def setup_install(repo=DEFAULT_REPO, branch=DEFAULT_BRANCH, install_path=None, as_user=False, zippath=None, dryrun=False, verbose=False):
    """
    Download and install StaSh using setup.py
    :param repo: name of user owning the github repo to download/install from
    :type repo: str
    :param branch: branch to download/install
    :type repo: str
    :param install_path: path to install to (as --prefix)
    :type install_path: str
    :param as_user: install into user packages
    :type as_user: bool
    :param zippath: alternative path to zip to install from (default: download from repo:branch)
    :param dryrun: if True, pass --dry-run to setup.py
    :param verbose: if True, print additional information
    :type verbose: bool
    """
    if zippath is None:
        zp = TEMP_ZIPFILE
        # download StaSh
        try:
            download_stash(repo=repo, branch=branch, outpath=zp, verbose=verbose)
        except:
            raise DownloadError("Unable to download StaSh from {}:{}".format(repo, branch))
    else:
        zp = zippath
    tp = os.path.join(TMPDIR, "getstash-{}".format(time.time()))
    unzip_into(zp, tp, verbose=verbose)
    # run setup.py
    os.chdir(tp)
    argv = ["setup.py", "install"]
    if as_user:
        argv.append("--user")
    if install_path is not None:
        argv += ["--prefix", install_path]
    if dryrun:
        argv.append("--dry-run")
    sys.argv = argv
    fp = os.path.abspath("setup.py")
    ns = {
        "__name__": "__main__",
        "__file__": fp,
    }
    with open(fp, "rU") as fin:
        content = fin.read()
        code = compile(content, fp, "exec", dont_inherit=True)
        exec(code, ns, ns)

    Download and install StaSh using setup.py
    :param repo: name of user owning the github repo to download/install from
    :type repo: str
    :param branch: branch to download/install
    :type repo: str
    :param install_path: path to install to (as --prefix)
    :type install_path: str
    :param as_user: install into user packages
    :type as_user: bool
    :param zippath: alternative path to zip to install from (default: download from repo:branch)
    :param dryrun: if True, pass --dry-run to setup.py
    :param verbose: if True, print additional information
    :type verbose: bool
    
getstash.py