Handles a candidate definition for a goog.provided name.
779816
private void handleCandidateProvideDefinition(NodeTraversal t, Node n, Node parent) {
    if (t.inGlobalHoistScope()) {
      String name = null;
      if (n.isName() && NodeUtil.isNameDeclaration(parent)) {
        name = n.getString();
      } else if (n.isAssign() && parent.isExprResult()) {
        name = n.getFirstChild().getQualifiedName();
      }

      if (name != null) {
        if (parent.getBooleanProp(Node.IS_NAMESPACE)) {
          // TODO(b/128361464): stop including goog.module exports in this case.
          processProvideFromPreviousPass(t, name, parent);
        } else {
          ProvidedName pn = providedNames.get(name);
          if (pn != null) {
            pn.addDefinition(parent, t.getModule());
          }
        }
      }
    }
  }
318807
def _resolve_name(self, name):
        
        res = [name]
        while True:
            orig_names = self._search("types", name)
            if orig_names is not None:
                name = orig_names[-1]
                # pop off the typedefd name
                res.pop()
                # add back on the original names
                res += orig_names
            else:
                break

        return res
475936
def as_nick(self, name):
        
        orig = self.get_nickname()
        self.nick(name)
        try:
            yield orig
        finally:
            self.nick(orig)
421592
def handle(self, *args, **options):
        
        from categories.migration import drop_field
        if 'app_name' not in options or 'model_name' not in options or 'field_name' not in options:
            raise CommandError("You must specify an Application name, a Model name and a Field name")

        drop_field(options['app_name'], options['model_name'], options['field_name'])
1351439
def handle(self, *args, **options):
        """"""
        try:
            admin = User.objects.get(username='admin')
        except User.DoesNotExist:
            admin = User(
                username='admin',
                first_name='admin',
                last_name='admin',
                email='admin@localhost.localdomain',
                is_staff=True,
                is_active=True,
                is_superuser=True,
            )
        admin.set_password('admin')
        admin.save()
219717
def handle_entityref(self, name):
        """"""
        char_code = html_entities.name2codepoint.get(name, None)
        if char_code is not None:
            try:
                self.result += unichr(char_code).encode("utf-8")
            except:
                return
1090591
def request(self, source="candidate"):
        """"""
        node = new_ele("validate")
        if type(source) is str:
            src = util.datastore_or_url("source", source, self._assert)
        else:
            validated_element(source, ("config", qualify("config")))
            src = new_ele("source")
            src.append(source)
        node.append(src)
        return self._request(node)
83275
def process(self, candidates):
        
        for c in candidates[:]:
            if c.locator not in self.good_locators:
                # TODO: search string, i.e. find "EU_Street_Name" in "EU_Street_Name.GBR_StreetName"
                candidates.remove(c)

        return candidates
334432
def run_getgist(filename, user, **kwargs):
    """"""
    assume_yes = kwargs.get("yes_to_all")
    getgist = GetGist(user=user, filename=filename, assume_yes=assume_yes)
    getgist.get()
498340
function parameterize(candidate) {
		candidate.param = candidate.param.map(function(param) {
			var value;

			if ('value' in param) {
				value = param.value;
			}
			else if ('reference' in param) {
				value = candidate.param.reduce(function(p, c) {
					return c !== param && !p && param.reference === c.name && 'value' in c ? c.value : p;
				}, null);
			}

			return value;
		});

		return candidate;
	}
510820
def lookup_name(self, name):
        """"""

        try:
            info = self._get_by_name(self._source, name)
        except NotImplementedError:
            pass
        else:
            if info:
                return info
            return

        info = self.lookup_name_fast(name)
        if info:
            return info
        return self.lookup_name_slow(name)
476117
def is_satisfied_by(self, candidate: Any, **kwds: Any) -> bool:
        """"""
        candidate_name = self._candidate_name
        context = self._context
        if context:
            if candidate_name in kwds:
                raise ValueError(f"Candidate name '{candidate_name}' must "
                                 "not be given as keyword.")
            context.update(kwds)
        context[candidate_name] = candidate
        try:
            code = self._code
        except AttributeError:
            self._code = code = compile(self._ast_expr, '<str>', mode='eval')
        return eval(code, context)
150457
def _name_is_available(self, job_name):
        
        return (False
                if [job for job in self.jobs if job.name == job_name]
                else True)
988113
def apply_slug_limit(candidate, uuid)
      return candidate unless candidate && friendly_id_config.slug_limit

      candidate[0...candidate_limit(uuid)]
    end
568828
void appendGoogRequiresTo(StringBuilder sb) {
    for (GoogRequire require : googRequires.values()) {
      // TODO(lukes): we need some namespace management here... though really we need namespace
      // management with all declarations... The problem is that a require could introduce a name
      // alias that conflicts with a symbol defined elsewhere in the file.
      require.writeTo(sb);
    }
  }
582202
function(id, profileKey) {
    if (!profiles.hasOwnProperty("definitions")) {
        throw ("\"profiles\" dictionary is badly formed, no \"definitions\" key");
    }
    if (!profiles.definitions.hasOwnProperty(profileKey)) {
        if (!profiles.definitions.hasOwnProperty("default")) {
            throw ("\"" + profileKey + "\" is not a registred SLURM profile AND no default profile is defined");
        } else {
            profileKey = "default";
        }
    }
    var string = _preprocessorDump(id, profiles.definitions[profileKey]);
    return string;
}
761784
def with_name(self, name):
    """"""
    with self.g.as_default(), tf.variable_scope(name) as var_scope:
      name_scope = scopes.get_current_name_scope()
      return _DeferredLayer(self.bookkeeper,
                            None,
                            (),
                            {},
                            scope=(name_scope, var_scope),
                            defaults=self._defaults,
                            pass_through=self,
                            partial_context=self._partial_context)