Takes a name, and returns the owner of the deepest subdomain that has an owner

        :returns: (owner or None, list(unowned_subdomain_labels), first_owned_domain)
978117
def _first_owner(self, name):
        
        owner = None
        unowned = []
        pieces = normalize_name(name).split('.')
        while pieces and is_none_or_zero_address(owner):
            name = '.'.join(pieces)
            owner = self.owner(name)
            if is_none_or_zero_address(owner):
                unowned.append(pieces.pop(0))
        return (owner, unowned, name)
223670
def get_owner(gh, owner):
    """"""
    try:
        u = gh.user(owner)
        name = u.name or u.login
        company = u.company or ''
        return [dict(name=name, affiliation=company)]
    except Exception:
        return None
709516
def owner(self):
        
        if self._owner:
            return self._owner
        elif not self.abstract:
            return self.read_meta()._owner

        raise EmptyDocumentException()
1273141
def subdomains(self, value=None):
        
        if value is not None:
            return URL._mutate(self, host='.'.join(value))
        return self.host().split('.')
194108
def __get_owner_windows(self):
        
        desc = win32security.GetFileSecurity(
            self, win32security.OWNER_SECURITY_INFORMATION)
        sid = desc.GetSecurityDescriptorOwner()
        account, domain, typecode = win32security.LookupAccountSid(None, sid)
        return domain + '\\' + account
862895
def owned_ecs(self):
        ''''''
        with self._mutex:
            if not self._owned_ecs:
                self._owned_ecs = [ExecutionContext(ec,
                    self._obj.get_context_handle(ec)) \
                    for ec in self._obj.get_owned_contexts()]
        return self._owned_ecs
261350
def get_subdomains_owned_by_address(address, db_path=None, zonefiles_dir=None):
    
    opts = get_blockstack_opts()
    if not is_subdomains_enabled(opts):
        return []

    if db_path is None:
        db_path = opts['subdomaindb_path']

    if zonefiles_dir is None:
        zonefiles_dir = opts['zonefiles']

    db = SubdomainDB(db_path, zonefiles_dir)
    return db.get_subdomains_owned_by_address(address)
459304
def owners(self):
        """"""
        result = set()
        for role in self._OWNER_ROLES:
            for member in self._bindings.get(role, ()):
                result.add(member)
        return frozenset(result)
624360
def match_owner(self, url):
        
        for owner in self.issuer_keys.keys():
            if owner.startswith(url):
                return owner

        raise KeyError("No keys for '{}' in this keyjar".format(url))
381889
def owner_profile(self) -> 'Profile':
        """"""
        if not self._owner_profile:
            if 'username' in self._node['owner']:
                owner_struct = self._node['owner']
            else:
                # Sometimes, the 'owner' structure does not contain the username, only the user's ID.  In that case,
                # this call triggers downloading of the complete Post metadata struct, where the owner username
                # is contained.
                # Note that we cannot use Profile.from_id() here since that would lead us into a recursion.
                owner_struct = self._full_metadata['owner']
            self._owner_profile = Profile(self._context, owner_struct)
        return self._owner_profile
224993
def _get_network_owners(network_id):
    
    owners_i = db.DBSession.query(NetworkOwner).filter(
                        NetworkOwner.network_id==network_id).options(noload('network')).options(joinedload_all('user')).all()

    owners = [JSONObject(owner_i) for owner_i in owners_i]

    return owners
749318
def get_names_owned_by_address(address, proxy=None, hostport=None):
    
    assert proxy or hostport, 'Need proxy or hostport'
    if proxy is None:
        proxy = connect_hostport(hostport)

    owned_schema = {
        'type': 'object',
        'properties': {
            'names': {
                'type': 'array',
                'items': {
                    'type': 'string',
                    'uniqueItems': True
                },
            },
        },
        'required': [
            'names',
        ],
    }

    schema = json_response_schema( owned_schema )

    resp = {}
    try:
        resp = proxy.get_names_owned_by_address(address)
        resp = json_validate(schema, resp)
        if json_is_error(resp):
            return resp

        # names must be valid
        for n in resp['names']:
            assert is_name_valid(str(n)), ('Invalid name "{}"'.format(str(n)))

    except ValidationError as ve:
        if BLOCKSTACK_DEBUG:
            log.exception(ve)

        resp = {'error': 'Server response did not match expected schema.  You are likely communicating with an out-of-date Blockstack node.', 'http_status': 502}
        return resp

    except AssertionError as e:
        if BLOCKSTACK_DEBUG:
            log.exception(e)

        resp = {'error': 'Got an invalid name from the server'}
        return resp

    except socket.timeout:
        log.error("Connection timed out")
        resp = {'error': 'Connection to remote host timed out.', 'http_status': 503}
        return resp

    except socket.error as se:
        log.error("Connection error {}".format(se.errno))
        resp = {'error': 'Connection to remote host failed.', 'http_status': 502}
        return resp

    except Exception as ee:
        if BLOCKSTACK_DEBUG:
            log.exception(ee)

        log.error("Caught exception while connecting to Blockstack node: {}".format(ee))
        resp = {'error': 'Failed to contact Blockstack node.  Try again with `--debug`.', 'http_status': 500}
        return resp

    return resp['names']
728056
def user(self):
        
        # Note, do any tasks really have an "owner_id", or are they all
        # "owner"?
        owner_id = getattr(self.task, 'owner_id', self.task.owner)
        return self.task.connection.cache.user_name(owner_id)
441029
def tagger(self):
        
        domain = 0
        if domain not in self.domains:
            self.register_domain(domain=domain)
        return self.domains[domain].tagger
350941
def get_hosted_zone_id_for_domain(self, domain):
        
        all_zones = self.get_all_zones()
        return self.get_best_match_zone(all_zones, domain)
1307232
def relativize(self, origin):
        

        if not origin is None and self.is_subdomain(origin):
            return Name(self[: -len(origin)])
        else:
            return self
213189
def getNameOwner(self, busName):
        
        d = self.callRemote(
            '/org/freedesktop/DBus',
            'GetNameOwner',
            interface='org.freedesktop.DBus',
            signature='s',
            body=[busName],
            destination='org.freedesktop.DBus',
        )
        return d