Get a name's DID info
        Returns None if not found
437843
def get_name_DID_info(self, name):
        
        db = get_db_state(self.working_dir)
        did_info = db.get_name_DID_info(name)
        if did_info is None:
            return {'error': 'No such name', 'http_status': 404}

        return did_info
186343
def _get_uid(name):
    """"""
    if getpwnam is None or name is None:
        return None
    try:
        result = getpwnam(name)
    except KeyError:
        result = None
    if result is not None:
        return result[2]
    return None
295622
def name(self):
        """"""
        if self._name == '' and self.details != None and 'name' in self.details:
            self._name = self.details['name']
        return self._name
1046473
def get_user_if_exists(strategy, details, user=None, *args, **kwargs):
    """"""
    if user:
        return {'is_new': False}
    try:
        username = details.get('username')

        # Return the user if it exists
        return {
            'is_new': False,
            'user': User.objects.get(username=username)
        }
    except User.DoesNotExist:
        # Fall to the default return value
        pass

    # Nothing to return since we don't have a user
    return {}
672773
def get_member(self, name):
        """"""
        for member in self.members:
            if member.name == name:
                return member

        return None
582657
def get_all_names( self, offset=None, count=None, include_expired=False ):
        
        if offset is not None and offset < 0:
            offset = None

        if count is not None and count < 0:
            count = None 

        cur = self.db.cursor()
        names = namedb_get_all_names( cur, self.lastblock, offset=offset, count=count, include_expired=include_expired )
        return names
1096955
def get_id_by_name(self, obj, name):
        
        list = self.list(obj, filter='name = "{}"'.format(name),
                         only_id=True, limit=1)
        return list[name] if name in list.keys() else False
1046812
def find(self, name):
        
        collectors = self.get_collectors()

        for collector in collectors:
            if name.lower() == collector['name'].lower():
                self.collector_id = collector['id']
                return collector

        return {'status': 'No results found.'}
502510
def get_alt_name(self):
        
        if ('altName' in self.attributes and
                bool(self.attributes['altName'].strip())):
            return self.attributes['altName']
        else:
            return None
1371265
def _is_did(did):
    
    return d1_gmn.app.models.IdNamespace.objects.filter(did=did).exists()
851291
def _get_sr(name=None, session=None):
    '''
    
    '''
    if session is None:
        session = _get_session()
    srs = session.xenapi.SR.get_by_name_label(name)
    if len(srs) == 1:
        return srs[0]
    return None
1229069
def get_name(src, min_freq = 0, max_freq = 100)     
      tmp = random_sort(@db[src.to_sym].filter{(freq >= min_freq) & (freq <= max_freq)})
      tmp.count > 0 ? tmp.first[:name] : nil
    end
591035
def rpc_get_name_DID(self, name, **con_info):
        
        did_info = None
        if check_name(name):
            did_info = self.get_name_DID_info(name)
        elif check_subdomain(name):
            did_info = self.get_subdomain_DID_info(name)
        else:
            return {'error': 'Invalid name or subdomain', 'http_status': 400}

        if did_info is None:
            return {'error': 'No DID for this name', 'http_status': 404}

        did = make_DID(did_info['name_type'], did_info['address'], did_info['index'])
        return self.success_response({'did': did})
414408
def rpc_get_DID_record(self, did, **con_info):
        
        if not isinstance(did, (str,unicode)):
            return {'error': 'Invalid DID: not a string', 'http_status': 400}

        try:
            did_info = parse_DID(did)
        except:
            return {'error': 'Invalid DID', 'http_status': 400}

        res = None
        if did_info['name_type'] == 'name':
            res = self.get_name_DID_record(did)
        elif did_info['name_type'] == 'subdomain':
            res = self.get_subdomain_DID_record(did)
        
        if 'error' in res:
            return {'error': res['error'], 'http_status': res.get('http_status', 404)}

        return self.success_response({'record': res['record']})
1231595
def display_name(self):
        
        for k in self._NAME_KEYS:
            if self._raw.get(k):
                return self._raw[k]
            if "profile" in self._raw and self._raw["profile"].get(k):
                return self._raw["profile"][k]
        return self._raw["name"]
267651
def rpc_get_name_record(self, name, **con_info):
        
        res = None
        if check_name(name):
            res = self.get_name_record(name, include_expired=True, include_history=False)
        elif check_subdomain(name):
            res = self.get_subdomain_record(name, include_history=False)
        else:
            return {'error': 'Invalid name or subdomain', 'http_status': 400}

        if 'error' in res:
            return {'error': res['error'], 'http_status': 404}

        # also get a DID
        did_info = None
        did = None
        if check_name(name):
            did_info = self.get_name_DID_info(name)
        elif check_subdomain(name):
            did_info = self.get_subdomain_DID_info(name)
        else:
            return {'error': 'Invalid name or subdomain', 'http_status': 400}

        if did_info is not None:
            did = make_DID(did_info['name_type'], did_info['address'], did_info['index'])
            res['record']['did'] = did

        return self.success_response({'record': res['record']})
1209928
def _get_id(self):
        """"""
        return ''.join(map(str,
                           filter(is_not_None,
                                  [self.Prefix, self.Name])))