Given a set of keyword literals, promote to the appropriate
    parameter type based on some simple heuristics.
554787
def guess_param_types(**kwargs):
    
    params = {}
    for k, v in kwargs.items():
        kws = dict(default=v, constant=True)
        if isinstance(v, Parameter):
            params[k] = v
        elif isinstance(v, dt_types):
            params[k] = Date(**kws)
        elif isinstance(v, bool):
            params[k] = Boolean(**kws)
        elif isinstance(v, int):
            params[k] = Integer(**kws)
        elif isinstance(v, float):
            params[k] = Number(**kws)
        elif isinstance(v, str):
            params[k] = String(**kws)
        elif isinstance(v, dict):
            params[k] = Dict(**kws)
        elif isinstance(v, tuple):
            if all(_is_number(el) for el in v):
                params[k] = NumericTuple(**kws)
            elif all(isinstance(el. dt_types) for el in v) and len(v)==2:
                params[k] = DateRange(**kws)
            else:
                params[k] = Tuple(**kws)
        elif isinstance(v, list):
            params[k] = List(**kws)
        elif isinstance(v, np.ndarray):
            params[k] = Array(**kws)
        else:
            from pandas import DataFrame as pdDFrame
            from pandas import Series as pdSeries

            if isinstance(v, pdDFrame):
                params[k] = DataFrame(**kws)
            elif isinstance(v, pdSeries):
                params[k] = Series(**kws)
            else:
                params[k] = Parameter(**kws)

    return params
1347419
function run(keywordsToRun, keywordsDefined, passedArguments) {
        var vars = helpers.createLocalEnv(passedArguments);
        keywordsToRun = helpers.createKeywords(keywordsToRun);

        return {
            then: function(callback) {
                runKeywords(keywordsToRun, keywordsDefined, vars, callback);
            }
        };
    }
991868
def _build_search_values(self, kwargs):
        
        criteria = {}
        for key in self._search_by:
            if getattr(self, key, None):
                criteria[key] = getattr(self, key)
            elif key in kwargs and kwargs.get(key):
                criteria[key] = kwargs.get(key)
        return criteria
1280500
public void setParaphrasesValue( DroolsParaphraseTypes type,
                                     String value ) {
        paraphrases.peek().put( type,
                                value );
    }
751012
@Override
    public KeywordLiteral setType(int nodeType) {
        if (!(nodeType == Token.THIS
              || nodeType == Token.NULL
              || nodeType == Token.TRUE
              || nodeType == Token.FALSE
              || nodeType == Token.DEBUGGER))
            throw new IllegalArgumentException("Invalid node type: "
                                               + nodeType);
        type = nodeType;
        return this;
    }
451646
function keywordMatch(mode, keywords) {
    var keyword = keywords[0]

    if (language[keyInsensitive]) {
      keyword = keyword.toLowerCase()
    }

    return own.call(mode.keywords, keyword) && mode.keywords[keyword]
  }
672080
def add_parameters(parser):
    """"""
    group = parser.add_argument_group('Evaluation arguments')

    group.add_argument('--eval-batch-size', type=int, default=1024)

    # Datasets
    group.add_argument(
        '--similarity-datasets', type=str,
        default=nlp.data.word_embedding_evaluation.word_similarity_datasets,
        nargs='*',
        help='Word similarity datasets to use for intrinsic evaluation.')
    group.add_argument(
        '--similarity-functions', type=str,
        default=nlp.embedding.evaluation.list_evaluation_functions(
            'similarity'), nargs='+',
        help='Word similarity functions to use for intrinsic evaluation.')
    group.add_argument(
        '--analogy-datasets', type=str, default=['GoogleAnalogyTestSet'],
        nargs='*',
        help='Word similarity datasets to use for intrinsic evaluation.')
    group.add_argument(
        '--analogy-functions', type=str,
        default=nlp.embedding.evaluation.list_evaluation_functions('analogy'),
        nargs='+',
        help='Word analogy functions to use for intrinsic evaluation. ')

    ## Analogy evaluation specific arguments
    group.add_argument(
        '--analogy-dont-exclude-question-words', action='store_true',
        help=('Exclude input words from valid output analogies.'
              'The performance of word embeddings on the analogy task '
              'is around 0% accuracy if input words are not excluded.'))
1150180
def _kw(keywords):
    """"""
    r = {}
    for k, v in keywords:
        r[k] = v
    return r
1055329
private static void addKeyword(String text, int type) {
        KEYWORDS.add(text);
        addTranslation(text, type);
    }
540785
private void addClause(final Collection<Literal> literals) {
        for (final Literal lit : literals) {
            Integer index = this.name2idx.get(lit.variable().name());
            if (index == null) {
                index = this.name2idx.size() + 1;
                this.name2idx.put(lit.variable().name(), index);
                this.idx2name.put(index, lit.variable().name());
            }
            this.solver.addlit(lit.phase() ? index : -index);
        }
        this.solver.addlit(CLAUSE_TERMINATOR);
    }
