Reads through the class defs and gets the related es class
    defintions

    Args:
    -----
        class_defs: RdfDataset of class definitions
173829
def es_get_class_defs(cls_def, cls_name):
    
    rtn_dict = {key: value for key, value in cls_def.items() \
                if key.startswith("kds_es")}
    for key in rtn_dict:
        del cls_def[key]
    return rtn_dict
694945
def getDescriptor(klass, **kw):
    
    # XXX: ctypes Structure.__init__ ignores arguments which do not exist
    # as structure fields. So check it.
    # This is annoying, but not doing it is a huge waste of time for the
    # developer.
    empty = klass()
    assert hasattr(empty, 'bLength')
    assert hasattr(empty, 'bDescriptorType')
    unknown = [x for x in kw if not hasattr(empty, x)]
    if unknown:
        raise TypeError('Unknown fields %r' % (unknown, ))
    # XXX: not very pythonic...
    return klass(
        bLength=ctypes.sizeof(klass),
        # pylint: disable=protected-access
        bDescriptorType=klass._bDescriptorType,
        # pylint: enable=protected-access
        **kw
    )
447454
def CLASSDEF(self, node):
        
        for deco in node.decorator_list:
            self.handleNode(deco, node)
        for baseNode in node.bases:
            self.handleNode(baseNode, node)
        if not PY2:
            for keywordNode in node.keywords:
                self.handleNode(keywordNode, node)
        self.pushScope(ClassScope)
        # doctest does not process doctest within a doctest
        # classes within classes are processed.
        if (self.withDoctest and
                not self._in_doctest() and
                not isinstance(self.scope, FunctionScope)):
            self.deferFunction(lambda: self.handleDoctests(node))
        for stmt in node.body:
            self.handleNode(stmt, node)
        self.popScope()
        self.addBinding(node, ClassDefinition(node.name, node))
408885
def visit_ClassDef(self, node):  # pylint: disable=invalid-name
        """"""
        # Resolve everything as root scope contains everything from the process module.
        for base in node.bases:
            # Cover `from resolwe.process import ...`.
            if isinstance(base, ast.Name) and isinstance(base.ctx, ast.Load):
                base = getattr(runtime, base.id, None)
            # Cover `from resolwe import process`.
            elif isinstance(base, ast.Attribute) and isinstance(base.ctx, ast.Load):
                base = getattr(runtime, base.attr, None)
            else:
                continue

            if issubclass(base, runtime.Process):
                break
        else:
            return

        descriptor = ProcessDescriptor(source=self.source)

        # Available embedded classes.
        embedded_class_fields = {
            runtime.PROCESS_INPUTS_NAME: descriptor.inputs,
            runtime.PROCESS_OUTPUTS_NAME: descriptor.outputs,
        }

        # Parse metadata in class body.
        for item in node.body:
            if isinstance(item, ast.Assign):
                # Possible metadata.
                if (len(item.targets) == 1 and isinstance(item.targets[0], ast.Name)
                        and isinstance(item.targets[0].ctx, ast.Store)
                        and item.targets[0].id in PROCESS_METADATA):
                    # Try to get the metadata value.
                    value = PROCESS_METADATA[item.targets[0].id].get_value(item.value)
                    setattr(descriptor.metadata, item.targets[0].id, value)
            elif (isinstance(item, ast.Expr) and isinstance(item.value, ast.Str)
                  and descriptor.metadata.description is None):
                # Possible description string.
                descriptor.metadata.description = item.value.s
            elif isinstance(item, ast.ClassDef) and item.name in embedded_class_fields.keys():
                # Possible input/output declaration.
                self.visit_field_class(item, descriptor, embedded_class_fields[item.name])

        descriptor.validate()
        self.processes.append(descriptor)
1321506
def get_class_meta(klass):
    
    if not isinstance(klass, python.class_types) or klass is object:
        raise TypeError('klass must be a class object, got %r' % type(klass))

    meta = {
        'static_attrs': None,
        'exclude_attrs': None,
        'readonly_attrs': None,
        'proxy_attrs': None,
        'amf3': None,
        'dynamic': None,
        'alias': None,
        'external': None,
        'synonym_attrs': None
    }

    if not hasattr(klass, '__amf__'):
        return meta

    a = klass.__amf__

    if type(a) is dict:
        in_func = lambda x: x in a
        get_func = a.__getitem__
    else:
        in_func = lambda x: hasattr(a, x)
        get_func = lambda x: getattr(a, x)

    for prop in ['alias', 'amf3', 'dynamic', 'external']:
        if in_func(prop):
            meta[prop] = get_func(prop)

    for prop in ['static', 'exclude', 'readonly', 'proxy', 'synonym']:
        if in_func(prop):
            meta[prop + '_attrs'] = get_func(prop)

    return meta
