Retrieves an instance of a specific hasher.

    Args:
      hasher_name (str): the name of the hasher to retrieve.

    Returns:
      BaseHasher: hasher.

    Raises:
      KeyError: if hasher class is not set for the corresponding name.
510813
def GetHasher(cls, hasher_name):
    
    hasher_name = hasher_name.lower()
    if hasher_name not in cls._hasher_classes:
      raise KeyError(
          'hasher class not set for name: {0:s}.'.format(hasher_name))

    hasher_class = cls._hasher_classes[hasher_name]
    return hasher_class()
173444
def get_storage_pool_by_name(self, name):
        
        for storage_pool in self.conn.storage_pools:
            if storage_pool.name == name:
                return storage_pool
        raise KeyError("Storage pool of that name not found")
814213
def get_hash(self):
        
        if not self.executed:
            raise pyhsm.exception.YHSM_Error("HMAC-SHA1 hash not available, before execute().")
        return self.result.hash_result
884178
def hash_to_model(klass_name, hash)
      model_klass =
        if self.class.const_defined?("#{self.class}::#{klass_name}")
          self.class.const_get(klass_name)
        else
          self.class.const_set(klass_name, Class.new(HashModel))
        end
      model_klass.new(hash)
    end
1167810
def lookup(self, key_name, headers=None, callback=None):
        
        return self.get_key(key_name, headers=headers, callback=callback)
1361888
def lookup(cls, name):
        
        try:
            field = cls.FIELDS[name]
        except KeyError:
            # Is it a custom attribute?
            field = TorrentProxy.add_manifold_attribute(name)

        return {"matcher": field._matcher} if field else None
1298875
def get(self, name: str):
        
        dep = None
        try:
            dep = self._registry[name]
        except KeyError:
            raise DependencyNotFoundError(name) from None
        value = self.cached(dep)
        if value is None:
            value = dep.factory()
            self.cache(dep, value)
        return value
1024385
def _get_hash_object(hash_algo_name):
    
    algorithms = (hashlib.algorithms_guaranteed if six.PY3
                  else hashlib.algorithms)
    if hash_algo_name not in algorithms:
        msg = ("Unsupported/Invalid hash name '%s' provided."
               % hash_algo_name)
        raise exception.InvalidInputError(msg)

    return getattr(hashlib, hash_algo_name)()
538002
def getblock(self, hash: str) -> dict:
        ''''''

        return cast(dict, self.api_fetch('getblock?hash=' + hash))
464826
def get_attribute(instance, attrs):
    
    for attr in attrs:
        if instance is None:
            # Break out early if we get `None` at any point in a nested lookup.
            return None
        try:
            if isinstance(instance, collections.Mapping):
                instance = instance[attr]
            else:
                instance = getattr(instance, attr)
        except ObjectDoesNotExist:
            return None
        if is_simple_callable(instance):
            try:
                instance = instance()
            except (AttributeError, KeyError) as exc:
                # If we raised an Attribute or KeyError here it'd get treated
                # as an omitted field in `Field.get_attribute()`. Instead we
                # raise a ValueError to ensure the exception is not masked.
                raise ValueError('Exception raised in callable attribute "{0}"; original exception was: {1}'.format(attr, exc))

    return instance
529865
def get_subclass(cls, name):
        
        for subclass in cls.__subclasses__():
            if subclass.name == name:
                return subclass
        raise NameError("Not a valid Benchmark class: " + name)
102980
def get_class(name) #:nodoc:
      raise ArgumentError, "class name is blank" if blank?(name)

      response = call_server(:method => :get, :uri => "class/#{@database}/#{name}")
      rslt = process_response(response) do
        raise NotFoundError, 'class not found' if response.body =~ /Invalid class/
      end

      classes = [rslt]
      decorate_classes_with_model(classes)
      clazz = classes[0]
      clazz.extend Orientdb4r::HashExtension
      clazz.extend Orientdb4r::OClass
      unless clazz['properties'].nil? # there can be a class without properties
        clazz.properties.each do |prop|
          prop.extend Orientdb4r::HashExtension
          prop.extend Orientdb4r::Property
        end
      end

      clazz
    end
252651
def get(self, name):
        
        # do import here to keep soft dependency
        import requests

        # append base url to requested name
        url = urljoin(self.base_url, name)
        # fetch the data from the remote url
        response = requests.get(url)
        # return the bytes of the response
        return response.content
1198363
def get_account_from_hash(self, account_hash):
        
        for account in self.accounts:
            if account.__hash__() == account_hash:
                return account
        return None
674281
def hash(self):
        '''
        
        '''
        if self._hash is None:
            self._initialize()
            self._hash = khash(type(self).__name__, self._default_value, self._fuzzable)
        return self._hash
1182255
def instance(cls, name):
        
        if not cls._instance.get(name):
            model_name = name.split('.')
            ins_name = '.'.join(
                ['models', model_name[0], 'model', model_name[1]])
            cls._instance[name] = cls.import_model(ins_name)()

        return cls._instance[name]
1087626
def get_item(cls, hash_key, range_key=None):
        
        key = cls._encode_key(hash_key, range_key)
        raw_data = cls._get_connection().get_item(cls.get_table_name(), key)
        if 'Item' not in raw_data:
            raise ItemNotFoundException
        return cls.from_raw_data(raw_data['Item'])