def gen_cjk(length=10):
    """Returns a random string made up of CJK characters.
    (Source: Wikipedia - CJK Unified Ideographs)

    :param int length: Length for random data.
    :returns: A random string made up of CJK characters.
    :rtype: str

    """

    # Validate length argument
    _is_positive_int(length)

    random.seed()

    # Generate codepoints, then convert the codepoints to a string. The
    # valid range of CJK codepoints is 0x4E00 - 0x9FCC, inclusive. Python 2
    # and 3 support the `unichr` and `chr` functions, respectively.
    codepoints = [random.randint(0x4E00, 0x9FCC) for _ in range(length)]
    if sys.version_info[0] == 2:
        # pylint:disable=undefined-variable
        output = u''.join(unichr(codepoint) for codepoint in codepoints)
    else:
        output = u''.join(chr(codepoint) for codepoint in codepoints)
    return _make_unicode(output)
dataset/ETHPy150Open omaciel/fauxfactory/fauxfactory/__init__.py/gen_cjk/original