rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
reference = self.uri.resolve(reference) | reference = self.uri.resolve2(reference) | def redirect(self, reference, status=302): reference = self.uri.resolve(reference) self.response.redirect(reference, status) | cdc0f9c27e9be38e9d42ecdd2d3c0eded1238965 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/cdc0f9c27e9be38e9d42ecdd2d3c0eded1238965/context.py |
version = "0.6.0", | version = "0.6.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" | 267b0a7d8a627eb2dd2b06c68cea493092e15ef5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/267b0a7d8a627eb2dd2b06c68cea493092e15ef5/setup.py |
id = ''.join(msgid) | def next_entry(self): # Initialize entry information id, comments, msgid, msgstr, fuzzy = None, [], [], [], False # Parse entry state = 0 for m in self.next_line(): line_type, value, line_number = m # Syntactic and semantic analysis if state == 0: # Wait for an entry if line_type == EOF: return elif line_type == BLANK:... | fc09ddce8bf857f7ed486ff29dc3a17fcdb753e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/fc09ddce8bf857f7ed486ff29dc3a17fcdb753e8/PO.py | |
id = ''.join(msgid) | def next_entry(self): # Initialize entry information id, comments, msgid, msgstr, fuzzy = None, [], [], [], False # Parse entry state = 0 for m in self.next_line(): line_type, value, line_number = m # Syntactic and semantic analysis if state == 0: # Wait for an entry if line_type == EOF: return elif line_type == BLANK:... | fc09ddce8bf857f7ed486ff29dc3a17fcdb753e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/fc09ddce8bf857f7ed486ff29dc3a17fcdb753e8/PO.py | |
transaction.commit(username, note) if request.method == 'LOCK' or request.method == 'UNLOCK': from transaction import get as get_zodb_transaction zodb_transaction = get_zodb_transaction() zodb_transaction.setUser(username, '') zodb_transaction.note(note) zodb_transaction.commit() | try: transaction.commit(username, note) except: server.log_error() transaction.rollback() response.set_status(500) response_body = root.internal_server_error() else: if request.method == 'LOCK' or request.method == 'UNLOCK': from transaction import get as get_zodb_transaction zodb_transaction = get_zodb_transaction(... | def handle_request(connection, server): # Build the request object resource = File(connection) try: request = Request(resource) except BadRequest, exception: request = None request_line = exception.args[0] else: # Keep here (though redundant) to be used later in the access log request_line = request.state.request_line ... | 00c60480e64c114ac9760033fd66caac17615f80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/00c60480e64c114ac9760033fd66caac17615f80/server.py |
node = self.tree | node = self.root | def unindex_term(self, tree_file, docs_file, word, documents): """ Un-indexes the given term. The parameter 'documents' is a list with the numbers of the documents that must be un-indexed. """ # Get the node node = self.tree for c in word: if node.children is None: node.load_children(tree_file) # Next node = node.child... | a627d44cbebfe8a24e08ac50232d03524e37d7b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a627d44cbebfe8a24e08ac50232d03524e37d7b9/index.py |
node.load_documents() | node.load_documents(tree_file, docs_file) | def unindex_term(self, tree_file, docs_file, word, documents): """ Un-indexes the given term. The parameter 'documents' is a list with the numbers of the documents that must be un-indexed. """ # Get the node node = self.tree for c in word: if node.children is None: node.load_children(tree_file) # Next node = node.child... | a627d44cbebfe8a24e08ac50232d03524e37d7b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a627d44cbebfe8a24e08ac50232d03524e37d7b9/index.py |
del self.documents[doc_number] | del node.documents[doc_number] | def unindex_term(self, tree_file, docs_file, word, documents): """ Un-indexes the given term. The parameter 'documents' is a list with the numbers of the documents that must be un-indexed. """ # Get the node node = self.tree for c in word: if node.children is None: node.load_children(tree_file) # Next node = node.child... | a627d44cbebfe8a24e08ac50232d03524e37d7b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a627d44cbebfe8a24e08ac50232d03524e37d7b9/index.py |
tree_file.seek(node.slot * 16 + 4) | tree_file.seek(node.block * 16 + 4) | def unindex_term(self, tree_file, docs_file, word, documents): """ Un-indexes the given term. The parameter 'documents' is a list with the numbers of the documents that must be un-indexed. """ # Get the node node = self.tree for c in word: if node.children is None: node.load_children(tree_file) # Next node = node.child... | a627d44cbebfe8a24e08ac50232d03524e37d7b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a627d44cbebfe8a24e08ac50232d03524e37d7b9/index.py |
pass | documents = self.removed_terms[term] self._index.unindex_term(tree_file, docs_file, term, documents) | def _save_state(self, uri): base = vfs.open(uri) tree_file = base.open('tree') docs_file = base.open('docs') try: # Removed terms for term in self.removed_terms: # XXX pass # Added terms for term in self.added_terms: documents = self.added_terms[term] self._index.index_term(tree_file, docs_file, term, documents) # Clea... | a627d44cbebfe8a24e08ac50232d03524e37d7b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a627d44cbebfe8a24e08ac50232d03524e37d7b9/index.py |
if isinstance(value, int): value = str(value) | def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {}) | 6fe868ca73b0918ba9a9f1fb26dfaf8a888daf02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/6fe868ca73b0918ba9a9f1fb26dfaf8a888daf02/STL.py | |
return self.get_start_tag() + self.get_content() + self.get_end_tag() | return self.get_start_tag() \ + self.get_content(encoding) \ + self.get_end_tag() | def to_unicode(self, encoding='UTF-8'): return self.get_start_tag() + self.get_content() + self.get_end_tag() | 37720938b709a1849bd7176662ff682d277a77df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/37720938b709a1849bd7176662ff682d277a77df/XML.py |
if len(path) == 0: return '.' | def __str__(self): path = '' if self.startswith_slash: path = '/' path += '/'.join([ str(x) for x in self ]) if self.endswith_slash: path += '/' if len(path) == 0: return '.' return path | 827a8c602b32145d852f203d26f531072d24edd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/827a8c602b32145d852f203d26f531072d24edd5/generic.py | |
if path == '.': path = '' | def __str__(self): path = str(self.path) if path == '.': path = '' reference = urlunsplit((self.scheme, str(self.authority), path, str(self.query), self.fragment)) if reference == '': if self.fragment is not None: return '#' return '.' return reference | 827a8c602b32145d852f203d26f531072d24edd5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/827a8c602b32145d852f203d26f531072d24edd5/generic.py | |
if request.uri.path.endswith_slash: | if context.uri.path.endswith_slash: | def handle_request(self, connection): # Build the request object resource = File(connection) try: request = Request(resource) except BadRequest, exception: request = None request_line = exception.args[0] except: self.log_error() request = None request_line = 'XXX' else: # Keep here (though redundant) to be used later i... | a762bfeb2c04858cbf38849474fb81d20549758e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a762bfeb2c04858cbf38849474fb81d20549758e/server.py |
goto = copy(request.uri) | goto = copy(context.uri) | def handle_request(self, connection): # Build the request object resource = File(connection) try: request = Request(resource) except BadRequest, exception: request = None request_line = exception.args[0] except: self.log_error() request = None request_line = 'XXX' else: # Keep here (though redundant) to be used later i... | a762bfeb2c04858cbf38849474fb81d20549758e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a762bfeb2c04858cbf38849474fb81d20549758e/server.py |
context = Context(request) set_context(context) | def handle_request(self, connection): # Build the request object resource = File(connection) try: request = Request(resource) except BadRequest, exception: request = None request_line = exception.args[0] except: self.log_error() request = None request_line = 'XXX' else: # Keep here (though redundant) to be used later i... | a762bfeb2c04858cbf38849474fb81d20549758e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a762bfeb2c04858cbf38849474fb81d20549758e/server.py | |
def _index_term(self, word, doc_number, position): | def _index_term(self, word, doc_number, positions): | def _index_term(self, word, doc_number, position): if word: prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot free_slot_n = self.root.tree_handler._get_free_slot() # Update data structure on memory subtree = self.children[prefix] = Tree(self.root, f... | bb3ce4cb078e57f293f40d00b258479d039ac7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bb3ce4cb078e57f293f40d00b258479d039ac7a8/IIndex.py |
subtree._index_term(suffix, doc_number, position) | subtree._index_term(suffix, doc_number, positions) | def _index_term(self, word, doc_number, position): if word: prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot free_slot_n = self.root.tree_handler._get_free_slot() # Update data structure on memory subtree = self.children[prefix] = Tree(self.root, f... | bb3ce4cb078e57f293f40d00b258479d039ac7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bb3ce4cb078e57f293f40d00b258479d039ac7a8/IIndex.py |
positions = self.documents[doc_number] positions.append(position) | aux = self.documents[doc_number] aux.extend(positions) positions = aux | def _index_term(self, word, doc_number, position): if word: prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot free_slot_n = self.root.tree_handler._get_free_slot() # Update data structure on memory subtree = self.children[prefix] = Tree(self.root, f... | bb3ce4cb078e57f293f40d00b258479d039ac7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bb3ce4cb078e57f293f40d00b258479d039ac7a8/IIndex.py |
frequency = len(positions) | def _index_term(self, word, doc_number, position): if word: prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot free_slot_n = self.root.tree_handler._get_free_slot() # Update data structure on memory subtree = self.children[prefix] = Tree(self.root, f... | bb3ce4cb078e57f293f40d00b258479d039ac7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bb3ce4cb078e57f293f40d00b258479d039ac7a8/IIndex.py | |
self.documents[doc_number] = positions = [position] | self.documents[doc_number] = positions | def _index_term(self, word, doc_number, position): if word: prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot free_slot_n = self.root.tree_handler._get_free_slot() # Update data structure on memory subtree = self.children[prefix] = Tree(self.root, f... | bb3ce4cb078e57f293f40d00b258479d039ac7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bb3ce4cb078e57f293f40d00b258479d039ac7a8/IIndex.py |
frequency = 1 | frequency = len(positions) | def _index_term(self, word, doc_number, position): if word: prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot free_slot_n = self.root.tree_handler._get_free_slot() # Update data structure on memory subtree = self.children[prefix] = Tree(self.root, f... | bb3ce4cb078e57f293f40d00b258479d039ac7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bb3ce4cb078e57f293f40d00b258479d039ac7a8/IIndex.py |
for position in positions: self._index_term(term, doc_number, position) | self._index_term(term, doc_number, positions) | def _save(self): # Removed terms for term, documents in self.removed_terms.keys(): for doc_number in documents: self._unindex_term(term, doc_number) self.removed_terms = {} # Added terms for term, documents in self.removed_terms.keys(): for doc_number, positions in documents.keys(): for position in positions: self._ind... | bb3ce4cb078e57f293f40d00b258479d039ac7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bb3ce4cb078e57f293f40d00b258479d039ac7a8/IIndex.py |
def _index_term(self, word, doc_number, position): | def _index_term(self, word, doc_number, positions): | def _index_term(self, word, doc_number, position): prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot slot_number = self.tree_handler._get_free_slot() subtree = self.children[prefix] = Tree(self, slot_number) # Update resource r = self.tree_handler.r... | bb3ce4cb078e57f293f40d00b258479d039ac7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bb3ce4cb078e57f293f40d00b258479d039ac7a8/IIndex.py |
subtree._index_term(suffix, doc_number, position) | subtree._index_term(suffix, doc_number, positions) | def _index_term(self, word, doc_number, position): prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot slot_number = self.tree_handler._get_free_slot() subtree = self.children[prefix] = Tree(self, slot_number) # Update resource r = self.tree_handler.r... | bb3ce4cb078e57f293f40d00b258479d039ac7a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/bb3ce4cb078e57f293f40d00b258479d039ac7a8/IIndex.py |
return apply(x, self.parameters) else: return self.end(x) def end(self, value): """ Call the object at the end of the traversal to get the value, if it is callable. """ if callable(value): | x = apply(x, self.parameters) elif callable(x): | def evaluate(self, stack, repeat): if self.repeat: stack = repeat | 26c59c5c85088ed1d9da824946aa09989828b35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/26c59c5c85088ed1d9da824946aa09989828b35e/STL.py |
value = value() | x = x() | def end(self, value): """ Call the object at the end of the traversal to get the value, if it is callable. """ if callable(value): try: value = value() except AttributeError, error_value: # XXX "callable" could return true even if the object is not # callable (see Python's documentation). # # This happens, for example,... | 26c59c5c85088ed1d9da824946aa09989828b35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/26c59c5c85088ed1d9da824946aa09989828b35e/STL.py |
return value | return x | def end(self, value): """ Call the object at the end of the traversal to get the value, if it is callable. """ if callable(value): try: value = value() except AttributeError, error_value: # XXX "callable" could return true even if the object is not # callable (see Python's documentation). # # This happens, for example,... | 26c59c5c85088ed1d9da824946aa09989828b35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/26c59c5c85088ed1d9da824946aa09989828b35e/STL.py |
def process1(self, node, stack, repeat): """ Process stl:if, stl:ifnot, stl:attributes and stl:content. """ attrs = node.attributes stl_uri = 'http://xml.itools.org/namespaces/stl' stl_attrs = attrs.namespaces.get(stl_uri, {}) | 26c59c5c85088ed1d9da824946aa09989828b35e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/26c59c5c85088ed1d9da824946aa09989828b35e/STL.py | ||
def get_quality(self): """ Returns the quality of this node. """ if self.quality is None: return max([ x.get_quality() for x in self.children.values() ]) | 976d1139da2815b4f6aa56381734980d601623c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/976d1139da2815b4f6aa56381734980d601623c9/accept.py | ||
def N_(message, language=None): """ Used to markup a string for translation but without translating it, this is known as deferred translations. """ return message | def gettext(cls, message, language=None, domain=None): if domain is None: domain = cls.class_domain | 04c468c264e48746410efe7f7020f04e6d29b357 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/04c468c264e48746410efe7f7020f04e6d29b357/domains.py | |
path = str(context.path[1:]) | path = self.get_abspath() | def copy(self, ids=[], **kw): # Filter names which the authenticated user is not allowed to copy handlers = [ self.get_handler(x) for x in ids ] names = [ x.name for x in handlers if x.is_allowed_to_copy() ] | c4cb35413d594f1000c06b08d26a8a9933774a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c4cb35413d594f1000c06b08d26a8a9933774a43/Folder.py |
context.set_cookie('ikaaro_cp', cp) | context.set_cookie('ikaaro_cp', cp, path='/') | def copy(self, ids=[], **kw): # Filter names which the authenticated user is not allowed to copy handlers = [ self.get_handler(x) for x in ids ] names = [ x.name for x in handlers if x.is_allowed_to_copy() ] | c4cb35413d594f1000c06b08d26a8a9933774a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c4cb35413d594f1000c06b08d26a8a9933774a43/Folder.py |
path = str(context.path[1:]) | path = self.get_abspath() | def cut(self, ids=[], **kw): # Filter names which the authenticated user is not allowed to move handlers = [ self.get_handler(x) for x in ids ] names = [ x.name for x in handlers if x.is_allowed_to_move() ] | c4cb35413d594f1000c06b08d26a8a9933774a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c4cb35413d594f1000c06b08d26a8a9933774a43/Folder.py |
context.set_cookie('ikaaro_cp', cp) | context.set_cookie('ikaaro_cp', cp, path='/') | def cut(self, ids=[], **kw): # Filter names which the authenticated user is not allowed to move handlers = [ self.get_handler(x) for x in ids ] names = [ x.name for x in handlers if x.is_allowed_to_move() ] | c4cb35413d594f1000c06b08d26a8a9933774a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c4cb35413d594f1000c06b08d26a8a9933774a43/Folder.py |
id.append('copy_1') | id.append('copy_1') | def paste(self): context = get_context() | c4cb35413d594f1000c06b08d26a8a9933774a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c4cb35413d594f1000c06b08d26a8a9933774a43/Folder.py |
id.append('copy_1') | id.append('copy_1') | def paste(self): context = get_context() | c4cb35413d594f1000c06b08d26a8a9933774a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c4cb35413d594f1000c06b08d26a8a9933774a43/Folder.py |
id.append('copy_1') | id.append('copy_1') | def paste(self): context = get_context() | c4cb35413d594f1000c06b08d26a8a9933774a43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c4cb35413d594f1000c06b08d26a8a9933774a43/Folder.py |
self.encoding = attribute_value.split(';')[-1].strip()[8:] | self.encoding = content_value.split(';')[-1].strip()[8:] | def handle_starttag(self, name, attrs): line_number = self.getpos()[0] | 2791207c6a72eeeb2d3ee54c7cb8cbf840e0ce48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/2791207c6a72eeeb2d3ee54c7cb8cbf840e0ce48/parser.py |
self.body = uri.generic.Query.decode(body) | self.body = Query.decode(body) | def non_blocking_load(self, read): """ Loads the request state from in non-blocking mode. Aimed at sockets, it works for files too. """ buffer = '' # Read the first line while True: data = read(512) data_size = len(data) # Check there is some data, if not we abort the request, something # may be wrong. if data_size == ... | a1583ead675cf8132f9ed70b1c3c3a6209d35f9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a1583ead675cf8132f9ed70b1c3c3a6209d35f9c/request.py |
raise LookupError, 'object "%s" not found' % str(path) | raise LookupError, 'object "%s" not found' % str(self.path) | def _get_object(self): connection = self.connection() object = connection.root() for segment in self.path: try: object = object[segment.name] except KeyError: raise LookupError, 'object "%s" not found' % str(path) | ebb47b8a324a4d2fe130a497b60860a578f44599 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ebb47b8a324a4d2fe130a497b60860a578f44599/zodb.py |
raise LookupError, 'object "%s" not found' % str(path) | raise LookupError, 'object "%s" not found' % str(self.path) | def _get_parent(self): connection = self.connection() object = connection.root() for segment in self.path[:-1]: try: object = object[segment.name] except KeyError: raise LookupError, 'object "%s" not found' % str(path) | ebb47b8a324a4d2fe130a497b60860a578f44599 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ebb47b8a324a4d2fe130a497b60860a578f44599/zodb.py |
self.load_state_from(file) | self.load_state_from_string(data) | def upload(self, context): file = context.get_form_value('file') | 42a08d7832e13344a0b3901159d885d6e6f2aac6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/42a08d7832e13344a0b3901159d885d6e6f2aac6/File.py |
mpath = os.path.splitdrive(mpath)[1] mpath = os.path.join(mpath, local_path) | drive, mpath = os.path.splitdrive(mpath) mpath = drive + os.path.join(mpath, local_path) | def get_abspath(globals_namespace, local_path): """ Returns the absolute path to the required file. """ mname = globals_namespace['__name__'] if mname == '__main__': mpath = os.getcwd() else: module = sys.modules[mname] if hasattr(module, '__path__'): mpath = module.__path__[0] elif '.' in mname: mpath = sys.modules[m... | d49df56bacd2eadb4e60a186b7b327f6d60ed165 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d49df56bacd2eadb4e60a186b7b327f6d60ed165/__init__.py |
transitions.append({'name': transition[(None, 'name')], | transitions.append({'title': transition[(None, 'name')], | def state_form(self, context): namespace = {} # State state = self.get_state() namespace['state'] = self.gettext(state['title']) # Posible transitions ac = self.get_access_control() transitions = [] for name, trans in state.transitions.items(): if ac.is_allowed_to_trans(context.user, self, name) is False: continue desc... | 085e1c35936d95b2d55a18f0748d171069fe07b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/085e1c35936d95b2d55a18f0748d171069fe07b0/workflow.py |
'pubDate': Unicode, | 'pubDate': TZDateTime, | def to_unicode(value): if value is None: return u'' return unicode(value.strftime('%Y-%m-%d %H:%M')) | 144b77f4bd2d9f28696c4f5ae0af18e711245563 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/144b77f4bd2d9f28696c4f5ae0af18e711245563/rss.py |
'lastBuildDate': Unicode, | 'lastBuildDate': TZDateTime, | def to_unicode(value): if value is None: return u'' return unicode(value.strftime('%Y-%m-%d %H:%M')) | 144b77f4bd2d9f28696c4f5ae0af18e711245563 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/144b77f4bd2d9f28696c4f5ae0af18e711245563/rss.py |
if not isinstance(uri_reference, uri.Reference): | if isinstance(uri_reference, uri.Reference): pass elif isinstance(uri_reference, uri.Path): uri_reference = uri.get_reference(str(uri_reference)) elif isinstance(uri_reference, StringTypes): | def __init__(self, uri_reference): if not isinstance(uri_reference, uri.Reference): uri_reference = uri.get_reference(uri_reference) self.uri = uri_reference | a3c40a0a8b582a786e8a0e6a3158273311cc3c25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/a3c40a0a8b582a786e8a0e6a3158273311cc3c25/base.py |
def _index_term(self, word, doc_number, positions): if word: prefix, suffix = word[0], word[1:] | def _index_term(self, term, documents): """ Indexes the given term. The parameter 'documents' is a mapping from document number to list of positions: {<document number>: [postion, ...], ...} """ if term: prefix, suffix = term[0], term[1:] | def _index_term(self, word, doc_number, positions): if word: prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot free_slot_n = self.root.tree_handler._get_free_slot() # Update data structure on memory subtree = self.children[prefix] = Tree(self.root, ... | 0f25159ac78f6533e983857dd8eb3f011e7ae412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0f25159ac78f6533e983857dd8eb3f011e7ae412/IIndex.py |
subtree._index_term(suffix, doc_number, positions) | subtree._index_term(suffix, documents) | def _index_term(self, word, doc_number, positions): if word: prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot free_slot_n = self.root.tree_handler._get_free_slot() # Update data structure on memory subtree = self.children[prefix] = Tree(self.root, ... | 0f25159ac78f6533e983857dd8eb3f011e7ae412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0f25159ac78f6533e983857dd8eb3f011e7ae412/IIndex.py |
if doc_number in self.documents: aux = self.documents[doc_number] aux.extend(positions) positions = aux doc_slot_n = docs_handler._get_document_slot(fdoc_slot_n, doc_number) doc_slot = 12 + doc_slot_n * 12 else: self.documents[doc_number] = positions doc_slot_n = docs_handler._get_free_slot() doc_slot = 12 + doc_slot... | for doc_number, doc_positions in documents.items(): if doc_number in self.documents: positions = self.documents[doc_number] positions.extend(doc_positions) doc_slot_n = docs_handler._get_document_slot(fdoc_slot_n, doc_number) doc_slot = 12 + doc_slot_n * 12 frequency = len(positions) else: self.documents[doc_number] ... | def _index_term(self, word, doc_number, positions): if word: prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot free_slot_n = self.root.tree_handler._get_free_slot() # Update data structure on memory subtree = self.children[prefix] = Tree(self.root, ... | 0f25159ac78f6533e983857dd8eb3f011e7ae412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0f25159ac78f6533e983857dd8eb3f011e7ae412/IIndex.py |
subtree = self.children[prefix] subtree._unindex_term(suffix, doc_number) | if prefix in self.children: subtree = self.children[prefix] subtree._unindex_term(suffix, doc_number) | def _unindex_term(self, word, doc_number): if word: prefix, suffix = word[0], word[1:] subtree = self.children[prefix] subtree._unindex_term(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 # Se... | 0f25159ac78f6533e983857dd8eb3f011e7ae412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0f25159ac78f6533e983857dd8eb3f011e7ae412/IIndex.py |
for term, documents in self.removed_terms.keys(): | for term, documents in self.removed_terms.items(): | def _save(self): # Removed terms for term, documents in self.removed_terms.keys(): for doc_number in documents: self._unindex_term(term, doc_number) self.removed_terms = {} # Added terms for term, documents in self.removed_terms.keys(): for doc_number, positions in documents.keys(): self._index_term(term, doc_number, p... | 0f25159ac78f6533e983857dd8eb3f011e7ae412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0f25159ac78f6533e983857dd8eb3f011e7ae412/IIndex.py |
for term, documents in self.removed_terms.keys(): for doc_number, positions in documents.keys(): self._index_term(term, doc_number, positions) | for term, documents in self.added_terms.items(): self._index_term(term, documents) | def _save(self): # Removed terms for term, documents in self.removed_terms.keys(): for doc_number in documents: self._unindex_term(term, doc_number) self.removed_terms = {} # Added terms for term, documents in self.removed_terms.keys(): for doc_number, positions in documents.keys(): self._index_term(term, doc_number, p... | 0f25159ac78f6533e983857dd8eb3f011e7ae412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0f25159ac78f6533e983857dd8eb3f011e7ae412/IIndex.py |
def _index_term(self, word, doc_number, positions): prefix, suffix = word[0], word[1:] | def _index_term(self, term, documents): """ Indexes the given term. The parameter 'documents' is a mapping from document number to list of positions: {<document number>: [postion, ...], ...} """ prefix, suffix = term[0], term[1:] | def _index_term(self, word, doc_number, positions): prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot slot_number = self.tree_handler._get_free_slot() subtree = self.children[prefix] = Tree(self, slot_number) # Update resource r = self.tree_handler.... | 0f25159ac78f6533e983857dd8eb3f011e7ae412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0f25159ac78f6533e983857dd8eb3f011e7ae412/IIndex.py |
subtree._index_term(suffix, doc_number, positions) | subtree._index_term(suffix, documents) | def _index_term(self, word, doc_number, positions): prefix, suffix = word[0], word[1:] if prefix in self.children: subtree = self.children[prefix] else: # Get an empty slot slot_number = self.tree_handler._get_free_slot() subtree = self.children[prefix] = Tree(self, slot_number) # Update resource r = self.tree_handler.... | 0f25159ac78f6533e983857dd8eb3f011e7ae412 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0f25159ac78f6533e983857dd8eb3f011e7ae412/IIndex.py |
def _get_handler(self, segment, uri): handler_class = here.get_handler_class(uri) return handler_class(uri) | ccffd93b52704fc7de70651dcf09c71bcbdc1dc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/ccffd93b52704fc7de70651dcf09c71bcbdc1dc6/Folder.py | ||
def get_handler(self, segment, resource): | def _get_handler(self, segment, resource): | def get_handler(self, segment, resource): return ListOfUsers(resource) | d77b89c2e4553add88c91818fe52c77d8221ca13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d77b89c2e4553add88c91818fe52c77d8221ca13/Group.py |
resource = memory.File(data) handler = CSV(resource) | handler = CSV() handler.load_state_from_string(data) | def test_unicode(self): data = '"Martin von Löwis","Marc André Lemburg","Guido van Rossum"\n' resource = memory.File(data) handler = CSV(resource) self.assertEqual(handler.get_rows(), [[u"Martin von Löwis", u"Marc André Lemburg", u"Guido van Rossum"]]) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_2) handler = CSV(resource) self.assertEqual(len(handler.get_rows()), 3) | handler = CSV() handler.load_state_from_string(TEST_DATA_2) rows = list(handler.get_rows()) self.assertEqual(len(rows), 3) | def test_num_of_lines(self): resource = memory.File(TEST_DATA_2) handler = CSV(resource) self.assertEqual(len(handler.get_rows()), 3) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(data) handler = CSV(resource) self.assertEqual(len(handler.get_rows()), 3) | handler = CSV() handler.load_state_from_string(data) rows = list(handler.get_rows()) self.assertEqual(len(rows), 3) | def test_num_of_lines_with_last_new_line(self): data = TEST_DATA_2 + '\r\n' resource = memory.File(data) handler = CSV(resource) self.assertEqual(len(handler.get_rows()), 3) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_1) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) | handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state_from_string(TEST_DATA_1) | def test_load_state_with_schema(self): resource = memory.File(TEST_DATA_1) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) self.assertEqual(handler.get_rows(), [ [u"python", URI.decode('http:... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_1) handler = CSV() handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) | handler = CSV() handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state_from_string(TEST_DATA_1) | def test_load_state_without_schema(self): resource = memory.File(TEST_DATA_1) handler = CSV() handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) self.assertEqual(handler.get_rows(), [ [u"python", u'http://python.org', u'52343', u'2003-10-23'], [u"ruby", u'http:/... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_1) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) | handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state_from_string(TEST_DATA_1) | def test_to_str_with_schema(self): resource = memory.File(TEST_DATA_1) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) self.assertEqual( handler.to_str(), u'"python","http://python.org","5234... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_1) handler = CSV() handler.load_state(resource) | handler = CSV() handler.load_state_from_string(TEST_DATA_1) | def test_to_str_without_schema(self): resource = memory.File(TEST_DATA_1) handler = CSV() handler.load_state(resource) self.assertEqual( handler.to_str(), u'"python","http://python.org","52343","2003-10-23"\n' u'"ruby","http://ruby-lang.org","42352","2001-03-28"') | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_2) handler = CSV(resource) | handler = CSV() handler.load_state_from_string(TEST_DATA_2) | def test_get_row(self): resource = memory.File(TEST_DATA_2) handler = CSV(resource) self.assertEqual(handler.get_row(1), ['four', 'five', 'six']) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_2) handler = CSV(resource) | handler = CSV() handler.load_state_from_string(TEST_DATA_2) | def test_get_rows(self): resource = memory.File(TEST_DATA_2) handler = CSV(resource) self.assertEqual(handler.get_rows([0, 1]), [ ['one', 'two', 'three'], ['four', 'five', 'six']]) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_2) handler = CSV(resource) | handler = CSV() handler.load_state_from_string(TEST_DATA_2) | def test_add_row(self): resource = memory.File(TEST_DATA_2) handler = CSV(resource) handler.add_row(['a', 'b', 'c']) self.assertEqual(handler.get_row(3), ['a', 'b', 'c']) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_2) handler = CSV(resource) | handler = CSV() handler.load_state_from_string(TEST_DATA_2) | def test_del_row(self): resource = memory.File(TEST_DATA_2) handler = CSV(resource) handler.del_row(1) self.assertEqual(handler.get_row(1), ['seven', 'eight', 'nine']) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_2) handler = CSV(resource) | handler = CSV() handler.load_state_from_string(TEST_DATA_2) | def test_del_rows(self): resource = memory.File(TEST_DATA_2) handler = CSV(resource) handler.del_rows([0, 1]) self.assertEqual(handler.get_row(0), ['seven', 'eight', 'nine']) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_2) handler = CSV(resource) | handler = CSV() handler.load_state_from_string(TEST_DATA_2) | def test_set_state_in_memory_resource(self): resource = memory.File(TEST_DATA_2) handler = CSV(resource) handler.add_row(['a', 'b', 'c']) handler.save_state() handler2 = CSV(resource) self.assertEqual(handler2.get_row(3), ['a', 'b', 'c']) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
handler2 = CSV(resource) | handler2 = CSV() handler2.load_state_from_string(TEST_DATA_2) | def test_set_state_in_memory_resource(self): resource = memory.File(TEST_DATA_2) handler = CSV(resource) handler.add_row(['a', 'b', 'c']) handler.save_state() handler2 = CSV(resource) self.assertEqual(handler2.get_row(3), ['a', 'b', 'c']) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = get_resource('test.csv') handler = CSV(resource) | handler = CSV('test.csv') | def test_set_state_in_file_resource(self): resource = get_resource('test.csv') handler = CSV(resource) handler.add_row(['d1', 'e1', 'f1']) handler.save_state() | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource2 = get_resource('test.csv') handler2 = CSV(resource2) | handler2 = CSV('test.csv') | def test_set_state_in_file_resource(self): resource = get_resource('test.csv') handler = CSV(resource) handler.add_row(['d1', 'e1', 'f1']) handler.save_state() | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = get_resource('test.csv') handler = CSV(resource) | handler = CSV('test.csv') | def test_set_state_in_file_resource(self): resource = get_resource('test.csv') handler = CSV(resource) handler.add_row(['d1', 'e1', 'f1']) handler.save_state() | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
data = TEST_DATA_1 resource = memory.File(data) | def test_indexes_hit_in_one_row(self): data = TEST_DATA_1 resource = memory.File(data) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer(index=True), 'date': Date(index=True)} handler.load_state(resource) self.assertEqual(len(handler.ind... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py | |
'number': Integer(index=True), 'date': Date(index=True)} handler.load_state(resource) | 'number': Integer(index='keyword'), 'date': Date(index='keyword')} handler.load_state_from_string(TEST_DATA_1) | def test_indexes_hit_in_one_row(self): data = TEST_DATA_1 resource = memory.File(data) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer(index=True), 'date': Date(index=True)} handler.load_state(resource) self.assertEqual(len(handler.ind... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(data) handler = CSV() | handler = CSV() handler.load_state_from_string(data) | def test_indexes_hit_in_many_rows(self): data = 'house,2005-10-10\nwindow,2005-05-10\ncomputer,2005-10-10' resource = memory.File(data) handler = CSV() handler.columns = ['name', 'date'] handler.schema = {'name': Unicode, 'date': Date(index=True)} handler.load_state(resource) self.assertEqual(handler.search(date=Date.d... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
handler.schema = {'name': Unicode, 'date': Date(index=True)} handler.load_state(resource) | handler.schema = {'name': Unicode, 'date': Date(index='keyword')} handler.load_state_from_string(data) | def test_indexes_hit_in_many_rows(self): data = 'house,2005-10-10\nwindow,2005-05-10\ncomputer,2005-10-10' resource = memory.File(data) handler = CSV() handler.columns = ['name', 'date'] handler.schema = {'name': Unicode, 'date': Date(index=True)} handler.load_state(resource) self.assertEqual(handler.search(date=Date.d... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(data) handler = CSV() | handler = CSV() handler.load_state_from_string(data) | def test_index_new_row(self): data = 'house,2005-10-10\nwindow,2005-05-10\ncomputer,2005-10-10' resource = memory.File(data) handler = CSV() handler.columns = ['name', 'date'] handler.schema = {'name': Unicode, 'date': Date(index=True)} handler.load_state(resource) handler.add_row(['flower', Date.decode('2005-05-10')])... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
handler.schema = {'name': Unicode, 'date': Date(index=True)} handler.load_state(resource) | handler.schema = {'name': Unicode, 'date': Date(index='keyword')} handler.load_state_from_string(data) | def test_index_new_row(self): data = 'house,2005-10-10\nwindow,2005-05-10\ncomputer,2005-10-10' resource = memory.File(data) handler = CSV() handler.columns = ['name', 'date'] handler.schema = {'name': Unicode, 'date': Date(index=True)} handler.load_state(resource) handler.add_row(['flower', Date.decode('2005-05-10')])... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(data) handler = CSV() | handler = CSV() handler.load_state_from_string(data) | def test_index_del_row(self): data = 'house,2005-10-10\nwindow,2005-05-10\ncomputer,2005-10-10' resource = memory.File(data) handler = CSV() handler.columns = ['name', 'date'] handler.schema = {'name': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) self.assertEqual(handler.search(name='wind... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
handler.schema = {'name': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) | handler.schema = {'name': Unicode(index='text'), 'date': Date(index='keyword')} handler.load_state_from_string(data) | def test_index_del_row(self): data = 'house,2005-10-10\nwindow,2005-05-10\ncomputer,2005-10-10' resource = memory.File(data) handler = CSV() handler.columns = ['name', 'date'] handler.schema = {'name': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) self.assertEqual(handler.search(name='wind... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File('') | def test_build_csv_data(self): resource = memory.File('') handler = CSV() handler.columns = ['name', 'surname', 'date'] handler.schema = {'name': Unicode, 'surname': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) handler.add_row(['Piotr', 'Macuk', '1975-12-08']) handler.add_row(['Basia', 'M... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py | |
handler.schema = {'name': Unicode, 'surname': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) | handler.schema = {'name': Unicode, 'surname': Unicode(index='text'), 'date': Date(index='keyword')} handler.load_state_from_string('') | def test_build_csv_data(self): resource = memory.File('') handler = CSV() handler.columns = ['name', 'surname', 'date'] handler.schema = {'name': Unicode, 'surname': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) handler.add_row(['Piotr', 'Macuk', '1975-12-08']) handler.add_row(['Basia', 'M... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = get_resource('test_adv.csv') | def test_advanced_search(self): resource = get_resource('test_adv.csv') handler = CSV() handler.columns = ['id', 'name', 'country', 'date'] handler.schema = {'id': Integer, 'name': Unicode(index=True), 'country': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) result1 = handler.search(name='... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py | |
handler.schema = {'id': Integer, 'name': Unicode(index=True), 'country': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) | handler.schema = {'id': Integer, 'name': Unicode(index='text'), 'country': Unicode(index='text'), 'date': Date(index='text')} handler.load_state_from_file('test_adv.csv') | def test_advanced_search(self): resource = get_resource('test_adv.csv') handler = CSV() handler.columns = ['id', 'name', 'country', 'date'] handler.schema = {'id': Integer, 'name': Unicode(index=True), 'country': Unicode(index=True), 'date': Date(index=True)} handler.load_state(resource) result1 = handler.search(name='... | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_1) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) | handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state_from_string(TEST_DATA_1) | def test_access_by_name(self): resource = memory.File(TEST_DATA_1) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_DATA_1) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) | handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state_from_string(TEST_DATA_1) | def test_get_row_as_handler(self): resource = memory.File(TEST_DATA_1) handler = CSV() handler.columns = ['name', 'url', 'number', 'date'] handler.schema = {'name': Unicode, 'url': URI, 'number': Integer, 'date': Date} handler.load_state(resource) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_SYNTAX_ERROR) self.assertRaises(ValueError, CSV, resource) | load_state = CSV().load_state_from_string self.assertRaises(ValueError, load_state, TEST_SYNTAX_ERROR) | def test_bad_syntax_csv_file(self): resource = memory.File(TEST_SYNTAX_ERROR) self.assertRaises(ValueError, CSV, resource) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
resource = memory.File(TEST_SYNTAX_ERROR) | def test_bad_syntax_csv_file_with_schema(self): resource = memory.File(TEST_SYNTAX_ERROR) handler = CSV() handler.columns = ['one', 'two', 'three'] handler.schema = {'one': Unicode, 'two': Unicode, 'three': Unicode} self.assertRaises(ValueError, handler.load_state, resource) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py | |
self.assertRaises(ValueError, handler.load_state, resource) | load_state = handler.load_state_from_string self.assertRaises(ValueError, load_state, TEST_SYNTAX_ERROR) | def test_bad_syntax_csv_file_with_schema(self): resource = memory.File(TEST_SYNTAX_ERROR) handler = CSV() handler.columns = ['one', 'two', 'three'] handler.schema = {'one': Unicode, 'two': Unicode, 'three': Unicode} self.assertRaises(ValueError, handler.load_state, resource) | 7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/7404f7e83f01f05f84fa82ab4b9b9fcd644b8aa8/test_csv.py |
return self.get_cookie(name) is None | return self.get_cookie(name) is not None | def has_cookie(self, name): return self.get_cookie(name) is None | 17be13aee16af5c9950e0c5e656c85094b788411 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/17be13aee16af5c9950e0c5e656c85094b788411/context.py |
for name in target.resource.get_names(): if name.startswith('.'): | user = context.user filter = (Folder, filter_type) for handler in target.search_handlers(handler_class=filter): ac = handler.get_access_control() if not ac.is_allowed_to_view(user, handler): | def __init__(self, filter_type=Handler, root=None, start=None): """ The 'start' must be a handler, 'filter_type' must be a handler class. """ context = get_context() request, response = context.request, context.response | 40a8cf1cf1eb99492d0971bf29eb1f152cdd158d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/40a8cf1cf1eb99492d0971bf29eb1f152cdd158d/widgets.py |
handler = target.get_handler(name) if handler.is_allowed_to_view(): path = here.get_pathto(handler) bc_target = str(root.get_pathto(handler)) url = context.uri.replace(bc_target=bc_target) is_folder = isinstance(handler, Folder) is_selectable = False if is_folder or isinstance(handler, filter_type): is_selectable = Tr... | path = here.get_pathto(handler) bc_target = str(root.get_pathto(handler)) url = context.uri.replace(bc_target=bc_target) self.is_submit = True path_to_icon = handler.get_path_to_icon(16) if path: path_to_handler = uri.Path(str(path) + '/') path_to_icon = path_to_handler.resolve(path_to_icon) objects.append({'name': h... | def __init__(self, filter_type=Handler, root=None, start=None): """ The 'start' must be a handler, 'filter_type' must be a handler class. """ context = get_context() request, response = context.request, context.response | 40a8cf1cf1eb99492d0971bf29eb1f152cdd158d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/40a8cf1cf1eb99492d0971bf29eb1f152cdd158d/widgets.py |
version = "0.6.1", | version = "0.6.2", | 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" | 77ef5269a46e24de89d71a2951a4fa876403d644 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/77ef5269a46e24de89d71a2951a4fa876403d644/setup.py |
s.append(node.replace('&', '&').replace('<', '<')) | s.append(XML_encoder.encode(Unicode.encode(node, encoding))) | def get_content_as_html(self, encoding='UTF-8'): s = [] for node in self.children: if isinstance(node, unicode): # XXX This is equivalent to 'Unicode.encode', # there should be a single place. s.append(node.replace('&', '&').replace('<', '<')) elif isinstance(node, Element): s.append(node.get_start_tag_as_html()... | d90bbf6f5e640dcc661c8a23ddb2e70b9613fa60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/d90bbf6f5e640dcc661c8a23ddb2e70b9613fa60/XHTML.py |
return self.resource.get_size() | return vfs.get_size(self.uri) | def get_size(self): """ Returns the size of this object. """ return self.resource.get_size() | fa27afcdd06d3aff7e8ef195c00eacf1c6d5033c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/fa27afcdd06d3aff7e8ef195c00eacf1c6d5033c/File.py |
resource = self.resource | def external_edit(self, context): # TODO check if zopeedit really needs the meta_type. encoding = context.get_form_value('encoding') | fa27afcdd06d3aff7e8ef195c00eacf1c6d5033c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/fa27afcdd06d3aff7e8ef195c00eacf1c6d5033c/File.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.