Lookup a set of notifications by address
        Args:
            address (UInt160 or str): hash of address for notifications

        Returns:
            list: a list of notifications
351929
def get_by_addr(self, address):
        
        addr = address
        if isinstance(address, str) and len(address) == 34:
            addr = Helper.AddrStrToScriptHash(address)

        if not isinstance(addr, UInt160):
            raise Exception("Incorrect address format")

        addrlist_snapshot = self.db.prefixed_db(NotificationPrefix.PREFIX_ADDR).snapshot()
        results = []

        for val in addrlist_snapshot.iterator(prefix=bytes(addr.Data), include_key=False):
            if len(val) > 4:
                try:
                    event = SmartContractEvent.FromByteArray(val)
                    results.append(event)
                except Exception as e:
                    logger.error("could not parse event: %s %s" % (e, val))
        return results
905394
def _get_callsites(self, function_address):
        

        all_predecessors = []

        nodes = self.get_all_nodes(function_address)
        for n in nodes:
            predecessors = list(self.get_predecessors(n))
            all_predecessors.extend(predecessors)

        return all_predecessors
1211327
def _get_addresses(self, text):
        ''''''
        # find addresses
        addresses = []
        matches = utils.findall(
            self.rules,
            text,
            flags=re.VERBOSE | re.U)

        if(matches):
            for match in matches:
                addresses.append(match[0].strip())
        return addresses
294533
def get_addresses(self, account_id, **params):
        """"""
        response = self._get('v2', 'accounts', account_id, 'addresses', params=params)
        return self._make_api_object(response, Address)
803859
def postadressen(self):
        '''
         
        '''
        return [h.postadres for h in self.huisnummers if h.status.id == '3']
466639
def notify(self, state, notifications):
        '''
        
        '''

        def do_append(desc, notifications):
            for notification in notifications:
                if not isinstance(notification, PendingNotification):
                    raise ValueError("Expected notify() params to be a list "
                                     "of PendingNotification instance, got %r."
                                     % notification)
                key = str(notification.recipient.key)
                if key not in desc.pending_notifications:
                    desc.pending_notifications[key] = list()
                desc.pending_notifications[key].append(notification)

        return state.agent.update_descriptor(do_append, notifications)
108300
def notifylists(self):
        
        import ns1.rest.monitoring
        return ns1.rest.monitoring.NotifyLists(self.config)
381339
def parse_address(self, address_line):
        
        params = {"term": address_line}
        json = self._make_request('/address/getParsedAddress', params)
        if json is None:
            return None
        return Address.from_json(json)
316157
def lists_for_email(self, email_address):
        """"""
        params = {"email": email_address}
        response = self._get(self.uri_for("listsforemail"), params=params)
        return json_to_py(response)
787475
def getaddress(self):
        """"""
        self.commentlist = []
        self.gotonext()

        oldpos = self.pos
        oldcl = self.commentlist
        plist = self.getphraselist()

        self.gotonext()
        returnlist = []

        if self.pos >= len(self.field):
            # Bad email address technically, no domain.
            if plist:
                returnlist = [(SPACE.join(self.commentlist), plist[0])]

        elif self.field[self.pos] in '.@':
            # email address is just an addrspec
            # this isn't very efficient since we start over
            self.pos = oldpos
            self.commentlist = oldcl
            addrspec = self.getaddrspec()
            returnlist = [(SPACE.join(self.commentlist), addrspec)]

        elif self.field[self.pos] == ':':
            # address is a group
            returnlist = []

            fieldlen = len(self.field)
            self.pos += 1
            while self.pos < len(self.field):
                self.gotonext()
                if self.pos < fieldlen and self.field[self.pos] == ';':
                    self.pos += 1
                    break
                returnlist = returnlist + self.getaddress()

        elif self.field[self.pos] == '<':
            # Address is a phrase then a route addr
            routeaddr = self.getrouteaddr()

            if self.commentlist:
                returnlist = [(SPACE.join(plist) + ' (' +
                               ' '.join(self.commentlist) + ')', routeaddr)]
            else:
                returnlist = [(SPACE.join(plist), routeaddr)]

        else:
            if plist:
                returnlist = [(SPACE.join(self.commentlist), plist[0])]
            elif self.field[self.pos] in self.specials:
                self.pos += 1

        self.gotonext()
        if self.pos < len(self.field) and self.field[self.pos] == ',':
            self.pos += 1
        return returnlist
719179
def onelineaddress(self, address, **kwargs):
        '''
        '''
        fields = {
            'address': address,
        }

        return self._fetch('onelineaddress', fields, **kwargs)
149394
def get_unspents(address, bitcoind):
    
    assert BLOCKSTACK_TEST, 'get_unspents can only be used in test mode!'

    addresses = [address]
    
    min_confirmations = 0
    max_confirmation = 2000000000  # just a very large number for max
    unspents = bitcoind.listunspent(min_confirmations, max_confirmation, addresses)

    if BLOCKSTACK_TEST and len(unspents) == 0:
        try:
            bitcoind.importaddress(str(address))
            unspents = bitcoind.listunspent(min_confirmations, max_confirmation, addresses)
        except Exception as e:
            return format_unspents([])

    return format_unspents(unspents)
954525
def get_addresses(self, fetch=False):
        """"""
        return Addresses(self.resource.addresses, self.client, populate=fetch)
782508
def recipient_address_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/recipient_addresses/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
652133
def get_address(self):
        
        resource_list = self.get_resource()
        try:
            return [resource['address'] for resource in resource_list]
        except (KeyError, TypeError):
            try:
                if isinstance(resource_list, dict):
                    resource_list = [resource_list]
                return [resource['Address'] for resource in resource_list]
            except (KeyError, TypeError) as exc:
                print(exc)
46852
def do_notification_list(mc, args):
    ''''''
    fields = {}
    if args.limit:
        fields['limit'] = args.limit
    if args.offset:
        fields['offset'] = args.offset
    if args.sort_by:
        sort_by = args.sort_by.split(',')
        for field in sort_by:
            field_values = field.lower().split()
            if len(field_values) > 2:
                print("Invalid sort_by value {}".format(field))
            if field_values[0] not in allowed_notification_sort_by:
                print("Sort-by field name {} is not in [{}]".format(field_values[0],
                                                                    allowed_notification_sort_by))
                return
            if len(field_values) > 1 and field_values[1] not in ['asc', 'desc']:
                print("Invalid value {}, must be asc or desc".format(field_values[1]))
        fields['sort_by'] = args.sort_by

    try:
        notification = mc.notifications.list(**fields)
    except osc_exc.ClientException as he:
        raise osc_exc.CommandError(
            'ClientException code=%s message=%s' %
            (he.code, he.message))
    else:
        if args.json:
            print(utils.json_formatter(notification))
            return
        cols = ['name', 'id', 'type', 'address', 'period']
        formatters = {
            'name': lambda x: x['name'],
            'id': lambda x: x['id'],
            'type': lambda x: x['type'],
            'address': lambda x: x['address'],
            'period': lambda x: x['period'],
        }
        if isinstance(notification, list):

            utils.print_list(
                notification,
                cols,
                formatters=formatters)
        else:
            notif_list = list()
            notif_list.append(notification)
            utils.print_list(notif_list, cols, formatters=formatters)
988981
def address(self, s):
        
        s = parseable_str(s)
        return self.p2pkh(s) or self.p2sh(s) or self.p2pkh_segwit(s) or self.p2sh_segwit(s)