def pairify(string):
    """Convert a string of the form "key: value" to a tuple ("key",
    "value").  May raise a ParseError."""
    items = string.split(":", 1)
    try:
        return items[0].strip(), items[1].strip()
    except IndexError:
        raise ParseError("'%s': Keys must be terminated with a colon." %
                         string)
Convert a string of the form "key: value" to a tuple ("key",
    "value").  May raise a ParseError.
recipes/Python/576996_RFC_822style_parser/recipe-576996.py