code: def str2tuple(str_in):
      '''
      Extracts a tuple from a string.
  
      Args:
          str_in (string) that contains python tuple
      Returns:
          (dict) or None if no valid tuple was found
      Raises:
          -
      '''
      tuple_out = safe_eval(str_in)
      if not isinstance(tuple_out, tuple):
          tuple_out = None
      return tuple_ouf str2tuple(str_in):
      '''
      Extracts a tuple from a string.
  
      Args:
          str_in (string) that contains python tuple
      Returns:
          (dict) or None if no valid tuple was found
      Raises:
          -
      '''
      tuple_out = safe_eval(str_in)
      if not isinstance(tuple_out, tuple):
          tuple_out = None
      return tuple_out
docs: Extracts a tuple from a string.
  
      Args:
          str_in (string) that contains python tuple
      Returns:
          (dict) or None if no valid tuple was found
      Raises:
          -