Did I find the right examples for you? yes no

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)
In Python2, maketrans is defined in the string module.
In Python3, it is defined in the str object.
This calls the adequate function.

        def maketrans(fromstr, tostr):
    """In Python2, maketrans is defined in the string module.
       In Python3, it is defined in the str object.
       This calls the adequate function."""
    try:
        return string.maketrans(fromstr, tostr)
    except AttributeError as err:
        return str.maketrans(fromstr, tostr)
        


src/a/s/astropy-0.3.1/astropy/io/fits/card.py   astropy(Download)
import numpy as np
 
from .util import _str_to_num, _is_int, maketrans, translate, _words_group
from .verify import _Verify, _ErrList, VerifyError, VerifyWarning
 
 
 
FIX_FP_TABLE = maketrans('de', 'DE')
FIX_FP_TABLE2 = maketrans('dD', 'eE')
 

src/m/i/mikroe-uhb-0.2/mikroeuhb/devkit.py   mikroe-uhb(Download)
import struct, logging
from util import hexlify, maketrans, bord
from device import Device, Command, HID_buf_size
logger = logging.getLogger(__name__)
 
        orig = ''.join([chr(a+i) for i in xrange(max_c)])
        field = bin(field)[2:].rjust(max_c, '0')
        template = template.translate(maketrans(orig, field))
    instruction = int(template, 2)
    instruction = struct.pack(endianness + _map[len(template)], instruction)