Return low-level information on a container or image.

@param array $args
@param bool|false $raw
@param null $callback
@return mixed|\Symfony\Component\Process\Process
@throws \Exception
2763
public static function inspect(array $args, $raw = false, $callback = null)
    {
        $process = self::runCommand('inspect', $args, $callback);

        if ($process->isSuccessful() && !$raw) {
            $decoded = json_decode($process->getOutput());
            return reset($decoded);
        }

        return $process;
    }
1146579
public function call($callback, $arguments = [])
    {
        $dependencies = $this->getMethodDependencies($callback, $arguments);

        return call_user_func_array($callback, $dependencies);
    }
580381
public function createCollectionLoaderWith(array $args = null, callable $callback = null)
    {
        $factory = $this->collectionLoaderFactory();

        return $factory->create($factory->defaultClass(), $args, $callback);
    }
276181
protected function detectConsoleEnvironment(Closure $callback, array $args)
    {
        if (! is_null($value = $this->getEnvironmentArgument($args))) {
            return head(array_slice(explode('=', $value), 1));
        }

        return $this->detectWebEnvironment($callback);
    }
610879
public function get(...$args)
    {
        $record = $this->fetchSingle($args);
        if (!$record)
            return null;
        $obj = new $this->model_class;
        $obj->assignRecord($record, $this->db);
        return $obj;
    }
1290325
function parse($args = null)
    {
        if ($args === null) {
            $args = array_slice($_SERVER['argv'], 1);
        }

        foreach ($args as $pos => $arg) {
            // reset value
            $value = null;

            if (substr($arg, 0, 1) === '-') {
                if (preg_match('/^(.+)=(.+)$/', $arg, $matches)) {
                    $arg = $matches[1];
                    $value = $matches[2];
                }

                if (!$flag = @$this->flags[$arg]) {
                    throw new ParseException(sprintf('Flag "%s" is not defined.', $arg));
                }

                unset($args[$pos]);

                if ($flag->hasValue) {
                    if (!isset($value)) {
                        $value = $args[$pos + 1];
                        unset($args[$pos + 1]);
                    }
                } else {
                    $value = true;
                }

                if (null !== $flag->callback) {
                    call_user_func_array($flag->callback, array(&$value));
                }

                # Set the reference given as the flag's 'var'.
                $flag->var = $this->parsedFlags[$flag->name] = $value;
            }
        }

        # TODO: Refactor this so this fits into the above foreach
        foreach ($this->flags as $flag) {
            if (!array_key_exists($flag->name, $this->parsedFlags)) {
                $flag->var = $this->parsedFlags[$flag->name] = $flag->defaultValue;
            }
        }

        $this->parsedArgs = $args = array_values($args);

        $pos = 0;

        foreach ($this->args as $arg) {
            if ($arg->required and !isset($args[$pos])) {
                throw new ArgumentException(sprintf(
                    'Missing required argument "%s"', $arg->name
                ));
            }

            if (isset($args[$pos])) {
                if ($arg->vararg) {
                    $value = array_slice($args, $pos);
                    $pos += count($value);
                } else {
                    $value = $args[$pos];
                    $pos++;
                }
            } else {
                $value = $arg->defaultValue;
            }

            $this->parsedNamedArgs[$arg->name] = $value;
        }
    }
133592
final private function get_argument_count($callback, $accepted_args = 1)
    {
        try {
            if (\is_string($callback) && \is_callable([$this, $callback])) {
                $reflector = new ReflectionMethod($this, $callback);
                return $reflector->getNumberOfParameters();
            }

            if (\is_object($callback) && $callback instanceof Closure) {
                $reflector = new ReflectionFunction($callback);
                return $reflector->getNumberOfParameters();
            }
        } catch (ReflectionException $exception) {
            \error_log($exception->getMessage());
        }

        return $accepted_args ? $accepted_args : 1;
    }
