Get a callback fully-qualified name.

    If no name can be produced ``repr(cb)`` is called and returned.
492565
def get_callback_name(cb):
    
    segments = []
    try:
        segments.append(cb.__qualname__)
    except AttributeError:
        try:
            segments.append(cb.__name__)
            if inspect.ismethod(cb):
                try:
                    # This attribute doesn't exist on py3.x or newer, so
                    # we optionally ignore it... (on those versions of
                    # python `__qualname__` should have been found anyway).
                    segments.insert(0, cb.im_class.__name__)
                except AttributeError:
                    pass
        except AttributeError:
            pass
    if not segments:
        return repr(cb)
    else:
        try:
            # When running under sphinx it appears this can be none?
            if cb.__module__:
                segments.insert(0, cb.__module__)
        except AttributeError:
            pass
        return ".".join(segments)
1006353
def parse_fully_qualified_name(fq_name: str) -> Tuple[Optional[str], str]:
    
    last_dot = fq_name.rfind('.')
    if last_dot != -1:
        return fq_name[:last_dot], fq_name[last_dot + 1:]
    else:
        return None, fq_name
253950
def get_name(self, name):
        """"""
        if name not in self.get_names():
            raise exceptions.NameNotFoundError('name %s not found' % name)
        return self.get_names()[name]
883149
function getname(req, res) {
  res.send(null, req.conn.client.name);
}
648229
def get_callable_name(c):
    
    if hasattr(c, 'name'):
        return six.text_type(c.name)
    elif hasattr(c, '__name__'):
        return six.text_type(c.__name__) + u'()'
    else:
        return six.text_type(c)
151924
def _get_check_versioned_name(self, check_name):
        
        if ':' not in check_name or ':latest' in check_name:
            check_name = ':'.join((check_name.split(':')[0],
                                   self.checkers[check_name]._cc_spec_version))
        return check_name
31719
def check_name(self, name=None):
        '''
        
        '''
        if name:
            self.plugin_info['check_name'] = name

        if self.plugin_info['check_name'] is not None:
            return self.plugin_info['check_name']

        return self.__class__.__name__
1367866
def get_name(component):
    
    if six.callable(component):
        name = getattr(component, "__qualname__", component.__name__)
        return '.'.join([component.__module__, name])
    return str(component)
24540
def get_name(self):
        
        dependent_host_name = 'unknown'
        if getattr(self, 'dependent_host_name', None):
            dependent_host_name = getattr(
                getattr(self, 'dependent_host_name'), 'host_name', 'unknown'
            )
        host_name = 'unknown'
        if getattr(self, 'host_name', None):
            host_name = getattr(getattr(self, 'host_name'), 'host_name', 'unknown')
        return dependent_host_name + '/' + host_name
1156769
def qualified_name(self):
        

        parent = self.full_parent_name
        if parent:
            return parent + ' ' + self.name
        else:
            return self.name
95923
def _get_reconciled_name_object(self, other):
        
        name = get_op_result_name(self, other)
        if self.name != name:
            return self._shallow_copy(name=name)
        return self
488109
def callback(name, params, returns)
      params, returns = generate_signature(params, returns)
      super name.to_sym, params, returns
    end
983304
def get_name(self, host_name):
        
        if wildcard_match(self._pattern, host_name):
            return host_name
        else:
            return self._fallback
1158031
def namedb_get_name(cur, name, current_block, include_expired=False, include_history=True, only_registered=True):
    

    if not include_expired:

        unexpired_fragment, unexpired_args = namedb_select_where_unexpired_names(current_block, only_registered=only_registered)
        select_query = "SELECT name_records.* FROM name_records JOIN namespaces ON name_records.namespace_id = namespaces.namespace_id " + \
                       "WHERE name = ? AND " + unexpired_fragment + ";"
        args = (name, ) + unexpired_args

    else:
        select_query = "SELECT * FROM name_records WHERE name = ?;"
        args = (name,)

    # log.debug(namedb_format_query(select_query, args))

    name_rows = namedb_query_execute( cur, select_query, args )
    name_row = name_rows.fetchone()
    if name_row is None:
        # no such name
        return None 

    name_rec = {}
    name_rec.update( name_row )
    
    if include_history:
        name_history = namedb_get_history( cur, name )
        name_rec['history'] = name_history

    return name_rec
741704
def full_name(self):
        """"""
        if self.requested_version is not None:
            return '%s-%s' % (self.name, self.requested_version)
        return self.name
767475
def _name_helper(name: str):
    
    name = name.rstrip()
    if name.endswith(('.service', '.socket', '.target')):
        return name
    return name + '.service'
874713
def _get_placeholder_repr(self):
        """"""
        placeholder = '...'
        if self.TRANSFORM is not None:
            placeholder = '%s(%s)' % (self.TRANSFORM.__name__, placeholder)
        return placeholder