Returns the global name of a variable declared in an ES module.
499517
static String getGlobalNameOfEsModuleLocalVariable(
      ModuleMetadata moduleMetadata, String variableName) {
    return variableName + "$$" + getGlobalName(moduleMetadata, /* googNamespace= */ null);
  }
1352883
function _globals (options) {
  options.hash.scope = 'global'
  return _identifiers(options).filter(function (identifier) {
    if (identifier.kind === 'external') {
      return identifier.description && identifier.description.length > 0
    } else {
      return true
    }
  })
}
931172
def _get_caller_globals_and_locals():
    
    caller_frame = inspect.stack()[2]
    myglobals = caller_frame[0].f_globals
    mylocals = caller_frame[0].f_locals
    return myglobals, mylocals
22389
def find_global(self, name):
        """"""
        defglobal = lib.EnvFindDefglobal(self._env, name.encode())
        if defglobal == ffi.NULL:
            raise LookupError("Global '%s' not found" % name)

        return Global(self._env, defglobal)
485111
public Element getGlobalVariable(String name) {
		GlobalVariable gvar = globalVariables.get(name);
		return (gvar != null) ? gvar.getValue() : null;
	}
983929
def get_global_name_value(self):
        
        if self._has_global_stats:
            name, value = self.get_global()
            if not isinstance(name, list):
                name = [name]
            if not isinstance(value, list):
                value = [value]
            return list(zip(name, value))
        else:
            return self.get_name_value()
1096796
def get_module_name(self, path_args):
        """"""
        controller_prefix = self.controller_prefix
        cset = self.module_names
        module_name = controller_prefix
        mod_name = module_name
        while path_args:
            mod_name += "." + path_args[0]
            if mod_name in cset:
                module_name = mod_name
                path_args.pop(0)
            else:
                break

        return module_name, path_args
401472
function checkForGlobal(node) {
				var scope = context.getScope(),
					parserOptions = context.parserOptions,
					ecmaFeatures = parserOptions.ecmaFeatures || {};

				// Nodejs env or modules has a special scope.
				if (ecmaFeatures.globalReturn || node.sourceType === "module") {
					findVariablesInScope(scope.childScopes[0]);
				} else {
					findVariablesInScope(scope);
				}
			}
1291476
def _global_index():
    
    var_and_type = var + Optional(type_)
    global_dec = Suppress(upkey("global")) + index
    range_key_etc = Suppress(",") + Group(throughput) | Optional(
        Group(Suppress(",") + var_and_type).setResultsName("range_key")
    ) + Optional(Suppress(",") + include_vars) + Optional(
        Group(Suppress(",") + throughput)
    )
    global_spec = (
        Suppress("(")
        + primitive
        + Suppress(",")
        + Group(var_and_type).setResultsName("hash_key")
        + range_key_etc
        + Suppress(")")
    )
    return Group(global_dec + global_spec).setName("global index")
800644
function getPackageExportNames(packagePath) {
  const packageMeta = getPackageMeta(packagePath);
  const packageModulePath = path.join(packagePath, packageMeta.module);
  const moduleFileSource = fs.readFileSync(packageModulePath, "utf8");
  const { body } = esprima.parseModule(moduleFileSource);

  return body.reduce((result, statement) => {
    if (statement.type === "ExportDefaultDeclaration") {
      return result.concat(["default"]);
    }

    if (statement.type === "ExportNamedDeclaration") {
      return result.concat(getNamesFromDeclaration(statement));
    }

    return result;
  }, []);
}
523283
function getImportGlobalsSrc(ignore) {
    var key,
        value,
        src = "",
        globalObj = typeof global === "undefined"? window: global;

    ignore = ignore || [];
    // global itself can't be overridden because it's the only reference to our real global objects
    ignore.push("global");
    // ignore 'module', 'exports' and 'require' on the global scope, because otherwise our code would
    // shadow the module-internal variables
    // @see https://github.com/jhnns/rewire-webpack/pull/6
    ignore.push("module", "exports", "require");

    for (key in globalObj) { /* jshint forin: false */
        if (ignore.indexOf(key) !== -1) {
            continue;
        }
        value = globalObj[key];

        // key may be an invalid variable name (e.g. 'a-b')
        try {
          eval("var " + key + ";");
          src += "var " + key + " = global." + key + "; ";
        } catch(e) {}
    }

    return src;
}
1204003
def get_local_variable_or_declare_one(self, raw_name, type=None):
        '''
        
        '''
        onnx_name = self.get_onnx_variable_name(raw_name)
        if onnx_name in self.variables:
            return self.variables[onnx_name]
        else:
            variable = Variable(raw_name, onnx_name, self.name, type)
            self.variables[onnx_name] = variable
            if raw_name in self.variable_name_mapping:
                self.variable_name_mapping[raw_name].append(onnx_name)
            else:
                self.variable_name_mapping[raw_name] = [onnx_name]
            return variable
668398
def get_name_init(self, name):
        
        self._register_name(name)

        return self._var_name_mappers[name].get_init()
726032
protected Map<String, Object> getGlobalVariables(KnowledgeRuntimeEngine runtimeEngine) {
        Map<String, Object> globalVariables = new HashMap<String, Object>();
        if (runtimeEngine != null) {
            Globals globals = runtimeEngine.getSessionGlobals();
            if (globals != null) {
                for (String key : globals.getGlobalKeys()) {
                    Object value = globals.get(key);
                    globalVariables.put(key, value);
                }
            }
        }
        return globalVariables;
    }
521991
def get_global_vars(mod):
    ""
    # https://stackoverflow.com/questions/8820276/docstring-for-variable/31764368#31764368
    import ast,re
    with open(mod.__file__, 'r') as f: fstr = f.read()
    flines = fstr.splitlines()
    d = {}
    for node in ast.walk(ast.parse(fstr)):
        if isinstance(node,ast.Assign) and hasattr(node.targets[0], 'id'):
            key,lineno = node.targets[0].id,node.targets[0].lineno
            codestr = flines[lineno]
            match = re.match(f"^({key})\s*=\s*.*", codestr)
            if match and match.group(1) != '__all__': # only top level assignment
                d[key] = f'`{codestr}` {get_source_link(mod, lineno)}'
    return d
415652
def resolve_name(name):
    

    parts = name.split('.')
    cursor = len(parts) - 1
    module_name = parts[:cursor]
    attr_name = parts[-1]

    while cursor > 0:
        try:
            ret = __import__('.'.join(module_name), fromlist=[attr_name])
            break
        except ImportError:
            if cursor == 0:
                raise
            cursor -= 1
            module_name = parts[:cursor]
            attr_name = parts[cursor]
            ret = ''

    for part in parts[cursor:]:
        try:
            ret = getattr(ret, part)
        except AttributeError:
            raise ImportError(name)

    return ret
572804
def p_global_var(p):
    ''''''
    if len(p) == 2:
        p[0] = ast.Variable(p[1], lineno=p.lineno(1))
    elif len(p) == 3:
        p[0] = ast.Variable(p[2], lineno=p.lineno(1))
    else:
        p[0] = ast.Variable(p[3], lineno=p.lineno(1))