Takes the container dir and the product name and returns the list of features.
    :param container_dir: path of the container dir
    :param product_name: name of the product
    :return: list of strings, each representing one feature
162956
def get_features_from_equation(container_dir, product_name):
    
    import featuremonkey
    file_path = os.path.join(container_dir, 'products', product_name, 'product.equation')
    return featuremonkey.get_features_from_equation_file(file_path)
954624
def _ensure_product_string(cls, product):
        

        if isinstance(product, str):
            return product

        if isinstance(product, list):
            return os.path.join(*product)

        raise DataError("Unknown object (not str or list) specified as a component product", product=product)
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)
139833
def get_markdown_files(self, dir_):
        
        md_files = OrderedSet()
        for root, _, files in os.walk(dir_):
            for name in files:
                split = os.path.splitext(name)
                if len(split) == 1:
                    continue
                if split[1] in ('.markdown', '.md', '.yaml'):
                    md_files.add(os.path.join(root, name))
        return md_files
630617
def get_container_containers(self, path):
        
        container = self.get_container(path)
        containers = {}
        for name,value in container._values.items():
            if isinstance(value, ValueTree):
                containers[name] = value
        return containers
789566
private Map<String, ProvisioningFeatureDefinition> getCoreProductFeatureDefinitions() {
        Map<String, ProvisioningFeatureDefinition> features = new TreeMap<String, ProvisioningFeatureDefinition>();
        File featureDir = getCoreFeatureDir();
        //the feature directory may not exist if the packaged server had no features installed when minified
        if (!featureDir.isDirectory() && !featureDir.mkdir()) {
            throw new FeatureToolException("Unable to find or create feature directory: " + featureDir,
                                           MessageFormat.format(NLS.messages.getString("tool.feature.dir.not.found"), featureDir),
                                           null,
                                           ReturnCode.MISSING_CONTENT);
        }
        File platformDir = getCorePlatformDir();
        File[] manifestFiles = featureDir.listFiles(MFFilter);

        if (manifestFiles != null) {
            for (File file : manifestFiles) {
                try {
                    ProvisioningFeatureDefinition fd = new SubsystemFeatureDefinitionImpl(ExtensionConstants.CORE_EXTENSION, file);
                    if (fd.isSupportedFeatureVersion()) {
                        // using symbolic name because gets compared to FeatureResource symbolic name
                        features.put(fd.getSymbolicName(), fd);
                    }
                } catch (IOException e) {
                    // TODO: PROPER NLS MESSAGE
                    throw new FeatureToolException("Unable to read core feature manifest: " + file,
                                                   (String) null,
                                                   e,
                                                   ReturnCode.BAD_FEATURE_DEFINITION);
                }
            }
        }
        manifestFiles = platformDir.listFiles(MFFilter);

        if (manifestFiles != null) {
            for (File file : manifestFiles) {
                try {
                    ProvisioningFeatureDefinition fd = new KernelFeatureListDefinition(file);
                    // using symbolic name because gets compared to FeatureResource symbolic name
                    features.put(fd.getSymbolicName(), fd);
                } catch (IOException e) {
                    // TODO: PROPER NLS MESSAGE
                    throw new FeatureToolException("Unable to read core manifest: " + file,
                                                   (String) null,
                                                   e,
                                                   ReturnCode.BAD_FEATURE_DEFINITION);
                }
            }
        }
        return features;
    }
1084184
def dirs(self, *args, **kwargs):
        
        return [p for p in self.listdir(*args, **kwargs) if p.isdir()]
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
196598
def containers(self):
        
        return [
            self.client.containers.get(cid) for cid in
            (self.attrs.get('Containers') or {}).keys()
        ]
421491
def list_dirs(directory):
    
    return [f for f in pathlib.Path(directory).iterdir() if f.is_dir()]
576879
def _get_dir_list(load):
    '''
    
    '''
    if 'env' in load:
        # "env" is not supported; Use "saltenv".
        load.pop('env')

    if 'saltenv' not in load or load['saltenv'] not in envs():
        return []
    ret = set()
    for repo in init():
        repo['repo'].open()
        ref = _get_ref(repo, load['saltenv'])
        if ref:
            manifest = repo['repo'].manifest(rev=ref[1])
            for tup in manifest:
                filepath = tup[4]
                split = filepath.rsplit('/', 1)
                while len(split) > 1:
                    relpath = os.path.relpath(split[0], repo['root'])
                    # Don't add '.'
                    if relpath != '.':
                        # Don't add files outside the hgfs_root
                        if not relpath.startswith('../'):
                            ret.add(os.path.join(repo['mountpoint'], relpath))
                    split = split[0].rsplit('/', 1)
        repo['repo'].close()
    if repo['mountpoint']:
        ret.add(repo['mountpoint'])
    return sorted(ret)
16239
def create_data_dir():
    
    from django_productline.context import PRODUCT_CONTEXT
    if not os.path.exists(PRODUCT_CONTEXT.DATA_DIR):
        os.mkdir(PRODUCT_CONTEXT.DATA_DIR)
        print('*** Created DATA_DIR in %s' % PRODUCT_CONTEXT.DATA_DIR)
    else:
        print('...DATA_DIR already exists.')
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);
    });

  }
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
986845
def get_image_list(self, name, dir_structure='original'):
        
        assert name in ['train', 'val', 'test']
        assert dir_structure in ['original', 'train']
        add_label_to_fname = (name != 'train' and dir_structure != 'original')
        if add_label_to_fname:
            synset = self.get_synset_1000()

        fname = os.path.join(self.dir, name + '.txt')
        assert os.path.isfile(fname), fname
        with open(fname) as f:
            ret = []
            for line in f.readlines():
                name, cls = line.strip().split()
                cls = int(cls)

                if add_label_to_fname:
                    name = os.path.join(synset[cls], name)

                ret.append((name.strip(), cls))
        assert len(ret), fname
        return ret
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))]
653872
def _get_products(self):
        
        '''  '''
    
    # request product list
        products_request = self.account_products()
        if products_request['error']:
            raise Exception(products_request['error'])

    # construct list of product ids
        product_ids = []
        for product in products_request["json"]["entries"]:
            product_ids.append(product['productId'])
    
    # construct default product map
        self.products = {}
    
    # request product details
        for id in product_ids:
            product_request = self.account_product(id)
            if product_request['error']:
                raise Exception(product_request['error'])
            self.products[id] = product_request['json']

        return self.products