class_docstr: In a TokenSeries, every cell has to be a list of words/tokens, i.e. a list
  of strings. For example, `pd.Series([["test"], ["token2", "token3"]])` is a valid TokenSeries.
class_docstr_tok: ["In","a","TokenSeries",",","every","cell","has","to","be","a","list","of","words\/tokens",",","i.e",".","a","list","of","strings",".","For","example",",","`","pd.Series","(","[","[","``","test","''","]",",","[","``","token2","''",",","``","token3","''","]","]",")","`","is","a","valid","TokenSeries","."]
docstr: Check if a given Pandas Series has the properties of a TokenSeries.
docstr_tok: ["Check","if","a","given","Pandas","Series","has","the","properties","of","a","TokenSeries","."]
code: def check_type(s: pd.Series) -> Tuple[bool, str]:
      """
      Check if a given Pandas Series has the properties of a TokenSeries.
      """
  
      error_string = (
          "should be TokenSeries: there are non-token cells (every cell should be a list of words/tokens) in the given Series."
          " See help(hero.HeroTypes) for more information."
      )
  
      def is_list_of_strings(cell):
          return all(isinstance(x, str) for x in cell) and isinstance(
              cell, (list, tuple)
          )
  
      try:
          first_non_nan_value = s.loc[s.first_valid_index()]
          if not is_list_of_strings(first_non_nan_value):
              return False, error_string
      except KeyError:  # Only NaNs in Series -> same warning applies
          return False, error_string
  
      return True, ""
  
file_path: texthero/texthero/_types.py
imports: import functools
  import pandas
  from typing import Tuple
label_desc: Use image node_id 1 for calling the TokenSeries obj's underlying member method code with example usage: obj.check_type(s) and returns: True,  str, unknown, False,  error_string, False,  error_string