def getargspecfromtext(text):
 blocks = text.split('\n\n')
 first_block = blocks[0].strip()
 return getsignaturefromtext(first_block, '')

def getargspecfromtext ( text ) : blocks = text . split ( '\n\n' ) first_block = blocks [ 0 ] . strip ( ) return getsignaturefromtext ( first_block , '' )
try to get the formatted argspec of a callable from the first block of its docstring this will return something like .