List all containers, just names if noted

@param bool $include_properties If true, additional properties are retrieved

@throws \Exception
@return array
490684
public function listContainers($include_properties = false)
    {
        $out = [];
        $root = FileUtilities::fixFolderPath(static::asFullPath('', false));
        $files = array_diff(scandir($root), ['.', '..', '.private']);
        foreach ($files as $file) {
            $dir = $root . $file;
            // get file meta
            if (is_dir($dir) || is_file($dir)) {
                $result = ['name' => $file, 'path' => $file];
                if ($include_properties) {
                    $temp = stat($dir);
                    $result['last_modified'] = gmdate(static::TIMESTAMP_FORMAT, array_get($temp, 'mtime', 0));
                }

                $out[] = $result;
            }
        }

        return $out;
    }
1068508
public static function getAvailableList($includeConcreteDirJobs = 1)
    {
        $jobObjs = array();

        //get existing jobs
        $existingJobHandles = array();
        $existingJobs = static::getList();
        foreach ($existingJobs as $j) {
            $existingJobHandles[] = $j->getJobHandle();
        }

        if (!$includeConcreteDirJobs) {
            $jobClassLocations = array(DIR_FILES_JOBS);
        } else {
            $jobClassLocations = static::jobClassLocations();
        }

        foreach ($jobClassLocations as $jobClassLocation) {
            // Open a known directory, and proceed to read its contents
            if (is_dir($jobClassLocation)) {
                if ($dh = opendir($jobClassLocation)) {
                    while (($file = readdir($dh)) !== false) {
                        if (substr($file, strlen($file) - 4) != '.php') {
                            continue;
                        }

                        $alreadyInstalled = 0;
                        foreach ($existingJobHandles as $existingJobHandle) {
                            if (substr($file, 0, strlen($file) - 4) == $existingJobHandle) {
                                $alreadyInstalled = 1;
                                break;
                            }
                        }
                        if ($alreadyInstalled) {
                            continue;
                        }

                        $jHandle = substr($file, 0, strlen($file) - 4);
                        $className = static::getClassName($jHandle);
                        $jobObjs[$jHandle] = Core::make($className);
                        $jobObjs[$jHandle]->jHandle = $jHandle;
                    }
                    closedir($dh);
                }
            }
        }

        return $jobObjs;
    }
44994
public function getFileProperties($container, $path, $include_content = false, $content_as_base = true)
    {
        if (!$this->fileExists($container, $path)) {
            throw new NotFoundException("File '$path' does not exist in storage.");
        }
        $file = static::addContainerToName($container, $path);
        $shortName = FileUtilities::getNameFromPath($path);
        $ext = FileUtilities::getFileExtension($file);
        $temp = stat($file);
        $data = [
            'path'           => $path,
            'name'           => $shortName,
            'content_type'   => FileUtilities::determineContentType($ext, '', $file),
            'last_modified'  => gmdate('D, d M Y H:i:s \G\M\T', array_get($temp, 'mtime', 0)),
            'content_length' => array_get($temp, 'size', 0)
        ];
        if ($include_content) {
            $contents = file_get_contents($file);
            if (false === $contents) {
                throw new InternalServerErrorException('Failed to retrieve file properties.');
            }
            if ($content_as_base) {
                $contents = base64_encode($contents);
            }
            $data['content'] = $contents;
        }

        return $data;
    }
883746
protected function allFieldsFromDataObject($includeHasOne = false)
    {
        $fields = [];
        $db = DataObject::config()->get('fixed_fields');
        $extra = Config::inst()->get($this->getDataObjectClass(), 'db');
        if ($extra) {
            $db = array_merge($db, $extra);
        }

        foreach ($db as $fieldName => $type) {
            $fields[] = $fieldName;
        }

        if ($includeHasOne) {
            $hasOne = $this->getDataObjectInstance()->hasOne();
            foreach ($hasOne as $fieldName => $class) {
                $fields[] = $fieldName;
            }
        }

        return $fields;
    }
1218322
private static function getExcludedFiles(ContainerBuilder $container): array
    {
        /**
         * @noinspection PhpUnhandledExceptionInspection
         * @psalm-var    array<int, string> $excludedFiles
         *
         * @var string[] $excludedFiles
         */
        $excludedFiles = true === $container->hasParameter('service_bus.auto_import.handlers_excluded')
            ? $container->getParameter('service_bus.auto_import.handlers_excluded')
            : [];

        return $excludedFiles;
    }
818898
public static function optionsRestrictions($include_empty): array
    {
        $options = [
            'none'         => I18N::translate('Show to visitors'),
            'privacy'      => I18N::translate('Show to members'),
            'confidential' => I18N::translate('Show to managers'),
            'locked'       => I18N::translate('Only managers can edit'),
        ];

        if ($include_empty) {
            $options = ['' => ''] + $options;
        }

        return $options;
    }
