def parse_name(name):
    """Parse a name string into its components and return an
    IMDbParsedName object."""
    match = NAMERE.match(name)
    if not match:# or match.group('trailing'):
        raise ValueError('Cannot parse "%s" as an IMDb name' % (name,))
    first = match.group('first') or None
    last = match.group('last')
    unique = match.group('unique')
    return IMDbParsedName(name, first, last, unique)

# Helper functions
dataset/ETHPy150Open nandhp/python-imdb/imdb/parsers.py/parse_name/original