Muennighoff/xP3x-sample huggingface dataset:
inputs: Complete the below
def default_payment_handler(request, order_form, order):

    ''''Default payment handler - called when the final step of the
    checkout process with payment information is submitted. Implement
    your own and specify the path to import it from via the setting
    ``SHOP_HANDLER_PAYMENT``. This function will typically contain
    integration with a payment gateway. Raise
    cartridge.shop.checkout.CheckoutError("error message") if payment
    is unsuccessful.'
    '''
targets: pass
inputs: def headers_to_dict(header_lines):
targets: """Convert the list of header lines into a dictionary
    """
    headers = {}
    headers_list = [x for line in header_lines for x in line.split(':    ', 1)]
    headers_dict = dict(zip(headers_list[0::2], headers_list[1::2]))
    for header in headers_dict:
        headers[header.lower()] = headers_dict[header]
    return headers
inputs: def _round(a):
targets: """Always round up.
    ``np.round`` cannot be used here, because it rounds .5 to the nearest
    even number.
    """
    return int(np.floor((a + 0.5)))
inputs: I wrote the below code

    page_html = ((Path(ctx.config.sphinx.destdir) / 'html') / 'index.html')
    if (not page_html.exists()):
        build(ctx, builder='html')
    assert page_html.exists()
    open_cmd = 'open'
    if sys.platform.startswith('win'):
        open_cmd = 'start'
    ctx.run('{open}    {page_html}'.format(open=open_cmd, page_html=page_html))


What's a good function header?
targets: @task
def browse(ctx):
inputs: I wrote the below code

    if (r.representation == 'html'):
        rheader_tabs = s3_rheader_tabs(r, tabs)
        assess = r.record
        if assess:
            table = db.assess_assess
            rheader = DIV(TABLE(TR(TH(('%s:    ' % T('Date    &    Time'))), table.datetime.represent(assess.datetime), TH(('%s:    ' % T('Location'))), table.location_id.represent(assess.location_id), TH(('%s:    ' % T('Assessor'))), table.assessor_person_id.represent(assess.assessor_person_id))), rheader_tabs)
            return rheader
    return None


What's a good function header?
targets: def assess_rheader(r, tabs=[]):
inputs: Complete the below
def is_ethernet_port(interface):

    ''''Judge whether it is ethernet port'
    '''
targets: ethernet_port = ['ge', '10ge', '25ge', '4x10ge', '40ge', '100ge', 'meth']
    if_type = get_interface_type(interface)
    if (if_type in ethernet_port):
        return True
    return False
inputs: I wrote the below code

    node = MockNode(manufacturer_id='0086', product_id='0062', command_classes=[const.COMMAND_CLASS_SWITCH_COLOR])
    value = MockValue(data=0, node=node)
    color = MockValue(data='#0000000000', node=node)
    color_channels = MockValue(data=31, node=node)
    values = MockLightValues(primary=value, color=color, color_channels=color_channels)
    device = zwave.get_device(node=node, values=values, node_config={})
    assert (device.color_temp == zwave.TEMP_MID_HASS)
    color.data = '#000000ff00'
    value_changed(color)
    assert (device.color_temp == zwave.TEMP_WARM_HASS)
    color.data = '#00000000ff'
    value_changed(color)
    assert (device.color_temp == zwave.TEMP_COLD_HASS)


What's a good function header?
targets: def test_ct_value_changed(mock_openzwave):
inputs: Complete the below
def __virtual__():

    ''''Only load if boto libraries exist and if boto libraries are greater than
    a given version.'
    '''
targets: if (not HAS_BOTO3):
        return (False, 'The    boto3_elasticache    module    could    not    be    loaded:    boto3    libraries    not    found')
    return True
inputs: Complete the below
def items_for_result(cl, result, form):

    ''''Generates the actual list of data.'
    '''
