<s> import re <EOL> class Actor ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name , email ) : <EOL> self . name = name <EOL> self . email = email <EOL> def __str__ ( self ) : <EOL> return self . name <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( self . name , self . email ) <EOL> @ classmethod <EOL> def from_string ( cls , string ) : <EOL> """<STR_LIT>""" <EOL> if re . search ( r'<STR_LIT>' , string ) : <EOL> m = re . search ( r'<STR_LIT>' , string ) <EOL> name , email = m . groups ( ) <EOL> return Actor ( name , email ) <EOL> else : <EOL> return Actor ( string , None ) </s>
