def getMyPlexAccount(opts=None):  
from plexapi import CONFIG<EOL>from plexapi.myplex import MyPlexAccount<EOL>if opts and opts.username and opts.password:<EOL><INDENT>print('<STR_LIT>' % opts.username)<EOL>return MyPlexAccount(opts.username, opts.password)<EOL><DEDENT>config_username = CONFIG.get('<STR_LIT>')<EOL>config_password = CONFIG.get('<STR_LIT>')<EOL>if config_username and config_password:<EOL><INDENT>print('<STR_LIT>' % config_username)<EOL>return MyPlexAccount(config_username, config_password)<EOL><DEDENT>username = input('<STR_LIT>')<EOL>password = getpass('<STR_LIT>')<EOL>print('<STR_LIT>' % username)<EOL>return MyPlexAccount(username, password)<EOL>
Helper function tries to get a MyPlex Account instance by checking
        the the following locations for a username and password. This is
        useful to create user-friendly command line tools.
        1. command-line options (opts).
        2. environment variables and config.ini
        3. Prompt on the command line.