class_docstr: An abstract class for transforming a sequence of text to produce a list of
  potential adversarial example.
class_docstr_tok: ["An","abstract","class","for","transforming","a","sequence","of","text","to","produce","a","list","of","potential","adversarial","example","."]
docstr: Get 'num' samples from x.
  
  :param list x: list to sample
  :param int num: sample number
  :return: max 'num' unique samples.
docstr_tok: ["Get","'num","'","samples","from","x.",":","param","list","x",":","list","to","sample",":","param","int","num",":","sample","number",":","return",":","max","'num","'","unique","samples","."]
code: def sample_num(cls, x, num):
      r"""
      Get 'num' samples from x.
  
      :param list x: list to sample
      :param int num: sample number
      :return: max 'num' unique samples.
  
      """
      if isinstance(x, list):
          num = min(num, len(x))
          return random.sample(x, num)
      elif isinstance(x, int):
          num = min(num, x)
          return random.sample(range(0, x), num)
  
file_path: textflint/textflint/generation/transformation/transformation.py
imports: import random
  from abc import ABC, abstractmethod
  from ...common.utils import logger
  from ...common.utils.list_op import trade_off_sub_words
  from ...common.utils.error import FlintError
  from ...common.preprocess.en_processor import EnProcessor
  from ...common.preprocess.cn_processor import CnProcessor
label_desc: Use image node_id 5 for calling the Transformation obj's underlying member method code with example usage: obj.sample_num(cls, x, num) and returns: random, random