code: def getsignaturefromtext(text, objname):
      
      if isinstance(text, dict):
          text = text.get('docstring', '')
      # Regexps
      oneline_re = objname + r'\([^\)].+?(?<=[\w\]\}\'"])\)(?!,)'
      multiline_re = objname + r'\([^\)]+(?<=[\w\]\}\'"])\)(?!,)'
      multiline_end_parenleft_re = r'(%s\([^\)]+(\),\n.+)+(?<=[\w\]\}\'"])\))'
      # Grabbing signatures
      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
      # The most relevant signature is usually the first one. There could be
      # others in doctests but those are not so important
      if all_sigs:
          return all_sigs[0]
      else:
          return ''
docs: Get object signatures from text (object documentation)
      Return a list containing a single string in most cases
      Example of multiple signatures: PyQt5 objects