def _generate_code_verifier():
    "\n    Generates a 'code_verifier' as described in https://tools.ietf.org/html/rfc7636#section-4.1\n    Adapted from https://github.com/openstack/deb-python-oauth2client/blob/master/oauth2client/_pkce.py.\n    :return str:\n    "
    code_verifier = _base64.urlsafe_b64encode(_os.urandom(_code_verifier_length)).decode(_utf_8)
    code_verifier = _re.sub('[^a-zA-Z0-9_\\-.~]+', '', code_verifier)
    if (len(code_verifier) < 43):
        raise ValueError('Verifier too short. number of bytes must be > 30.')
    elif (len(code_verifier) > 128):
        raise ValueError('Verifier too long. number of bytes must be < 97.')
    return code_verifier
Generates a 'code_verifier' as described in https://tools.ietf.org/html/rfc7636#section-4.1
Adapted from https://github.com/openstack/deb-python-oauth2client/blob/master/oauth2client/_pkce.py.
:return str:
def _generate_code_verifier():
    "\n    Generates a 'code_verifier' as described in https://tools.ietf.org/html/rfc7636#section-4.1\n    Adapted from https://github.com/openstack/deb-python-oauth2client/blob/master/oauth2client/_pkce.py.\n    :return str:\n    "
    code_verifier = _base64.urlsafe_b64encode(_os.urandom(_code_verifier_length)).decode(_utf_8)
    code_verifier = _re.sub('[^a-zA-Z0-9_\\-.~]+', , code_verifier)
    if (len(code_verifier) < 43):
        raise ValueError('Verifier too short. number of bytes must be > 30.')
    elif (len(code_verifier) > 128):
        raise ValueError('Verifier too long. number of bytes must be < 97.')
    return code_verifier