def get_string(input_text, encoding='utf-8'):
    """Get byte string representation of an object.

    :param input_text:  The input text.
    :type input_text: unicode, str, float, int

    :param encoding: The encoding used to do the conversion, default to utf-8.
    :type encoding: str

    :returns: Byte string representation of the input.
    :rtype: bytes
    """
    if isinstance(input_text, str):
        return input_text.encode(encoding)
    return input_text
Get byte string representation of an object.

    :param input_text:  The input text.
    :type input_text: unicode, str, float, int

    :param encoding: The encoding used to do the conversion, default to utf-8.
    :type encoding: str

    :returns: Byte string representation of the input.
    :rtype: bytes