def addStage(self, stage):
        # check if stage already exists in pipeline - if so, don't bother

        # check if stage exists - stage uniqueness defined by in- and outputs
        # for base stages and entire command for CmdStages
        h = stage.getHash()
        if self.stage_dict.has_key(h):
            self.skipped_stages += 1
            #stage already exists - nothing to be done
        else: #stage doesn't exist - add it
            self.stage_dict[h] = self.counter
            #self.statusArray[self.counter] = 'notstarted'
            self.stages.append(stage)
            self.nameArray.append(stage.name)
            # add all outputs to the output dictionary
            for o in stage.outputFiles:
                self.outputhash[o] = self.counter
            # add the stage's index to the graph
            self.G.add_node(self.counter, label=stage.name,color=stage.colour)
            self.counter += 1
        # huge hack since default isn't available in CmdStage() constructor
        # (may get overridden later by a hook, hence may really be wrong ... ugh):
        if stage.mem is None and self.options is not None:
            stage.setMem(self.options.default_job_mem)
Returns a dictionary of {field_name: field_index} for the given table.
dataset/ETHPy150Open Mouse-Imaging-Centre/pydpiper/pydpiper/pipeline.py/Pipeline.addStage--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/db/backends/mysql/introspection.py/DatabaseIntrospection._name_to_index