def __init__(self, args=None, **kwargs):
<EOL>if isinstance(args, Namespace):<EOL><INDENT>kwargs.update({k: v for k, v in vars(args).items() if v is not None})<EOL><DEDENT>self._screen_name = kwargs.pop('<STR_LIT>', None)<EOL>level = logging.DEBUG if kwargs.pop('<STR_LIT>', None) else None<EOL>level = logging.ERROR if kwargs.get('<STR_LIT>', None) else level<EOL>self.logger = tbu_args.add_logger(kwargs.pop('<STR_LIT>', self._screen_name), level,<EOL>kwargs.pop('<STR_LIT>', None))<EOL>config = configure(self._screen_name, **kwargs)<EOL>self._config = {k: v for k, v in config.items() if k not in PROTECTED_INFO}<EOL>keys = {k: v for k, v in config.items() if k in PROTECTED_INFO}<EOL>if kwargs.get('<STR_LIT>', True):<EOL><INDENT>keys.update({<EOL>k: os.environ['<STR_LIT>' + k.upper()] for k in PROTECTED_INFO<EOL>if k not in keys and '<STR_LIT>' + k.upper() in os.environ<EOL>})<EOL><DEDENT>try:<EOL><INDENT>auth = tweepy.OAuthHandler(consumer_key=keys['<STR_LIT>'], consumer_secret=keys['<STR_LIT>'])<EOL>try:<EOL><INDENT>auth.set_access_token(<EOL>key=keys.get('<STR_LIT>', keys.get('<STR_LIT:key>', keys.get('<STR_LIT>'))),<EOL>secret=keys.get('<STR_LIT>', keys.get('<STR_LIT>'))<EOL>)<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>except KeyError:<EOL><INDENT>missing = [p for p in PROTECTED_INFO if p not in keys]<EOL>raise ValueError("<STR_LIT>".format(missing))<EOL><DEDENT>super(API, self).__init__(auth)<EOL>
Construct the tbu.API object.