#NEWLINE# def get_callable_name( o ) : #NEWLINE# #INDENT# 'Welcome to str inception. Leave your kittens at home.\n    ' #NEWLINE# if isinstance ( o , partial ) : #NEWLINE# #INDENT# keywords = o . keywords #NEWLINE# kwds = ( ', ' . join ( ( ( '%s=%r' % item ) for item in keywords . items ( ) ) ) if keywords else '' ) #NEWLINE# args = ', ' . join ( map ( repr , o . args ) ) #NEWLINE# arguments = [ ] #NEWLINE# if args : #NEWLINE# #INDENT# arguments . append ( args ) #NEWLINE# #UNINDENT# if kwds : #NEWLINE# #INDENT# arguments . append ( kwds ) #NEWLINE# #UNINDENT# return ( 'partial(%s, %s)' % ( get_callable_name ( o . func ) , ', ' . join ( arguments ) ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return o . __qualname__ #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return ( '%s.%s' % ( inspect . getmodule ( o ) . __name__ , arguments . __name__ ) ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return ( '%s.%s' % ( o . __self__ . __name__ , o . __name__ ) ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# return o . __name__