are taken into account. The function can also take additional arguments if the model is using a __contruct() function.
324946
protected function getModel($model) {
		$args = func_get_args();
		array_shift($args);
		require 'app/models/' . $model . '.php';
       	$class = 'Tadpole\model\\' . $model;
		if(!empty($args)) {
			$modData = new ReflectionClass($class);
			$returnMod = $modData->newInstanceArgs($args);
			return $returnMod;
		} else {
        	$returnMod = new $class;
			return $returnMod;
		}
	}
1137295
def build_map(function: Callable[[Any], Any] = None,
              unpack: bool = False):
    
    def _build_map(function: Callable[[Any], Any]):
        @wraps(function)
        def _wrapper(*args, **kwargs) -> Map:
            if 'unpack' in kwargs:
                raise TypeError('"unpack" has to be defined by decorator')
            return Map(function, *args, unpack=unpack, **kwargs)
        return _wrapper

    if function:
        return _build_map(function)

    return _build_map
269480
def add_method_model(self,
                         func,  # type: Callable
                         name=None,  # type: Optional[str]
                         description=None,  # type: Optional[str]
                         owner=None,  # type: object
                         ):
        # type: (...) -> MethodModel
        """"""
        if name is None:
            name = func.__name__
        method = MethodModel.from_callable(func, description)
        self._add_field(owner, name, method, func)
        return method
1243678
def attached_to_model(self):
        """"""
        try:
            if not bool(self._model):
                return False
        except AttributeError:
            return False
        else:
            try:
                return not bool(self._instance)
            except AttributeError:
                return True
202950
def self_if_parameters(func):
    
    @wraps(func)
    def wrapper(self, *args, **kwargs):
        result = func(self, *args, **kwargs)
        if args or kwargs:
            return self
        else:
            return result
    return wrapper
966329
def npartial(func, *args, **kwargs):
  
  def wrapped(self, node):
    func(self, *args, **kwargs)
  return wrapped
1365725
def add_method_model(self,
                         func,  # type: Callable
                         name=None,  # type: Optional[str]
                         description=None,  # type: Optional[str]
                         ):
        # type: (...) -> MethodModel
        """"""
        return self._field_registry.add_method_model(
            func, name, description, self._part)
