text_prompt stringlengths 157 13.1k | code_prompt stringlengths 7 19.8k ⌀ |
|---|---|
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def textMerge(self, second):
"""Merge two text nodes into one """ |
if second is None: second__o = None
else: second__o = second._o
ret = libxml2mod.xmlTextMerge(self._o, second__o)
if ret is None:raise treeError('xmlTextMerge() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def unsetProp(self, name):
"""Remove an attribute carried by a node. This handles only attributes in no namespace. """ |
ret = libxml2mod.xmlUnsetProp(self._o, name)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xincludeProcessTreeFlags(self, flags):
"""Implement the XInclude substitution for the given subtree """ |
ret = libxml2mod.xmlXIncludeProcessTreeFlags(self._o, flags)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpathCmpNodes(self, node2):
"""Compare two nodes w.r.t document order """ |
if node2 is None: node2__o = None
else: node2__o = node2._o
ret = libxml2mod.xmlXPathCmpNodes(self._o, node2__o)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpathNodeEval(self, str, ctx):
"""Evaluate the XPath Location Path in the given context. The node 'node' is set as the context node. The context node is not ... |
if ctx is None: ctx__o = None
else: ctx__o = ctx._o
ret = libxml2mod.xmlXPathNodeEval(self._o, str, ctx__o)
if ret is None:raise xpathError('xmlXPathNodeEval() failed')
return xpathObjectRet(ret) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpathNewNodeSet(self):
"""Create a new xmlXPathObjectPtr of type NodeSet and initialize it with the single Node @val """ |
ret = libxml2mod.xmlXPathNewNodeSet(self._o)
if ret is None:raise xpathError('xmlXPathNewNodeSet() failed')
return xpathObjectRet(ret) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpointerNewCollapsedRange(self):
"""Create a new xmlXPathObjectPtr of type range using a single nodes """ |
ret = libxml2mod.xmlXPtrNewCollapsedRange(self._o)
if ret is None:raise treeError('xmlXPtrNewCollapsedRange() failed')
return xpathObjectRet(ret) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpointerNewLocationSetNodes(self, end):
"""Create a new xmlXPathObjectPtr of type LocationSet and initialize it with the single range made of the two nodes @... |
if end is None: end__o = None
else: end__o = end._o
ret = libxml2mod.xmlXPtrNewLocationSetNodes(self._o, end__o)
if ret is None:raise treeError('xmlXPtrNewLocationSetNodes() failed')
return xpathObjectRet(ret) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpointerNewRange(self, startindex, end, endindex):
"""Create a new xmlXPathObjectPtr of type range """ |
if end is None: end__o = None
else: end__o = end._o
ret = libxml2mod.xmlXPtrNewRange(self._o, startindex, end__o, endindex)
if ret is None:raise treeError('xmlXPtrNewRange() failed')
return xpathObjectRet(ret) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpointerNewRangeNodes(self, end):
"""Create a new xmlXPathObjectPtr of type range using 2 nodes """ |
if end is None: end__o = None
else: end__o = end._o
ret = libxml2mod.xmlXPtrNewRangeNodes(self._o, end__o)
if ret is None:raise treeError('xmlXPtrNewRangeNodes() failed')
return xpathObjectRet(ret) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def htmlAutoCloseTag(self, name, elem):
"""The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function chec... |
ret = libxml2mod.htmlAutoCloseTag(self._o, name, elem)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def htmlIsAutoClosed(self, elem):
"""The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if ... |
ret = libxml2mod.htmlIsAutoClosed(self._o, elem)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def htmlDocDump(self, f):
"""Dump an HTML document to an open FILE. """ |
ret = libxml2mod.htmlDocDump(f, self._o)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def htmlNodeDumpFile(self, out, cur):
"""Dump an HTML node, recursive behaviour,children are printed too, and formatting returns are added. """ |
if cur is None: cur__o = None
else: cur__o = cur._o
libxml2mod.htmlNodeDumpFile(out, self._o, cur__o) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def htmlSaveFile(self, filename):
"""Dump an HTML document to a file. If @filename is "-" the stdout file is used. """ |
ret = libxml2mod.htmlSaveFile(filename, self._o)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def htmlSaveFileFormat(self, filename, encoding, format):
"""Dump an HTML document to a file using a given encoding. """ |
ret = libxml2mod.htmlSaveFileFormat(filename, self._o, encoding, format)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def debugCheckDocument(self, output):
"""Check the document for potential content problems, and output the errors to @output """ |
ret = libxml2mod.xmlDebugCheckDocument(output, self._o)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def addDocEntity(self, name, type, ExternalID, SystemID, content):
"""Register a new entity for this document. """ |
ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content)
if ret is None:raise treeError('xmlAddDocEntity() failed')
__tmp = xmlEntity(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def addDtdEntity(self, name, type, ExternalID, SystemID, content):
"""Register a new entity for this document DTD external subset. """ |
ret = libxml2mod.xmlAddDtdEntity(self._o, name, type, ExternalID, SystemID, content)
if ret is None:raise treeError('xmlAddDtdEntity() failed')
__tmp = xmlEntity(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def docEntity(self, name):
"""Do an entity lookup in the document entity hash table and """ |
ret = libxml2mod.xmlGetDocEntity(self._o, name)
if ret is None:raise treeError('xmlGetDocEntity() failed')
__tmp = xmlEntity(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def dtdEntity(self, name):
"""Do an entity lookup in the DTD entity hash table and """ |
ret = libxml2mod.xmlGetDtdEntity(self._o, name)
if ret is None:raise treeError('xmlGetDtdEntity() failed')
__tmp = xmlEntity(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def encodeEntitiesReentrant(self, input):
"""Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and Cha... |
ret = libxml2mod.xmlEncodeEntitiesReentrant(self._o, input)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def encodeSpecialChars(self, input):
"""Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result must be dealloc... |
ret = libxml2mod.xmlEncodeSpecialChars(self._o, input)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def parameterEntity(self, name):
"""Do an entity lookup in the internal and external subsets and """ |
ret = libxml2mod.xmlGetParameterEntity(self._o, name)
if ret is None:raise treeError('xmlGetParameterEntity() failed')
__tmp = xmlEntity(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def copyDoc(self, recursive):
"""Do a copy of the document info. If recursive, the content tree will be copied too as well as DTD, namespaces and entities. """ |
ret = libxml2mod.xmlCopyDoc(self._o, recursive)
if ret is None:raise treeError('xmlCopyDoc() failed')
__tmp = xmlDoc(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def createIntSubset(self, name, ExternalID, SystemID):
"""Create the internal subset of a document """ |
ret = libxml2mod.xmlCreateIntSubset(self._o, name, ExternalID, SystemID)
if ret is None:raise treeError('xmlCreateIntSubset() failed')
__tmp = xmlDtd(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def intSubset(self):
"""Get the internal subset of a document """ |
ret = libxml2mod.xmlGetIntSubset(self._o)
if ret is None:raise treeError('xmlGetIntSubset() failed')
__tmp = xmlDtd(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newCDataBlock(self, content, len):
"""Creation of a new node containing a CDATA block. """ |
ret = libxml2mod.xmlNewCDataBlock(self._o, content, len)
if ret is None:raise treeError('xmlNewCDataBlock() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newCharRef(self, name):
"""Creation of a new character reference node. """ |
ret = libxml2mod.xmlNewCharRef(self._o, name)
if ret is None:raise treeError('xmlNewCharRef() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newDocComment(self, content):
"""Creation of a new node containing a comment within a document. """ |
ret = libxml2mod.xmlNewDocComment(self._o, content)
if ret is None:raise treeError('xmlNewDocComment() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newDocFragment(self):
"""Creation of a new Fragment node. """ |
ret = libxml2mod.xmlNewDocFragment(self._o)
if ret is None:raise treeError('xmlNewDocFragment() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newDocPI(self, name, content):
"""Creation of a processing instruction element. """ |
ret = libxml2mod.xmlNewDocPI(self._o, name, content)
if ret is None:raise treeError('xmlNewDocPI() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newDocProp(self, name, value):
"""Create a new property carried by a document. """ |
ret = libxml2mod.xmlNewDocProp(self._o, name, value)
if ret is None:raise treeError('xmlNewDocProp() failed')
__tmp = xmlAttr(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newDocText(self, content):
"""Creation of a new text node within a document. """ |
ret = libxml2mod.xmlNewDocText(self._o, content)
if ret is None:raise treeError('xmlNewDocText() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newDocTextLen(self, content, len):
"""Creation of a new text node with an extra content length parameter. The text node pertain to a given document. """ |
ret = libxml2mod.xmlNewDocTextLen(self._o, content, len)
if ret is None:raise treeError('xmlNewDocTextLen() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newGlobalNs(self, href, prefix):
"""Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! """ |
ret = libxml2mod.xmlNewGlobalNs(self._o, href, prefix)
if ret is None:raise treeError('xmlNewGlobalNs() failed')
__tmp = xmlNs(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newReference(self, name):
"""Creation of a new reference node. """ |
ret = libxml2mod.xmlNewReference(self._o, name)
if ret is None:raise treeError('xmlNewReference() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def saveFileEnc(self, filename, encoding):
"""Dump an XML document, converting it to the given encoding """ |
ret = libxml2mod.xmlSaveFileEnc(filename, self._o, encoding)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def saveFormatFileEnc(self, filename, encoding, format):
"""Dump an XML document to a file or an URL. """ |
ret = libxml2mod.xmlSaveFormatFileEnc(filename, self._o, encoding, format)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def ID(self, ID):
"""Search the attribute declaring the given ID """ |
ret = libxml2mod.xmlGetID(self._o, ID)
if ret is None:raise treeError('xmlGetID() failed')
__tmp = xmlAttr(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xincludeProcessFlags(self, flags):
"""Implement the XInclude substitution on the XML document @doc """ |
ret = libxml2mod.xmlXIncludeProcessFlags(self._o, flags)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def readerWalker(self):
"""Create an xmltextReader for a preparsed document. """ |
ret = libxml2mod.xmlReaderWalker(self._o)
if ret is None:raise treeError('xmlReaderWalker() failed')
__tmp = xmlTextReader(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def schemaNewDocParserCtxt(self):
"""Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process. """ |
ret = libxml2mod.xmlSchemaNewDocParserCtxt(self._o)
if ret is None:raise parserError('xmlSchemaNewDocParserCtxt() failed')
__tmp = SchemaParserCtxt(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpathNewContext(self):
"""Create a new xmlXPathContext """ |
ret = libxml2mod.xmlXPathNewContext(self._o)
if ret is None:raise xpathError('xmlXPathNewContext() failed')
__tmp = xpathContext(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def doc(self):
"""Get the document tree from a parser context. """ |
ret = libxml2mod.xmlParserGetDoc(self._o)
if ret is None:raise parserError('xmlParserGetDoc() failed')
__tmp = xmlDoc(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def htmlCtxtReadFd(self, fd, URL, encoding, options):
"""parse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context """ |
ret = libxml2mod.htmlCtxtReadFd(self._o, fd, URL, encoding, options)
if ret is None:raise treeError('htmlCtxtReadFd() failed')
__tmp = xmlDoc(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def ctxtResetPush(self, chunk, size, filename, encoding):
"""Reset a push parser context """ |
ret = libxml2mod.xmlCtxtResetPush(self._o, chunk, size, filename, encoding)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def setupParserForBuffer(self, buffer, filename):
"""Setup the parser context to parse a new buffer; Clears any prior contents from the parser context. The buffe... |
libxml2mod.xmlSetupParserForBuffer(self._o, buffer, filename) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def debugDumpAttr(self, output, depth):
"""Dumps debug information for the attribute """ |
libxml2mod.xmlDebugDumpAttr(output, self._o, depth) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def debugDumpAttrList(self, output, depth):
"""Dumps debug information for the attribute list """ |
libxml2mod.xmlDebugDumpAttrList(output, self._o, depth) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def add(self, type, orig, replace):
"""Add an entry in the catalog, it may overwrite existing but different entries. """ |
ret = libxml2mod.xmlACatalogAdd(self._o, type, orig, replace)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def remove(self, value):
"""Remove an entry from the catalog """ |
ret = libxml2mod.xmlACatalogRemove(self._o, value)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def resolve(self, pubID, sysID):
"""Do a complete resolution lookup of an External Identifier """ |
ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def resolvePublic(self, pubID):
"""Try to lookup the catalog local reference associated to a public ID in that catalog """ |
ret = libxml2mod.xmlACatalogResolvePublic(self._o, pubID)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def resolveSystem(self, sysID):
"""Try to lookup the catalog resource for a system ID """ |
ret = libxml2mod.xmlACatalogResolveSystem(self._o, sysID)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def resolveURI(self, URI):
"""Do a complete resolution lookup of an URI """ |
ret = libxml2mod.xmlACatalogResolveURI(self._o, URI)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def copyDtd(self):
"""Do a copy of the dtd. """ |
ret = libxml2mod.xmlCopyDtd(self._o)
if ret is None:raise treeError('xmlCopyDtd() failed')
__tmp = xmlDtd(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def dtdAttrDesc(self, elem, name):
"""Search the DTD for the description of this attribute on this element. """ |
ret = libxml2mod.xmlGetDtdAttrDesc(self._o, elem, name)
if ret is None:raise treeError('xmlGetDtdAttrDesc() failed')
__tmp = xmlAttribute(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def dtdQAttrDesc(self, elem, name, prefix):
"""Search the DTD for the description of this qualified attribute on this element. """ |
ret = libxml2mod.xmlGetDtdQAttrDesc(self._o, elem, name, prefix)
if ret is None:raise treeError('xmlGetDtdQAttrDesc() failed')
__tmp = xmlAttribute(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def copyError(self, to):
"""Save the original error to the new place. """ |
if to is None: to__o = None
else: to__o = to._o
ret = libxml2mod.xmlCopyError(self._o, to__o)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def copyNamespace(self):
"""Do a copy of the namespace. """ |
ret = libxml2mod.xmlCopyNamespace(self._o)
if ret is None:raise treeError('xmlCopyNamespace() failed')
__tmp = xmlNs(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def copyNamespaceList(self):
"""Do a copy of an namespace list. """ |
ret = libxml2mod.xmlCopyNamespaceList(self._o)
if ret is None:raise treeError('xmlCopyNamespaceList() failed')
__tmp = xmlNs(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newNodeEatName(self, name):
"""Creation of a new node element. @ns is optional (None). """ |
ret = libxml2mod.xmlNewNodeEatName(self._o, name)
if ret is None:raise treeError('xmlNewNodeEatName() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def read(self, len):
"""Refresh the content of the input buffer, the old data are considered consumed This routine handle the I18N transcoding to internal UTF-8 ... |
ret = libxml2mod.xmlParserInputBufferRead(self._o, len)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def newTextReader(self, URI):
"""Create an xmlTextReader structure fed with @input """ |
ret = libxml2mod.xmlNewTextReader(self._o, URI)
if ret is None:raise treeError('xmlNewTextReader() failed')
__tmp = xmlTextReader(_obj=ret)
__tmp.input = self
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def regexpExec(self, content):
"""Check if the regular expression generates the value """ |
ret = libxml2mod.xmlRegexpExec(self._o, content)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def relaxParserSetFlag(self, flags):
"""Semi private function used to pass informations to a parser context which are a combination of xmlRelaxNGParserFlag . """ |
ret = libxml2mod.xmlRelaxParserSetFlag(self._o, flags)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def relaxNGNewValidCtxt(self):
"""Create an XML RelaxNGs validation context based on the given schema """ |
ret = libxml2mod.xmlRelaxNGNewValidCtxt(self._o)
if ret is None:raise treeError('xmlRelaxNGNewValidCtxt() failed')
__tmp = relaxNgValidCtxt(_obj=ret)
__tmp.schema = self
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def schemaNewValidCtxt(self):
"""Create an XML Schemas validation context based on the given schema. """ |
ret = libxml2mod.xmlSchemaNewValidCtxt(self._o)
if ret is None:raise treeError('xmlSchemaNewValidCtxt() failed')
__tmp = SchemaValidCtxt(_obj=ret)
__tmp.schema = self
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def schemaSetValidOptions(self, options):
"""Sets the options to be used during the validation. """ |
ret = libxml2mod.xmlSchemaSetValidOptions(self._o, options)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def schemaValidCtxtGetParserCtxt(self):
"""allow access to the parser context of the schema validation context """ |
ret = libxml2mod.xmlSchemaValidCtxtGetParserCtxt(self._o)
if ret is None:raise parserError('xmlSchemaValidCtxtGetParserCtxt() failed')
__tmp = parserCtxt(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def schemaValidateFile(self, filename, options):
"""Do a schemas validation of the given resource, it will use the SAX streamable validation internally. """ |
ret = libxml2mod.xmlSchemaValidateFile(self._o, filename, options)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def CurrentNode(self):
"""Hacking interface allowing to get the xmlNodePtr correponding to the current node being accessed by the xmlTextReader. This is dangerou... |
ret = libxml2mod.xmlTextReaderCurrentNode(self._o)
if ret is None:raise treeError('xmlTextReaderCurrentNode() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def GetAttribute(self, name):
"""Provides the value of the attribute with the specified qualified name. """ |
ret = libxml2mod.xmlTextReaderGetAttribute(self._o, name)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def GetAttributeNo(self, no):
"""Provides the value of the attribute with the specified index relative to the containing element. """ |
ret = libxml2mod.xmlTextReaderGetAttributeNo(self._o, no)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def GetAttributeNs(self, localName, namespaceURI):
"""Provides the value of the specified attribute """ |
ret = libxml2mod.xmlTextReaderGetAttributeNs(self._o, localName, namespaceURI)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def GetParserProp(self, prop):
"""Read the parser internal property. """ |
ret = libxml2mod.xmlTextReaderGetParserProp(self._o, prop)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def GetRemainder(self):
"""Method to get the remainder of the buffered XML. this method stops the parser, set its state to End Of File and return the input strea... |
ret = libxml2mod.xmlTextReaderGetRemainder(self._o)
if ret is None:raise treeError('xmlTextReaderGetRemainder() failed')
__tmp = inputBuffer(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def LookupNamespace(self, prefix):
"""Resolves a namespace prefix in the scope of the current element. """ |
ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def MoveToAttribute(self, name):
"""Moves the position of the current instance to the attribute with the specified qualified name. """ |
ret = libxml2mod.xmlTextReaderMoveToAttribute(self._o, name)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def MoveToAttributeNo(self, no):
"""Moves the position of the current instance to the attribute with the specified index relative to the containing element. """ |
ret = libxml2mod.xmlTextReaderMoveToAttributeNo(self._o, no)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def MoveToAttributeNs(self, localName, namespaceURI):
"""Moves the position of the current instance to the attribute with the specified local name and namespace ... |
ret = libxml2mod.xmlTextReaderMoveToAttributeNs(self._o, localName, namespaceURI)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def NewFd(self, fd, URL, encoding, options):
"""Setup an xmltextReader to parse an XML from a file descriptor. NOTE that the file descriptor will not be closed w... |
ret = libxml2mod.xmlReaderNewFd(self._o, fd, URL, encoding, options)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def SetParserProp(self, prop, value):
"""Change the parser processing behaviour by changing some of its internal properties. Note that some properties can only b... |
ret = libxml2mod.xmlTextReaderSetParserProp(self._o, prop, value)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def String(self, str):
"""Get an interned string from the reader, allows for example to speedup string name comparisons """ |
ret = libxml2mod.xmlTextReaderConstString(self._o, str)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def parseURIReference(self, str):
"""Parse an URI reference string based on RFC 3986 and fills in the appropriate fields of the @uri structure URI-reference = UR... |
ret = libxml2mod.xmlParseURIReference(self._o, str)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def contextDoc(self):
"""Get the doc from an xpathContext """ |
ret = libxml2mod.xmlXPathGetContextDoc(self._o)
if ret is None:raise xpathError('xmlXPathGetContextDoc() failed')
__tmp = xmlDoc(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def contextNode(self):
"""Get the current node from an xpathContext """ |
ret = libxml2mod.xmlXPathGetContextNode(self._o)
if ret is None:raise xpathError('xmlXPathGetContextNode() failed')
__tmp = xmlNode(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def setContextDoc(self, doc):
"""Set the doc of an xpathContext """ |
if doc is None: doc__o = None
else: doc__o = doc._o
libxml2mod.xmlXPathSetContextDoc(self._o, doc__o) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def setContextNode(self, node):
"""Set the current node of an xpathContext """ |
if node is None: node__o = None
else: node__o = node._o
libxml2mod.xmlXPathSetContextNode(self._o, node__o) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def registerXPathFunction(self, name, ns_uri, f):
"""Register a Python written function to the XPath interpreter """ |
ret = libxml2mod.xmlRegisterXPathFunction(self._o, name, ns_uri, f)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpathRegisterVariable(self, name, ns_uri, value):
"""Register a variable with the XPath context """ |
ret = libxml2mod.xmlXPathRegisterVariable(self._o, name, ns_uri, value)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpathEvalExpression(self, str):
"""Evaluate the XPath expression in the given context. """ |
ret = libxml2mod.xmlXPathEvalExpression(str, self._o)
if ret is None:raise xpathError('xmlXPathEvalExpression() failed')
return xpathObjectRet(ret) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpathNewParserContext(self, str):
"""Create a new xmlXPathParserContext """ |
ret = libxml2mod.xmlXPathNewParserContext(str, self._o)
if ret is None:raise xpathError('xmlXPathNewParserContext() failed')
__tmp = xpathParserContext(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpathNsLookup(self, prefix):
"""Search in the namespace declaration array of the context for the given namespace name associated to the given prefix """ |
ret = libxml2mod.xmlXPathNsLookup(self._o, prefix)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpathRegisterNs(self, prefix, ns_uri):
"""Register a new namespace. If @ns_uri is None it unregisters the namespace """ |
ret = libxml2mod.xmlXPathRegisterNs(self._o, prefix, ns_uri)
return ret |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def context(self):
"""Get the xpathContext from an xpathParserContext """ |
ret = libxml2mod.xmlXPathParserGetContext(self._o)
if ret is None:raise xpathError('xmlXPathParserGetContext() failed')
__tmp = xpathContext(_obj=ret)
return __tmp |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def xpatherror(self, file, line, no):
"""Formats an error message. """ |
libxml2mod.xmlXPatherror(self._o, file, line, no) |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def traverse (target, include_roots = False, include_sources = False):
""" Traverses the dependency graph of 'target' and return all targets that will be created... |
assert isinstance(target, VirtualTarget)
assert isinstance(include_roots, (int, bool))
assert isinstance(include_sources, (int, bool))
result = []
if target.action ():
action = target.action ()
# This includes 'target' as well
result += action.targets ()
for t in ... |
<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
def clone_action (action, new_project, new_action_name, new_properties):
"""Takes an 'action' instances and creates new instance of it and all produced target. T... |
if __debug__:
from .targets import ProjectTarget
assert isinstance(action, Action)
assert isinstance(new_project, ProjectTarget)
assert isinstance(new_action_name, basestring)
assert isinstance(new_properties, property_set.PropertySet)
if not new_action_name:
new... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.