<s> """<STR_LIT>""" <EOL> from collections import namedtuple <EOL> FieldTuple = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def has_digit ( string_or_list , sep = "<STR_LIT:_>" ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( string_or_list , list ) : <EOL> list_length = len ( string_or_list ) <EOL> return unicode ( string_or_list [ - <NUM_LIT:1> ] ) . isdigit ( ) if list_length > <NUM_LIT:0> else False <EOL> else : <EOL> return has_digit ( string_or_list . split ( sep ) ) <EOL> def make_key ( * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> sep = kwargs . get ( '<STR_LIT>' , u"<STR_LIT:_>" ) <EOL> exclude_last_string = kwargs . get ( '<STR_LIT>' , False ) <EOL> string_array = [ ] <EOL> for arg in args : <EOL> if isinstance ( arg , list ) : <EOL> string_array . append ( unicode ( sep . join ( arg ) ) ) <EOL> else : <EOL> if exclude_last_string : <EOL> new_key_array = arg . split ( sep ) [ : - <NUM_LIT:1> ] <EOL> if len ( new_key_array ) > <NUM_LIT:0> : <EOL> string_array . append ( make_key ( new_key_array ) ) <EOL> else : <EOL> string_array . append ( unicode ( arg ) ) <EOL> return sep . join ( string_array ) </s>
