Compute the estimator bandwidth with given method.

The new bandwidth calculated after a call to `setBandwidth` is used
for subsequent evaluations of the estimated density.

@param string $bwMethod Either "scott" or "silverman"
18432
public function setBandwidth($bwMethod = null)
    {
        if ($bwMethod == 'scott' || null === $bwMethod) {
            $this->coVarianceFactor = function () {
                return pow(count($this->dataset), -1. / (5));
            };
        } elseif ($bwMethod == 'silverman') {
            $this->coVarianceFactor = function () {
                return pow(count($this->dataset) * (3.0) / 4.0, -1. / (5));
            };
        } elseif (is_numeric($bwMethod)) {
            $this->coVarianceFactor = function () use ($bwMethod) {
                return $bwMethod;
            };
        } else {
            throw new \InvalidArgumentException(sprintf(
                'Unknown bandwidth method "%s"',
                $bwMethod
            ));
        }

        $this->computeCovariance();
    }
1302724
public function getMethodTitle($shippingMethod)
    {
        $this->fetchAvailableShippingMethods();
        return isset($this->methods[$shippingMethod]['display_text']) ?
            $this->methods[$shippingMethod]['display_text'] : null;
    }
1355761
public function getMethod ($method)
	{
		
		// Get methods
		
		$this->getMethods ();
		
		// Loop through the methods
		
		foreach ($this->methods as $obj)
		{
			
			// If the method names match return 
			
			if (strtolower ($obj->get ('name')) == strtolower ($method))
			{
				return $obj;
			}
			
		}
		
		// Return FALSE
		
		return FALSE;
		
	}
1032824
public function setPaymentMethod($method)
    {
        try {
            if ($method instanceof PagSeguroDirectPaymentMethods) {
                $this->paymentMethod = $method;
            } else {
                $this->paymentMethod = new PagSeguroDirectPaymentMethods($method);
            }
        } catch (Exception $e) {
            die($e->getMessage());
        }
    }
579139
public function setMethod($method)
    {
      if(!is_string($method) && strlen(trim($method)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid method, must be a non empty string');

      $this->method = $method;
    }
733096
public function setMethod($method) {
        if (isset(static::$_methodOptionMap[$method])) {
            return $this->setOption(static::$_methodOptionMap[$method],true);
        } else {
            return $this->setOption(CURLOPT_CUSTOMREQUEST,$method);
        }
    }
56910
private void processSetSizeOps(String methodName) throws ClassNotFoundException {
        if ("setSize".equals(methodName)) {
            int argCount = SignatureUtils.getNumParameters(getSigConstantOperand());
            if ((windowClass != null) && (stack.getStackDepth() > argCount)) {
                OpcodeStack.Item item = stack.getStackItem(argCount);
                JavaClass cls = item.getJavaClass();
                if ((cls != null) && cls.instanceOf(windowClass)) {
                    bugReporter.reportBug(
                            new BugInstance(this, BugType.S508C_NO_SETSIZE.name(), NORMAL_PRIORITY).addClass(this).addMethod(this).addSourceLine(this));
                }
            }
        }
    }
510411
def _WsdlHasMethod(self, method_name):
    
    try:
      self._method_bindings.get(method_name)
      return True
    except ValueError:
      return False
1104800
public function setCustomMethod(Method $method)
    {
        $this->setMethod(self::METHOD_CUSTOM);
        $this->methods[$this->method] = get_object_vars($method);

        $this->loadSettings();
    }
1197654
private function checkMethodExist(string $method):int
    {
        if (in_array($method, $this->methodsReq)) {
            return (1);
        } else {
            new Server500(new \ArrayObject(array("explain" => "Unknown method $method for Allowed method request",
                "solution" => "Allowed methods request must be ".json_encode($this->methodsReq))));
        }
        return (0);
    }
437876
function set_method($xmlrpcpath) {
        if (is_string($xmlrpcpath)) {
            $this->method = $xmlrpcpath;
            $this->params = array();
            return true;
        }
        $this->method = '';
        $this->params = array();
        return false;
    }
1363535
public function methodIsCallable($method)
    {
        return ! $this->methodIsBlacklisted($method) &&
            method_exists($this, $method) &&
            ! method_exists(ModelFilter::class, $method);
    }
307224
public static function getAccountAvailableBandwidth($accountVShares, $totalVestingShares, $maxVirtualBandwidth)
    {
        return gmp_strval(gmp_div_q(
            gmp_div_q($maxVirtualBandwidth, self::BANDWIDTH_PRECISION, GMP_ROUND_MINUSINF),
            gmp_div_q($totalVestingShares, $accountVShares, GMP_ROUND_PLUSINF),
            GMP_ROUND_MINUSINF
        ));
    }
1079602
public function set_active_method($method) {
        global $DB;

        $this->ensure_isset(array('context', 'component', 'area'));

        // make sure the passed method is empty or a valid plugin name
        if (empty($method)) {
            $method = null;
        } else {
            if ('gradingform_'.$method !== clean_param('gradingform_'.$method, PARAM_COMPONENT)) {
                throw new moodle_exception('invalid_method_name', 'core_grading');
            }
            $available = $this->get_available_methods(false);
            if (!array_key_exists($method, $available)) {
                throw new moodle_exception('invalid_method_name', 'core_grading');
            }
        }

        // get the current grading area record if it exists
        if (is_null($this->areacache)) {
            $this->areacache = $DB->get_record('grading_areas', array(
                'contextid' => $this->context->id,
                'component' => $this->component,
                'areaname'  => $this->area),
            '*', IGNORE_MISSING);
        }

        $methodchanged = false;

        if ($this->areacache === false) {
            // no area record yet, create one with the active method set
            $area = array(
                'contextid'     => $this->context->id,
                'component'     => $this->component,
                'areaname'      => $this->area,
                'activemethod'  => $method);
            $DB->insert_record('grading_areas', $area);
            $methodchanged = true;

        } else {
            // update the existing record if needed
            if ($this->areacache->activemethod !== $method) {
                $DB->set_field('grading_areas', 'activemethod', $method, array('id' => $this->areacache->id));
                $methodchanged = true;
            }
        }

        $this->areacache = null;

        return $methodchanged;
    }
32803
protected function _lsb($method)
    {
        $class = get_class($this);
        $args = array_slice(func_get_args(), 1);
        return call_user_func_array(array(
            $class,
            $method
        ), $args);
    }
33042
private static function setKeyAndMethod($driver, $key, $method): void
    {
        $driver->setKey($key);
        if ($method !== null) {
            $driver->setMethod($method);
        }
    }
1283404
@Override
    public void setMethod(String method) throws UnsupportedMethodException {
        MethodValues val = MethodValues.match(method, 0, method.length());
        if (null == val) {
            throw new UnsupportedMethodException("Illegal method " + method);
        }
        setMethod(val);
    }