

def get_specification(commit_message, allowed_formats, allowed_uri_schemes):
    "\n    Extracts the specification URI from the commit_message and creates the appropriate specification instance based on\n    the URI scheme. If scheme is missing from the URI the default_specification_format will be used.\n\n    >>> spec = get_specification('something', {'uri'}, {'https'})\n    >>> spec.valid\n    False\n\n    :type commit_message:str\n    :type default_specification_format:str\n    :type allowed_uri_schemes: List[str]\n    :return: BaseSpecification\n    "
    try:
        (specification_str, _) = commit_message.split(' ', 1)
    except ValueError:
        specification_str = commit_message
    specification = Specification(specification_str, allowed_formats, allowed_uri_schemes)
    return specification

dataset/ETHPy150Open zalando/turnstile/turnstile/models/specifications.py get_specification/original