repo
stringlengths
7
55
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
19
28.4k
docstring
stringlengths
1
46.9k
docstring_tokens
listlengths
1
1.97k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
Schema.schemaNewValidCtxt
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
python
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
[ "def", "schemaNewValidCtxt", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlSchemaNewValidCtxt", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlSchemaNewValidCtxt() failed'", ")", "__tmp", "=", "SchemaValidCtxt", "(", "_obj", "=", "ret", ")", "__tmp", ".", "schema", "=", "self", "return", "__tmp" ]
Create an XML Schemas validation context based on the given schema.
[ "Create", "an", "XML", "Schemas", "validation", "context", "based", "on", "the", "given", "schema", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6409-L6416
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
SchemaValidCtxt.SchemaValidateCtxt
def SchemaValidateCtxt(self, reader, options): """Use W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then XML Schema validation is deactivated. """ if reader is None: reader__o = None else: reader__o = reader._o ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(reader__o, self._o, options) return ret
python
def SchemaValidateCtxt(self, reader, options): """Use W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then XML Schema validation is deactivated. """ if reader is None: reader__o = None else: reader__o = reader._o ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(reader__o, self._o, options) return ret
[ "def", "SchemaValidateCtxt", "(", "self", ",", "reader", ",", "options", ")", ":", "if", "reader", "is", "None", ":", "reader__o", "=", "None", "else", ":", "reader__o", "=", "reader", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlTextReaderSchemaValidateCtxt", "(", "reader__o", ",", "self", ".", "_o", ",", "options", ")", "return", "ret" ]
Use W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then XML Schema validation is deactivated.
[ "Use", "W3C", "XSD", "schema", "context", "to", "validate", "the", "document", "as", "it", "is", "processed", ".", "Activation", "is", "only", "possible", "before", "the", "first", "Read", "()", ".", "If" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6433-L6441
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
SchemaValidCtxt.schemaSetValidOptions
def schemaSetValidOptions(self, options): """Sets the options to be used during the validation. """ ret = libxml2mod.xmlSchemaSetValidOptions(self._o, options) return ret
python
def schemaSetValidOptions(self, options): """Sets the options to be used during the validation. """ ret = libxml2mod.xmlSchemaSetValidOptions(self._o, options) return ret
[ "def", "schemaSetValidOptions", "(", "self", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlSchemaSetValidOptions", "(", "self", ".", "_o", ",", "options", ")", "return", "ret" ]
Sets the options to be used during the validation.
[ "Sets", "the", "options", "to", "be", "used", "during", "the", "validation", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6452-L6455
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
SchemaValidCtxt.schemaValidCtxtGetParserCtxt
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
python
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
[ "def", "schemaValidCtxtGetParserCtxt", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlSchemaValidCtxtGetParserCtxt", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "parserError", "(", "'xmlSchemaValidCtxtGetParserCtxt() failed'", ")", "__tmp", "=", "parserCtxt", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
allow access to the parser context of the schema validation context
[ "allow", "access", "to", "the", "parser", "context", "of", "the", "schema", "validation", "context" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6462-L6468
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
SchemaValidCtxt.schemaValidateDoc
def schemaValidateDoc(self, doc): """Validate a document tree in memory. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlSchemaValidateDoc(self._o, doc__o) return ret
python
def schemaValidateDoc(self, doc): """Validate a document tree in memory. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlSchemaValidateDoc(self._o, doc__o) return ret
[ "def", "schemaValidateDoc", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlSchemaValidateDoc", "(", "self", ".", "_o", ",", "doc__o", ")", "return", "ret" ]
Validate a document tree in memory.
[ "Validate", "a", "document", "tree", "in", "memory", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6470-L6475
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
SchemaValidCtxt.schemaValidateFile
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
python
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
[ "def", "schemaValidateFile", "(", "self", ",", "filename", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlSchemaValidateFile", "(", "self", ".", "_o", ",", "filename", ",", "options", ")", "return", "ret" ]
Do a schemas validation of the given resource, it will use the SAX streamable validation internally.
[ "Do", "a", "schemas", "validation", "of", "the", "given", "resource", "it", "will", "use", "the", "SAX", "streamable", "validation", "internally", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6477-L6481
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
SchemaValidCtxt.schemaValidateOneElement
def schemaValidateOneElement(self, elem): """Validate a branch of a tree, starting with the given @elem. """ if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlSchemaValidateOneElement(self._o, elem__o) return ret
python
def schemaValidateOneElement(self, elem): """Validate a branch of a tree, starting with the given @elem. """ if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlSchemaValidateOneElement(self._o, elem__o) return ret
[ "def", "schemaValidateOneElement", "(", "self", ",", "elem", ")", ":", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlSchemaValidateOneElement", "(", "self", ".", "_o", ",", "elem__o", ")", "return", "ret" ]
Validate a branch of a tree, starting with the given @elem.
[ "Validate", "a", "branch", "of", "a", "tree", "starting", "with", "the", "given" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6483-L6488
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.CurrentDoc
def CurrentDoc(self): """Hacking interface allowing to get the xmlDocPtr correponding to the current document being accessed by the xmlTextReader. NOTE: as a result of this call, the reader will not destroy the associated XML document and calling xmlFreeDoc() on the result is needed once the reader parsing has finished. """ ret = libxml2mod.xmlTextReaderCurrentDoc(self._o) if ret is None:raise treeError('xmlTextReaderCurrentDoc() failed') __tmp = xmlDoc(_obj=ret) return __tmp
python
def CurrentDoc(self): """Hacking interface allowing to get the xmlDocPtr correponding to the current document being accessed by the xmlTextReader. NOTE: as a result of this call, the reader will not destroy the associated XML document and calling xmlFreeDoc() on the result is needed once the reader parsing has finished. """ ret = libxml2mod.xmlTextReaderCurrentDoc(self._o) if ret is None:raise treeError('xmlTextReaderCurrentDoc() failed') __tmp = xmlDoc(_obj=ret) return __tmp
[ "def", "CurrentDoc", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderCurrentDoc", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlTextReaderCurrentDoc() failed'", ")", "__tmp", "=", "xmlDoc", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Hacking interface allowing to get the xmlDocPtr correponding to the current document being accessed by the xmlTextReader. NOTE: as a result of this call, the reader will not destroy the associated XML document and calling xmlFreeDoc() on the result is needed once the reader parsing has finished.
[ "Hacking", "interface", "allowing", "to", "get", "the", "xmlDocPtr", "correponding", "to", "the", "current", "document", "being", "accessed", "by", "the", "xmlTextReader", ".", "NOTE", ":", "as", "a", "result", "of", "this", "call", "the", "reader", "will", "not", "destroy", "the", "associated", "XML", "document", "and", "calling", "xmlFreeDoc", "()", "on", "the", "result", "is", "needed", "once", "the", "reader", "parsing", "has", "finished", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6555-L6565
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.CurrentNode
def CurrentNode(self): """Hacking interface allowing to get the xmlNodePtr correponding to the current node being accessed by the xmlTextReader. This is dangerous because the underlying node may be destroyed on the next Reads. """ ret = libxml2mod.xmlTextReaderCurrentNode(self._o) if ret is None:raise treeError('xmlTextReaderCurrentNode() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def CurrentNode(self): """Hacking interface allowing to get the xmlNodePtr correponding to the current node being accessed by the xmlTextReader. This is dangerous because the underlying node may be destroyed on the next Reads. """ ret = libxml2mod.xmlTextReaderCurrentNode(self._o) if ret is None:raise treeError('xmlTextReaderCurrentNode() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "CurrentNode", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderCurrentNode", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlTextReaderCurrentNode() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Hacking interface allowing to get the xmlNodePtr correponding to the current node being accessed by the xmlTextReader. This is dangerous because the underlying node may be destroyed on the next Reads.
[ "Hacking", "interface", "allowing", "to", "get", "the", "xmlNodePtr", "correponding", "to", "the", "current", "node", "being", "accessed", "by", "the", "xmlTextReader", ".", "This", "is", "dangerous", "because", "the", "underlying", "node", "may", "be", "destroyed", "on", "the", "next", "Reads", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6567-L6575
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.Expand
def Expand(self): """Reads the contents of the current node and the full subtree. It then makes the subtree available until the next xmlTextReaderRead() call """ ret = libxml2mod.xmlTextReaderExpand(self._o) if ret is None:raise treeError('xmlTextReaderExpand() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def Expand(self): """Reads the contents of the current node and the full subtree. It then makes the subtree available until the next xmlTextReaderRead() call """ ret = libxml2mod.xmlTextReaderExpand(self._o) if ret is None:raise treeError('xmlTextReaderExpand() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "Expand", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderExpand", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlTextReaderExpand() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Reads the contents of the current node and the full subtree. It then makes the subtree available until the next xmlTextReaderRead() call
[ "Reads", "the", "contents", "of", "the", "current", "node", "and", "the", "full", "subtree", ".", "It", "then", "makes", "the", "subtree", "available", "until", "the", "next", "xmlTextReaderRead", "()", "call" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6587-L6594
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.GetAttribute
def GetAttribute(self, name): """Provides the value of the attribute with the specified qualified name. """ ret = libxml2mod.xmlTextReaderGetAttribute(self._o, name) return ret
python
def GetAttribute(self, name): """Provides the value of the attribute with the specified qualified name. """ ret = libxml2mod.xmlTextReaderGetAttribute(self._o, name) return ret
[ "def", "GetAttribute", "(", "self", ",", "name", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderGetAttribute", "(", "self", ".", "_o", ",", "name", ")", "return", "ret" ]
Provides the value of the attribute with the specified qualified name.
[ "Provides", "the", "value", "of", "the", "attribute", "with", "the", "specified", "qualified", "name", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6596-L6600
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.GetAttributeNo
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
python
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
[ "def", "GetAttributeNo", "(", "self", ",", "no", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderGetAttributeNo", "(", "self", ".", "_o", ",", "no", ")", "return", "ret" ]
Provides the value of the attribute with the specified index relative to the containing element.
[ "Provides", "the", "value", "of", "the", "attribute", "with", "the", "specified", "index", "relative", "to", "the", "containing", "element", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6602-L6606
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.GetAttributeNs
def GetAttributeNs(self, localName, namespaceURI): """Provides the value of the specified attribute """ ret = libxml2mod.xmlTextReaderGetAttributeNs(self._o, localName, namespaceURI) return ret
python
def GetAttributeNs(self, localName, namespaceURI): """Provides the value of the specified attribute """ ret = libxml2mod.xmlTextReaderGetAttributeNs(self._o, localName, namespaceURI) return ret
[ "def", "GetAttributeNs", "(", "self", ",", "localName", ",", "namespaceURI", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderGetAttributeNs", "(", "self", ".", "_o", ",", "localName", ",", "namespaceURI", ")", "return", "ret" ]
Provides the value of the specified attribute
[ "Provides", "the", "value", "of", "the", "specified", "attribute" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6608-L6611
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.GetParserProp
def GetParserProp(self, prop): """Read the parser internal property. """ ret = libxml2mod.xmlTextReaderGetParserProp(self._o, prop) return ret
python
def GetParserProp(self, prop): """Read the parser internal property. """ ret = libxml2mod.xmlTextReaderGetParserProp(self._o, prop) return ret
[ "def", "GetParserProp", "(", "self", ",", "prop", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderGetParserProp", "(", "self", ".", "_o", ",", "prop", ")", "return", "ret" ]
Read the parser internal property.
[ "Read", "the", "parser", "internal", "property", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6623-L6626
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.GetRemainder
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 stream with what is left that the parser did not use. The implementation is not good, the parser certainly procgressed past what's left in reader->input, and there is an allocation problem. Best would be to rewrite it differently. """ ret = libxml2mod.xmlTextReaderGetRemainder(self._o) if ret is None:raise treeError('xmlTextReaderGetRemainder() failed') __tmp = inputBuffer(_obj=ret) return __tmp
python
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 stream with what is left that the parser did not use. The implementation is not good, the parser certainly procgressed past what's left in reader->input, and there is an allocation problem. Best would be to rewrite it differently. """ ret = libxml2mod.xmlTextReaderGetRemainder(self._o) if ret is None:raise treeError('xmlTextReaderGetRemainder() failed') __tmp = inputBuffer(_obj=ret) return __tmp
[ "def", "GetRemainder", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderGetRemainder", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlTextReaderGetRemainder() failed'", ")", "__tmp", "=", "inputBuffer", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
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 stream with what is left that the parser did not use. The implementation is not good, the parser certainly procgressed past what's left in reader->input, and there is an allocation problem. Best would be to rewrite it differently.
[ "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", "stream", "with", "what", "is", "left", "that", "the", "parser", "did", "not", "use", ".", "The", "implementation", "is", "not", "good", "the", "parser", "certainly", "procgressed", "past", "what", "s", "left", "in", "reader", "-", ">", "input", "and", "there", "is", "an", "allocation", "problem", ".", "Best", "would", "be", "to", "rewrite", "it", "differently", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6628-L6639
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.LookupNamespace
def LookupNamespace(self, prefix): """Resolves a namespace prefix in the scope of the current element. """ ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix) return ret
python
def LookupNamespace(self, prefix): """Resolves a namespace prefix in the scope of the current element. """ ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix) return ret
[ "def", "LookupNamespace", "(", "self", ",", "prefix", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderLookupNamespace", "(", "self", ".", "_o", ",", "prefix", ")", "return", "ret" ]
Resolves a namespace prefix in the scope of the current element.
[ "Resolves", "a", "namespace", "prefix", "in", "the", "scope", "of", "the", "current", "element", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6678-L6682
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.MoveToAttribute
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
python
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
[ "def", "MoveToAttribute", "(", "self", ",", "name", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderMoveToAttribute", "(", "self", ".", "_o", ",", "name", ")", "return", "ret" ]
Moves the position of the current instance to the attribute with the specified qualified name.
[ "Moves", "the", "position", "of", "the", "current", "instance", "to", "the", "attribute", "with", "the", "specified", "qualified", "name", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6684-L6688
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.MoveToAttributeNo
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
python
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
[ "def", "MoveToAttributeNo", "(", "self", ",", "no", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderMoveToAttributeNo", "(", "self", ".", "_o", ",", "no", ")", "return", "ret" ]
Moves the position of the current instance to the attribute with the specified index relative to the containing element.
[ "Moves", "the", "position", "of", "the", "current", "instance", "to", "the", "attribute", "with", "the", "specified", "index", "relative", "to", "the", "containing", "element", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6690-L6694
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.MoveToAttributeNs
def MoveToAttributeNs(self, localName, namespaceURI): """Moves the position of the current instance to the attribute with the specified local name and namespace URI. """ ret = libxml2mod.xmlTextReaderMoveToAttributeNs(self._o, localName, namespaceURI) return ret
python
def MoveToAttributeNs(self, localName, namespaceURI): """Moves the position of the current instance to the attribute with the specified local name and namespace URI. """ ret = libxml2mod.xmlTextReaderMoveToAttributeNs(self._o, localName, namespaceURI) return ret
[ "def", "MoveToAttributeNs", "(", "self", ",", "localName", ",", "namespaceURI", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderMoveToAttributeNs", "(", "self", ".", "_o", ",", "localName", ",", "namespaceURI", ")", "return", "ret" ]
Moves the position of the current instance to the attribute with the specified local name and namespace URI.
[ "Moves", "the", "position", "of", "the", "current", "instance", "to", "the", "attribute", "with", "the", "specified", "local", "name", "and", "namespace", "URI", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6696-L6700
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.NewDoc
def NewDoc(self, cur, URL, encoding, options): """Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewDoc(self._o, cur, URL, encoding, options) return ret
python
def NewDoc(self, cur, URL, encoding, options): """Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewDoc(self._o, cur, URL, encoding, options) return ret
[ "def", "NewDoc", "(", "self", ",", "cur", ",", "URL", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlReaderNewDoc", "(", "self", ".", "_o", ",", "cur", ",", "URL", ",", "encoding", ",", "options", ")", "return", "ret" ]
Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader.
[ "Setup", "an", "xmltextReader", "to", "parse", "an", "XML", "in", "-", "memory", "document", ".", "The", "parsing", "flags" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6730-L6736
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.NewFd
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 when the reader is closed or reset. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewFd(self._o, fd, URL, encoding, options) return ret
python
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 when the reader is closed or reset. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewFd(self._o, fd, URL, encoding, options) return ret
[ "def", "NewFd", "(", "self", ",", "fd", ",", "URL", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlReaderNewFd", "(", "self", ".", "_o", ",", "fd", ",", "URL", ",", "encoding", ",", "options", ")", "return", "ret" ]
Setup an xmltextReader to parse an XML from a file descriptor. NOTE that the file descriptor will not be closed when the reader is closed or reset. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader.
[ "Setup", "an", "xmltextReader", "to", "parse", "an", "XML", "from", "a", "file", "descriptor", ".", "NOTE", "that", "the", "file", "descriptor", "will", "not", "be", "closed", "when", "the", "reader", "is", "closed", "or", "reset", ".", "The", "parsing", "flags" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6738-L6745
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.NewFile
def NewFile(self, filename, encoding, options): """parse an XML file from the filesystem or the network. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewFile(self._o, filename, encoding, options) return ret
python
def NewFile(self, filename, encoding, options): """parse an XML file from the filesystem or the network. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewFile(self._o, filename, encoding, options) return ret
[ "def", "NewFile", "(", "self", ",", "filename", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlReaderNewFile", "(", "self", ".", "_o", ",", "filename", ",", "encoding", ",", "options", ")", "return", "ret" ]
parse an XML file from the filesystem or the network. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader.
[ "parse", "an", "XML", "file", "from", "the", "filesystem", "or", "the", "network", ".", "The", "parsing", "flags" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6747-L6753
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.NewMemory
def NewMemory(self, buffer, size, URL, encoding, options): """Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewMemory(self._o, buffer, size, URL, encoding, options) return ret
python
def NewMemory(self, buffer, size, URL, encoding, options): """Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader. """ ret = libxml2mod.xmlReaderNewMemory(self._o, buffer, size, URL, encoding, options) return ret
[ "def", "NewMemory", "(", "self", ",", "buffer", ",", "size", ",", "URL", ",", "encoding", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlReaderNewMemory", "(", "self", ".", "_o", ",", "buffer", ",", "size", ",", "URL", ",", "encoding", ",", "options", ")", "return", "ret" ]
Setup an xmltextReader to parse an XML in-memory document. The parsing flags @options are a combination of xmlParserOption. This reuses the existing @reader xmlTextReader.
[ "Setup", "an", "xmltextReader", "to", "parse", "an", "XML", "in", "-", "memory", "document", ".", "The", "parsing", "flags" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6755-L6761
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.NewWalker
def NewWalker(self, doc): """Setup an xmltextReader to parse a preparsed XML document. This reuses the existing @reader xmlTextReader. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlReaderNewWalker(self._o, doc__o) return ret
python
def NewWalker(self, doc): """Setup an xmltextReader to parse a preparsed XML document. This reuses the existing @reader xmlTextReader. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlReaderNewWalker(self._o, doc__o) return ret
[ "def", "NewWalker", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlReaderNewWalker", "(", "self", ".", "_o", ",", "doc__o", ")", "return", "ret" ]
Setup an xmltextReader to parse a preparsed XML document. This reuses the existing @reader xmlTextReader.
[ "Setup", "an", "xmltextReader", "to", "parse", "a", "preparsed", "XML", "document", ".", "This", "reuses", "the", "existing" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6763-L6769
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.Preserve
def Preserve(self): """This tells the XML Reader to preserve the current node. The caller must also use xmlTextReaderCurrentDoc() to keep an handle on the resulting document once parsing has finished """ ret = libxml2mod.xmlTextReaderPreserve(self._o) if ret is None:raise treeError('xmlTextReaderPreserve() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def Preserve(self): """This tells the XML Reader to preserve the current node. The caller must also use xmlTextReaderCurrentDoc() to keep an handle on the resulting document once parsing has finished """ ret = libxml2mod.xmlTextReaderPreserve(self._o) if ret is None:raise treeError('xmlTextReaderPreserve() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "Preserve", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderPreserve", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlTextReaderPreserve() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
This tells the XML Reader to preserve the current node. The caller must also use xmlTextReaderCurrentDoc() to keep an handle on the resulting document once parsing has finished
[ "This", "tells", "the", "XML", "Reader", "to", "preserve", "the", "current", "node", ".", "The", "caller", "must", "also", "use", "xmlTextReaderCurrentDoc", "()", "to", "keep", "an", "handle", "on", "the", "resulting", "document", "once", "parsing", "has", "finished" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6807-L6814
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.RelaxNGSetSchema
def RelaxNGSetSchema(self, schema): """Use RelaxNG to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then RelaxNG validation is desactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated. """ if schema is None: schema__o = None else: schema__o = schema._o ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(self._o, schema__o) return ret
python
def RelaxNGSetSchema(self, schema): """Use RelaxNG to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then RelaxNG validation is desactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated. """ if schema is None: schema__o = None else: schema__o = schema._o ret = libxml2mod.xmlTextReaderRelaxNGSetSchema(self._o, schema__o) return ret
[ "def", "RelaxNGSetSchema", "(", "self", ",", "schema", ")", ":", "if", "schema", "is", "None", ":", "schema__o", "=", "None", "else", ":", "schema__o", "=", "schema", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlTextReaderRelaxNGSetSchema", "(", "self", ".", "_o", ",", "schema__o", ")", "return", "ret" ]
Use RelaxNG to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then RelaxNG validation is desactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated.
[ "Use", "RelaxNG", "to", "validate", "the", "document", "as", "it", "is", "processed", ".", "Activation", "is", "only", "possible", "before", "the", "first", "Read", "()", ".", "if" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6856-L6865
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.RelaxNGValidate
def RelaxNGValidate(self, rng): """Use RelaxNG schema to validate the document as it is processed. Activation is only possible before the first Read(). If @rng is None, then RelaxNG schema validation is deactivated. """ ret = libxml2mod.xmlTextReaderRelaxNGValidate(self._o, rng) return ret
python
def RelaxNGValidate(self, rng): """Use RelaxNG schema to validate the document as it is processed. Activation is only possible before the first Read(). If @rng is None, then RelaxNG schema validation is deactivated. """ ret = libxml2mod.xmlTextReaderRelaxNGValidate(self._o, rng) return ret
[ "def", "RelaxNGValidate", "(", "self", ",", "rng", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderRelaxNGValidate", "(", "self", ".", "_o", ",", "rng", ")", "return", "ret" ]
Use RelaxNG schema to validate the document as it is processed. Activation is only possible before the first Read(). If @rng is None, then RelaxNG schema validation is deactivated.
[ "Use", "RelaxNG", "schema", "to", "validate", "the", "document", "as", "it", "is", "processed", ".", "Activation", "is", "only", "possible", "before", "the", "first", "Read", "()", ".", "If" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6867-L6873
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.RelaxNGValidateCtxt
def RelaxNGValidateCtxt(self, ctxt, options): """Use RelaxNG schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then RelaxNG schema validation is deactivated. """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o ret = libxml2mod.xmlTextReaderRelaxNGValidateCtxt(self._o, ctxt__o, options) return ret
python
def RelaxNGValidateCtxt(self, ctxt, options): """Use RelaxNG schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then RelaxNG schema validation is deactivated. """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o ret = libxml2mod.xmlTextReaderRelaxNGValidateCtxt(self._o, ctxt__o, options) return ret
[ "def", "RelaxNGValidateCtxt", "(", "self", ",", "ctxt", ",", "options", ")", ":", "if", "ctxt", "is", "None", ":", "ctxt__o", "=", "None", "else", ":", "ctxt__o", "=", "ctxt", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlTextReaderRelaxNGValidateCtxt", "(", "self", ".", "_o", ",", "ctxt__o", ",", "options", ")", "return", "ret" ]
Use RelaxNG schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then RelaxNG schema validation is deactivated.
[ "Use", "RelaxNG", "schema", "context", "to", "validate", "the", "document", "as", "it", "is", "processed", ".", "Activation", "is", "only", "possible", "before", "the", "first", "Read", "()", ".", "If" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6875-L6883
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.SchemaValidate
def SchemaValidate(self, xsd): """Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). If @xsd is None, then XML Schema validation is deactivated. """ ret = libxml2mod.xmlTextReaderSchemaValidate(self._o, xsd) return ret
python
def SchemaValidate(self, xsd): """Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). If @xsd is None, then XML Schema validation is deactivated. """ ret = libxml2mod.xmlTextReaderSchemaValidate(self._o, xsd) return ret
[ "def", "SchemaValidate", "(", "self", ",", "xsd", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderSchemaValidate", "(", "self", ".", "_o", ",", "xsd", ")", "return", "ret" ]
Use W3C XSD schema to validate the document as it is processed. Activation is only possible before the first Read(). If @xsd is None, then XML Schema validation is deactivated.
[ "Use", "W3C", "XSD", "schema", "to", "validate", "the", "document", "as", "it", "is", "processed", ".", "Activation", "is", "only", "possible", "before", "the", "first", "Read", "()", ".", "If" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6885-L6891
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.SchemaValidateCtxt
def SchemaValidateCtxt(self, ctxt, options): """Use W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then XML Schema validation is deactivated. """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(self._o, ctxt__o, options) return ret
python
def SchemaValidateCtxt(self, ctxt, options): """Use W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then XML Schema validation is deactivated. """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o ret = libxml2mod.xmlTextReaderSchemaValidateCtxt(self._o, ctxt__o, options) return ret
[ "def", "SchemaValidateCtxt", "(", "self", ",", "ctxt", ",", "options", ")", ":", "if", "ctxt", "is", "None", ":", "ctxt__o", "=", "None", "else", ":", "ctxt__o", "=", "ctxt", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlTextReaderSchemaValidateCtxt", "(", "self", ".", "_o", ",", "ctxt__o", ",", "options", ")", "return", "ret" ]
Use W3C XSD schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is None, then XML Schema validation is deactivated.
[ "Use", "W3C", "XSD", "schema", "context", "to", "validate", "the", "document", "as", "it", "is", "processed", ".", "Activation", "is", "only", "possible", "before", "the", "first", "Read", "()", ".", "If" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6893-L6901
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.SetParserProp
def SetParserProp(self, prop, value): """Change the parser processing behaviour by changing some of its internal properties. Note that some properties can only be changed before any read has been done. """ ret = libxml2mod.xmlTextReaderSetParserProp(self._o, prop, value) return ret
python
def SetParserProp(self, prop, value): """Change the parser processing behaviour by changing some of its internal properties. Note that some properties can only be changed before any read has been done. """ ret = libxml2mod.xmlTextReaderSetParserProp(self._o, prop, value) return ret
[ "def", "SetParserProp", "(", "self", ",", "prop", ",", "value", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderSetParserProp", "(", "self", ".", "_o", ",", "prop", ",", "value", ")", "return", "ret" ]
Change the parser processing behaviour by changing some of its internal properties. Note that some properties can only be changed before any read has been done.
[ "Change", "the", "parser", "processing", "behaviour", "by", "changing", "some", "of", "its", "internal", "properties", ".", "Note", "that", "some", "properties", "can", "only", "be", "changed", "before", "any", "read", "has", "been", "done", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6903-L6908
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.SetSchema
def SetSchema(self, schema): """Use XSD Schema to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then Schema validation is desactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated. """ if schema is None: schema__o = None else: schema__o = schema._o ret = libxml2mod.xmlTextReaderSetSchema(self._o, schema__o) return ret
python
def SetSchema(self, schema): """Use XSD Schema to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then Schema validation is desactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated. """ if schema is None: schema__o = None else: schema__o = schema._o ret = libxml2mod.xmlTextReaderSetSchema(self._o, schema__o) return ret
[ "def", "SetSchema", "(", "self", ",", "schema", ")", ":", "if", "schema", "is", "None", ":", "schema__o", "=", "None", "else", ":", "schema__o", "=", "schema", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlTextReaderSetSchema", "(", "self", ".", "_o", ",", "schema__o", ")", "return", "ret" ]
Use XSD Schema to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is None, then Schema validation is desactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated.
[ "Use", "XSD", "Schema", "to", "validate", "the", "document", "as", "it", "is", "processed", ".", "Activation", "is", "only", "possible", "before", "the", "first", "Read", "()", ".", "if" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6910-L6919
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.Setup
def Setup(self, input, URL, encoding, options): """Setup an XML reader with new options """ if input is None: input__o = None else: input__o = input._o ret = libxml2mod.xmlTextReaderSetup(self._o, input__o, URL, encoding, options) return ret
python
def Setup(self, input, URL, encoding, options): """Setup an XML reader with new options """ if input is None: input__o = None else: input__o = input._o ret = libxml2mod.xmlTextReaderSetup(self._o, input__o, URL, encoding, options) return ret
[ "def", "Setup", "(", "self", ",", "input", ",", "URL", ",", "encoding", ",", "options", ")", ":", "if", "input", "is", "None", ":", "input__o", "=", "None", "else", ":", "input__o", "=", "input", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlTextReaderSetup", "(", "self", ".", "_o", ",", "input__o", ",", "URL", ",", "encoding", ",", "options", ")", "return", "ret" ]
Setup an XML reader with new options
[ "Setup", "an", "XML", "reader", "with", "new", "options" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6921-L6926
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xmlTextReader.String
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
python
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
[ "def", "String", "(", "self", ",", "str", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderConstString", "(", "self", ".", "_o", ",", "str", ")", "return", "ret" ]
Get an interned string from the reader, allows for example to speedup string name comparisons
[ "Get", "an", "interned", "string", "from", "the", "reader", "allows", "for", "example", "to", "speedup", "string", "name", "comparisons" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L6933-L6937
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
URI.parseURIReference
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 = URI / relative-ref """ ret = libxml2mod.xmlParseURIReference(self._o, str) return ret
python
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 = URI / relative-ref """ ret = libxml2mod.xmlParseURIReference(self._o, str) return ret
[ "def", "parseURIReference", "(", "self", ",", "str", ")", ":", "ret", "=", "libxml2mod", ".", "xmlParseURIReference", "(", "self", ".", "_o", ",", "str", ")", "return", "ret" ]
Parse an URI reference string based on RFC 3986 and fills in the appropriate fields of the @uri structure URI-reference = URI / relative-ref
[ "Parse", "an", "URI", "reference", "string", "based", "on", "RFC", "3986", "and", "fills", "in", "the", "appropriate", "fields", "of", "the" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7060-L7065
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validCtxtNormalizeAttributeValue
def validCtxtNormalizeAttributeValue(self, doc, elem, name, value): """Does the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character. Also check VC: Standalone Document Declaration in P32, and update ctxt->valid accordingly """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(self._o, doc__o, elem__o, name, value) return ret
python
def validCtxtNormalizeAttributeValue(self, doc, elem, name, value): """Does the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character. Also check VC: Standalone Document Declaration in P32, and update ctxt->valid accordingly """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidCtxtNormalizeAttributeValue(self._o, doc__o, elem__o, name, value) return ret
[ "def", "validCtxtNormalizeAttributeValue", "(", "self", ",", "doc", ",", "elem", ",", "name", ",", "value", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidCtxtNormalizeAttributeValue", "(", "self", ".", "_o", ",", "doc__o", ",", "elem__o", ",", "name", ",", "value", ")", "return", "ret" ]
Does the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character. Also check VC: Standalone Document Declaration in P32, and update ctxt->valid accordingly
[ "Does", "the", "validation", "related", "extra", "step", "of", "the", "normalization", "of", "attribute", "values", ":", "If", "the", "declared", "value", "is", "not", "CDATA", "then", "the", "XML", "processor", "must", "further", "process", "the", "normalized", "attribute", "value", "by", "discarding", "any", "leading", "and", "trailing", "space", "(", "#x20", ")", "characters", "and", "by", "replacing", "sequences", "of", "space", "(", "#x20", ")", "characters", "by", "single", "space", "(", "#x20", ")", "character", ".", "Also", "check", "VC", ":", "Standalone", "Document", "Declaration", "in", "P32", "and", "update", "ctxt", "-", ">", "valid", "accordingly" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7090-L7104
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateDocument
def validateDocument(self, doc): """Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateDocument(self._o, doc__o) return ret
python
def validateDocument(self, doc): """Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateDocument(self._o, doc__o) return ret
[ "def", "validateDocument", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateDocument", "(", "self", ".", "_o", ",", "doc__o", ")", "return", "ret" ]
Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.
[ "Try", "to", "validate", "the", "document", "instance", "basically", "it", "does", "the", "all", "the", "checks", "described", "by", "the", "XML", "Rec", "i", ".", "e", ".", "validates", "the", "internal", "and", "external", "subset", "(", "if", "present", ")", "and", "validate", "the", "document", "tree", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7106-L7114
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateDocumentFinal
def validateDocumentFinal(self, doc): """Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for validity """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateDocumentFinal(self._o, doc__o) return ret
python
def validateDocumentFinal(self, doc): """Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for validity """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateDocumentFinal(self._o, doc__o) return ret
[ "def", "validateDocumentFinal", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateDocumentFinal", "(", "self", ".", "_o", ",", "doc__o", ")", "return", "ret" ]
Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for validity
[ "Does", "the", "final", "step", "for", "the", "document", "validation", "once", "all", "the", "incremental", "validation", "steps", "have", "been", "completed", "basically", "it", "does", "the", "following", "checks", "described", "by", "the", "XML", "Rec", "Check", "all", "the", "IDREF", "/", "IDREFS", "attributes", "definition", "for", "validity" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7116-L7125
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateDtd
def validateDtd(self, doc, dtd): """Try to validate the document against the dtd instance Basically it does check all the definitions in the DtD. Note the the internal subset (if present) is de-coupled (i.e. not used), which could give problems if ID or IDREF is present. """ if doc is None: doc__o = None else: doc__o = doc._o if dtd is None: dtd__o = None else: dtd__o = dtd._o ret = libxml2mod.xmlValidateDtd(self._o, doc__o, dtd__o) return ret
python
def validateDtd(self, doc, dtd): """Try to validate the document against the dtd instance Basically it does check all the definitions in the DtD. Note the the internal subset (if present) is de-coupled (i.e. not used), which could give problems if ID or IDREF is present. """ if doc is None: doc__o = None else: doc__o = doc._o if dtd is None: dtd__o = None else: dtd__o = dtd._o ret = libxml2mod.xmlValidateDtd(self._o, doc__o, dtd__o) return ret
[ "def", "validateDtd", "(", "self", ",", "doc", ",", "dtd", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "if", "dtd", "is", "None", ":", "dtd__o", "=", "None", "else", ":", "dtd__o", "=", "dtd", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateDtd", "(", "self", ".", "_o", ",", "doc__o", ",", "dtd__o", ")", "return", "ret" ]
Try to validate the document against the dtd instance Basically it does check all the definitions in the DtD. Note the the internal subset (if present) is de-coupled (i.e. not used), which could give problems if ID or IDREF is present.
[ "Try", "to", "validate", "the", "document", "against", "the", "dtd", "instance", "Basically", "it", "does", "check", "all", "the", "definitions", "in", "the", "DtD", ".", "Note", "the", "the", "internal", "subset", "(", "if", "present", ")", "is", "de", "-", "coupled", "(", "i", ".", "e", ".", "not", "used", ")", "which", "could", "give", "problems", "if", "ID", "or", "IDREF", "is", "present", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7127-L7138
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateDtdFinal
def validateDtdFinal(self, doc): """Does the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one of the defined entities. - check that NOTATION type attributes default or possible values matches one of the defined notations. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateDtdFinal(self._o, doc__o) return ret
python
def validateDtdFinal(self, doc): """Does the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one of the defined entities. - check that NOTATION type attributes default or possible values matches one of the defined notations. """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateDtdFinal(self._o, doc__o) return ret
[ "def", "validateDtdFinal", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateDtdFinal", "(", "self", ".", "_o", ",", "doc__o", ")", "return", "ret" ]
Does the final step for the dtds validation once all the subsets have been parsed basically it does the following checks described by the XML Rec - check that ENTITY and ENTITIES type attributes default or possible values matches one of the defined entities. - check that NOTATION type attributes default or possible values matches one of the defined notations.
[ "Does", "the", "final", "step", "for", "the", "dtds", "validation", "once", "all", "the", "subsets", "have", "been", "parsed", "basically", "it", "does", "the", "following", "checks", "described", "by", "the", "XML", "Rec", "-", "check", "that", "ENTITY", "and", "ENTITIES", "type", "attributes", "default", "or", "possible", "values", "matches", "one", "of", "the", "defined", "entities", ".", "-", "check", "that", "NOTATION", "type", "attributes", "default", "or", "possible", "values", "matches", "one", "of", "the", "defined", "notations", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7140-L7151
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateElement
def validateElement(self, doc, elem): """Try to validate the subtree under an element """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidateElement(self._o, doc__o, elem__o) return ret
python
def validateElement(self, doc, elem): """Try to validate the subtree under an element """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidateElement(self._o, doc__o, elem__o) return ret
[ "def", "validateElement", "(", "self", ",", "doc", ",", "elem", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateElement", "(", "self", ".", "_o", ",", "doc__o", ",", "elem__o", ")", "return", "ret" ]
Try to validate the subtree under an element
[ "Try", "to", "validate", "the", "subtree", "under", "an", "element" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7153-L7160
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateNotationUse
def validateNotationUse(self, doc, notationName): """Validate that the given name match a notation declaration. - [ VC: Notation Declared ] """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateNotationUse(self._o, doc__o, notationName) return ret
python
def validateNotationUse(self, doc, notationName): """Validate that the given name match a notation declaration. - [ VC: Notation Declared ] """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateNotationUse(self._o, doc__o, notationName) return ret
[ "def", "validateNotationUse", "(", "self", ",", "doc", ",", "notationName", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateNotationUse", "(", "self", ".", "_o", ",", "doc__o", ",", "notationName", ")", "return", "ret" ]
Validate that the given name match a notation declaration. - [ VC: Notation Declared ]
[ "Validate", "that", "the", "given", "name", "match", "a", "notation", "declaration", ".", "-", "[", "VC", ":", "Notation", "Declared", "]" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7162-L7168
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateOneAttribute
def validateOneAttribute(self, doc, elem, attr, value): """Try to validate a single attribute for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o if attr is None: attr__o = None else: attr__o = attr._o ret = libxml2mod.xmlValidateOneAttribute(self._o, doc__o, elem__o, attr__o, value) return ret
python
def validateOneAttribute(self, doc, elem, attr, value): """Try to validate a single attribute for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o if attr is None: attr__o = None else: attr__o = attr._o ret = libxml2mod.xmlValidateOneAttribute(self._o, doc__o, elem__o, attr__o, value) return ret
[ "def", "validateOneAttribute", "(", "self", ",", "doc", ",", "elem", ",", "attr", ",", "value", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "if", "attr", "is", "None", ":", "attr__o", "=", "None", "else", ":", "attr__o", "=", "attr", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateOneAttribute", "(", "self", ".", "_o", ",", "doc__o", ",", "elem__o", ",", "attr__o", ",", "value", ")", "return", "ret" ]
Try to validate a single attribute for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately
[ "Try", "to", "validate", "a", "single", "attribute", "for", "an", "element", "basically", "it", "does", "the", "following", "checks", "as", "described", "by", "the", "XML", "-", "1", ".", "0", "recommendation", ":", "-", "[", "VC", ":", "Attribute", "Value", "Type", "]", "-", "[", "VC", ":", "Fixed", "Attribute", "Default", "]", "-", "[", "VC", ":", "Entity", "Name", "]", "-", "[", "VC", ":", "Name", "Token", "]", "-", "[", "VC", ":", "ID", "]", "-", "[", "VC", ":", "IDREF", "]", "-", "[", "VC", ":", "Entity", "Name", "]", "-", "[", "VC", ":", "Notation", "Attributes", "]", "The", "ID", "/", "IDREF", "uniqueness", "and", "matching", "are", "done", "separately" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7170-L7185
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateOneElement
def validateOneElement(self, doc, elem): """Try to validate a single element and it's attributes, basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC: Required Attribute ] Then call xmlValidateOneAttribute() for each attribute present. The ID/IDREF checkings are done separately """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidateOneElement(self._o, doc__o, elem__o) return ret
python
def validateOneElement(self, doc, elem): """Try to validate a single element and it's attributes, basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC: Required Attribute ] Then call xmlValidateOneAttribute() for each attribute present. The ID/IDREF checkings are done separately """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidateOneElement(self._o, doc__o, elem__o) return ret
[ "def", "validateOneElement", "(", "self", ",", "doc", ",", "elem", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateOneElement", "(", "self", ".", "_o", ",", "doc__o", ",", "elem__o", ")", "return", "ret" ]
Try to validate a single element and it's attributes, basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC: Required Attribute ] Then call xmlValidateOneAttribute() for each attribute present. The ID/IDREF checkings are done separately
[ "Try", "to", "validate", "a", "single", "element", "and", "it", "s", "attributes", "basically", "it", "does", "the", "following", "checks", "as", "described", "by", "the", "XML", "-", "1", ".", "0", "recommendation", ":", "-", "[", "VC", ":", "Element", "Valid", "]", "-", "[", "VC", ":", "Required", "Attribute", "]", "Then", "call", "xmlValidateOneAttribute", "()", "for", "each", "attribute", "present", ".", "The", "ID", "/", "IDREF", "checkings", "are", "done", "separately" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7187-L7199
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateOneNamespace
def validateOneNamespace(self, doc, elem, prefix, ns, value): """Try to validate a single namespace declaration for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o if ns is None: ns__o = None else: ns__o = ns._o ret = libxml2mod.xmlValidateOneNamespace(self._o, doc__o, elem__o, prefix, ns__o, value) return ret
python
def validateOneNamespace(self, doc, elem, prefix, ns, value): """Try to validate a single namespace declaration for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o if ns is None: ns__o = None else: ns__o = ns._o ret = libxml2mod.xmlValidateOneNamespace(self._o, doc__o, elem__o, prefix, ns__o, value) return ret
[ "def", "validateOneNamespace", "(", "self", ",", "doc", ",", "elem", ",", "prefix", ",", "ns", ",", "value", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "if", "ns", "is", "None", ":", "ns__o", "=", "None", "else", ":", "ns__o", "=", "ns", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateOneNamespace", "(", "self", ".", "_o", ",", "doc__o", ",", "elem__o", ",", "prefix", ",", "ns__o", ",", "value", ")", "return", "ret" ]
Try to validate a single namespace declaration for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately
[ "Try", "to", "validate", "a", "single", "namespace", "declaration", "for", "an", "element", "basically", "it", "does", "the", "following", "checks", "as", "described", "by", "the", "XML", "-", "1", ".", "0", "recommendation", ":", "-", "[", "VC", ":", "Attribute", "Value", "Type", "]", "-", "[", "VC", ":", "Fixed", "Attribute", "Default", "]", "-", "[", "VC", ":", "Entity", "Name", "]", "-", "[", "VC", ":", "Name", "Token", "]", "-", "[", "VC", ":", "ID", "]", "-", "[", "VC", ":", "IDREF", "]", "-", "[", "VC", ":", "Entity", "Name", "]", "-", "[", "VC", ":", "Notation", "Attributes", "]", "The", "ID", "/", "IDREF", "uniqueness", "and", "matching", "are", "done", "separately" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7201-L7216
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validatePopElement
def validatePopElement(self, doc, elem, qname): """Pop the element end from the validation stack. """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidatePopElement(self._o, doc__o, elem__o, qname) return ret
python
def validatePopElement(self, doc, elem, qname): """Pop the element end from the validation stack. """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidatePopElement(self._o, doc__o, elem__o, qname) return ret
[ "def", "validatePopElement", "(", "self", ",", "doc", ",", "elem", ",", "qname", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidatePopElement", "(", "self", ".", "_o", ",", "doc__o", ",", "elem__o", ",", "qname", ")", "return", "ret" ]
Pop the element end from the validation stack.
[ "Pop", "the", "element", "end", "from", "the", "validation", "stack", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7218-L7225
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validatePushCData
def validatePushCData(self, data, len): """check the CData parsed for validation in the current stack """ ret = libxml2mod.xmlValidatePushCData(self._o, data, len) return ret
python
def validatePushCData(self, data, len): """check the CData parsed for validation in the current stack """ ret = libxml2mod.xmlValidatePushCData(self._o, data, len) return ret
[ "def", "validatePushCData", "(", "self", ",", "data", ",", "len", ")", ":", "ret", "=", "libxml2mod", ".", "xmlValidatePushCData", "(", "self", ".", "_o", ",", "data", ",", "len", ")", "return", "ret" ]
check the CData parsed for validation in the current stack
[ "check", "the", "CData", "parsed", "for", "validation", "in", "the", "current", "stack" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7227-L7230
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validatePushElement
def validatePushElement(self, doc, elem, qname): """Push a new element start on the validation stack. """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidatePushElement(self._o, doc__o, elem__o, qname) return ret
python
def validatePushElement(self, doc, elem, qname): """Push a new element start on the validation stack. """ if doc is None: doc__o = None else: doc__o = doc._o if elem is None: elem__o = None else: elem__o = elem._o ret = libxml2mod.xmlValidatePushElement(self._o, doc__o, elem__o, qname) return ret
[ "def", "validatePushElement", "(", "self", ",", "doc", ",", "elem", ",", "qname", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "if", "elem", "is", "None", ":", "elem__o", "=", "None", "else", ":", "elem__o", "=", "elem", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidatePushElement", "(", "self", ".", "_o", ",", "doc__o", ",", "elem__o", ",", "qname", ")", "return", "ret" ]
Push a new element start on the validation stack.
[ "Push", "a", "new", "element", "start", "on", "the", "validation", "stack", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7232-L7239
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
ValidCtxt.validateRoot
def validateRoot(self, doc): """Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateRoot(self._o, doc__o) return ret
python
def validateRoot(self, doc): """Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element """ if doc is None: doc__o = None else: doc__o = doc._o ret = libxml2mod.xmlValidateRoot(self._o, doc__o) return ret
[ "def", "validateRoot", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateRoot", "(", "self", ".", "_o", ",", "doc__o", ")", "return", "ret" ]
Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element
[ "Try", "to", "validate", "a", "the", "root", "element", "basically", "it", "does", "the", "following", "check", "as", "described", "by", "the", "XML", "-", "1", ".", "0", "recommendation", ":", "-", "[", "VC", ":", "Root", "Element", "Type", "]", "it", "doesn", "t", "try", "to", "recurse", "or", "apply", "other", "check", "to", "the", "element" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7241-L7249
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.contextDoc
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
python
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
[ "def", "contextDoc", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathGetContextDoc", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathGetContextDoc() failed'", ")", "__tmp", "=", "xmlDoc", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Get the doc from an xpathContext
[ "Get", "the", "doc", "from", "an", "xpathContext" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7257-L7262
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.contextNode
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
python
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
[ "def", "contextNode", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathGetContextNode", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathGetContextNode() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Get the current node from an xpathContext
[ "Get", "the", "current", "node", "from", "an", "xpathContext" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7264-L7269
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.setContextDoc
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)
python
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)
[ "def", "setContextDoc", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "libxml2mod", ".", "xmlXPathSetContextDoc", "(", "self", ".", "_o", ",", "doc__o", ")" ]
Set the doc of an xpathContext
[ "Set", "the", "doc", "of", "an", "xpathContext" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7291-L7295
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.setContextNode
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)
python
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)
[ "def", "setContextNode", "(", "self", ",", "node", ")", ":", "if", "node", "is", "None", ":", "node__o", "=", "None", "else", ":", "node__o", "=", "node", ".", "_o", "libxml2mod", ".", "xmlXPathSetContextNode", "(", "self", ".", "_o", ",", "node__o", ")" ]
Set the current node of an xpathContext
[ "Set", "the", "current", "node", "of", "an", "xpathContext" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7297-L7301
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.registerXPathFunction
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
python
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
[ "def", "registerXPathFunction", "(", "self", ",", "name", ",", "ns_uri", ",", "f", ")", ":", "ret", "=", "libxml2mod", ".", "xmlRegisterXPathFunction", "(", "self", ".", "_o", ",", "name", ",", "ns_uri", ",", "f", ")", "return", "ret" ]
Register a Python written function to the XPath interpreter
[ "Register", "a", "Python", "written", "function", "to", "the", "XPath", "interpreter" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7307-L7310
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpathRegisterVariable
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
python
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
[ "def", "xpathRegisterVariable", "(", "self", ",", "name", ",", "ns_uri", ",", "value", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathRegisterVariable", "(", "self", ".", "_o", ",", "name", ",", "ns_uri", ",", "value", ")", "return", "ret" ]
Register a variable with the XPath context
[ "Register", "a", "variable", "with", "the", "XPath", "context" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7312-L7315
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpathContextSetCache
def xpathContextSetCache(self, active, value, options): """Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused. @options: 0: This will set the XPath object caching: @value: This will set the maximum number of XPath objects to be cached per slot There are 5 slots for: node-set, string, number, boolean, and misc objects. Use <0 for the default number (100). Other values for @options have currently no effect. """ ret = libxml2mod.xmlXPathContextSetCache(self._o, active, value, options) return ret
python
def xpathContextSetCache(self, active, value, options): """Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused. @options: 0: This will set the XPath object caching: @value: This will set the maximum number of XPath objects to be cached per slot There are 5 slots for: node-set, string, number, boolean, and misc objects. Use <0 for the default number (100). Other values for @options have currently no effect. """ ret = libxml2mod.xmlXPathContextSetCache(self._o, active, value, options) return ret
[ "def", "xpathContextSetCache", "(", "self", ",", "active", ",", "value", ",", "options", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathContextSetCache", "(", "self", ".", "_o", ",", "active", ",", "value", ",", "options", ")", "return", "ret" ]
Creates/frees an object cache on the XPath context. If activates XPath objects (xmlXPathObject) will be cached internally to be reused. @options: 0: This will set the XPath object caching: @value: This will set the maximum number of XPath objects to be cached per slot There are 5 slots for: node-set, string, number, boolean, and misc objects. Use <0 for the default number (100). Other values for @options have currently no effect.
[ "Creates", "/", "frees", "an", "object", "cache", "on", "the", "XPath", "context", ".", "If", "activates", "XPath", "objects", "(", "xmlXPathObject", ")", "will", "be", "cached", "internally", "to", "be", "reused", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7321-L7331
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpathEval
def xpathEval(self, str): """Evaluate the XPath Location Path in the given context. """ ret = libxml2mod.xmlXPathEval(str, self._o) if ret is None:raise xpathError('xmlXPathEval() failed') return xpathObjectRet(ret)
python
def xpathEval(self, str): """Evaluate the XPath Location Path in the given context. """ ret = libxml2mod.xmlXPathEval(str, self._o) if ret is None:raise xpathError('xmlXPathEval() failed') return xpathObjectRet(ret)
[ "def", "xpathEval", "(", "self", ",", "str", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathEval", "(", "str", ",", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathEval() failed'", ")", "return", "xpathObjectRet", "(", "ret", ")" ]
Evaluate the XPath Location Path in the given context.
[ "Evaluate", "the", "XPath", "Location", "Path", "in", "the", "given", "context", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7333-L7337
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpathEvalExpression
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)
python
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)
[ "def", "xpathEvalExpression", "(", "self", ",", "str", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathEvalExpression", "(", "str", ",", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathEvalExpression() failed'", ")", "return", "xpathObjectRet", "(", "ret", ")" ]
Evaluate the XPath expression in the given context.
[ "Evaluate", "the", "XPath", "expression", "in", "the", "given", "context", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7339-L7343
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpathNewParserContext
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
python
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
[ "def", "xpathNewParserContext", "(", "self", ",", "str", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathNewParserContext", "(", "str", ",", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNewParserContext() failed'", ")", "__tmp", "=", "xpathParserContext", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Create a new xmlXPathParserContext
[ "Create", "a", "new", "xmlXPathParserContext" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7353-L7358
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpathNsLookup
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
python
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
[ "def", "xpathNsLookup", "(", "self", ",", "prefix", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathNsLookup", "(", "self", ".", "_o", ",", "prefix", ")", "return", "ret" ]
Search in the namespace declaration array of the context for the given namespace name associated to the given prefix
[ "Search", "in", "the", "namespace", "declaration", "array", "of", "the", "context", "for", "the", "given", "namespace", "name", "associated", "to", "the", "given", "prefix" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7360-L7364
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpathRegisterNs
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
python
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
[ "def", "xpathRegisterNs", "(", "self", ",", "prefix", ",", "ns_uri", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathRegisterNs", "(", "self", ".", "_o", ",", "prefix", ",", "ns_uri", ")", "return", "ret" ]
Register a new namespace. If @ns_uri is None it unregisters the namespace
[ "Register", "a", "new", "namespace", ".", "If" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7370-L7374
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpathVariableLookup
def xpathVariableLookup(self, name): """Search in the Variable array of the context for the given variable value. """ ret = libxml2mod.xmlXPathVariableLookup(self._o, name) if ret is None:raise xpathError('xmlXPathVariableLookup() failed') return xpathObjectRet(ret)
python
def xpathVariableLookup(self, name): """Search in the Variable array of the context for the given variable value. """ ret = libxml2mod.xmlXPathVariableLookup(self._o, name) if ret is None:raise xpathError('xmlXPathVariableLookup() failed') return xpathObjectRet(ret)
[ "def", "xpathVariableLookup", "(", "self", ",", "name", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathVariableLookup", "(", "self", ".", "_o", ",", "name", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathVariableLookup() failed'", ")", "return", "xpathObjectRet", "(", "ret", ")" ]
Search in the Variable array of the context for the given variable value.
[ "Search", "in", "the", "Variable", "array", "of", "the", "context", "for", "the", "given", "variable", "value", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7391-L7396
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpathVariableLookupNS
def xpathVariableLookupNS(self, name, ns_uri): """Search in the Variable array of the context for the given variable value. """ ret = libxml2mod.xmlXPathVariableLookupNS(self._o, name, ns_uri) if ret is None:raise xpathError('xmlXPathVariableLookupNS() failed') return xpathObjectRet(ret)
python
def xpathVariableLookupNS(self, name, ns_uri): """Search in the Variable array of the context for the given variable value. """ ret = libxml2mod.xmlXPathVariableLookupNS(self._o, name, ns_uri) if ret is None:raise xpathError('xmlXPathVariableLookupNS() failed') return xpathObjectRet(ret)
[ "def", "xpathVariableLookupNS", "(", "self", ",", "name", ",", "ns_uri", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathVariableLookupNS", "(", "self", ".", "_o", ",", "name", ",", "ns_uri", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathVariableLookupNS() failed'", ")", "return", "xpathObjectRet", "(", "ret", ")" ]
Search in the Variable array of the context for the given variable value.
[ "Search", "in", "the", "Variable", "array", "of", "the", "context", "for", "the", "given", "variable", "value", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7398-L7403
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathContext.xpointerEval
def xpointerEval(self, str): """Evaluate the XPath Location Path in the given context. """ ret = libxml2mod.xmlXPtrEval(str, self._o) if ret is None:raise treeError('xmlXPtrEval() failed') return xpathObjectRet(ret)
python
def xpointerEval(self, str): """Evaluate the XPath Location Path in the given context. """ ret = libxml2mod.xmlXPtrEval(str, self._o) if ret is None:raise treeError('xmlXPtrEval() failed') return xpathObjectRet(ret)
[ "def", "xpointerEval", "(", "self", ",", "str", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPtrEval", "(", "str", ",", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "treeError", "(", "'xmlXPtrEval() failed'", ")", "return", "xpathObjectRet", "(", "ret", ")" ]
Evaluate the XPath Location Path in the given context.
[ "Evaluate", "the", "XPath", "Location", "Path", "in", "the", "given", "context", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7409-L7413
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.context
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
python
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
[ "def", "context", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathParserGetContext", "(", "self", ".", "_o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathParserGetContext() failed'", ")", "__tmp", "=", "xpathContext", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Get the xpathContext from an xpathParserContext
[ "Get", "the", "xpathContext", "from", "an", "xpathParserContext" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7421-L7426
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathCompareValues
def xpathCompareValues(self, inf, strict): """Implement the compare operation on XPath objects: @arg1 < @arg2 (1, 1, ... @arg1 <= @arg2 (1, 0, ... @arg1 > @arg2 (0, 1, ... @arg1 >= @arg2 (0, 0, ... When neither object to be compared is a node-set and the operator is <=, <, >=, >, then the objects are compared by converted both objects to numbers and comparing the numbers according to IEEE 754. The < comparison will be true if and only if the first number is less than the second number. The <= comparison will be true if and only if the first number is less than or equal to the second number. The > comparison will be true if and only if the first number is greater than the second number. The >= comparison will be true if and only if the first number is greater than or equal to the second number. """ ret = libxml2mod.xmlXPathCompareValues(self._o, inf, strict) return ret
python
def xpathCompareValues(self, inf, strict): """Implement the compare operation on XPath objects: @arg1 < @arg2 (1, 1, ... @arg1 <= @arg2 (1, 0, ... @arg1 > @arg2 (0, 1, ... @arg1 >= @arg2 (0, 0, ... When neither object to be compared is a node-set and the operator is <=, <, >=, >, then the objects are compared by converted both objects to numbers and comparing the numbers according to IEEE 754. The < comparison will be true if and only if the first number is less than the second number. The <= comparison will be true if and only if the first number is less than or equal to the second number. The > comparison will be true if and only if the first number is greater than the second number. The >= comparison will be true if and only if the first number is greater than or equal to the second number. """ ret = libxml2mod.xmlXPathCompareValues(self._o, inf, strict) return ret
[ "def", "xpathCompareValues", "(", "self", ",", "inf", ",", "strict", ")", ":", "ret", "=", "libxml2mod", ".", "xmlXPathCompareValues", "(", "self", ".", "_o", ",", "inf", ",", "strict", ")", "return", "ret" ]
Implement the compare operation on XPath objects: @arg1 < @arg2 (1, 1, ... @arg1 <= @arg2 (1, 0, ... @arg1 > @arg2 (0, 1, ... @arg1 >= @arg2 (0, 0, ... When neither object to be compared is a node-set and the operator is <=, <, >=, >, then the objects are compared by converted both objects to numbers and comparing the numbers according to IEEE 754. The < comparison will be true if and only if the first number is less than the second number. The <= comparison will be true if and only if the first number is less than or equal to the second number. The > comparison will be true if and only if the first number is greater than the second number. The >= comparison will be true if and only if the first number is greater than or equal to the second number.
[ "Implement", "the", "compare", "operation", "on", "XPath", "objects", ":" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7454-L7470
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextAncestor
def xpathNextAncestor(self, cur): """Traversal function for the "ancestor" direction the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist of the parent of context node and the parent's parent and so on; the nodes are ordered in reverse document order; thus the parent is the first node on the axis, and the parent's parent is the second node on the axis """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextAncestor(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextAncestor() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextAncestor(self, cur): """Traversal function for the "ancestor" direction the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist of the parent of context node and the parent's parent and so on; the nodes are ordered in reverse document order; thus the parent is the first node on the axis, and the parent's parent is the second node on the axis """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextAncestor(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextAncestor() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextAncestor", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextAncestor", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextAncestor() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "ancestor" direction the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist of the parent of context node and the parent's parent and so on; the nodes are ordered in reverse document order; thus the parent is the first node on the axis, and the parent's parent is the second node on the axis
[ "Traversal", "function", "for", "the", "ancestor", "direction", "the", "ancestor", "axis", "contains", "the", "ancestors", "of", "the", "context", "node", ";", "the", "ancestors", "of", "the", "context", "node", "consist", "of", "the", "parent", "of", "context", "node", "and", "the", "parent", "s", "parent", "and", "so", "on", ";", "the", "nodes", "are", "ordered", "in", "reverse", "document", "order", ";", "thus", "the", "parent", "is", "the", "first", "node", "on", "the", "axis", "and", "the", "parent", "s", "parent", "is", "the", "second", "node", "on", "the", "axis" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7594-L7607
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextAncestorOrSelf
def xpathNextAncestorOrSelf(self, cur): """Traversal function for the "ancestor-or-self" direction he ancestor-or-self axis contains the context node and ancestors of the context node in reverse document order; thus the context node is the first node on the axis, and the context node's parent the second; parent here is defined the same as with the parent axis. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextAncestorOrSelf(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextAncestorOrSelf() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextAncestorOrSelf(self, cur): """Traversal function for the "ancestor-or-self" direction he ancestor-or-self axis contains the context node and ancestors of the context node in reverse document order; thus the context node is the first node on the axis, and the context node's parent the second; parent here is defined the same as with the parent axis. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextAncestorOrSelf(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextAncestorOrSelf() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextAncestorOrSelf", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextAncestorOrSelf", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextAncestorOrSelf() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "ancestor-or-self" direction he ancestor-or-self axis contains the context node and ancestors of the context node in reverse document order; thus the context node is the first node on the axis, and the context node's parent the second; parent here is defined the same as with the parent axis.
[ "Traversal", "function", "for", "the", "ancestor", "-", "or", "-", "self", "direction", "he", "ancestor", "-", "or", "-", "self", "axis", "contains", "the", "context", "node", "and", "ancestors", "of", "the", "context", "node", "in", "reverse", "document", "order", ";", "thus", "the", "context", "node", "is", "the", "first", "node", "on", "the", "axis", "and", "the", "context", "node", "s", "parent", "the", "second", ";", "parent", "here", "is", "defined", "the", "same", "as", "with", "the", "parent", "axis", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7609-L7621
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextAttribute
def xpathNextAttribute(self, cur): """Traversal function for the "attribute" direction TODO: support DTD inherited default attributes """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextAttribute(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextAttribute() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextAttribute(self, cur): """Traversal function for the "attribute" direction TODO: support DTD inherited default attributes """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextAttribute(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextAttribute() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextAttribute", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextAttribute", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextAttribute() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "attribute" direction TODO: support DTD inherited default attributes
[ "Traversal", "function", "for", "the", "attribute", "direction", "TODO", ":", "support", "DTD", "inherited", "default", "attributes" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7623-L7631
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextChild
def xpathNextChild(self, cur): """Traversal function for the "child" direction The child axis contains the children of the context node in document order. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextChild(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextChild() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextChild(self, cur): """Traversal function for the "child" direction The child axis contains the children of the context node in document order. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextChild(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextChild() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextChild", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextChild", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextChild() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "child" direction The child axis contains the children of the context node in document order.
[ "Traversal", "function", "for", "the", "child", "direction", "The", "child", "axis", "contains", "the", "children", "of", "the", "context", "node", "in", "document", "order", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7633-L7641
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextDescendant
def xpathNextDescendant(self, cur): """Traversal function for the "descendant" direction the descendant axis contains the descendants of the context node in document order; a descendant is a child or a child of a child and so on. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextDescendant(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextDescendant() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextDescendant(self, cur): """Traversal function for the "descendant" direction the descendant axis contains the descendants of the context node in document order; a descendant is a child or a child of a child and so on. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextDescendant(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextDescendant() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextDescendant", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextDescendant", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextDescendant() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "descendant" direction the descendant axis contains the descendants of the context node in document order; a descendant is a child or a child of a child and so on.
[ "Traversal", "function", "for", "the", "descendant", "direction", "the", "descendant", "axis", "contains", "the", "descendants", "of", "the", "context", "node", "in", "document", "order", ";", "a", "descendant", "is", "a", "child", "or", "a", "child", "of", "a", "child", "and", "so", "on", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7643-L7653
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextDescendantOrSelf
def xpathNextDescendantOrSelf(self, cur): """Traversal function for the "descendant-or-self" direction the descendant-or-self axis contains the context node and the descendants of the context node in document order; thus the context node is the first node on the axis, and the first child of the context node is the second node on the axis """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextDescendantOrSelf(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextDescendantOrSelf() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextDescendantOrSelf(self, cur): """Traversal function for the "descendant-or-self" direction the descendant-or-self axis contains the context node and the descendants of the context node in document order; thus the context node is the first node on the axis, and the first child of the context node is the second node on the axis """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextDescendantOrSelf(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextDescendantOrSelf() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextDescendantOrSelf", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextDescendantOrSelf", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextDescendantOrSelf() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "descendant-or-self" direction the descendant-or-self axis contains the context node and the descendants of the context node in document order; thus the context node is the first node on the axis, and the first child of the context node is the second node on the axis
[ "Traversal", "function", "for", "the", "descendant", "-", "or", "-", "self", "direction", "the", "descendant", "-", "or", "-", "self", "axis", "contains", "the", "context", "node", "and", "the", "descendants", "of", "the", "context", "node", "in", "document", "order", ";", "thus", "the", "context", "node", "is", "the", "first", "node", "on", "the", "axis", "and", "the", "first", "child", "of", "the", "context", "node", "is", "the", "second", "node", "on", "the", "axis" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7655-L7667
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextFollowing
def xpathNextFollowing(self, cur): """Traversal function for the "following" direction The following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding attribute nodes and namespace nodes; the nodes are ordered in document order """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextFollowing(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextFollowing() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextFollowing(self, cur): """Traversal function for the "following" direction The following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding attribute nodes and namespace nodes; the nodes are ordered in document order """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextFollowing(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextFollowing() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextFollowing", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextFollowing", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextFollowing() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "following" direction The following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding attribute nodes and namespace nodes; the nodes are ordered in document order
[ "Traversal", "function", "for", "the", "following", "direction", "The", "following", "axis", "contains", "all", "nodes", "in", "the", "same", "document", "as", "the", "context", "node", "that", "are", "after", "the", "context", "node", "in", "document", "order", "excluding", "any", "descendants", "and", "excluding", "attribute", "nodes", "and", "namespace", "nodes", ";", "the", "nodes", "are", "ordered", "in", "document", "order" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7669-L7681
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextFollowingSibling
def xpathNextFollowingSibling(self, cur): """Traversal function for the "following-sibling" direction The following-sibling axis contains the following siblings of the context node in document order. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextFollowingSibling(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextFollowingSibling() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextFollowingSibling(self, cur): """Traversal function for the "following-sibling" direction The following-sibling axis contains the following siblings of the context node in document order. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextFollowingSibling(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextFollowingSibling() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextFollowingSibling", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextFollowingSibling", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextFollowingSibling() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "following-sibling" direction The following-sibling axis contains the following siblings of the context node in document order.
[ "Traversal", "function", "for", "the", "following", "-", "sibling", "direction", "The", "following", "-", "sibling", "axis", "contains", "the", "following", "siblings", "of", "the", "context", "node", "in", "document", "order", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7683-L7692
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextNamespace
def xpathNextNamespace(self, cur): """Traversal function for the "namespace" direction the namespace axis contains the namespace nodes of the context node; the order of nodes on this axis is implementation-defined; the axis will be empty unless the context node is an element We keep the XML namespace node at the end of the list. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextNamespace(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextNamespace() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextNamespace(self, cur): """Traversal function for the "namespace" direction the namespace axis contains the namespace nodes of the context node; the order of nodes on this axis is implementation-defined; the axis will be empty unless the context node is an element We keep the XML namespace node at the end of the list. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextNamespace(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextNamespace() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextNamespace", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextNamespace", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextNamespace() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "namespace" direction the namespace axis contains the namespace nodes of the context node; the order of nodes on this axis is implementation-defined; the axis will be empty unless the context node is an element We keep the XML namespace node at the end of the list.
[ "Traversal", "function", "for", "the", "namespace", "direction", "the", "namespace", "axis", "contains", "the", "namespace", "nodes", "of", "the", "context", "node", ";", "the", "order", "of", "nodes", "on", "this", "axis", "is", "implementation", "-", "defined", ";", "the", "axis", "will", "be", "empty", "unless", "the", "context", "node", "is", "an", "element", "We", "keep", "the", "XML", "namespace", "node", "at", "the", "end", "of", "the", "list", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7694-L7706
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextParent
def xpathNextParent(self, cur): """Traversal function for the "parent" direction The parent axis contains the parent of the context node, if there is one. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextParent(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextParent() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextParent(self, cur): """Traversal function for the "parent" direction The parent axis contains the parent of the context node, if there is one. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextParent(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextParent() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextParent", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextParent", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextParent() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "parent" direction The parent axis contains the parent of the context node, if there is one.
[ "Traversal", "function", "for", "the", "parent", "direction", "The", "parent", "axis", "contains", "the", "parent", "of", "the", "context", "node", "if", "there", "is", "one", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7708-L7717
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextPreceding
def xpathNextPreceding(self, cur): """Traversal function for the "preceding" direction the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes; the nodes are ordered in reverse document order """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextPreceding(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextPreceding() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextPreceding(self, cur): """Traversal function for the "preceding" direction the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes; the nodes are ordered in reverse document order """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextPreceding(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextPreceding() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextPreceding", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextPreceding", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextPreceding() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "preceding" direction the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes; the nodes are ordered in reverse document order
[ "Traversal", "function", "for", "the", "preceding", "direction", "the", "preceding", "axis", "contains", "all", "nodes", "in", "the", "same", "document", "as", "the", "context", "node", "that", "are", "before", "the", "context", "node", "in", "document", "order", "excluding", "any", "ancestors", "and", "excluding", "attribute", "nodes", "and", "namespace", "nodes", ";", "the", "nodes", "are", "ordered", "in", "reverse", "document", "order" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7719-L7731
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextPrecedingSibling
def xpathNextPrecedingSibling(self, cur): """Traversal function for the "preceding-sibling" direction The preceding-sibling axis contains the preceding siblings of the context node in reverse document order; the first preceding sibling is first on the axis; the sibling preceding that node is the second on the axis and so on. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextPrecedingSibling(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextPrecedingSibling() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextPrecedingSibling(self, cur): """Traversal function for the "preceding-sibling" direction The preceding-sibling axis contains the preceding siblings of the context node in reverse document order; the first preceding sibling is first on the axis; the sibling preceding that node is the second on the axis and so on. """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextPrecedingSibling(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextPrecedingSibling() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextPrecedingSibling", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextPrecedingSibling", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextPrecedingSibling() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "preceding-sibling" direction The preceding-sibling axis contains the preceding siblings of the context node in reverse document order; the first preceding sibling is first on the axis; the sibling preceding that node is the second on the axis and so on.
[ "Traversal", "function", "for", "the", "preceding", "-", "sibling", "direction", "The", "preceding", "-", "sibling", "axis", "contains", "the", "preceding", "siblings", "of", "the", "context", "node", "in", "reverse", "document", "order", ";", "the", "first", "preceding", "sibling", "is", "first", "on", "the", "axis", ";", "the", "sibling", "preceding", "that", "node", "is", "the", "second", "on", "the", "axis", "and", "so", "on", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7733-L7744
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpathNextSelf
def xpathNextSelf(self, cur): """Traversal function for the "self" direction The self axis contains just the context node itself """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextSelf(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextSelf() failed') __tmp = xmlNode(_obj=ret) return __tmp
python
def xpathNextSelf(self, cur): """Traversal function for the "self" direction The self axis contains just the context node itself """ if cur is None: cur__o = None else: cur__o = cur._o ret = libxml2mod.xmlXPathNextSelf(self._o, cur__o) if ret is None:raise xpathError('xmlXPathNextSelf() failed') __tmp = xmlNode(_obj=ret) return __tmp
[ "def", "xpathNextSelf", "(", "self", ",", "cur", ")", ":", "if", "cur", "is", "None", ":", "cur__o", "=", "None", "else", ":", "cur__o", "=", "cur", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlXPathNextSelf", "(", "self", ".", "_o", ",", "cur__o", ")", "if", "ret", "is", "None", ":", "raise", "xpathError", "(", "'xmlXPathNextSelf() failed'", ")", "__tmp", "=", "xmlNode", "(", "_obj", "=", "ret", ")", "return", "__tmp" ]
Traversal function for the "self" direction The self axis contains just the context node itself
[ "Traversal", "function", "for", "the", "self", "direction", "The", "self", "axis", "contains", "just", "the", "context", "node", "itself" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7746-L7754
train
apple/turicreate
deps/src/libxml2-2.9.1/python/libxml2.py
xpathParserContext.xpatherror
def xpatherror(self, file, line, no): """Formats an error message. """ libxml2mod.xmlXPatherror(self._o, file, line, no)
python
def xpatherror(self, file, line, no): """Formats an error message. """ libxml2mod.xmlXPatherror(self._o, file, line, no)
[ "def", "xpatherror", "(", "self", ",", "file", ",", "line", ",", "no", ")", ":", "libxml2mod", ".", "xmlXPatherror", "(", "self", ".", "_o", ",", "file", ",", "line", ",", "no", ")" ]
Formats an error message.
[ "Formats", "an", "error", "message", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/libxml2-2.9.1/python/libxml2.py#L7969-L7971
train
apple/turicreate
src/unity/python/turicreate/toolkits/classifier/logistic_classifier.py
LogisticClassifier._get_summary_struct
def _get_summary_struct(self): """ Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters. Returns ------- sections : list (of list of tuples) A list of summary sections. Each section is a list. Each item in a section list is a tuple of the form: ('<label>','<field>') section_titles: list A list of section titles. The order matches that of the 'sections' object. """ model_fields = [ ('Number of coefficients', 'num_coefficients'), ('Number of examples', 'num_examples'), ('Number of classes', 'num_classes'), ('Number of feature columns', 'num_features'), ('Number of unpacked features', 'num_unpacked_features')] hyperparam_fields = [ ("L1 penalty", 'l1_penalty'), ("L2 penalty", 'l2_penalty') ] solver_fields = [ ("Solver", 'solver'), ("Solver iterations", 'training_iterations'), ("Solver status", 'training_solver_status'), ("Training time (sec)", 'training_time')] training_fields = [ ("Log-likelihood", 'training_loss')] coefs = self.coefficients top_coefs, bottom_coefs = _toolkit_get_topk_bottomk(coefs,k=5) (coefs_list, titles_list) = _summarize_coefficients(top_coefs, \ bottom_coefs) return ([ model_fields, hyperparam_fields, \ solver_fields, training_fields ] + coefs_list, \ [ 'Schema', 'Hyperparameters', \ 'Training Summary', 'Settings' ] + titles_list )
python
def _get_summary_struct(self): """ Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters. Returns ------- sections : list (of list of tuples) A list of summary sections. Each section is a list. Each item in a section list is a tuple of the form: ('<label>','<field>') section_titles: list A list of section titles. The order matches that of the 'sections' object. """ model_fields = [ ('Number of coefficients', 'num_coefficients'), ('Number of examples', 'num_examples'), ('Number of classes', 'num_classes'), ('Number of feature columns', 'num_features'), ('Number of unpacked features', 'num_unpacked_features')] hyperparam_fields = [ ("L1 penalty", 'l1_penalty'), ("L2 penalty", 'l2_penalty') ] solver_fields = [ ("Solver", 'solver'), ("Solver iterations", 'training_iterations'), ("Solver status", 'training_solver_status'), ("Training time (sec)", 'training_time')] training_fields = [ ("Log-likelihood", 'training_loss')] coefs = self.coefficients top_coefs, bottom_coefs = _toolkit_get_topk_bottomk(coefs,k=5) (coefs_list, titles_list) = _summarize_coefficients(top_coefs, \ bottom_coefs) return ([ model_fields, hyperparam_fields, \ solver_fields, training_fields ] + coefs_list, \ [ 'Schema', 'Hyperparameters', \ 'Training Summary', 'Settings' ] + titles_list )
[ "def", "_get_summary_struct", "(", "self", ")", ":", "model_fields", "=", "[", "(", "'Number of coefficients'", ",", "'num_coefficients'", ")", ",", "(", "'Number of examples'", ",", "'num_examples'", ")", ",", "(", "'Number of classes'", ",", "'num_classes'", ")", ",", "(", "'Number of feature columns'", ",", "'num_features'", ")", ",", "(", "'Number of unpacked features'", ",", "'num_unpacked_features'", ")", "]", "hyperparam_fields", "=", "[", "(", "\"L1 penalty\"", ",", "'l1_penalty'", ")", ",", "(", "\"L2 penalty\"", ",", "'l2_penalty'", ")", "]", "solver_fields", "=", "[", "(", "\"Solver\"", ",", "'solver'", ")", ",", "(", "\"Solver iterations\"", ",", "'training_iterations'", ")", ",", "(", "\"Solver status\"", ",", "'training_solver_status'", ")", ",", "(", "\"Training time (sec)\"", ",", "'training_time'", ")", "]", "training_fields", "=", "[", "(", "\"Log-likelihood\"", ",", "'training_loss'", ")", "]", "coefs", "=", "self", ".", "coefficients", "top_coefs", ",", "bottom_coefs", "=", "_toolkit_get_topk_bottomk", "(", "coefs", ",", "k", "=", "5", ")", "(", "coefs_list", ",", "titles_list", ")", "=", "_summarize_coefficients", "(", "top_coefs", ",", "bottom_coefs", ")", "return", "(", "[", "model_fields", ",", "hyperparam_fields", ",", "solver_fields", ",", "training_fields", "]", "+", "coefs_list", ",", "[", "'Schema'", ",", "'Hyperparameters'", ",", "'Training Summary'", ",", "'Settings'", "]", "+", "titles_list", ")" ]
Returns a structured description of the model, including (where relevant) the schema of the training data, description of the training data, training statistics, and model hyperparameters. Returns ------- sections : list (of list of tuples) A list of summary sections. Each section is a list. Each item in a section list is a tuple of the form: ('<label>','<field>') section_titles: list A list of section titles. The order matches that of the 'sections' object.
[ "Returns", "a", "structured", "description", "of", "the", "model", "including", "(", "where", "relevant", ")", "the", "schema", "of", "the", "training", "data", "description", "of", "the", "training", "data", "training", "statistics", "and", "model", "hyperparameters", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/classifier/logistic_classifier.py#L403-L451
train
apple/turicreate
src/unity/python/turicreate/toolkits/classifier/logistic_classifier.py
LogisticClassifier.classify
def classify(self, dataset, missing_value_action='auto'): """ Return a classification, for each example in the ``dataset``, using the trained logistic regression model. The output SFrame contains predictions as both class labels (0 or 1) as well as probabilities that the predicted value is the associated label. Parameters ---------- dataset : SFrame Dataset of new observations. Must include columns with the same names as the features used for model training, but does not require a target column. Additional columns are ignored. missing_value_action : str, optional Action to perform when missing values are encountered. This can be one of: - 'auto': Default to 'impute' - 'impute': Proceed with evaluation by filling in the missing values with the mean of the training data. Missing values are also imputed if an entire column of data is missing during evaluation. - 'error': Do not proceed with evaluation and terminate with an error message. Returns ------- out : SFrame An SFrame with model predictions i.e class labels and probabilities. See Also ---------- create, evaluate, predict Examples ---------- >>> data = turicreate.SFrame('https://static.turi.com/datasets/regression/houses.csv') >>> data['is_expensive'] = data['price'] > 30000 >>> model = turicreate.logistic_classifier.create(data, target='is_expensive', features=['bath', 'bedroom', 'size']) >>> classes = model.classify(data) """ return super(LogisticClassifier, self).classify(dataset, missing_value_action=missing_value_action)
python
def classify(self, dataset, missing_value_action='auto'): """ Return a classification, for each example in the ``dataset``, using the trained logistic regression model. The output SFrame contains predictions as both class labels (0 or 1) as well as probabilities that the predicted value is the associated label. Parameters ---------- dataset : SFrame Dataset of new observations. Must include columns with the same names as the features used for model training, but does not require a target column. Additional columns are ignored. missing_value_action : str, optional Action to perform when missing values are encountered. This can be one of: - 'auto': Default to 'impute' - 'impute': Proceed with evaluation by filling in the missing values with the mean of the training data. Missing values are also imputed if an entire column of data is missing during evaluation. - 'error': Do not proceed with evaluation and terminate with an error message. Returns ------- out : SFrame An SFrame with model predictions i.e class labels and probabilities. See Also ---------- create, evaluate, predict Examples ---------- >>> data = turicreate.SFrame('https://static.turi.com/datasets/regression/houses.csv') >>> data['is_expensive'] = data['price'] > 30000 >>> model = turicreate.logistic_classifier.create(data, target='is_expensive', features=['bath', 'bedroom', 'size']) >>> classes = model.classify(data) """ return super(LogisticClassifier, self).classify(dataset, missing_value_action=missing_value_action)
[ "def", "classify", "(", "self", ",", "dataset", ",", "missing_value_action", "=", "'auto'", ")", ":", "return", "super", "(", "LogisticClassifier", ",", "self", ")", ".", "classify", "(", "dataset", ",", "missing_value_action", "=", "missing_value_action", ")" ]
Return a classification, for each example in the ``dataset``, using the trained logistic regression model. The output SFrame contains predictions as both class labels (0 or 1) as well as probabilities that the predicted value is the associated label. Parameters ---------- dataset : SFrame Dataset of new observations. Must include columns with the same names as the features used for model training, but does not require a target column. Additional columns are ignored. missing_value_action : str, optional Action to perform when missing values are encountered. This can be one of: - 'auto': Default to 'impute' - 'impute': Proceed with evaluation by filling in the missing values with the mean of the training data. Missing values are also imputed if an entire column of data is missing during evaluation. - 'error': Do not proceed with evaluation and terminate with an error message. Returns ------- out : SFrame An SFrame with model predictions i.e class labels and probabilities. See Also ---------- create, evaluate, predict Examples ---------- >>> data = turicreate.SFrame('https://static.turi.com/datasets/regression/houses.csv') >>> data['is_expensive'] = data['price'] > 30000 >>> model = turicreate.logistic_classifier.create(data, target='is_expensive', features=['bath', 'bedroom', 'size']) >>> classes = model.classify(data)
[ "Return", "a", "classification", "for", "each", "example", "in", "the", "dataset", "using", "the", "trained", "logistic", "regression", "model", ".", "The", "output", "SFrame", "contains", "predictions", "as", "both", "class", "labels", "(", "0", "or", "1", ")", "as", "well", "as", "probabilities", "that", "the", "predicted", "value", "is", "the", "associated", "label", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/src/unity/python/turicreate/toolkits/classifier/logistic_classifier.py#L631-L680
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
add_prefix_and_suffix
def add_prefix_and_suffix(specified_name, type, property_set): """Appends the suffix appropriate to 'type/property-set' combination to the specified name and returns the result.""" property_set = b2.util.jam_to_value_maybe(property_set) suffix = "" if type: suffix = b2.build.type.generated_target_suffix(type, property_set) # Handle suffixes for which no leading dot is desired. Those are # specified by enclosing them in <...>. Needed by python so it # can create "_d.so" extensions, for example. if get_grist(suffix): suffix = ungrist(suffix) elif suffix: suffix = "." + suffix prefix = "" if type: prefix = b2.build.type.generated_target_prefix(type, property_set) if specified_name.startswith(prefix): prefix = "" if not prefix: prefix = "" if not suffix: suffix = "" return prefix + specified_name + suffix
python
def add_prefix_and_suffix(specified_name, type, property_set): """Appends the suffix appropriate to 'type/property-set' combination to the specified name and returns the result.""" property_set = b2.util.jam_to_value_maybe(property_set) suffix = "" if type: suffix = b2.build.type.generated_target_suffix(type, property_set) # Handle suffixes for which no leading dot is desired. Those are # specified by enclosing them in <...>. Needed by python so it # can create "_d.so" extensions, for example. if get_grist(suffix): suffix = ungrist(suffix) elif suffix: suffix = "." + suffix prefix = "" if type: prefix = b2.build.type.generated_target_prefix(type, property_set) if specified_name.startswith(prefix): prefix = "" if not prefix: prefix = "" if not suffix: suffix = "" return prefix + specified_name + suffix
[ "def", "add_prefix_and_suffix", "(", "specified_name", ",", "type", ",", "property_set", ")", ":", "property_set", "=", "b2", ".", "util", ".", "jam_to_value_maybe", "(", "property_set", ")", "suffix", "=", "\"\"", "if", "type", ":", "suffix", "=", "b2", ".", "build", ".", "type", ".", "generated_target_suffix", "(", "type", ",", "property_set", ")", "# Handle suffixes for which no leading dot is desired. Those are", "# specified by enclosing them in <...>. Needed by python so it", "# can create \"_d.so\" extensions, for example.", "if", "get_grist", "(", "suffix", ")", ":", "suffix", "=", "ungrist", "(", "suffix", ")", "elif", "suffix", ":", "suffix", "=", "\".\"", "+", "suffix", "prefix", "=", "\"\"", "if", "type", ":", "prefix", "=", "b2", ".", "build", ".", "type", ".", "generated_target_prefix", "(", "type", ",", "property_set", ")", "if", "specified_name", ".", "startswith", "(", "prefix", ")", ":", "prefix", "=", "\"\"", "if", "not", "prefix", ":", "prefix", "=", "\"\"", "if", "not", "suffix", ":", "suffix", "=", "\"\"", "return", "prefix", "+", "specified_name", "+", "suffix" ]
Appends the suffix appropriate to 'type/property-set' combination to the specified name and returns the result.
[ "Appends", "the", "suffix", "appropriate", "to", "type", "/", "property", "-", "set", "combination", "to", "the", "specified", "name", "and", "returns", "the", "result", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L610-L639
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
traverse
def traverse (target, include_roots = False, include_sources = False): """ Traverses the dependency graph of 'target' and return all targets that will be created before this one is created. If root of some dependency graph is found during traversal, it's either included or not, dependencing of the value of 'include_roots'. In either case, sources of root are not traversed. """ 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 action.sources (): # FIXME: # TODO: see comment in Manager.register_object () #if not isinstance (t, VirtualTarget): # t = target.project_.manager_.get_object (t) if not t.root (): result += traverse (t, include_roots, include_sources) elif include_roots: result.append (t) elif include_sources: result.append (target) return result
python
def traverse (target, include_roots = False, include_sources = False): """ Traverses the dependency graph of 'target' and return all targets that will be created before this one is created. If root of some dependency graph is found during traversal, it's either included or not, dependencing of the value of 'include_roots'. In either case, sources of root are not traversed. """ 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 action.sources (): # FIXME: # TODO: see comment in Manager.register_object () #if not isinstance (t, VirtualTarget): # t = target.project_.manager_.get_object (t) if not t.root (): result += traverse (t, include_roots, include_sources) elif include_roots: result.append (t) elif include_sources: result.append (target) return result
[ "def", "traverse", "(", "target", ",", "include_roots", "=", "False", ",", "include_sources", "=", "False", ")", ":", "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", "action", ".", "sources", "(", ")", ":", "# FIXME:", "# TODO: see comment in Manager.register_object ()", "#if not isinstance (t, VirtualTarget):", "# t = target.project_.manager_.get_object (t)", "if", "not", "t", ".", "root", "(", ")", ":", "result", "+=", "traverse", "(", "t", ",", "include_roots", ",", "include_sources", ")", "elif", "include_roots", ":", "result", ".", "append", "(", "t", ")", "elif", "include_sources", ":", "result", ".", "append", "(", "target", ")", "return", "result" ]
Traverses the dependency graph of 'target' and return all targets that will be created before this one is created. If root of some dependency graph is found during traversal, it's either included or not, dependencing of the value of 'include_roots'. In either case, sources of root are not traversed.
[ "Traverses", "the", "dependency", "graph", "of", "target", "and", "return", "all", "targets", "that", "will", "be", "created", "before", "this", "one", "is", "created", ".", "If", "root", "of", "some", "dependency", "graph", "is", "found", "during", "traversal", "it", "s", "either", "included", "or", "not", "dependencing", "of", "the", "value", "of", "include_roots", ".", "In", "either", "case", "sources", "of", "root", "are", "not", "traversed", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L963-L996
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
clone_action
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. The rule-name and properties are set to 'new-rule-name' and 'new-properties', if those are specified. Returns the cloned action.""" 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_action_name = action.action_name() if not new_properties: new_properties = action.properties() cloned_action = action.__class__(action.manager_, action.sources(), new_action_name, new_properties) cloned_targets = [] for target in action.targets(): n = target.name() # Don't modify the name of the produced targets. Strip the directory f cloned_target = FileTarget(n, target.type(), new_project, cloned_action, exact=True) d = target.dependencies() if d: cloned_target.depends(d) cloned_target.root(target.root()) cloned_target.creating_subvariant(target.creating_subvariant()) cloned_targets.append(cloned_target) return cloned_action
python
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. The rule-name and properties are set to 'new-rule-name' and 'new-properties', if those are specified. Returns the cloned action.""" 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_action_name = action.action_name() if not new_properties: new_properties = action.properties() cloned_action = action.__class__(action.manager_, action.sources(), new_action_name, new_properties) cloned_targets = [] for target in action.targets(): n = target.name() # Don't modify the name of the produced targets. Strip the directory f cloned_target = FileTarget(n, target.type(), new_project, cloned_action, exact=True) d = target.dependencies() if d: cloned_target.depends(d) cloned_target.root(target.root()) cloned_target.creating_subvariant(target.creating_subvariant()) cloned_targets.append(cloned_target) return cloned_action
[ "def", "clone_action", "(", "action", ",", "new_project", ",", "new_action_name", ",", "new_properties", ")", ":", "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_action_name", "=", "action", ".", "action_name", "(", ")", "if", "not", "new_properties", ":", "new_properties", "=", "action", ".", "properties", "(", ")", "cloned_action", "=", "action", ".", "__class__", "(", "action", ".", "manager_", ",", "action", ".", "sources", "(", ")", ",", "new_action_name", ",", "new_properties", ")", "cloned_targets", "=", "[", "]", "for", "target", "in", "action", ".", "targets", "(", ")", ":", "n", "=", "target", ".", "name", "(", ")", "# Don't modify the name of the produced targets. Strip the directory f", "cloned_target", "=", "FileTarget", "(", "n", ",", "target", ".", "type", "(", ")", ",", "new_project", ",", "cloned_action", ",", "exact", "=", "True", ")", "d", "=", "target", ".", "dependencies", "(", ")", "if", "d", ":", "cloned_target", ".", "depends", "(", "d", ")", "cloned_target", ".", "root", "(", "target", ".", "root", "(", ")", ")", "cloned_target", ".", "creating_subvariant", "(", "target", ".", "creating_subvariant", "(", ")", ")", "cloned_targets", ".", "append", "(", "cloned_target", ")", "return", "cloned_action" ]
Takes an 'action' instances and creates new instance of it and all produced target. The rule-name and properties are set to 'new-rule-name' and 'new-properties', if those are specified. Returns the cloned action.
[ "Takes", "an", "action", "instances", "and", "creates", "new", "instance", "of", "it", "and", "all", "produced", "target", ".", "The", "rule", "-", "name", "and", "properties", "are", "set", "to", "new", "-", "rule", "-", "name", "and", "new", "-", "properties", "if", "those", "are", "specified", ".", "Returns", "the", "cloned", "action", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L998-L1034
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
VirtualTargetRegistry.register
def register (self, target): """ Registers a new virtual target. Checks if there's already registered target, with the same name, type, project and subvariant properties, and also with the same sources and equal action. If such target is found it is retured and 'target' is not registered. Otherwise, 'target' is registered and returned. """ assert isinstance(target, VirtualTarget) if target.path(): signature = target.path() + "-" + target.name() else: signature = "-" + target.name() result = None if signature not in self.cache_: self.cache_ [signature] = [] for t in self.cache_ [signature]: a1 = t.action () a2 = target.action () # TODO: why are we checking for not result? if not result: if not a1 and not a2: result = t else: if a1 and a2 and a1.action_name () == a2.action_name () and a1.sources () == a2.sources (): ps1 = a1.properties () ps2 = a2.properties () p1 = ps1.base () + ps1.free () +\ b2.util.set.difference(ps1.dependency(), ps1.incidental()) p2 = ps2.base () + ps2.free () +\ b2.util.set.difference(ps2.dependency(), ps2.incidental()) if p1 == p2: result = t if not result: self.cache_ [signature].append (target) result = target # TODO: Don't append if we found pre-existing target? self.recent_targets_.append(result) self.all_targets_.append(result) return result
python
def register (self, target): """ Registers a new virtual target. Checks if there's already registered target, with the same name, type, project and subvariant properties, and also with the same sources and equal action. If such target is found it is retured and 'target' is not registered. Otherwise, 'target' is registered and returned. """ assert isinstance(target, VirtualTarget) if target.path(): signature = target.path() + "-" + target.name() else: signature = "-" + target.name() result = None if signature not in self.cache_: self.cache_ [signature] = [] for t in self.cache_ [signature]: a1 = t.action () a2 = target.action () # TODO: why are we checking for not result? if not result: if not a1 and not a2: result = t else: if a1 and a2 and a1.action_name () == a2.action_name () and a1.sources () == a2.sources (): ps1 = a1.properties () ps2 = a2.properties () p1 = ps1.base () + ps1.free () +\ b2.util.set.difference(ps1.dependency(), ps1.incidental()) p2 = ps2.base () + ps2.free () +\ b2.util.set.difference(ps2.dependency(), ps2.incidental()) if p1 == p2: result = t if not result: self.cache_ [signature].append (target) result = target # TODO: Don't append if we found pre-existing target? self.recent_targets_.append(result) self.all_targets_.append(result) return result
[ "def", "register", "(", "self", ",", "target", ")", ":", "assert", "isinstance", "(", "target", ",", "VirtualTarget", ")", "if", "target", ".", "path", "(", ")", ":", "signature", "=", "target", ".", "path", "(", ")", "+", "\"-\"", "+", "target", ".", "name", "(", ")", "else", ":", "signature", "=", "\"-\"", "+", "target", ".", "name", "(", ")", "result", "=", "None", "if", "signature", "not", "in", "self", ".", "cache_", ":", "self", ".", "cache_", "[", "signature", "]", "=", "[", "]", "for", "t", "in", "self", ".", "cache_", "[", "signature", "]", ":", "a1", "=", "t", ".", "action", "(", ")", "a2", "=", "target", ".", "action", "(", ")", "# TODO: why are we checking for not result?", "if", "not", "result", ":", "if", "not", "a1", "and", "not", "a2", ":", "result", "=", "t", "else", ":", "if", "a1", "and", "a2", "and", "a1", ".", "action_name", "(", ")", "==", "a2", ".", "action_name", "(", ")", "and", "a1", ".", "sources", "(", ")", "==", "a2", ".", "sources", "(", ")", ":", "ps1", "=", "a1", ".", "properties", "(", ")", "ps2", "=", "a2", ".", "properties", "(", ")", "p1", "=", "ps1", ".", "base", "(", ")", "+", "ps1", ".", "free", "(", ")", "+", "b2", ".", "util", ".", "set", ".", "difference", "(", "ps1", ".", "dependency", "(", ")", ",", "ps1", ".", "incidental", "(", ")", ")", "p2", "=", "ps2", ".", "base", "(", ")", "+", "ps2", ".", "free", "(", ")", "+", "b2", ".", "util", ".", "set", ".", "difference", "(", "ps2", ".", "dependency", "(", ")", ",", "ps2", ".", "incidental", "(", ")", ")", "if", "p1", "==", "p2", ":", "result", "=", "t", "if", "not", "result", ":", "self", ".", "cache_", "[", "signature", "]", ".", "append", "(", "target", ")", "result", "=", "target", "# TODO: Don't append if we found pre-existing target?", "self", ".", "recent_targets_", ".", "append", "(", "result", ")", "self", ".", "all_targets_", ".", "append", "(", "result", ")", "return", "result" ]
Registers a new virtual target. Checks if there's already registered target, with the same name, type, project and subvariant properties, and also with the same sources and equal action. If such target is found it is retured and 'target' is not registered. Otherwise, 'target' is registered and returned.
[ "Registers", "a", "new", "virtual", "target", ".", "Checks", "if", "there", "s", "already", "registered", "target", "with", "the", "same", "name", "type", "project", "and", "subvariant", "properties", "and", "also", "with", "the", "same", "sources", "and", "equal", "action", ".", "If", "such", "target", "is", "found", "it", "is", "retured", "and", "target", "is", "not", "registered", ".", "Otherwise", "target", "is", "registered", "and", "returned", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L107-L150
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
VirtualTargetRegistry.from_file
def from_file (self, file, file_location, project): """ Creates a virtual target with appropriate name and type from 'file'. If a target with that name in that project was already created, returns that already created target. TODO: more correct way would be to compute path to the file, based on name and source location for the project, and use that path to determine if the target was already created. TODO: passing project with all virtual targets starts to be annoying. """ if __debug__: from .targets import ProjectTarget assert isinstance(file, basestring) assert isinstance(file_location, basestring) assert isinstance(project, ProjectTarget) # Check if we've created a target corresponding to this file. path = os.path.join(os.getcwd(), file_location, file) path = os.path.normpath(path) if path in self.files_: return self.files_ [path] file_type = b2.build.type.type (file) result = FileTarget (file, file_type, project, None, file_location) self.files_ [path] = result return result
python
def from_file (self, file, file_location, project): """ Creates a virtual target with appropriate name and type from 'file'. If a target with that name in that project was already created, returns that already created target. TODO: more correct way would be to compute path to the file, based on name and source location for the project, and use that path to determine if the target was already created. TODO: passing project with all virtual targets starts to be annoying. """ if __debug__: from .targets import ProjectTarget assert isinstance(file, basestring) assert isinstance(file_location, basestring) assert isinstance(project, ProjectTarget) # Check if we've created a target corresponding to this file. path = os.path.join(os.getcwd(), file_location, file) path = os.path.normpath(path) if path in self.files_: return self.files_ [path] file_type = b2.build.type.type (file) result = FileTarget (file, file_type, project, None, file_location) self.files_ [path] = result return result
[ "def", "from_file", "(", "self", ",", "file", ",", "file_location", ",", "project", ")", ":", "if", "__debug__", ":", "from", ".", "targets", "import", "ProjectTarget", "assert", "isinstance", "(", "file", ",", "basestring", ")", "assert", "isinstance", "(", "file_location", ",", "basestring", ")", "assert", "isinstance", "(", "project", ",", "ProjectTarget", ")", "# Check if we've created a target corresponding to this file.", "path", "=", "os", ".", "path", ".", "join", "(", "os", ".", "getcwd", "(", ")", ",", "file_location", ",", "file", ")", "path", "=", "os", ".", "path", ".", "normpath", "(", "path", ")", "if", "path", "in", "self", ".", "files_", ":", "return", "self", ".", "files_", "[", "path", "]", "file_type", "=", "b2", ".", "build", ".", "type", ".", "type", "(", "file", ")", "result", "=", "FileTarget", "(", "file", ",", "file_type", ",", "project", ",", "None", ",", "file_location", ")", "self", ".", "files_", "[", "path", "]", "=", "result", "return", "result" ]
Creates a virtual target with appropriate name and type from 'file'. If a target with that name in that project was already created, returns that already created target. TODO: more correct way would be to compute path to the file, based on name and source location for the project, and use that path to determine if the target was already created. TODO: passing project with all virtual targets starts to be annoying.
[ "Creates", "a", "virtual", "target", "with", "appropriate", "name", "and", "type", "from", "file", ".", "If", "a", "target", "with", "that", "name", "in", "that", "project", "was", "already", "created", "returns", "that", "already", "created", "target", ".", "TODO", ":", "more", "correct", "way", "would", "be", "to", "compute", "path", "to", "the", "file", "based", "on", "name", "and", "source", "location", "for", "the", "project", "and", "use", "that", "path", "to", "determine", "if", "the", "target", "was", "already", "created", ".", "TODO", ":", "passing", "project", "with", "all", "virtual", "targets", "starts", "to", "be", "annoying", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L152-L178
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
VirtualTargetRegistry.add_suffix
def add_suffix (self, specified_name, file_type, prop_set): """ Appends the suffix appropriate to 'type/property_set' combination to the specified name and returns the result. """ assert isinstance(specified_name, basestring) assert isinstance(file_type, basestring) assert isinstance(prop_set, property_set.PropertySet) suffix = b2.build.type.generated_target_suffix (file_type, prop_set) if suffix: return specified_name + '.' + suffix else: return specified_name
python
def add_suffix (self, specified_name, file_type, prop_set): """ Appends the suffix appropriate to 'type/property_set' combination to the specified name and returns the result. """ assert isinstance(specified_name, basestring) assert isinstance(file_type, basestring) assert isinstance(prop_set, property_set.PropertySet) suffix = b2.build.type.generated_target_suffix (file_type, prop_set) if suffix: return specified_name + '.' + suffix else: return specified_name
[ "def", "add_suffix", "(", "self", ",", "specified_name", ",", "file_type", ",", "prop_set", ")", ":", "assert", "isinstance", "(", "specified_name", ",", "basestring", ")", "assert", "isinstance", "(", "file_type", ",", "basestring", ")", "assert", "isinstance", "(", "prop_set", ",", "property_set", ".", "PropertySet", ")", "suffix", "=", "b2", ".", "build", ".", "type", ".", "generated_target_suffix", "(", "file_type", ",", "prop_set", ")", "if", "suffix", ":", "return", "specified_name", "+", "'.'", "+", "suffix", "else", ":", "return", "specified_name" ]
Appends the suffix appropriate to 'type/property_set' combination to the specified name and returns the result.
[ "Appends", "the", "suffix", "appropriate", "to", "type", "/", "property_set", "combination", "to", "the", "specified", "name", "and", "returns", "the", "result", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L248-L261
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
VirtualTarget.depends
def depends (self, d): """ Adds additional instances of 'VirtualTarget' that this one depends on. """ self.dependencies_ = unique (self.dependencies_ + d).sort ()
python
def depends (self, d): """ Adds additional instances of 'VirtualTarget' that this one depends on. """ self.dependencies_ = unique (self.dependencies_ + d).sort ()
[ "def", "depends", "(", "self", ",", "d", ")", ":", "self", ".", "dependencies_", "=", "unique", "(", "self", ".", "dependencies_", "+", "d", ")", ".", "sort", "(", ")" ]
Adds additional instances of 'VirtualTarget' that this one depends on.
[ "Adds", "additional", "instances", "of", "VirtualTarget", "that", "this", "one", "depends", "on", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L299-L303
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
VirtualTarget.actualize
def actualize (self, scanner = None): """ Generates all the actual targets and sets up build actions for this target. If 'scanner' is specified, creates an additional target with the same location as actual target, which will depend on the actual target and be associated with 'scanner'. That additional target is returned. See the docs (#dependency_scanning) for rationale. Target must correspond to a file if 'scanner' is specified. If scanner is not specified, then actual target is returned. """ if __debug__: from .scanner import Scanner assert scanner is None or isinstance(scanner, Scanner) actual_name = self.actualize_no_scanner () if self.always_: bjam.call("ALWAYS", actual_name) if not scanner: return actual_name else: # Add the scanner instance to the grist for name. g = '-'.join ([ungrist(get_grist(actual_name)), str(id(scanner))]) name = replace_grist (actual_name, '<' + g + '>') if name not in self.made_: self.made_ [name] = True self.project_.manager ().engine ().add_dependency (name, actual_name) self.actualize_location (name) self.project_.manager ().scanners ().install (scanner, name, str (self)) return name
python
def actualize (self, scanner = None): """ Generates all the actual targets and sets up build actions for this target. If 'scanner' is specified, creates an additional target with the same location as actual target, which will depend on the actual target and be associated with 'scanner'. That additional target is returned. See the docs (#dependency_scanning) for rationale. Target must correspond to a file if 'scanner' is specified. If scanner is not specified, then actual target is returned. """ if __debug__: from .scanner import Scanner assert scanner is None or isinstance(scanner, Scanner) actual_name = self.actualize_no_scanner () if self.always_: bjam.call("ALWAYS", actual_name) if not scanner: return actual_name else: # Add the scanner instance to the grist for name. g = '-'.join ([ungrist(get_grist(actual_name)), str(id(scanner))]) name = replace_grist (actual_name, '<' + g + '>') if name not in self.made_: self.made_ [name] = True self.project_.manager ().engine ().add_dependency (name, actual_name) self.actualize_location (name) self.project_.manager ().scanners ().install (scanner, name, str (self)) return name
[ "def", "actualize", "(", "self", ",", "scanner", "=", "None", ")", ":", "if", "__debug__", ":", "from", ".", "scanner", "import", "Scanner", "assert", "scanner", "is", "None", "or", "isinstance", "(", "scanner", ",", "Scanner", ")", "actual_name", "=", "self", ".", "actualize_no_scanner", "(", ")", "if", "self", ".", "always_", ":", "bjam", ".", "call", "(", "\"ALWAYS\"", ",", "actual_name", ")", "if", "not", "scanner", ":", "return", "actual_name", "else", ":", "# Add the scanner instance to the grist for name.", "g", "=", "'-'", ".", "join", "(", "[", "ungrist", "(", "get_grist", "(", "actual_name", ")", ")", ",", "str", "(", "id", "(", "scanner", ")", ")", "]", ")", "name", "=", "replace_grist", "(", "actual_name", ",", "'<'", "+", "g", "+", "'>'", ")", "if", "name", "not", "in", "self", ".", "made_", ":", "self", ".", "made_", "[", "name", "]", "=", "True", "self", ".", "project_", ".", "manager", "(", ")", ".", "engine", "(", ")", ".", "add_dependency", "(", "name", ",", "actual_name", ")", "self", ".", "actualize_location", "(", "name", ")", "self", ".", "project_", ".", "manager", "(", ")", ".", "scanners", "(", ")", ".", "install", "(", "scanner", ",", "name", ",", "str", "(", "self", ")", ")", "return", "name" ]
Generates all the actual targets and sets up build actions for this target. If 'scanner' is specified, creates an additional target with the same location as actual target, which will depend on the actual target and be associated with 'scanner'. That additional target is returned. See the docs (#dependency_scanning) for rationale. Target must correspond to a file if 'scanner' is specified. If scanner is not specified, then actual target is returned.
[ "Generates", "all", "the", "actual", "targets", "and", "sets", "up", "build", "actions", "for", "this", "target", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L311-L349
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
AbstractFileTarget.set_path
def set_path (self, path): """ Sets the path. When generating target name, it will override any path computation from properties. """ assert isinstance(path, basestring) self.path_ = os.path.normpath(path)
python
def set_path (self, path): """ Sets the path. When generating target name, it will override any path computation from properties. """ assert isinstance(path, basestring) self.path_ = os.path.normpath(path)
[ "def", "set_path", "(", "self", ",", "path", ")", ":", "assert", "isinstance", "(", "path", ",", "basestring", ")", "self", ".", "path_", "=", "os", ".", "path", ".", "normpath", "(", "path", ")" ]
Sets the path. When generating target name, it will override any path computation from properties.
[ "Sets", "the", "path", ".", "When", "generating", "target", "name", "it", "will", "override", "any", "path", "computation", "from", "properties", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L425-L430
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
AbstractFileTarget.root
def root (self, set = None): """ Sets/gets the 'root' flag. Target is root is it directly correspods to some variant of a main target. """ assert isinstance(set, (int, bool, type(None))) if set: self.root_ = True return self.root_
python
def root (self, set = None): """ Sets/gets the 'root' flag. Target is root is it directly correspods to some variant of a main target. """ assert isinstance(set, (int, bool, type(None))) if set: self.root_ = True return self.root_
[ "def", "root", "(", "self", ",", "set", "=", "None", ")", ":", "assert", "isinstance", "(", "set", ",", "(", "int", ",", "bool", ",", "type", "(", "None", ")", ")", ")", "if", "set", ":", "self", ".", "root_", "=", "True", "return", "self", ".", "root_" ]
Sets/gets the 'root' flag. Target is root is it directly correspods to some variant of a main target.
[ "Sets", "/", "gets", "the", "root", "flag", ".", "Target", "is", "root", "is", "it", "directly", "correspods", "to", "some", "variant", "of", "a", "main", "target", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L437-L444
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
AbstractFileTarget.creating_subvariant
def creating_subvariant (self, s = None): """ Gets or sets the subvariant which created this target. Subvariant is set when target is brought into existance, and is never changed after that. In particual, if target is shared by subvariant, only the first is stored. s: If specified, specified the value to set, which should be instance of 'subvariant' class. """ assert s is None or isinstance(s, Subvariant) if s and not self.creating_subvariant (): if self.creating_subvariant (): raise BaseException ("Attempt to change 'dg'") else: self.creating_subvariant_ = s return self.creating_subvariant_
python
def creating_subvariant (self, s = None): """ Gets or sets the subvariant which created this target. Subvariant is set when target is brought into existance, and is never changed after that. In particual, if target is shared by subvariant, only the first is stored. s: If specified, specified the value to set, which should be instance of 'subvariant' class. """ assert s is None or isinstance(s, Subvariant) if s and not self.creating_subvariant (): if self.creating_subvariant (): raise BaseException ("Attempt to change 'dg'") else: self.creating_subvariant_ = s return self.creating_subvariant_
[ "def", "creating_subvariant", "(", "self", ",", "s", "=", "None", ")", ":", "assert", "s", "is", "None", "or", "isinstance", "(", "s", ",", "Subvariant", ")", "if", "s", "and", "not", "self", ".", "creating_subvariant", "(", ")", ":", "if", "self", ".", "creating_subvariant", "(", ")", ":", "raise", "BaseException", "(", "\"Attempt to change 'dg'\"", ")", "else", ":", "self", ".", "creating_subvariant_", "=", "s", "return", "self", ".", "creating_subvariant_" ]
Gets or sets the subvariant which created this target. Subvariant is set when target is brought into existance, and is never changed after that. In particual, if target is shared by subvariant, only the first is stored. s: If specified, specified the value to set, which should be instance of 'subvariant' class.
[ "Gets", "or", "sets", "the", "subvariant", "which", "created", "this", "target", ".", "Subvariant", "is", "set", "when", "target", "is", "brought", "into", "existance", "and", "is", "never", "changed", "after", "that", ".", "In", "particual", "if", "target", "is", "shared", "by", "subvariant", "only", "the", "first", "is", "stored", ".", "s", ":", "If", "specified", "specified", "the", "value", "to", "set", "which", "should", "be", "instance", "of", "subvariant", "class", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L446-L462
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
AbstractFileTarget.grist
def grist (self): """Helper to 'actual_name', above. Compute unique prefix used to distinguish this target from other targets with the same name which create different file. """ # Depending on target, there may be different approaches to generating # unique prefixes. We'll generate prefixes in the form # <one letter approach code> <the actual prefix> path = self.path () if path: # The target will be generated to a known path. Just use the path # for identification, since path is as unique as it can get. return 'p' + path else: # File is either source, which will be searched for, or is not a file at # all. Use the location of project for distinguishing. project_location = self.project_.get ('location') path_components = b2.util.path.split(project_location) location_grist = '!'.join (path_components) if self.action_: ps = self.action_.properties () property_grist = ps.as_path () # 'property_grist' can be empty when 'ps' is an empty # property set. if property_grist: location_grist = location_grist + '/' + property_grist return 'l' + location_grist
python
def grist (self): """Helper to 'actual_name', above. Compute unique prefix used to distinguish this target from other targets with the same name which create different file. """ # Depending on target, there may be different approaches to generating # unique prefixes. We'll generate prefixes in the form # <one letter approach code> <the actual prefix> path = self.path () if path: # The target will be generated to a known path. Just use the path # for identification, since path is as unique as it can get. return 'p' + path else: # File is either source, which will be searched for, or is not a file at # all. Use the location of project for distinguishing. project_location = self.project_.get ('location') path_components = b2.util.path.split(project_location) location_grist = '!'.join (path_components) if self.action_: ps = self.action_.properties () property_grist = ps.as_path () # 'property_grist' can be empty when 'ps' is an empty # property set. if property_grist: location_grist = location_grist + '/' + property_grist return 'l' + location_grist
[ "def", "grist", "(", "self", ")", ":", "# Depending on target, there may be different approaches to generating", "# unique prefixes. We'll generate prefixes in the form", "# <one letter approach code> <the actual prefix>", "path", "=", "self", ".", "path", "(", ")", "if", "path", ":", "# The target will be generated to a known path. Just use the path", "# for identification, since path is as unique as it can get.", "return", "'p'", "+", "path", "else", ":", "# File is either source, which will be searched for, or is not a file at", "# all. Use the location of project for distinguishing.", "project_location", "=", "self", ".", "project_", ".", "get", "(", "'location'", ")", "path_components", "=", "b2", ".", "util", ".", "path", ".", "split", "(", "project_location", ")", "location_grist", "=", "'!'", ".", "join", "(", "path_components", ")", "if", "self", ".", "action_", ":", "ps", "=", "self", ".", "action_", ".", "properties", "(", ")", "property_grist", "=", "ps", ".", "as_path", "(", ")", "# 'property_grist' can be empty when 'ps' is an empty", "# property set.", "if", "property_grist", ":", "location_grist", "=", "location_grist", "+", "'/'", "+", "property_grist", "return", "'l'", "+", "location_grist" ]
Helper to 'actual_name', above. Compute unique prefix used to distinguish this target from other targets with the same name which create different file.
[ "Helper", "to", "actual_name", "above", ".", "Compute", "unique", "prefix", "used", "to", "distinguish", "this", "target", "from", "other", "targets", "with", "the", "same", "name", "which", "create", "different", "file", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L500-L530
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
AbstractFileTarget.__adjust_name
def __adjust_name(self, specified_name): """Given the target name specified in constructor, returns the name which should be really used, by looking at the <tag> properties. The tag properties come in two flavour: - <tag>value, - <tag>@rule-name In the first case, value is just added to name In the second case, the specified rule is called with specified name, target type and properties and should return the new name. If not <tag> property is specified, or the rule specified by <tag> returns nothing, returns the result of calling virtual-target.add-suffix""" assert isinstance(specified_name, basestring) if self.action_: ps = self.action_.properties() else: ps = property_set.empty() # FIXME: I'm not sure how this is used, need to check with # Rene to figure out how to implement #~ We add ourselves to the properties so that any tag rule can get #~ more direct information about the target than just that available #~ through the properties. This is useful in implementing #~ name changes based on the sources of the target. For example to #~ make unique names of object files based on the source file. #~ --grafik #ps = property_set.create(ps.raw() + ["<target>%s" % "XXXX"]) #ps = [ property-set.create [ $(ps).raw ] <target>$(__name__) ] ; tag = ps.get("<tag>") if tag: if len(tag) > 1: get_manager().errors()( """<tag>@rulename is present but is not the only <tag> feature""") tag = tag[0] if callable(tag): self.name_ = tag(specified_name, self.type_, ps) else: if not tag[0] == '@': self.manager_.errors()("""The value of the <tag> feature must be '@rule-nane'""") exported_ps = b2.util.value_to_jam(ps, methods=True) self.name_ = b2.util.call_jam_function( tag[1:], specified_name, self.type_, exported_ps) if self.name_: self.name_ = self.name_[0] # If there's no tag or the tag rule returned nothing. if not tag or not self.name_: self.name_ = add_prefix_and_suffix(specified_name, self.type_, ps)
python
def __adjust_name(self, specified_name): """Given the target name specified in constructor, returns the name which should be really used, by looking at the <tag> properties. The tag properties come in two flavour: - <tag>value, - <tag>@rule-name In the first case, value is just added to name In the second case, the specified rule is called with specified name, target type and properties and should return the new name. If not <tag> property is specified, or the rule specified by <tag> returns nothing, returns the result of calling virtual-target.add-suffix""" assert isinstance(specified_name, basestring) if self.action_: ps = self.action_.properties() else: ps = property_set.empty() # FIXME: I'm not sure how this is used, need to check with # Rene to figure out how to implement #~ We add ourselves to the properties so that any tag rule can get #~ more direct information about the target than just that available #~ through the properties. This is useful in implementing #~ name changes based on the sources of the target. For example to #~ make unique names of object files based on the source file. #~ --grafik #ps = property_set.create(ps.raw() + ["<target>%s" % "XXXX"]) #ps = [ property-set.create [ $(ps).raw ] <target>$(__name__) ] ; tag = ps.get("<tag>") if tag: if len(tag) > 1: get_manager().errors()( """<tag>@rulename is present but is not the only <tag> feature""") tag = tag[0] if callable(tag): self.name_ = tag(specified_name, self.type_, ps) else: if not tag[0] == '@': self.manager_.errors()("""The value of the <tag> feature must be '@rule-nane'""") exported_ps = b2.util.value_to_jam(ps, methods=True) self.name_ = b2.util.call_jam_function( tag[1:], specified_name, self.type_, exported_ps) if self.name_: self.name_ = self.name_[0] # If there's no tag or the tag rule returned nothing. if not tag or not self.name_: self.name_ = add_prefix_and_suffix(specified_name, self.type_, ps)
[ "def", "__adjust_name", "(", "self", ",", "specified_name", ")", ":", "assert", "isinstance", "(", "specified_name", ",", "basestring", ")", "if", "self", ".", "action_", ":", "ps", "=", "self", ".", "action_", ".", "properties", "(", ")", "else", ":", "ps", "=", "property_set", ".", "empty", "(", ")", "# FIXME: I'm not sure how this is used, need to check with", "# Rene to figure out how to implement", "#~ We add ourselves to the properties so that any tag rule can get", "#~ more direct information about the target than just that available", "#~ through the properties. This is useful in implementing", "#~ name changes based on the sources of the target. For example to", "#~ make unique names of object files based on the source file.", "#~ --grafik", "#ps = property_set.create(ps.raw() + [\"<target>%s\" % \"XXXX\"])", "#ps = [ property-set.create [ $(ps).raw ] <target>$(__name__) ] ;", "tag", "=", "ps", ".", "get", "(", "\"<tag>\"", ")", "if", "tag", ":", "if", "len", "(", "tag", ")", ">", "1", ":", "get_manager", "(", ")", ".", "errors", "(", ")", "(", "\"\"\"<tag>@rulename is present but is not the only <tag> feature\"\"\"", ")", "tag", "=", "tag", "[", "0", "]", "if", "callable", "(", "tag", ")", ":", "self", ".", "name_", "=", "tag", "(", "specified_name", ",", "self", ".", "type_", ",", "ps", ")", "else", ":", "if", "not", "tag", "[", "0", "]", "==", "'@'", ":", "self", ".", "manager_", ".", "errors", "(", ")", "(", "\"\"\"The value of the <tag> feature must be '@rule-nane'\"\"\"", ")", "exported_ps", "=", "b2", ".", "util", ".", "value_to_jam", "(", "ps", ",", "methods", "=", "True", ")", "self", ".", "name_", "=", "b2", ".", "util", ".", "call_jam_function", "(", "tag", "[", "1", ":", "]", ",", "specified_name", ",", "self", ".", "type_", ",", "exported_ps", ")", "if", "self", ".", "name_", ":", "self", ".", "name_", "=", "self", ".", "name_", "[", "0", "]", "# If there's no tag or the tag rule returned nothing.", "if", "not", "tag", "or", "not", "self", ".", "name_", ":", "self", ".", "name_", "=", "add_prefix_and_suffix", "(", "specified_name", ",", "self", ".", "type_", ",", "ps", ")" ]
Given the target name specified in constructor, returns the name which should be really used, by looking at the <tag> properties. The tag properties come in two flavour: - <tag>value, - <tag>@rule-name In the first case, value is just added to name In the second case, the specified rule is called with specified name, target type and properties and should return the new name. If not <tag> property is specified, or the rule specified by <tag> returns nothing, returns the result of calling virtual-target.add-suffix
[ "Given", "the", "target", "name", "specified", "in", "constructor", "returns", "the", "name", "which", "should", "be", "really", "used", "by", "looking", "at", "the", "<tag", ">", "properties", ".", "The", "tag", "properties", "come", "in", "two", "flavour", ":", "-", "<tag", ">", "value", "-", "<tag", ">" ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L532-L584
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
FileTarget.path
def path (self): """ Returns the directory for this target. """ if not self.path_: if self.action_: p = self.action_.properties () (target_path, relative_to_build_dir) = p.target_path () if relative_to_build_dir: # Indicates that the path is relative to # build dir. target_path = os.path.join (self.project_.build_dir (), target_path) # Store the computed path, so that it's not recomputed # any more self.path_ = target_path return os.path.normpath(self.path_)
python
def path (self): """ Returns the directory for this target. """ if not self.path_: if self.action_: p = self.action_.properties () (target_path, relative_to_build_dir) = p.target_path () if relative_to_build_dir: # Indicates that the path is relative to # build dir. target_path = os.path.join (self.project_.build_dir (), target_path) # Store the computed path, so that it's not recomputed # any more self.path_ = target_path return os.path.normpath(self.path_)
[ "def", "path", "(", "self", ")", ":", "if", "not", "self", ".", "path_", ":", "if", "self", ".", "action_", ":", "p", "=", "self", ".", "action_", ".", "properties", "(", ")", "(", "target_path", ",", "relative_to_build_dir", ")", "=", "p", ".", "target_path", "(", ")", "if", "relative_to_build_dir", ":", "# Indicates that the path is relative to", "# build dir.", "target_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "project_", ".", "build_dir", "(", ")", ",", "target_path", ")", "# Store the computed path, so that it's not recomputed", "# any more", "self", ".", "path_", "=", "target_path", "return", "os", ".", "path", ".", "normpath", "(", "self", ".", "path_", ")" ]
Returns the directory for this target.
[ "Returns", "the", "directory", "for", "this", "target", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L727-L744
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
Action.actualize
def actualize (self): """ Generates actual build instructions. """ if self.actualized_: return self.actualized_ = True ps = self.properties () properties = self.adjust_properties (ps) actual_targets = [] for i in self.targets (): actual_targets.append (i.actualize ()) self.actualize_sources (self.sources (), properties) self.engine_.add_dependency (actual_targets, self.actual_sources_ + self.dependency_only_sources_) # FIXME: check the comment below. Was self.action_name_ [1] # Action name can include additional rule arguments, which should not # be passed to 'set-target-variables'. # FIXME: breaking circular dependency import toolset toolset.set_target_variables (self.manager_, self.action_name_, actual_targets, properties) engine = self.manager_.engine () # FIXME: this is supposed to help --out-xml option, but we don't # implement that now, and anyway, we should handle it in Python, # not but putting variables on bjam-level targets. bjam.call("set-target-variable", actual_targets, ".action", repr(self)) self.manager_.engine ().set_update_action (self.action_name_, actual_targets, self.actual_sources_, properties) # Since we set up creating action here, we also set up # action for cleaning up self.manager_.engine ().set_update_action ('common.Clean', 'clean-all', actual_targets) return actual_targets
python
def actualize (self): """ Generates actual build instructions. """ if self.actualized_: return self.actualized_ = True ps = self.properties () properties = self.adjust_properties (ps) actual_targets = [] for i in self.targets (): actual_targets.append (i.actualize ()) self.actualize_sources (self.sources (), properties) self.engine_.add_dependency (actual_targets, self.actual_sources_ + self.dependency_only_sources_) # FIXME: check the comment below. Was self.action_name_ [1] # Action name can include additional rule arguments, which should not # be passed to 'set-target-variables'. # FIXME: breaking circular dependency import toolset toolset.set_target_variables (self.manager_, self.action_name_, actual_targets, properties) engine = self.manager_.engine () # FIXME: this is supposed to help --out-xml option, but we don't # implement that now, and anyway, we should handle it in Python, # not but putting variables on bjam-level targets. bjam.call("set-target-variable", actual_targets, ".action", repr(self)) self.manager_.engine ().set_update_action (self.action_name_, actual_targets, self.actual_sources_, properties) # Since we set up creating action here, we also set up # action for cleaning up self.manager_.engine ().set_update_action ('common.Clean', 'clean-all', actual_targets) return actual_targets
[ "def", "actualize", "(", "self", ")", ":", "if", "self", ".", "actualized_", ":", "return", "self", ".", "actualized_", "=", "True", "ps", "=", "self", ".", "properties", "(", ")", "properties", "=", "self", ".", "adjust_properties", "(", "ps", ")", "actual_targets", "=", "[", "]", "for", "i", "in", "self", ".", "targets", "(", ")", ":", "actual_targets", ".", "append", "(", "i", ".", "actualize", "(", ")", ")", "self", ".", "actualize_sources", "(", "self", ".", "sources", "(", ")", ",", "properties", ")", "self", ".", "engine_", ".", "add_dependency", "(", "actual_targets", ",", "self", ".", "actual_sources_", "+", "self", ".", "dependency_only_sources_", ")", "# FIXME: check the comment below. Was self.action_name_ [1]", "# Action name can include additional rule arguments, which should not", "# be passed to 'set-target-variables'.", "# FIXME: breaking circular dependency", "import", "toolset", "toolset", ".", "set_target_variables", "(", "self", ".", "manager_", ",", "self", ".", "action_name_", ",", "actual_targets", ",", "properties", ")", "engine", "=", "self", ".", "manager_", ".", "engine", "(", ")", "# FIXME: this is supposed to help --out-xml option, but we don't", "# implement that now, and anyway, we should handle it in Python,", "# not but putting variables on bjam-level targets.", "bjam", ".", "call", "(", "\"set-target-variable\"", ",", "actual_targets", ",", "\".action\"", ",", "repr", "(", "self", ")", ")", "self", ".", "manager_", ".", "engine", "(", ")", ".", "set_update_action", "(", "self", ".", "action_name_", ",", "actual_targets", ",", "self", ".", "actual_sources_", ",", "properties", ")", "# Since we set up creating action here, we also set up", "# action for cleaning up", "self", ".", "manager_", ".", "engine", "(", ")", ".", "set_update_action", "(", "'common.Clean'", ",", "'clean-all'", ",", "actual_targets", ")", "return", "actual_targets" ]
Generates actual build instructions.
[ "Generates", "actual", "build", "instructions", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L818-L861
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
Action.actualize_source_type
def actualize_source_type (self, sources, prop_set): """ Helper for 'actualize_sources'. For each passed source, actualizes it with the appropriate scanner. Returns the actualized virtual targets. """ assert is_iterable_typed(sources, VirtualTarget) assert isinstance(prop_set, property_set.PropertySet) result = [] for i in sources: scanner = None # FIXME: what's this? # if isinstance (i, str): # i = self.manager_.get_object (i) if i.type (): scanner = b2.build.type.get_scanner (i.type (), prop_set) r = i.actualize (scanner) result.append (r) return result
python
def actualize_source_type (self, sources, prop_set): """ Helper for 'actualize_sources'. For each passed source, actualizes it with the appropriate scanner. Returns the actualized virtual targets. """ assert is_iterable_typed(sources, VirtualTarget) assert isinstance(prop_set, property_set.PropertySet) result = [] for i in sources: scanner = None # FIXME: what's this? # if isinstance (i, str): # i = self.manager_.get_object (i) if i.type (): scanner = b2.build.type.get_scanner (i.type (), prop_set) r = i.actualize (scanner) result.append (r) return result
[ "def", "actualize_source_type", "(", "self", ",", "sources", ",", "prop_set", ")", ":", "assert", "is_iterable_typed", "(", "sources", ",", "VirtualTarget", ")", "assert", "isinstance", "(", "prop_set", ",", "property_set", ".", "PropertySet", ")", "result", "=", "[", "]", "for", "i", "in", "sources", ":", "scanner", "=", "None", "# FIXME: what's this?", "# if isinstance (i, str):", "# i = self.manager_.get_object (i)", "if", "i", ".", "type", "(", ")", ":", "scanner", "=", "b2", ".", "build", ".", "type", ".", "get_scanner", "(", "i", ".", "type", "(", ")", ",", "prop_set", ")", "r", "=", "i", ".", "actualize", "(", "scanner", ")", "result", ".", "append", "(", "r", ")", "return", "result" ]
Helper for 'actualize_sources'. For each passed source, actualizes it with the appropriate scanner. Returns the actualized virtual targets.
[ "Helper", "for", "actualize_sources", ".", "For", "each", "passed", "source", "actualizes", "it", "with", "the", "appropriate", "scanner", ".", "Returns", "the", "actualized", "virtual", "targets", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L863-L884
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
Action.actualize_sources
def actualize_sources (self, sources, prop_set): """ Creates actual jam targets for sources. Initializes two member variables: 'self.actual_sources_' -- sources which are passed to updating action 'self.dependency_only_sources_' -- sources which are made dependencies, but are not used otherwise. New values will be *appended* to the variables. They may be non-empty, if caller wants it. """ assert is_iterable_typed(sources, VirtualTarget) assert isinstance(prop_set, property_set.PropertySet) dependencies = self.properties_.get ('<dependency>') self.dependency_only_sources_ += self.actualize_source_type (dependencies, prop_set) self.actual_sources_ += self.actualize_source_type (sources, prop_set) # This is used to help bjam find dependencies in generated headers # in other main targets. # Say: # # make a.h : ....... ; # exe hello : hello.cpp : <implicit-dependency>a.h ; # # However, for bjam to find the dependency the generated target must # be actualized (i.e. have the jam target). In the above case, # if we're building just hello ("bjam hello"), 'a.h' won't be # actualized unless we do it here. implicit = self.properties_.get("<implicit-dependency>") for i in implicit: i.actualize()
python
def actualize_sources (self, sources, prop_set): """ Creates actual jam targets for sources. Initializes two member variables: 'self.actual_sources_' -- sources which are passed to updating action 'self.dependency_only_sources_' -- sources which are made dependencies, but are not used otherwise. New values will be *appended* to the variables. They may be non-empty, if caller wants it. """ assert is_iterable_typed(sources, VirtualTarget) assert isinstance(prop_set, property_set.PropertySet) dependencies = self.properties_.get ('<dependency>') self.dependency_only_sources_ += self.actualize_source_type (dependencies, prop_set) self.actual_sources_ += self.actualize_source_type (sources, prop_set) # This is used to help bjam find dependencies in generated headers # in other main targets. # Say: # # make a.h : ....... ; # exe hello : hello.cpp : <implicit-dependency>a.h ; # # However, for bjam to find the dependency the generated target must # be actualized (i.e. have the jam target). In the above case, # if we're building just hello ("bjam hello"), 'a.h' won't be # actualized unless we do it here. implicit = self.properties_.get("<implicit-dependency>") for i in implicit: i.actualize()
[ "def", "actualize_sources", "(", "self", ",", "sources", ",", "prop_set", ")", ":", "assert", "is_iterable_typed", "(", "sources", ",", "VirtualTarget", ")", "assert", "isinstance", "(", "prop_set", ",", "property_set", ".", "PropertySet", ")", "dependencies", "=", "self", ".", "properties_", ".", "get", "(", "'<dependency>'", ")", "self", ".", "dependency_only_sources_", "+=", "self", ".", "actualize_source_type", "(", "dependencies", ",", "prop_set", ")", "self", ".", "actual_sources_", "+=", "self", ".", "actualize_source_type", "(", "sources", ",", "prop_set", ")", "# This is used to help bjam find dependencies in generated headers", "# in other main targets.", "# Say:", "#", "# make a.h : ....... ;", "# exe hello : hello.cpp : <implicit-dependency>a.h ;", "#", "# However, for bjam to find the dependency the generated target must", "# be actualized (i.e. have the jam target). In the above case,", "# if we're building just hello (\"bjam hello\"), 'a.h' won't be", "# actualized unless we do it here.", "implicit", "=", "self", ".", "properties_", ".", "get", "(", "\"<implicit-dependency>\"", ")", "for", "i", "in", "implicit", ":", "i", ".", "actualize", "(", ")" ]
Creates actual jam targets for sources. Initializes two member variables: 'self.actual_sources_' -- sources which are passed to updating action 'self.dependency_only_sources_' -- sources which are made dependencies, but are not used otherwise. New values will be *appended* to the variables. They may be non-empty, if caller wants it.
[ "Creates", "actual", "jam", "targets", "for", "sources", ".", "Initializes", "two", "member", "variables", ":", "self", ".", "actual_sources_", "--", "sources", "which", "are", "passed", "to", "updating", "action", "self", ".", "dependency_only_sources_", "--", "sources", "which", "are", "made", "dependencies", "but", "are", "not", "used", "otherwise", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L886-L917
train
apple/turicreate
deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py
Subvariant.all_referenced_targets
def all_referenced_targets(self, result): """Returns all targets referenced by this subvariant, either directly or indirectly, and either as sources, or as dependency properties. Targets referred with dependency property are returned a properties, not targets.""" if __debug__: from .property import Property assert is_iterable_typed(result, (VirtualTarget, Property)) # Find directly referenced targets. deps = self.build_properties().dependency() all_targets = self.sources_ + deps # Find other subvariants. r = [] for e in all_targets: if not e in result: result.add(e) if isinstance(e, property.Property): t = e.value else: t = e # FIXME: how can this be? cs = t.creating_subvariant() if cs: r.append(cs) r = unique(r) for s in r: if s != self: s.all_referenced_targets(result)
python
def all_referenced_targets(self, result): """Returns all targets referenced by this subvariant, either directly or indirectly, and either as sources, or as dependency properties. Targets referred with dependency property are returned a properties, not targets.""" if __debug__: from .property import Property assert is_iterable_typed(result, (VirtualTarget, Property)) # Find directly referenced targets. deps = self.build_properties().dependency() all_targets = self.sources_ + deps # Find other subvariants. r = [] for e in all_targets: if not e in result: result.add(e) if isinstance(e, property.Property): t = e.value else: t = e # FIXME: how can this be? cs = t.creating_subvariant() if cs: r.append(cs) r = unique(r) for s in r: if s != self: s.all_referenced_targets(result)
[ "def", "all_referenced_targets", "(", "self", ",", "result", ")", ":", "if", "__debug__", ":", "from", ".", "property", "import", "Property", "assert", "is_iterable_typed", "(", "result", ",", "(", "VirtualTarget", ",", "Property", ")", ")", "# Find directly referenced targets.", "deps", "=", "self", ".", "build_properties", "(", ")", ".", "dependency", "(", ")", "all_targets", "=", "self", ".", "sources_", "+", "deps", "# Find other subvariants.", "r", "=", "[", "]", "for", "e", "in", "all_targets", ":", "if", "not", "e", "in", "result", ":", "result", ".", "add", "(", "e", ")", "if", "isinstance", "(", "e", ",", "property", ".", "Property", ")", ":", "t", "=", "e", ".", "value", "else", ":", "t", "=", "e", "# FIXME: how can this be?", "cs", "=", "t", ".", "creating_subvariant", "(", ")", "if", "cs", ":", "r", ".", "append", "(", "cs", ")", "r", "=", "unique", "(", "r", ")", "for", "s", "in", "r", ":", "if", "s", "!=", "self", ":", "s", ".", "all_referenced_targets", "(", "result", ")" ]
Returns all targets referenced by this subvariant, either directly or indirectly, and either as sources, or as dependency properties. Targets referred with dependency property are returned a properties, not targets.
[ "Returns", "all", "targets", "referenced", "by", "this", "subvariant", "either", "directly", "or", "indirectly", "and", "either", "as", "sources", "or", "as", "dependency", "properties", ".", "Targets", "referred", "with", "dependency", "property", "are", "returned", "a", "properties", "not", "targets", "." ]
74514c3f99e25b46f22c6e02977fe3da69221c2e
https://github.com/apple/turicreate/blob/74514c3f99e25b46f22c6e02977fe3da69221c2e/deps/src/boost_1_68_0/tools/build/src/build/virtual_target.py#L1099-L1128
train