This method finds the first parent class which is within the buildbot namespace
    it prepends the name with as many ">" as the class is subclassed
568
def getName(obj):
    
    # elastic search does not like '.' in dict keys, so we replace by /
    def sanitize(name):
        return name.replace(".", "/")
    if isinstance(obj, _BuildStepFactory):
        klass = obj.factory
    else:
        klass = type(obj)
    name = ""
    klasses = (klass, ) + inspect.getmro(klass)
    for klass in klasses:
        if hasattr(klass, "__module__") and klass.__module__.startswith("buildbot."):
            return sanitize(name + klass.__module__ + "." + klass.__name__)
        else:
            name += ">"
    return sanitize(type(obj).__name__)
719708
def _make_subclasshook(cls):
    
    if isinstance(cls.__extra__, abc.ABCMeta):
        # The logic mirrors that of ABCMeta.__subclasscheck__.
        # Registered classes need not be checked here because
        # cls and its extra share the same _abc_registry.
        def __extrahook__(subclass):
            res = cls.__extra__.__subclasshook__(subclass)
            if res is not NotImplemented:
                return res
            if cls.__extra__ in subclass.__mro__:
                return True
            for scls in cls.__extra__.__subclasses__():
                if isinstance(scls, GenericMeta):
                    continue
                if issubclass(subclass, scls):
                    return True
            return NotImplemented
    else:
        # For non-ABC extras we'll just call issubclass().
        def __extrahook__(subclass):
            if cls.__extra__ and issubclass(subclass, cls.__extra__):
                return True
            return NotImplemented
    return __extrahook__
186146
private static String discoverClassName(ClassLoader tccl) {
        String className = null;

        // First services API
        className = getClassNameServices(tccl);
        if (className == null) {
            if (IS_SECURITY_ENABLED) {
                className = AccessController.doPrivileged(
                                new PrivilegedAction<String>() {
                                    @Override
                                    public String run() {
                                        return getClassNameJreDir();
                                    }
                                }
                                );
            } else {
                // Second el.properties file
                className = getClassNameJreDir();
            }
        }
        if (className == null) {
            if (IS_SECURITY_ENABLED) {
                className = AccessController.doPrivileged(
                                new PrivilegedAction<String>() {
                                    @Override
                                    public String run() {
                                        return getClassNameSysProp();
                                    }
                                }
                                );
            } else {
                // Third system property
                className = getClassNameSysProp();
            }
        }
        if (className == null) {
            // Fourth - default
            className = "org.apache.el.ExpressionFactoryImpl";
        }
        return className;
    }
72527
def parent(self):
        
        p = self._lib.dirname(self.path)
        p = self.__class__(p)
        return p
452855
def qualify_class_name(klass_name)
    unless @namespace.nil? || @namespace.blank? || klass_name.include?('::')
      namespaces = @namespace.split(/\.|::/)
      namespaces << klass_name
      klass_name = namespaces.join '::'
    end
    klass_name.camelize
  end
106238
@Override
  public String extractClassNameIfProvide(Node node, Node parent) {
    String namespace = extractClassNameIfGoog(node, parent, "goog.provide");
    if (namespace == null) {
      namespace = extractClassNameIfGoog(node, parent, "goog.module");
    }
    return namespace;
  }
858278
def find_embedded_parent(self, element):
        
        result = None
        for t in self.types:
            if (element.start > self.types[t].start and
                element.end < self.types[t].end):
                result = self.types[t]
                break
        else:
            for iexec in self.executables:
                if (element.start > self.executables[iexec].start and
                    element.end < self.executables[iexec].end):
                    result = self.executables[iexec]
                    break

        return result
483810
private static SubclassType typeofClassDefiningName(Node callName) {
    // Check if the method name matches one of the class-defining methods.
    String methodName = null;
    if (callName.isGetProp()) {
      methodName = callName.getLastChild().getString();
    } else if (callName.isName()) {
      String name = callName.getString();
      int dollarIndex = name.lastIndexOf('$');
      if (dollarIndex != -1) {
        methodName = name.substring(dollarIndex + 1);
      }
    }

    if (methodName != null) {
      if (methodName.equals("inherits")) {
        return SubclassType.INHERITS;
      } else if (methodName.equals("mixin")) {
        return SubclassType.MIXIN;
      }
    }
    return null;
  }
381327
def class_names op, deep_inheritance = false
    ret = []
    unless op.is_a? Sfcc::Cim::ObjectPath
      op = Sfcc::Cim::ObjectPath.new(op.to_s, nil) # assume namespace
    end
    flags = deep_inheritance ? Sfcc::Flags::DeepInheritance : 0
    begin
      @client.class_names(op, flags).each do |name|
	ret << name.to_s
      end
    rescue Sfcc::Cim::ErrorInvalidNamespace
    end
    ret
  end