1319965
private void addBuiltIn( ) {
        input1.put("inv", Operation::inv);
        input1.put("pinv", Operation::pinv);
        input1.put("rref", Operation::rref);
        input1.put("eye", Operation::eye);
        input1.put("det", Operation::det);
        input1.put("normF", Operation::normF);
        input1.put("sum", Operation::sum_one);
        input1.put("trace", Operation::trace);
        input1.put("diag", Operation::diag);
        input1.put("min", Operation::min);
        input1.put("max", Operation::max);
        input1.put("abs", Operation::abs);
        input1.put("sin", Operation::sin);
        input1.put("cos", Operation::cos);
        input1.put("atan", Operation::atan);
        input1.put("exp", Operation::exp);
        input1.put("log", Operation::log);
        input1.put("sqrt", Operation::sqrt);
        input1.put("rng", Operation::rng);

        inputN.put("normP", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.normP(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("max", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("One or two inputs expected");
            return Operation.max_two(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("min", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("One or two inputs expected");
            return Operation.min_two(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("sum", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("One or two inputs expected");
            return Operation.sum_two(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("zeros", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.zeros(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("ones", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.ones(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("rand", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.rand(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("randn", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.randn(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("kron", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.kron(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("dot", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.dot(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("pow", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.pow(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("atan2", (inputs, manager) -> {
            if (inputs.size() != 2) throw new RuntimeException("Two inputs expected");
            return Operation.atan2(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("solve", (inputs, manager) -> {
            if( inputs.size() != 2 ) throw new RuntimeException("Two inputs expected");
            return Operation.solve(inputs.get(0), inputs.get(1), manager);
        });

        inputN.put("extract", Operation::extract);
        inputN.put("extractScalar", (inputs, manager) -> {
            if( inputs.size() != 2 && inputs.size() != 3 ) throw new RuntimeException("Two or three inputs expected");
            return Operation.extractScalar(inputs, manager);
        });
    }
325682
def concretize(self, **kwargs):
        
        return (self._read_file.concretize(**kwargs), self._write_file.concretize(**kwargs))
193276
def compiled_model(self):
        """"""
        return ALCHEMY_TEMPLATES.model.safe_substitute(class_name=self.class_name,
                                                       table_name=self.table_name,
                                                       column_definitions=self.compiled_columns,
                                                       init_function=self.compiled_init_func,
                                                       update_function=self.compiled_update_func,
                                                       hash_function=self.compiled_hash_func,
                                                       eq_function=self.compiled_eq_func,
                                                       neq_function=self.compiled_neq_func,
                                                       str_function=self.compiled_str_func,
                                                       unicode_function=self.compiled_unicode_func,
                                                       repr_function=self.compiled_repr_func,
                                                       types=", ".join(self.basic_types),
                                                       username=self.username,
                                                       foreign_keys=self.compiled_foreign_keys,
                                                       relationships=self.compiled_relationships,
                                                       named_imports=self.compiled_named_imports,
                                                       orm_imports=self.compiled_orm_imports,
                                                       get_proxy_cls_function=self.compiled_proxy_cls_func,
                                                       add_function=ALCHEMY_TEMPLATES.add_function.template,
                                                       delete_function=ALCHEMY_TEMPLATES.delete_function.template,
                                                       to_dict_function=ALCHEMY_TEMPLATES.to_dict_function.template,
                                                       to_proxy_function=ALCHEMY_TEMPLATES.to_proxy_function.template,
                                                       from_proxy_function=ALCHEMY_TEMPLATES.from_proxy_function.template)
91672
def make_params(self):
    

    if self.needs_dummy_fprop:
      if hasattr(self, "_dummy_input"):
        return
      self._dummy_input = self.make_input_placeholder()
      self.fprop(self._dummy_input)
139533
private void putSuperAndThisConstructorSymbols()
  {
    IGosuClassInternal thisClass = getGosuClass();
    IGosuClassInternal superClass = thisClass.getSuperClass();
    if( superClass != null )
    {
      for( DynamicFunctionSymbol dfs : superClass.getConstructorFunctions() )
      {
        if( superClass.isAccessible( getGosuClass(), dfs ) )
        {
          dfs = new SuperConstructorFunctionSymbol( superClass.isParameterizedType()
                                                    ? dfs.getParameterizedVersion( superClass )
                                                    : dfs );
          getSymbolTable().putSymbol( dfs );
          getOwner().putDfsDeclInSetByName( dfs );
        }
      }
    }
    for( DynamicFunctionSymbol dfs : thisClass.getConstructorFunctions() )
    {
      dfs = new ThisConstructorFunctionSymbol( dfs );
      getSymbolTable().putSymbol( dfs );
      getOwner().putDfsDeclInSetByName( dfs );
    }
  }
1257774
def require_axis(f):
    

    @wraps(f)
    def _wrapper(self, *args, **kwargs):
        if None in (self.axis, self.sel_axis):
            raise ValueError('%(func_name) requires the node %(node)s '
                    'to have an axis and a sel_axis function' %
                    dict(func_name=f.__name__, node=repr(self)))

        return f(self, *args, **kwargs)

    return _wrapper
92572
def construction_error(tot_items, block_shape, axes, e=None):
    
    passed = tuple(map(int, [tot_items] + list(block_shape)))
    # Correcting the user facing error message during dataframe construction
    if len(passed) <= 2:
        passed = passed[::-1]

    implied = tuple(len(ax) for ax in axes)
    # Correcting the user facing error message during dataframe construction
    if len(implied) <= 2:
        implied = implied[::-1]

    if passed == implied and e is not None:
        raise e
    if block_shape[0] == 0:
        raise ValueError("Empty data passed with indices specified.")
    raise ValueError("Shape of passed values is {0}, indices imply {1}".format(
        passed, implied))
1133353
def append(self, function, update=True):
        
        self._funcs.append(function)
        self._add_dep(function)
        if update:
            self._update()
459852
function getPropFunction(params) {
    var func;

    if(!params.exclude && !params.include) {
      func = function(properties) {
        for(var attr in this) {
          if(this.hasOwnProperty(attr) && (geomAttrs.indexOf(attr) === -1)) {
            properties[attr] = this[attr];
          }
        }
      };
    } else if(params.include) {
      func = function(properties) {
        params.include.forEach(function(attr){
          properties[attr] = this[attr];
        }, this);
      };
    } else if(params.exclude) {
      func = function(properties) {
        for(var attr in this) {
          if(this.hasOwnProperty(attr) && (geomAttrs.indexOf(attr) === -1) && (params.exclude.indexOf(attr) === -1)) {
            properties[attr] = this[attr];
          }
        }
      };
    }

    return function() {
      var properties = {};

      func.call(this, properties);

      if(params.extra) { addExtra(properties, params.extra); }
      return properties;
    };
  }
745074
def data_structure_builder(func):
    
    @wraps(func)
    def ds_builder_wrapper(function, *args, **kwargs):
        try:
            function = DSBuilder(function)
        except NoBuilder:
            pass
        return func(function, *args, **kwargs)

    return ds_builder_wrapper