def get(url, session=None, silent=not debug, **kwargs):
    """Retrieve a given URL and log response.

    :param session: a :class:`requests.Session` object.
    :param silent: if **True**, response status and URL will not be printed.
    """
    session = session or requests
    kwargs["verify"] = kwargs.get("verify", True)
    r = session.get(url, **kwargs)
    if not silent:
        status_code = click.style(
            str(r.status_code),
            fg="green" if r.status_code in (200, 304) else "red")
        click.echo(status_code + " " + url)
        if r.status_code == 404:
            raise PackageNotFoundError
    return r
def _add_implementor(rpc_code, blocking, fn):

    # Validate the argument types.
    if type(rpc_code) is not int:
        raise TypeError("Expected int, got %r instead" % type(rpc_code))
    if type(blocking) is not bool:
        raise TypeError("Expected bool, got %r instead" % type(blocking))
    if not callable(fn):
        raise TypeError("Expected callable, got %r instead" % type(fn))

    # Validate the RPC code.
    if rpc_code in rpcMap:
        try:
            msg = "Duplicated RPC implementors for code %d: %s and %s"
            msg %= (rpc_code, rpcMap[rpc_code][0].__name__, fn.__name__)
        except Exception:
            msg = "Duplicated RPC implementors for code: %d" % rpc_code
        raise SyntaxError(msg)

    # TODO: use introspection to validate the function signature

    # Register the implementor.
    rpcMap[rpc_code] = (fn, blocking)

    # Return the implementor. No wrapping is needed! :)
    return fn