Get the python variable name
506066
def getPythonVarName(name):
    
    return SUB_REGEX.sub('', name.replace('+', '_').replace('-', '_').replace('.', '_').replace(' ', '').replace('/', '_')).upper()
515533
def get_project_name():
    
    setup_py_content = helpers.get_file_content('setup.py')
    ret = helpers.value_of_named_argument_in_function(
        'name', 'setup', setup_py_content, resolve_varname=True
    )
    if ret and ret[0] == ret[-1] in ('"', "'"):
        ret = ret[1:-1]
    return ret
717804
def get_name(self):
        """"""
        if self.given_name is None:
            # Name according to host
            if self.hostname is None:
                name = _("Console")
            else:
                name = self.hostname
            # Adding id to name
            client_id = self.id_['int_id'] + u'/' + self.id_['str_id']
            name = name + u' ' + client_id
        elif self.given_name in ["Pylab", "SymPy", "Cython"]:
            client_id = self.id_['int_id'] + u'/' + self.id_['str_id']
            name = self.given_name + u' ' + client_id
        else:
            name = self.given_name + u'/' + self.id_['str_id']
        return name
1011002
def get_name(self, func):
        '''
        
        '''
        if hasattr(func, 'name'):
            return func.name

        return '%s.%s' % (
            func.__module__,
            func.__name__
        )
621848
private static String toVariableName(String str) {

	StringBuffer rtn = new StringBuffer();
	char[] chars = str.toCharArray();
	long changes = 0;
	boolean doCorrect = true;
	for (int i = 0; i < chars.length; i++) {
	    char c = chars[i];
	    if (i == 0 && (c >= '0' && c <= '9')) rtn.append("_" + c);
	    else if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_' || c == '$') rtn.append(c);
	    else {
		doCorrect = false;
		rtn.append('_');
		changes += (c * (i + 1));
	    }
	}

	if (changes > 0) rtn.append(changes);

	if (doCorrect) return correctReservedWord(rtn.toString());
	return rtn.toString();
    }
1129645
def getVariable(self, name):
        
        return lock_and_call(
            lambda: Variable(self._impl.getVariable(name)),
            self._lock
        )
1113650
private function getNextVariableName()
    {
        $firstChars = self::FIRST_CHARS;
        $firstCharsLength = strlen($firstChars);
        $nonFirstChars = self::NON_FIRST_CHARS;
        $nonFirstCharsLength = strlen($nonFirstChars);

        while (true) {
            $name = '';
            $i = $this->variableCount;

            if ('' === $name) {
                $name .= $firstChars[$i % $firstCharsLength];
                $i = (int) ($i / $firstCharsLength);
            }

            while ($i > 0) {
                --$i;
                $name .= $nonFirstChars[$i % $nonFirstCharsLength];
                $i = (int) ($i / $nonFirstCharsLength);
            }

            ++$this->variableCount;

            // check that the name is not reserved
            if (in_array($name, $this->reservedVariables, true)) {
                continue;
            }

            return $name;
        }
    }
356916
function getPathVariableName() {
    // windows calls it's path 'Path' usually, but this is not guaranteed.
    if (process.platform === 'win32') {
        for (const key of Object.keys(process.env))
            if (key.match(/^PATH$/i))
                return key;
        return 'Path';
    }
    return "PATH";
}
747443
def getParams(self):
        
        cur = self._conn.cursor()
        cur.execute("SHOW GLOBAL VARIABLES")
        rows = cur.fetchall()
        info_dict = {}
        for row in rows:
            key = row[0]
            val = util.parse_value(row[1])
            info_dict[key] = val
        return info_dict
142339
public final int getVariableByName(String variableName) {
    int index = getVariableIndex(variableName);
    if (index == -1) {
      return index;
    } else {
      return nums[index];
    }
  }
202545
def get_default_name(self):
        '''
        
        '''
        long_names = [name for name in self.name if name.startswith("--")]
        short_names = [name for name in self.name if not name.startswith("--")]

        if long_names:
            return to_snake_case(long_names[0].lstrip("-"))

        return to_snake_case(short_names[0].lstrip("-"))
277927
def parse_variables(args):
    

    if args is None:
        return {}

    def parse_variable(string):
        tokens = string.split('=')
        name = tokens[0]
        value = '='.join(tokens[1:])
        return name, value

    return {
        name: value
        for name, value in (parse_variable(v) for v in args)
    }
1038334
def _get_unique_variable_name(vname, variables):
    '''
    '''
    count = 2
    vname_base = vname
    while vname in variables:
        vname = '{}_{}'.format(vname_base, count)
        count += 1
    return vname
66688
def _get_variables(self):
        """"""
        if self._specs_in[_VARIABLES_STR] == 'all':
            return _get_all_objs_of_type(
                Var, getattr(self._obj_lib, 'variables', self._obj_lib)
            )
        else:
            return set(self._specs_in[_VARIABLES_STR])
988513
def get_global_variable(self, name):
        
        p = ffi.lib.LLVMPY_GetNamedGlobalVariable(self, _encode_string(name))
        if not p:
            raise NameError(name)
        return ValueRef(p, 'global', dict(module=self))
308346
def getName(self, value, defaultName = None):
        '''
        
        '''
        for k,v in self._values.items():
            if v == value:
                return k
        return defaultName
1171693
def defvar(varname):
    """"""

    if 'pyraf' in sys.modules:
        #ONLY if pyraf is already loaded, import iraf into the namespace
        from pyraf import iraf
    else:
        # else set iraf to None so it knows to not use iraf's environment
        iraf = None

    if iraf:
        _irafdef = iraf.envget(varname)
    else:
        _irafdef = 0
    return varname in _varDict or varname in os.environ or _irafdef