<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_host_lock(url):
 """Get lock object for given URL host."""

    hostname = get_hostname(url)
    return host_locks.setdefault(hostname, threading.Lock())