jacquev6/PyGithub — pull request #220 by cameronbwhite (2013-12-19 12:20:48+00:00)
Title: Added onetime_password to create_authorization

## About

github.AuthenticatedUser.create_authorization has been modified to
support two-factor authentication. When two-factor authentication
is enabled create_authorization will throw an TwoFactorException.
The onetime password can be then be passed to create_authorization
on a subsequent call.

## Usage

Below is an example of how to login when two-factor authorization is enabled.

```python
from github import Github

g = Github(username, password)
user = g.get_user()
try:
authorization = user.create_authorization(scopes=['repo'], note='test')
except TwoFactorError:
authorization = user.create_authorization(
scopes=['repo'], note='test', onetime_password=password)

g = Github(authorization.token)
```