def _parse_requirements_string(parser, s, version_factory):
    m = _SECTION_RE.search(s)
    if m is None:
        raise ValueError("invalid requirement string: %r" % s)
    else:
        requirements_type, requirements_string = m.groups()
        requirements = OrderedDict()
        for requirement_string in requirements_string.split(","):
            for distribution_name, specs in parser.parse(requirement_string).items():
                if not distribution_name in requirements:
                    requirements[distribution_name] = []
                requirements[distribution_name].extend(specs)
        return requirements_type, \
               [Requirement(name, reqs, version_factory)
                for name, reqs in six.iteritems(requirements)]
dataset/ETHPy150Open enthought/depsolver/depsolver/package.py/_parse_requirements_string/original