parameters: (urlpath)
return_statement: return '%s://%s' % (urlpath.scheme, site_host)
docstring: Takes a urlparse object and finds its approximate site.
  
    Site is defined as registered domain name + scheme. We approximate
    registered domain name by preserving the last 2 elements of the DNS
    name. This breaks for domains like co.uk.
docstring_summary: Takes a urlparse object and finds its approximate site.
docstring_tokens: Takes a urlparse object and finds its approximate site .
function: def get_site(urlpath):
    """Takes a urlparse object and finds its approximate site.
  
    Site is defined as registered domain name + scheme. We approximate
    registered domain name by preserving the last 2 elements of the DNS
    name. This breaks for domains like co.uk.
    """
    no_port = urlpath.netloc.split(':')[0]
    host_parts = no_port.split('.')
    site_host = '.'.join(host_parts[-2:])
    return '%s://%s' % (urlpath.scheme, site_host)
function_tokens: def get_site ( urlpath ) : no_port = urlpath . netloc . split ( ':' ) [ 0 ] host_parts = no_port . split ( '.' ) site_host = '.' . join ( host_parts [ - 2 : ] ) return '%s://%s' % ( urlpath . scheme , site_host )