get a class from name within a module
964881
def getClassInModuleFromName(className, module):
    
    n = getAvClassNamesInModule(module)
    i = n.index(className)
    c = getAvailableClassesInModule(module)
    return c[i]
499483
def get_plugin_from_string(plugin_name):
    
    modulename, classname = plugin_name.rsplit('.', 1)
    module = import_module(modulename)
    return getattr(module, classname)
1158472
def get_module_toc(mod_name):
    ""
    mod = import_mod(mod_name)
    ft_names = mod.__all__ if hasattr(mod,'__all__') else get_ft_names(mod)
    ft_names.sort(key = str.lower)
    tabmat = ''
    for ft_name in ft_names:
        tabmat += f'- [{ft_name}](#{ft_name})\n'
        elt = getattr(mod, ft_name)
        if inspect.isclass(elt) and not is_enum(elt.__class__):
            in_ft_names = get_inner_fts(elt)
            for name in in_ft_names:
                tabmat += f'  - [{name}](#{name})\n'
    display(Markdown(tabmat))
933670
function getSubclassNames(spec_c) {
  return _.map(getChildren(spec_c, 'innerclass'), function(innerclass) {
    return getText(innerclass).replace(xml2js.opts.module + '::', '');
  });
}
595484
def get_obj_module(qualname):
    """"""
    modname = qualname
    classname = None
    attrname = None
    while modname not in sys.modules:
        attrname = classname
        modname, classname = modname.rsplit('.', 1)

    # retrieve object and find original module name
    if classname:
        cls = getattr(sys.modules[modname], classname)
        modname = cls.__module__
        obj = getattr(cls, attrname) if attrname else cls
    else:
        obj = None

    return obj, sys.modules[modname]
933806
def get_class(class_path):
        
        module_path, class_name = class_path.rsplit(".", 1)

        try:
            module = __import__(class_path, fromlist=[class_name])
        except ImportError:
            raise ValueError('Class {0} could not be imported'.format(class_path))

        try:
            cls = getattr(module, class_name)
        except AttributeError:
            raise ValueError("Module '%s' has no class '%s'" % (module_path, class_name,))

        try:
            instance = cls()
        except TypeError as type_error:
            raise ValueError('Failed to instantiate class {0}. Error: {1}'.format(class_name, type_error.message))

        return instance
1106946
def get_class_by_name( name )
      raise "get_class_by_name #{name}.#{name.class}" unless name.is_a?(Symbol)
      c = classes[name]
      #puts "MISS, no class #{name} #{name.class}" unless c # " #{classes}"
      #puts "CLAZZ, #{name} #{c.get_type.get_length}" if c
      c
    end
785929
def get_qualified_name(_object):
    """"""
    module = _object.__module__
    if hasattr(_object, '__name__'):
        _class = _object.__name__

    else:
        _class = _object.__class__.__name__

    return module + '.' + _class
1364091
def load_from_namespace(module_name):
        
        class_inst = None
        name = "py3status.modules.{}".format(module_name)
        py_mod = __import__(name)
        components = name.split(".")
        for comp in components[1:]:
            py_mod = getattr(py_mod, comp)
        class_inst = py_mod.Py3status()
        return class_inst
684270
def get_complete_class_name(class_or_module, name = class_or_module.name)
      if !class_or_module.parent.name.nil? && class_or_module.parent.is_a?(RDoc::NormalModule)
        get_complete_class_name(class_or_module.parent, "#{class_or_module.parent.name}::#{name}")
      else
        name
      end
    end
305592
def import_class(name):
    

    module, _, klass = name.rpartition('.')
    mod = import_module(module)
    return getattr(mod, klass)
540821
def get(self, name=None):
        
        if name is None:
            return self._classes
        else:
            if name not in self._classes.keys():
                return None
            else:
                return self._classes[name]
1217747
def fetch_class(full_class_name):
    
    (module_name, class_name) = full_class_name.rsplit('.', 1)
    module = importlib.import_module(module_name)
    return getattr(module, class_name)
444222
def get_classes(modName):
    """"""
    classNames = []
    for name, obj in inspect.getmembers(sys.modules[modName]):
        if inspect.isclass(obj):
            classNames.append(name)

    return classNames
718131
def import_cls(cls_name):
    
    path_components = cls_name.split('.')
    module = __import__('.'.join(path_components[:-1]),
                        locals(),
                        globals(),
                        fromlist=path_components[-1:])
    return getattr(module, path_components[-1])
983855
def class_for(module_name)
    begin
      class_const = @session.namespace_const.const_get(module_name.classify)
      klass = class_const.new
    rescue NameError
      raise InvalidModule, "Module: #{module_name} is not registered"
    end
  end
1243466
def get_attr(name):
    
    i = name.rfind('.')
    cls = str(name[i+1:])
    module = str(name[:i])

    mod = __import__(module, fromlist=[cls])
    return getattr(mod, cls)