code: def replacePatterns(self, vector, layer = None):
          
          if not self.patterned: return vector
          if type(vector) == str:
              return self.replacePatterns(self.lookupPattern(vector, layer), layer)
          elif type(vector) != list:
              return vector
          # should be a vector if we made it here
          vec = []
          for v in vector:
              if type(v) == str:
                  retval = self.replacePatterns(self.lookupPattern(v, layer), layer)
                  if type(retval) == list:
                      vec.extend( retval )
                  else:
                      vec.append( retval )
              else:
                  vec.append( v )
          return vec
docs: Replaces patterned inputs or targets with activation vectors.