Return a list of unique valid options for a list of image processors
    (and/or source generators)
359778
def valid_processor_options(processors=None):
    
    if processors is None:
        processors = [
            dynamic_import(p) for p in
            tuple(settings.THUMBNAIL_PROCESSORS) +
            tuple(settings.THUMBNAIL_SOURCE_GENERATORS)]
    valid_options = set(['size', 'quality', 'subsampling'])
    for processor in processors:
        args = inspect.getfullargspec(processor)[0] if six.PY3 else inspect.getargspec(processor)[0]
        # Add all arguments apart from the first (the source image).
        valid_options.update(args[1:])
    return list(valid_options)
191178
def get_jvm_options(self):
    
    ret = []
    for opt in self.get_options().options:
      ret.extend(safe_shlex_split(opt))

    if (self.get_options().debug or
        self.get_options().is_flagged('debug_port') or
        self.get_options().is_flagged('debug_args')):
      debug_port = self.get_options().debug_port
      ret.extend(arg.format(debug_port=debug_port) for arg in self.get_options().debug_args)
    return ret
1289231
def images(self):
        """"""
        for ds_id, projectable in self.datasets.items():
            if ds_id in self.wishlist:
                yield projectable.to_image()
1338961
def avail_images(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_images function must be called with '
            '-f or --function, or with the --list-images option.'
        )

    templates = {}
    vm_properties = [
        "name",
        "config.template",
        "config.guestFullName",
        "config.hardware.numCPU",
        "config.hardware.memoryMB"
    ]

    vm_list = salt.utils.vmware.get_mors_with_properties(_get_si(), vim.VirtualMachine, vm_properties)

    for vm in vm_list:
        if "config.template" in vm and vm["config.template"]:
            templates[vm["name"]] = {
                'name': vm["name"],
                'guest_fullname': vm["config.guestFullName"] if "config.guestFullName" in vm else "N/A",
                'cpus': vm["config.hardware.numCPU"] if "config.hardware.numCPU" in vm else "N/A",
                'ram': vm["config.hardware.memoryMB"] if "config.hardware.memoryMB" in vm else "N/A"
            }

    return templates
1090351
def dependent_images(self):
        
        found = []
        for command in self.commands:
            dep = command.dependent_image
            if dep:
                if dep not in found:
                    yield dep
                    found.append(dep)
140137
def get_cuda_visible_devices():
    
    gpu_ids_str = os.environ.get("CUDA_VISIBLE_DEVICES", None)

    if gpu_ids_str is None:
        return None

    if gpu_ids_str == "":
        return []

    return [int(i) for i in gpu_ids_str.split(",")]
343882
def find_all_valid_cards(provider: Provider, deck: Deck) -> Generator:
    ''''''

    # validate_card_issue_modes must recieve a full list of cards, not batches
    unfiltered = (card for batch in get_card_bundles(provider, deck) for card in batch)

    for card in validate_card_issue_modes(deck.issue_mode, list(unfiltered)):
        yield card
1227187
def get_sources(src_dir='src', ending='.cpp'):
    """"""
    return [os.path.join(src_dir, fnm) for fnm in os.listdir(src_dir) if fnm.endswith(ending)]
930291
def list(self, sort=False):
        
        prs = self._processors.values()
        if sort:
            return sorted(prs, key=operator.methodcaller("cid"))

        return prs
533356
def get_variants(self, arch=None, types=None, recursive=False):
        
        types = types or []
        result = []

        if "self" in types:
            result.append(self)

        for variant in six.itervalues(self.variants):
            if types and variant.type not in types:
                continue
            if arch and arch not in variant.arches.union(["src"]):
                continue
            result.append(variant)
            if recursive:
                result.extend(variant.get_variants(types=[i for i in types if i != "self"], recursive=True))

        result.sort(key=lambda x: x.uid)
        return result
1237893
def image_sets(self):
        
        images = self._original_images()
        for image in images:
            yield ImageSubset(self, **image.identity_map)
669816
def available_options(self):
        
        for option in list(self.cmd.options.values()):
            if (option.is_multiple or
                    option not in list(self.used_options)):
                yield option
1264304
def _get_choices(self, gandi):
        
        iso_codes = []
        dc_codes = []
        for item in gandi.datacenter.list():
            iso_codes.append(item['iso'])
            if item.get('dc_code'):
                dc_codes.append(item['dc_code'])
        return dc_codes + iso_codes
1100516
def get_options(self, thumbnail_options, **kwargs):
        
        if isinstance(thumbnail_options, ThumbnailOptions):
            return thumbnail_options
        args = []
        if thumbnail_options is not None:
            args.append(thumbnail_options)
        opts = ThumbnailOptions(*args, **kwargs)
        if 'quality' not in thumbnail_options:
            opts['quality'] = self.thumbnail_quality
        return opts
912014
def get(self):
        
        return {k:v for k,v in list(self.options.items()) if k in self._allowed_axes}
1369272
def viable_source_types_for_generator (generator):
    
    assert isinstance(generator, Generator)
    if generator not in __viable_source_types_cache:
        __vstg_cached_generators.append(generator)
        __viable_source_types_cache[generator] = viable_source_types_for_generator_real (generator)

    return __viable_source_types_cache[generator]
978933
def get_uniques(l):
    
    result = []

    for i in l:
        if i not in result:
            result.append(i)

    return result