Return base spec for this region. See base class method for more info.
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
660224
def find_spec(self, fullname, path, target=None):
        ''''''
        if not path:
            path = [os.getcwd()]
        if "." in fullname:
            name = fullname.split(".")[-1]
        else:
            name = fullname
        for entry in path:
            if os.path.isdir(os.path.join(entry, name)):
                # this module has child modules
                filename = os.path.join(entry, name, "__init__.py")
                submodule_locations = [os.path.join(entry, name)]
            else:
                filename = os.path.join(entry, name + ".py")
                submodule_locations = None
            if not os.path.exists(filename):
                continue

            return spec_from_file_location(fullname, filename,
                                           loader=MyLoader(filename),
                                           submodule_search_locations=submodule_locations)
        return None
823264
def find_spec(self, fullname, path, target=None):
        
        if fullname.startswith(self.package_prefix):
            for path in self._get_paths(fullname):
                if os.path.exists(path):
                    return ModuleSpec(
                        name=fullname,
                        loader=self.loader_class(fullname, path),
                        origin=path,
                        is_package=(path.endswith('__init__.ipynb') or path.endswith('__init__.py')),
                    )
703375
def _get_requested_spec(self, obj, spec_name):
        """"""
        requested = self._specs_in[spec_name]
        if isinstance(requested, str):
            return _get_attr_by_tag(obj, requested, spec_name)
        else:
            return requested
177176
function () {
            var spec = this.__spec;
            if (arguments.length === 0)
                return spec;
            else if (arguments.length === 1 && typeof arguments[0] === "string")
                return spec[arguments[0]];
            else {
                for (var i = 0; i < arguments.length; i++) {
                    if (typeof arguments[i] === "string") {
                        spec[arguments[i]] = arguments[i + 1];
                        i++;
                    }
                    else if (typeof arguments[i] === "object") {
                        for (var key in arguments[i])
                            if (_cs.isown(arguments[i], key))
                                spec[key] = arguments[i][key];
                    }
                }
            }
            return undefined;
        }
128436
def find_base_generic(type_):
    
    for t in type_.__mro__:
        if t.__module__ == typing.__name__:
            return first_origin(t)
178552
def base(self, du):
        """"""
        parameter = 'base'
        if parameter not in self._by:
            self._by[parameter] = {}
            for clb in self.upi.values():
                if clb.floor == 0:
                    self._by[parameter][clb.du] = clb
        return self._by[parameter][du]
678471
def get_specification(self):
        
        resp = self._call('getApplicationSpec', proto.Empty())
        return ApplicationSpec.from_protobuf(resp)
530540
def base_fields(self):
        ''''''
        if self.extensions_start is None:
            return len(self.fields)
        return len(self.fields[:self.extensions_start])
176681
def _get_specifications(specifications):
    
    if not specifications or specifications is object:
        raise ValueError("No specifications given")
    elif inspect.isclass(specifications):
        if Provides.USE_MODULE_QUALNAME:
            if sys.version_info < (3, 3, 0):
                raise ValueError(
                    "Qualified name capability requires Python 3.3+"
                )

            # Get the name of the class
            if not specifications.__module__:
                return [specifications.__qualname__]

            return [
                "{0}.{1}".format(
                    specifications.__module__, specifications.__qualname__
                )
            ]
        else:
            # Legacy behavior
            return [specifications.__name__]
    elif is_string(specifications):
        # Specification name
        specifications = specifications.strip()
        if not specifications:
            raise ValueError("Empty specification given")
        return [specifications]
    elif isinstance(specifications, (list, tuple)):
        # List given: normalize its content
        results = []
        for specification in specifications:
            results.extend(_get_specifications(specification))
        return results
    else:
        raise ValueError(
            "Unhandled specifications type : {0}".format(
                type(specifications).__name__
            )
        )
49613
def as_base_types(self):
    """"""
    if not self._cached:
      # Create the single cache file the first time this is called.
      self._cached = {
          'name': self.name,
          'outcome': self.outcome.name,
      }
      if self.validators:
        self._cached['validators'] = data.convert_to_base_types(
            tuple(str(v) for v in self.validators))
      if self.dimensions:
        self._cached['dimensions'] = data.convert_to_base_types(self.dimensions)
      if self.units:
        self._cached['units'] = data.convert_to_base_types(self.units)
      if self.docstring:
        self._cached['docstring'] = self.docstring
    if self.measured_value.is_value_set:
      self._cached['measured_value'] = self.measured_value.basetype_value()
    return self._cached
210657
def get_kernel_spec(self, kernel_name):
        
        if kernel_name == CURRENT_ENV_KERNEL_NAME:
            return self.kernel_spec_class(
                resource_dir=ipykernel.kernelspec.RESOURCES,
                **ipykernel.kernelspec.get_kernel_dict())
        else:
            return super(NbvalKernelspecManager, self).get_kernel_spec(kernel_name)
726006
def min_base_quality(self):
        '''
        
        '''
        try:
            return min(self.base_qualities)
        except ValueError:
            # We are mid-deletion. We return the minimum of the adjacent bases.
            assert self.offset_start == self.offset_end
            adjacent_qualities = [
                self.alignment.query_qualities[offset]
                for offset in [self.offset_start - 1, self.offset_start]
                if 0 <= offset < len(self.alignment.query_qualities)
            ]
            return min(adjacent_qualities)
785720
def find_specs(self, directory):
        
        specs = []
        spec_files = self.file_finder.find(directory)
        for spec_file in spec_files:
            specs.extend(self.spec_finder.find(spec_file.module))
        return specs
1138339
def _get_spec(cls, fullname, path, target=None):
        """"""
        # If this ends up being a namespace package, namespace_path is
        #  the list of paths that will become its __path__
        namespace_path = []
        for entry in path:
            if not isinstance(entry, (str, bytes)):
                continue
            finder = cls._path_importer_cache(entry)
            if finder is not None:
                if hasattr(finder, 'find_spec'):
                    spec = finder.find_spec(fullname, target)
                else:
                    spec = cls._legacy_get_spec(fullname, finder)
                if spec is None:
                    continue
                if spec.loader is not None:
                    return spec
                portions = spec.submodule_search_locations
                if portions is None:
                    raise ImportError('spec missing loader')
                # This is possibly part of a namespace package.
                #  Remember these path entries (if any) for when we
                #  create a namespace package, and continue iterating
                #  on path.
                namespace_path.extend(portions)
        else:
            spec = ModuleSpec(fullname, None)
            spec.submodule_search_locations = namespace_path
            return spec
342179
def cpp_spec():
    """"""
    return {
        INDENTATION    : '\t',
        BEG_BLOCK      : '{',
        END_BLOCK      : '}',
        BEG_LINE       : '',
        END_LINE       : '\n',
        BEG_ACTION     : '',
        END_ACTION     : ';',
        BEG_CONDITION  : 'if(',
        END_CONDITION  : ')',
        LOGICAL_AND    : ' && ',
        LOGICAL_OR     : ' || '
    }
971992
def find_spec(cls, fullname, path=None, target=None):
        """"""
        if path is None:
            path = sys.path
        spec = cls._get_spec(fullname, path, target)
        if spec is None:
            return None
        elif spec.loader is None:
            namespace_path = spec.submodule_search_locations
            if namespace_path:
                # We found at least one namespace path.  Return a
                #  spec which can create the namespace package.
                spec.origin = 'namespace'
                spec.submodule_search_locations = _NamespacePath(fullname, namespace_path, cls._get_spec)
                return spec
            else:
                return None
        else:
            return spec