Returns list of non-private class methods
@param {Object} Model
@return {Array}
495514
function listClassMethods (Model) {
  var classMethods = Object.keys(Model.schema.statics);
  for (var method in Model) {
    if (!isPrivateMethod(method) && isFunction(Model[method])) {
      classMethods.push(method);
    }
  }
  return classMethods;
}
494351
def import_models(module):
    
    try:
        module = importlib.import_module('{0}.models'.format(module))
    except ImportError:
        return []
    else:
        clsmembers = inspect.getmembers(module, lambda member: inspect.isclass(member) and member.__module__ == module.__name__)
        return [kls for name, kls in clsmembers]
1253407
function _ensureModel(model) {
      if (model instanceof this.model) {
        return model;
      } else if (typeof model === "object") {
        return new this.model(model);
      } else {
        return new this.model({ id: model });
      }
    }
1299145
function(object) {
		var methods = Array.prototype.slice.call(arguments).slice(1);
		if (!methods.length) {
			methods = gui.Object.ownmethods(object).filter(function(name) {
				return name[0] !== "_"; // exclude private methods
			});
		}
		methods.forEach(function(name) {
			object[name] = object[name].bind(object);
		});
		return object;
	}
432947
function StartableModel(model,instance) {
    if(!model) {
        throw new Error('model is required')
    }
    if(!instance) {
        throw new Error('instance is required')
    }
    if(!(this instanceof StartableModel)) {
        return new StartableModel(model,instance,index)
    }
    this.model = model
    this.key = model.key
    this.instance= instance
    this.fn = instance[model.startable]
    if(!this.fn) {
        throw new Error('The instance of ' +
                        this.key +
                        ' does not have a method ' +
                        model.startable +
                       ' which is required for starting this service.')
    }
    this.inject = (this.fn.inject || [])
    this.hasDeps = (this.inject.length > 0)
}
1106269
function(object) {
		return Object.keys(object).filter(function(key) {
			return gui.Type.isMethod(object[key]);
		}).map(function(key) {
			return key;
		});
	}
25196
protected function getSoftDeleteMethods($model)
    {
        $traits = class_uses(get_class($model), true);
        if (in_array('Illuminate\\Database\\Eloquent\\SoftDeletes', $traits)) {
            $this->setMethod('forceDelete', 'bool|null', []);
            $this->setMethod('restore', 'bool|null', []);

            $this->setMethod('withTrashed', '\Illuminate\Database\Query\Builder|\\' . get_class($model), []);
            $this->setMethod('withoutTrashed', '\Illuminate\Database\Query\Builder|\\' . get_class($model), []);
            $this->setMethod('onlyTrashed', '\Illuminate\Database\Query\Builder|\\' . get_class($model), []);
        }
    }
287614
function getRemoveIndexes ( modelsToRemove, models ) {
        var indexes = {},
            toRemove = modelsToRemove || [];

        if( !_.isArray( toRemove ) ) toRemove = [toRemove];

        models = models.slice() || [];

        _.each( toRemove, function ( model ) {
            var index = _.indexOf( models, model );
            if ( index !== -1 ) {
                indexes[model.cid] = index;
                models.splice( index, 1 );
            }
        } );

        return indexes;
    }
1311569
function UserMethods(models) {
      this.models = models;
      this.removeEmail = __bind(this.removeEmail, this);
      this.addEmail = __bind(this.addEmail, this);
      this.resetPasswordToken = __bind(this.resetPasswordToken, this);
      this.resetPassword = __bind(this.resetPassword, this);
      this.removeRoles = __bind(this.removeRoles, this);
      this.addRoles = __bind(this.addRoles, this);
      this.removeIdentityFromUser = __bind(this.removeIdentityFromUser, this);
      this.addIdentityToUser = __bind(this.addIdentityToUser, this);
      this._profileImageFromProfile = __bind(this._profileImageFromProfile, this);
      this._displayNameFromProfile = __bind(this._displayNameFromProfile, this);
      this._usernameFromProfile = __bind(this._usernameFromProfile, this);
      this.getOrCreateUserFromProvider = __bind(this.getOrCreateUserFromProvider, this);
      this.create = __bind(this.create, this);
      this.hashPassword = __bind(this.hashPassword, this);
      this.validateUserByUsernameOrEmail = __bind(this.validateUserByUsernameOrEmail, this);
      this.findUserByUsernameOrEmail = __bind(this.findUserByUsernameOrEmail, this);
      this.setPassword = __bind(this.setPassword, this);
      this.destroy = __bind(this.destroy, this);
      this["delete"] = __bind(this["delete"], this);
      this.patch = __bind(this.patch, this);
      this.getByNameOrId = __bind(this.getByNameOrId, this);
      this.getByPrimaryEmail = __bind(this.getByPrimaryEmail, this);
      this.getByName = __bind(this.getByName, this);
      this.lookup = __bind(this.lookup, this);
      this.get = __bind(this.get, this);
      this.getByUsernames = __bind(this.getByUsernames, this);
      this.getByIds = __bind(this.getByIds, this);
      this.all = __bind(this.all, this);
      if (!this.models) {
        throw new Error("models parameter is required");
      }
    }
