rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
docs.first_empty = docs_slot_n | docs.state.first_empty = docs_slot_n | def _unindex_term(self, word, documents): """ Un-indexes the given term. The parameter 'documents' is a list with the numbers of the documents that must be un-indexed. """ if word: if self.children is None: self.load_children() | 3306566f148328e3a5e5f8ea571beb484fd98de2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3306566f148328e3a5e5f8ea571beb484fd98de2/IIndex.py |
return id | return str(id) | def checkid(id): """ Checks wether th id is or not a valid Zope id. If it is the id is returned, but stripped. If it is a bad id None is returned to signal the error. """ if isinstance(id, str): id = unicode(id, 'utf8') id = id.strip().translate(transmap).strip('_') # Check wether the id is empty if len(id) == 0: retu... | 0288b7f4e5bd61e9b9ce6b472f74540b24774120 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0288b7f4e5bd61e9b9ce6b472f74540b24774120/utils.py |
yield str(int(value)), 0 | yield unicode(int(value)), 0 | def Bool(value): yield str(int(value)), 0 | 3a33b39768429e94756226bcbd0dbbef33630134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3a33b39768429e94756226bcbd0dbbef33630134/Analysers.py |
yield value, 0 | yield unicode(value), 0 | def Keyword(value): if value: yield value, 0 | 3a33b39768429e94756226bcbd0dbbef33630134 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3a33b39768429e94756226bcbd0dbbef33630134/Analysers.py |
dict.__setitem__(self, key, value) | if key in self: old_value = self[key] if isinstance(old_value, list): old_value.append(value) else: value = [old_value, value] dict.__setitem__(self, key, value) else: dict.__setitem__(self, key, value) | def __init__(self, query): if query: for x in query.split('&'): x = urllib.unquote_plus(x) if x: key, value = x.split('=', 1) dict.__setitem__(self, key, value) | a6a08dc6d32a2c195647c7a13496ed6dd52ac6e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a6a08dc6d32a2c195647c7a13496ed6dd52ac6e1/generic.py |
return offset.resolve(uri.path) | value = offset.resolve(uri.path) return str(value) | def resolve_pointer(uri, offset): if not uri.scheme and not uri.authority: if uri.path.is_relative(): if uri.path or str(uri) == '.': # XXX Here we loss the query and fragment. return offset.resolve(uri.path) return URI.encode(uri) | 1fcd13d9c1448035bfc6c24984c75c59aa03620b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1fcd13d9c1448035bfc6c24984c75c59aa03620b/XHTML.py |
return self.form | if self.method in ('GET', 'HEAD'): return self.uri.query return self.body | def get_form(self): return self.form | b75e29c34c8e278077493c6e04f1ab996a905e7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/b75e29c34c8e278077493c6e04f1ab996a905e7b/request.py |
src_base = '%s/%s/database/' % (cwd, target) | src_base = os.path.join(cwd, target, 'database/') | def end_commit_on_success(self): target = self.target transaction = get_transaction() | 3af7dc8c16fb53f4075f5741b4f6781bc06a78c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3af7dc8c16fb53f4075f5741b4f6781bc06a78c4/server.py |
dst_base = '%s/%s/database.bak/' % (cwd, target) | dst_base = os.path.join(cwd, target, 'database.bak/') | def end_commit_on_success(self): target = self.target transaction = get_transaction() | 3af7dc8c16fb53f4075f5741b4f6781bc06a78c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3af7dc8c16fb53f4075f5741b4f6781bc06a78c4/server.py |
handler = get_handler('../examples/hello.txt.en') | handler = get_handler('hello.txt') | def test_get(self): handler = get_handler('../examples/hello.txt.en') self.assertEqual(handler.to_str(), 'hello world\n') | 05ad743166834b950b86d9122f51ac7dbc465d1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/05ad743166834b950b86d9122f51ac7dbc465d1f/test_handlers.py |
data = """ import A import A.B as AB from B.E import F from A.B import C as CC class E(AA, C): pass """ code_0 = """ import A import A.B as AB from A.B import C as CC class D(A.B.C): pass class E(AB.C): pass class F(CC): pass """ dot_0 = """ digraph G { rankdir=BT; "D" -> "A.B.C" "E" -> "A.B.C" "F" -> "A.B.C" }""... | def test_language(self): self.assertEqual(self.var.state.records[0].language, 'de') | 05ad743166834b950b86d9122f51ac7dbc465d1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/05ad743166834b950b86d9122f51ac7dbc465d1f/test_handlers.py | |
'class N(B):\n' ' pass\n' ) | 'class N(B):\n' ' pass\n' ) | def test0_class_diagram_from_python(self): data = ('from A import B\n' 'class N(B):\n' ' pass\n' ) handler = Python(memory.File(data)) dot = Dot() dot.class_diagram_from_python([handler]) res = dot.to_str() expect = ('digraph G {\n' 'rankdir=BT;\n' ' "N" -> "A.B"\n}') self.assertEqual(expect, res) | 05ad743166834b950b86d9122f51ac7dbc465d1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/05ad743166834b950b86d9122f51ac7dbc465d1f/test_handlers.py |
data = ( 'from A.B import C\n' 'from D import E\n' 'class M(C.D):\n' ' pass\n' 'class N(M, E.F.H):\n' ' pass\n' ) | data = ('from A.B import C\n' 'from D import E\n' 'class M(C.D):\n' ' pass\n' 'class N(M, E.F.H):\n' ' pass\n' ) | def test1_class_diagram_from_python(self): data = ( 'from A.B import C\n' 'from D import E\n' 'class M(C.D):\n' ' pass\n' 'class N(M, E.F.H):\n' ' pass\n' ) dot = Dot() handler = Python(memory.File(data)) dot.class_diagram_from_python([handler]) expect = ('digraph G {\n' 'rankdir=BT;\n' ' "M" -> "A.B.C.D"\n' ' "N"... | 05ad743166834b950b86d9122f51ac7dbc465d1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/05ad743166834b950b86d9122f51ac7dbc465d1f/test_handlers.py |
'class M(B):\n' ' pass\n' 'class N(B):\n' ' pass\n' ) | 'class M(B):\n' ' pass\n' 'class N(B):\n' ' pass\n' ) | def test2_class_diagram_from_python(self): data = ('from A import B\n' 'class M(B):\n' ' pass\n' 'class N(B):\n' ' pass\n' ) handler = Python(memory.File(data)) dot = Dot() dot.class_diagram_from_python([handler]) res = dot.to_str() expect = ('digraph G {\n' 'rankdir=BT;\n' ' "M" -> "A.B"\n' ' "N" -> "A.B"\n}') sel... | 05ad743166834b950b86d9122f51ac7dbc465d1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/05ad743166834b950b86d9122f51ac7dbc465d1f/test_handlers.py |
data = ( 'from A.B import C\n' 'from D import E\n' 'class M(C.D):\n' ' pass\n' ) | data = ('from A.B import C\n' 'from D import E\n' 'class M(C.D):\n' ' pass\n' ) | def test4_class_diagram_from_python(self): data = ( 'from A.B import C\n' 'from D import E\n' 'class M(C.D):\n' ' pass\n' ) handler = Python(memory.File(data)) dot = Dot() dot.class_diagram_from_python([handler]) res = dot.to_str() expect = ('digraph G {\n' 'rankdir=BT;\n' ' "M" -> "A.B.C.D"\n}' ) self.assertEqual(e... | 05ad743166834b950b86d9122f51ac7dbc465d1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/05ad743166834b950b86d9122f51ac7dbc465d1f/test_handlers.py |
if name == 'number' or name == 'columns': | if name in ('number', 'columns', 'parent', 'name'): | def __setattr__(self, name, value): if name == 'number' or name == 'columns': list.__setattr__(self, name, value) else: try: column = self.columns.index(name) except ValueError: message = "'%s' object has no attribute '%s'" raise AttributeError, message % (self.__class__.__name__, name) | 1dca8e418a442be9c2d4ed7fd5c06dbb0ff3c743 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1dca8e418a442be9c2d4ed7fd5c06dbb0ff3c743/itools_csv.py |
def _get_virtual_handler(self, segment): index = int(segment.name) return self.state.lines[index] | ## def _get_virtual_handler(self, segment): | 1dca8e418a442be9c2d4ed7fd5c06dbb0ff3c743 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1dca8e418a442be9c2d4ed7fd5c06dbb0ff3c743/itools_csv.py | |
return container.cache.keys() | return container._get_handler_names() def _get_handler_names(self): return self.cache.keys() | def get_handler_names(self, path='.'): container = self.get_handler(path) return container.cache.keys() | 3bbccc65372dc62139bb7b20779440cd651169a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3bbccc65372dc62139bb7b20779440cd651169a9/Folder.py |
def _load_state(self, resource): self.data = resource.read() | def _load_state_from_file(self, file): self.data = file.read() | def _load_state(self, resource): self.data = resource.read() | 7f6ebbb93d15d33c9aba52af1137b03cb8d6fdca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7f6ebbb93d15d33c9aba52af1137b03cb8d6fdca/Image.py |
if callable(value): value = value() | def index_document(self, document): # Mark as changed self.set_changed() | 1a6e11c08d28727bac2cf62cc797e83736021bba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1a6e11c08d28727bac2cf62cc797e83736021bba/Catalog.py | |
docs_rsrc[8:12] = docs_slot_r | docs_rsrc[8:12] = IO.encode_link(docs_slot_n) | def unindex_word(self, word, doc_number): if word: prefix, suffix = word[0], word[1:] subtree = self.children[prefix] subtree.unindex_word(suffix, doc_number) else: del self.documents[doc_number] # Update resource tree_rsrc = self.root.tree_handler.resource docs = self.root.docs_handler docs_rsrc = docs.resource # Sear... | f9893ea50a4982a12d4e1e8ff22a79b27acd41e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/f9893ea50a4982a12d4e1e8ff22a79b27acd41e2/IIndex.py |
if self.has_attribute(namespaces.xhtml, 'type'): return self.get_attribute(namespaces.xhtml, 'type') == 'submit' | if self.has_attribute(Namespace.class_uri, 'type'): return self.get_attribute(Namespace.class_uri, 'type') == 'submit' | def is_translatable(self, attribute_name): # Attributes if self.name == 'img' and attribute_name == 'alt': return True if self.name == 'input' and attribute_name == 'value': if self.has_attribute(namespaces.xhtml, 'type'): return self.get_attribute(namespaces.xhtml, 'type') == 'submit' return False | c02999cff7fee9ce82a43c893233ab15e9380a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c02999cff7fee9ce82a43c893233ab15e9380a91/XHTML.py |
if isinstance(namespace, dict): | elif isinstance(namespace, dict): | def lookup(namespace, name): """ Looks for a variable in a namespace (an instance, a mapping, etc..) """ if hasattr(namespace, 'stl_lookup'): return namespace.stl_lookup(name) if isinstance(namespace, dict): if name in namespace: return namespace[name] try: value = getattr(namespace, name) except AttributeError: # XX... | 85f505c667c2c2761bcc78771fb39315b22fa673 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/85f505c667c2c2761bcc78771fb39315b22fa673/STL.py |
try: value = getattr(namespace, name) except AttributeError: try: value = namespace[name] except KeyError: raise STLNameError, 'name "%s" not found in the namespace' % name return value | elif hasattr(namespace, name): return getattr(namespace, name) raise STLNameError, 'name "%s" not found in the namespace' % name | def lookup(namespace, name): """ Looks for a variable in a namespace (an instance, a mapping, etc..) """ if hasattr(namespace, 'stl_lookup'): return namespace.stl_lookup(name) if isinstance(namespace, dict): if name in namespace: return namespace[name] try: value = getattr(namespace, name) except AttributeError: # XX... | 85f505c667c2c2761bcc78771fb39315b22fa673 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/85f505c667c2c2761bcc78771fb39315b22fa673/STL.py |
version = "0.5.0", | version = "0.5.1", | def build_module(self, module, module_file, package): if isinstance(package, str): package = package.split('.') elif not isinstance(package, (list, tuple)): raise TypeError, \ "'package' must be a string (dot-separated), list, or tuple" | 4b7f07d1167e40692a5420ff2aa7daca7cf978e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4b7f07d1167e40692a5420ff2aa7daca7cf978e8/setup.py |
if user_id in self.get_property(rolename): | if user_id in self.get_property(role): | def user_has_role(self, user_id, *roles): """ Return True if the given user has any of the the given roles, False otherwise. """ for role in roles: if user_id in self.get_property(rolename): return True return False | efdfa878b02ae0e027812491e4d5dc9f45be1735 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/efdfa878b02ae0e027812491e4d5dc9f45be1735/access.py |
if not document.is_allowed_to_view(): | ac = document.get_access_control() if not ac.is_allowed_to_view(user, document): | def tasks_list(self, context): root = context.root | 67a4d807ba840934ada22963282262b59bf3c69d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/67a4d807ba840934ada22963282262b59bf3c69d/users.py |
assert str(path) == 'a/b/c/' | self.assertEqual(str(path), 'a/b/c/') | def test_simplenorm(self): """ Test the simple path normalization: | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
assert str(path) == 'a/b/d' | self.assertEqual(str(path), 'a/b/d') | def test_backnorm(self): """ Test the normalization 'a/../b' = 'b' """ path = uri.Path('a/b/c/../d') assert str(path) == 'a/b/d' | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
assert str(path) == '/a/b/c' | self.assertEqual(str(path), '/a/b/c') | def test_absnorm(self): """ Test the normalization '/..' = '/' """ path = uri.Path('/../../a/b/c') assert str(path) == '/a/b/c' | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
assert str(path) == '../../a/b/c' | self.assertEqual(str(path), '../../a/b/c') | def test_relnorm(self): """ Check that '../' = '../' """ path = uri.Path('../../a//.//b/c') assert str(path) == '../../a/b/c' | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
assert ref.scheme == 'http' assert ref.authority == 'example.com' assert ref.path == '/a/b/c' assert ref.query == 'query' assert ref.fragment == 'fragment' | self.assertEqual(ref.scheme, 'http') self.assertEqual(ref.authority, 'example.com') self.assertEqual(ref.path, '/a/b/c') self.assertEqual(ref.query, 'query') self.assertEqual(ref.fragment, 'fragment') | def test_full(self): ref = 'http://example.com/a/b/c?query#fragment' ref = uri.Reference(ref) assert ref.scheme == 'http' assert ref.authority == 'example.com' assert ref.path == '/a/b/c' assert ref.query == 'query' assert ref.fragment == 'fragment' | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
assert bool(ref.scheme) is False assert ref.authority == 'example.com' assert ref.path == '/a/b' | self.assertEqual(bool(ref.scheme), False) self.assertEqual(ref.authority, 'example.com') self.assertEqual(ref.path, '/a/b') | def test_network(self): ref = '//example.com/a/b' ref = uri.Reference(ref) assert bool(ref.scheme) is False assert ref.authority == 'example.com' assert ref.path == '/a/b' | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
assert bool(ref.scheme) is False assert bool(ref.authority) is False assert ref.path == '/a/b/c' | self.assertEqual(bool(ref.scheme), False) self.assertEqual(bool(ref.authority), False) self.assertEqual(ref.path, '/a/b/c') | def test_path(self): ref = '/a/b/c' ref = uri.Reference(ref) assert bool(ref.scheme) is False assert bool(ref.authority) is False assert ref.path == '/a/b/c' | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
assert bool(ref.scheme) is False assert bool(ref.authority) is False assert len(ref.path) == 0 assert ref.query == 'query' | self.assertEqual(bool(ref.scheme), False) self.assertEqual(bool(ref.authority), False) self.assertEqual(len(ref.path), 0) self.assertEqual(ref.query, 'query') | def test_query(self): ref = '?query' ref = uri.Reference(ref) assert bool(ref.scheme) is False assert bool(ref.authority) is False assert len(ref.path) == 0 assert ref.query == 'query' | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
def test(self): | def test_standard(self): | def test(self): failure = 0 for reference, expected in [('g:h', 'g:h'), ('g', 'http://a/b/c/g'), ('./g', 'http://a/b/c/g'), ('g/', 'http://a/b/c/g/'), ('/g', 'http://a/g'), ('//g', 'http://g'), ('?y', 'http://a/b/c/?y'), ('g?y', 'http://a/b/c/g?y'), ('#s', 'http://a/b/c/d;p?q#s'), ('g#s', 'http://a/b/c/g#s'), ('g?y#s',... | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
('', 'http://a/b/c/'), | ('.', 'http://a/b/c/'), | def test(self): failure = 0 for reference, expected in [('g:h', 'g:h'), ('g', 'http://a/b/c/g'), ('./g', 'http://a/b/c/g'), ('g/', 'http://a/b/c/g/'), ('/g', 'http://a/g'), ('//g', 'http://g'), ('?y', 'http://a/b/c/?y'), ('g?y', 'http://a/b/c/g?y'), ('#s', 'http://a/b/c/d;p?q#s'), ('g#s', 'http://a/b/c/g#s'), ('g?y#s',... | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
assert x == expected | self.assertEqual(x, expected) | def test(self): failure = 0 for reference, expected in [('g:h', 'g:h'), ('g', 'http://a/b/c/g'), ('./g', 'http://a/b/c/g'), ('g/', 'http://a/b/c/g/'), ('/g', 'http://a/g'), ('//g', 'http://g'), ('?y', 'http://a/b/c/?y'), ('g?y', 'http://a/b/c/g?y'), ('#s', 'http://a/b/c/d;p?q#s'), ('g#s', 'http://a/b/c/g#s'), ('g?y#s',... | 10e3494b023699fdcb2cbe973f15ae8a062173c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/10e3494b023699fdcb2cbe973f15ae8a062173c1/test_uri.py |
port = 8000 | port = 8080 | def __init__(self, root, address='127.0.0.1', port=None, access_log=None, error_log=None, pid_file=None): if port is None: port = 8000 # The application's root self.pool = Pool(root) # The address and port the server will listen to self.address = address self.port = port # The access and error logs if access_log is not... | 62e9cecb85466cfeb7897dba4449f7219cfc237a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/62e9cecb85466cfeb7897dba4449f7219cfc237a/server.py |
handler = self._get_handler(segment) if handler is None: raise ValueError, '%s not found' % segment | if self.has_resource(name): resource = self.get_resource(name) handler = self._get_handler(segment, resource) else: handler = self._get_virtual_handler(segment) | def get_handler(self, path): # Be sure path is a Path if not isinstance(path, uri.Path): path = uri.Path(path) | f27d97e6e95c4c5aa42f776af4fe70e2de29bcbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/f27d97e6e95c4c5aa42f776af4fe70e2de29bcbd/Folder.py |
def _get_handler(self, segment): if self.has_resource(segment.name): resource = self.get_resource(segment.name) | def _get_handler(self, segment, resource): from itools.handlers import database mimetype = database.guess_mimetype(segment.name, resource) return database.get_handler(resource, mimetype) | def _get_handler(self, segment): if self.has_resource(segment.name): resource = self.get_resource(segment.name) | f27d97e6e95c4c5aa42f776af4fe70e2de29bcbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/f27d97e6e95c4c5aa42f776af4fe70e2de29bcbd/Folder.py |
from itools.handlers import database mimetype = database.guess_mimetype(segment.name, resource) return database.get_handler(resource, mimetype) | def _get_handler(self, segment): if self.has_resource(segment.name): resource = self.get_resource(segment.name) | f27d97e6e95c4c5aa42f776af4fe70e2de29bcbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/f27d97e6e95c4c5aa42f776af4fe70e2de29bcbd/Folder.py | |
return None | def _get_virtual_handler(self, segment): """ This method must return a handler for the given segment, or raise the exception LookupError. We know there is not a resource with the given name, this method is used to return 'virtual' handlers. """ raise LookupError, 'the resource "%s" does not exist' % segment.name | def _get_handler(self, segment): if self.has_resource(segment.name): resource = self.get_resource(segment.name) | f27d97e6e95c4c5aa42f776af4fe70e2de29bcbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/f27d97e6e95c4c5aa42f776af4fe70e2de29bcbd/Folder.py |
state.children = [] | children = [] | def _load_state(self, resource): state = self.state state.encoding = 'UTF-8' state.document_type = None state.children = [] | d22d43d8c32870250c2909e8cc9defca9b4dc347 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d22d43d8c32870250c2909e8cc9defca9b4dc347/HTML.py |
state.children.append(element) | children.append(element) | def _load_state(self, resource): state = self.state state.encoding = 'UTF-8' state.document_type = None state.children = [] | d22d43d8c32870250c2909e8cc9defca9b4dc347 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d22d43d8c32870250c2909e8cc9defca9b4dc347/HTML.py |
state.children.append(comment) | children.append(comment) | def _load_state(self, resource): state = self.state state.encoding = 'UTF-8' state.document_type = None state.children = [] | d22d43d8c32870250c2909e8cc9defca9b4dc347 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d22d43d8c32870250c2909e8cc9defca9b4dc347/HTML.py |
state.children.append(value) | children.append(value) for element in children: if isinstance(element, Element) and element.name == 'html': state.root_element = element break else: schema = elements_schema.get('html', {'type': BlockElement}) element_class = schema['type'] element = element_class('html') element.children = children state.root_ele... | def _load_state(self, resource): state = self.state state.encoding = 'UTF-8' state.document_type = None state.children = [] | d22d43d8c32870250c2909e8cc9defca9b4dc347 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d22d43d8c32870250c2909e8cc9defca9b4dc347/HTML.py |
s = [] | data = [] | def to_str(self, encoding='UTF-8'): s = [] # The declaration if self.state.document_type is not None: s.append('<!%s>' % self.state.document_type) # The children for child in self.state.children: if isinstance(child, unicode): s.append(child.encode(encoding)) else: s.append(child.to_str(encoding)) return ''.join(s) | d22d43d8c32870250c2909e8cc9defca9b4dc347 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d22d43d8c32870250c2909e8cc9defca9b4dc347/HTML.py |
s.append('<!%s>' % self.state.document_type) for child in self.state.children: if isinstance(child, unicode): s.append(child.encode(encoding)) else: s.append(child.to_str(encoding)) return ''.join(s) | data.append('<!%s>' % self.state.document_type) data.append(self.get_root_element().to_str(encoding)) | def to_str(self, encoding='UTF-8'): s = [] # The declaration if self.state.document_type is not None: s.append('<!%s>' % self.state.document_type) # The children for child in self.state.children: if isinstance(child, unicode): s.append(child.encode(encoding)) else: s.append(child.to_str(encoding)) return ''.join(s) | d22d43d8c32870250c2909e8cc9defca9b4dc347 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d22d43d8c32870250c2909e8cc9defca9b4dc347/HTML.py |
def get_root_element(self): for child in self.state.children: if isinstance(child, Element): return child | return ''.join(data) | def to_str(self, encoding='UTF-8'): s = [] # The declaration if self.state.document_type is not None: s.append('<!%s>' % self.state.document_type) # The children for child in self.state.children: if isinstance(child, unicode): s.append(child.encode(encoding)) else: s.append(child.to_str(encoding)) return ''.join(s) | d22d43d8c32870250c2909e8cc9defca9b4dc347 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d22d43d8c32870250c2909e8cc9defca9b4dc347/HTML.py |
language = node.get_attribute('lang') | language = str(node.get_attribute('lang')) | def decode(cls, node): schema = cls.schema property = cls() for node in node.get_elements(): name = node.name # Decode the value if name in schema: type, default = schema[name] if issubclass(type, ComplexType): value = type.decode(node) else: value = unicode(node.children) value = value.encode('utf8') try: value = type... | 8f921bc29f1709b6e374ed6fc434ad37f288a593 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/8f921bc29f1709b6e374ed6fc434ad37f288a593/Schema.py |
print 'COMMIT' | def commit(self, username='', note=''): if not self: return | 43f8e256c3bbd97b9fca0ac91c3f0d0b4b80d297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/43f8e256c3bbd97b9fca0ac91c3f0d0b4b80d297/transactions.py | |
try: if self.schema[self.columns[i]].index == True: if self.state.indexes[i] is None: self.state.indexes[i] = {} if self.state.indexes[i].has_key(value): self.state.indexes[i][value].append(row_index) else: self.state.indexes[i][value] = [row_index] except: pass | if self.schema[self.columns[i]].index is True: if indexes[i] is None: indexes[i] = {} index = indexes[i] if value in index: index[value].append(row_index) else: index[value] = [row_index] | def _index_row(self, row, row_index): """Index one line""" for i, value in enumerate(row): try: if self.schema[self.columns[i]].index == True: if self.state.indexes[i] is None: self.state.indexes[i] = {} if self.state.indexes[i].has_key(value): self.state.indexes[i][value].append(row_index) else: self.state.indexes[i][... | 33c4c5ca55ab592cabba30b0cb474e23292454b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/33c4c5ca55ab592cabba30b0cb474e23292454b2/itools_csv.py |
res = ' ' + lines[0] | res = lines[0] | def fold_line(line): """ Fold the unfolded line over 75 characters. """ i = 1 lines = line.split(' ') res = ' ' + lines[0] size = len(res) while i < len(lines): # Still less than 75c if size+len(lines[i]) <= 75: res = res + ' ' + lines[i] size = size + 1 + len(lines[i]) i = i + 1 # More than 75c, insert new line else: ... | 4940abcfd356be91ea0ce096d7218c3938d118b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4940abcfd356be91ea0ce096d7218c3938d118b2/types.py |
raise SyntaxError, 'unexpected character (%s)' % c | raise SyntaxError, "unexpected character '%s' (%s)" % (c, ord(c)) | def parse(cls, property, encoding='UTF-8'): """ Parse content line property splitting it into 2 parts: name | [parameters]value """ c, lexeme = property[0], '' # Test first character of name if not c.isalnum() and c != '-': raise SyntaxError, 'unexpected character (%s)' % c # Test if property contains ':' if not ':' in... | 4940abcfd356be91ea0ce096d7218c3938d118b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4940abcfd356be91ea0ce096d7218c3938d118b2/types.py |
xmlns = get_namespace(xmlns_uri) | xmlns = get_namespace(None) | def start_element_handler(self, name, attrs): # Parse the element name: namespace_uri, name and prefix n = name.count(' ') if n == 2: namespace_uri, name, prefix = name.split() elif n == 1: prefix = None namespace_uri, name = name.split() else: prefix = None namespace_uri = None | 382492a5206fcfb955b90392a63b0cb5205c7717 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/382492a5206fcfb955b90392a63b0cb5205c7717/XML.py |
value = namespace.get_attribute('xmlns', name, value) | value = xmlns.get_attribute('xmlns', name, value) | def start_element_handler(self, name, attrs): # Parse the element name: namespace_uri, name and prefix n = name.count(' ') if n == 2: namespace_uri, name, prefix = name.split() elif n == 1: prefix = None namespace_uri, name = name.split() else: prefix = None namespace_uri = None | 382492a5206fcfb955b90392a63b0cb5205c7717 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/382492a5206fcfb955b90392a63b0cb5205c7717/XML.py |
""" Set header used to navigate into time. datetime.strftime('%U') gives week number, starting week by Sunday datetime.strftime('%W') gives week number, starting week by Monday This week number is calculated as "Week O1" begins on the first Sunday/Monday of the year. Its range is [0,53]. We adjust week numbers to fit... | def add_selector_ns(cls, c_date, method, namespace): # Set header used to navigate into time # Week, current date is first showed week + 1 tmp_date = c_date - timedelta(7) current_week = cls.gettext(u'Week ') current_week = current_week + Unicode.encode(tmp_date.strftime('%U')) previous_week = ";%s?date=%s" % (method, ... | 4ae55f4ffc1b6906d1cd648e82a78a08e6897100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4ae55f4ffc1b6906d1cd648e82a78a08e6897100/ical.py | |
current_week = cls.gettext(u'Week ') current_week = current_week + Unicode.encode(tmp_date.strftime('%U')) | def add_selector_ns(cls, c_date, method, namespace): # Set header used to navigate into time # Week, current date is first showed week + 1 tmp_date = c_date - timedelta(7) current_week = cls.gettext(u'Week ') current_week = current_week + Unicode.encode(tmp_date.strftime('%U')) previous_week = ";%s?date=%s" % (method, ... | 4ae55f4ffc1b6906d1cd648e82a78a08e6897100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4ae55f4ffc1b6906d1cd648e82a78a08e6897100/ical.py | |
tmp_date = c_date - timedelta(30) | delta = 31 if c_date.month != 1: xxx, delta = monthrange(c_date.year, c_date.month - 1) tmp_date = c_date - timedelta(delta) | def add_selector_ns(cls, c_date, method, namespace): # Set header used to navigate into time # Week, current date is first showed week + 1 tmp_date = c_date - timedelta(7) current_week = cls.gettext(u'Week ') current_week = current_week + Unicode.encode(tmp_date.strftime('%U')) previous_week = ";%s?date=%s" % (method, ... | 4ae55f4ffc1b6906d1cd648e82a78a08e6897100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4ae55f4ffc1b6906d1cd648e82a78a08e6897100/ical.py |
tmp_date = c_date + timedelta(30) | xxx, delta = monthrange(c_date.year, c_date.month) tmp_date = c_date + timedelta(delta) | def add_selector_ns(cls, c_date, method, namespace): # Set header used to navigate into time # Week, current date is first showed week + 1 tmp_date = c_date - timedelta(7) current_week = cls.gettext(u'Week ') current_week = current_week + Unicode.encode(tmp_date.strftime('%U')) previous_week = ";%s?date=%s" % (method, ... | 4ae55f4ffc1b6906d1cd648e82a78a08e6897100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4ae55f4ffc1b6906d1cd648e82a78a08e6897100/ical.py |
tmp_date = c_date - timedelta(365) | date_before = date(c_date.year, 2, 28) date_after = date(c_date.year, 3, 1) delta = 365 if (isleap(c_date.year - 1) and c_date <= date_before) \ or (isleap(c_date.year) and c_date > date_before): delta = 366 tmp_date = c_date - timedelta(delta) | def add_selector_ns(cls, c_date, method, namespace): # Set header used to navigate into time # Week, current date is first showed week + 1 tmp_date = c_date - timedelta(7) current_week = cls.gettext(u'Week ') current_week = current_week + Unicode.encode(tmp_date.strftime('%U')) previous_week = ";%s?date=%s" % (method, ... | 4ae55f4ffc1b6906d1cd648e82a78a08e6897100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4ae55f4ffc1b6906d1cd648e82a78a08e6897100/ical.py |
tmp_date = c_date + timedelta(365) | delta = 365 if (isleap(c_date.year) and c_date <= date_before) \ or (isleap(c_date.year +1) and c_date >= date_after): delta = 366 tmp_date = c_date + timedelta(delta) | def add_selector_ns(cls, c_date, method, namespace): # Set header used to navigate into time # Week, current date is first showed week + 1 tmp_date = c_date - timedelta(7) current_week = cls.gettext(u'Week ') current_week = current_week + Unicode.encode(tmp_date.strftime('%U')) previous_week = ";%s?date=%s" % (method, ... | 4ae55f4ffc1b6906d1cd648e82a78a08e6897100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4ae55f4ffc1b6906d1cd648e82a78a08e6897100/ical.py |
def days_of_week_ns(cls, date, num=None, ndays=7): | def days_of_week_ns(cls, date, num=None, ndays=7, c_date=None): | def days_of_week_ns(cls, date, num=None, ndays=7): ns_days = [] for index in range(ndays): ns = {} ns['name'] = cls.gettext(cls.days[date.weekday()]) ns['nday'] = None if num: ns['nday'] = date.day ns_days.append(ns) date = date + timedelta(1) return ns_days | 4ae55f4ffc1b6906d1cd648e82a78a08e6897100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4ae55f4ffc1b6906d1cd648e82a78a08e6897100/ical.py |
namespace['days_of_week'] = self.days_of_week_ns(start, num=True) | namespace['days_of_week'] = self.days_of_week_ns(start, True, 7, c_date) | def weekly_view(self, context): context = get_context() root = context.root | 4ae55f4ffc1b6906d1cd648e82a78a08e6897100 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4ae55f4ffc1b6906d1cd648e82a78a08e6897100/ical.py |
class Stat_special_char(Char): def __init__(self, text): self.text = text.upper().swapcase() | def test_french_very_sort(self): text = u"""Les dclarations du prsident Vladimir Poutine""" p = oracle.Language(text) print ('test_french_very_sort', p.percent()) | def __init__(self, language, lexeme=''): self.language = language self.lexeme = lexeme | 01cf89725c399f39f6264ce34c9f6a329f12087d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/01cf89725c399f39f6264ce34c9f6a329f12087d/test_oracle.py |
def stat_special_char(self): """ return percent of special char for specific language """ stat = {} for lang in language: n = 0 for special_char in lang[2]: n = n + self.text.count(special_char) if len(self.text) != 0: percent = (n*4000)/len(self.text) percent = min (100, percent) else: percent = 0 stat[lang[0]] = per... | def test_english_short(self): text = """The French, too, paid much attention to French-German reconciliation and interpreted the ceremonies as a celebration of European integration and peace.""" p = oracle.Language(text) print ('test_english_short', p.percent()) | def stat_special_char(self): """ return percent of special char for specific language """ stat = {} for lang in language: n = 0 for special_char in lang[2]: n = n + self.text.count(special_char) if len(self.text) != 0: percent = (n*4000)/len(self.text) percent = min (100, percent) else: percent = 0 stat[lang[0]] = per... | 01cf89725c399f39f6264ce34c9f6a329f12087d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/01cf89725c399f39f6264ce34c9f6a329f12087d/test_oracle.py |
class Token: def __init__(self, id, lexeme=''): self.id = id self.lexeme = lexeme | if __name__ == '__main__': unittest.main() | def stat_special_char(self): """ return percent of special char for specific language """ stat = {} for lang in language: n = 0 for special_char in lang[2]: n = n + self.text.count(special_char) if len(self.text) != 0: percent = (n*4000)/len(self.text) percent = min (100, percent) else: percent = 0 stat[lang[0]] = per... | 01cf89725c399f39f6264ce34c9f6a329f12087d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/01cf89725c399f39f6264ce34c9f6a329f12087d/test_oracle.py |
class Select_token(Token): def __init__(self, text): self.text = text for i in rubbish_punctuation: self.text = self.text.replace(i , ' ') for i in keeping_punctuation: self.text = self.text.replace(i , ' '+i+' ') self.index = 0 def get_token(self): """ return only word with latin char or keeping_punctuation """ lexe... | def __init__(self, id, lexeme=''): self.id = id self.lexeme = lexeme | 01cf89725c399f39f6264ce34c9f6a329f12087d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/01cf89725c399f39f6264ce34c9f6a329f12087d/test_oracle.py | |
request_uri = deepcopy(request.uri) request_uri.path = uri.Path('/' + request_uri.query['REAL_PATH']) | real_path = request_uri.query.pop('REAL_PATH') request_uri = deepcopy(request_uri) request_uri.path = uri.Path('/' + real_path) | def __init__(self, request): self.request = request self.response = Response() | 9751d011bb49189f67c9f05027879cd3f8855164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/9751d011bb49189f67c9f05027879cd3f8855164/context.py |
path = request_uri.path | path = request.uri.path | def __init__(self, request): self.request = request self.response = Response() | 9751d011bb49189f67c9f05027879cd3f8855164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/9751d011bb49189f67c9f05027879cd3f8855164/context.py |
- itools.csv | def get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" data = [] if not self.packages: return data for package in self.packages: # Locate package source directory src_dir = self.get_package_dir(package) | bba63c445979c3ffa8c40e1848553141c0b42d9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bba63c445979c3ffa8c40e1848553141c0b42d9b/setup.py | |
version = "0.11.0", | version = "0.12.0", | def get_data_files(self): """Generate list of '(package,src_dir,build_dir,filenames)' tuples""" data = [] if not self.packages: return data for package in self.packages: # Locate package source directory src_dir = self.get_package_dir(package) | bba63c445979c3ffa8c40e1848553141c0b42d9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bba63c445979c3ffa8c40e1848553141c0b42d9b/setup.py |
def normalize_path(path): """ Normalize the path (we don't use os.path because on Windows it converts forward slashes to back slashes). Examples: a//b/c : a/b/c a/./b/c : a/b/c a/b/c/../d : a/b/d /../a/b/c : /a/b/c """ if not isinstance(path, str) and not isinstance(path, unicode): raise TypeError, 'path must... | 850bd3d64a2fcc3b87711b887d8122a1690fd8e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/850bd3d64a2fcc3b87711b887d8122a1690fd8e2/uri.py | ||
endswith_slash = path.endswith('/') | endswith_slash = path.endswith('/') \ or path.endswith('/.') \ or path.endswith('/..') | def normalize_path(path): """ Normalize the path (we don't use os.path because on Windows it converts forward slashes to back slashes). Examples: a//b/c : a/b/c a/./b/c : a/b/c a/b/c/../d : a/b/d /../a/b/c : /a/b/c """ if not isinstance(path, str) and not isinstance(path, unicode): raise TypeError, 'path must... | 850bd3d64a2fcc3b87711b887d8122a1690fd8e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/850bd3d64a2fcc3b87711b887d8122a1690fd8e2/uri.py |
if not isinstance(path, Path): path = Path(path) return self.__class__(list(self) + list(path)) | raise NotImplementedError, \ 'paths can not be added, use resolve2 instead' | def __add__(self, path): if not isinstance(path, Path): path = Path(path) return self.__class__(list(self) + list(path)) | 850bd3d64a2fcc3b87711b887d8122a1690fd8e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/850bd3d64a2fcc3b87711b887d8122a1690fd8e2/uri.py |
return urlunsplit((self.scheme, str(self.authority), str(self.path), | path = str(self.path) if path == '.': path = '' return urlunsplit((self.scheme, str(self.authority), path, | def __str__(self): return urlunsplit((self.scheme, str(self.authority), str(self.path), str(self.query), self.fragment)) | 850bd3d64a2fcc3b87711b887d8122a1690fd8e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/850bd3d64a2fcc3b87711b887d8122a1690fd8e2/uri.py |
for resource_name in self.get_resource_names(path): yield self.get_resource(resource_name) | resource = self.get_resource(path) for name in resource._get_resource_names(): yield resource.get_resource(name) | def get_resources(self, path='.'): for resource_name in self.get_resource_names(path): yield self.get_resource(resource_name) | 44391ac98df81ac00b56815999397153e3b4bcb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/44391ac98df81ac00b56815999397153e3b4bcb3/base.py |
parameters.append('; max-Age=%s' % cookie.max_age) | parameters.append('; max-age=%s' % cookie.max_age) | def to_str(self): state = self.state | bd27fb892756c4b2891d1184e3a059d4ea38e930 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bd27fb892756c4b2891d1184e3a059d4ea38e930/response.py |
value = ' '.join(value) | value = u' '.join(value) | def index_document(self, document): self.set_changed() # Create the document to index doc_number = self.documents.n_documents catalog_document = Document(doc_number) | c4f713fbc2432c906108675261272c0dc3930068 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c4f713fbc2432c906108675261272c0dc3930068/catalog.py |
css_class = 'busy' | css_class = 'cal_busy' | def get_ns_calendar(self, calendar, c_date, cal_fields, shown_fields, timetables, method='browse_calendar', show_conflicts=False): calendar_url = self.get_pathto(calendar) args = 'date=%s&method=%s' % (Date.encode(c_date), method) new_url = '%s/;edit_event_form?%s' % (calendar_url, args) | 5f83542f3cb0eb04e251ae570d1de06be358684c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/5f83542f3cb0eb04e251ae570d1de06be358684c/ical.py |
request_uri.path = uri.Path('/%s' % diff_path) | if request_uri.path.endswith_slash: request_uri.path = uri.Path('/%s/' % diff_path) else: request_uri.path = uri.Path('/%s' % diff_path) | def __init__(self, request): self.request = request self.response = Response() | 7852ef9529d3bc75eb67b2278302738a8b30159c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7852ef9529d3bc75eb67b2278302738a8b30159c/context.py |
return str(self) != normalize_path(str(other)) | if isinstance(other, str): other = Path(other) return str(self) != str(other) | def __ne__(self, other): return str(self) != normalize_path(str(other)) | be62e248e1c2259c60ba3078990e12061e86cd62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/be62e248e1c2259c60ba3078990e12061e86cd62/generic.py |
return str(self) == normalize_path(str(other)) | if isinstance(other, str): other = Path(other) return str(self) == str(other) | def __eq__(self, other): return str(self) == normalize_path(str(other)) | be62e248e1c2259c60ba3078990e12061e86cd62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/be62e248e1c2259c60ba3078990e12061e86cd62/generic.py |
buffer.write(u' %s="%s"' % (qname, unicode(value))) | namespace = namespaces.get_namespace(namespace) schema = namespace.get_attribute_schema(local_name) type = schema['type'] buffer.write(u' %s="%s"' % (qname, type.to_unicode(value))) | def open_tag(node): # The open tag buffer.write(u'<%s' % node.qname) # The attributes for namespace, local_name, value in node.get_attributes(): if node.is_translatable(local_name): value = value.strip() if value: value = catalog.get_msgstr(value) or value qname = node.get_attribute_qname(namespace, local_name) buffer.... | 1ad68a8f5eaa74a28eba768d587ef9d3e14a7de2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1ad68a8f5eaa74a28eba768d587ef9d3e14a7de2/XHTML.py |
author = config.get_value('author_name'), | author = author_name, | def setup(description='', classifiers=[]): from __init__ import __version__ try: from itools.resources import get_resource from handlers.config import Config except ImportError: # Are we trying to install itools? # XXX This is ugly, because Python does not support relative imports start_local_import() from resources im... | 1df1a2b281ea4f4af8c730e50dedb417f49e8e10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1df1a2b281ea4f4af8c730e50dedb417f49e8e10/utils.py |
handler_class = here.get_handler_class(uri) | handler_class = self.get_handler_class(uri) | def _get_handler(self, segment, uri): handler_class = here.get_handler_class(uri) return handler_class(uri) | 2ef49b3d1f9a90928a6d679f118fb320c1ac6500 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/2ef49b3d1f9a90928a6d679f118fb320c1ac6500/Folder.py |
reference = self.uri.resolve2(reference) | reference = self.uri.resolve(reference) | def redirect(self, reference, status=302): reference = self.uri.resolve2(reference) self.response.redirect(reference, status) | 4c7c0639287229ccbff8c3ca87e93c749032b7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/4c7c0639287229ccbff8c3ca87e93c749032b7a8/context.py |
self.encoding = self.guess_encoding(data) | self.encoding = 'utf-8' | def new(self, data=u''): self.data = data self.encoding = self.guess_encoding(data) | 5d073888a995b016159ca7131d0bb242140678ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/5d073888a995b016159ca7131d0bb242140678ed/Text.py |
if isinstance(self, WorkflowAware): state = self.workflow_state | if isinstance(object, WorkflowAware): state = object.workflow_state | def is_allowed_to_view(self, user, object): # Objects with workflow from workflow import WorkflowAware if isinstance(self, WorkflowAware): state = self.workflow_state # Anybody can see public objects if state == 'public': return True | 3bfb9947ad2730072cb2db1310ee04195ab1b9da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/3bfb9947ad2730072cb2db1310ee04195ab1b9da/access.py |
dialect = csv.Sniffer().sniff(data[:1000]) | if data: dialect = csv.Sniffer().sniff(data[:1000]) reader = csv.reader(data.splitlines(), dialect) else: reader = csv.reader(data.splitlines()) | def parse(data, schema=None): encoding = Text.guess_encoding(data) dialect = csv.Sniffer().sniff(data[:1000]) if schema is None: for line in csv.reader(data.splitlines(), dialect): yield [ unicode(x, encoding) for x in line ] else: for line in csv.reader(data.splitlines(), dialect): yield [ schema[i].decode(value) for ... | d7d66783028d89ac24e4e2e007a313c18f639940 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d7d66783028d89ac24e4e2e007a313c18f639940/CSV.py |
for line in csv.reader(data.splitlines(), dialect): | for line in reader: | def parse(data, schema=None): encoding = Text.guess_encoding(data) dialect = csv.Sniffer().sniff(data[:1000]) if schema is None: for line in csv.reader(data.splitlines(), dialect): yield [ unicode(x, encoding) for x in line ] else: for line in csv.reader(data.splitlines(), dialect): yield [ schema[i].decode(value) for ... | d7d66783028d89ac24e4e2e007a313c18f639940 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d7d66783028d89ac24e4e2e007a313c18f639940/CSV.py |
for line in csv.reader(data.splitlines(), dialect): | for line in reader: | def parse(data, schema=None): encoding = Text.guess_encoding(data) dialect = csv.Sniffer().sniff(data[:1000]) if schema is None: for line in csv.reader(data.splitlines(), dialect): yield [ unicode(x, encoding) for x in line ] else: for line in csv.reader(data.splitlines(), dialect): yield [ schema[i].decode(value) for ... | d7d66783028d89ac24e4e2e007a313c18f639940 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d7d66783028d89ac24e4e2e007a313c18f639940/CSV.py |
['about', 'license']] | ['about', 'license'], ['catalog_form', 'check_groups']] | def get_subviews(self, name): views = [['browse_thumbnails', 'browse_list'], ['general_form', 'languages_form'], ['about', 'license']] for subviews in views: if name in subviews: return subviews return Group.get_subviews(self, name) | 64621b5747df491de5b5b0ad5a90b519f7a0b7a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/64621b5747df491de5b5b0ad5a90b519f7a0b7a9/root.py |
def join(self, username, password, password2, **kw): users = self.get_handler('users') error = users.new_user(username, password, password2) | 64621b5747df491de5b5b0ad5a90b519f7a0b7a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/64621b5747df491de5b5b0ad5a90b519f7a0b7a9/root.py | ||
catalog_form__label__ = u'Catalog' | catalog_form__label__ = u'Maintenance' catalog_form__sublabel__ = u'Update Catalog' | def join(self, username, password, password2, **kw): users = self.get_handler('users') error = users.new_user(username, password, password2) | 64621b5747df491de5b5b0ad5a90b519f7a0b7a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/64621b5747df491de5b5b0ad5a90b519f7a0b7a9/root.py |
check_groups__access__ = 'is_admin' check_groups__label__ = u'Maintenance' check_groups__sublabel__ = u'Check Groups' def check_groups(self): namespace = {} groups = [] root_users = self.get_handler('users').get_usernames() for path in self.get_groups(): group = self.get_handler(path) group_users = group.get_usernam... | def update_catalog(self): # Initialize a new empty catalog t0 = time() tmp_path = tempfile.mkdtemp() tmp_folder = get_handler(tmp_path) tmp_folder.set_handler('catalog', Catalog(fields=self._catalog_fields)) tmp_folder.save_state() catalog_resource = tmp_folder.resource.get_resource('catalog') catalog = Catalog(catalog... | 64621b5747df491de5b5b0ad5a90b519f7a0b7a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/64621b5747df491de5b5b0ad5a90b519f7a0b7a9/root.py | |
return unicode(value) | return unicode(value).replace(u'&', u'&') | def to_unicode(cls, value): return unicode(value) | 5649da5f4e688357c519d27d23a97333ae30fb01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/5649da5f4e688357c519d27d23a97333ae30fb01/__init__.py |
If 'self' and 'path' are absolute, a relative path 'x' is returned so self.resolve(x) = path. | Returns the relative path from 'self' to 'path'. This operation is the complement of 'resolve2'. So, if 'x = a.get_pathto(b)', then 'b = a.resolve2(x)'. | def get_pathto(self, path): """ If 'self' and 'path' are absolute, a relative path 'x' is returned so self.resolve(x) = path. """ if not isinstance(path, Path): path = Path(path) | f5758f7ea5183abfd15ef239ce25ecd9e1a15d28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/f5758f7ea5183abfd15ef239ce25ecd9e1a15d28/generic.py |
class HeadElement(Element): | class HeadElement(BlockElement): | def get_closetag(self): if self.name in parser.empty_elements: return '' return XHTML.Element.get_closetag(self) | dc7d811dc73f926f85a6ba425702eadebd81c43e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/dc7d811dc73f926f85a6ba425702eadebd81c43e/HTML.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.