docs: def load_rdd_from_pickle(sc, path, min_partitions=None, return_type='images'):
      """  Loads an rdd that was saved as one pickle file per partition
  
      :param sc: Spark Context
      :param path: directory to load from
      :param min_partitions: minimum number of partitions. If None will be sc.defaultParallelism
      :param return_type: what to return:
          'rdd' - RDD
          'images' - Thunder Images object
          'series' - Thunder Series object
      :return: based on return type.
      """
      if min_partitions is None:
          min_partitions = sc.defaultParallelism
      rdd = sc.pickleFile(path, minPartitions=min_partitions)
      rdd = rdd.flatMap(lambda x: x)
      if return_type == 'images':
          result = td.images.fromrdd(rdd).repartition(min_partitions)
      elif return_type == 'series':
          result = td.series.fromrdd(rdd).repartition(min_partitions)
      elif return_type == 'rdd':
          result = rdd.repartition(min_partitions)
      else:
          raise ValueError('return_type not supported: %s' % return_type)
      logging.getLogger('pySparkUtils').info('Loaded rdd from: %s as type: %s'
                                             % (path, return_type))
      return result