get the key name to use in log from the logging keys map
347497
public String getKeyValue(String key){
        String keyName = keysMap.get(key);
        if (keyName != null){
            return keyName;
        }
        return ""; //key wasn't defined in keys properties file
    }
1208218
def get_table_key(key, d, fallback=""):
    
    try:
        var = d[key]
        return var
    except KeyError:
        logger_misc.info("get_variable_name_table: KeyError: missing {}, use name: {}".format(key, fallback))
        return fallback
1313554
def parent_name( key )
      return if :root == key

      a = key.split PATH_DELIMITER
      p = :root
      while a.slice!(-1) and !a.empty?
        k = a.join PATH_DELIMITER
        if @h.has_key? k then p = k; break end
      end
      p
    end
844945
function getKey(context) {
        if (context.getModelKey) {
            return context.getModelKey();
        }
        return context.props.name || context.props.key || context.props.ref;
    }
245603
def get_key_names(self):
        
        names = []
        for (k, _) in self.items():
            names.append(k)
        return names
343786
def get_table_keys_name(self, table_name, keys):
        
        table = self.tables.get(table_name)
        if not table:
            return None, None
        else:
            if len(keys) == 1:
                for key in keys:
                    if key in table.hash_key_names:
                        return key, None
            # for potential_hash, potential_range in zip(table.hash_key_names, table.range_key_names):
            #     if set([potential_hash, potential_range]) == set(keys):
            #         return potential_hash, potential_range
            potential_hash, potential_range = None, None
            for key in set(keys):
                if key in table.hash_key_names:
                    potential_hash = key
                elif key in table.range_key_names:
                    potential_range = key
            return potential_hash, potential_range
698032
public String getWithLog(String key) {
		final String value = getStr(key);
		if (value == null) {
			log.debug("No key define for [{}]!", key);
		}
		return value;
	}
1361865
def _key(self):
        
        return (
            self._name,
            self._field_type.upper(),
            self._mode.upper(),
            self._description,
            self._fields,
        )
555444
private String getEventLogName(String name, String id) {
    return String.format("%s-%s", name, id);
  }
671338
def _map_and_prefix_keys(self, key_iterable, key_prefix):
        
        # Check it just once ...
        key_extra_len=len(key_prefix)
        if key_prefix and self.do_check_key:
            self.check_key(key_prefix)

        # server (_Host) -> list of unprefixed server keys in mapping
        server_keys = {}

        prefixed_to_orig_key = {}
        # build up a list for each server of all the keys we want.
        for orig_key in key_iterable:
            if isinstance(orig_key, tuple):
                # Tuple of hashvalue, key ala _get_server(). Caller is essentially telling us what server to stuff this on.
                # Ensure call to _get_server gets a Tuple as well.
                str_orig_key = str(orig_key[1])
                server, key = self._get_server((orig_key[0], key_prefix + str_orig_key)) # Gotta pre-mangle key before hashing to a server. Returns the mangled key.
            else:
                str_orig_key = str(orig_key) # set_multi supports int / long keys.
                server, key = self._get_server(key_prefix + str_orig_key)

            # Now check to make sure key length is proper ...
            if self.do_check_key:
                self.check_key(str_orig_key, key_extra_len=key_extra_len)

            if not server:
                continue

            if server not in server_keys:
                server_keys[server] = []
            server_keys[server].append(key)
            prefixed_to_orig_key[key] = orig_key

        return (server_keys, prefixed_to_orig_key)
1201082
def _structlog_default_keys_processor(logger_class, log_method, event):
    '''  '''
    global HOSTNAME

    if 'id' not in event:
        event['id'] = '%s_%s' % (
            datetime.utcnow().strftime('%Y%m%dT%H%M%S'),
            uuid.uuid1().hex
        )

    if 'type' not in event:
        event['type'] = 'log'

    event['host'] = HOSTNAME

    return event
93945
def _get_name(self, key):
        
        if key in self.display_names:
            return self.display_names[key]

        return key.capitalize()
432554
def _parseKeyNames(lib):
    
    _keyNames = {}
    for attr in dir(lib): # from the modules variables
        if attr[:6] == 'TCODK_': # get the K_* constants
            _keyNames[getattr(lib, attr)] = attr[6:] # and make CODE=NAME pairs
    return _keyNames
490094
def _key(self, ch):
        """"""

        if ch in self.D:
            return ch

        if isinstance(ch, int):
            raise KeyError(ch)  # dont accept integers as custom names

        if self.chnames:
            for item in self.chnames.items():
                if item[1] == ch:
                    return item[0]
        for item in self.chnames_0.items():
            if item[1] == ch:
                return item[0]

        # If we got here, ch can be an int represented by a string if it comes
        # from a condition string:
        try:
            chint = int(ch)
            if chint in self.D:
                return chint
        except ValueError:
            pass

        raise KeyError(ch)
374801
def _key_name(self):  # type: () -> str
        
        if self._key is not None:
            return self._key

        return self.__class__.__name__.lower()
1372943
public String getKey() {
        String dbkey = ThreadContext.getContext(dbName);
        if (dbkey == null) {
            Integer userid = ThreadContext.getShardKey();
            if (userid == null) {
                userid = 0;
                // throw new
                // RuntimeException("No userid contexted,so you can't know how to routing!!");
            }
            dbkey = router.getTargetDataSourceKey(userid, true);

            StackTraceElement[] elements = Thread.currentThread().getStackTrace();

            logTrace(dbkey, elements);

        }
        return dbkey;
    }
897240
def _get_ordered_access_keys(self):
        ""
        self.access_log_lock.acquire()
        r = [e.key for e in self.access_log if e.is_valid]
        self.access_log_lock.release()

        return r