Get basic usage.

@return string
346696
public function getBasicExample(): string
    {
        $author = Author::instance('123', 'John', 'Dow');

        $encoder = Encoder::instance([
            Author::class => AuthorSchema::class,
        ])->withEncodeOptions(JSON_PRETTY_PRINT);

        $result = $encoder->withUrlPrefix('http://example.com/api/v1')->encodeData($author);

        return $result;
    }
1273562
public function getUsage()
    {
        if (!$this->isParsed) {
            $this->parseDefinitions();
        } //if

        /* build list of argument names and calculate
           the first column width so we can pad to 
           align definitions */
        $firstCol = array();
        $longestDef = 0;
        foreach (array_keys($this->longNames) as $longName) {
            ob_start();
            echo "--{$longName}|-{$this->getShortName($longName)}";

            if ($this->allowsValue($longName)) {
                echo "={$this->getValueType($longName)}";
            } //if

            if ($this->allowsMultiple($longName)) {
                echo "+";
            } //if

            $defLength = ob_get_length();

            $longestDef = max($longestDef, $defLength);

            $firstCol[$longName] = ob_get_contents();
            ob_end_clean();

        } //foreach

        $firstColMaxWidth = $longestDef + 4;

        ob_start();

        foreach ($firstCol as $longName => $def) {
            $currentDefLength = strlen($def);

            $padding = str_repeat(" ", $firstColMaxWidth - $currentDefLength);

            echo "{$def}{$padding}{$this->getDescription($longName)}", PHP_EOL;
        } //foreach

        echo PHP_EOL;

        $usage = ob_get_contents();
        ob_end_clean();
        
        return $usage;

    }
71652
protected function getUsageRecords() {
        if (!$this->_usageRecords) {
            $this->_usageRecords = new UsageRecordList($this->version, $this->solution['sid']);
        }

        return $this->_usageRecords;
    }
256569
public function baseContext() {
        $baseContext = get_property("web.base_context", "");
        if (empty($baseContext)) {
            $baseContext = !empty($_SERVER["CONTEXT_PREFIX"])? $_SERVER["CONTEXT_PREFIX"] : "";
        }
        return $baseContext;
    }
1259260
public function UsageListAsString()
    {
        $pages = implode(', ', $this->Pages()->column('URLSegment'));
        $sets = implode(', ', $this->BlockSets()->column('Title'));
        $_t_pages = _t('Block.PagesAsString', 'Pages: {pages}', '', ['pages' => $pages]);
        $_t_sets = _t('Block.BlockSetsAsString', 'Block Sets: {sets}', '', ['sets' => $sets]);
        if ($pages && $sets) {
            return "$_t_pages<br />$_t_sets";
        }
        if ($pages) {
            return $_t_pages;
        }
        if ($sets) {
            return $_t_sets;
        }
    }
17015
public function usedOSs()
    {
        $results = [];

        foreach ($this->views as $view) {
            array_key_exists($view->os, $results) ? $results[$view->os]++ : $results[$view->os] = 1;
        }

        return $results;
    }
622461
public static function current()
    {
        if (defined('PHPUNIT_RUNNING')) {
            return 'http://localhost';
        }

        $protocol = (isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)
            || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0)
            ? 'https://' : 'http://';

        return $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    }
1257024
def get_usages(self):
        ""
        result = dict()
        for key, usage in self.items():
            result[key] = usage.value
        return result
846140
public function toString()
    {
        $uses = $this->getIterator();
        $string = '';
        foreach ($uses as $use) {
            $string .= $use->toString();
        }

        return $string;
    }
249396
public function getAmount()
    {
        if ($this->isStatusExceptional()) {
            return (string)($this->getData()->getBtcPrice() * $this->getData()->getRate());
        }

        return (string)$this->data->getPrice();
    }
38167
public function getTermsOfUse()
    {
        if (false === $xml = simplexml_load_string($this->get_prefs())) {
            return null;
        }

        foreach ($xml->xpath('/baseprefs/cgu') as $sbpcgu) {
            return $sbpcgu->saveXML();
        }
    }
792127
protected function getUsings()
    {
        $usings = array();

        for ($i=0; $i<count($this->values); $i++) {
            $using = '"-" using 1:2 with '.$this->mode;
            if (isset($this->titles[$i])) {
                $using .= ' title "'.$this->titles[$i].'"';
            }
            $usings[] = $using;
        }

        return implode(', ', $usings);
    }
110945
public function current() {
		if ($this->string === null) {
			$this->string = fgets($this->file);
		}
		
		$string = rtrim($this->string, "\n\r");
		
		if ($this->delimiter === null) {
			return $string;
		} 
		
		$dataRaw = explode($this->delimiter, $string);
		$data    = [];

		if ($this->partsNames === null) {
			foreach ($dataRaw as $key => $part) {
				$data[self::UNNAMED_PREFIX . $key] = $part;
			}
			
			return $data;
		}
		
		foreach ($dataRaw as $key => $part) {
			if (isset($this->partsNames[$key])) {
				$data[$this->partsNames[$key]] = $part;
				continue;
			}
			
			$data[self::UNNAMED_PREFIX . $key] = $part;
		}

		return $data;
	}
663948
public static function getUsage($system=false, $peak = true) {
        if ($peak) {
            $mem = memory_get_peak_usage($system);
        } else {
            $mem = memory_get_usage($system);
        }

       $unit=array('b','kb','mb','gb','tb','pb');
       return round($mem/pow(1024,($i=floor(log($mem,1024)))),2).' '.$unit[$i];
    }
412266
public function current()
    {
        $extractor = $this->_value;
        $current = $this->_fetchCurrent();
        $spacer = str_repeat($this->_spacer, $this->getDepth());

        return $spacer . $extractor($current, parent::key(), $this);
    }
494986
protected function getUsageStrategies()
    {
        if (is_array($this->usageStrategies)) {
            return $this->usageStrategies;
        }

        $this->usageStrategies = [];
        $assetUsageStrategyImplementations = $this->reflectionService->getAllImplementationClassNamesForInterface(AssetUsageStrategyInterface::class);
        foreach ($assetUsageStrategyImplementations as $assetUsageStrategyImplementationClassName) {
            $this->usageStrategies[] = $this->objectManager->get($assetUsageStrategyImplementationClassName);
        }

        return $this->usageStrategies;
    }
766939
public static function current()
    {
        if (defined('PHPUNIT_RUNNING')) {
            return 'http://localhost';
        }

        $protocol = (!empty($_SERVER['HTTPS'])
            && $_SERVER['HTTPS'] !== 'off'
            || (int) $_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://';

        return $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
    }