r"""Return a random byte string containing *nbytes* bytes.

    Raises ValueError if nbytes <= 0, and TypeError if it's not an integer.

    >>> randbytes(16)  #doctest:+SKIP
    b'\\xebr\\x17D*t\\xae\\xd4\\xe3S\\xb6\\xe2\\xebP1\\x8b'

def randbytes(nbytes: int) -> bytes:
    r"""Return a random byte string containing *nbytes* bytes.

    Raises ValueError if nbytes <= 0, and TypeError if it's not an integer.

    >>> randbytes(16)  #doctest:+SKIP
    b'\\xebr\\x17D*t\\xae\\xd4\\xe3S\\xb6\\xe2\\xebP1\\x8b'

    """
    if not isinstance(nbytes, int):
        raise TypeError('number of bytes shoud be an integer')
    if nbytes <= 0:
        raise ValueError('number of bytes must be greater than zero')

    return _urandom(nbytes)