371562
function getIgnoredMethods (methods) {
  var obj = Object.create(null)

  for (var i = 0; i < methods.length; i++) {
    var method = methods[i].toUpperCase()
    obj[method] = true
  }

  return obj
}
1002432
function(model, options) {
            var index, existing;

            if (_.isArray(model)) {
                return _.map(model, function(m) {
                    return this.add(m, _.clone(options));
                }, this);
            }

            // Manage {list:[], n:0} for infinite list
            if (_.size(model) == 2
            && model.list != null && model.n != null) {
                this._totalCount = model.n;
                return this.add(model.list, options);
            }

            options = _.defaults({}, options || {}, {
                at: this.models.length,
                merge: false,
                silent: false
            });

            model = this._prepareModel(model);

            if (existing = this.get(model)) {
                if (options.merge) {
                    existing.set(model.toJSON())
                }
                return this;
            }

            this._byId[model.id] = model;

            this.listenTo(model, 'all', this._onModelEvent);
            this.listenTo(model, 'id', this._onModelId);

            index = options.at;
            this.models.splice(index, 0, model);

            if (options.silent) return this;
            options.index = index;
            this.trigger('add', model, this, options);

            if (this.comparator) this.sort({silent: options.silent});
            return model;
        }
1038294
function getPrototype(model) {
  if (model.__recordPrototype) return model.__recordPrototype;

  const mrProto = Object.assign({}, proto);// eslint-disable-line no-use-before-define
  const extraProperties = {};
  Object.keys(model.def.fields).forEach((fieldName) => {
    extraProperties[fieldName] = {
      enumerable: true,
      get() {
        const value = getf.call(this, fieldName);
        return value;
      },
      set(value) {
        return setf.call(this, fieldName, value);
      },
    };
  });
  Object.defineProperties(mrProto, extraProperties);
  model.__recordPrototype = mrProto;
  return mrProto;
}
1233746
protected function getRelations($model)
    {
        $methods = get_class_methods($model);
        if (!$methods) {
            return [];
        }
        foreach ($methods as $method) {
            if (Str::startsWith($method, 'get') && Str::endsWith($method, 'Attribute') && $method !== 'getAttribute') {
                $name = Str::snake(substr($method, 3, -9));
                if (!empty($name)) {
                    $this->setProperty($name, null, true, null);
                }
            } elseif (Str::startsWith($method, 'set') && Str::endsWith($method, 'Attribute') && $method !== 'setAttribute') {
                $name = Str::snake(substr($method, 3, -9));
                if (!empty($name)) {
                    $this->setProperty($name, null, null, true);
                }
            } elseif (Str::startsWith($method, 'scope') && $method !== 'scopeQuery') {
                $name = Str::camel(substr($method, 5));
                if (!empty($name)) {
                    $reflection = new \ReflectionMethod($model, $method);
                    $args       = $this->getParameters($reflection);
                    array_shift($args);
                    $this->setMethod($name, '\Illuminate\Database\Query\Builder|\\' . $reflection->class, $args);
                }
            } elseif (!method_exists('Illuminate\Database\Eloquent\Model', $method) && !Str::startsWith($method, 'get')) {
                $reflection = new ReflectionMethod($model, $method);
                $file       = new SplFileObject($reflection->getFileName());
                $file->seek($reflection->getStartLine() - 1);
                $code       = '';
                while ($file->key() < $reflection->getEndLine()) {
                    $code .= $file->current();
                    $file->next();
                }
                $code  = trim(preg_replace('/\s\s+/', '', $code));
                $begin = strpos($code, 'function(');
                $code  = substr($code, $begin, strrpos($code, '}') - $begin + 1);

                foreach (array('hasOne', 'belongsTo') as $relation) {
                    $search = '$this->' . $relation . '(';
                    if ($pos    = stripos($code, $search)) {
                        $relationObj = $model->$method();
                        if ($relationObj instanceof Relation) {
                            $relatedModel = '\\' . get_class($relationObj->getRelated());

                            $relations = ['hasManyThrough', 'belongsToMany', 'hasMany', 'morphMany', 'morphToMany'];
                            if (in_array($relation, $relations)) {
                                $this->setProperty($method, $this->getCollectionClass($relatedModel) . '|' . $relatedModel . '[]', true, null);
                            } elseif ($relation === "morphTo") {
                                $this->setProperty($method, '\Illuminate\Database\Eloquent\Model|\Eloquent', true, null);
                            } else {
                                $this->setProperty($method, $relatedModel, true, null);
                            }
                        }
                    }
                }
            }
        }
        return $this->properties;
    }