82972
public static function find($args = false)
    {
        /* @var ActiveRecord $model */

        $query = null;
        $model = new static();

        if ($args && $args instanceof Query) {
            $query = $args;
            $query->limit = 1;

            if (empty($query->from)) {
                $query->addFrom($model->getTableName().' T');
            }
        } elseif ($args && is_array($args)) {
            $args['limit'] = 1;
            if (!isset($args['from'])) {
                $args['from'] = $model->getTableName().' T';
            }
            $query = new Query($args);
        } elseif (!$args) {
            $query = new Query(
                [
                    'from' => $model->getTableName().' T',
                    'limit' => 1,
                ]
            );
        } else {
            throw new Exception(translate('Bad arguments'), 500, Exception::BADARGUMENTS);
        }

        $stmt = $model->getDB()->prepare($query->toSql());
        $stmt->execute($query->params);
        $record = $stmt->fetchObject(get_class($model), [false]);
        $stmt->closeCursor();

        return $record;
    }
50037
public function getLeadsByList($listId, $args = array(), $returnRaw = false)
    {
        $args['listId'] = $listId;

        return $this->getResult('getLeadsByList', $args, false, $returnRaw);
    }
770086
public function pipeline(callable $callback = null)
    {
        $pipeline = $this->client()->pipeline();

        return is_null($callback)
            ? $pipeline
            : tap($pipeline, $callback)->exec();
    }
1351980
function get($key,$args=NULL) {
		if (is_string($val=$this->ref($key,FALSE)) && !is_null($args))
			return call_user_func_array(
				array($this,'format'),
				array_merge(array($val),is_array($args)?$args:array($args))
			);
		if (is_null($val)) {
			// Attempt to retrieve from cache
			if (Cache::instance()->exists($this->hash($key).'.var',$data))
				return $data;
		}
		return $val;
	}
1107908
public static function capture( $callback, $params = array() )
	{
		if ( is_string( $callback ) )
		{
			return $callback;
		}

		if ( !is_closure( $callback ) )
		{
			return "";
		}

		if ( !is_array( $params ) ) 
		{
			$params = array( $params );
		}

		ob_start();
		$return = call_user_func_array( $callback,  $params );
		$buffer = ob_get_clean();

		if ( !is_null( $return ) )
		{
			return $return;
		}

		return $buffer;
	}
596315
protected function executeCallback($callback, $args)
    {
        if (is_string($callback)) {
            return $this->callStringCallback($callback, $args);
        } elseif ($callback instanceof Closure) {
            return call_user_func_array($callback, $args);
        }

        return '';
    }
790103
public function getUniqueSlug($callback, $slug, array $args = array())
    {
        if (!is_callable($callback)) {
            throw new InvalidArgumentException(
                sprintf('First argument must be callable, received "%s"', gettype($callback))
            );
        }

        $count = 0;

        while (true) {
            $count++;

            if (call_user_func_array($callback, array_merge(array($slug), $args))) {
                // If dash can't be found, then add first
                if (!$this->isNumericSlug($slug)) {
                    $slug = sprintf('%s-%s', $slug, $count);
                } else {
                    $slug = $this->createUniqueNumericSlug($slug);
                }

            } else {
                break;
            }
        }

        return $slug;
    }
179874
private function processDefaultSubCommands(RawArgs $args, Command $currentCommand)
    {
        if ($result = $this->processDefaultCommands($args, $currentCommand->getDefaultSubCommands())) {
            return $result;
        }

        // No default commands, return the current command
        return new ResolveResult($currentCommand, $args);
    }
344658
public static function get(array $arg_params)
    {
        //validate params
        $data = self::getParams($arg_params);
        $url = '/ecommerce/customers';
        if(!empty($data['id'])){
            $url .= '/'.$data['id'];
        }else{
            return null;
        }

        //submit to api
        $customer_data = APIRequests::request(
            $url,
            APIRequests::METHOD_GET
        );

        //return response
        return self::toObj($customer_data['body']);
    }
1202854
public function execute($callback, array $parameters = [], $defaultMethod = null)
    {
        return $this->container->call($callback, $parameters, $defaultMethod);
    }