def hex(x):
    '''
    x-->bytes | bytearray
    Returns-->bytes: hex-encoded
    '''
    if isinstance(x, bytearray):
        x = bytes(x)
    return encode(x, 'hex')
def hex ( x ) : if isinstance ( x , bytearray ) : x = bytes ( x ) return encode ( x , 'hex' )
x-->bytes | bytearray
    Returns-->bytes: hex-encoded