(
        config_dict: Optional[Dict[Text, Any]] = None,
        config_path: Optional[Text] = '',
        config_section: Optional[Text] = 'timesketch',
        token_password: Optional[Text] = '',
        confirm_choices: Optional[bool] = False,
        load_cli_config: Optional[bool] = False
        )
Returns a Timesketch API client using the configuration assistant.

    Args:
        config_dict (dict): optional dict that will be used to configure
            the client.
        config_path (str): optional path to the configuration file, if
            not supplied a default path will be used.
        config_section (str): The configuration section to read from. This
            is optional and defaults to timesketch. This can be
            useful if you have multiple Timesketch servers to connect to,
            with each one of them having a separate section in the config
            file.
        token_password (str): an optional password to decrypt
            the credential token file.
        confirm_choices (bool): an optional bool. if set to the user is given
            a choice to change the value for all already configured parameters.
            This defaults to False.
        load_cli_config (bool): Determine if the CLI config section should
            be loaded. This is optional and defaults to False.

    Returns:
        A timesketch client (TimesketchApi) or None if not possible.
Returns a Timesketch API client using the configuration assistant.
Returns a Timesketch API client using the configuration assistant .
def get_client(
        config_dict: Optional[Dict[Text, Any]] = None,
        config_path: Optional[Text] = '',
        config_section: Optional[Text] = 'timesketch',
        token_password: Optional[Text] = '',
        confirm_choices: Optional[bool] = False,
        load_cli_config: Optional[bool] = False
        ) -> Optional[client.TimesketchApi]:
    """Returns a Timesketch API client using the configuration assistant.

    Args:
        config_dict (dict): optional dict that will be used to configure
            the client.
        config_path (str): optional path to the configuration file, if
            not supplied a default path will be used.
        config_section (str): The configuration section to read from. This
            is optional and defaults to timesketch. This can be
            useful if you have multiple Timesketch servers to connect to,
            with each one of them having a separate section in the config
            file.
        token_password (str): an optional password to decrypt
            the credential token file.
        confirm_choices (bool): an optional bool. if set to the user is given
            a choice to change the value for all already configured parameters.
            This defaults to False.
        load_cli_config (bool): Determine if the CLI config section should
            be loaded. This is optional and defaults to False.

    Returns:
        A timesketch client (TimesketchApi) or None if not possible.
    """
    assistant = ConfigAssistant()
    try:
        assistant.load_config_file(
            config_path, section=config_section,
            load_cli_config=load_cli_config)
        if config_dict:
            assistant.load_config_dict(config_dict)
    except IOError as e:
        logger.error('Unable to load the config file, is it valid?')
        logger.error('Error: %s', e)

    try:
        configure_missing_parameters(
            config_assistant=assistant,
            token_password=token_password,
            confirm_choices=confirm_choices,
            config_section=config_section)
        return assistant.get_client(token_password=token_password)
    except (RuntimeError, requests.ConnectionError) as e:
        logger.error(
            'Unable to connect to the Timesketch server, are you '
            'connected to the network? Is the timesketch server '
            'running and accessible from your host? The error '
            'message is %s', e)
    except IOError as e:
        logger.error('Unable to get a client, with error: %s', e)
        logger.error(
            'If the issue is in the credentials then one solution '
            'is to remove the ~/.timesketch.token file and the '
            'credential section in ~/.timesketchrc or to remove '
            'both files. Or you could have supplied a wrong '
            'password to undecrypt the token file.')
def get_client ( config_dict : Optional [ Dict [ Text , Any ] ] = None , config_path : Optional [ Text ] = '' , config_section : Optional [ Text ] = 'timesketch' , token_password : Optional [ Text ] = '' , confirm_choices : Optional [ bool ] = False , load_cli_config : Optional [ bool ] = False ) -> Optional [ client . TimesketchApi ] : assistant = ConfigAssistant ( ) try : assistant . load_config_file ( config_path , section = config_section , load_cli_config = load_cli_config ) if config_dict : assistant . load_config_dict ( config_dict ) except IOError as e : logger . error ( 'Unable to load the config file, is it valid?' ) logger . error ( 'Error: %s' , e ) try : configure_missing_parameters ( config_assistant = assistant , token_password = token_password , confirm_choices = confirm_choices , config_section = config_section ) return assistant . get_client ( token_password = token_password ) except ( RuntimeError , requests . ConnectionError ) as e : logger . error ( 'Unable to connect to the Timesketch server, are you ' 'connected to the network? Is the timesketch server ' 'running and accessible from your host? The error ' 'message is %s' , e ) except IOError as e : logger . error ( 'Unable to get a client, with error: %s' , e ) logger . error ( 'If the issue is in the credentials then one solution ' 'is to remove the ~/.timesketch.token file and the ' 'credential section in ~/.timesketchrc or to remove ' 'both files. Or you could have supplied a wrong ' 'password to undecrypt the token file.' )