code: def from_localfs(
      paths: str, partitions, in_serialized=True, id_delimiter=None
  ):
      # noinspection PyPackageRequirements
      from pyspark import SparkContext
  
      sc = SparkContext.getOrCreate()
      fun = (
          HDFSCoder.decode
          if in_serialized
          else lambda x: (
              x.partition(id_delimiter)[0],
              x.partition(id_delimiter)[2],
          )
      )
      rdd = materialize(
          sc.textFile(paths, partitions)
          .map(fun)
          .repartition(partitions)
      )
      return from_rdd(rdd=rdd)
  
imports: import logging
  import struct
  import typing
  from typing import Callable, Iterable, Tuple, Optional, Any
  import pyspark
  from pyspark.rddsampler import RDDSamplerBase
  from fate.arch import URI
  from fate.arch.computing.api import KVTable, ComputingEngine, K, V
  from fate.arch.computing.api._table import _lifted_reduce_to_serdes, get_serdes_by_type
  from ._materialize import materialize, unmaterialize
label_desc: Use image node_id 2 for calling a global function with example usage: from_localfs(paths, partitions, in_serialized, id_delimiter) and returns: from_rdd