def METHOD_NAME(url, token):
    req = urllib.request.Request(url)
    if token:
        req.add_header('Authorization', "token {}".format(token))
    try:
        rsp = urllib.request.urlopen(req)
        result = json.loads(rsp.read())
    except Exception as e:
        if hasattr(e, 'reason'):
            print('Failed to fetch URL {}: {}'.format(url, e.reason), file=sys.stderr)
        elif hasattr(e, 'code'):
            print('Failed to fetch URL {}: Code {}'.format(url, e.code), file=sys.stderr)
        return {}
    else:
        return result