get mapped contract_address by its hash, if not found try
        indexing.
161357
def get_contract_by_hash(self, contract_hash):
        """"""
        contract_address = self.db.reader._get_address_by_hash(contract_hash)
        if contract_address is not None:
            return contract_address

        else:
            raise AddressNotFoundError
870620
def CheckAddressState(self, script_hash):
        
        for key, contract in self._contracts.items():
            if contract.ScriptHash.ToBytes() == script_hash.ToBytes():
                return AddressState.InWallet
        for watch in self._watch_only:
            if watch == script_hash:
                return AddressState.InWallet | AddressState.WatchOnly
        return AddressState.NoState
422566
def lookup
      if !options[:street_address] and (options[:ip_address] or ip_address?)
        name = options[:ip_lookup] || Configuration.ip_lookup || Geocoder::Lookup.ip_services.first
      else
        name = options[:lookup] || Configuration.lookup || Geocoder::Lookup.street_services.first
      end
      Lookup.get(name)
    end
1264867
def get_service_address(
            self,
            block_identifier: BlockSpecification,
            index: int,
    ) -> Optional[AddressHex]:
        """"""
        try:
            result = self.proxy.contract.functions.service_addresses(index).call(
                block_identifier=block_identifier,
            )
        except web3.exceptions.BadFunctionCallOutput:
            result = None
        return result
1169907
def namedb_get_value_hash_txids(cur, value_hash):
    
    query = 'SELECT txid FROM history WHERE value_hash = ? ORDER BY block_id,vtxindex;'
    args = (value_hash,)

    rows = namedb_query_execute(cur, query, args)
    txids = []
    
    for r in rows:
        # present
        txid = str(r['txid'])
        txids.append(txid)

    return txids
382898
def get_address_transactions(self, address_id, **params):
        """"""
        return self.api_client.get_address_transactions(self.id, address_id, **params)
523106
function getContractAddress(transaction) {
    if (!transaction.from) {
        throw new Error('missing from address');
    }
    var nonce = transaction.nonce;
    return getAddress('0x' + keccak256_1.keccak256(rlp_1.encode([
        getAddress(transaction.from),
        bytes_1.stripZeros(bytes_1.hexlify(nonce))
    ])).substring(26));
}
35432
def to_query(params)
      unless params.is_a?(Hash)
        raise "Expected Hash but got #{params.class.name}"
      end
      Addressable::URI.form_encode(params)
    end
992188
function getHash(location) {
    var href = location.href;
    var hashIndex = href.indexOf('#');

    if (hashIndex === -1) {
      return '';
    } else {
      return href.substr(hashIndex);
    }
  }
480786
def get_transaction_by_tx_hash(self, tx_hash: str, is_full: bool = False) -> dict:
        
        payload = self.generate_json_rpc_payload(RpcMethod.GET_TRANSACTION, [tx_hash, 1])
        response = self.__post(self.__url, payload)
        if is_full:
            return response
        return response['result']
1143412
def get_field_mapping(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.get_field_mapping(index=self._name, **kwargs)
460313
def lookup_hash_prefix(self, cues):
        
        q = '''SELECT value, MAX(negative_expires_at < current_timestamp) AS negative_cache_expired
                FROM hash_prefix WHERE cue IN ({}) GROUP BY 1
        '''
        output = []
        with self.get_cursor() as dbc:
            dbc.execute(q.format(','.join(['?'] * len(cues))), [sqlite3.Binary(cue) for cue in cues])
            for h in dbc.fetchall():
                value, negative_cache_expired = h
                output.append((bytes(value), negative_cache_expired))
        return output
421614
def p2pkh(self, s):
        
        data = self.parse_b58_hashed(s)
        if data is None or not data.startswith(self._address_prefix):
            return None
        size = len(self._address_prefix)
        script = self._network.contract.for_p2pkh(data[size:])
        script_info = self._network.contract.info_for_script(script)
        return Contract(script_info, self._network)
801513
def check_address_has_code(
        client: 'JSONRPCClient',
        address: Address,
        contract_name: str = '',
):
    
    result = client.web3.eth.getCode(to_checksum_address(address), 'latest')

    if not result:
        if contract_name:
            formated_contract_name = '[{}]: '.format(contract_name)
        else:
            formated_contract_name = ''

        raise AddressWithoutCode(
            '{}Address {} does not contain code'.format(
                formated_contract_name,
                to_checksum_address(address),
            ),
        )
64257
def transactions_by_address(address, options = {})
      agent.transactions_by_address(self['id'], address, options) do |data, resp|
        yield(data, resp) if block_given?
      end
    end
1164127
def matches(self, address, name=None):
        

        if self.controller:
            return address == 8

        return self.address == address
319039
def lookup_blob(hash_value):
    
    try:
        blob = BlobStorage.objects.get(sha256=hash_value)
    except:
        return "Blob not found"
    return blob.content