code: def foreach(self, func):
          
          if self.mode == 'spark':
              self.values.tordd().map(lambda kv: (kv[0][0], kv[1])).foreach(func)
          else:
              [func(kv) for kv in enumerate(self.values)]
docs: Execute a function on each image.
  
          Functions can have side effects. There is no return value.