code: def _from_string(cls, string):
          
          m = cls.name_email_regex.search(string)
          if m:
              name, email = m.groups()
              return Actor(name, email)
          else:
              m = cls.name_only_regex.search(string)
              if m:
                  return Actor(m.group(1), None)
              else:
                  # assume best and use the whole string as name
                  return Actor(string, None)
docs: Create an Actor from a string.
          :param string: is the string, which is expected to be in regular git format
  
                  John Doe <jdoe@example.com>
  
          :return: Actor