'Instantiate a new twitter.Api object.
Args:
consumer_key:
Your Twitter user\'s consumer_key.
consumer_secret:
Your Twitter user\'s consumer_secret.
access_token_key:
The oAuth access token key value you retrieved
from running get_access_token.py.
access_token_secret:
The oAuth access token\'s secret, also retrieved
from the get_access_token.py run.
input_encoding:
The encoding used to encode input strings. [Optional]
request_header:
A dictionary of additional HTTP request headers. [Optional]
cache:
The cache instance to use. Defaults to DEFAULT_CACHE.
Use None to disable caching. [Optional]
shortner:
The shortner instance to use.  Defaults to None.
See shorten_url.py for an example shortner. [Optional]
base_url:
The base URL to use to contact the Twitter API.
Defaults to https://api.twitter.com. [Optional]
use_gzip_compression:
Set to True to tell enable gzip compression for any call
made to Twitter.  Defaults to False. [Optional]
debugHTTP:
Set to True to enable debug output from urllib2 when performing
any HTTP requests.  Defaults to False. [Optional]'

def __init__(self, consumer_key=None, consumer_secret=None, access_token_key=None, access_token_secret=None, input_encoding=None, request_headers=None, cache=DEFAULT_CACHE, shortner=None, base_url=None, use_gzip_compression=False, debugHTTP=False):

    self.SetCache(cache)
    self._urllib = urllib2
    self._cache_timeout = Api.DEFAULT_CACHE_TIMEOUT
    self._input_encoding = input_encoding
    self._use_gzip = use_gzip_compression
    self._debugHTTP = debugHTTP
    self._oauth_consumer = None
    self._shortlink_size = 19
    self._InitializeRequestHeaders(request_headers)
    self._InitializeUserAgent()
    self._InitializeDefaultParameters()
    if (base_url is None):
        self.base_url = 'https://api.twitter.com/1.1'
    else:
        self.base_url = base_url
    if ((consumer_key is not None) and ((access_token_key is None) or (access_token_secret is None))):
        print >>sys.stderr, 'Twitter    now    requires    an    oAuth    Access    Token    for    API    calls.'
        print >>sys.stderr, 'If    your    using    this    library    from    a    command    line    utility,    please'
        print >>sys.stderr, 'run    the    the    included    get_access_token.py    tool    to    generate    one.'
        raise TwitterError('Twitter    requires    oAuth    Access    Token    for    all    API    access')
    self.SetCredentials(consumer_key, consumer_secret, access_token_key, access_token_secret)
