code: def getData(self, pos):
          
          retval = {}
          if pos >= len(self.inputs):
              raise IndexError('getData() pattern beyond range.', pos)
          if self.verbosity >= 1: print("Getting input", pos, "...")
          if len(self.inputMap) == 0:
              if type(self.inputs[pos]) == dict: # allow inputs to be a dict
                  retval.update(self.inputs[pos])
              else:
                  retval[self.layers[0].name] = self.inputs[pos]
          else: # mapInput set manually
              for vals in self.inputMap:
                  (name, offset) = vals
                  retval[name] = self.getDataMap("input", pos, name, offset)
          if self.verbosity > 1: print("Loading target", pos, "...")
          if len(self.targets) == 0:
              pass # ok, no targets
          elif len(self.targetMap) == 0:
              if type(self.targets[pos]) == dict: # allow targets to be a dict
                  retval.update(self.targets[pos])
              else:
                  retval[self.layers[len(self.layers)-1].name] = self.targets[pos]
          else: # set manually
              for vals in self.targetMap:
                  (name, offset) = vals
                  retval[name] = self.getDataMap("target", pos, name, offset)
          return retval
docs: Returns dictionary with input and target given pos.