Code stringlengths 103 85.9k | Summary listlengths 0 94 |
|---|---|
Please provide a description of the function:def create(dataset, target,
features=None,
validation_set='auto',
max_depth=6,
min_loss_reduction=0.0, min_child_weight=0.1,
verbose=True,
random_seed = None,
metric = 'auto',
**kwargs):
... | [
"\n Create a :class:`~turicreate.decision_tree_regression.DecisionTreeRegression` to predict\n a scalar target variable using one or more features. In addition to standard\n numeric and categorical types, features can also be extracted automatically\n from list- or dictionary-type SFrame columns.\n\n\n ... |
Please provide a description of the function:def evaluate(self, dataset, metric='auto', missing_value_action='auto'):
_raise_error_evaluation_metric_is_valid(
metric, ['auto', 'rmse', 'max_error'])
return super(DecisionTreeRegression, self).evaluate(dataset,
... | [
"\n Evaluate the model on the given dataset.\n\n Parameters\n ----------\n dataset : SFrame\n Dataset in the same format used for training. The columns names and\n types of the dataset must be the same as that used in training.\n\n metric : str, optional\n ... |
Please provide a description of the function:def predict(self, dataset, missing_value_action='auto'):
return super(DecisionTreeRegression, self).predict(dataset, output_type='margin',
missing_value_action=missing_value_action) | [
"\n Predict the target column of the given dataset.\n\n The target column is provided during\n :func:`~turicreate.decision_tree_regression.create`. If the target column is in the\n `dataset` it will be ignored.\n\n Parameters\n ----------\n dataset : SFrame\n ... |
Please provide a description of the function:def compute_composite_distance(distance, x, y):
## Validate inputs
_validate_composite_distance(distance)
distance = _convert_distance_names_to_functions(distance)
if not isinstance(x, dict) or not isinstance(y, dict):
raise TypeError("Inputs '... | [
"\n Compute the value of a composite distance function on two dictionaries,\n typically SFrame rows.\n\n Parameters\n ----------\n distance : list[list]\n A composite distance function. Composite distance functions are a\n weighted sum of standard distance functions, each of which appli... |
Please provide a description of the function:def _validate_composite_distance(distance):
if not isinstance(distance, list):
raise TypeError("Input 'distance' must be a composite distance.")
if len(distance) < 1:
raise ValueError("Composite distances must have a least one distance "
... | [
"\n Check that composite distance function is in valid form. Don't modify the\n composite distance in any way.\n "
] |
Please provide a description of the function:def _scrub_composite_distance_features(distance, feature_blacklist):
dist_out = []
for i, d in enumerate(distance):
ftrs, dist, weight = d
new_ftrs = [x for x in ftrs if x not in feature_blacklist]
if len(new_ftrs) > 0:
dist_... | [
"\n Remove feature names from the feature lists in a composite distance\n function.\n "
] |
Please provide a description of the function:def _convert_distance_names_to_functions(distance):
dist_out = _copy.deepcopy(distance)
for i, d in enumerate(distance):
_, dist, _ = d
if isinstance(dist, str):
try:
dist_out[i][1] = _tc.distances.__dict__[dist]
... | [
"\n Convert function names in a composite distance function into function\n handles.\n "
] |
Please provide a description of the function:def build_address_distance(number=None, street=None, city=None, state=None,
zip_code=None):
## Validate inputs
for param in [number, street, city, state, zip_code]:
if param is not None and not isinstance(param, str):
... | [
"\n Construct a composite distance appropriate for matching address data. NOTE:\n this utility function does not guarantee that the output composite distance\n will work with a particular dataset and model. When the composite distance\n is applied in a particular context, the feature types and individua... |
Please provide a description of the function:def GetMessages(file_protos):
for file_proto in file_protos:
_FACTORY.pool.Add(file_proto)
return _FACTORY.GetMessages([file_proto.name for file_proto in file_protos]) | [
"Builds a dictionary of all the messages available in a set of files.\n\n Args:\n file_protos: A sequence of file protos to build messages out of.\n\n Returns:\n A dictionary mapping proto names to the message classes. This will include\n any dependent messages as well as any messages defined in the same... |
Please provide a description of the function:def GetPrototype(self, descriptor):
if descriptor.full_name not in self._classes:
descriptor_name = descriptor.name
if str is bytes: # PY2
descriptor_name = descriptor.name.encode('ascii', 'ignore')
result_class = reflection.GeneratedProto... | [
"Builds a proto2 message class based on the passed in descriptor.\n\n Passing a descriptor with a fully qualified name matching a previous\n invocation will cause the same class to be returned.\n\n Args:\n descriptor: The descriptor to build from.\n\n Returns:\n A class describing the passed i... |
Please provide a description of the function:def GetMessages(self, files):
result = {}
for file_name in files:
file_desc = self.pool.FindFileByName(file_name)
for desc in file_desc.message_types_by_name.values():
result[desc.full_name] = self.GetPrototype(desc)
# While the extens... | [
"Gets all the messages from a specified file.\n\n This will find and resolve dependencies, failing if the descriptor\n pool cannot satisfy them.\n\n Args:\n files: The file names to extract messages from.\n\n Returns:\n A dictionary mapping proto names to the message classes. This will include... |
Please provide a description of the function:def refactor_ifs(stmnt, ifs):
'''
for if statements in list comprehension
'''
if isinstance(stmnt, _ast.BoolOp):
test, right = stmnt.values
if isinstance(stmnt.op, _ast.Or):
test = _ast.UnaryOp(op=_ast.Not(), operand=test, lineno=0... | [] |
Please provide a description of the function:def MAP_ADD(self, instr):
key = self.ast_stack.pop()
value = self.ast_stack.pop()
self.ast_stack.append((key, value))
'NOP' | [] |
Please provide a description of the function:def _get_mps_od_net(input_image_shape, batch_size, output_size, anchors,
config, weights={}):
network = _MpsGraphAPI(network_id=_MpsGraphNetworkType.kODGraphNet)
c_in, h_in, w_in = input_image_shape
c_out = output_size
h_out = h_in ... | [
"\n Initializes an MpsGraphAPI for object detection.\n "
] |
Please provide a description of the function:def create(dataset, annotations=None, feature=None, model='darknet-yolo',
classes=None, batch_size=0, max_iterations=0, verbose=True,
**kwargs):
_raise_error_if_not_sframe(dataset, "dataset")
from ._mx_detector import YOLOLoss as _YOLOLoss
... | [
"\n Create a :class:`ObjectDetector` model.\n\n Parameters\n ----------\n dataset : SFrame\n Input data. The columns named by the ``feature`` and ``annotations``\n parameters will be extracted for training the detector.\n\n annotations : string\n Name of the column containing the... |
Please provide a description of the function:def _predict_with_options(self, dataset, with_ground_truth,
postprocess=True, confidence_threshold=0.001,
iou_threshold=None,
verbose=True):
if iou_threshold is None: i... | [
"\n Predict with options for what kind of SFrame should be returned.\n\n If postprocess is False, a single numpy array with raw unprocessed\n results will be returned.\n "
] |
Please provide a description of the function:def _canonize_input(self, dataset):
unpack = lambda x: x
if isinstance(dataset, _tc.SArray):
dataset = _tc.SFrame({self.feature: dataset})
elif isinstance(dataset, _tc.Image):
dataset = _tc.SFrame({self.feature: [datas... | [
"\n Takes input and returns tuple of the input in canonical form (SFrame)\n along with an unpack callback function that can be applied to\n prediction results to \"undo\" the canonization.\n "
] |
Please provide a description of the function:def predict(self, dataset, confidence_threshold=0.25, iou_threshold=None, verbose=True):
_numeric_param_check_range('confidence_threshold', confidence_threshold, 0.0, 1.0)
dataset, unpack = self._canonize_input(dataset)
stacked_pred = self._p... | [
"\n Predict object instances in an sframe of images.\n\n Parameters\n ----------\n dataset : SFrame | SArray | turicreate.Image\n The images on which to perform object detection.\n If dataset is an SFrame, it must have a column with the same name\n as the... |
Please provide a description of the function:def evaluate(self, dataset, metric='auto',
output_type='dict', iou_threshold=None,
confidence_threshold=None, verbose=True):
if iou_threshold is None: iou_threshold = self.non_maximum_suppression_threshold
if confidence_thres... | [
"\n Evaluate the model by making predictions and comparing these to ground\n truth bounding box annotations.\n\n Parameters\n ----------\n dataset : SFrame\n Dataset of new observations. Must include columns with the same\n names as the annotations and featur... |
Please provide a description of the function:def export_coreml(self, filename,
include_non_maximum_suppression = True,
iou_threshold = None,
confidence_threshold = None):
import mxnet as _mx
from .._mxnet._mxnet_to_coreml import _mxnet_converter
impo... | [
"\n Save the model in Core ML format. The Core ML model takes an image of\n fixed size as input and produces two output arrays: `confidence` and\n `coordinates`.\n\n The first one, `confidence` is an `N`-by-`C` array, where `N` is the\n number of instances predicted and `C` is the... |
Please provide a description of the function:def parse_title(self, docname):
env = self.document.settings.env
title = self.titles.get(docname)
if title is None:
fname = os.path.join(env.srcdir, docname+'.rst')
try:
f = open(fname, 'r')
... | [
"Parse a document title as the first line starting in [A-Za-z0-9<]\n or fall back to the document basename if no such line exists.\n The cmake --help-*-list commands also depend on this convention.\n Return the title or False if the document file does not exist.\n "
] |
Please provide a description of the function:def registerErrorHandler(f, ctx):
import sys
if 'libxslt' not in sys.modules:
# normal behaviour when libxslt is not imported
ret = libxml2mod.xmlRegisterErrorHandler(f,ctx)
else:
# when libxslt is already imported, one must
#... | [
"Register a Python written function to for error reporting.\n The function is called back as f(ctx, error). "
] |
Please provide a description of the function:def _xmlTextReaderErrorFunc(xxx_todo_changeme,msg,severity,locator):
(f,arg) = xxx_todo_changeme
return f(arg,msg,severity,xmlTextReaderLocator(locator)) | [
"Intermediate callback to wrap the locator"
] |
Please provide a description of the function:def htmlCreateMemoryParserCtxt(buffer, size):
ret = libxml2mod.htmlCreateMemoryParserCtxt(buffer, size)
if ret is None:raise parserError('htmlCreateMemoryParserCtxt() failed')
return parserCtxt(_obj=ret) | [
"Create a parser context for an HTML in-memory document. "
] |
Please provide a description of the function:def htmlParseDoc(cur, encoding):
ret = libxml2mod.htmlParseDoc(cur, encoding)
if ret is None:raise parserError('htmlParseDoc() failed')
return xmlDoc(_obj=ret) | [
"parse an HTML in-memory document and build a tree. "
] |
Please provide a description of the function:def htmlParseFile(filename, encoding):
ret = libxml2mod.htmlParseFile(filename, encoding)
if ret is None:raise parserError('htmlParseFile() failed')
return xmlDoc(_obj=ret) | [
"parse an HTML file and build a tree. Automatic support for\n ZLIB/Compress compressed document is provided by default if\n found at compile-time. "
] |
Please provide a description of the function:def htmlReadDoc(cur, URL, encoding, options):
ret = libxml2mod.htmlReadDoc(cur, URL, encoding, options)
if ret is None:raise treeError('htmlReadDoc() failed')
return xmlDoc(_obj=ret) | [
"parse an XML in-memory document and build a tree. "
] |
Please provide a description of the function:def htmlReadFd(fd, URL, encoding, options):
ret = libxml2mod.htmlReadFd(fd, URL, encoding, options)
if ret is None:raise treeError('htmlReadFd() failed')
return xmlDoc(_obj=ret) | [
"parse an XML from a file descriptor and build a tree. "
] |
Please provide a description of the function:def htmlReadFile(filename, encoding, options):
ret = libxml2mod.htmlReadFile(filename, encoding, options)
if ret is None:raise treeError('htmlReadFile() failed')
return xmlDoc(_obj=ret) | [
"parse an XML file from the filesystem or the network. "
] |
Please provide a description of the function:def htmlReadMemory(buffer, size, URL, encoding, options):
ret = libxml2mod.htmlReadMemory(buffer, size, URL, encoding, options)
if ret is None:raise treeError('htmlReadMemory() failed')
return xmlDoc(_obj=ret) | [
"parse an XML in-memory document and build a tree. "
] |
Please provide a description of the function:def htmlNewDoc(URI, ExternalID):
ret = libxml2mod.htmlNewDoc(URI, ExternalID)
if ret is None:raise treeError('htmlNewDoc() failed')
return xmlDoc(_obj=ret) | [
"Creates a new HTML document "
] |
Please provide a description of the function:def htmlNewDocNoDtD(URI, ExternalID):
ret = libxml2mod.htmlNewDocNoDtD(URI, ExternalID)
if ret is None:raise treeError('htmlNewDocNoDtD() failed')
return xmlDoc(_obj=ret) | [
"Creates a new HTML document without a DTD node if @URI and\n @ExternalID are None "
] |
Please provide a description of the function:def catalogAdd(type, orig, replace):
ret = libxml2mod.xmlCatalogAdd(type, orig, replace)
return ret | [
"Add an entry in the catalog, it may overwrite existing but\n different entries. If called before any other catalog\n routine, allows to override the default shared catalog put\n in place by xmlInitializeCatalog(); "
] |
Please provide a description of the function:def loadACatalog(filename):
ret = libxml2mod.xmlLoadACatalog(filename)
if ret is None:raise treeError('xmlLoadACatalog() failed')
return catalog(_obj=ret) | [
"Load the catalog and build the associated data structures.\n This can be either an XML Catalog or an SGML Catalog It\n will recurse in SGML CATALOG entries. On the other hand XML\n Catalogs are not handled recursively. "
] |
Please provide a description of the function:def loadSGMLSuperCatalog(filename):
ret = libxml2mod.xmlLoadSGMLSuperCatalog(filename)
if ret is None:raise treeError('xmlLoadSGMLSuperCatalog() failed')
return catalog(_obj=ret) | [
"Load an SGML super catalog. It won't expand CATALOG or\n DELEGATE references. This is only needed for manipulating\n SGML Super Catalogs like adding and removing CATALOG or\n DELEGATE entries. "
] |
Please provide a description of the function:def newCatalog(sgml):
ret = libxml2mod.xmlNewCatalog(sgml)
if ret is None:raise treeError('xmlNewCatalog() failed')
return catalog(_obj=ret) | [
"create a new Catalog. "
] |
Please provide a description of the function:def parseCatalogFile(filename):
ret = libxml2mod.xmlParseCatalogFile(filename)
if ret is None:raise parserError('xmlParseCatalogFile() failed')
return xmlDoc(_obj=ret) | [
"parse an XML file and build a tree. It's like\n xmlParseFile() except it bypass all catalog lookups. "
] |
Please provide a description of the function:def debugDumpString(output, str):
if output is not None: output.flush()
libxml2mod.xmlDebugDumpString(output, str) | [
"Dumps informations about the string, shorten it if necessary "
] |
Please provide a description of the function:def predefinedEntity(name):
ret = libxml2mod.xmlGetPredefinedEntity(name)
if ret is None:raise treeError('xmlGetPredefinedEntity() failed')
return xmlEntity(_obj=ret) | [
"Check whether this name is an predefined entity. "
] |
Please provide a description of the function:def nanoFTPProxy(host, port, user, passwd, type):
libxml2mod.xmlNanoFTPProxy(host, port, user, passwd, type) | [
"Setup the FTP proxy informations. This can also be done by\n using ftp_proxy ftp_proxy_user and ftp_proxy_password\n environment variables. "
] |
Please provide a description of the function:def createDocParserCtxt(cur):
ret = libxml2mod.xmlCreateDocParserCtxt(cur)
if ret is None:raise parserError('xmlCreateDocParserCtxt() failed')
return parserCtxt(_obj=ret) | [
"Creates a parser context for an XML in-memory document. "
] |
Please provide a description of the function:def parseDTD(ExternalID, SystemID):
ret = libxml2mod.xmlParseDTD(ExternalID, SystemID)
if ret is None:raise parserError('xmlParseDTD() failed')
return xmlDtd(_obj=ret) | [
"Load and parse an external subset. "
] |
Please provide a description of the function:def parseDoc(cur):
ret = libxml2mod.xmlParseDoc(cur)
if ret is None:raise parserError('xmlParseDoc() failed')
return xmlDoc(_obj=ret) | [
"parse an XML in-memory document and build a tree. "
] |
Please provide a description of the function:def parseEntity(filename):
ret = libxml2mod.xmlParseEntity(filename)
if ret is None:raise parserError('xmlParseEntity() failed')
return xmlDoc(_obj=ret) | [
"parse an XML external entity out of context and build a\n tree. [78] extParsedEnt ::= TextDecl? content This\n correspond to a \"Well Balanced\" chunk "
] |
Please provide a description of the function:def parseFile(filename):
ret = libxml2mod.xmlParseFile(filename)
if ret is None:raise parserError('xmlParseFile() failed')
return xmlDoc(_obj=ret) | [
"parse an XML file and build a tree. Automatic support for\n ZLIB/Compress compressed document is provided by default if\n found at compile-time. "
] |
Please provide a description of the function:def parseMemory(buffer, size):
ret = libxml2mod.xmlParseMemory(buffer, size)
if ret is None:raise parserError('xmlParseMemory() failed')
return xmlDoc(_obj=ret) | [
"parse an XML in-memory block and build a tree. "
] |
Please provide a description of the function:def readDoc(cur, URL, encoding, options):
ret = libxml2mod.xmlReadDoc(cur, URL, encoding, options)
if ret is None:raise treeError('xmlReadDoc() failed')
return xmlDoc(_obj=ret) | [
"parse an XML in-memory document and build a tree. "
] |
Please provide a description of the function:def readFd(fd, URL, encoding, options):
ret = libxml2mod.xmlReadFd(fd, URL, encoding, options)
if ret is None:raise treeError('xmlReadFd() failed')
return xmlDoc(_obj=ret) | [
"parse an XML from a file descriptor and build a tree. NOTE\n that the file descriptor will not be closed when the reader\n is closed or reset. "
] |
Please provide a description of the function:def readFile(filename, encoding, options):
ret = libxml2mod.xmlReadFile(filename, encoding, options)
if ret is None:raise treeError('xmlReadFile() failed')
return xmlDoc(_obj=ret) | [
"parse an XML file from the filesystem or the network. "
] |
Please provide a description of the function:def readMemory(buffer, size, URL, encoding, options):
ret = libxml2mod.xmlReadMemory(buffer, size, URL, encoding, options)
if ret is None:raise treeError('xmlReadMemory() failed')
return xmlDoc(_obj=ret) | [
"parse an XML in-memory document and build a tree. "
] |
Please provide a description of the function:def recoverDoc(cur):
ret = libxml2mod.xmlRecoverDoc(cur)
if ret is None:raise treeError('xmlRecoverDoc() failed')
return xmlDoc(_obj=ret) | [
"parse an XML in-memory document and build a tree. In the\n case the document is not Well Formed, a attempt to build a\n tree is tried anyway "
] |
Please provide a description of the function:def recoverFile(filename):
ret = libxml2mod.xmlRecoverFile(filename)
if ret is None:raise treeError('xmlRecoverFile() failed')
return xmlDoc(_obj=ret) | [
"parse an XML file and build a tree. Automatic support for\n ZLIB/Compress compressed document is provided by default if\n found at compile-time. In the case the document is not Well\n Formed, it attempts to build a tree anyway "
] |
Please provide a description of the function:def recoverMemory(buffer, size):
ret = libxml2mod.xmlRecoverMemory(buffer, size)
if ret is None:raise treeError('xmlRecoverMemory() failed')
return xmlDoc(_obj=ret) | [
"parse an XML in-memory block and build a tree. In the case\n the document is not Well Formed, an attempt to build a tree\n is tried anyway "
] |
Please provide a description of the function:def copyChar(len, out, val):
ret = libxml2mod.xmlCopyChar(len, out, val)
return ret | [
"append the char value in the array "
] |
Please provide a description of the function:def createEntityParserCtxt(URL, ID, base):
ret = libxml2mod.xmlCreateEntityParserCtxt(URL, ID, base)
if ret is None:raise parserError('xmlCreateEntityParserCtxt() failed')
return parserCtxt(_obj=ret) | [
"Create a parser context for an external entity Automatic\n support for ZLIB/Compress compressed document is provided\n by default if found at compile-time. "
] |
Please provide a description of the function:def createFileParserCtxt(filename):
ret = libxml2mod.xmlCreateFileParserCtxt(filename)
if ret is None:raise parserError('xmlCreateFileParserCtxt() failed')
return parserCtxt(_obj=ret) | [
"Create a parser context for a file content. Automatic\n support for ZLIB/Compress compressed document is provided\n by default if found at compile-time. "
] |
Please provide a description of the function:def createMemoryParserCtxt(buffer, size):
ret = libxml2mod.xmlCreateMemoryParserCtxt(buffer, size)
if ret is None:raise parserError('xmlCreateMemoryParserCtxt() failed')
return parserCtxt(_obj=ret) | [
"Create a parser context for an XML in-memory document. "
] |
Please provide a description of the function:def createURLParserCtxt(filename, options):
ret = libxml2mod.xmlCreateURLParserCtxt(filename, options)
if ret is None:raise parserError('xmlCreateURLParserCtxt() failed')
return parserCtxt(_obj=ret) | [
"Create a parser context for a file or URL content.\n Automatic support for ZLIB/Compress compressed document is\n provided by default if found at compile-time and for file\n accesses "
] |
Please provide a description of the function:def htmlCreateFileParserCtxt(filename, encoding):
ret = libxml2mod.htmlCreateFileParserCtxt(filename, encoding)
if ret is None:raise parserError('htmlCreateFileParserCtxt() failed')
return parserCtxt(_obj=ret) | [
"Create a parser context for a file content. Automatic\n support for ZLIB/Compress compressed document is provided\n by default if found at compile-time. "
] |
Please provide a description of the function:def namePop(ctxt):
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.namePop(ctxt__o)
return ret | [
"Pops the top element name from the name stack "
] |
Please provide a description of the function:def namePush(ctxt, value):
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.namePush(ctxt__o, value)
return ret | [
"Pushes a new element name on top of the name stack "
] |
Please provide a description of the function:def nodePop(ctxt):
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.nodePop(ctxt__o)
if ret is None:raise treeError('nodePop() failed')
return xmlNode(_obj=ret) | [
"Pops the top element node from the node stack "
] |
Please provide a description of the function:def nodePush(ctxt, value):
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
if value is None: value__o = None
else: value__o = value._o
ret = libxml2mod.nodePush(ctxt__o, value__o)
return ret | [
"Pushes a new element node on top of the node stack "
] |
Please provide a description of the function:def createInputBuffer(file, encoding):
ret = libxml2mod.xmlCreateInputBuffer(file, encoding)
if ret is None:raise treeError('xmlCreateInputBuffer() failed')
return inputBuffer(_obj=ret) | [
"Create a libxml2 input buffer from a Python file "
] |
Please provide a description of the function:def createOutputBuffer(file, encoding):
ret = libxml2mod.xmlCreateOutputBuffer(file, encoding)
if ret is None:raise treeError('xmlCreateOutputBuffer() failed')
return outputBuffer(_obj=ret) | [
"Create a libxml2 output buffer from a Python file "
] |
Please provide a description of the function:def createPushParser(SAX, chunk, size, URI):
ret = libxml2mod.xmlCreatePushParser(SAX, chunk, size, URI)
if ret is None:raise parserError('xmlCreatePushParser() failed')
return parserCtxt(_obj=ret) | [
"Create a progressive XML parser context to build either an\n event flow if the SAX object is not None, or a DOM tree\n otherwise. "
] |
Please provide a description of the function:def htmlCreatePushParser(SAX, chunk, size, URI):
ret = libxml2mod.htmlCreatePushParser(SAX, chunk, size, URI)
if ret is None:raise parserError('htmlCreatePushParser() failed')
return parserCtxt(_obj=ret) | [
"Create a progressive HTML parser context to build either an\n event flow if the SAX object is not None, or a DOM tree\n otherwise. "
] |
Please provide a description of the function:def newNode(name):
ret = libxml2mod.xmlNewNode(name)
if ret is None:raise treeError('xmlNewNode() failed')
return xmlNode(_obj=ret) | [
"Create a new Node "
] |
Please provide a description of the function:def relaxNGNewMemParserCtxt(buffer, size):
ret = libxml2mod.xmlRelaxNGNewMemParserCtxt(buffer, size)
if ret is None:raise parserError('xmlRelaxNGNewMemParserCtxt() failed')
return relaxNgParserCtxt(_obj=ret) | [
"Create an XML RelaxNGs parse context for that memory buffer\n expected to contain an XML RelaxNGs file. "
] |
Please provide a description of the function:def relaxNGNewParserCtxt(URL):
ret = libxml2mod.xmlRelaxNGNewParserCtxt(URL)
if ret is None:raise parserError('xmlRelaxNGNewParserCtxt() failed')
return relaxNgParserCtxt(_obj=ret) | [
"Create an XML RelaxNGs parse context for that file/resource\n expected to contain an XML RelaxNGs file. "
] |
Please provide a description of the function:def buildQName(ncname, prefix, memory, len):
ret = libxml2mod.xmlBuildQName(ncname, prefix, memory, len)
return ret | [
"Builds the QName @prefix:@ncname in @memory if there is\n enough space and prefix is not None nor empty, otherwise\n allocate a new string. If prefix is None or empty it\n returns ncname. "
] |
Please provide a description of the function:def newComment(content):
ret = libxml2mod.xmlNewComment(content)
if ret is None:raise treeError('xmlNewComment() failed')
return xmlNode(_obj=ret) | [
"Creation of a new node containing a comment. "
] |
Please provide a description of the function:def newDoc(version):
ret = libxml2mod.xmlNewDoc(version)
if ret is None:raise treeError('xmlNewDoc() failed')
return xmlDoc(_obj=ret) | [
"Creates a new XML document "
] |
Please provide a description of the function:def newPI(name, content):
ret = libxml2mod.xmlNewPI(name, content)
if ret is None:raise treeError('xmlNewPI() failed')
return xmlNode(_obj=ret) | [
"Creation of a processing instruction element. Use\n xmlDocNewPI preferably to get string interning "
] |
Please provide a description of the function:def newText(content):
ret = libxml2mod.xmlNewText(content)
if ret is None:raise treeError('xmlNewText() failed')
return xmlNode(_obj=ret) | [
"Creation of a new text node. "
] |
Please provide a description of the function:def newTextLen(content, len):
ret = libxml2mod.xmlNewTextLen(content, len)
if ret is None:raise treeError('xmlNewTextLen() failed')
return xmlNode(_obj=ret) | [
"Creation of a new text node with an extra parameter for the\n content's length "
] |
Please provide a description of the function:def URIUnescapeString(str, len, target):
ret = libxml2mod.xmlURIUnescapeString(str, len, target)
return ret | [
"Unescaping routine, but does not check that the string is\n an URI. The output is a direct unsigned char translation of\n %XX values (no encoding) Note that the length of the result\n can only be smaller or same size as the input string. "
] |
Please provide a description of the function:def parseURI(str):
ret = libxml2mod.xmlParseURI(str)
if ret is None:raise uriError('xmlParseURI() failed')
return URI(_obj=ret) | [
"Parse an URI based on RFC 3986 URI-reference = [\n absoluteURI | relativeURI ] [ \"#\" fragment ] "
] |
Please provide a description of the function:def parseURIRaw(str, raw):
ret = libxml2mod.xmlParseURIRaw(str, raw)
if ret is None:raise uriError('xmlParseURIRaw() failed')
return URI(_obj=ret) | [
"Parse an URI but allows to keep intact the original\n fragments. URI-reference = URI / relative-ref "
] |
Please provide a description of the function:def newTextReaderFilename(URI):
ret = libxml2mod.xmlNewTextReaderFilename(URI)
if ret is None:raise treeError('xmlNewTextReaderFilename() failed')
return xmlTextReader(_obj=ret) | [
"Create an xmlTextReader structure fed with the resource at\n @URI "
] |
Please provide a description of the function:def readerForDoc(cur, URL, encoding, options):
ret = libxml2mod.xmlReaderForDoc(cur, URL, encoding, options)
if ret is None:raise treeError('xmlReaderForDoc() failed')
return xmlTextReader(_obj=ret) | [
"Create an xmltextReader for an XML in-memory document. The\n parsing flags @options are a combination of xmlParserOption. "
] |
Please provide a description of the function:def readerForFd(fd, URL, encoding, options):
ret = libxml2mod.xmlReaderForFd(fd, URL, encoding, options)
if ret is None:raise treeError('xmlReaderForFd() failed')
return xmlTextReader(_obj=ret) | [
"Create an xmltextReader for an XML from a file descriptor.\n The parsing flags @options are a combination of\n xmlParserOption. NOTE that the file descriptor will not be\n closed when the reader is closed or reset. "
] |
Please provide a description of the function:def readerForFile(filename, encoding, options):
ret = libxml2mod.xmlReaderForFile(filename, encoding, options)
if ret is None:raise treeError('xmlReaderForFile() failed')
return xmlTextReader(_obj=ret) | [
"parse an XML file from the filesystem or the network. The\n parsing flags @options are a combination of xmlParserOption. "
] |
Please provide a description of the function:def readerForMemory(buffer, size, URL, encoding, options):
ret = libxml2mod.xmlReaderForMemory(buffer, size, URL, encoding, options)
if ret is None:raise treeError('xmlReaderForMemory() failed')
return xmlTextReader(_obj=ret) | [
"Create an xmltextReader for an XML in-memory document. The\n parsing flags @options are a combination of xmlParserOption. "
] |
Please provide a description of the function:def regexpCompile(regexp):
ret = libxml2mod.xmlRegexpCompile(regexp)
if ret is None:raise treeError('xmlRegexpCompile() failed')
return xmlReg(_obj=ret) | [
"Parses a regular expression conforming to XML Schemas Part\n 2 Datatype Appendix F and builds an automata suitable for\n testing strings against that regular expression "
] |
Please provide a description of the function:def schemaNewMemParserCtxt(buffer, size):
ret = libxml2mod.xmlSchemaNewMemParserCtxt(buffer, size)
if ret is None:raise parserError('xmlSchemaNewMemParserCtxt() failed')
return SchemaParserCtxt(_obj=ret) | [
"Create an XML Schemas parse context for that memory buffer\n expected to contain an XML Schemas file. "
] |
Please provide a description of the function:def schemaNewParserCtxt(URL):
ret = libxml2mod.xmlSchemaNewParserCtxt(URL)
if ret is None:raise parserError('xmlSchemaNewParserCtxt() failed')
return SchemaParserCtxt(_obj=ret) | [
"Create an XML Schemas parse context for that file/resource\n expected to contain an XML Schemas file. "
] |
Please provide a description of the function:def UTF8Strsub(utf, start, len):
ret = libxml2mod.xmlUTF8Strsub(utf, start, len)
return ret | [
"Create a substring from a given UTF-8 string Note:\n positions are given in units of UTF-8 chars "
] |
Please provide a description of the function:def valuePop(ctxt):
if ctxt is None: ctxt__o = None
else: ctxt__o = ctxt._o
ret = libxml2mod.valuePop(ctxt__o)
return ret | [
"Pops the top XPath object from the value stack "
] |
Please provide a description of the function:def removeNsDef(self, href):
ret = libxml2mod.xmlNodeRemoveNsDef(self._o, href)
if ret is None:return None
__tmp = xmlNs(_obj=ret)
return __tmp | [
"\n Remove a namespace definition from a node. If href is None,\n remove all of the ns definitions on that node. The removed\n namespaces are returned as a linked list.\n\n Note: If any child nodes referred to the removed namespaces,\n they will be left with dangling links. You... |
Please provide a description of the function:def setErrorHandler(self,f,arg):
libxml2mod.xmlParserCtxtSetErrorHandler(self._o,f,arg) | [
"Register an error handler that will be called back as\n f(arg,msg,severity,reserved).\n\n @reserved is currently always None."
] |
Please provide a description of the function:def setValidityErrorHandler(self, err_func, warn_func, arg=None):
libxml2mod.xmlSetValidErrors(self._o, err_func, warn_func, arg) | [
"\n Register error and warning handlers for DTD validation.\n These will be called back as f(msg,arg)\n "
] |
Please provide a description of the function:def setValidityErrorHandler(self, err_func, warn_func, arg=None):
libxml2mod.xmlSchemaSetValidErrors(self._o, err_func, warn_func, arg) | [
"\n Register error and warning handlers for Schema validation.\n These will be called back as f(msg,arg)\n "
] |
Please provide a description of the function:def setValidityErrorHandler(self, err_func, warn_func, arg=None):
libxml2mod.xmlRelaxNGSetValidErrors(self._o, err_func, warn_func, arg) | [
"\n Register error and warning handlers for RelaxNG validation.\n These will be called back as f(msg,arg)\n "
] |
Please provide a description of the function:def SetErrorHandler(self,f,arg):
if f is None:
libxml2mod.xmlTextReaderSetErrorHandler(\
self._o,None,None)
else:
libxml2mod.xmlTextReaderSetErrorHandler(\
self._o,_xmlTextReaderErrorFunc,(f,arg... | [
"Register an error handler that will be called back as\n f(arg,msg,severity,locator)."
] |
Please provide a description of the function:def GetErrorHandler(self):
f,arg = libxml2mod.xmlTextReaderGetErrorHandler(self._o)
if f is None:
return None,None
else:
# assert f is _xmlTextReaderErrorFunc
return arg | [
"Return (f,arg) as previously registered with setErrorHandler\n or (None,None)."
] |
Please provide a description of the function:def ns(self):
ret = libxml2mod.xmlNodeGetNs(self._o)
if ret is None:return None
__tmp = xmlNs(_obj=ret)
return __tmp | [
"Get the namespace of a node "
] |
Please provide a description of the function:def nsDefs(self):
ret = libxml2mod.xmlNodeGetNsDefs(self._o)
if ret is None:return None
__tmp = xmlNs(_obj=ret)
return __tmp | [
"Get the namespace of a node "
] |
Please provide a description of the function:def debugDumpNode(self, output, depth):
libxml2mod.xmlDebugDumpNode(output, self._o, depth) | [
"Dumps debug information for the element node, it is\n recursive "
] |
Please provide a description of the function:def debugDumpNodeList(self, output, depth):
libxml2mod.xmlDebugDumpNodeList(output, self._o, depth) | [
"Dumps debug information for the list of element node, it is\n recursive "
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.