Collects all goog.provides in the given namespace and warns on invalid code
964260
Map<String, ProvidedName> collectProvidedNames(Node externs, Node root) {
    if (this.providedNames.isEmpty()) {
      // goog is special-cased because it is provided in Closure's base library.
      providedNames.put(GOOG, new ProvidedName(GOOG, null, null, false /* implicit */, false));
      NodeTraversal.traverseRoots(compiler, new CollectDefinitions(), externs, root);
    }
    return this.providedNames;
  }
903428
private static void addCodeToProvideSoyNamespace(StringBuilder header, SoyFileNode soyFile) {
    header.append("goog.provide('").append(soyFile.getNamespace()).append("');\n");
  }
1091962
private void processLegacyModuleCall(String namespace, Node googModuleCall, JSModule module) {
    registerAnyProvidedPrefixes(namespace, googModuleCall, module);
    providedNames.put(
        namespace,
        new ProvidedName(
            namespace,
            googModuleCall,
            module,
            /* explicit= */ true,
            /* fromPreviousProvide= */ false));
  }
3103
def gatherNamespaces(self):
        '''
        '''
        if self.usedNamespaces is not None:
            return

        self.logger.debug('gatherNamespaces')
        self.usedNamespaces = {}
            
        # Add all schemas defined in wsdl
        # to used namespace and to the Alias dict
        for schema in self._wsdl.types.values():
            tns = schema.getTargetNamespace()
            self.logger.debug('Register schema(%s) -- TNS(%s)'\
                %(_get_idstr(schema), tns),)
            if self.usedNamespaces.has_key(tns) is False:
                self.usedNamespaces[tns] = []
            self.usedNamespaces[tns].append(schema)
            NAD.add(tns)
            
        # Add all xsd:import schema instances
        # to used namespace and to the Alias dict
        for k,v in SchemaReader.namespaceToSchema.items():
            self.logger.debug('Register schema(%s) -- TNS(%s)'\
                %(_get_idstr(v), k),)
            if self.usedNamespaces.has_key(k) is False:
                self.usedNamespaces[k] = []
            self.usedNamespaces[k].append(v)
            NAD.add(k)
438785
def get_collection(self, namespace):
        """"""
        database, coll = namespace.split(".", 1)
        return self.primary_client[database][coll]
1108709
def get_all(self):
        """"""
        logger.debug('Fetching items. Table: {namespace}'.format(
            namespace=self.namespace
        ))

        rows = []

        result = self.table.scan()

        while True:
            next_token = result.get('LastEvaluatedKey', None)
            rows += result['Items']

            if next_token:
                result = self.table.scan(ExclusiveStartKey=next_token)
            else:
                break

        return rows
416866
public static void checkDatasetName(String namespace, String name) {
    Preconditions.checkNotNull(namespace, "Namespace cannot be null");
    Preconditions.checkNotNull(name, "Dataset name cannot be null");
    ValidationException.check(Compatibility.isCompatibleName(namespace),
        "Namespace %s is not alphanumeric (plus '_')",
        namespace);
    ValidationException.check(Compatibility.isCompatibleName(name),
        "Dataset name %s is not alphanumeric (plus '_')",
        name);
  }
648303
private ImmutableList<Require> getAllRequiresFromDestructuring(
      Node objectPattern, String namespace) {
    ImmutableList.Builder<Require> requireBuilder = ImmutableList.builder();
    for (Node key : objectPattern.children()) {
      if (!key.isStringKey()) {
        // Bad code, just ignore. We warn elsewhere.
        continue;
      }
      Node lhs = key.getOnlyChild();
      if (!lhs.isName()) {
        // Bad code ( e.g. `const {a = 0} = goog.require(...)`). We warn elsewhere.
        continue;
      }

      requireBuilder.add(
          Require.create(
              lhs.getString(),
              Import.builder()
                  .moduleRequest(namespace)
                  .localName(lhs.getString())
                  .importName(key.getString())
                  .importNode(nameDeclaration)
                  .nameNode(lhs)
                  .build(),
              requireKind));
    }
    return requireBuilder.build();
  }
931160
def filter(select, iterable, namespaces=None, flags=0, **kwargs):  # noqa: A001
    """"""

    return compile(select, namespaces, flags, **kwargs).filter(iterable)
321839
def get_provides(self, ignored=tuple()):
        

        if self._provides is None:
            self._collect_requires_provides()

        d = self._provides
        if ignored:
            d = dict((k, v) for k, v in d.items()
                     if not fnmatches(k, *ignored))
        return d
1142287
public void collect(Name currPkg, Name depPkg) {
        if (!currPkg.equals(depPkg)) {
            Set<Name> theset = deps.get(currPkg);
            if (theset==null) {
                theset = new HashSet<Name>();
                deps.put(currPkg, theset);
            }
            theset.add(depPkg);
        }
    }
782197
def getArgs(self, namespace):
        
        namespace = self._fixNS(namespace)
        return dict([
            (ns_key, value)
            for ((pair_ns, ns_key), value)
            in self.args.iteritems()
            if pair_ns == namespace
            ])
255489
def _get_namespaces(apiserver_url, name=""):
    ''''''
    # Prepare URL
    url = "{0}/api/v1/namespaces/{1}".format(apiserver_url, name)
    # Make request
    ret = http.query(url)
    if ret.get("body"):
        return salt.utils.json.loads(ret.get("body"))
    else:
        return None
174185
def namespace_bindings_from_defs(ns_defs)
      (ns_defs||[]).reduce({}) do |h,ns_def|
        h[ns_def.prefix||""] = ns_def.href
        h
      end
    end
1241041
def add_namespaces(metadata, namespaces):
    # type: (Mapping[Text, Any], MutableMapping[Text, Text]) -> None
    """"""
    for key, value in metadata.items():
        if key not in namespaces:
            namespaces[key] = value
        elif namespaces[key] != value:
            raise validate.ValidationException(
                "Namespace prefix '{}' has conflicting definitions '{}'"
                " and '{}'.".format(key, namespaces[key], value))
72073
def _run_namespace(self, doc):
        """"""
        for receiver in self.receivers[doc['ns']]:
            params = self.receivers[doc['ns']][receiver]
            if params[doc['op']]:
                if params[doc['op']] is True or str(doc['o']['_id']) in params[doc['op']]:
                    notification_id = self._notify_receiver(receiver, params, doc)
                    if params['reliable'] and self._max_attempts > 1:
                        self.notifications[notification_id] = {
                            'receiver': receiver,
                            'params': dict(params),
                            'doc': dict(doc),
                            'ts': datetime.datetime.utcnow(),
                            'attempts': 1}
9569
def generate_imports_for_referenced_namespaces(
        backend, namespace, insert_type_ignore=False):
    # type: (Backend, ApiNamespace, bool) -> None
    

    imported_namespaces = namespace.get_imported_namespaces(consider_annotation_types=True)
    if not imported_namespaces:
        return

    type_ignore_comment = TYPE_IGNORE_COMMENT if insert_type_ignore else ""

    backend.emit('try:')
    with backend.indent():
        backend.emit('from . import (')
        with backend.indent():
            for ns in imported_namespaces:
                backend.emit(fmt_namespace(ns.name) + ',')
        backend.emit(')')
    backend.emit('except (ImportError, SystemError, ValueError):')
    # Fallback if imported from outside a package.
    with backend.indent():
        for ns in imported_namespaces:
            backend.emit('import {namespace_name}{type_ignore_comment}'.format(
                namespace_name=fmt_namespace(ns.name),
                type_ignore_comment=type_ignore_comment
            ))
    backend.emit()