<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_rtt( url: str, samples: int = 3, method: str = 'head', timeout: int = 1, ) -> Optional[float]: """ Determine the average HTTP RTT to `url` over the number of `samples`. Returns `None` if the server is unreachable. """

    durations = []
    for _ in range(samples):
        try:
            durations.append(
                requests.request(method, url, timeout=timeout).elapsed.total_seconds(),
            )
        except (RequestException, OSError):
            return None
        except Exception as ex:
            print(ex)
            return None
        # Slight delay to avoid overloading
        sleep(.125)
    return sum(durations) / samples