Download all the containers owned by a group

        Arguments
        ---------
        include_only: List containg `Group` or `Location` objects
            Search only over a list of groups or locations
199970
def get_containers(self, include_only=[]):
        
        locations = self.get_locations() 
        if len(locations) == 0:
            raise ValueError("No locations for containers exist in Cheminventory")

        final_locations = []
        if include_only:
            for location in locations:
                check = location in include_only or location.group in include_only
                if check:
                    final_locations.append(location)
            if len(final_locations)==0: raise ValueError(f"Location(s) or group(s) {include_only} is/are not in the database.")
        else:
            final_locations = locations

        containers = []
        for location in final_locations:
            containers += self._get_location_containers(location.inventory_id)

        return containers
481763
def get_all_children(self, include_self=False):
        
        ownership = Ownership.objects.filter(parent=self)
        subsidiaries = Company.objects.filter(child__in=ownership)
        for sub in subsidiaries:
            subsidiaries = subsidiaries | sub.get_all_children()

        if include_self is True:
            self_company = Company.objects.filter(id=self.id)
            subsidiaries = subsidiaries | self_company

        return subsidiaries
413478
def compact(self, include=None):
        
        return self._get(self._build_url(self.endpoint.compact(include=include)))
768223
def all(self, query=None, **kwargs):
        

        return super(OrganizationsProxy, self).all(query=query)
298797
def _get_groups(self, data):
        
        groups = []
        for attribute in SOURCE_KEYS:
            for k, v in data[attribute].items():
                if k == None:
                    k = 'Sources'
                if k not in groups:
                    groups.append(k)
        for k, v in data['include_files'].items():
            if k == None:
                k = 'Includes'
            if k not in groups:
                groups.append(k)
        return groups
195940
def group_list():
    '''
    
    '''

    ret = {'installed': [],
        'partially_installed': [],
        'available': []}

    # find out what's available

    cmd = ['pacman', '-Sgg']
    out = __salt__['cmd.run'](cmd, output_loglevel='trace', python_shell=False)

    available = {}

    for line in salt.utils.itertools.split(out, '\n'):
        if not line:
            continue
        try:
            group, pkg = line.split()[0:2]
        except ValueError:
            log.error('Problem parsing pacman -Sgg: Unexpected formatting in '
                      'line: \'%s\'', line)
        else:
            available.setdefault(group, []).append(pkg)

    # now get what's installed

    cmd = ['pacman', '-Qg']
    out = __salt__['cmd.run'](cmd, output_loglevel='trace', python_shell=False)
    installed = {}
    for line in salt.utils.itertools.split(out, '\n'):
        if not line:
            continue
        try:
            group, pkg = line.split()[0:2]
        except ValueError:
            log.error('Problem parsing pacman -Qg: Unexpected formatting in '
                      'line: \'%s\'', line)
        else:
            installed.setdefault(group, []).append(pkg)

    # move installed and partially-installed items from available to appropriate other places

    for group in installed:
        if group not in available:
            log.error(
                'Pacman reports group %s installed, but it is not in the '
                'available list (%s)!', group, available
            )
            continue
        if len(installed[group]) == len(available[group]):
            ret['installed'].append(group)
        else:
            ret['partially_installed'].append(group)
        available.pop(group)

    ret['installed'].sort()
    ret['partially_installed'].sort()

    # Now installed and partially installed are set, whatever is left is the available list.
    # In Python 3, .keys() returns an iterable view instead of a list. sort() cannot be
    # called on views. Use sorted() instead. Plus it's just as efficient as sort().
    ret['available'] = sorted(available.keys())

    return ret
1114650
def getitem(self, index, context=None):
        
        return _container_getitem(self, self.elts, index, context=context)
418363
def get_group_dict(user=None, include_default=True):
    '''
    
    '''
    if HAS_GRP is False or HAS_PWD is False:
        return {}
    group_dict = {}
    group_names = get_group_list(user, include_default=include_default)
    for group in group_names:
        group_dict.update({group: grp.getgrnam(group).gr_gid})
    return group_dict
1096301
private Collection<DockerImage> filterDockerImagesToScan(Collection<DockerImage> dockerImages, String[] dockerImageIncludes, String[] dockerImageExcludes) {
        logger.info("Filtering docker images list by includes and excludes lists");
        Collection<DockerImage> dockerImagesToScan = new LinkedList<>();
        Collection<String> imageIncludesList = Arrays.asList(dockerImageIncludes);
        Collection<String> imageExcludesList = Arrays.asList(dockerImageExcludes);
        for (DockerImage dockerImage : dockerImages) {
            String dockerImageString = dockerImage.getRepository() + Constants.WHITESPACE + dockerImage.getTag() + Constants.WHITESPACE + dockerImage.getId();
            // add images to scan according to dockerIncludes pattern
            if (isMatchingPattern(dockerImageString, imageIncludesList)) {
                dockerImagesToScan.add(dockerImage);
            }
            // remove images from scan according to dockerExcludes pattern
            if (isMatchingPattern(dockerImageString, imageExcludesList)) {
                dockerImagesToScan.remove(dockerImage);
            }
        }
        return dockerImagesToScan;
    }
1008746
def extract_all(self, directory=".", members=None):
        
        if self.handle:
            self.handle.extractall(path=directory, members=members)
1304016
def get_containers(self):
        
        query = dict(portal_type="Container",
                     sort_on="sortable_title",
                     sort_order="ascending",
                     is_active=True)
        results = api.search(query, "bika_setup_catalog")
        return map(api.get_object, results)
691875
def VCIncludes(self):
        
        return [os.path.join(self.si.VCInstallDir, 'Include'),
                os.path.join(self.si.VCInstallDir, r'ATLMFC\Include')]
431848
def OSIncludes(self):
        
        include = os.path.join(self.si.WindowsSdkDir, 'include')

        if self.vc_ver <= 10.0:
            return [include, os.path.join(include, 'gl')]

        else:
            if self.vc_ver >= 14.0:
                sdkver = self._sdk_subdir
            else:
                sdkver = ''
            return [os.path.join(include, '%sshared' % sdkver),
                    os.path.join(include, '%sum' % sdkver),
                    os.path.join(include, '%swinrt' % sdkver)]
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))]
1259481
def getContainers(self):
        
        _containers = []
        for container in self.bika_setup.bika_containers.objectValues():
            containertype = container.getContainerType()
            if containertype and containertype.UID() == self.UID():
                _containers.append(container)
        return _containers
174797
def memberships(self, group, include=None):
        
        return self._get(self._build_url(self.endpoint.memberships(id=group, include=include)))
792297
def containers
      if @containers.nil? && !info[:containers].nil?
        @containers = []
        info[:containers].each do |uri|
          @containers.push(client.containers.get_from_uri(uri))
        end
      end
      @containers
    end