1227080
public function listInvalidProperties()
    {
        $invalidProperties = [];

        $allowedValues = $this->getHighGradeAllowableValues();
        if (!in_array($this->container['high_grade'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'high_grade', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        $allowedValues = $this->getLowGradeAllowableValues();
        if (!in_array($this->container['low_grade'], $allowedValues)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'low_grade', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }
258421
private static function base_options($includenotset = true, $includeinherit = true) {

        $options = [];

        if ($includenotset) {
            $options[\tool_dataprivacy\context_instance::NOTSET] = get_string('notset', 'tool_dataprivacy');
        }

        if ($includeinherit) {
            $options[\tool_dataprivacy\context_instance::INHERIT] = get_string('inherit', 'tool_dataprivacy');
        }

        return $options;
    }
407823
public function getFolderProperties($container, $path)
    {
        $path = FileUtilities::fixFolderPath($path);
        $shortName = FileUtilities::getNameFromPath($path);
        $out = ['name' => $shortName, 'path' => $path];
        if ($this->containerExists($container) && $this->blobExists($container, $path)) {
            $properties = $this->getBlobProperties($container, $path);
            $out = array_merge($properties, $out);
        }

        return $out;
    }
1373395
public function getLinksArray($includeOnlyVisited = false){
        $links = $this->getLinks();
        
        if($includeOnlyVisited === true){
            $links = array_filter($links, function (Link $linkObj) {
                /*@var $linkObj Link */
                return $linkObj->isVisited() === true;
            });
        }
        
        return array_map(function(Link $link){
            return [
              'fullUrl' => $link->getAbsoluteUrl(),
              'uri' => $link->getPath(),
              'metaInfo' => $link->getMetaInfoArray(),
              'parentLink' => $link->getParentUrl(),
              'statusCode' => $link->getStatusCode(), 
              'status' => $link->getStatus(), 
              'contentType' => $link->getContentType(), 
              'errorInfo' => $link->getErrorInfo(),
              'crawlDepth' => $link->getCrawlDepth(),              
            ];
        },$links);
    }
548994
public function listPaths($preserveDuplicates = false)
    {
        if (!$this->checked) {
            // make sure we don't have a circular reference here
            $stk = [];
            $stk[] = $this;
            $this->dieOnCircularReference($stk, $this->project);
        }

        $result = [];
        for ($i = 0, $elSize = count($this->elements); $i < $elSize; $i++) {
            $o = $this->elements[$i];
            if ($o instanceof Reference) {
                $refId = $o->getRefId();
                $o = $o->getReferencedObject($this->project);
                // we only support references to paths right now
                if (!($o instanceof Path)) {
                    $msg = $refId . " doesn't denote a path";
                    throw new BuildException($msg);
                }
            }

            if (is_string($o)) {
                $result[] = $o;
            } elseif ($o instanceof PathElement) {
                $parts = $o->getParts();
                if ($parts === null) {
                    throw new BuildException(
                        "You must either set location or"
                        . " path on <pathelement>"
                    );
                }
                foreach ($parts as $part) {
                    $result[] = $part;
                }
            } elseif ($o instanceof Path) {
                $p = $o;
                if ($p->getProject() === null) {
                    $p->setProject($this->getProject());
                }
                $parts = $p->listPaths();
                foreach ($parts as $part) {
                    $result[] = $part;
                }
            } elseif ($o instanceof DirSet) {
                $dset = $o;
                $ds = $dset->getDirectoryScanner($this->project);
                $dirstrs = $ds->getIncludedDirectories();
                $dir = $dset->getDir($this->project);
                foreach ($dirstrs as $dstr) {
                    $d = new PhingFile($dir, $dstr);
                    $result[] = $d->getAbsolutePath();
                }
            } elseif ($o instanceof FileSet) {
                $fs = $o;
                $ds = $fs->getDirectoryScanner($this->getProject());
                $filestrs = $ds->getIncludedFiles();
                $dir = $fs->getDir($this->getProject());
                foreach ($filestrs as $fstr) {
                    $d = new PhingFile($dir, $fstr);
                    $result[] = $d->getAbsolutePath();
                }
            } elseif ($o instanceof FileList) {
                $fl = $o;
                $dirstrs = $fl->getFiles($this->project);
                $dir = $fl->getDir($this->project);
                foreach ($dirstrs as $dstr) {
                    $d = new PhingFile($dir, $dstr);
                    $result[] = $d->getAbsolutePath();
                }
            }
        }

        return $preserveDuplicates ? $result : array_unique($result);
    }
177463
def list_containers(self):
        
        data = run_cmd(["machinectl", "list", "--no-legend", "--no-pager"],
                       return_output=True)
        output = []
        reg = re.compile(r"\s+")
        for line in data.split("\n"):
            stripped = line.strip()
            if stripped:
                parts = reg.split(stripped)
                name = parts[0]
                output.append(self.ContainerClass(None, None, name=name))
        return output
729361
public function getSimpleData($include_header = true)
	{
		$return = [];

		if ($include_header) {
			$return[] = $this->getHeader();
		}

		foreach ($this->data as $item) {
			$return[] = $this->getRow($item);
		}

		return $return;
	}
1177908
public function listDatabases($detailed = false)
    {
        $result = $this->connection->listDBs();

        if ($detailed) {
            return $result;
        }

        return array_map(
            function ($database) {
                return $database['name'];
            },
            $result['databases']
        );
    }
374992
def _get_containers(self):
        """"""
        infos = self.native_conn.list_containers_info()
        return [self.cont_cls(self, i['name'], i['count'], i['bytes'])
                for i in infos]
320371
public function getIncludedFields(string $resourceType): array
    {
        if ($this->includedFields === null) {
            $this->includedFields = $this->setIncludedFields();
        }

        return isset($this->includedFields[$resourceType]) ? array_keys($this->includedFields[$resourceType]) : [];
    }
1222944
public function getLoadedApps(bool $only_names = true)
    {
        if ($only_names) {
            return array_keys($this->instances);
        }

        return $this->instances;
    }