targets: first = True
    pk = cl.lookup_opts.pk.attname
    for field_name in cl.list_display:
        row_class = ''
        try:
            (f, attr, value) = lookup_field(field_name, result, cl.model_admin)
        except (AttributeError, ObjectDoesNotExist):
            result_repr = EMPTY_CHANGELIST_VALUE
        else:
            if (f is None):
                if (field_name == u'action_checkbox'):
                    row_class = '    class="action-checkbox"'
                allow_tags = getattr(attr, 'allow_tags', False)
                boolean = getattr(attr, 'boolean', False)
                if boolean:
                    allow_tags = True
                    result_repr = _boolean_icon(value)
                else:
                    result_repr = smart_unicode(value)
                if (not allow_tags):
                    result_repr = escape(result_repr)
                else:
                    result_repr = mark_safe(result_repr)
            else:
                if isinstance(f.rel, models.ManyToOneRel):
                    field_val = getattr(result, f.name)
                    if (field_val is None):
                        result_repr = EMPTY_CHANGELIST_VALUE
                    else:
                        result_repr = escape(field_val)
                else:
                    result_repr = display_for_field(value, f)
                if (isinstance(f, models.DateField) or isinstance(f, models.TimeField) or isinstance(f, models.ForeignKey)):
                    row_class = '    class="nowrap"'
        if (force_unicode(result_repr) == ''):
            result_repr = mark_safe('&nbsp;')
        if ((first and (not cl.list_display_links)) or (field_name in cl.list_display_links)):
            table_tag = {True: 'th', False: 'td'}[first]
            first = False
            url = cl.url_for_result(result)
            if cl.to_field:
                attr = str(cl.to_field)
            else:
                attr = pk
            value = result.serializable_value(attr)
            result_id =...
inputs: I wrote the below code

    negated = {(- s)}
    return [(clause - negated) for clause in clauses if (s not in clause)]


What's a good function header?
targets: def unit_propagate_int_repr(clauses, s):
inputs: Complete the below
def get_tiles_height_width(n_tiles, desired_width=None):

    ''''Get a height x width size that will fit n_tiles tiles.'
    '''
targets: if (desired_width == None):
        width = int(np.ceil(np.sqrt(n_tiles)))
        height = width
    else:
        assert isinstance(desired_width, int)
        width = desired_width
        height = int(np.ceil((float(n_tiles) / width)))
    return (height, width)
inputs: def is_rfc1918_ip(ip):
targets: """Checks if the given ip address is a rfc1918 one.
    @param ip: The ip address to test
    @type ip: a string "x.x.x.x"
    @return: True if it\s a LAN address, False otherwise
    """
    if isinstance(ip, basestring):
        ip = _ip_to_number(ip)
    for (net, mask) in _nets:
        if ((ip & mask) == net):
            return True
    return False
inputs: def in6_addrtovendor(addr):
targets: """Extract the MAC address from a modified EUI-64 constructed IPv6
    address provided and use the IANA oui.txt file to get the vendor.
    The database used for the conversion is the one loaded by Scapy,
    based on Wireshark (/usr/share/wireshark/wireshark/manuf)  None
    is returned on error, "UNKNOWN" if the vendor is unknown.
    """
    mac = in6_addrtomac(addr)
    if (mac is None):
        return None
    res = conf.manufdb._get_manuf(mac)
    if ((len(res) == 17) and (res.count(':') != 5)):
        res = 'UNKNOWN'
    return res
inputs: Complete the below
def make_graph(dists, scheme=u'default'):

    ''''Makes a dependency graph from the given distributions.
    :parameter dists: a list of distributions
    :type dists: list of :class:`distutils2.database.InstalledDistribution` and
    :class:`distutils2.database.EggInfoDistribution` instances
    :rtype: a :class:`DependencyGraph` instance'
    '''
targets: scheme = get_scheme(scheme)
    graph = DependencyGraph()
    provided = {}
    for dist in dists:
        graph.add_distribution(dist)
        for p in dist.provides:
            (name, version) = parse_name_and_version(p)
            logger.debug(u'Add    to    provided:    %s,    %s,    %s', name, version, dist)
            provided.setdefault(name, []).append((version, dist))
    for dist in dists:
        requires = (((dist.run_requires | dist.meta_requires) | dist.build_requires) | dist.dev_requires)
        for req in requires:
            try:
                matcher = scheme.matcher(req)
            except UnsupportedVersionError:
                logger.warning(u'could    not    read    version    %r    -    using    name    only', req)
                name = req.split()[0]
                matcher = scheme.matcher(name)
            name = matcher.key
            matched = False
            if (name in provided):
                for (version, provider) in provided[name]:
                    try:
                        match = matcher.match(version)
                    except UnsupportedVersionError:
                        match = False
                    if match:
                        graph.add_edge(dist, provider, req)
                        matched = True
                        break
            if (not matched):
                graph.add_missing(dist, req)
    return graph
inputs: I wrote the below code

    if (':    ' in data):
        return data.split(':    ')[1]
    if (':\n' in data):
        return data.split(':\n')[1]
    else:
        return data


