def split_section(input_file, section_suffix, test_function):
    '\n    Split a pipfile or a lockfile section out by section name and test function\n\n        :param dict input_file: A dictionary containing either a pipfile or lockfile\n        :param str section_suffix: A string of the name of the section\n        :param func test_function: A test function to test against the value in the key/value pair\n\n    >>> split_section(my_lockfile, \'vcs\', is_vcs)\n    {\n        \'default\': {\n            "six": {\n                "hashes": [\n                    "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb",\n                    "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"\n                ],\n                "version": "==1.11.0"\n            }\n        },\n        \'default-vcs\': {\n            "e1839a8": {\n                "editable": true,\n                "path": "."\n            }\n        }\n    }\n    '
    pipfile_sections = ('packages', 'dev-packages')
    lockfile_sections = ('default', 'develop')
    if any(((section in input_file) for section in pipfile_sections)):
        sections = pipfile_sections
    elif any(((section in input_file) for section in lockfile_sections)):
        sections = lockfile_sections
    else:
        return input_file
    for section in sections:
        split_dict = {}
        entries = input_file.get(section, {})
        for k in list(entries.keys()):
            if test_function(entries.get(k)):
                split_dict[k] = entries.pop(k)
        input_file['-'.join([section, section_suffix])] = split_dict
    return input_file
Split a pipfile or a lockfile section out by section name and test function

    :param dict input_file: A dictionary containing either a pipfile or lockfile
    :param str section_suffix: A string of the name of the section
    :param func test_function: A test function to test against the value in the key/value pair

>>> split_section(my_lockfile, 'vcs', is_vcs)
{
    'default': {
        "six": {
            "hashes": [
                "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb",
                "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"
            ],
            "version": "==1.11.0"
        }
    },
    'default-vcs': {
        "e1839a8": {
            "editable": true,
            "path": "."
        }
    }
}
def split_section(input_file, section_suffix, test_function):
    '\n    Split a pipfile or a lockfile section out by section name and test function\n\n        :param dict input_file: A dictionary containing either a pipfile or lockfile\n        :param str section_suffix: A string of the name of the section\n        :param func test_function: A test function to test against the value in the key/value pair\n\n    >>> split_section(my_lockfile, \'vcs\', is_vcs)\n    {\n        \'default\': {\n            "six": {\n                "hashes": [\n                    "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb",\n                    "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"\n                ],\n                "version": "==1.11.0"\n            }\n        },\n        \'default-vcs\': {\n            "e1839a8": {\n                "editable": true,\n                "path": "."\n            }\n        }\n    }\n    '
    pipfile_sections = ('packages', 'dev-packages')
    lockfile_sections = ('default', 'develop')
    if any(((section in input_file) for section in pipfile_sections)):
        sections = pipfile_sections
    elif any(((section in input_file) for section in lockfile_sections)):
        sections = lockfile_sections
    else:
        return input_file
    for section in sections:
        split_dict = {}
        entries = input_file.get(section, {})
        for k in list(entries.keys()):
            if test_function(entries.get(k)):
                split_dict[k] = entries.pop(k)
        input_file['-'.join([section, section_suffix])] = split_dict
    return input_file