code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
# ==================================================================
# Copyright (c) 2007,2008,2009 Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistribut... | Python |
#!/usr/bin/env python
# ==================================================================
# Copyright (c) 2007,2008,2009 Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are me... | Python |
# ==================================================================
# Copyright (c) 2007,2008,2009 Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistribut... | Python |
# ==================================================================
# Copyright (c) 2007,2008,2009 Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistribut... | Python |
#!/usr/bin/env python
# ==================================================================
# Copyright (c) 2007,2008,2009 Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are me... | Python |
# ==================================================================
# Copyright (c) 2007,2008,2009 Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistribut... | Python |
#!/usr/bin/python
# ========================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# ... | Python |
# ========================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistribution... | Python |
import sys
from freebase.api.session import HTTPMetawebSession
import sandbox
__all__ = ["HTTPMetawebSession", "sandbox"]
_base = HTTPMetawebSession("freebase.com")
# we want to add base's functions to __init__.py
# so that we can say freebase.func() and really
# just call base.func()
# a little trick to refer to ... | Python |
#
# rison for python (parser only so far)
# see http://mjtemplate.org/examples/rison.html for more info
#
######################################################################
#
# the rison parser is based on javascript openlaszlo-json:
# Author: Oliver Steele
# Copyright: Copyright 2006 Oliver Steele. All... | Python |
"""Parse (absolute and relative) URLs.
See RFC 1808: "Relative Uniform Resource Locators", by R. Fielding,
UC Irvine, June 1995.
"""
__all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag",
"urlsplit", "urlunsplit"]
# A classification of schemes ('' means apply by default)
uses_relative = ['ftp', 'htt... | Python |
"""HTTP cookie handling for web clients.
This module has (now fairly distant) origins in Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.
Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Pyth... | Python |
always_safe = ('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
'abcdefghijklmnopqrstuvwxyz'
'0123456789' '_.-')
_safemaps = {}
def quote(s, safe = '/'):
"""quote('abc def') -> 'abc%20def'
Each part of a URL, e.g. the path info, the query, etc., has a
different set of reserved characters that mu... | Python |
#!/usr/bin/python
# ========================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# ... | Python |
#!/usr/bin/python
# ========================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# ... | Python |
import os
import os.path
import getpass
import freebase
from freebase.api.session import MetawebError
passwordfile = "test/.password.txt"
def main(create_password_file=False):
USERNAME, PASSWORD = "", ""
if not os.path.isfile(passwordfile):
print "In order to run the tests, we need to use a vali... | Python |
import unittest
import os
import os.path
import freebase
import getlogindetails
def main():
created = False
passwordfile = "test/.password.txt"
# setup password stuff
if not os.path.isfile(passwordfile):
created = True
USERNAME, PASSWORD = getlogindetails.main(create_password_fi... | Python |
#!/usr/bin/python
# ========================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# ... | Python |
#========================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistribution... | Python |
try:
from google.appengine.api import urlfetch
from cookie_handlers import CookiefulUrlfetch
except:
pass
try:
import httplib2
from cookie_handlers import CookiefulHttp
except:
pass
try:
import urllib2
import socket
except:
pass
import logging
import re
class Urllib2Client(object... | Python |
# ========================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistribution... | Python |
# ==================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of s... | Python |
# ========================================================================
# Copyright (c) 2007, Metaweb Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistribution... | Python |
from session import HTTPMetawebSession, MetawebError, attrdict, LITERAL_TYPE_IDS
from mqlkey import quotekey, unquotekey | Python |
from copy import deepcopy
import sys
from freebase.api.session import HTTPMetawebSession, MetawebError
from freebase.api.session import LITERAL_TYPE_IDS
"""
NOTE
----
graph is used freely in this file. Some information:
- It refers to an internal representation of a group of types.
- It resembles a mqlread result, b... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.