code: def validate_frameworkcontroller_trial_config(
      self, experiment_config
  ):
      if (
          experiment_config.get("trainingServicePlatform")
          == "frameworkcontroller"
      ):
          if not experiment_config.get("trial").get("taskRoles"):
              if not experiment_config.get(
                  "frameworkcontrollerConfig"
              ).get("configPath"):
                  raise SchemaError(
                      """If no taskRoles are specified a valid custom frameworkcontroller config should
                                           be set using the configPath attribute in frameworkcontrollerConfig!"""
                  )
              config_content = get_yml_content(
                  experiment_config.get(
                      "frameworkcontrollerConfig"
                  ).get("configPath")
              )
              if not config_content.get("spec").get(
                  "taskRoles"
              ) or not config_content.get("spec").get("taskRoles"):
                  raise SchemaError(
                      "Invalid frameworkcontroller config! No taskRoles were specified!"
                  )
              if (
                  not config_content.get("spec")
                  .get("taskRoles")[0]
                  .get("task")
              ):
                  raise SchemaError(
                      "Invalid frameworkcontroller config! No task was specified for taskRole!"
                  )
              names = []
              for taskRole in config_content.get("spec").get(
                  "taskRoles"
              ):
                  if not "name" in taskRole:
                      raise SchemaError(
                          "Invalid frameworkcontroller config! Name is missing for taskRole!"
                      )
                  names.append(taskRole.get("name"))
              if len(names) > len(set(names)):
                  raise SchemaError(
                      "Invalid frameworkcontroller config! Duplicate taskrole names!"
                  )
              if not config_content.get("metadata").get("name"):
                  raise SchemaError(
                      "Invalid frameworkcontroller config! No experiment name was specified!"
                  )
  
imports: import json
  import os
  from schema import And, Optional, Or, Regex, Schema, SchemaError
  from nni.tools.package_utils.tuner_factory import create_validator_instance
  from .common_utils import get_yml_content, print_warning
  from .constants import SCHEMA_PATH_ERROR, SCHEMA_RANGE_ERROR, SCHEMA_TYPE_ERROR
label_desc: Use image node_id 10 for calling the NNIConfigSchema obj's underlying member method code with example usage: obj.validate_frameworkcontroller_trial_config(experiment_config) without return types