Get a list of mappings representing all containers

    all
        Return all containers

    trunc
        Set it to True to have the short ID

    Returns a mapping of containers
559566
def get_containers(config,
                   all=True,
                   trunc=False,
                   since=None,
                   before=None,
                   limit=-1,
                   *args,
                   **kwargs):
    '''
    
    '''
    err = "Unknown"
    client = _get_client(config)
    try:
        ret = client.containers(all=all,
                                trunc=trunc,
                                since=since,
                                before=before,
                                limit=limit)
        return ret
    except Exception as e:
        err = e
    utils.error("Unable to list Docker containers: %s"%err)
    return None
1062391
function(cid) {

    // Get list of generic containers.
    return list()
    // Filter by container id and container name.
    .filter(function(container) {
      return container.id === cid || container.name === cid;
    })
    // Return head on results.
    .then(function(results) {
      assert(results.length < 2);
      return _.head(results);
    });

  }
1087191
def get_containers_by_name(self, name):
        
        code, containers = self.get_containers()

        if code != httplib.OK:
            return []

        return [container for container in containers if
                any(map(lambda x: x.startswith(name), container.Names))]
1201217
def all(self) -> List[Any]:
        
        values = []
        for name, value in self._entrypoints.items():
            if isinstance(value, EntryPoint):
                value = self._entrypoints[name] = value.load()

            values.append(value)

        return values
1037936
def get_all_rml(self, **kwargs):
        
        rml_procs = self.es_defs.get("kds_esRmlProcessor", [])
        role = kwargs.get('role')
        if role:
            rml_procs = [proc for proc in rml_procs
                         if role == 'rdf_class' or
                         proc['force']]
        rml_maps = {}
        for rml in rml_procs:
            rml_maps[rml['name']] = self.get_rml(rml, **kwargs)
        return rml_maps
451347
def list_all():
    '''
    
    '''
    if 'ports.list_all' not in __context__:
        __context__['ports.list_all'] = []
        for path, dirs, files in salt.utils.path.os_walk('/usr/ports'):
            stripped = path[len('/usr/ports'):]
            if stripped.count('/') != 2 or stripped.endswith('/CVS'):
                continue
            __context__['ports.list_all'].append(stripped[1:])
    return __context__['ports.list_all']
153078
def _full_map(self):
    """"""
    result = {}
    if self._parent:
      result.update(self._parent)
    result.update(self._map)
    return result
1179225
@VisibleForTesting
  static Map<Integer, Container> getContainers(
      PackingPlan currentPackingPlan, Resource maxContainerResource, Resource padding,
      Map<String, TreeSet<Integer>> componentIndexes, TreeSet<Integer> taskIds) {
    Map<Integer, Container> containers = new HashMap<>();

    Resource capacity = maxContainerResource;
    for (PackingPlan.ContainerPlan currentContainerPlan : currentPackingPlan.getContainers()) {
      Container container =
          new Container(currentContainerPlan.getId(), capacity, padding);
      for (PackingPlan.InstancePlan instancePlan : currentContainerPlan.getInstances()) {
        addToContainer(container, instancePlan, componentIndexes, taskIds);
      }
      containers.put(currentContainerPlan.getId(), container);
    }
    return containers;
  }
607721
def getall(self, key, failobj=None):
        """"""
        if self.mmkeys is None: self._mmInit()
        k = self.mmkeys.get(key)
        if not k: return failobj
        return list(map(self.data.get, k))
681225
def containers(self) -> list:
        

        all_containers: List = list()
        for slot in self:
            all_containers += slot.get_children_list()

        for container in all_containers:
            if getattr(container, 'stackable', False):
                all_containers += container.get_children_list()

        return all_containers
36356
def get_all_storage_keys(self):
        

        parts1 = [
            self.model._name,
            self.field.name,
        ]

        parts2 = parts1 + ['*']  # for indexes taking args, like for hashfields

        if self.prefix:
            parts1.append(self.prefix)
            parts2.append(self.prefix)

        if self.key:
            parts1.append(self.key)
            parts2.append(self.key)

        parts1.append('*')
        parts2.append('*')

        return set(
            self.model.database.scan_keys(self.field.make_key(*parts1))
        ).union(
            set(
                self.model.database.scan_keys(self.field.make_key(*parts2))
            )
        )
596429
def remove_all_containers(**kwargs):
    
    containers = docker_fabric().remove_all_containers(**kwargs)
    if kwargs.get('list_only'):
        puts('Existing containers:')
        for c_id in containers[1]:
            fastprint(c_id, end='\n')
1285638
def get_containers
      containers = { }

      @executor_pool.ps() do |id, mac, *cidrs|
        next if id == 'weave:expose'

        containers[id] = cidrs
      end

      containers
    end
1222321
public List<Map<String, Object>> toMaps() {
        hydrate();
        List<Map<String, Object>> maps = new ArrayList<>(delegate.size());
        for (T t : delegate) {
            maps.add(t.toMap());
        }
        return maps;
    }
112294
def list_containers(self):
        
        containers = []
        for container in self._list_podman_containers():
            identifier = container["ID"]
            name = container["Names"]
            image_name = container["Image"]

            try:
                image_name, image_tag = parse_reference(image_name)
            except (IndexError, TypeError):
                image_name, image_tag = None, None

            image = PodmanImage(image_name, tag=image_tag, identifier=None)
            container = PodmanContainer(image, identifier, name=name)
            containers.append(container)

        return containers
378166
def list_container_objects(self, container, prefix=None, delimiter=None):
        
        LOG.debug('list_container_objects() with %s is success.', self.driver)
        return self.driver.list_container_objects(container, prefix, delimiter)
1274817
def container_id(self):
        
        if getattr(self, "_container_id", None):
            return self._container_id

        try:
            containers = self.harpoon.docker_api.containers(all=True)
        except ValueError:
            log.warning("Failed to get a list of active docker files")
            containers = []

        self._container_id = None
        for container in containers:
            if any(self.name in container.get("Names", []) for name in (self.container_name, "/{0}".format(self.container_name))):
                self._container_id = container["Id"]
                break

        return self._container_id