<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def send_config(config_file=None,
                config_commands=None,
                template_engine='jinja',
                commit=False,
                context=None,
                defaults=None,
                saltenv='base',
                **kwargs):
    '''
    Send configuration commands down the SSH channel.
    Return the configuration lines sent to the device.

    The function is flexible to send the configuration from a local or remote
    file, or simply the commands as list.

    config_file
        The source file with the configuration commands to be sent to the
        device.

        The file can also be a template that can be rendered using the template
        engine of choice.

        This can be specified using the absolute path to the file, or using one
        of the following URL schemes:

        - ``salt://``, to fetch the file from the Salt fileserver.
        - ``http://`` or ``https://``
        - ``ftp://``
        - ``s3://``
        - ``swift://``

    config_commands
        Multiple configuration commands to be sent to the device.

        .. note::

            This argument is ignored when ``config_file`` is specified.

    template_engine: ``jinja``
        The template engine to use when rendering the source file. Default:
        ``jinja``. To simply fetch the file without attempting to render, set
        this argument to ``None``.

    commit: ``False``
        Commit the configuration changes before exiting the config mode. This
        option is by default disabled, as many platforms don't have this
        capability natively.

    context
        Variables to add to the template context.

    defaults
        Default values of the context_dict.

    exit_config_mode: ``True``
        Determines whether or not to exit config mode after complete.

    delay_factor: ``1``
        Factor to adjust delays.

    max_loops: ``150``
        Controls wait time in conjunction with delay_factor (default: ``150``).

    strip_prompt: ``False``
        Determines whether or not to strip the prompt (default: ``False``).

    strip_command: ``False``
        Determines whether or not to strip the command (default: ``False``).

    config_mode_command
        The command to enter into config mode.

    CLI Example:

    .. code-block:: bash

        salt '*' netmiko.send_config config_commands="['interface GigabitEthernet3', 'no ip address']"
        salt '*' netmiko.send_config config_commands="['snmp-server location {{ grains.location }}']"
        salt '*' netmiko.send_config config_file=salt://config.txt
        salt '*' netmiko.send_config config_file=https://bit.ly/2sgljCB device_type='cisco_ios' ip='1.2.3.4' username='example'
    '''
    if config_file:
        file_str = __salt__['cp.get_file_str'](config_file, saltenv=saltenv)
        if file_str is False:
            raise CommandExecutionError('Source file {} not found'.format(config_file))
    elif config_commands:
        if isinstance(config_commands, (six.string_types, six.text_type)):
            config_commands = [config_commands]
        file_str = '\n'.join(config_commands)
        # unify all the commands in a single file, to render them in a go
    if template_engine:
        file_str = __salt__['file.apply_template_on_contents'](file_str,
                                                               template_engine,
                                                               context,
                                                               defaults,
                                                               saltenv)
    # whatever the source of the commands would be, split them line by line
    config_commands = [line for line in file_str.splitlines() if line.strip()]
    kwargs = clean_kwargs(**kwargs)
    if 'netmiko.conn' in __proxy__:
        conn = __proxy__['netmiko.conn']()
    else:
        conn, kwargs = _prepare_connection(**kwargs)
    if commit:
        kwargs['exit_config_mode'] = False  # don't exit config mode after
        # loading the commands, wait for explicit commit
    ret = conn.send_config_set(config_commands=config_commands, **kwargs)
    if commit:
        ret += conn.commit()
    return ret