def getsignaturefromtext(text, objname):
 if isinstance(text, dict):
  text = text.get('docstring', '')
 oneline_re = (objname + '\\([^\\)].+?(?<=[\\w\\]\\}\\\'"])\\)(?!,)')
 multiline_re = (objname + '\\([^\\)]+(?<=[\\w\\]\\}\\\'"])\\)(?!,)')
 multiline_end_parenleft_re = '(%s\\([^\\)]+(\\),\\n.+)+(?<=[\\w\\]\\}\\\'"])\\))'
 if (not text):
  text = ''
 sigs_1 = re.findall(((oneline_re + '|') + multiline_re), text)
 sigs_2 = [g[0] for g in re.findall((multiline_end_parenleft_re % objname), text)]
 all_sigs = (sigs_1 + sigs_2)
 if all_sigs:
  return all_sigs[0]
 else:
  return ''

def getsignaturefromtext ( text , objname ) : if isinstance ( text , dict ) : text = text . get ( 'docstring' , '' ) oneline_re = ( objname + '\\([^\\)].+?(?<=[\\w\\]\\}\\\'"])\\)(?!,)' ) multiline_re = ( objname + '\\([^\\)]+(?<=[\\w\\]\\}\\\'"])\\)(?!,)' ) multiline_end_parenleft_re = '(%s\\([^\\)]+(\\),\\n.+)+(?<=[\\w\\]\\}\\\'"])\\))' if ( not text ) : text = '' sigs_1 = re . findall ( ( ( oneline_re + '|' ) + multiline_re ) , text ) sigs_2 = [ g [ 0 ] for g in re . findall ( ( multiline_end_parenleft_re % objname ) , text ) ] all_sigs = ( sigs_1 + sigs_2 ) if all_sigs : return all_sigs [ 0 ] else : return ''
get object signatures from text return a list containing a single string in most cases example of multiple signatures: pyqt4 objects .