Return the Spec for TemporalPoolerRegion.

    The parameters collection is constructed based on the parameters specified
    by the various components (poolerSpec and otherSpec)
434005
def getSpec(cls):
    
    spec = cls.getBaseSpec()
    p, o = _getAdditionalSpecs()
    spec["parameters"].update(p)
    spec["parameters"].update(o)

    return spec
698418
private static long getTimeStamp(ClassNode cls) {
        if (!(cls instanceof DecompiledClassNode)) {
            return Verifier.getTimestamp(cls.getTypeClass());
        }

        return ((DecompiledClassNode) cls).getCompilationTimeStamp();
    }
1041924
function GENERATE_PARAMS(spec) {
  return _.map(spec, function(paramSpec, paramName) {
    return paramName + ': ' + paramSpec.type;
  }).join(', ');
}
962451
def data_spec(cls, name):
        
        # If the provided "name" is actually a data item or parameter then
        # replace it with its name.
        if isinstance(name, BaseData):
            name = name.name
        try:
            return cls._data_specs[name]
        except KeyError:
            raise ArcanaNameError(
                name,
                "No fileset spec named '{}' in {}, available:\n{}"
                .format(name, cls.__name__,
                        "\n".join(list(cls._data_specs.keys()))))
349072
def getSpec(cls):
    """"""
    spec = {
      "description":"Sensor for sending sparse data to an HTM network.",
      "singleNodeOnly":True,
      "outputs":{
        "dataOut":{
          "description":"Encoded text",
          "dataType":"Real32",
          "count":0,
          "regionLevel":True,
          "isDefaultOutput":True,
          },
        "resetOut":{
          "description":"Boolean reset output.",
          "dataType":"Real32",
          "count":1,
          "regionLevel":True,
          "isDefaultOutput":False,
          },
        "sequenceIdOut":{
          "description":"Sequence ID",
          "dataType":'Real32',
          "count":1,
          "regionLevel":True,
          "isDefaultOutput":False,
        },
      },
      "inputs":{},
      "parameters":{
        "verbosity":{
          "description":"Verbosity level",
          "dataType":"UInt32",
          "accessMode":"ReadWrite",
          "count":1,
          "constraints":"",
        },
        "outputWidth":{
          "description":"Size of output vector",
          "dataType":"UInt32",
          "accessMode":"ReadWrite",
          "count":1,
          "defaultValue": 2048,
          "constraints":"",
        },
      },
      "commands":{
        "addDataToQueue": {
          "description": "Add data",
        }
      },
    }

    return spec
840706
def example_reading_spec(self):
    """"""

    # Subclasses can override and/or extend.

    processed_reward_type = tf.float32
    if self.is_processed_rewards_discrete:
      processed_reward_type = tf.int64

    data_fields = {
        TIMESTEP_FIELD: tf.FixedLenFeature((1,), tf.int64),
        RAW_REWARD_FIELD: tf.FixedLenFeature((1,), tf.float32),
        PROCESSED_REWARD_FIELD: tf.FixedLenFeature((1,), processed_reward_type),
        DONE_FIELD: tf.FixedLenFeature((1,), tf.int64),  # we wrote this as int.

        # Special treatment because we need to determine type and shape, also
        # enables classes to override.
        OBSERVATION_FIELD: self.observation_spec,
        ACTION_FIELD: self.action_spec,
    }

    data_items_to_decoders = {
        field: tf.contrib.slim.tfexample_decoder.Tensor(field)
        for field in data_fields
    }

    return data_fields, data_items_to_decoders
882299
def _is_temporal_problem(exception):
    
    try:
        return isinstance(exception, (requests.ConnectionError, requests.Timeout))
    except AttributeError:  # Earlier requests versions might not have requests.Timeout
        return isinstance(exception, requests.ConnectionError)
951326
function getE2eSpecsFor(basePath, specFile, filter) {
  // Only get spec file at the example root.
  const e2eSpecGlob = `${filter ? `*${filter}*` : '*'}/${specFile}`;
  return globby(e2eSpecGlob, { cwd: basePath, nodir: true })
    .then(paths => paths
      .filter(file => !IGNORED_EXAMPLES.some(ignored => file.startsWith(ignored)))
      .map(file => path.join(basePath, file))
    );
}
154855
private static TemporalUnit defaultUnitFor(Temporal temporal) {
        return DEFAULT_UNITS.entrySet()
                .stream()
                .filter(e -> e.getKey().isAssignableFrom(temporal.getClass()))
                .findFirst()
                .map(Map.Entry::getValue)
                .orElse(ChronoUnit.SECONDS);
    }
535824
public GenericObjectPool.Config getObjectPoolConfig()
    {
        GenericObjectPool.Config conf = new GenericObjectPool.Config();
        conf.maxActive = getMaxActive();
        conf.maxIdle = getMaxIdle();
        conf.minIdle = getMinIdle();
        conf.maxWait = getMaxWait();
        conf.minEvictableIdleTimeMillis = getMinEvictableIdleTimeMillis();
        conf.numTestsPerEvictionRun = getNumTestsPerEvictionRun();
        conf.testOnBorrow = isTestOnBorrow();
        conf.testOnReturn = isTestOnReturn();
        conf.testWhileIdle = isTestWhileIdle();
        conf.timeBetweenEvictionRunsMillis = getTimeBetweenEvictionRunsMillis();
        conf.whenExhaustedAction = getWhenExhaustedAction();
        return conf;
    }