434351
def model_functions(vk, model):
    """"""

    def get_vk_extension_functions():
        names = set()
        for extension in get_extensions_filtered(vk):
            for req in extension['require']:
                if 'command' not in req:
                    continue
                for command in req['command']:
                    cn = command['@name']
                    names.add(cn)
                    
                    # add alias command too
                    for alias, n in model['alias'].items():
                        if n == cn:
                            names.add(alias)
        return names

    def get_count_param(command):
        for param in command['param']:
            if param['type'] + param.get('#text', '') == 'uint32_t*':
                return param
        return None

    def member_has_str(name):
        c = next(iter([x for x in model['constructors']
                       if x['name'] == name]), None)
        if c and any(['char' in x['type'] for x in c['members']]):
            return True
        return False

    def format_member(member):
        type_name = member['type']
        if '#text' in member:
            text = member['#text'].replace('const ', '').strip()
            type_name += ' ' + text

        return {'name': member['name'],
                'type': member['type'],
                'none': member['name'] in NULL_MEMBERS,
                'force_array': True if '@len' in member else False,
                'to_create': False,
                'has_str': member_has_str(member['type'])}

    def format_return_member(member):
        t = member['type']

        static_count = None
        if '@len' in member and '::' in member['@len']:
            lens = member['@len'].split('::')
            static_count = {'key': lens[0], 'value': lens[1]}

        is_handle = t in get_handle_names(vk)
        is_enum = t in get_enum_names(vk)
        is_struct = t in get_struct_names(vk)
        return {'name': member['name'],
                'type': t,
                'handle': is_handle,
                'enum': is_enum,
                'struct': is_struct,
                'static_count': static_count,
                'has_str': member_has_str(member['type'])}

    ALLOCATE_PREFIX = ('vkCreate', 'vkGet', 'vkEnumerate', 'vkAllocate',
                       'vkMap', 'vkAcquire')
    ALLOCATE_EXCEPTION = ('vkGetFenceStatus', 'vkGetEventStatus',
                          'vkGetQueryPoolResults',
                          'vkGetPhysicalDeviceXlibPresentationSupportKHR')
    COUNT_EXCEPTION = ('vkAcquireNextImageKHR', 'vkEnumerateInstanceVersion')

    model['functions'] = []
    model['extension_functions'] = []
    functions = [f for f in vk['registry']['commands']['command']]
    extension_function_names = get_vk_extension_functions()

    for function in functions:
        if '@alias' in function:
            continue

        fname = function['proto']['name']
        ftype = function['proto']['type']

        if fname in CUSTOM_FUNCTIONS:
            continue

        if type(function['param']) is not list:
            function['param'] = [function['param']]

        count_param = get_count_param(function)
        if fname in COUNT_EXCEPTION:
            count_param = None
        is_allocate = any([fname.startswith(a) for a in ALLOCATE_PREFIX])
        is_count = is_allocate and count_param is not None

        if fname in ALLOCATE_EXCEPTION or ftype == 'VkBool32':
            is_allocate = is_count = False

        members = []
        for member in function['param']:
            members.append(format_member(member))

        return_member = None
        if is_allocate:
            return_member = format_return_member(function['param'][-1])
            members[-1]['to_create'] = True
        if is_count:
            members[-2]['to_create'] = True

        f = {
            'name': fname,
            'members': members,
            'allocate': is_allocate,
            'count': is_count,
            'return_boolean': True if ftype == 'VkBool32' else False,
            'return_result': True if ftype == 'VkResult' else False,
            'return_member': return_member,
            'is_extension': fname in extension_function_names
        }

        model['functions'].append(f)
920531
def collect_methods
            list = @context.method_list
            unless @options.show_all
                list = list.find_all {|m| m.visibility == :public || m.visibility == :protected || m.force_documentation }
            end
            @methods = list.collect {|m| HtmlMethod.new(m, self, @options) }
        end
887724
def get_method_names(obj):
        
        method_names = []
        
        for method_name in dir(obj):

            method = getattr(obj, method_name)

            if MethodReflector._is_method(method, method_name):
                method_names.append(method_name)

        return method_names
755065
function( model ) {
			var coll =  _.detect( this._collections, function( c ) {
					// Check if model is the type itself (a ref to the constructor), or is of type c.model
					return model === c.model || model instanceof c.model;
				});
			
			if ( !coll ) {
				coll = this._createCollection( model );
			}
			
			return coll;
		}