Return a bundle of the requested assets and their dependencies.
183923
def require(self, *namespecs):
        """"""
        blacklist = set([n[1:] for n in namespecs if n.startswith('!')])
        not_blacklist = [n for n in namespecs if not n.startswith('!')]
        return Bundle(*[bundle for name, version, bundle
            in self._require_recursive(*not_blacklist) if name not in blacklist])
118267
def dependencies(self) -> List[Dependency]:
        """"""
        dependencies_str = DB.get_hash_value(self.key, 'dependencies')
        dependencies = []
        for dependency in ast.literal_eval(dependencies_str):
            dependencies.append(Dependency(dependency))
        return dependencies
823561
public function getAssets()
    {
        //this is the app directory.
        //the console is in this directory
        $rootDir = $this->container->get('kernel')->getRootDir();
        $appOverrideDir = '/Resources';

        $resources = [];
        $finder = new Finder();
        $finder->files()->name('assetic_injector.json');
        foreach ($this->container->get('kernel')->getBundles() as $bundle) {
            //the number of files found in the override path
            $finderCount = 0;
            //the bundle name
            $bundleName = $bundle->getName();

            //the override path
            $overridePath = $rootDir.$appOverrideDir.'/'.$bundleName.'/config/';

            //does the file exists in the app/Resources
            if (file_exists($overridePath)) {
                $finder->in($overridePath);
                $finderCount = $finder->count();
            }

            //if no files were found
            if ($finderCount === 0) {
                if (file_exists($bundle->getPath().'/Resources/config/')) {
                    $finder->in($bundle->getPath().'/Resources/config/');
                }
            }
        }
        $injectArray = [];
        foreach ($finder as $file) {
            $json = file_get_contents($file);
            if (is_array(json_decode($json, true))) {
                $injectArray = array_merge_recursive($injectArray, json_decode($json, true));
            }
        }

        foreach ($injectArray as $engine => $assets) {
            $engine = $this->container->get('assetic_injector.'.$engine);
            $engine->compute($assets);
            $resources = array_merge_recursive($resources, $engine->getResources());
        }

        return $resources;
    }
593909
def evaluate_dependencies(asset_paths)
      return dependencies if config.evaluate_node_modules

      dependencies.select do |path|
        path.start_with?(*asset_paths)
      end
    end
880811
def _get_packages():
    # type: () -> List[Package]
    
    return [Package(pkg_obj=pkg) for pkg in sorted(pkg_resources.working_set,
                                                   key=lambda x: str(x).lower())]
982916
def get_dependencies(self, filename):
        
        if self.is_partial(filename):
            return self.templates
        elif self.is_template(filename):
            return [self.get_template(filename)]
        elif self.is_static(filename):
            return [filename]
        else:
            return []
48580
protected function getAssets(Composer $composer, $assetDir, array $packages)
    {
        $installationManager = $composer->getInstallationManager();
        $configPackages = $this->config->getArray('enable-packages');
        $assets = array();

        foreach ($packages as $package) {
            $filename = AssetUtil::getPath($installationManager, $this->assetManager, $package, $configPackages);

            if (null !== $filename) {
                list($packageName, $packagePath) = $this->getMockPackagePath($package, $assetDir, $filename);
                $assets[$packageName] = $packagePath;
            }
        }

        $assetsEvent = new GetAssetsEvent($assetDir, $packages, $assets);
        $composer->getEventDispatcher()->dispatch(FoxyEvents::GET_ASSETS, $assetsEvent);

        return $assetsEvent->getAssets();
    }
261467
function getDependencies(platform, bundleEntry) {
    return packagerServer.getDependencies({
      platform: platform,
      dev: true,
      hot: true,
      entryFile: bundleEntry,
    }).then(response => {
      const {getModuleId} = response;

      // for each dependency builds the object:
      // `{path: '/a/b/c.js', deps: ['modA', 'modB', ...]}`
      return Promise.all(Object.values(response.dependencies).map(dep => {
        return dep.getName().then(depName => {
          if (dep.isAsset() || dep.isAsset_DEPRECATED() || dep.isJSON()) {
            return Promise.resolve({path: dep.path, deps: []});
          }
          return packagerServer.getShallowDependencies({
            platform: platform,
            dev: true,
            hot: true,
            entryFile: dep.path
          })
            .then(deps => {
              return {
                path: dep.path,
                name: depName,
                deps,
              };
            });
        });
      }))
      .then(deps => {
        // list with all the dependencies' filenames the bundle entry has
        const dependenciesCache = response.dependencies.map(dep => dep.path);

        // map from module name to path
        const moduleToFilenameCache = Object.create(null);
        deps.forEach(dep => {
          moduleToFilenameCache[dep.name] = dep.path;
        });

        // map that indicates the shallow dependency each file included on the
        // bundle has
        const shallowDependencies = Object.create(null);
        deps.forEach(dep => {
          shallowDependencies[dep.path] = dep.deps;
        });

        // map from module name to the modules' dependencies the bundle entry
        // has
        const dependenciesModulesCache = Object.create(null);
        response.dependencies.forEach(dep => {
          dependenciesModulesCache[getModuleId(dep)] = dep;
        });


        const inverseDependenciesCache = Object.create(null);
        const inverseDependencies = getInverseDependencies(response);
        for (const [module, dependents] of inverseDependencies) {
          inverseDependenciesCache[getModuleId(module)] =
            Array.from(dependents).map(getModuleId);
        }

        return {
          dependenciesCache,
          dependenciesModulesCache,
          shallowDependencies,
          inverseDependenciesCache,
          resolutionResponse: response,
        };
      });
    });
  }
