docstr: Creates a random number generator using the `Instance` id and `seed`.
docstr_tok: ["Creates","a","random","number","generator","using","the","`","Instance","`","id","and","`","seed","`","."]
code: def get_rng(
      self, instance: Instance, seed: Optional[int] = None
  ) -> Random:
      """Creates a random number generator using the `Instance` id and `seed`."""
      assert instance.id is not None
      # If seed exists, use it as part of the random seed
      return Random(
          instance.id if seed is None else str(seed) + instance.id
      )
  
file_path: H2O/h2o_hf/helm/src/helm/benchmark/augmentations/perturbation.py
imports: from abc import ABC, abstractmethod
  from dataclasses import replace
  from random import Random
  from typing import List, Optional
  from .perturbation_description import PerturbationDescription
  from helm.benchmark.scenarios.scenario import Input, Instance, Reference, Output
  from helm.common.object_spec import ObjectSpec, create_object
label_desc: Use image node_id 2 for calling the Perturbation obj's underlying member method code with example usage: obj.get_rng(instance, seed) and returns: Random