Return the key associated with a registered file object.
4187
def get_key(self, fileobj):
        
        mapping = self.get_map()
        if mapping is None:
            raise RuntimeError("Selector is closed")
        try:
            return mapping[fileobj]
        except KeyError:
            raise KeyError("{0!r} is not registered".format(fileobj))
218772
def _all_keys(self):
        """"""
        file_keys = [self._filename_to_key(fn) for fn in self._all_filenames()]
        if self._sync:
            return set(file_keys)
        else:
            return set(file_keys + list(self._buffer))
743494
def get_file_contents(self, file_key):
		'''
		'''
		#does not work
		self._raise_unimplemented_error()
		
		uri = '/'.join([self.api_uri,
						self.files_suffix,
						file_key,
						self.file_contents_suffix,
						])
		return self._req('get', uri)
657334
def set_api_key_from_file(path, set_global=True):
    """"""
    with open(path, 'r+b') as f:
        global api_key
        api_key = f.read().strip()
    return api_key
451572
def key(self, att=None):
        """"""
        if att is not None:
            return self._key[self.id][att]
        else:
            return self._key[self.id]
768019
def get(self, key):
    
    self._create_file_if_none_exists()
    with open(self.filename, 'rb') as file_object:
      cache_pickle = pickle.load(file_object)
      val = cache_pickle.get(key, None)
      return val
334068
def get_filesystem(filename):
    """"""
    filename = compat.as_str_any(filename)
    prefix = ""
    index = filename.find("://")
    if index >= 0:
        prefix = filename[:index]
    fs = _REGISTERED_FILESYSTEMS.get(prefix, None)
    if fs is None:
        raise ValueError("No recognized filesystem for prefix %s" % prefix)
    return fs
78595
def _get_object_key(self, p_object):
        """"""
        matched_key = None
        matched_index = None

        if hasattr(p_object, self._searchNames[0]):
            return getattr(p_object, self._searchNames[0])

        for x in xrange(len(self._searchNames)):
            key = self._searchNames[x]
            if hasattr(p_object, key):
                matched_key = key
                matched_index = x

        if matched_key is None:
            raise KeyError()

        if matched_index != 0 and self._searchOptimize:
            self._searchNames.insert(0, self._searchNames.pop(matched_index))

        return getattr(p_object, matched_key)
770057
def _get_key_location(self, key) -> (int, int):
        
        key = int(key)
        if key == 0:
            return 1, 0
        remainder = key % self.chunkSize
        addend = ChunkedFileStore.firstChunkIndex
        chunk_no = key - remainder + addend if remainder \
            else key - self.chunkSize + addend
        offset = remainder or self.chunkSize
        return chunk_no, offset
1302816
def get_processed_key_name(self):
        """"""
        if not hasattr(self, '_processed_key_name'):
            path, upload_name = os.path.split(self.get_upload_key().name)
            key_name = self._generate_processed_key_name(
                self.process_to, upload_name)
            self._processed_key_name = os.path.join(
                self.get_storage().location, key_name)
        return self._processed_key_name
686062
function FileKeyInfo(file) {
  this.file = file

  this.getKeyInfo = function(key, prefix) {
    prefix = prefix || ''
    prefix = prefix ? prefix + ':' : prefix
    return "<" + prefix + "X509Data></" + prefix + "X509Data>"
  }

  this.getKey = function(keyInfo) {
    return fs.readFileSync(this.file)
  }
}
561482
def get_key(self, key):
        
        return self.__mapping.get(self.type(key), self.__getitem__)(key)
857628
def get_key(raw=False):
    
    file_descriptor = stdin.fileno()
    state = tcgetattr(file_descriptor)
    chars = []
    try:
        setraw(stdin.fileno())
        for i in range(3):
            char = stdin.read(1)
            ordinal = ord(char)
            chars.append(char)
            if i == 0 and ordinal != 27:
                break
            elif i == 1 and ordinal != 91:
                break
            elif i == 2 and ordinal != 51:
                break
    finally:
        tcsetattr(file_descriptor, TCSADRAIN, state)
    result = "".join(chars)
    return result if raw else codes.keys_flipped.get(result, result)
994809
def entry_key(*entry):
    """"""
    if len(entry) == 1:
        return (entry[0].path, entry[0].stage)
    else:
        return tuple(entry)
670032
def get_key(key=None, keyfile=None):
    
    if key is None:
        if keyfile is None:
            key = environ.get('CRYPTOYAML_SECRET')
            if key is None:
                raise MissingKeyException(
                    '''You must either provide a key value,'''
                    ''' a path to a key or its value via the environment variable '''
                    ''' CRYPTOYAML_SECRET'''
                )
            else:
                key = key.encode('utf-8')
        else:
            key = open(keyfile, 'rb').read()
    return key
527343
def get(self, key):
        
        upload = None
        files_states = self.backend.get(key)
        files = MultiValueDict()
        if files_states:
            for name, state in files_states.items():
                f = BytesIO()
                f.write(state['content'])

                # If the post is too large, we cannot use a
                # InMemoryUploadedFile instance.
                if state['size'] > settings.FILE_UPLOAD_MAX_MEMORY_SIZE:
                    upload = TemporaryUploadedFile(
                        state['name'],
                        state['content_type'],
                        state['size'],
                        state['charset'],
                    )
                    upload.file = f
                else:
                    f = BytesIO()
                    f.write(state['content'])
                    upload = InMemoryUploadedFile(
                        file=f,
                        field_name=name,
                        name=state['name'],
                        content_type=state['content_type'],
                        size=state['size'],
                        charset=state['charset'],
                    )
                files[name] = upload

                # Go to the first byte in the file for future use
                upload.file.seek(0)

        return files
119648
private function getKey()
    {
        if ($this->_key === null) {
            $this->_key = ftok(__FILE__, $this->id);
        }

        return $this->_key;
    }