def install_packages(env, to_install=None, packages=None):
    config_file = get_config_file(env, "packages-homebrew.yaml")
    if to_install:
        (packages, _) = _yaml_to_packages(config_file.base, to_install, config_file.dist)
    # if we have no packages to install, do not try to install or update brew
    if len(packages) == 0:
        _remove_old(env, config_file.base)
        return
    system.install_homebrew(env)
    brew_cmd = _brew_cmd(env)
    formula_repos = ["homebrew/science", "chapmanb/cbl", "homebrew/dupes"]
    current_taps = set([x.strip() for x in env.safe_run_output("%s tap" % brew_cmd).split()])
    _safe_update(env, brew_cmd, formula_repos, current_taps)
    current_taps = set([x.strip() for x in env.safe_run_output("%s tap" % brew_cmd).split()])
    for repo in formula_repos:
        if repo not in current_taps:
            env.safe_run("%s tap %s" % (brew_cmd, repo))
    env.safe_run("%s tap --repair" % brew_cmd)
    ipkgs = {"outdated": set([x.strip() for x in env.safe_run_output("%s outdated" % brew_cmd).split()]),
             "current": _get_current_pkgs(env, brew_cmd)}
    _install_brew_baseline(env, brew_cmd, ipkgs, packages)
    ipkgs = {"outdated": set([x.strip() for x in env.safe_run_output("%s outdated" % brew_cmd).split()]),
             "current": _get_current_pkgs(env, brew_cmd)}
    for pkg_str in packages:
        _install_pkg(env, pkg_str, brew_cmd, ipkgs)
    for pkg_str in ["pkg-config", "openssl", "cmake", "unzip"]:
        _safe_unlink_pkg(env, pkg_str, brew_cmd)
    with open(config_file.base) as in_handle:
        to_remove = yaml.load(in_handle).get("to_remove", [])
    for pkg_str in ["curl"] + to_remove:
        _safe_uninstall_pkg(env, pkg_str, brew_cmd)
Several kinds of elemwise expressions with dimension permutations
dataset/ETHPy150Open chapmanb/cloudbiolinux/cloudbio/package/brew.py/install_packages--crossover with--dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/sandbox/cuda/tests/test_basic_ops.py/test_elemwise2