<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_http_services(self, http_list):
 """ Returns a list of httpd.HttpService instances which describe the HTTP services that should be started. The is built from the settings.http section of the configuration. The first element of that section is adjusted according to parameters which have been passed into the legion. If settings.http is empty or missing but parameters are present, an httpd.HttpService instance will built using just the parameters and the returned list will contain just that entry. """

        log = self._params.get('log', self._discard)
        listen_param = self._params.get('http')
        services = []
        if len(http_list) > 0:
            for service in http_list:
                s = httpd.HttpService()
                for att in ['listen', 'allow_control', 'certfile', 'timeout']:
                    val = service.get(att)
                    if val is not None:
                        setattr(s, att,  _fmt_context(self._get(val), self._context))
                services.append(s)
        elif listen_param is not None:
            services.append(httpd.HttpService())
        if services:
            if listen_param is not None:
                log.debug("Service 0 listen from args: %s", listen_param)
                services[0].listen = listen_param
            val = self._params.get('control')
            if val is not None:
                log.debug("Service 0 control from args: %s", val)
                services[0].allow_control = val
            val = self._params.get('certfile')
            if val is not None:
                log.debug("Service 0 certfile from args: %s", val)
                services[0].certfile = val
        return services