<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _add_apt_repository(spec):
 """Add the spec using add_apt_repository :param spec: the parameter to pass to add_apt_repository :type spec: str """

    if '{series}' in spec:
        series = get_distrib_codename()
        spec = spec.replace('{series}', series)
    # software-properties package for bionic properly reacts to proxy settings
    # passed as environment variables (See lp:1433761). This is not the case
    # LTS and non-LTS releases below bionic.
    _run_with_retries(['add-apt-repository', '--yes', spec],
                      cmd_env=env_proxy_settings(['https']))