def convert_deps_to_pip(deps, project=None, r=True, include_index=False):
    '"Converts a Pipfile-formatted dependency to a pip-formatted one.'
    dependencies = []
    for dep in deps.keys():
        extra = (deps[dep] if isinstance(deps[dep], six.string_types) else '')
        version = ''
        index = ''
        if (is_star(deps[dep]) or (str(extra) == '{}')):
            extra = ''
        hash = ''
        if ('hash' in deps[dep]):
            hash = ' --hash={0}'.format(deps[dep]['hash'])
        if ('hashes' in deps[dep]):
            hash = '{0} '.format(''.join([' --hash={0} '.format(h) for h in deps[dep]['hashes']]))
        if ('extras' in deps[dep]):
            extra = '[{0}]'.format(','.join(deps[dep]['extras']))
        if ('version' in deps[dep]):
            if (not is_star(deps[dep]['version'])):
                version = deps[dep]['version']
        if ('markers' in deps[dep]):
            specs = '; {0}'.format(deps[dep]['markers'])
        else:
            specs = []
            for specifier in specifiers:
                if (specifier in deps[dep]):
                    if (not is_star(deps[dep][specifier])):
                        specs.append('{0} {1}'.format(specifier, deps[dep][specifier]))
            if specs:
                specs = '; {0}'.format(' and '.join(specs))
            else:
                specs = ''
        if (include_index and (not is_file(deps[dep])) and (not is_vcs(deps[dep]))):
            pip_src_args = []
            if ('index' in deps[dep]):
                pip_src_args = [project.get_source(deps[dep]['index'])]
            else:
                pip_src_args = project.sources
            pip_args = prepare_pip_source_args(pip_src_args)
            index = ' '.join(pip_args)
        maybe_vcs = [vcs for vcs in VCS_LIST if (vcs in deps[dep])]
        vcs = (maybe_vcs[0] if maybe_vcs else None)
        if ('file' in deps[dep]):
            extra = '{1}{0}'.format(extra, deps[dep]['file']).strip()
            if ('editable' in deps[dep]):
                dep = '-e '
            else:
                dep = ''
        elif ('path' in deps[dep]):
            extra = '{1}{0}'.format(extra, deps[dep]['path']).strip()
            if ('editable' in deps[dep]):
                dep = '-e '
            else:
                dep = ''
        if vcs:
            extra = '{0}+{1}'.format(vcs, deps[dep][vcs])
            if ('ref' in deps[dep]):
                extra += '@{0}'.format(deps[dep]['ref'])
            extra += '#egg={0}'.format(dep)
            if ('subdirectory' in deps[dep]):
                extra += '&subdirectory={0}'.format(deps[dep]['subdirectory'])
            if ('editable' in deps[dep]):
                dep = '-e '
            else:
                dep = ''
        s = '{0}{1}{2}{3}{4} {5}'.format(dep, extra, version, specs, hash, index).strip()
        dependencies.append(s)
    if (not r):
        return dependencies
    f = tempfile.NamedTemporaryFile(suffix='-requirements.txt', delete=False)
    f.write('\n'.join(dependencies).encode('utf-8'))
    f.close()
    return f.name
"Converts a Pipfile-formatted dependency to a pip-formatted one.
def convert_deps_to_pip(deps, project=None, r=True, include_index=False):
    
    dependencies = []
    for dep in deps.keys():
        extra = (deps[dep] if isinstance(deps[dep], six.string_types) else )
        version = 
        index = 
        if (is_star(deps[dep]) or (str(extra) == '{}')):
            extra = 
        hash = 
        if ('hash' in deps[dep]):
            hash = ' --hash={0}'.format(deps[dep]['hash'])
        if ('hashes' in deps[dep]):
            hash = '{0} '.format(.join([' --hash={0} '.format(h) for h in deps[dep]['hashes']]))
        if ('extras' in deps[dep]):
            extra = '[{0}]'.format(','.join(deps[dep]['extras']))
        if ('version' in deps[dep]):
            if (not is_star(deps[dep]['version'])):
                version = deps[dep]['version']
        if ('markers' in deps[dep]):
            specs = '; {0}'.format(deps[dep]['markers'])
        else:
            specs = []
            for specifier in specifiers:
                if (specifier in deps[dep]):
                    if (not is_star(deps[dep][specifier])):
                        specs.append('{0} {1}'.format(specifier, deps[dep][specifier]))
            if specs:
                specs = '; {0}'.format(' and '.join(specs))
            else:
                specs = 
        if (include_index and (not is_file(deps[dep])) and (not is_vcs(deps[dep]))):
            pip_src_args = []
            if ('index' in deps[dep]):
                pip_src_args = [project.get_source(deps[dep]['index'])]
            else:
                pip_src_args = project.sources
            pip_args = prepare_pip_source_args(pip_src_args)
            index = ' '.join(pip_args)
        maybe_vcs = [vcs for vcs in VCS_LIST if (vcs in deps[dep])]
        vcs = (maybe_vcs[0] if maybe_vcs else None)
        if ('file' in deps[dep]):
            extra = '{1}{0}'.format(extra, deps[dep]['file']).strip()
            if ('editable' in deps[dep]):
                dep = '-e '
            else:
                dep = 
        elif ('path' in deps[dep]):
            extra = '{1}{0}'.format(extra, deps[dep]['path']).strip()
            if ('editable' in deps[dep]):
                dep = '-e '
            else:
                dep = 
        if vcs:
            extra = '{0}+{1}'.format(vcs, deps[dep][vcs])
            if ('ref' in deps[dep]):
                extra += '@{0}'.format(deps[dep]['ref'])
            extra += '#egg={0}'.format(dep)
            if ('subdirectory' in deps[dep]):
                extra += '&subdirectory={0}'.format(deps[dep]['subdirectory'])
            if ('editable' in deps[dep]):
                dep = '-e '
            else:
                dep = 
        s = '{0}{1}{2}{3}{4} {5}'.format(dep, extra, version, specs, hash, index).strip()
        dependencies.append(s)
    if (not r):
        return dependencies
    f = tempfile.NamedTemporaryFile(suffix='-requirements.txt', delete=False)
    f.write('\n'.join(dependencies).encode('utf-8'))
    f.close()
    return f.name