code: def partition(self, text, *args, **kwargs):
      if self.partition_fn == "ngrams":
          assert (
              "n" in self.partition_kwargs
          ), "ngrams should have 'n' in the partition_kwargs"
          parts = extract_non_overlapping_ngrams(
              text, self.partition_kwargs["n"]
          )
  
      elif self.partition_fn == "sentences":
          parts = split_into_sentences(text)
  
      elif self.partition_fn == "n_sentences":
          assert (
              "n" in self.partition_kwargs
          ), "n_sentences should have 'n' in the partition_kwargs"
          parts = split_k_sentences(text, self.partition_kwargs["n"])
  
      elif self.partition_fn == "dep_parse":
          parts = split_dep_parse(text)
  
      else:
          raise NotImplementedError(
              f"Partition function {self.partition_fn} not implemented."
          )
  
      return parts
  
imports: import torch
  import numpy
  from abc import ABC, abstractmethod
  from sklearn.linear_model import Ridge, lars_path
  from .text_utils import *
  from .perturbation_tools import RemovalPerturbation
label_desc: Use image node_id 2 for calling the LocalExplanations obj's underlying member method code with example usage: obj.partition(text) and returns: parts