:return: The email and api_key to use to connect to TagCube. This
                 function will try to get the credentials from:
                    * Command line arguments
                    * Environment variables
                    * Configuration file

                 It will return the first match, in the order specified above.

def get_credentials(cmd_args):
        """
        :return: The email and api_key to use to connect to TagCube. This
                 function will try to get the credentials from:
                    * Command line arguments
                    * Environment variables
                    * Configuration file

                 It will return the first match, in the order specified above.
        """
        # Check the cmd args, return if we have something here
        cmd_credentials = cmd_args.email, cmd_args.key
        if cmd_credentials != (None, None):
            cli_logger.debug('Using command line configured credentials')
            return cmd_credentials

        env_email, env_api_key = get_config_from_env()
        if env_email is not None:
            if env_api_key is not None:
                cli_logger.debug('Using environment configured credentials')
                return env_email, env_api_key

        cfg_email, cfg_api_key = parse_config_file()
        if cfg_email is not None:
            if cfg_api_key is not None:
                cli_logger.debug('Using .tagcube file configured credentials')
                return cfg_email, cfg_api_key

        raise ValueError(NO_CREDENTIALS_ERROR)