Helper function to construct the method response params, models, and integration_params
        values needed to configure method response integration/mappings.
163769
def _parse_method_response(self, method_name, method_response, httpStatus):
        '''
        
        '''
        method_response_models = {}
        method_response_pattern = '.*'
        if method_response.schema:
            method_response_models['application/json'] = method_response.schema
            method_response_pattern = self._get_pattern_for_schema(method_response.schema, httpStatus)

        method_response_params = {}
        method_integration_response_params = {}
        for header in method_response.headers:
            response_header = 'method.response.header.{0}'.format(header)
            method_response_params[response_header] = False
            header_data = method_response.headers.get(header)
            method_integration_response_params[response_header] = (
                "'{0}'".format(header_data.get('default')) if 'default' in header_data else "'*'")

        response_templates = self._get_response_template(method_name, httpStatus)

        return {'params': method_response_params,
                'models': method_response_models,
                'integration_params': method_integration_response_params,
                'pattern': method_response_pattern,
                'response_templates': response_templates}
76885
def build_params(self, params={}):
        
        z = params.copy()
        z.update({'editId': self.edit_id, 'packageName': self.package_name})
        return z
490164
def _build_params(self):
        
        d = OrderedDict()
        d['purpose_codes'] = 'ADULT'
        d['queryDate'] = self._valid_date
        d['from_station'] = self._from_station_telecode
        d['to_station'] = self._to_station_telecode
        return d
568926
def add_integration_response(self):
        """"""
        self.client.put_integration_response(
            restApiId=self.api_id,
            resourceId=self.resource_id,
            httpMethod=self.trigger_settings['method'],
            statusCode='200',
            responseTemplates={'application/json': ''})
114459
function provideAppMethods(model, methodsProto) {
  /*jshint immed:false */
  var key, method,
      cname = inflect.camelize(model.context),
      scname = inflect.singularize(cname),
      Application = app.constructor;
      
  var pluralize = /^(get|find|delete|destroy)$/
      
  for (key in methodsProto) {
    var suffix = (key.slice(-3) === 'All') ? cname : scname;
    method = key + suffix;
    (function(model, key, method) {
      app.model[method] = function() {
        model[key].apply(model, arguments);
      }
      if (pluralize.test(key)) {
        app.model[key + inflect.pluralize(suffix)] = app.model[method];
      }
    }).call(this, model, key, method);
  }
}
1012805
def prepare_source(model_class, source)
      source = source.attributes if source.is_a? model_class

      if source.is_a?(Hash) && model_class.respond_to?(:adjusted_api_attributes)
        source = model_class.adjusted_api_attributes source
      end

      source
    end
1186906
def build_request(method, query_params={})
      query   = { token: token }.merge(query_params)
      request = { query: query, method: method, headers: {}, mock: @test_mode }

      if Diffbot.instrumentor
        request.update(
          instrumentor: Diffbot.instrumentor,
          instrumentor_name: "diffbot"
        )
      end

      request
    end
742969
function buildParams(msg, method, config, params) {
    var p = buildWorkspaceParams(msg, method, config, params)
      .then(function(){
        return buildIntentParams(msg, method, config, params);
      })
      .then(function(){
        return buildExampleParams(msg, method, config, params);
      })
      .then(function(){
        return buildEntityParams(msg, method, config, params);
      })
      .then(function(){
        return buildEntityValueParams(msg, method, config, params);
      })
      .then(function(){
        return buildDialogParams(msg, method, config, params);
      })
      .then(function(){
        return buildExportParams(method, config, params);
      });

    return p;
  }
1267129
def _set_params_callback(self, **params):
        """"""
        # model after sklearn.utils._BaseCompostion._set_params
        # 1. All steps
        if 'callbacks' in params:
            setattr(self, 'callbacks', params.pop('callbacks'))

        # 2. Step replacement
        names, _ = zip(*getattr(self, 'callbacks_'))
        for key in params.copy():
            name = key[11:]  # drop 'callbacks__'
            if '__' not in name and name in names:
                self._replace_callback(name, params.pop(key))

        # 3. Step parameters and other initilisation arguments
        for key in params.copy():
            name = key[11:]
            part0, part1 = name.split('__')
            kwarg = {part1: params.pop(key)}
            callback = dict(self.callbacks_).get(part0)
            if callback is not None:
                callback.set_params(**kwarg)
            else:
                raise ValueError(
                    "Trying to set a parameter for callback {} "
                    "which does not exist.".format(part0))

        return self
1317989
def _resolve_view_params(self, request, defaults, *args, **kwargs):
        
        params = copy.copy(defaults)
        params.update(self.params)
        params.update(kwargs)
        resolved_params = {}
        
        extra_context = {}
        for key in params:
            # grab from provided params. 
            value = params[key]
            
            # otherwise grab from existing params
            if value == None:
                value = self.params[key] if self.params.has_key(key) else None
            
            # otherwise grab from class method
            if value == None:
                value = getattr(self, 'get_%s' % key)(request, *args, **kwargs) if getattr(self, 'get_%s' % key, None) else None

            if key in defaults:
                resolved_params[key] = value
            else:
                extra_context[key] = value
        
        if extra_context:
            try:
                resolved_params['extra_context'].update(extra_context)
            except AttributeError:
                resolved_params['extra_context'] = extra_context

        return resolved_params