182761
private ResourceBundle getBundle() {
        String bundleKey = getBundleKey();
        if (bundles.containsKey(bundleKey)) {
            return bundles.get(bundleKey);
        } else {
            ResourceBundle bundle = loadBundle();
            bundles.put(bundleKey, bundle);
            return bundle;
        }
    }
779118
function mapDependencies(dependencies) {
  var deps;

  deps = (dependencies) ? Object.keys(dependencies) : [];

  return deps.map(function(name) {
    return {
      name: name,
      version: dependencies[name]
    };
  });
}
458228
public PackageAssets getAssets(String packageName, boolean withVcsInfo) throws ServiceException {
        try {
            PackageDir pkgDir = getPackageDir(packageName);
            if (pkgDir == null) {
                pkgDir = getGhostPackage(packageName);
                if (pkgDir == null)
                    throw new DataAccessException("Missing package metadata directory: " + packageName);
            }
            List<AssetInfo> assets = new ArrayList<>();
            if (!DiffType.MISSING.equals(pkgDir.getVcsDiffType())) {
                for (File file : pkgDir.listFiles()) {
                    if (file.isFile()) {
                        AssetFile assetFile = pkgDir.getAssetFile(file);
                        if (!MdwIgnore.isIgnore(assetFile))
                            assets.add(new AssetInfo(assetFile));
                    }
                }
            }

            PackageAssets pkgAssets = new PackageAssets(pkgDir);
            pkgAssets.setAssets(assets);

            if (withVcsInfo) {
                CodeTimer timer = new CodeTimer("AssetServices", true);
                addVersionControlInfo(pkgAssets);
                pkgAssets.sort();
                timer.stopAndLogTiming("addVersionControlInfo(PackageAssets)");
            }

            return pkgAssets;
        }
        catch (Exception ex) {
            throw new ServiceException(ex.getMessage(), ex);
        }
    }
140934
def bundles():
    """"""
    per_page = int(request.args.get('per_page', 30))
    page = int(request.args.get('page', 1))
    query = store.bundles()

    query_page = query.paginate(page, per_page=per_page)
    data = []
    for bundle_obj in query_page.items:
        bundle_data = bundle_obj.to_dict()
        bundle_data['versions'] = [version.to_dict() for version in bundle_obj.versions]
        data.append(bundle_data)

    return jsonify(bundles=data)
1233372
function svgs(req, res) {
  const bundle = new Bundle(
    req.url.slice(1, -5).split('-').map(function map(name) {
      return assets[name];
    })
  );

  bundle.run(function (err, output) {
    if (err) throw err;

    res.setHeader('Content-Length', Buffer(output).length);
    res.writeHead(200, { 'Content-Type': 'text/plain' });

    res.end(output);
  });
}
1250784
private JoinableResourceBundle getBundleFromName(String name, List<JoinableResourceBundle> bundles) {

		JoinableResourceBundle bundle = null;
		for (JoinableResourceBundle aBundle : bundles) {
			if (aBundle.getName().equals(name)) {
				bundle = aBundle;
				break;
			}
		}

		return bundle;
	}
1083107
public Set<Dependency> asSet(boolean withChildren) {
        if (withChildren) {
            Set<Dependency> dependencySet = new HashSet<>();
            List<Dependency> dependencyList = asList(false);

            dependencySet.addAll(dependencyList);
            for (Dependency dependency : dependencyList) {
                if (dependency.isInternal()) {
                    dependencySet.addAll(dependency.getDependencies().asSet());
                }
            }

            return dependencySet;
        } else {
            return new HashSet<>(list);
        }
    }
1335250
def get():
    """"""
    pkgnames = find_packages()

    if len(pkgnames) == 0:
        raise ValueError("Can't find any packages")

    pkgname = pkgnames[0]

    content = open(join(pkgname, '__init__.py')).read()
    c = re.compile(r"__version__ *= *('[^']+'|\"[^\"]+\")")
    m = c.search(content)

    if m is None:
        raise ValueError("Can't find __version__ = ... in __init__.py")

    return m.groups()[0][1: -1]
544191
def load(uri)
      asset = environment.load(uri)
      @dependencies.merge(asset.metadata[:dependencies])
      asset
    end