537659
def class_names op, deep_inheritance = false
    @options.flags = Openwsman::FLAG_ENUMERATION_OPTIMIZATION
    @options.max_elements = 999
    namespace = (op.is_a? Sfcc::Cim::ObjectPath) ? op.namespace : op
    classname = (op.is_a? Sfcc::Cim::ObjectPath) ? op.classname : nil
    case @product
    when :openwsman
      if @product_version < "2.2"
        STDERR.puts "ENUMERATE_CLASS_NAMES unsupported for #{@product_vendor} #{@product_version}, please upgrade"
        return []
      end
      method = Openwsman::CIM_ACTION_ENUMERATE_CLASS_NAMES
      uri = Openwsman::XML_NS_CIM_INTRINSIC
      @options.cim_namespace = namespace
      @options.add_selector("DeepInheritance", "True") if deep_inheritance
      result = @client.invoke( @options, uri, method )
    when :winrm
      # see https://github.com/kkaempf/openwsman/blob/master/bindings/ruby/tests/winenum.rb
      filter = Openwsman::Filter.new
      query = "select * from meta_class"
      query << " where __SuperClass is #{classname?classname:'null'}" unless deep_inheritance
      filter.wql query
      uri = "#{@prefix}#{namespace}/*"
      result = @client.enumerate( @options, filter, uri )
    else
      raise "Unsupported for WSMAN product #{@product}"
    end
    
    if _handle_fault @client, result
      return []
    end
    
    classes = []
    
    case @product
    when :openwsman
      # extract invoke result
      output = result.body[method]
      output.each do |c|
        classes << c.to_s
      end
    when :winrm
      # extract enumerate/pull result
      loop do
        output = result.Items
        output.each do |node|
          classes << node.name.to_s
        end if output
        context = result.context
        break unless context
        # get the next chunk
        result = @client.pull( @options, nil, uri, context)
        break if _handle_fault @client, result
      end
    end
    return classes
  end
54339
def parent_class_inspector
      @parent_class_inspector ||= ParentClass.new(parsed_source:        class_introspector.parsed_source,
                                                  klasses_to_be_mocked: klasses_to_be_mocked,
                                                  mock_append_name:     mock_append_name).call
    end
1091789
private void exploreClass(Class<?>  clazzToAdd) throws IntrospectionException{
		List<InnerPropertyDescriptor> classList=getProperties(clazzToAdd);
	
		for (InnerPropertyDescriptor descriptor:classList){
			map.put(descriptor.getName(),descriptor);
		}
			
		this.list.addAll(classList);

		Class<?>  superClazz=clazzToAdd.getSuperclass();
		if (superClazz !=null){
			exploreClass(superClazz);
		}
	}
519628
def first_parent(tag, nodename):
    
    if nodename is not None and type(nodename) == str:
        nodename = [nodename]
    return first(list(filter(lambda tag: tag.name in nodename, tag.parents)))
449049
def _subclass_container(self):
        
        _parent_class = self

        class GetWrapper(Get):

            def __init__(self):
                self._parent_class = _parent_class

        class PostWrapper(Post):

            def __init__(self):
                self._parent_class = _parent_class

        class PutWrapper(Put):

            def __init__(self):
                self._parent_class = _parent_class

        class PatchWrapper(Patch):

            def __init__(self):
                self._parent_class = _parent_class

        class DeleteWrapper(Delete):

            def __init__(self):
                self._parent_class = _parent_class

        class InteractiveWrapper(Interactive):

            def __init__(self):
                self._parent_class = _parent_class

        return {"get": GetWrapper,
                "post": PostWrapper,
                "put": PutWrapper,
                "patch": PatchWrapper,
                "delete": DeleteWrapper,
                "interactive": InteractiveWrapper}
776950
def _getParentSpatialPoolerClass(name):
    
    baseClassList = list(_getPoolerClass(name).__bases__)
    spatialPoolerParent = None
    while len(baseClassList) > 0 and spatialPoolerParent is None:
      v = baseClassList.pop()
      if v.__name__ is "SpatialPooler":
        spatialPoolerParent = v
      if v.__name__ is not 'object':
        baseClassList += list(v.__bases__)

    if spatialPoolerParent is None:
      raise RuntimeError("Union pooler class does not inherit from "
                         "spatial pooler class")
    return spatialPoolerParent
340921
def _init_class(self, cls, peg_rule, position, position_end=None,
                    inherits=None, root=False, rule_type=RULE_MATCH):
        
        cls._tx_metamodel = self

        # Attribute information (MetaAttr instances) keyed by name.
        cls._tx_attrs = OrderedDict()

        # A list of inheriting classes
        cls._tx_inh_by = inherits if inherits else []

        cls._tx_position = position

        cls._tx_position_end = \
            position if position_end is None else position_end

        # The type of the rule this meta-class results from.
        # There are three rule types: common, abstract and match
        # Base types are match rules.
        cls._tx_type = rule_type

        cls._tx_peg_rule = peg_rule
        if peg_rule:
            peg_rule._tx_class = cls

        # Push this class and PEG rule in the current namespace
        current_namespace = self.namespaces[self._namespace_stack[-1]]
        cls._tx_fqn = self._cls_fqn(cls)
        current_namespace[cls.__name__] = cls

        if root:
            self.rootcls = cls
126466
def find_subclass(cls, name):
        """"""
        if name == cls.__name__:
            return cls
        for sc in cls.__sub_classes__:
            r = sc.find_subclass(name)
            if r != None:
                return r