Returns the prefix of the key to use in the result row, at this groupLevel
760349
public static Object groupKey(Object key, int groupLevel) {
        if (groupLevel > 0 && (key instanceof List) && (((List<Object>) key).size() > groupLevel)) {
            return ((List<Object>) key).subList(0, groupLevel);
        } else {
            return key;
        }
    }
603038
private String getRow(String rowKey) {
        try {
            return cache.get(rowKey);
        } catch (Exception e) {
            if (e.getCause() instanceof RowNotFoundException) {
                return null;
            }
            throw new RuntimeException(e);
        }
    }
449750
def split_prefix(key, prefixs):
        
        key_upper = key.upper()
        for prefix in prefixs:
            if key_upper.startswith(prefix):
                plen = len(prefix)
                return (key_upper[:plen], key[plen:])
224584
function row (root, prefix, isTail, out, printNode) {
  if (root) {
    out(`${ prefix }${ isTail ? '└── ' : '├── ' }${ printNode(root) }\n`);
    const indent = prefix + (isTail ? '    ' : '│   ');
    if (root.left)  row(root.left,  indent, false, out, printNode);
    if (root.right) row(root.right, indent, true,  out, printNode);
  }
}
711659
def KeyValue(self, row=None):
        """"""
        if not row:
            if self._iterator:
                # If we are inside an iterator use current row iteration.
                row = self[self._iterator]
            else:
                row = self.row
        # If no superkey then use row number.
        if not self.superkey:
            return ["%s" % row.row]

        sorted_list = []
        for header in self.header:
            if header in self.superkey:
                sorted_list.append(row[header])
        return sorted_list
698915
function resolvePrimaryKey(row, context) {
    const resAttrNode = context.resourceAttrNode;
    const indexKey = resAttrNode.resolvedPrimaryKey[resAttrNode.primaryDataSource];

    function dereferenceKeyAttr(keyAttr) {
        const keyVal = row[keyAttr];
        if (keyVal === undefined) {
            const attrPath = context.attrPath.length > 0 ? context.attrPath.join('.') : '{root}';
            throw new DataError(
                `Result-row of "${attrPath}" (DataSource "${
                    resAttrNode.primaryDataSource
                }") misses primary key attribute "${keyAttr}"`
            );
        }
        return keyVal;
    }

    if (indexKey.length === 1) {
        context.primaryKey = '' + dereferenceKeyAttr(indexKey[0]);
    } else {
        context.primaryKey = indexKey.map(dereferenceKeyAttr).join(keySeparator);
    }

    // link rows from secondary DataSources by primary key:
    // row from joinVia-DataSource is passed via context here
    context.secondaryRows = context.secondaryRows || {};

    Object.keys(resAttrNode.dataSources).forEach(dataSourceName => {
        if (dataSourceName === resAttrNode.primaryDataSource) return;
        if (resAttrNode.joinVia && dataSourceName === resAttrNode.joinVia) return;
        if (!('resultId' in resAttrNode.dataSources[dataSourceName])) return;

        const secondaryResult = context.rawResults[resAttrNode.dataSources[dataSourceName].resultId];
        if (typeof secondaryResult.indexedData[context.primaryKey] === 'undefined') {
            context.api.log.debug(
                new DataError(
                    `Secondary DataSource "${dataSourceName}" of "` +
                        (context.attrPath.length > 0 ? context.attrPath.join('.') : '{root}') +
                        `": row with key "${context.primaryKey}" not found`
                )
            );
            context.secondaryRows[dataSourceName] = null;
        } else {
            context.secondaryRows[dataSourceName] = secondaryResult.indexedData[context.primaryKey];
        }
    });
}
640093
function( version ) {

    var propName = (this.group ? this.group + '.' : '') + capitalDashCase( this._field )
    var keys = Object.keys( this )
    var params = []

    for( var i = 0; i < keys.length; i++ ) {
      if (keys[i] === 'group') continue
      params.push( capitalDashCase( keys[i] ) + '=' + this[ keys[i] ] )
    }

    return propName +
      ( params.length ? ';' + params.join( ';' ) : params ) + ':' +
      ( Array.isArray( this._data ) ? this._data.join( ';' ) : this._data )

  }
1084955
def each_common_prefix(key, start, callback)
      base = @base
      chck = @chck
      node = @base[0]
      offset = -1
      kin = KeyStream.new(key, start)
    
      while true
        code = kin.read
        offset += 1
        terminal_index = node
      
        if(chck[terminal_index] == Node::Chck::TERMINATE_CODE)
          callback.call(start, offset, Node::Base.ids(base[terminal_index]))
        
          if(code == Node::Chck::TERMINATE_CODE)
            return
          end
        end
      
        idx = node + code
        node = base[idx]
      
        if(chck[idx] == code)
          if(node >= 0)
            next
          else
            call_if_key_including(kin, node, start, offset, callback)
          end
        end
        return
      end
    end
588857
def get_prefix(self, key_prefix, **kwargs):
        
        range_response = self.get_prefix_response(key_prefix, **kwargs)
        for kv in range_response.kvs:
            yield (kv.value, KVMetadata(kv, range_response.header))
1340740
private final int getRoundKey(final int key, final boolean upORdown, final boolean acceptEqual) {
		if (isEmpty())
			return NULL_VALUE;
		int slot = findSlotByKey(key);
		if (upORdown) {
			// ceiling / higher
			slot = ((slot < 0) ? (-slot) - 1 : (acceptEqual ? slot : slot + 1));
			if (slot >= allocated) {
				return NULL_VALUE;
			}
		} else {
			// floor / lower
			slot = ((slot < 0) ? (-slot) - 2 : (acceptEqual ? slot : slot - 1));
			if (slot < 0) {
				return NULL_VALUE;
			}
		}
		return keys[slot];
	}
1338656
def prefix_dict_keys(d: Dict[str, Any], prefix: str) -> Dict[str, Any]:
    
    result = {}  # type: Dict[str, Any]
    for k, v in d.items():
        result[prefix + k] = v
    return result
334116
def prefixes(self, key):
        '''
        
        '''
        res = []
        index = self.dct.ROOT
        if not isinstance(key, bytes):
            key = key.encode('utf8')

        pos = 1

        for ch in key:
            index = self.dct.follow_char(int_from_byte(ch), index)
            if not index:
                break

            if self._has_value(index):
                res.append(key[:pos].decode('utf8'))
            pos += 1

        return res
848805
def _allKeys(self, prefix):
        
        global dictItemsIter
        result = [prefix + self.key] if self.key != None else []
        for key, trie in dictItemsIter(self.slots):        
            result.extend(trie._allKeys(prefix + key))        
        return result
408483
def _key(self):
        
        return (self.start_key, self.start_inclusive, self.end_key, self.end_inclusive)
881139
public static function get_key( $key, $group_key = '' ) {

		// Add some salt
		$key .= '-' . PODS_VERSION;

		// Patch for limitations in DB
		if ( 44 < strlen( $group_key . $key ) ) {
			$key = md5( $key );
		}

		return $key;

	}
1068772
def key(self, direction, mechanism, purviews=False, _prefix=None):
        """"""
        return (_prefix, direction, mechanism, purviews)
1361646
def _get_result_string(self, key):
        

        row, col, tab = key

        result_obj = self.grid.code_array[row, col, tab]

        try:
            # Numpy object arrays are converted because of numpy repr bug
            result_obj = result_obj.tolist()

        except AttributeError:
            pass

        return unicode(result_obj)