@param MBias $bias

@return Bias
359343
protected static function convertBias($bias)
  {
    return (new MBias())->setName($bias->getName())->setContent($bias->getContent())->setStrength($bias->getStrength());
  }
964329
public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof LicenseQuery) {
            return $criteria;
        }
        $query = new LicenseQuery(null, null, $modelAlias);

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
954013
public function inverse(): self
    {
        if (!$this->isSquare()) {
            throw new MatrixMustBeSquare;
        }

        $matrix = $this->augmentWith($this->identity());

        try {
            $matrix = $this->reduceLowerTriangle($matrix);
            $matrix = $this->reduceUpperTriangle($matrix);
        } catch (DivisionByZeroError | NotANumber $e) {
            throw new MatrixNotInvertible;
        }

        return Matrix::fromColumns(
            ...$matrix
                ->columns()
                ->takeEnd(
                    $this->dimension->columns()->value()
                )
        );
    }
675716
def get_autoregressive_bias(max_length: int, dtype: str = C.DTYPE_FP32) -> mx.sym.Symbol:
    
    length_array = mx.sym.arange(max_length, dtype=dtype)
    # matrix with lower triangle and main diagonal set to 0, upper triangle set to 1
    bias = mx.sym.broadcast_greater(mx.sym.reshape(length_array, shape=(1, -1)),
                                    mx.sym.reshape(length_array, shape=(-1, 1)))
    bias = bias * -C.LARGE_VALUES[dtype]
    bias = mx.sym.reshape(bias, shape=(1, max_length, max_length))
    return mx.sym.BlockGrad(bias)
1158449
public static boolean getHasBiasFromConfig(Map<String, Object> layerConfig,
                                               KerasLayerConfiguration conf)
            throws InvalidKerasConfigurationException {
        Map<String, Object> innerConfig = KerasLayerUtils.getInnerLayerConfigFromConfig(layerConfig, conf);
        boolean hasBias = true;
        if (innerConfig.containsKey(conf.getLAYER_FIELD_USE_BIAS())) {
            hasBias = (boolean) innerConfig.get(conf.getLAYER_FIELD_USE_BIAS());
        }
        return hasBias;
    }
451279
public function matching(Criteria $criteria)
    {
        if ($this->isDirty) {
            $this->initialize();
        }

        if ($this->initialized) {
            return $this->collection->matching($criteria);
        }

        if ($this->association['type'] === ClassMetadata::MANY_TO_MANY) {
            $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);

            return new ArrayCollection($persister->loadCriteria($this, $criteria));
        }

        $builder         = Criteria::expr();
        $ownerExpression = $builder->eq($this->backRefFieldName, $this->owner);
        $expression      = $criteria->getWhereExpression();
        $expression      = $expression ? $builder->andX($expression, $ownerExpression) : $ownerExpression;

        $criteria = clone $criteria;
        $criteria->where($expression);

        $persister = $this->em->getUnitOfWork()->getEntityPersister($this->association['targetEntity']);

        return ($this->association['fetch'] === ClassMetadataInfo::FETCH_EXTRA_LAZY)
            ? new LazyCriteriaCollection($persister, $criteria)
            : new ArrayCollection($persister->loadCriteria($criteria));
    }
1097055
public function getFilter(QueryBuilder $qb, $dqlAlias)
    {
        if (null !== $this->dqlAlias) {
            $dqlAlias = $this->dqlAlias;
        }

        $field = ArgumentToOperandConverter::toField($this->field);

        return (string) $qb->expr()->isNotNull($field->transform($qb, $dqlAlias));
    }
277808
public function find($criteria = [], array $fields = []) {
		$criteriaNormalized = $this->normalizeCriteria($criteria);
		
		$mongoCursor = $this->getAdapter()->find(
			$this->getTableName(),
			$criteriaNormalized,
			$fields
		);
		
		if ($criteria instanceof Criteria) {
			$this->applyCriteriaToCursor($criteria, $mongoCursor);
		}
		
		return $this->createResultset($mongoCursor);
	}
1029094
private void setAccessors(int bias, JMFSchema schema) {
    int nextBoxBias = bias + fields.length + variants.length;
    for (int i = 0; i < fields.length; i++) {
      JSField field = fields[i];
      if (field instanceof JSVariant) {
        JSchema boxed = (JSchema) ((JSVariant)field).getBoxed();
        boxed.setAccessors(nextBoxBias, schema);
        // Copy accessors from the top type of the box to the visible variant
        JSVariant boxVar = (JSVariant) boxed.getJMFType();
        field.setAccessor(boxVar.getAccessor(boxed), boxed);
        field.setAccessor(boxVar.getAccessor(schema), schema);
        ((JSVariant) field).setBoxAccessor(i + bias, schema);
        nextBoxBias += boxed.getAccessorCount();
      }
      else
        field.setAccessor(i + bias, schema);
    }
    for (int i = 0; i < variants.length; i++)
      variants[i].setAccessor(i + bias + fields.length, schema);
  }
938729
public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof ApiLogQuery) {
            return $criteria;
        }
        $query = new ApiLogQuery(null, null, $modelAlias);

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
852719
public function getAnalyticsViewsForm($withPortfolioSelect = false)
    {
        return new AnalyticsViewsType($this->translator, $this->securityTokenStorage->getToken()->getUser(), $withPortfolioSelect);
    }
568340
public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof \FeatureType\Model\FeatureFeatureTypeQuery) {
            return $criteria;
        }
        $query = new \FeatureType\Model\FeatureFeatureTypeQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
537364
private function predicateFor($constraint): \bovigo\assert\predicate\Predicate
    {
        if ($constraint instanceof \PHPUnit\Framework\Constraint\Constraint) {
            return new \bovigo\assert\phpunit\ConstraintAdapter($constraint);
        }

        if ($constraint instanceof \bovigo\assert\predicate\Predicate) {
            return $constraint;
        }

        return \bovigo\assert\predicate\equals($constraint);
    }
1149559
public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof UserQuery) {
            return $criteria;
        }
        $query = new UserQuery(null, null, $modelAlias);

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
1326336
public function getOrElse($index, $default = null)
    {
        $focus = Aim::focus($index);

        if (!$focus->exists($this)) {
            return $default;
        }

        return $focus->get($this);
    }
657352
public function forForeignID($id)
    {
        // Turn a 1-element array into a simple value
        if (is_array($id) && sizeof($id) == 1) {
            $id = reset($id);
        }

        // Calculate the new filter
        $filter = $this->foreignIDFilter($id);

        $list = $this->alterDataQuery(function (DataQuery $query) use ($id, $filter) {
            // Check if there is an existing filter, remove if there is
            $currentFilter = $query->getQueryParam('Foreign.Filter');
            if ($currentFilter) {
                try {
                    $query->removeFilterOn($currentFilter);
                } catch (Exception $e) {
                    /* NOP */
                }
            }

            // Add the new filter
            $query->setQueryParam('Foreign.ID', $id);
            $query->setQueryParam('Foreign.Filter', $filter);
            $query->where($filter);
        });

        return $list;
    }
156963
public function getQuery(string $type = 'select', ...$arguments): QueryObject
    {
        $allowedTypes = [
            'select',
            'insert',
            'insertignore',
            'replace',
            'delete',
            'update',
            'criteriaonly',
        ];

        if (\in_array(strtolower($type), $allowedTypes, true) === false) {
            throw new Exception($type . ' is not a known type.', 1);
        }

        $queryArr = $this->adapterInstance->$type($this->statements, ...$arguments);

        return new QueryObject($queryArr['sql'], $queryArr['bindings'], $this->getConnection());
    }