def _parse_docstring(self, class_):
        # Extract port names from docstring
        docstring = class_.__doc__
        inputs = []
        outputs = []
        doctext = []
        dest = doctext
        for line in docstring.split('\n'):
            if re.match(r'^\s*[Ii]nputs?\s?:\s*$', line):
                dest = inputs
                continue
            elif re.match(r'^\s*[Oo]utputs?\s?:\s*$', line):
                dest = outputs
                continue
            elif dest is doctext:
                line = line.strip()
                if line:
                    dest.append(line)
                continue

            if dest in [inputs, outputs]:
                match = re.match(r'^\s*([a-zA-Z][a-zA-Z0-9_]*)\s*:?\s*(.*)$', line)
                if match:
                    dest.append((match.group(1), match.group(2)))

        return (inputs, outputs, doctext)
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/actorstore/store.py/ActorStore._parse_docstring/original