code: def translate(s, a, b=None, c=None):
      """Return ``s`` where characters have been replaced or deleted.
  
      SYNTAX
      ======
  
      translate(s, None, deletechars):
          all characters in ``deletechars`` are deleted
      translate(s, map [,deletechars]):
          all characters in ``deletechars`` (if provided) are deleted
          then the replacements defined by map are made; if the keys
          of map are strings then the longer ones are handled first.
          Multicharacter deletions should have a value of ''.
      translate(s, oldchars, newchars, deletechars)
          all characters in ``deletechars`` are deleted
          then each character in ``oldchars`` is replaced with the
          corresponding character in ``newchars``
  
      Examples
      ========
  
      >>> from sympy.utilities.misc import translate
      >>> abc = 'abc'
      >>> translate(abc, None, 'a')
      'bc'
      >>> translate(abc, {'a': 'x'}, 'c')
      'xb'
      >>> translate(abc, {'abc': 'x', 'a': 'y'})
      'x'
  
      >>> translate('abcd', 'ac', 'AC', 'd')
      'AbC'
  
      There is no guarantee that a unique answer will be
      obtained if keys in a mapping overlap are the same
      length and have some identical sequences at the
      beginning/end:
  
      >>> translate(abc, {'ab': 'x', 'bc': 'y'}) in ('xc', 'ay')
      True
      """
  
      mr = {}
      if a is None:
          if c is not None:
              raise ValueError(
                  "c should be None when a=None is passed, instead got %s"
                  % c
              )
          if b is None:
              return s
          c = b
          a = b = ""
      else:
          if isinstance(a, dict):
              short = {}
              for k in list(a.keys()):
                  if len(k) == 1 and len(a[k]) == 1:
                      short[k] = a.pop(k)
              mr = a
              c = b
              if short:
                  a, b = ["".join(i) for i in list(zip(*short.items()))]
              else:
                  a = b = ""
          elif len(a) != len(b):
              raise ValueError(
                  "oldchars and newchars have different lengths"
              )
  
      if c:
          val = str.maketrans("", "", c)
          s = s.translate(val)
      s = replace(s, mr)
      n = str.maketrans(a, b)
      return s.translate(n)
  
imports: from __future__ import annotations
  import operator
  import sys
  import os
  import re
  import struct
  from textwrap import fill, dedent
label_desc: Use image node_id 11 for calling a global function with example usage: translate(s, a, b, c) and returns: s, s