def parse_title(title):
    """Parse a title string into its components and return an
    IMDbParsedTitle object."""
    match = TITLERE.match(title)
    if not match or match.group('trailing'):
        raise ValueError('Cannot parse "%s" as an IMDb title' % (title,))
    name = match.group('name')
    year = match.group('year')
    if year == u'????':
        year = None
    unique = match.group('unique')

    # Handle movie type (TV, etc.)
    cat = None
    #for i in ('TV','V','VG','mini'):
    #    if match.group(i):
    #        cat = match.group(i)
    ## Do not index video games
    #if cat == "VG":
    #    continue

    # Detect TV show, strip surrounding quotes.
    if name[0] == '"' and name[-1] == '"':
        name = name[1:-1]
        assert(cat is None)
        cat = "TV Show"

    return IMDbParsedTitle(title, name, year, unique, cat)
dataset/ETHPy150Open nandhp/python-imdb/imdb/parsers.py/parse_title/original