https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/mngt.c#L94.

    Positional arguments:
    family -- integer.

    Returns:
    genl_ops class instance or None.
356476
def lookup_family(family):
    
    for ops in nl_list_for_each_entry(genl_ops(), genl_ops_list, 'o_list'):
        if ops.o_id == family:
            return ops
    return None
1058025
def lookup_family_by_name(name):
    
    for ops in nl_list_for_each_entry(genl_ops(), genl_ops_list, 'o_list'):
        if ops.o_name == name:
            return ops
    return None
582397
def get_basis_family(basis_name, data_dir=None):
    '''
    '''

    data_dir = fix_data_dir(data_dir)
    bs_data = _get_basis_metadata(basis_name, data_dir)
    return bs_data['family']
608192
function getParentInstance(inst) {
	  !('_hostNode' in inst) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0;

	  return inst._hostParent;
	}
384796
def resolve_child_module_registries_lineage(registry):
    

    children = [registry]
    while isinstance(registry, BaseChildModuleRegistry):
        if registry.parent in children:
            # this should never normally occur under normal usage where
            # classes have been properly subclassed with methods defined
            # to specificiation and with standard entry point usage, but
            # non-standard definitions/usage can definitely trigger this
            # self-referential loop.
            raise TypeError(
                "registry '%s' was already recorded in the lineage, "
                "indicating that it may be some (grand)child of itself, which "
                "is an illegal reference in the registry system; previously "
                "resolved lineage is: %r" % (registry.parent.registry_name, [
                    r.registry_name for r in reversed(children)
                ])
            )

        pl = len(registry.parent.registry_name)
        if len(registry.parent.registry_name) > len(registry.registry_name):
            logger.warning(
                "the parent registry '%s' somehow has a longer name than its "
                "child registry '%s'; the underlying registry class may be "
                "constructed in an invalid manner",
                registry.parent.registry_name,
                registry.registry_name,
            )
        elif registry.registry_name[:pl] != registry.parent.registry_name:
            logger.warning(
                "child registry '%s' does not share the same common prefix as "
                "its parent registry '%s'; there may be errors with how the "
                "related registries are set up or constructed",
                registry.registry_name,
                registry.parent.registry_name,
            )
        children.append(registry.parent)
        registry = registry.parent
    # the lineage down from parent to child.
    return iter(reversed(children))
931113
def _inherited_value(self, attr_name):
        
        base_placeholder = self._base_placeholder
        if base_placeholder is None:
            return None
        inherited_value = getattr(base_placeholder, attr_name)
        return inherited_value
807770
def direct_descendants(include_singletons = false)
      return _inherited_by if BBLib.in_opal?
      ObjectSpace.each_object(Class).select do |c|
        (include_singletons || !c.singleton_class?) && c.ancestors[1..-1].find { |k| k.is_a?(Class) } == self
      end
    end
1112959
public org.tensorflow.framework.CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder() {
    if (kindCase_ == 3) {
       return (org.tensorflow.framework.CollectionDef.Int64List) kind_;
    }
    return org.tensorflow.framework.CollectionDef.Int64List.getDefaultInstance();
  }
746763
public final int getVersion(final int familyId)
	{
		for (int i = 0; i < ids.length; i++) {
			if (ids[i] == familyId)
				return versions[i];
		}
		return 0;
	}
1131392
private JType getNumberType(JCodeModel owner, GenerationConfig config) {

    if (config.isUseBigDecimals()) {
      return unboxIfNecessary(owner.ref(BigDecimal.class), config);
    } else if (config.isUseDoubleNumbers()) {
      return unboxIfNecessary(owner.ref(Double.class), config);
    } else {
      return unboxIfNecessary(owner.ref(Float.class), config);
    }

  }
663039
def find_copy_constructor(type_):
    
    copy_ = type_.constructors(
        lambda x: is_copy_constructor(x),
        recursive=False,
        allow_empty=True)
    if copy_:
        return copy_[0]

    return None
518448
def get_datatype(object_type, propid, vendor_id=0):
    """"""
    if _debug: get_datatype._debug("get_datatype %r %r vendor_id=%r", object_type, propid, vendor_id)

    # get the related class
    cls = get_object_class(object_type, vendor_id)
    if not cls:
        return None

    # get the property
    prop = cls._properties.get(propid)
    if not prop:
        return None

    # return the datatype
    return prop.datatype
628878
def _getParentClass(self, startClass, parentClass):
        
        try:
            if not startClass:  # reached system with no hits
                raise AttributeError
        except AttributeError:  # i.e calling binary on an object without one
                raise HierarchyError('This object ({0}) has no {1} as a parent object'.format(self.name, parentClass))

        if startClass.classType == parentClass:
            return startClass
        else:
            return self._getParentClass(startClass.parent, parentClass)
648563
def family_ids(force_reload=false)
      return @family_ids unless @family_ids.nil? or force_reload
      
      transaction do
        reload_boundaries
        query = "SELECT id FROM #{self.class.quote_db_property(base_class.table_name)} " + 
                "WHERE #{nested_set_column(:left)} >= #{left} AND #{nested_set_column(:right)} <= #{right} " +
                "ORDER BY #{nested_set_column(:left)}"
        @family_ids = base_class.connection.select_values(query).map(&:to_i)
      end
    end
230123
static Number coerceToPrimitiveNumber(Number pValue,
                                          Class pClass)
            throws ELException {
        if (pClass == Byte.class || pClass == Byte.TYPE) {
            return PrimitiveObjects.getByte(pValue.byteValue());
        } else if (pClass == Short.class || pClass == Short.TYPE) {
            return PrimitiveObjects.getShort(pValue.shortValue());
        } else if (pClass == Integer.class || pClass == Integer.TYPE) {
            return PrimitiveObjects.getInteger(pValue.intValue());
        } else if (pClass == Long.class || pClass == Long.TYPE) {
            return PrimitiveObjects.getLong(pValue.longValue());
        } else if (pClass == Float.class || pClass == Float.TYPE) {
            return PrimitiveObjects.getFloat(pValue.floatValue());
        } else if (pClass == Double.class || pClass == Double.TYPE) {
            return PrimitiveObjects.getDouble(pValue.doubleValue());
        } else {
            return PrimitiveObjects.getInteger(0);
        }
    }
706272
def gen_orm_classes_from_base(base: Type) -> Generator[Type, None, None]:
    
    for cls in gen_all_subclasses(base):
        if _get_immediate_cls_attr(cls, '__abstract__', strict=True):
            # This is SQLAlchemy's own way of detecting abstract classes; see
            # sqlalchemy.ext.declarative.base
            continue  # NOT an ORM class
        yield cls
1118695
@SuppressWarnings("unchecked")
    public <T extends ElementBase> T getAncestor(Class<T> clazz) {
        ElementBase parent = getParent();
        
        while (parent != null && !clazz.isInstance(parent)) {
            parent = parent.getParent();
        }
        
        return (T) parent;
    }