167649
def check_specs(specs, renamings, types):
    '''
    
    '''
    from pythran.types.tog import unify, clone, tr
    from pythran.types.tog import Function, TypeVariable, InferenceError

    functions = {renamings.get(k, k): v for k, v in specs.functions.items()}
    for fname, signatures in functions.items():
        ftype = types[fname]
        for signature in signatures:
            sig_type = Function([tr(p) for p in signature], TypeVariable())
            try:
                unify(clone(sig_type), clone(ftype))
            except InferenceError:
                raise PythranSyntaxError(
                    "Specification for `{}` does not match inferred type:\n"
                    "expected `{}`\n"
                    "got `Callable[[{}], ...]`".format(
                        fname,
                        ftype,
                        ", ".join(map(str, sig_type.types[:-1])))
                )
59437
def cache_spec(name, spec):
    
    return cache.set(build_cache_name(name), spec, app_settings.ESI_SPEC_CACHE_DURATION)
721376
def specification(cls, *context_specs):
		
		import_data = []
		for name in context_specs:
			import_data.append((name, None))
		return cls.import_context(import_data)
1048737
function parameters (spec) {
  var defs = {}
  var envs = {}

  return function (params) {
    init(spec, defs, envs)
    var opts = cat(defs, envs, params)
    var errs = []

    def(opts, spec, errs)
    req(opts, spec, errs)
    val(opts, spec, errs)

    return {
      error: errs.length ? errs[0] : null,
      errors: errs,
      params: opts
    }
  }
}
1257009
def timestamp(instance):
    
    ts_re = re.compile(r"^[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?Z$")
    timestamp_props = ['created', 'modified']
    if instance['type'] in enums.TIMESTAMP_PROPERTIES:
        timestamp_props += enums.TIMESTAMP_PROPERTIES[instance['type']]

    for tprop in timestamp_props:
        if tprop in instance and ts_re.match(instance[tprop]):
            # Don't raise an error if schemas will catch it
            try:
                parser.parse(instance[tprop])
            except ValueError as e:
                yield JSONError("'%s': '%s' is not a valid timestamp: %s"
                                % (tprop, instance[tprop], str(e)), instance['id'])

    if has_cyber_observable_data(instance):
        for key, obj in instance['objects'].items():
            if 'type' not in obj:
                continue
            if obj['type'] in enums.TIMESTAMP_OBSERVABLE_PROPERTIES:
                for tprop in enums.TIMESTAMP_OBSERVABLE_PROPERTIES[obj['type']]:
                    if tprop in obj and ts_re.match(obj[tprop]):
                        # Don't raise an error if schemas will catch it
                        try:
                            parser.parse(obj[tprop])
                        except ValueError as e:
                            yield JSONError("'%s': '%s': '%s' is not a valid timestamp: %s"
                                            % (obj['type'], tprop, obj[tprop], str(e)), instance['id'])
            if obj['type'] in enums.TIMESTAMP_EMBEDDED_PROPERTIES:
                for embed in enums.TIMESTAMP_EMBEDDED_PROPERTIES[obj['type']]:
                    if embed in obj:
                        for tprop in enums.TIMESTAMP_EMBEDDED_PROPERTIES[obj['type']][embed]:
                            if embed == 'extensions':
                                for ext in obj[embed]:
                                    if tprop in obj[embed][ext] and ts_re.match(obj[embed][ext][tprop]):
                                        try:
                                            parser.parse(obj[embed][ext][tprop])
                                        except ValueError as e:
                                            yield JSONError("'%s': '%s': '%s': '%s' is not a valid timestamp: %s"
                                                            % (obj['type'], ext, tprop, obj[embed][ext][tprop], str(e)), instance['id'])
                            elif tprop in obj[embed] and ts_re.match(obj[embed][tprop]):
                                try:
                                    parser.parse(obj[embed][tprop])
                                except ValueError as e:
                                    yield JSONError("'%s': '%s': '%s' is not a valid timestamp: %s"
                                                    % (obj['type'], tprop, obj[embed][tprop], str(e)), instance['id'])
720831
def get_template_request_spec(spec):
        
        dst = CreateUO.get_default_template()
        src = None
        if isinstance(spec, Configuration):
            src = spec.create_tpl
        elif isinstance(spec, dict):
            src = spec
        else:
            raise ValueError('Unrecognized spec type')

        if spec is not None:
            dst = EBUtils.merge(dst, src)

        return dst
1247348
def _get(self, name, interval, config, timestamp, **kws):
    '''
    
    '''
    i_bucket = config['i_calc'].to_bucket(timestamp)
    fetch = kws.get('fetch')
    process_row = kws.get('process_row') or self._process_row

    rval = OrderedDict()
    query = {'name':name, 'interval':i_bucket}
    if config['coarse']:
      if fetch:
        record = fetch( self._client[interval], spec=query, method='find_one' )
      else:
        record = self._client[interval].find_one( query )

      if record:
        data = process_row( self._unescape(record['value']) )
        rval[ config['i_calc'].from_bucket(i_bucket) ] = data
      else:
        rval[ config['i_calc'].from_bucket(i_bucket) ] = self._type_no_value()
    else:
      sort = [('interval', ASCENDING), ('resolution', ASCENDING) ]
      if fetch:
        cursor = fetch( self._client[interval], spec=query, sort=sort, method='find' )
      else:
        cursor = self._client[interval].find( spec=query, sort=sort )

      idx = 0
      for record in cursor:
        rval[ config['r_calc'].from_bucket(record['resolution']) ] = \
          process_row(record['value'])

    return rval