根据参数创建一个 leancloud.Object 的子类的实例化对象

        :param class_name: 子类名称
        :type class_name: string_types
        :param attributes: 对象属性
        :return: 派生子类的实例
        :rtype: Object
976404
def create(cls, class_name, **attributes):
        
        object_class = cls.extend(class_name)
        return object_class(**attributes)
778474
def get_fields_class(self, class_name):
        
        l = []
        for i in self.classes.class_def:
            for j in i.get_fields():
                if class_name == j.get_class_name():
                    l.append(j)

        return l
976814
def create_attributes(klass, attributes, previous_object=None):
        

        result = super(ContentType, klass).create_attributes(attributes, previous_object)

        if 'fields' not in result:
            result['fields'] = []
        return result
380131
def search_get_class_names(cls):
        
        if hasattr(cls, '_class_key'):
            class_names = []
            for n in cls._class_key():
                class_names.append(n)
            return class_names
        else:
            return [cls.__name__]
1234434
def create_attributes(klass, attributes, previous_object=None):
        

        return {
            'name': attributes.get(
                'name',
                previous_object.name if previous_object is not None else ''
            ),
            'description': attributes.get(
                'description',
                previous_object.description if previous_object is not None else ''
            ),
            'environments': attributes.get(
                'environments',
                [e.to_json() for e in previous_object.environments] if previous_object is not None else []  # Will default to master if empty
            )
        }
211093
def get_all_attributes(klass_or_instance):
    
    pairs = list()
    for attr, value in inspect.getmembers(
            klass_or_instance, lambda x: not inspect.isroutine(x)):
        if not (attr.startswith("__") or attr.endswith("__")):
            pairs.append((attr, value))
    return pairs
705555
def pclass_field_for_attribute(self):
        
        return self.type_model.pclass_field_for_type(
            required=self.required,
            default=self.default,
        )
159506
def get_class(class_string):
    
    split_string = class_string.encode('ascii').split('.')
    import_path = '.'.join(split_string[:-1])
    class_name = split_string[-1]

    if class_name:
        try:
            if import_path:
                mod = __import__(import_path, globals(), {}, [class_name])
                cls = getattr(mod, class_name)
            else:
                cls = __import__(class_name, globals(), {})
            if cls:
                return cls
        except (ImportError, AttributeError):
            pass

    return None
191445
def get_class_with_attr_name(pyname):
    
    lineno = get_lineno_for_node(pyname.assignments[0].ast_node)
    holding_scope = pyname.module.get_scope().get_inner_scope_for_line(lineno)
    pyobject = holding_scope.pyobject
    if isinstance(pyobject, PyClass):
        pyclass = pyobject
    elif (isinstance(pyobject, PyFunction) and
          isinstance(pyobject.parent, PyClass)):
        pyclass = pyobject.parent
    else:
        return
    for name, attr in pyclass.get_attributes().items():
        if attr is pyname:
            return (pyclass, name)
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
1087138
def create_attributes(klass, attributes, previous_object=None):
        

        result = {}

        if previous_object is not None:
            result = {k: v for k, v in previous_object.to_json().items() if k != 'sys'}

        result.update(attributes)

        return result
1006612
def get_class(self, name):
        
        for i in self.classes.class_def:
            if i.get_name() == name:
                return i
        return None
536736
def _get_rdfclass(self, class_type, **kwargs):
        
        def select_class(class_name):
            """ finds the class in the rdfclass Module"""
            try:
                return getattr(MODULE.rdfclass, class_name.pyuri)
            except AttributeError:
                return RdfClassBase

        if kwargs.get("def_load"):
            return RdfClassBase

        if isinstance(class_type[self.omap], list):
            bases = [select_class(class_name)
                     for class_name in class_type[self.omap]]
            bases = [base for base in bases if base != RdfClassBase]
            if len(bases) == 0:
                return RdfClassBase
            elif len(bases) == 1:
                return bases[0]
            else:
                bases = remove_parents(bases)
                if len(bases) == 1:
                    return bases[0]
                else:
                    name = "_".join(sorted(class_type[self.omap]))
                    # if the the class has already been created return it
                    if hasattr(MODULE.rdfclass, name):
                        return getattr(MODULE.rdfclass, name)
                    new_class = type(name,
                                     tuple(bases),
                                     {})
                    new_class.hierarchy = list_hierarchy(class_type[self.omap][0],
                                                         bases)
                    new_class.class_names = sorted([base.__name__ \
                            for base in bases \
                            if base not in [RdfClassBase, dict]])
                    setattr(MODULE.rdfclass, name, new_class)
                    return new_class
        else:
            return select_class(class_type[self.omap])
110425
def get_attribute(self, name):
        
        assert isinstance(name, compat.str_type)
        return self.__attributes.get(name)
179803
def get_account_db_class(cls) -> Type[BaseAccountDB]:
        
        if cls.account_db_class is None:
            raise AttributeError("No account_db_class set for {0}".format(cls.__name__))
        return cls.account_db_class
985394
def __model_class(self, model_name):
        
        build_schema = deepcopy(self.definitions[model_name])
        return self.schema_class(build_schema, model_name)
862104
def create_attributes(klass, attributes, previous_object=None):
        

        if 'fields' not in attributes:
            if previous_object is None:
                attributes['fields'] = {}
            else:
                attributes['fields'] = previous_object.to_json()['fields']
        return {'fields': attributes['fields']}