def makeDoneNeed(self, kind, tokens, index):
        frame = "" # name of frame where aux resides
        framer = "" # name of framer where aux resides

        tasker = tokens[index]
        index += 1

        if index < len(tokens): #options
            connective = tokens[index]

            if connective == 'in': #optional in frame or in framer clause
                index += 1 #eat token only otherwise save for next need
                place = tokens[index] #need to resolve
                index += 1 #eat token

                if place != 'frame':
                    msg = ("ParseError: Building verb '{0}'. Invalid "
                        " '{1}' clause. Expected 'frame' got "
                        "'{2}'".format(command, connective, place))
                    raise excepting.ParseError(msg, tokens, index)

                if index < len(tokens):
                    frame = tokens[index]
                    index += 1

                    if index < len(tokens): #options
                        connective = tokens[index]

                        if connective == 'of':
                            index += 1 #eat token
                            place = tokens[index] #need to resolve
                            index += 1 #eat token

                            if place != 'framer':
                                msg = ("ParseError: Building verb '{0}'. Invalid "
                                       " '{1}' clause. Expected 'framer' got "
                                       "'{2}'".format(command, connective, place))
                                raise excepting.ParseError(msg, tokens, index)

                            if index < len(tokens):
                                framer = tokens[index]
                                index += 1
                            else:
                                framer = 'me'

                else:
                    frame = 'me'
                    framer = 'me'

        if frame and tasker not in ['any', 'all']:
            msg = ("ParseError: Building verb '{0}'. Named tasker '{1}'  not "
                "allowed with 'in frame' clause.".format(command, tasker))
            raise excepting.ParseError(msg, tokens, index)

        if not frame and tasker in ['any', 'all']:
            frame = 'me'
            framer = 'me'

        # a frame of me is nonsensical if framer is not current framer
        if (frame == 'me' and
                not (framer == 'me' or  framer == self.currentFramer.name)):
            msg = ("Error building {0}. Frame '{0}' nonsensical given"
                   " Framer '{1}'.".format(command, frame, framer))
            raise excepting.ParseError(msg, tokens, index)

        actorName = 'Need' + kind.capitalize()
        if actorName not in needing.Need.Registry:
            msg = "ParseError: Need '%s' can't find actor named '%s'" %\
                (  kind, actorName)
            raise excepting.ParseError(msg, tokens, index)

        parms = {}
        parms['tasker'] = tasker
        parms['framer'] = framer
        parms['frame'] = frame
        act = acting.Act(actor=actorName,
                         registrar=needing.Need,
                         parms=parms,
                         human=self.currentHuman,
                         count=self.currentCount)

        return (act, index)
Need to check if tasker completed by .done truthy
dataset/ETHPy150Open ioflo/ioflo/ioflo/base/building.py/Builder.makeDoneNeed