896664
function setupMethods(classDef, methodsIn) {
  const methods = classDef.methods;
  Object.keys(methodsIn).forEach((methodName) => {
    if (!methods[methodName]) methods[methodName] = {};
    const methodDef = methods[methodName];
    const methodInDef = methodsIn[methodName];
    if (!methodDef.methodsBefore) {
      methodDef.methodsBefore = [];
      methodDef.methodLast = [];
      methodDef.methodsAfter = [];
      methodDef.methodsMiddle = [];
      methodDef.conditional = [];
    }

    if (typeof methodInDef === 'function') {
      methodDef.methodsMiddle.push(methodInDef);
    } else if (methodInDef.mode === registerComponent.MODES.BEFORE) {
      methodDef.methodsBefore.push(methodInDef.value);
    } else if (methodInDef.mode === registerComponent.MODES.AFTER) {
      methodDef.methodsAfter.push(methodInDef.value);
    } else if (methodInDef.mode === registerComponent.MODES.OVERWRITE) {
      methodDef.lock = methodInDef.value;
    } else if (methodInDef.mode === registerComponent.MODES.DEFAULT || methodInDef.value && !methodInDef.mode) {
      methodDef.methodsMiddle.push(methodInDef.value);
    } else if (methodInDef.mode === registerComponent.MODES.LAST) {
      methodDef.methodLast.push(methodInDef.value);
    }
    if (methodInDef.conditional) methodDef.conditional.push(methodInDef.conditional);
  });
}
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')
206388
def _preprocess_params(cls, kwargs):
        
        # kwargs.pop('csrf_token', None)
        for attr, val in kwargs.items():
            if cls.is_the_primary_key(attr) and cls._prevent_primary_key_initialization_:
                del kwargs[attr]
                continue
            if val == "":
                # Making an assumption that there is no good usecase
                # for setting an empty string. This will help prevent
                # cases where empty string is sent because of client
                # not clearing form fields to null
                kwargs[attr] = None
                continue
            if attr in class_mapper(cls).relationships and attr not in cls._no_overwrite_:
                rel = class_mapper(cls).relationships[attr]
                if rel.uselist:
                    if isinstance(val, list):
                        if all(isinstance(v, dict) for v in val):
                            rel_cls = cls.mapped_rel_class(attr)
                            kwargs[attr] = rel_cls.update_or_new_all(
                                list_of_kwargs=val, keys=[rel_cls.primary_key_name()])
                    elif isinstance(val, dict):
                        rel_cls = cls.mapped_rel_class(attr)
                        mapping_col = rel.collection_class().keyfunc.name
                        list_of_kwargs = [merge(v, {mapping_col: k}) for k, v in val.items()]
                        kwargs[attr] = {getattr(obj, mapping_col): obj for obj in rel_cls.update_or_new_all(
                            list_of_kwargs=list_of_kwargs, keys=[rel_cls.primary_key_name()])}
                elif isinstance(val, dict):
                    rel_cls = cls.mapped_rel_class(attr)
                    kwargs[attr] = rel_cls.update_or_new(
                        **merge(val, {'keys': [rel_cls.primary_key_name()]}))
        return kwargs
1083129
public ApiResponse buildParamsDescription() {
		ApiResponseList configParams = new ApiResponseList("methodConfigParams");
		for (String param : this.getMandatoryParamNames())
			configParams.addItem(buildParamMap(param, true));
		for (String param : this.getOptionalParamNames())
			configParams.addItem(buildParamMap(param, false));
		return configParams;
	}
1347346
def build(self, builder):
        
        params = {}

        if self.value is not None:
            params['Value'] = str(self.value)

        if self.query_repeat_key is not None:
            params['QueryRepeatKey'] = str(self.query_repeat_key)

        if self.recipient is not None:
            params['Recipient'] = str(self.recipient)

        if self.status is not None:
            params['Status'] = self.status.value

        if self.requires_response is not None:
            params['RequiresResponse'] = bool_to_yes_no(self.requires_response)

        # When closing a query
        if self.response is not None:
            params['Response'] = str(self.response)

        builder.start("mdsol:Query", params)
        builder.end("mdsol:Query")
967862
def _setup_parameters(self):
        
        # facet
        self.facet.set(
            layout=self.layout,
            theme=self.theme,
            coordinates=self.coordinates,
            figure=self.figure,
            axs=self.axs
        )

        # layout
        self.layout.axs = self.axs
        # theme
        self.theme.figure = self.figure
234263
function EntityMethods(models) {
      this.models = models;
      this.getByNameOrId = __bind(this.getByNameOrId, this);
      this.getByName = __bind(this.getByName, this);
      this.get = __bind(this.get, this);
      if (!this.models) {
        throw new Error("models parameter is required");
      }
    }