parameters: (title, year=None)
return_statement: return results
docstring: Search for a single TV show
  
      :param title: TV show title to search
      : param year: the year to search (optional)
      :return: a list with found TV shows
docstring_summary: Search for a single TV show
docstring_tokens: Search for a single TV show
function: def search_show(title, year=None):
      # type: (Text) -> List[InfoType]
      """
      Search for a single TV show
  
      :param title: TV show title to search
      : param year: the year to search (optional)
      :return: a list with found TV shows
      """
      params = TMDB_PARAMS.copy()
      results = []
      ext_media_id = data_utils.parse_media_id(title)
      if ext_media_id:
          logger.debug('using %s of %s to find show' % (ext_media_id['type'], ext_media_id['title']))
          if ext_media_id['type'] == 'tmdb_id':
              search_url = SHOW_URL.format(ext_media_id['title'])
          else:
              search_url = FIND_URL.format(ext_media_id['title'])
              params['external_source'] = ext_media_id['type']
      else:
          logger.debug('using title of %s to find show' % title)
          search_url = SEARCH_URL
          params['query'] = unicodedata.normalize('NFKC', title)
          if year:
              params['first_air_date_year'] = str(year)
      resp = api_utils.load_info(search_url, params=params, verboselog=settings.VERBOSELOG)
      if resp is not None:
          if ext_media_id:
              if ext_media_id['type'] == 'tmdb_id':
                  if resp.get('success') == 'false':
                      results = []
                  else:
                      results = [resp]
              else:
                  results = resp.get('tv_results', [])
          else:
              results = resp.get('results', [])
      return results
function_tokens: def search_show ( title , year = None ) : # type: (Text) -> List[InfoType] params = TMDB_PARAMS . copy ( ) results = [ ] ext_media_id = data_utils . parse_media_id ( title ) if ext_media_id : logger . debug ( 'using %s of %s to find show' % ( ext_media_id [ 'type' ] , ext_media_id [ 'title' ] ) ) if ext_media_id [ 'type' ] == 'tmdb_id' : search_url = SHOW_URL . format ( ext_media_id [ 'title' ] ) else : search_url = FIND_URL . format ( ext_media_id [ 'title' ] ) params [ 'external_source' ] = ext_media_id [ 'type' ] else : logger . debug ( 'using title of %s to find show' % title ) search_url = SEARCH_URL params [ 'query' ] = unicodedata . normalize ( 'NFKC' , title ) if year : params [ 'first_air_date_year' ] = str ( year ) resp = api_utils . load_info ( search_url , params = params , verboselog = settings . VERBOSELOG ) if resp is not None : if ext_media_id : if ext_media_id [ 'type' ] == 'tmdb_id' : if resp . get ( 'success' ) == 'false' : results = [ ] else : results = [ resp ] else : results = resp . get ( 'tv_results' , [ ] ) else : results = resp . get ( 'results' , [ ] ) return results