Process the parsed command.

    Parameters
    ----------
    twis: Pytwis
        A Pytwis instance which interacts with the Redis database of the Twitter toy clone.
    auth_secret: str
        The authentication secret of a logged-in user.
    args:
        The parsed command output by pytwis_command_parser().

def pytwis_command_processor(twis, auth_secret, args):
    """Process the parsed command.

    Parameters
    ----------
    twis: Pytwis
        A Pytwis instance which interacts with the Redis database of the Twitter toy clone.
    auth_secret: str
        The authentication secret of a logged-in user.
    args:
        The parsed command output by pytwis_command_parser().
    """
    command = args[pytwis_clt_constants.ARG_COMMAND]

    if command == pytwis_clt_constants.CMD_REGISTER:
        succeeded, result = twis.register(args[pytwis_clt_constants.ARG_USERNAME],
                                          args[pytwis_clt_constants.ARG_PASSWORD])
        if succeeded:
            print('Registered {}'.format(args[pytwis_clt_constants.ARG_USERNAME]))
        else:
            print("Couldn't register {} with error = {}".\
                  format(args[pytwis_clt_constants.ARG_USERNAME],
                         result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_LOGIN:
        succeeded, result = twis.login(args[pytwis_clt_constants.ARG_USERNAME],
                                       args[pytwis_clt_constants.ARG_PASSWORD])
        if succeeded:
            auth_secret[0] = result[pytwis_constants.AUTH_KEY]
            print('Logged into username {}'.format(args[pytwis_clt_constants.ARG_USERNAME]))
        else:
            print("Couldn't log into username {} with error = {}".\
                  format(args[pytwis_clt_constants.ARG_USERNAME],
                         result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_LOGOUT:
        succeeded, result = twis.logout(auth_secret[0])
        if succeeded:
            auth_secret[0] = result[pytwis_constants.AUTH_KEY]
            print('Logged out of username {}'.format(result[pytwis_constants.USERNAME_KEY]))
        else:
            print("Couldn't log out with error = {}".format(result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_CHANGE_PASSWORD:
        succeeded, result = twis.change_password(auth_secret[0],
                                                 args[pytwis_clt_constants.ARG_OLD_PASSWORD],
                                                 args[pytwis_clt_constants.ARG_NEW_PASSWORD])
        if succeeded:
            auth_secret[0] = result[pytwis_constants.AUTH_KEY]
            print('Changed the password')
        else:
            print("Couldn't change the password with error = {}".\
                  format(result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_GET_USER_PROFILE:
        succeeded, result = twis.get_user_profile(auth_secret[0])
        if succeeded:
            print('Got the user profile')
            print('=' * 20)
            for key, value in result.items():
                print('{}: {}'.format(key, value))
            print('=' * 20)
        else:
            print("Couldn't get the user profile with error = {}".\
                  format(result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_POST:
        succeeded, result = twis.post_tweet(auth_secret[0], args['tweet'])
        if succeeded:
            print('Posted the tweet')
        else:
            print("Couldn't post the tweet with error = {}".\
                  format(result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_FOLLOW:
        succeeded, result = twis.follow(auth_secret[0],
                                        args[pytwis_clt_constants.ARG_FOLLOWEE])
        if succeeded:
            print('Followed username {}'.format(args[pytwis_clt_constants.ARG_FOLLOWEE]))
        else:
            print("Couldn't follow the username {} with error = {}".\
                  format(args[pytwis_clt_constants.ARG_FOLLOWEE],
                         result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_UNFOLLOW:
        succeeded, result = twis.unfollow(auth_secret[0],
                                          args[pytwis_clt_constants.ARG_FOLLOWEE])
        if succeeded:
            print('Unfollowed username {}'.format(args[pytwis_clt_constants.ARG_FOLLOWEE]))
        else:
            print("Couldn't unfollow the username {} with error = {}".\
                  format(args[pytwis_clt_constants.ARG_FOLLOWEE],
                         result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_GET_FOLLOWERS:
        succeeded, result = twis.get_followers(auth_secret[0])
        if succeeded:
            print('Got the list of {} followers'.\
                  format(len(result[pytwis_constants.FOLLOWER_LIST_KEY])))
            print('=' * 20)
            for follower in result[pytwis_constants.FOLLOWER_LIST_KEY]:
                print('\t' + follower)
            print('=' * 20)
        else:
            print("Couldn't get the follower list with error = {}".\
                  format(result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_GET_FOLLOWINGS:
        succeeded, result = twis.get_following(auth_secret[0])
        if succeeded:
            print('Got the list of {} followings'.\
                  format(len(result[pytwis_constants.FOLLOWING_LIST_KEY])))
            print('=' * 60)
            for following in result[pytwis_constants.FOLLOWING_LIST_KEY]:
                print('\t' + following)
            print('=' * 60)
        else:
            print("Couldn't get the following list with error = {}".\
                  format(result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_TIMELINE:
        succeeded, result = twis.get_timeline(auth_secret[0],
                                              args[pytwis_clt_constants.ARG_MAX_TWEETS])
        if succeeded:
            if auth_secret[0] != '':
                print('Got {} tweets in the user timeline'.\
                      format(len(result[pytwis_constants.TWEETS_KEY])))
            else:
                print('Got {} tweets in the general timeline'.\
                      format(len(result[pytwis_constants.TWEETS_KEY])))
            print_tweets(result[pytwis_constants.TWEETS_KEY])
        else:
            if auth_secret[0] != '':
                print("Couldn't get the user timeline with error = {}".\
                      format(result[pytwis_constants.ERROR_KEY]))
            else:
                print("Couldn't get the general timeline with error = {}".\
                      format(result[pytwis_constants.ERROR_KEY]))
    elif command == pytwis_clt_constants.CMD_GET_USER_TWEETS:
        # Get the username of the currently logged-in user if no username is given.
        if args[pytwis_clt_constants.ARG_USERNAME] is None:
            succeeded, result = twis.get_user_profile(auth_secret[0])
            if succeeded:
                args[pytwis_clt_constants.ARG_USERNAME] = result[pytwis_constants.USERNAME_KEY]
                print('No username is given, so use the currently logged-in user {}'.\
                      format(args[pytwis_clt_constants.ARG_USERNAME]))
            else:
                print("Couldn't get the username of the currently logged-in user with error = {}".\
                      format(result[pytwis_constants.ERROR_KEY]))
                return

        succeeded, result = twis.get_user_tweets(auth_secret[0],
                                                 args[pytwis_clt_constants.ARG_USERNAME],
                                                 args[pytwis_clt_constants.ARG_MAX_TWEETS])
        if succeeded:
            print('Got {} tweets posted by {}'.format(len(result[pytwis_constants.TWEETS_KEY]),
                                                      args[pytwis_clt_constants.ARG_USERNAME]))
            print_tweets(result[pytwis_constants.TWEETS_KEY])
        else:
            print("Couldn't get the tweets posted by {} with error = {}".\
                  format(args[pytwis_clt_constants.ARG_USERNAME],
                         result[pytwis_constants.ERROR_KEY]))
    else:
        pass