What's a good function header?
targets: def parse_return(data):
inputs: I wrote the below code

    from .models import ImportPurgatory
    from ..devices.models import Device
    own_device = Device.get_own_device()
    if (not src_version):
        src_version = own_device.get_version()
    if isinstance(data, ImportPurgatory):
        purgatory = data
        data = purgatory.serialized_models
    else:
        purgatory = None
    if (isinstance(data, str) or isinstance(data, unicode)):
        models = deserialize(data, src_version=src_version, dest_version=own_device.get_version())
    else:
        models = deserialize(data, src_version=src_version, dest_version=own_device.get_version())
    unsaved_models = []
    exceptions = ''
    saved_model_count = 0
    try:
        for modelwrapper in models:
            try:
                model = modelwrapper.object
                if (not hasattr(model, 'verify')):
                    raise ValidationError(('Cannot    save    model:    %s    does    not    have    a    verify    method    (not    a    subclass    of    SyncedModel?)' % model.__class__))
                model._state.adding = False
                model.full_clean(imported=True)
                model.save(imported=True, increment_counters=increment_counters)
                saved_model_count += 1
                if verbose:
                    print ('IMPORTED    %s    (id:    %s,    counter:    %d,    signed_by:    %s)' % (model.__class__.__name__, model.id[0:5], model.counter, model.signed_by.id[0:5]))
            except ValidationError as e:
                exceptions += ('%s:    %s\n' % (model.pk, e))
                unsaved_models.append(model)
                try:
                    if (increment_counters and model.verify()):
                        model.signed_by.set_counter_position(model.counter, soft_set=True)
                except:
                    pass
    except Exception as e:
        exceptions += unicode(e)
    if unsaved_models:
        if (not purgatory):
            purgatory = ImportPurgatory()
        purgatory.serialized_models = serialize(unsaved_models,...

What's a good function header?
targets: def save_serialized_models(data, increment_counters=True, src_version=None, verbose=False):
inputs: I wrote the below code

    if (resp[:3] != '229'):
        raise error_reply, resp
    left = resp.find('(')
    if (left < 0):
        raise error_proto, resp
    right = resp.find(')', (left + 1))
    if (right < 0):
        raise error_proto, resp
    if (resp[(left + 1)] != resp[(right - 1)]):
        raise error_proto, resp
    parts = resp[(left + 1):right].split(resp[(left + 1)])
    if (len(parts) != 5):
        raise error_proto, resp
    host = peer[0]
    port = int(parts[3])
    return (host, port)


What's a good function header?
targets: def parse229(resp, peer):
inputs: Complete the below
def get_validation_errors(outfile, app=None):

    ''''Validates all models that are part of the specified app. If no app name is provided,
    validates all models of all installed apps. Writes errors, if any, to outfile.
    Returns number of errors.'
    '''
targets: from django.db import models, connection
    from django.db.models.loading import get_app_errors
    from django.db.models.fields.related import RelatedObject
    from django.db.models.deletion import SET_NULL, SET_DEFAULT
    e = ModelErrorCollection(outfile)
    for (app_name, error) in get_app_errors().items():
        e.add(app_name, error)
    for cls in models.get_models(app, include_swapped=True):
        opts = cls._meta
        if opts.swapped:
            try:
                (app_label, model_name) = opts.swapped.split('.')
            except ValueError:
                e.add(opts, ("%s    is    not    of    the    form    'app_label.app_name'." % opts.swappable))
                continue
            if (not models.get_model(app_label, model_name)):
                e.add(opts, ("Model    has    been    swapped    out    for    '%s'    which    has    not    been    installed    or    is    abstract." % opts.swapped))
            continue
        if (settings.AUTH_USER_MODEL == ('%s.%s' % (opts.app_label, opts.object_name))):
            if (cls.USERNAME_FIELD in cls.REQUIRED_FIELDS):
                e.add(opts, 'The    field    named    as    the    USERNAME_FIELD    should    not    be    included    in    REQUIRED_FIELDS    on    a    swappable    User    model.')
            if (not opts.get_field(cls.USERNAME_FIELD).unique):
                e.add(opts, 'The    USERNAME_FIELD    must    be    unique.    Add    unique=True    to    the    field    parameters.')
        for f in opts.local_fields:
            if ((f.name == 'id') and (not f.primary_key) and (opts.pk.name == 'id')):
                e.add(opts, ('"%s":    You    can\'t    use    "id"    as    a    field    name,    because    each    model    automatically    gets    an    "id"    field    if    none    of    the    fields    have    primary_key=True.    You    need    to    either    remove/rename    your    "id"    field    or    add    primary_key=True    to    a    field.' % f.name))
            if f.name.endswith('_'):
    ...
inputs: def bulk_upload():
targets: """Custom view to allow bulk uploading of Photos
    @ToDo: Allow creation of a GIS Feature Layer to view on the map
    @ToDo: Allow uploading of associated GPX track for timestamp correlation.
    See r1595 for the previous draft of this work
    """
    s3.stylesheets.append('plugins/fileuploader.css')
    return dict()
inputs: Complete the below
@cachedmethod
def getConsoleWidth(default=80):

    ''''Returns console width'
    '''
targets: width = None
    if os.getenv('COLUMNS', '').isdigit():
        width = int(os.getenv('COLUMNS'))
    else:
        try:
            try:
                FNULL = open(os.devnull, 'w')
            except IOError:
                FNULL = None
            process = subprocess.Popen('stty    size', shell=True, stdout=subprocess.PIPE, stderr=(FNULL or subprocess.PIPE))
            (stdout, _) = process.communicate()
            items = stdout.split()
            if ((len(items) == 2) and items[1].isdigit()):
                width = int(items[1])
        except (OSError, MemoryError):
            pass
    if (width is None):
        try:
            import curses
            stdscr = curses.initscr()
            (_, width) = stdscr.getmaxyx()
            curses.endwin()
        except:
            pass
    return (width or default)
inputs: I wrote the below code

    if ('openstack_config.get' not in __salt__):
        return False
    if ('openstack_config.set' not in __salt__):
        return False
    if ('openstack_config.delete' not in __salt__):
        return False
    return True


What's a good function header?
targets: def __virtual__():
inputs: Complete the below
def get_user_permission_codename(perm):

    ''''Returns \'<perm>_<usermodulename>\'. If standard ``auth.User`` is
    used, for \'change\' perm this would return ``change_user`` and if
    ``myapp.CustomUser`` is used it would return ``change_customuser``.'
    '''
targets: return get_user_permission_full_codename(perm).split(u'.')[1]
inputs: Complete the below
def get_server_certificate(addr, ssl_version=PROTOCOL_TLS, ca_certs=None):

    ''''Retrieve the certificate from the server at the specified address,
    and return it as a PEM-encoded string.
    If \'ca_certs\' is specified, validate the server cert against it.
    If \'ssl_version\' is specified, use it in the connection attempt.'
    '''
targets: (host, port) = addr
    if (ca_certs is not None):
        cert_reqs = CERT_REQUIRED
    else:
        cert_reqs = CERT_NONE
    context = _create_stdlib_context(ssl_version, cert_reqs=cert_reqs, cafile=ca_certs)
    with closing(create_connection(addr)) as sock:
        with closing(context.wrap_socket(sock)) as sslsock:
            dercert = sslsock.getpeercert(True)
    return DER_cert_to_PEM_cert(dercert)
inputs: def get_required_parameters(dictionary, additional_params=None):
targets: """Extract all required LTI parameters from a dictionary and verify that none
    are missing.
    :param dictionary: The dictionary that should contain all required parameters
    :param additional_params: Any expected parameters, beyond those required for
    the LTI launch.
    :return: A new dictionary containing all the required parameters from the
    original dictionary and additional parameters, or None if any expected
    parameters are missing.
    """
    params = {}
    additional_params = (additional_params or [])
    for key in (REQUIRED_PARAMETERS + additional_params):
        if (key not in dictionary):
            return None
        params[key] = dictionary[key]
    return params
inputs: I wrote the below code

    if (len(ty) != len(pv)):
        raise ValueError('len(ty)    must    equal    to    len(pv)')
    total_correct = total_error = 0
    sumv = sumy = sumvv = sumyy = sumvy = 0
    for (v, y) in zip(pv, ty):
        if (y == v):
            total_correct += 1
        total_error += ((v - y) * (v - y))
        sumv += v
        sumy += y
        sumvv += (v * v)
        sumyy += (y * y)
        sumvy += (v * y)
    l = len(ty)
    ACC = ((100.0 * total_correct) / l)
    MSE = (total_error / l)
    try:
        SCC = ((((l * sumvy) - (sumv * sumy)) * ((l * sumvy) - (sumv * sumy))) / (((l * sumvv) - (sumv * sumv)) * ((l * sumyy) - (sumy * sumy))))
    except:
        SCC = float('nan')
    return (ACC, MSE, SCC)


What's a good function header?
targets: def evaluations(ty, pv):
inputs: Complete the below
@pytest.fixture
def setup_browser(qtbot):

    ''''Set up WebBrowser.'
    '''
targets: widget = WebBrowser()
    qtbot.addWidget(widget)
    return widget
inputs: @testing.requires_testing_data
def test_rap_music_sphere():
targets: """Test RAP-MUSIC with real data, sphere model, MEG only.
    """
    (evoked, noise_cov) = _get_data(ch_decim=8)
    sphere = mne.make_sphere_model(r0=(0.0, 0.0, 0.04))
    src = mne.setup_volume_source_space(subject=None, pos=10.0, sphere=(0.0, 0.0, 40, 65.0), mindist=5.0, exclude=0.0)
    forward = mne.make_forward_solution(evoked.info, trans=None, src=src, bem=sphere)
    dipoles = rap_music(evoked, forward, noise_cov, n_dipoles=2)
    pos = np.array([dip.pos[0] for dip in dipoles])
    assert_equal(pos.shape, (2, 3))
    assert_equal((pos[:, 0] < 0).sum(), 1)
    assert_equal((pos[:, 0] > 0).sum(), 1)
    assert_true((1e-10 < dipoles[0].amplitude[0] < 1e-07))
inputs: I wrote the below code

    import pifacedigitalio as PFIO
    hass.data[DATA_PFIO_LISTENER].register(port, PFIO.IODIR_BOTH, event_callback, settle_time=settle)


What's a good function header?
targets: def edge_detect(hass, port, event_callback, settle):
inputs: def get_loc_from_db(location, country):
targets: """Lookup a Location Hierarchy
    """
    row = db((table.name == location)).select(table.level, table.L1, table.L2, table.L3, orderby=table.level, limitby=(0, 1)).first()
    if (row is None):
        return lookup_loc(location, country)
    country_code = country_codes[country]
    return (country_code, row.L1, row.L2, row.L3)
inputs: def make_app():
targets: """Helper function that creates a plnt app.
    """
    from plnt import Plnt
    database_uri = os.environ.get('PLNT_DATABASE_URI')
    app = Plnt((database_uri or 'sqlite:////tmp/plnt.db'))
    app.bind_to_context()
    return app
inputs: I wrote the below code

    assert (torch.distributed._initialized == _INITIALIZED_PG), 'collective    only    supported    in    process-group    mode'
    return _DistributedRequest(torch._C._dist_isend(tensor, dst))


What's a good function header?
targets: def isend(tensor, dst):
inputs: def get_region_from_metadata():
targets: """Try to get region from instance identity document and cache it
    .. versionadded:: 2015.5.6
    """
    global __Location__
    if (__Location__ == 'do-not-get-from-metadata'):
        LOG.debug('Previously    failed    to    get    AWS    region    from    metadata.    Not    trying    again.')
        return None
    if (__Location__ != ''):
        return __Location__
    try:
        result = requests.get('http://169.254.169.254/latest/dynamic/instance-identity/document', proxies={'http': ''}, timeout=AWS_METADATA_TIMEOUT)
    except requests.exceptions.RequestException:
        LOG.warning('Failed    to    get    AWS    region    from    instance    metadata.', exc_info=True)
        __Location__ = 'do-not-get-from-metadata'
        return None
    try:
        region = result.json()['region']
        __Location__ = region
        return __Location__
    except (ValueError, KeyError):
        LOG.warning('Failed    to    decode    JSON    from    instance    metadata.')
        return None
    return None
inputs: Complete the below
def Run(arg_dict, oauth2_parameters=None):

    ''''Sets up and runs the bulkloader, given the options as keyword arguments.
    Args:
    arg_dict: Dictionary of bulkloader options
    oauth2_parameters: None, or the parameters for OAuth2 authentication.
    Returns:
    An exit code.'
    '''
targets: arg_dict = ProcessArguments(arg_dict)
    SetupLogging(arg_dict)
    return _PerformBulkload(arg_dict, oauth2_parameters)
inputs: def dispatch(c, id, methodname, args=(), kwds={}):
targets: """Send a message to manager using connection `c` and return response
    """
    c.send((id, methodname, args, kwds))
    (kind, result) = c.recv()
    if (kind == '#RETURN'):
        return result
    raise convert_to_error(kind, result)
inputs: I wrote the below code

    print('Loading    model...')
    model = serial.load(model_path)
    model.set_batch_size(m)
    return model


What's a good function header?
targets: def load_model(model_path, m):
inputs: I wrote the below code

    def enumerated_type_check(var_name, val):
        for func in allowed_type_funcs:
            if (not func(var_name, val)):
                return None
        return (_('%s    is    not    an    allowed_type') % (var_name,))
    return enumerated_type_check


What's a good function header?
targets: def check_variable_type(allowed_type_funcs):
inputs: Complete the below
def explore_module(package):

    ''''Explore the modules.'
    '''
targets: module = importlib.import_module(package)
    if (not hasattr(module, '__path__')):
        return []
    for (_, name, _) in pkgutil.iter_modules(module.__path__, (package + '.')):
        (yield name)
inputs: def LU_solve(matlist, variable, constant, K):
targets: """Solves a system of equations using  LU decomposition given a matrix
    of coefficients, a vector of variables and a vector of constants.
    Examples
    >>> from sympy.matrices.densesolve import LU_solve
    >>> from sympy import QQ
    >>> from sympy import Dummy
    >>> x, y, z = Dummy(\x\), Dummy(\y\), Dummy(\z\)
    >>> coefficients = [
    ... [QQ(2), QQ(-1), QQ(-2)],
    ... [QQ(-4), QQ(6), QQ(3)],
    ... [QQ(-4), QQ(-2), QQ(8)]]
    >>> variables = [
    ... [x],
    ... [y],
    ... [z]]
    >>> constants = [
    ... [QQ(-1)],
    ... [QQ(13)],
    ... [QQ(-6)]]
    >>> LU_solve(coefficients, variables, constants, QQ)
    [[2], [3], [1]]
    See Also
    LU
    forward_substitution
    backward_substitution
    """
    new_matlist = copy.deepcopy(matlist)
    nrow = len(new_matlist)
    (L, U) = LU(new_matlist, K)
    y = [[i] for i in symbols(('y:%i' % nrow))]
    forward_substitution(L, y, constant, K)
    backward_substitution(U, variable, y, K)
    return variable
inputs: I wrote the below code

    for format in formats:
        if (format not in ARCHIVE_FORMATS):
            return format
    return None


What's a good function header?
targets: def check_archive_formats(formats):
inputs: @register.filter
def fix_jsi18n(extrahead):
targets: """Hack to rewrite out the jsi18n script tag from an inherited admin template.
    This is required in order to prevent it\s relative path from generating
    server errors.
    Please see this issue for more information:
    * http://code.google.com/p/django-reversion/issues/detail?id=50
    """
    return mark_safe(unicode(extrahead).replace(u'../../../jsi18n/', reverse('admin:jsi18n')))
inputs: Complete the below
def cookie_date(epoch_seconds=None):

    ''''Formats the time to ensure compatibility with Netscape\'s cookie standard.
    Accepts a floating point number expressed in seconds since the epoch, in
    UTC - such as that outputted by time.time(). If set to None, defaults to
    the current time.
    Outputs a string in the format \'Wdy, DD-Mon-YYYY HH:MM:SS GMT\'.'
    '''
targets: rfcdate = formatdate(epoch_seconds)
    return (u'%s-%s-%s    GMT' % (rfcdate[:7], rfcdate[8:11], rfcdate[12:25]))
inputs: I wrote the below code

    p[0] = p[1]


What's a good function header?
targets: def p_container_type(p):
inputs: def create_virtualenv(venv=VENV, no_site_packages=True):
targets: """Creates the virtual environment and installs PIP only into the
    virtual environment
    """
    print 'Creating    venv...',
    if no_site_packages:
        run_command(['virtualenv', '-q', '--no-site-packages', VENV])
    else:
        run_command(['virtualenv', '-q', VENV])
    print 'done.'
    print 'Installing    pip    in    virtualenv...',
    if (not run_command(['tools/with_venv.sh', 'easy_install', 'pip>1.0']).strip()):
        die('Failed    to    install    pip.')
    print 'done.'
inputs: Complete the below
def logical_volume_info(path):

    ''''Get logical volume info.
    :param path: logical volume path'
    '''
targets: (out, err) = execute('lvs', '-o', 'vg_all,lv_all', '--separator', '|', path, run_as_root=True)
    info = [line.split('|') for line in out.splitlines()]
    if (len(info) != 2):
        raise RuntimeError((_('Path    %s    must    be    LVM    logical    volume') % path))
    return dict(zip(*info))