649318
def mk_definition(defn):
  
  assert len(defn) == 1
  identifier, contents = next(iter(defn.items()))
  fs = [mk_field(f) for f in contents.get('fields', [])]
  return sbp.resolve_type(sbp.Definition(identifier=identifier,
                                         sbp_id=contents.get('id', None),
                                         short_desc=contents.get('short_desc', None),
                                         desc=contents.get('desc', None),
                                         type_id=contents.get('type'),
                                         fields=fs,
                                         public=contents.get('public', True)))
767185
private ZooClassDef locateClassDefinition(Class<?> cls, Node node) {
		ZooClassDef def = cache.getSchema(cls, node);
		if (def == null || def.jdoZooIsDeleted()) {
			return null;
		}
		return def;
	}
227999
def fields(class_or_instance):
    

    # Might it be worth caching this, per class?
    try:
        fields = getattr(class_or_instance, _FIELDS)
    except AttributeError:
        raise TypeError('must be called with a dataclass type or instance')

    # Exclude pseudo-fields.  Note that fields is sorted by insertion
    # order, so the order of the tuple is as the fields were defined.
    return tuple(f for f in fields.values() if f._field_type is _FIELD)
999313
def get_collection_for_cls_name(self, cls_name):
        
        for cls in self.classes:
            if cls.__name__ == cls_name:
                return self.classes[cls]['collection']
        raise AttributeError("Unknown class name: %s" % cls_name)
1014345
def get_predicates(self, class_):
        
        return self.client.get_predicates(
            class_=class_, controller=self.controller)
281151
def get_method(self, cls_name):
        
        for id, spec in self.db.items():
            if spec["method"].__class__.__name__ == cls_name:
                yield spec["method"]
449060
def datagetter(cls):
        
        with open('myfile', 'rt') as f:
            rows = [r for r in csv.reader(f)]
        dothing = lambda _: [i for i, v in enumerate(_)]
        rows = [dothing(_) for _ in rows]
        raise NotImplementedError('You need to implement this yourlself!')
        return rows
610992
def GetHasherClasses(cls, hasher_names=None):
    
    for hasher_name, hasher_class in iter(cls._hasher_classes.items()):
      if not hasher_names or hasher_name in hasher_names:
        yield hasher_name, hasher_class
171492
def get_class_that_defined_method(fun):
    
    if inspect.ismethod(fun):
        for cls in inspect.getmro(fun.__self__.__class__):
            if cls.__dict__.get(fun.__name__) is fun:
                return cls
        fun = fun.__func__  # fallback to __qualname__ parsing
    if inspect.isfunction(fun):
        cls = getattr(inspect.getmodule(fun),
                      fun.__qualname__.split('.<locals>', 1)[0].rsplit('.', 1)[0], None)
        if isinstance(cls, type):
            return cls
    return getattr(fun, '__objclass__', None)
1020382
def _get_object_class(cls, class_name):
        

        class_name = class_name.lstrip(cls.__STRING_FORMAT_UNDERSCORE)

        if class_name in cls._override_field_map:
            class_name = cls._override_field_map[class_name]

        try:
            return getattr(endpoint, class_name)
        except AttributeError:
            pass

        try:
            return getattr(object_, class_name)
        except AttributeError:
            pass

        raise BunqException(cls._ERROR_MODEL_NOT_FOUND.format(class_name))
552571
def get_definition(self):
        
        def_ = {
            "id": self.id,
            "name": self.name,
            "desc": self.desc
        }
        return def_
61891
def class_subobjects(
        class_: Type) -> Generator[Tuple[str, Type, bool], None, None]:
    
    argspec = inspect.getfullargspec(class_.__init__)
    defaults = argspec.defaults if argspec.defaults else []
    num_optional = len(defaults)
    first_optional = len(argspec.args) - num_optional

    for i, attr_name in enumerate(argspec.args):
        if attr_name == 'self':
            continue
        if attr_name == 'yatiml_extra':
            continue
        attr_type = argspec.annotations.get(attr_name, Any)
        yield attr_name, attr_type, i < first_optional