1030437
def append_ISO19115_keywords(keywords):
    
    # Map setting's key and metadata key
    ISO19115_mapping = {
        'ISO19115_ORGANIZATION': 'organisation',
        'ISO19115_URL': 'url',
        'ISO19115_EMAIL': 'email',
        'ISO19115_LICENSE': 'license'
    }
    ISO19115_keywords = {}
    # Getting value from setting.
    for key, value in list(ISO19115_mapping.items()):
        ISO19115_keywords[value] = setting(key, expected_type=str)
    keywords.update(ISO19115_keywords)
253241
def set_keywords(self, keywords):
        
        self._query_params += str(QueryParam.KEYWORDS) + '+'.join(keywords)
62598
def apply_customizations(cls, spec, options):
        
        for key in sorted(spec.keys()):
            if isinstance(spec[key], (list, tuple)):
                customization = {v.key:v for v in spec[key]}
            else:
                customization = {k:(Options(**v) if isinstance(v, dict) else v)
                                 for k,v in spec[key].items()}

            # Set the Keywords target on Options from the {type} part of the key.
            customization = {k:v.keywords_target(key.split('.')[0])
                             for k,v in customization.items()}
            options[str(key)] = customization
        return options
125303
def _normalize_data_types(self, strategy):
        '''  '''
        for k, v in strategy.iteritems():
            if not isinstance(v, str):
                # There is probably nothing to do
                continue
            if v == 'true':
                strategy[k] = True
            elif v == 'false' or v is None:
                strategy[k] = False
            else:
                try:
                    if v.find('.') > 0:
                        strategy[k] = float(v)
                    else:
                        strategy[k] = int(v)
                except ValueError:
                    pass
1122256
def _validate_params_types(self, method, params):
        
        if isinstance(params, list):
            if not isinstance(self.method_data[method]['types'], list):
                raise InvalidParamsError(
                    'expected keyword params, not positional')

            for param, type, posnum in zip(params,
                                           self.method_data[method]['types'],
                                           range(1, len(params)+1)):
                if not (isinstance(param, type) or param is None):
                    raise InvalidParamsError(
                        'positional arg #{} is the wrong type'.format(posnum))

        elif isinstance(params, dict):
            if not isinstance(self.method_data[method]['types'], dict):
                raise InvalidParamsError(
                    'expected positional params, not keyword')

            if 'required' in self.method_data[method]:
                for key in self.method_data[method]['required']:
                    if key not in params:
                        raise InvalidParamsError('missing key: %s' % key)

            for key in params.keys():
                if key not in self.method_data[method]['types'] or \
                    not (isinstance(params[key],
                                    self.method_data[method]['types'][key])
                         or params[key] is None):
                    raise InvalidParamsError(
                        'arg "{}" is the wrong type'.format(key))
765958
private static void populateTypeArgs(ParameterizedType type, Map<TypeVariable<?>, Type> map, boolean depthFirst) {
    if (type.getRawType() instanceof Class) {
      TypeVariable<?>[] typeVariables = ((Class<?>) type.getRawType()).getTypeParameters();
      Type[] typeArguments = type.getActualTypeArguments();

      if (type.getOwnerType() != null) {
        Type owner = type.getOwnerType();
        if (owner instanceof ParameterizedType)
          populateTypeArgs((ParameterizedType) owner, map, depthFirst);
      }

      for (int i = 0; i < typeArguments.length; i++) {
        TypeVariable<?> variable = typeVariables[i];
        Type typeArgument = typeArguments[i];

        if (typeArgument instanceof Class) {
          map.put(variable, typeArgument);
        } else if (typeArgument instanceof GenericArrayType) {
          map.put(variable, typeArgument);
        } else if (typeArgument instanceof ParameterizedType) {
          map.put(variable, typeArgument);
        } else if (typeArgument instanceof TypeVariable) {
          TypeVariable<?> typeVariableArgument = (TypeVariable<?>) typeArgument;
          if (depthFirst) {
            Type existingType = map.get(variable);
            if (existingType != null) {
              map.put(typeVariableArgument, existingType);
              continue;
            }
          }

          Type resolvedType = map.get(typeVariableArgument);
          if (resolvedType == null)
            resolvedType = resolveBound(typeVariableArgument);
          map.put(variable, resolvedType);
        }
      }
    }
  }
420858
def _create_and_add_parameters(params):
    '''
    
    '''
    global _current_parameter
    if _is_simple_type(params):
        _current_parameter = SimpleParameter(params)
        _current_option.add_parameter(_current_parameter)
    else:
        # must be a list
        for i in params:
            if _is_simple_type(i):
                _current_parameter = SimpleParameter(i)
            else:
                _current_parameter = TypedParameter()
                _parse_typed_parameter(i)
            _current_option.add_parameter(_current_parameter)