Returns the relevant i/o for a method whose call is characterized by the hash

    :param hash: The hash for the CallDescriptor

    :rtype list(tuple( hash, stack, methodname, returnval, args, packet_num )):
427050
def select_io( hash ):
    
    load_cache(True)
    global CACHE_
    res = []
    record_used('cache', hash)
    for d in CACHE_['cache'].get(hash, {}).values():
        d = pickle.loads(d)
        res += [(d['hash'], d['stack'], d['methodname'], d['returnval'], d['args'], d['packet_num'])]
    return res
127214
def get_file(self, hash_list):
        
        assert len(hash_list) == 1
        self._check_hashes(hash_list)
        return self.object_path(hash_list[0])
636030
def __make_hash(cls, innermsg, token, seqnum):
        
        hobj = hmacNew(token, digestmod=hashfunc)
        hobj.update(innermsg)
        hobj.update(cls.__byte_packer(seqnum))
        return hobj.digest()
943306
def get_hash(self, length=HASH_LENGTH):
        

        data_hash = ""
        if not self.data_str:
            return data_hash

        encoded_data_str = self.data_str
        if sys.version_info.major == 2:
            # In Py2, only unicode needs to be encoded.
            if isinstance(self.data_str, unicode):
                encoded_data_str = self.data_str.encode('utf-8')
        else:
            # data_str should always be unicode on python 3
            encoded_data_str = self.data_str.encode('utf-8')

        data_hash = hashlib.sha1(encoded_data_str).hexdigest()

        return data_hash[:length]
255216
def define_method_from_descriptor(m)
      m.params.each do |fpar|
        par = fpar.type
        # This is the signature validity check
        Type::Parser.new(par).parse
      end

      singleton_class.class_eval do
        define_method m.name do |*args, &reply_handler|
          if m.params.size != args.size
            raise ArgumentError, "wrong number of arguments (#{args.size} for #{m.params.size})"
          end

          msg = Message.new(Message::METHOD_CALL)
          msg.path = @object.path
          msg.interface = @name
          msg.destination = @object.destination
          msg.member = m.name
          msg.sender = @object.bus.unique_name
          m.params.each do |fpar|
            par = fpar.type
            msg.add_param(par, args.shift)
          end
          ret = @object.bus.send_sync_or_async(msg, &reply_handler)
          if ret.nil? || @object.api.proxy_method_returns_array
            ret
          else
            m.rets.size == 1 ? ret.first : ret
          end
        end
      end

      @methods[m.name] = m
    end
301198
def _get_hash(self, file_obj):
        
        size = 0
        hash_buider = self.hash_builder()
        for piece in self._get_file_iterator(file_obj):
            hash_buider.update(piece)
            size += len(piece)

        file_obj.seek(0)

        return "%s_%x" % (hash_buider.hexdigest(), size)
104162
def hash(self):
        '''
        
        '''
        hashed = super(Compare, self).hash()
        return khash(hashed, self._comp_value, self._comp_type)
130663
def cache_hash(*a, **kw):
    

    def cache_str(o):
        if isinstance(o, (types.FunctionType, types.BuiltinFunctionType,
                          types.MethodType, types.BuiltinMethodType,
                          types.UnboundMethodType)):
            return getattr(o, 'func_name', 'func')
        if isinstance(o, dict):
            o = [k + ':' + cache_str(v) for k, v in o.items()]
        if isinstance(o, (list, tuple, set)):
            o = sorted(map(cache_str, o))
            o = '|'.join(o)
        if isinstance(o, basestring):
            return o
        if hasattr(o, 'updated_at'):
            return cache_str((repr(o), o.updated_at))
        return repr(o)

    hash = cache_str((a, kw)).encode('utf-8')
    return sha1(hash).hexdigest()
1291924
def _CalculateHashDataStream(self, file_entry, data_stream_name):
    
    hash_context = hashlib.sha256()

    try:
      file_object = file_entry.GetFileObject(data_stream_name=data_stream_name)
    except IOError as exception:
      logging.warning((
          'Unable to open path specification:\n{0:s}'
          'with error: {1!s}').format(
              file_entry.path_spec.comparable, exception))
      return None

    if not file_object:
      return None

    try:
      data = file_object.read(self._READ_BUFFER_SIZE)
      while data:
        hash_context.update(data)
        data = file_object.read(self._READ_BUFFER_SIZE)
    except IOError as exception:
      logging.warning((
          'Unable to read from path specification:\n{0:s}'
          'with error: {1!s}').format(
              file_entry.path_spec.comparable, exception))
      return None

    finally:
      file_object.close()

    return hash_context.hexdigest()
345389
def introspect
      iface = Hash.new
      pin = Hash.new
      meth = Array.new
      
      if self.respond_to?(:read)
        meth << "read"
      end
      if self.respond_to?(:write)
        meth << "write"
      end
      iface[@interface] = meth
      pin[@name] = iface
      return pin
    end
425647
def hash(self):
        '''
        
        '''
        hashed = super(_LibraryBitField, self).hash()
        return khash(hashed, self._length, self._signed, self._min_value, self._max_value)
744847
def calc_hash(self, hashalg=None):
        
        fd = open(self.filename, "rb")
        buf = fd.read()
        fd.close()
        if hashalg:
            self.hashalg = hashalg.upper()
        self.hash = getattr(hashlib, self.hashalg.lower())(buf).hexdigest()
940847
def get_file_hash( fd, hashfunc, fd_len=None ):
    

    h = hashfunc()
    fd.seek(0, os.SEEK_SET)

    count = 0
    while True:
        buf = fd.read(65536)
        if len(buf) == 0:
            break

        if fd_len is not None:
            if count + len(buf) > fd_len:
                buf = buf[:fd_len - count]

        h.update(buf)
        count += len(buf)

    hashed = h.hexdigest()
    return hashed
1273831
def instance_method_hash(options)
      ChainOptions::Util.slice(options, Option::METHOD_SYMBOLS).each_with_object({}) do |(meth, value), h|
        next h[meth] = value if value.respond_to?(:call)

        h[meth] = instance.public_method(value)
      end
    end
1243696
def GetHashObject(self):
    """"""
    hash_object = rdf_crypto.Hash()
    hash_object.num_bytes = self._bytes_read
    for algorithm in self._hashers:
      setattr(hash_object, algorithm, self._hashers[algorithm].digest())
    return hash_object
1090081
def hash(self):
        '''
        
        '''
        hashed = super(Dynamic, self).hash()
        return khash(hashed, self._key, self._length)
705900
def get_stored_hash(self, temp_ver):
        
        with open(self._prefixed('%s.hash' % temp_ver.name)) as f:
            return f.read().strip()