def __init__(<EOL>self, <EOL>consumer_key=None, <EOL>consumer_secret=None, <EOL>api_key=None, <EOL>api_base="<STR_LIT>"<EOL>):
self.consumer_key = consumer_key if consumer_key else api_key<EOL>self.consumer_secret = consumer_secret<EOL>self.api_base = api_base<EOL>if api_key:<EOL><INDENT>logging.warn("<STR_LIT>")<EOL><DEDENT>if self.consumer_secret:<EOL><INDENT>self.consumer = oauth2.Consumer(consumer_key, consumer_secret)<EOL>self.oauth_signature_method = oauth2.SignatureMethod_HMAC_SHA1()<EOL><DEDENT>else:<EOL><INDENT>self.consumer = None<EOL>logging.warn("<STR_LIT>")<EOL><DEDENT>
Construct a Session object to hold OAuth credentials. Provide an OAuth consumer 
key and consumer secret to use with the Factual API.

n.b. Providing only an api_key or only a consumer_key will fall back to 
     authenticating requests via the KEY query string parameter, skipping 
         OAuth entirely. This behavior is deprecated in the v3 API.