Returns a set of trial graph config, as a serializable object.
        parameter_id : int
14129
def generate_parameters(self, parameter_id):
        
        if len(self.population) <= 0:
            logger.debug("the len of poplution lower than zero.")
            raise Exception('The population is empty')
        pos = -1
        for i in range(len(self.population)):
            if self.population[i].result == None:
                pos = i
                break
        if pos != -1:
            indiv = copy.deepcopy(self.population[pos])
            self.population.pop(pos)
            temp = json.loads(graph_dumps(indiv.config))
        else:
            random.shuffle(self.population)
            if self.population[0].result < self.population[1].result:
                self.population[0] = self.population[1]
            indiv = copy.deepcopy(self.population[0])
            self.population.pop(1)
            indiv.mutation()
            graph = indiv.config
            temp =  json.loads(graph_dumps(graph))
        logger.debug('generate_parameter return value is:')
        logger.debug(temp)
        return temp
1054575
def _config_from_url(self):
        
        config = {
            "name": self._blk.name,
            "options": {}
        }
        for key, value in six.iteritems(request.args):
            if isinstance(value, list) and len(value) == 1:
                config["options"][key] = value[0]
            else:
                config["options"][key] = value
        return config
368847
def get_parameters(self, graph=None):
        
        g = graph if graph is not None else self.tf_graph

        with g.as_default():
            with tf.Session() as self.tf_session:
                self.tf_saver.restore(self.tf_session, self.model_path)

                return {
                    'W': self.W.eval(),
                    'bh_': self.bh_.eval(),
                    'bv_': self.bv_.eval()
                }
817616
def get_params(self):
    

    if hasattr(self, 'params'):
      return list(self.params)

    # Catch eager execution and assert function overload.
    try:
      if tf.executing_eagerly():
        raise NotImplementedError("For Eager execution - get_params "
                                  "must be overridden.")
    except AttributeError:
      pass

    # For graph-based execution
    scope_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES,
                                   self.scope + "/")

    if len(scope_vars) == 0:
      self.make_params()
      scope_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES,
                                     self.scope + "/")
      assert len(scope_vars) > 0

    # Make sure no parameters have been added or removed
    if hasattr(self, "num_params"):
      if self.num_params != len(scope_vars):
        print("Scope: ", self.scope)
        print("Expected " + str(self.num_params) + " variables")
        print("Got " + str(len(scope_vars)))
        for var in scope_vars:
          print("\t" + str(var))
        assert False
    else:
      self.num_params = len(scope_vars)

    return scope_vars
294585
def configure_config(graph):
    
    ns = Namespace(
        subject=Config,
    )

    convention = ConfigDiscoveryConvention(
        graph,
    )
    convention.configure(ns, retrieve=tuple())
    return convention.config_discovery
317654
def to_dict(self):
        
        return dict((parameter.name, parameter.value) for parameter in self.values())
436442
def generate_parameters(self, parameter_id):
        
        self.count +=1
        if self.count>len(self.values)-1:
            raise nni.NoMoreTrialError('no more parameters now.')
        return self.values[self.count]
25307
def _generate_trials(self, experiment_spec, output_path=""):
        
        if "run" not in experiment_spec:
            raise TuneError("Must specify `run` in {}".format(experiment_spec))
        for _ in range(experiment_spec.get("num_samples", 1)):
            trial_id = Trial.generate_id()
            while True:
                suggested_config = self._suggest(trial_id)
                if suggested_config is None:
                    yield None
                else:
                    break
            spec = copy.deepcopy(experiment_spec)
            spec["config"] = merge_dicts(spec["config"], suggested_config)
            flattened_config = resolve_nested_dict(spec["config"])
            self._counter += 1
            tag = "{0}_{1}".format(
                str(self._counter), format_vars(flattened_config))
            yield create_trial_from_spec(
                spec,
                output_path,
                self._parser,
                experiment_tag=tag,
                trial_id=trial_id)
951320
def get_default_config_help(self):
        
        config = super(HostedGraphiteHandler, self).get_default_config_help()

        config.update({
            'apikey': 'Api key to use',
            'host': 'Hostname',
            'port': 'Port',
            'proto': 'udp or tcp',
            'timeout': '',
            'batch': 'How many to store before sending to the graphite server',
            'max_backlog_multiplier': 'how many batches to store before trimming',  # NOQA
            'trim_backlog_multiplier': 'Trim down how many batches',
        })

        return config
38269
def get_params(self, exp, cfgname='experiment.cfg'):
        
        cfgp = ConfigParser()
        cfgp.read(os.path.join(exp, cfgname))
        section = cfgp.sections()[0]
        params = self.items_to_params(cfgp.items(section))
        params['name'] = section
        return params
508224
def value_parameters(self):
        
        return it.chain(self.value_backbone.parameters(), self.critic_head.parameters())
520255
def iterate_pubmed_identifiers(graph) -> Iterable[str]:
    
    return (
        data[CITATION][CITATION_REFERENCE].strip()
        for _, _, data in graph.edges(data=True)
        if has_pubmed(data)
    )
432756
def params(self):
        
        params = {}
        params["access_token"] = self.access_token
        params["account_id"] = self.account_id
        return params
1158210
def write_config(params, config_path=None):
    
    if config_path is None:
        config_path = tempfile.mktemp(prefix="mongo-")

    cfg = params.copy()
    if 'setParameter' in cfg:
        set_parameters = cfg.pop('setParameter')
        try:
            for key, value in set_parameters.items():
                cfg['setParameter = ' + key] = value
        except AttributeError:
            reraise(RequestError,
                    'Not a valid value for setParameter: %r '
                    'Expected "setParameter": {<param name> : value, ...}'
                    % set_parameters)

    # fix boolean value
    for key, value in cfg.items():
        if isinstance(value, bool):
            cfg[key] = json.dumps(value)

    with open(config_path, 'w') as fd:
        data = '\n'.join('%s=%s' % (key, item) for key, item in cfg.items())
        fd.write(data)
    return config_path
436261
def passparameters(self):
        """"""
        paramdict = {}
        for parametergroup, params in self.parameters: #pylint: disable=unused-variable
            for parameter in params:
                if parameter.value:
                    if isinstance(parameter.value, list):
                        paramdict[parameter.id] = ",".join(parameter.value)
                    else:
                        paramdict[parameter.id] = parameter.value
        return paramdict
1329064
def _parameter_values(parameter_values_from_pillars, parameter_value_overrides):
    '''
    
    '''
    from_pillars = copy.deepcopy(__salt__['pillar.get'](parameter_values_from_pillars))
    from_pillars.update(parameter_value_overrides)
    parameter_values = _standardize(from_pillars)
    return _properties_from_dict(parameter_values, key_name='id')
567750
def get_ids(self, request_data, parameter_name='ids'):
        """"""
        if parameter_name not in request_data:
            raise ParseError("`{}` parameter is required".format(parameter_name))

        ids = request_data.get(parameter_name)
        if not isinstance(ids, list):
            raise ParseError("`{}` parameter not a list".format(parameter_name))

        if not ids:
            raise ParseError("`{}` parameter is empty".format(parameter_name))

        if any(map(lambda id: not isinstance(id, int), ids)):
            raise ParseError("`{}` parameter contains non-integers".format(parameter_name))

        return ids