code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Natural Language Toolkit: Toolbox Settings Parser
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Greg Aumann <greg_aumann@sil.org>/Stuart Robinson <stuart@zapata.org>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This module... | Python |
# Natural Language Toolkit: Shoebox Text
#
# Author: Stuart Robinson <stuart@zapata.org>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This module provides tools for parsing and manipulating the contents
of a Shoebox text without reference to its metadata.
"""
import re
from utilities imp... | Python |
# __all__ = ["data", "errors", "lexicon", "settings", "text", "utilities"]
from data import *
| Python |
# Natural Language Toolkit: Brill Tagger
#
# Copyright (C) 2001-2005 University of Pennsylvania
# Authors: Christopher Maloof <cjmaloof@gradient.cis.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LI... | Python |
"""
This module provides utilities for treating Python dictionaries as X{feature
structures}. Specifically, it contains the C{unify} function, which can be used
to merge the properties of two dictionaries, and the C{Variable} class, which
holds an unknown value to be used in unification.
A X{feature structure} is a ma... | Python |
# Contributed by Peter Wang
from en.parser.nltk_lite import tokenize
from en.parser.nltk_lite.parse.featurechart import *
from en.parser.nltk_lite.parse.grammarfile import GrammarFile
from en.parser.nltk_lite.draw.tree import draw_trees
from en.parser.nltk_lite.parse import bracket_parse
from en.parser.nltk_lite.parse... | Python |
# New lambda system (Steven Bird)
class Lambda:
def __init__(self, *args):
if isinstance(args[0], str):
if len(args) == 1:
self._var = args[0]
self._type = 'v'
else:
self._var = args[0]
self._term = args[1]
... | Python |
import math
import os
# tagger importing
from en.parser.nltk_lite import tag
from en.parser.nltk_lite.tag import SequentialBackoff
# work-around while marshal is not moved into standard tree
from en.parser.nltk_lite.contrib.marshal import MarshalDefault ; Default = MarshalDefault
from en.parser.nltk_lite.contrib.marsh... | Python |
# Natural Language Toolkit: Kimmo Morphological Analyzer
#
# Copyright (C) 2001-2006 MIT
# Author: Carl de Marcken <carl@demarcken.org>
# Beracah Yankama <beracah@mit.edu>
# Robert Berwick <berwick@ai.mit.edu>
#
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Kimmo Morphologi... | Python |
# Natural Language Toolkit: Paradigm Visualisation
#
# Copyright (C) 2005 University of Melbourne
# Author: Will Hardy
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
# Front end to a Python implementation of David
# Penton's paradigm visualisation model.
# Author:
#
# Run: To run, first load a... | Python |
# Natural Language Toolkit: Concordance System
#
# Copyright (C) 2005 University of Melbourne
# Author: Peter Spiller
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parser.nltk_lite.corpora import brown
from math import *
import re
from en.parser.nltk_lite.probability import *
class Se... | Python |
# Natural Language Toolkit: Tokenizers
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# Trevor Cohn <tacohn@csse.unimelb.edu.au>
# URL: <http://nltk.sourceforge.net>
# For license information, see LICE... | Python |
# Natural Language Toolkit: Simple Tokenizers
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# Trevor Cohn <tacohn@csse.unimelb.edu.au>
# URL: <http://nltk.sourceforge.net>
# For license information, s... | Python |
# Natural Language Toolkit: Tokenizers
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au> (minor additions)
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Functions for tokenizing text... | Python |
# Natural Language Toolkit: Penn Treebank Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parser.nltk_lite.corpora import get_bas... | Python |
# Natural Language Toolkit: Genesis Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
The Genesis Corpus.
This corpus has been ... | Python |
# Natural Language Toolkit: Stopwords Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Read tokens from the Stopwords Corpus.
"... | Python |
# Natural Language Toolkit: Presidential State of the Union Addres Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
C-Span State of the Union Address Corpus
Annual US presidential ad... | Python |
# Natural Language Toolkit: Sinica Treebank Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parser.nltk_lite.corpora import get_basedir
from en.parser.nltk_lite import tokenize
from en.... | Python |
# Natural Language Toolkit: Senseval 2 Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Steven Bird <sb@csse.unimelb.edu.au> (modifications)
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Read from the Senseval 2 Corpu... | Python |
# Natural Language Toolkit: Names Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Names Corpus, Version 1.3 (1994-03-29)
Copyr... | Python |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Natural Language Toolkit: Toolbox Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Greg Aumann <greg_aumann@sil.org>
# Stuart Robinson <Stuart.Robinson@mpi.nl>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For ... | Python |
# Natural Language Toolkit: PP Attachment Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Read lines from the Prepositional Ph... | Python |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Natural Language Toolkit: Toolbox Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Greg Aumann <greg_aumann@sil.org>
# Stuart Robinson <Stuart.Robinson@mpi.nl>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For ... | Python |
# Natural Language Toolkit: Genesis Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
The Carnegie Mellon Pronouncing Dictionary [cmudict.0.6]
ftp://ftp.cs.cmu.edu/project/speech/dict/... | Python |
# Natural Language Toolkit: IEER Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Corpus reader for the Information Extra... | Python |
# Natural Language Toolkit: CONLL Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Read chunk structures from the CONLL-2000 Co... | Python |
# Natural Language Toolkit: TIMIT Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Haejoong Lee <haejoong@ldc.upenn.edu>
# Steven Bird <sb@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Read tokens, phonemes and audio data from the NLTK T... | Python |
# Natural Language Toolkit: Corpus Readers
#
# Copyright (C) 2001-2005 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
import os, sys
def set_basedir(path):
"""
Se... | Python |
# Natural Language Toolkit: Brown Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Read tokens from the Brown Corpus.
Brown Co... | Python |
# Natural Language Toolkit: Gutenberg Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Read tokens from the NLTK Gutenberg Corp... | Python |
# Natural Language Toolkit: Wordlist Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
Read tokens from the Wordlist Corpus.
"""... | Python |
# Natural Language Toolkit: Presidential State of the Union Addres Corpus Reader
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@ldc.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
C-Span Inaugural Address Corpus
US presidential inaugural addresse... | Python |
# Natural Language Toolkit: Word Finder
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
# Simplified from PHP version by Robert Klein <brathna@gmail.com>
# http://fswordfinder.sourceforge.net/
... | Python |
# Natural Language Toolkit: List Sorting
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
This module provides a variety of list sorting algorithms, to
illustrate the many different algorithm... | Python |
# Natural Language Toolkit: Miscellaneous modules
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Author: Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
| Python |
# Natural Language Toolkit (NLTK-Lite)
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Authors: Steven Bird <sb@csse.unimelb.edu.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
NLTK-Lite is a collection of lightweight NLP ... | Python |
# PARSER - last updated for NodeBox 1.9.2
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
# The part-of-speech-tagger was adopted by Jason Wiener from Mark Watson:
# http://jasonwiener.wordpress.com/category/nlp/
# Based on Brill's lexicon.
# The chunker relies on NLTK from the Universi... | Python |
# QUANTIFY - last updated for NodeBox 1rc7
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
# Based on the Ruby Linguistics module by Michael Granger:
# http://www.deveiate.org/projects/Linguistics/wiki/English
from article import article
from numeral import spoken_number, thousands as ... | Python |
#!/usr/bin/env python
#
# Copyright 2007 John Wiseman <jjwiseman@yahoo.com>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to... | Python |
# PLURAL - last updated for NodeBox 1rc7
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
# Based on "An Algorithmic Approach to English Pluralization" by Damian Conway:
# http://www.csse.monash.edu.au/~damian/papers/HTML/Plurals.html
# Prepositions are used to solve things like
# "moth... | Python |
#!/usr/bin/env python
#
# Copyright 2007 John Wiseman <jjwiseman@yahoo.com>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to... | Python |
# Peter Norvig's spelling corrector, with adaptions for Python 2.3
# http://norvig.com/spell-correct.html
import os
import re
try: from collections import defaultdict
except:
from sets import Set as set
import copy
class defaultdict(dict):
"""Dictionary with a default value for unknown keys.
... | Python |
# COMMONSENSE - last updated for NodeBox 1.9.4
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
import numeral
import tags
import wordnet
import singular
# Connectives from a file somewhere in Darwin:
commonsense_connectives = [
"I", "the", "of", "and", "to", "a", "in", "that",
... | Python |
# TAGS - last updated for NodeBox 1rc7
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
tags_html = [
"!--", "!doctype", "a", "abbr", "acronym", "address",
"applet", "area", "b", "base", "basefont", "bdo",
"big", "blockquote", "body", "br", "button", "caption",
"center", ... | Python |
### CREDITS ##########################################################################################
# Copyright (c) 2007 Tom De Smedt.
# See LICENSE.txt for details.
__author__ = "Tom De Smedt"
__version__ = "1.9.4.2"
__copyright__ = "Copyright (c) 2007 Tom De Smedt"
__license__ = "GPL"
### NODEBOX ENGLISH... | Python |
# Put the en library in the same folder as your script so NodeBox can find
# the library. It takes some time to load all the data the first time.
try:
# This is the statement you normally use.
en = ximport("en")
except:
# But since these examples are "inside" the library
# we may need to try something d... | Python |
# SINGULAR - last updated for NodeBox 1.9.4
# Adapted from Bermi Ferrer's Inflector for Python:
# http://www.bermi.org/inflector/
# Copyright (c) 2006 Bermi Ferrer Martinez
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software to deal in this software without restriction, i... | Python |
# ORDINAL - last updated for NodeBox 1rc7
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
# Based on the Ruby Linguistics module by Michael Granger:
# http://www.deveiate.org/projects/Linguistics/wiki/English
ordinal_nth = {
0 : "th",
1 : "st",
2 : "nd",
3 : "rd",
... | Python |
# ARTICLE - last updated for NodeBox 1rc7
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
# Based on the Ruby Linguistics module by Michael Granger:
# http://www.deveiate.org/projects/Linguistics/wiki/English
article_rules = [
["euler|hour(?!i)|heir|honest|hono", "an"], ... | Python |
# NUMERAL - last updated for NodeBox 1rc7
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
# Based on "Numbers and plural words as spoken English" by Christopher Dunn:
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/413172
numerals = {
0: "zero",
1: "one",
2: "two"... | Python |
import knowledge
import nltk
import en
import random
class FactSpec(object):
fact = None
aspect = None
which = None
def __init__(self, fact=None, aspect=None, which=None):
self.fact = fact
self.aspect = aspect
self.which = which
def __str__(self):
return str(self.fact) + '.' + str(self.aspect... | Python |
from knowledge import Date
from knowledge import Person
from knowledge import Location
from knowledge import Group
from knowledge import Object
from knowledge import Event
from knowledge import Page
def getPage():
trevor = Person(name="trevor" , birth=Date(year=1988))
peter = Person(name="peter", birth=Date(y... | Python |
#!/usr/bin/env python2.4
import os, pickle
import nltk
import knowledge, parse
CATEGORIES = (
"General",
"People",
"Objects",
"Dates",
)
EXCLUDE = (
"Bad Cases",
)
CREATION_VERBS = (
'painted',
'paints',
'wrote',
'writes',
'built',
'builds',
'created',
'creates',
'sculpted',
'sculpts... | Python |
from present import FactSpec
from knowledge import Fact
from knowledge import Location
from knowledge import Person
from knowledge import Event
from knowledge import Group
from knowledge import Object
from knowledge import Date
import manage
import random
def debug(*strings):
return
for s in strings:
pri... | Python |
"""-----------------------------------------------------------------------------
manage.py
This module consists of 3 main components: the Behavior class hierarchy, the
definition of State, and the Manager class. manage.py chooses what type of
Behavior object to create and then passes this object(along with state and i... | Python |
import pickle, os, sys, re
import xml.dom.minidom, htmlentitydefs
import nltk
CATEGORIES = (
"General",
"People",
"Objects",
)
DATES = (
"Dates",
)
EXCLUDE = (
"Bad Cases",
"Finished",
)
def debug(*strings):
for s in strings:
print s,
print
fin = open(os.path.join("data", "pages.list"), 'r')
ca... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from server import *
if __name__ == "__main__":
try:
server = Server()
server.start()
except KeyboardInterrupt:
server.stop()
| Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
from cache import *
from connection import *
class Server:
"""
Cette classe représente le serveur proxy.
Celui-ci est en attente de connexions. Une fois qu'un client se connecte,
un objet Connection est créé et se charge de traiter sa requête... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import select
import datetime
from threading import Thread
BUFFER_SIZE = 8192
class Connection(Thread):
"""
Cette classe gère les connections client-proxy et proxy-serveur.
A chaque fois qu'un client se connecte au proxy, un thread est lancé
... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Cache:
"""
Cette classe représente le cache du proxy.
Elle bufferise toutes les requêtes passant par celui-ci.
"""
def __init__(self):
"""
Constructeur.
Initialise le buffer.
"""
self.pages = []
def ... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from server import *
if __name__ == "__main__":
try:
server = Server()
server.start()
except KeyboardInterrupt:
server.stop()
| Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import select
import datetime
from threading import Thread
BUFFER_SIZE = 8192
class Connection(Thread):
"""
Cette classe gère les connections client-proxy et proxy-serveur.
A chaque fois qu'un client se connecte au proxy, un thread est lancé
... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
from cache import *
from connection import *
class Server:
"""
Cette classe représente le serveur proxy.
Celui-ci est en attente de connexions. Une fois qu'un client se connecte,
un objet Connection est créé et se charge de traiter sa requête... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Cache:
"""
Cette classe représente le cache du proxy.
Elle bufferise toutes les requêtes passant par celui-ci.
"""
def __init__(self):
"""
Constructeur.
Initialise le buffer.
"""
self.pages = []
def ... | Python |
"""FlashTreePruner.py
by Peter Balogh (palexanderbalogh@yahoo.com)
August 1, 2007
designed to remove all unnecessary files and folders
from an exported source code tree of ActionScript files.
First: ONLY USE THIS ON AN EXPORTED TREE. Never use this on your actual project files, since IT DELETES LOTS OF THINGS.
Use E... | Python |
#!/usr/bin/env python
import logging
import os
import re
import time
import platform
from optparse import OptionParser
from subprocess import Popen, PIPE, STDOUT
from xmlrpclib import ServerProxy, Error
# -- createDaemon() code from: http://code.activestate.com/recipes/278731/
# Default daemon parameters.
# File mode ... | Python |
#!/usr/bin/env python
import logging
import os
import re
import time
import platform
from optparse import OptionParser
from subprocess import Popen, PIPE, STDOUT
from xmlrpclib import ServerProxy, Error
# -- createDaemon() code from: http://code.activestate.com/recipes/278731/
# Default daemon parameters.
# File mode ... | Python |
#!/usr/bin/env python
# Copyright (C) 2011 Victor Semionov <vsemionov@gmail.com>
# 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 source code must retain the above c... | Python |
#!/usr/bin/env python
# Copyright (C) 2011 Victor Semionov <vsemionov@gmail.com>
# 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 source code must retain the above c... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
#!/usr/bin/env python
#
# Copyright (c) 2002, Google 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 source code must retain the above copyright
# notice, this ... | Python |
#!/usr/bin/env python
# Copyright (c) 2010, Google 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 source code must retain the above copyright
# notice, this l... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Locked file interface that should work on Unix and Windows pythons.
This module first tries to use fcntl locking to ensure serialized access
to a file, then falls back on a lock file if that is unavialable.
Usage:
f = LockedFile('filename', 'r+b', 'rb')
f.... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
__version__ = "1.0c2"
| Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
__version__ = "1.0c2"
| Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | Python |
from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | 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.