def prepare_pip_source_args(sources, pip_args=None):
    if (pip_args is None):
        pip_args = []
    if sources:
        pip_args.extend(['-i', sources[0]['url']])
        if (not sources[0].get('verify_ssl', True)):
            pip_args.extend(['--trusted-host', urlparse(sources[0]['url']).netloc.split(':')[0]])
        if (len(sources) > 1):
            for source in sources[1:]:
                pip_args.extend(['--extra-index-url', source['url']])
                if (not source.get('verify_ssl', True)):
                    pip_args.extend(['--trusted-host', urlparse(source['url']).hostname])
    return pip_args
def prepare_pip_source_args(sources, pip_args=None):
    if (pip_args is None):
        pip_args = []
    if sources:
        pip_args.extend(['-i', sources[0]['url']])
        if (not sources[0].get('verify_ssl', True)):
            pip_args.extend(['--trusted-host', urlparse(sources[0]['url']).netloc.split(':')[0]])
        if (len(sources) > 1):
            for source in sources[1:]:
                pip_args.extend(['--extra-index-url', source['url']])
                if (not source.get('verify_ssl', True)):
                    pip_args.extend(['--trusted-host', urlparse(source['url']).hostname])
    return pip_args