repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
suds-community/suds | suds/wsdl.py | Service.do_resolve | def do_resolve(self, definitions):
"""
Resolve named references to other WSDL objects. Ports without SOAP
bindings are discarded.
@param definitions: A definitions object.
@type definitions: L{Definitions}
"""
filtered = []
for p in self.ports:
... | python | def do_resolve(self, definitions):
"""
Resolve named references to other WSDL objects. Ports without SOAP
bindings are discarded.
@param definitions: A definitions object.
@type definitions: L{Definitions}
"""
filtered = []
for p in self.ports:
... | [
"def",
"do_resolve",
"(",
"self",
",",
"definitions",
")",
":",
"filtered",
"=",
"[",
"]",
"for",
"p",
"in",
"self",
".",
"ports",
":",
"ref",
"=",
"qualify",
"(",
"p",
".",
"binding",
",",
"self",
".",
"root",
",",
"definitions",
".",
"tns",
")",
... | Resolve named references to other WSDL objects. Ports without SOAP
bindings are discarded.
@param definitions: A definitions object.
@type definitions: L{Definitions} | [
"Resolve",
"named",
"references",
"to",
"other",
"WSDL",
"objects",
".",
"Ports",
"without",
"SOAP",
"bindings",
"are",
"discarded",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/wsdl.py#L939-L967 |
suds-community/suds | suds/wsdl.py | Factory.create | def create(cls, root, definitions):
"""
Create an object based on the root tag name.
@param root: An XML root element.
@type root: L{Element}
@param definitions: A definitions object.
@type definitions: L{Definitions}
@return: The created object.
@rtype: ... | python | def create(cls, root, definitions):
"""
Create an object based on the root tag name.
@param root: An XML root element.
@type root: L{Element}
@param definitions: A definitions object.
@type definitions: L{Definitions}
@return: The created object.
@rtype: ... | [
"def",
"create",
"(",
"cls",
",",
"root",
",",
"definitions",
")",
":",
"fn",
"=",
"cls",
".",
"tags",
".",
"get",
"(",
"root",
".",
"name",
")",
"if",
"fn",
"is",
"not",
"None",
":",
"return",
"fn",
"(",
"root",
",",
"definitions",
")"
] | Create an object based on the root tag name.
@param root: An XML root element.
@type root: L{Element}
@param definitions: A definitions object.
@type definitions: L{Definitions}
@return: The created object.
@rtype: L{WObject} | [
"Create",
"an",
"object",
"based",
"on",
"the",
"root",
"tag",
"name",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/wsdl.py#L991-L1005 |
suds-community/suds | suds/bindings/binding.py | Binding.get_reply | def get_reply(self, method, replyroot):
"""
Process the I{reply} for the specified I{method} by unmarshalling it
into into Python object(s).
@param method: The name of the invoked method.
@type method: str
@param replyroot: The reply XML root node received after invoking... | python | def get_reply(self, method, replyroot):
"""
Process the I{reply} for the specified I{method} by unmarshalling it
into into Python object(s).
@param method: The name of the invoked method.
@type method: str
@param replyroot: The reply XML root node received after invoking... | [
"def",
"get_reply",
"(",
"self",
",",
"method",
",",
"replyroot",
")",
":",
"soapenv",
"=",
"replyroot",
".",
"getChild",
"(",
"\"Envelope\"",
",",
"envns",
")",
"soapenv",
".",
"promotePrefixes",
"(",
")",
"soapbody",
"=",
"soapenv",
".",
"getChild",
"(",... | Process the I{reply} for the specified I{method} by unmarshalling it
into into Python object(s).
@param method: The name of the invoked method.
@type method: str
@param replyroot: The reply XML root node received after invoking the
specified method.
@type replyroot: ... | [
"Process",
"the",
"I",
"{",
"reply",
"}",
"for",
"the",
"specified",
"I",
"{",
"method",
"}",
"by",
"unmarshalling",
"it",
"into",
"into",
"Python",
"object",
"(",
"s",
")",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/binding.py#L132-L162 |
suds-community/suds | suds/bindings/binding.py | Binding.replylist | def replylist(self, rt, nodes):
"""
Construct a I{list} reply.
Called for replies with possible multiple occurrences.
@param rt: The return I{type}.
@type rt: L{suds.xsd.sxbase.SchemaObject}
@param nodes: A collection of XML nodes.
@type nodes: [L{Element},...]
... | python | def replylist(self, rt, nodes):
"""
Construct a I{list} reply.
Called for replies with possible multiple occurrences.
@param rt: The return I{type}.
@type rt: L{suds.xsd.sxbase.SchemaObject}
@param nodes: A collection of XML nodes.
@type nodes: [L{Element},...]
... | [
"def",
"replylist",
"(",
"self",
",",
"rt",
",",
"nodes",
")",
":",
"resolved",
"=",
"rt",
".",
"resolve",
"(",
"nobuiltin",
"=",
"True",
")",
"unmarshaller",
"=",
"self",
".",
"unmarshaller",
"(",
")",
"return",
"[",
"unmarshaller",
".",
"process",
"(... | Construct a I{list} reply.
Called for replies with possible multiple occurrences.
@param rt: The return I{type}.
@type rt: L{suds.xsd.sxbase.SchemaObject}
@param nodes: A collection of XML nodes.
@type nodes: [L{Element},...]
@return: A list of I{unmarshalled} objects.
... | [
"Construct",
"a",
"I",
"{",
"list",
"}",
"reply",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/binding.py#L164-L180 |
suds-community/suds | suds/bindings/binding.py | Binding.mkheader | def mkheader(self, method, hdef, object):
"""
Builds a soapheader for the specified I{method} using the header
definition (hdef) and the specified value (object).
@param method: A method name.
@type method: str
@param hdef: A header definition.
@type hdef: tuple:... | python | def mkheader(self, method, hdef, object):
"""
Builds a soapheader for the specified I{method} using the header
definition (hdef) and the specified value (object).
@param method: A method name.
@type method: str
@param hdef: A header definition.
@type hdef: tuple:... | [
"def",
"mkheader",
"(",
"self",
",",
"method",
",",
"hdef",
",",
"object",
")",
":",
"marshaller",
"=",
"self",
".",
"marshaller",
"(",
")",
"if",
"isinstance",
"(",
"object",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"return",
"[",
"self",
".... | Builds a soapheader for the specified I{method} using the header
definition (hdef) and the specified value (object).
@param method: A method name.
@type method: str
@param hdef: A header definition.
@type hdef: tuple: (I{name}, L{xsd.sxbase.SchemaObject})
@param object: ... | [
"Builds",
"a",
"soapheader",
"for",
"the",
"specified",
"I",
"{",
"method",
"}",
"using",
"the",
"header",
"definition",
"(",
"hdef",
")",
"and",
"the",
"specified",
"value",
"(",
"object",
")",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/binding.py#L246-L265 |
suds-community/suds | suds/bindings/binding.py | Binding.envelope | def envelope(self, header, body):
"""
Build the B{<Envelope/>} for a SOAP outbound message.
@param header: The SOAP message B{header}.
@type header: L{Element}
@param body: The SOAP message B{body}.
@type body: L{Element}
@return: The SOAP envelope containing the... | python | def envelope(self, header, body):
"""
Build the B{<Envelope/>} for a SOAP outbound message.
@param header: The SOAP message B{header}.
@type header: L{Element}
@param body: The SOAP message B{body}.
@type body: L{Element}
@return: The SOAP envelope containing the... | [
"def",
"envelope",
"(",
"self",
",",
"header",
",",
"body",
")",
":",
"env",
"=",
"Element",
"(",
"\"Envelope\"",
",",
"ns",
"=",
"envns",
")",
"env",
".",
"addPrefix",
"(",
"Namespace",
".",
"xsins",
"[",
"0",
"]",
",",
"Namespace",
".",
"xsins",
... | Build the B{<Envelope/>} for a SOAP outbound message.
@param header: The SOAP message B{header}.
@type header: L{Element}
@param body: The SOAP message B{body}.
@type body: L{Element}
@return: The SOAP envelope containing the body and header.
@rtype: L{Element} | [
"Build",
"the",
"B",
"{",
"<Envelope",
"/",
">",
"}",
"for",
"a",
"SOAP",
"outbound",
"message",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/binding.py#L267-L283 |
suds-community/suds | suds/bindings/binding.py | Binding.header | def header(self, content):
"""
Build the B{<Body/>} for a SOAP outbound message.
@param content: The header content.
@type content: L{Element}
@return: The SOAP body fragment.
@rtype: L{Element}
"""
header = Element("Header", ns=envns)
header.app... | python | def header(self, content):
"""
Build the B{<Body/>} for a SOAP outbound message.
@param content: The header content.
@type content: L{Element}
@return: The SOAP body fragment.
@rtype: L{Element}
"""
header = Element("Header", ns=envns)
header.app... | [
"def",
"header",
"(",
"self",
",",
"content",
")",
":",
"header",
"=",
"Element",
"(",
"\"Header\"",
",",
"ns",
"=",
"envns",
")",
"header",
".",
"append",
"(",
"content",
")",
"return",
"header"
] | Build the B{<Body/>} for a SOAP outbound message.
@param content: The header content.
@type content: L{Element}
@return: The SOAP body fragment.
@rtype: L{Element} | [
"Build",
"the",
"B",
"{",
"<Body",
"/",
">",
"}",
"for",
"a",
"SOAP",
"outbound",
"message",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/binding.py#L285-L297 |
suds-community/suds | suds/bindings/binding.py | Binding.headercontent | def headercontent(self, method):
"""
Get the content for the SOAP I{Header} node.
@param method: A service method.
@type method: I{service.Method}
@return: The XML content for the <body/>.
@rtype: [L{Element},...]
"""
content = []
wsse = self.opt... | python | def headercontent(self, method):
"""
Get the content for the SOAP I{Header} node.
@param method: A service method.
@type method: I{service.Method}
@return: The XML content for the <body/>.
@rtype: [L{Element},...]
"""
content = []
wsse = self.opt... | [
"def",
"headercontent",
"(",
"self",
",",
"method",
")",
":",
"content",
"=",
"[",
"]",
"wsse",
"=",
"self",
".",
"options",
"(",
")",
".",
"wsse",
"if",
"wsse",
"is",
"not",
"None",
":",
"content",
".",
"append",
"(",
"wsse",
".",
"xml",
"(",
")... | Get the content for the SOAP I{Header} node.
@param method: A service method.
@type method: I{service.Method}
@return: The XML content for the <body/>.
@rtype: [L{Element},...] | [
"Get",
"the",
"content",
"for",
"the",
"SOAP",
"I",
"{",
"Header",
"}",
"node",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/binding.py#L315-L357 |
suds-community/suds | suds/bindings/binding.py | Binding.bodypart_types | def bodypart_types(self, method, input=True):
"""
Get a list of I{parameter definitions} (pdefs) defined for the
specified method.
An input I{pdef} is a (I{name}, L{xsd.sxbase.SchemaObject}) tuple,
while an output I{pdef} is a L{xsd.sxbase.SchemaObject}.
@param method: ... | python | def bodypart_types(self, method, input=True):
"""
Get a list of I{parameter definitions} (pdefs) defined for the
specified method.
An input I{pdef} is a (I{name}, L{xsd.sxbase.SchemaObject}) tuple,
while an output I{pdef} is a L{xsd.sxbase.SchemaObject}.
@param method: ... | [
"def",
"bodypart_types",
"(",
"self",
",",
"method",
",",
"input",
"=",
"True",
")",
":",
"if",
"input",
":",
"parts",
"=",
"method",
".",
"soap",
".",
"input",
".",
"body",
".",
"parts",
"else",
":",
"parts",
"=",
"method",
".",
"soap",
".",
"outp... | Get a list of I{parameter definitions} (pdefs) defined for the
specified method.
An input I{pdef} is a (I{name}, L{xsd.sxbase.SchemaObject}) tuple,
while an output I{pdef} is a L{xsd.sxbase.SchemaObject}.
@param method: A service method.
@type method: I{service.Method}
... | [
"Get",
"a",
"list",
"of",
"I",
"{",
"parameter",
"definitions",
"}",
"(",
"pdefs",
")",
"defined",
"for",
"the",
"specified",
"method",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/binding.py#L387-L407 |
suds-community/suds | suds/bindings/binding.py | Binding.headpart_types | def headpart_types(self, method, input=True):
"""
Get a list of header I{parameter definitions} (pdefs) defined for the
specified method.
An input I{pdef} is a (I{name}, L{xsd.sxbase.SchemaObject}) tuple,
while an output I{pdef} is a L{xsd.sxbase.SchemaObject}.
@param m... | python | def headpart_types(self, method, input=True):
"""
Get a list of header I{parameter definitions} (pdefs) defined for the
specified method.
An input I{pdef} is a (I{name}, L{xsd.sxbase.SchemaObject}) tuple,
while an output I{pdef} is a L{xsd.sxbase.SchemaObject}.
@param m... | [
"def",
"headpart_types",
"(",
"self",
",",
"method",
",",
"input",
"=",
"True",
")",
":",
"if",
"input",
":",
"headers",
"=",
"method",
".",
"soap",
".",
"input",
".",
"headers",
"else",
":",
"headers",
"=",
"method",
".",
"soap",
".",
"output",
".",... | Get a list of header I{parameter definitions} (pdefs) defined for the
specified method.
An input I{pdef} is a (I{name}, L{xsd.sxbase.SchemaObject}) tuple,
while an output I{pdef} is a L{xsd.sxbase.SchemaObject}.
@param method: A service method.
@type method: I{service.Method}
... | [
"Get",
"a",
"list",
"of",
"header",
"I",
"{",
"parameter",
"definitions",
"}",
"(",
"pdefs",
")",
"defined",
"for",
"the",
"specified",
"method",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/binding.py#L409-L429 |
suds-community/suds | suds/bindings/binding.py | Binding.__part_type | def __part_type(self, part, input):
"""
Get a I{parameter definition} (pdef) defined for a given body or header
message part.
An input I{pdef} is a (I{name}, L{xsd.sxbase.SchemaObject}) tuple,
while an output I{pdef} is a L{xsd.sxbase.SchemaObject}.
@param part: A servi... | python | def __part_type(self, part, input):
"""
Get a I{parameter definition} (pdef) defined for a given body or header
message part.
An input I{pdef} is a (I{name}, L{xsd.sxbase.SchemaObject}) tuple,
while an output I{pdef} is a L{xsd.sxbase.SchemaObject}.
@param part: A servi... | [
"def",
"__part_type",
"(",
"self",
",",
"part",
",",
"input",
")",
":",
"if",
"part",
".",
"element",
"is",
"None",
":",
"query",
"=",
"TypeQuery",
"(",
"part",
".",
"type",
")",
"else",
":",
"query",
"=",
"ElementQuery",
"(",
"part",
".",
"element",... | Get a I{parameter definition} (pdef) defined for a given body or header
message part.
An input I{pdef} is a (I{name}, L{xsd.sxbase.SchemaObject}) tuple,
while an output I{pdef} is a L{xsd.sxbase.SchemaObject}.
@param part: A service method input or output part.
@type part: I{su... | [
"Get",
"a",
"I",
"{",
"parameter",
"definition",
"}",
"(",
"pdef",
")",
"defined",
"for",
"a",
"given",
"body",
"or",
"header",
"message",
"part",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/binding.py#L443-L472 |
suds-community/suds | suds/mx/typer.py | Typer.auto | def auto(cls, node, value=None):
"""
Automatically set the node's xsi:type attribute based on either
I{value}'s or the node text's class. When I{value} is an unmapped
class, the default type (xs:any) is set.
@param node: XML node.
@type node: L{sax.element.Element}
... | python | def auto(cls, node, value=None):
"""
Automatically set the node's xsi:type attribute based on either
I{value}'s or the node text's class. When I{value} is an unmapped
class, the default type (xs:any) is set.
@param node: XML node.
@type node: L{sax.element.Element}
... | [
"def",
"auto",
"(",
"cls",
",",
"node",
",",
"value",
"=",
"None",
")",
":",
"if",
"value",
"is",
"None",
":",
"value",
"=",
"node",
".",
"getText",
"(",
")",
"if",
"isinstance",
"(",
"value",
",",
"Object",
")",
":",
"known",
"=",
"cls",
".",
... | Automatically set the node's xsi:type attribute based on either
I{value}'s or the node text's class. When I{value} is an unmapped
class, the default type (xs:any) is set.
@param node: XML node.
@type node: L{sax.element.Element}
@param value: Object that is or would be the node'... | [
"Automatically",
"set",
"the",
"node",
"s",
"xsi",
":",
"type",
"attribute",
"based",
"on",
"either",
"I",
"{",
"value",
"}",
"s",
"or",
"the",
"node",
"text",
"s",
"class",
".",
"When",
"I",
"{",
"value",
"}",
"is",
"an",
"unmapped",
"class",
"the",... | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/mx/typer.py#L45-L69 |
suds-community/suds | suds/mx/typer.py | Typer.manual | def manual(cls, node, tval, ns=None):
"""
Set the node's xsi:type attribute based on either I{value}'s or the
node text's class. Then adds the referenced prefix(s) to the node's
prefix mapping.
@param node: XML node.
@type node: L{sax.element.Element}
@param tval... | python | def manual(cls, node, tval, ns=None):
"""
Set the node's xsi:type attribute based on either I{value}'s or the
node text's class. Then adds the referenced prefix(s) to the node's
prefix mapping.
@param node: XML node.
@type node: L{sax.element.Element}
@param tval... | [
"def",
"manual",
"(",
"cls",
",",
"node",
",",
"tval",
",",
"ns",
"=",
"None",
")",
":",
"xta",
"=",
"\":\"",
".",
"join",
"(",
"(",
"Namespace",
".",
"xsins",
"[",
"0",
"]",
",",
"\"type\"",
")",
")",
"node",
".",
"addPrefix",
"(",
"Namespace",
... | Set the node's xsi:type attribute based on either I{value}'s or the
node text's class. Then adds the referenced prefix(s) to the node's
prefix mapping.
@param node: XML node.
@type node: L{sax.element.Element}
@param tval: XSD schema type name.
@type tval: str
@p... | [
"Set",
"the",
"node",
"s",
"xsi",
":",
"type",
"attribute",
"based",
"on",
"either",
"I",
"{",
"value",
"}",
"s",
"or",
"the",
"node",
"text",
"s",
"class",
".",
"Then",
"adds",
"the",
"referenced",
"prefix",
"(",
"s",
")",
"to",
"the",
"node",
"s"... | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/mx/typer.py#L72-L97 |
suds-community/suds | suds/mx/typer.py | Typer.genprefix | def genprefix(cls, node, ns):
"""
Generate a prefix.
@param node: XML node on which the prefix will be used.
@type node: L{sax.element.Element}
@param ns: Namespace needing a unique prefix.
@type ns: (prefix, URI)
@return: I{ns} with a new prefix.
@rtype:... | python | def genprefix(cls, node, ns):
"""
Generate a prefix.
@param node: XML node on which the prefix will be used.
@type node: L{sax.element.Element}
@param ns: Namespace needing a unique prefix.
@type ns: (prefix, URI)
@return: I{ns} with a new prefix.
@rtype:... | [
"def",
"genprefix",
"(",
"cls",
",",
"node",
",",
"ns",
")",
":",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"1024",
")",
":",
"prefix",
"=",
"\"ns%d\"",
"%",
"(",
"i",
",",
")",
"uri",
"=",
"node",
".",
"resolvePrefix",
"(",
"prefix",
",",
"def... | Generate a prefix.
@param node: XML node on which the prefix will be used.
@type node: L{sax.element.Element}
@param ns: Namespace needing a unique prefix.
@type ns: (prefix, URI)
@return: I{ns} with a new prefix.
@rtype: (prefix, URI) | [
"Generate",
"a",
"prefix",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/mx/typer.py#L100-L117 |
suds-community/suds | suds/cache.py | FileCache._getf | def _getf(self, id):
"""Open a cached file with the given id for reading."""
try:
filename = self.__filename(id)
self.__remove_if_expired(filename)
return self.__open(filename, "rb")
except Exception:
pass | python | def _getf(self, id):
"""Open a cached file with the given id for reading."""
try:
filename = self.__filename(id)
self.__remove_if_expired(filename)
return self.__open(filename, "rb")
except Exception:
pass | [
"def",
"_getf",
"(",
"self",
",",
"id",
")",
":",
"try",
":",
"filename",
"=",
"self",
".",
"__filename",
"(",
"id",
")",
"self",
".",
"__remove_if_expired",
"(",
"filename",
")",
"return",
"self",
".",
"__open",
"(",
"filename",
",",
"\"rb\"",
")",
... | Open a cached file with the given id for reading. | [
"Open",
"a",
"cached",
"file",
"with",
"the",
"given",
"id",
"for",
"reading",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/cache.py#L182-L189 |
suds-community/suds | suds/cache.py | FileCache.__filename | def __filename(self, id):
"""Return the cache file name for an entry with a given id."""
suffix = self.fnsuffix()
filename = "%s-%s.%s" % (self.fnprefix, id, suffix)
return os.path.join(self.location, filename) | python | def __filename(self, id):
"""Return the cache file name for an entry with a given id."""
suffix = self.fnsuffix()
filename = "%s-%s.%s" % (self.fnprefix, id, suffix)
return os.path.join(self.location, filename) | [
"def",
"__filename",
"(",
"self",
",",
"id",
")",
":",
"suffix",
"=",
"self",
".",
"fnsuffix",
"(",
")",
"filename",
"=",
"\"%s-%s.%s\"",
"%",
"(",
"self",
".",
"fnprefix",
",",
"id",
",",
"suffix",
")",
"return",
"os",
".",
"path",
".",
"join",
"(... | Return the cache file name for an entry with a given id. | [
"Return",
"the",
"cache",
"file",
"name",
"for",
"an",
"entry",
"with",
"a",
"given",
"id",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/cache.py#L209-L213 |
suds-community/suds | suds/cache.py | FileCache.__get_default_location | def __get_default_location():
"""
Returns the current process's default cache location folder.
The folder is determined lazily on first call.
"""
if not FileCache.__default_location:
tmp = tempfile.mkdtemp("suds-default-cache")
FileCache.__default_locati... | python | def __get_default_location():
"""
Returns the current process's default cache location folder.
The folder is determined lazily on first call.
"""
if not FileCache.__default_location:
tmp = tempfile.mkdtemp("suds-default-cache")
FileCache.__default_locati... | [
"def",
"__get_default_location",
"(",
")",
":",
"if",
"not",
"FileCache",
".",
"__default_location",
":",
"tmp",
"=",
"tempfile",
".",
"mkdtemp",
"(",
"\"suds-default-cache\"",
")",
"FileCache",
".",
"__default_location",
"=",
"tmp",
"import",
"atexit",
"atexit",
... | Returns the current process's default cache location folder.
The folder is determined lazily on first call. | [
"Returns",
"the",
"current",
"process",
"s",
"default",
"cache",
"location",
"folder",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/cache.py#L216-L228 |
suds-community/suds | suds/cache.py | FileCache.__mktmp | def __mktmp(self):
"""Create the I{location} folder if it does not already exist."""
try:
if not os.path.isdir(self.location):
os.makedirs(self.location)
except Exception:
log.debug(self.location, exc_info=1)
return self | python | def __mktmp(self):
"""Create the I{location} folder if it does not already exist."""
try:
if not os.path.isdir(self.location):
os.makedirs(self.location)
except Exception:
log.debug(self.location, exc_info=1)
return self | [
"def",
"__mktmp",
"(",
"self",
")",
":",
"try",
":",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"self",
".",
"location",
")",
":",
"os",
".",
"makedirs",
"(",
"self",
".",
"location",
")",
"except",
"Exception",
":",
"log",
".",
"debug",
... | Create the I{location} folder if it does not already exist. | [
"Create",
"the",
"I",
"{",
"location",
"}",
"folder",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/cache.py#L230-L237 |
suds-community/suds | suds/cache.py | FileCache.__remove_if_expired | def __remove_if_expired(self, filename):
"""
Remove a cached file entry if it expired.
@param filename: The file name.
@type filename: str
"""
if not self.duration:
return
created = datetime.datetime.fromtimestamp(os.path.getctime(filename))
... | python | def __remove_if_expired(self, filename):
"""
Remove a cached file entry if it expired.
@param filename: The file name.
@type filename: str
"""
if not self.duration:
return
created = datetime.datetime.fromtimestamp(os.path.getctime(filename))
... | [
"def",
"__remove_if_expired",
"(",
"self",
",",
"filename",
")",
":",
"if",
"not",
"self",
".",
"duration",
":",
"return",
"created",
"=",
"datetime",
".",
"datetime",
".",
"fromtimestamp",
"(",
"os",
".",
"path",
".",
"getctime",
"(",
"filename",
")",
"... | Remove a cached file entry if it expired.
@param filename: The file name.
@type filename: str | [
"Remove",
"a",
"cached",
"file",
"entry",
"if",
"it",
"expired",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/cache.py#L261-L275 |
suds-community/suds | suds/xsd/doctor.py | TnsFilter.match | def match(self, root, ns):
"""
Match by I{targetNamespace} excluding those that
are equal to the specified namespace to prevent
adding an import to itself.
@param root: A schema root.
@type root: L{Element}
"""
tns = root.get('targetNamespace')
if ... | python | def match(self, root, ns):
"""
Match by I{targetNamespace} excluding those that
are equal to the specified namespace to prevent
adding an import to itself.
@param root: A schema root.
@type root: L{Element}
"""
tns = root.get('targetNamespace')
if ... | [
"def",
"match",
"(",
"self",
",",
"root",
",",
"ns",
")",
":",
"tns",
"=",
"root",
".",
"get",
"(",
"'targetNamespace'",
")",
"if",
"len",
"(",
"self",
".",
"tns",
")",
":",
"matched",
"=",
"(",
"tns",
"in",
"self",
".",
"tns",
")",
"else",
":"... | Match by I{targetNamespace} excluding those that
are equal to the specified namespace to prevent
adding an import to itself.
@param root: A schema root.
@type root: L{Element} | [
"Match",
"by",
"I",
"{",
"targetNamespace",
"}",
"excluding",
"those",
"that",
"are",
"equal",
"to",
"the",
"specified",
"namespace",
"to",
"prevent",
"adding",
"an",
"import",
"to",
"itself",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/xsd/doctor.py#L90-L104 |
suds-community/suds | suds/transport/http.py | HttpTransport.u2opener | def u2opener(self):
"""
Create a urllib opener.
@return: An opener.
@rtype: I{OpenerDirector}
"""
if self.urlopener is None:
return urllib2.build_opener(*self.u2handlers())
return self.urlopener | python | def u2opener(self):
"""
Create a urllib opener.
@return: An opener.
@rtype: I{OpenerDirector}
"""
if self.urlopener is None:
return urllib2.build_opener(*self.u2handlers())
return self.urlopener | [
"def",
"u2opener",
"(",
"self",
")",
":",
"if",
"self",
".",
"urlopener",
"is",
"None",
":",
"return",
"urllib2",
".",
"build_opener",
"(",
"*",
"self",
".",
"u2handlers",
"(",
")",
")",
"return",
"self",
".",
"urlopener"
] | Create a urllib opener.
@return: An opener.
@rtype: I{OpenerDirector} | [
"Create",
"a",
"urllib",
"opener",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/transport/http.py#L130-L140 |
suds-community/suds | suds/transport/http.py | HttpTransport.u2ver | def u2ver(self):
"""
Get the major/minor version of the urllib2 lib.
@return: The urllib2 version.
@rtype: float
"""
try:
part = urllib2.__version__.split('.', 1)
return float('.'.join(part))
except Exception, e:
log.exception... | python | def u2ver(self):
"""
Get the major/minor version of the urllib2 lib.
@return: The urllib2 version.
@rtype: float
"""
try:
part = urllib2.__version__.split('.', 1)
return float('.'.join(part))
except Exception, e:
log.exception... | [
"def",
"u2ver",
"(",
"self",
")",
":",
"try",
":",
"part",
"=",
"urllib2",
".",
"__version__",
".",
"split",
"(",
"'.'",
",",
"1",
")",
"return",
"float",
"(",
"'.'",
".",
"join",
"(",
"part",
")",
")",
"except",
"Exception",
",",
"e",
":",
"log"... | Get the major/minor version of the urllib2 lib.
@return: The urllib2 version.
@rtype: float | [
"Get",
"the",
"major",
"/",
"minor",
"version",
"of",
"the",
"urllib2",
"lib",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/transport/http.py#L152-L165 |
suds-community/suds | tools/suds_devel/utility.py | any_contains_any | def any_contains_any(strings, candidates):
"""Whether any of the strings contains any of the candidates."""
for string in strings:
for c in candidates:
if c in string:
return True | python | def any_contains_any(strings, candidates):
"""Whether any of the strings contains any of the candidates."""
for string in strings:
for c in candidates:
if c in string:
return True | [
"def",
"any_contains_any",
"(",
"strings",
",",
"candidates",
")",
":",
"for",
"string",
"in",
"strings",
":",
"for",
"c",
"in",
"candidates",
":",
"if",
"c",
"in",
"string",
":",
"return",
"True"
] | Whether any of the strings contains any of the candidates. | [
"Whether",
"any",
"of",
"the",
"strings",
"contains",
"any",
"of",
"the",
"candidates",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/utility.py#L32-L37 |
suds-community/suds | tools/suds_devel/utility.py | path_to_URL | def path_to_URL(path, escape=True):
"""Convert a local file path to a absolute path file protocol URL."""
# We do not use urllib's builtin pathname2url() function since:
# - it has been commented with 'not recommended for general use'
# - it does not seem to work the same on Windows and non-Window... | python | def path_to_URL(path, escape=True):
"""Convert a local file path to a absolute path file protocol URL."""
# We do not use urllib's builtin pathname2url() function since:
# - it has been commented with 'not recommended for general use'
# - it does not seem to work the same on Windows and non-Window... | [
"def",
"path_to_URL",
"(",
"path",
",",
"escape",
"=",
"True",
")",
":",
"# We do not use urllib's builtin pathname2url() function since:\r",
"# - it has been commented with 'not recommended for general use'\r",
"# - it does not seem to work the same on Windows and non-Windows platforms\r"... | Convert a local file path to a absolute path file protocol URL. | [
"Convert",
"a",
"local",
"file",
"path",
"to",
"a",
"absolute",
"path",
"file",
"protocol",
"URL",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/utility.py#L67-L86 |
suds-community/suds | tools/suds_devel/utility.py | requirement_spec | def requirement_spec(package_name, *args):
"""Identifier used when specifying a requirement to pip or setuptools."""
if not args or args == (None,):
return package_name
version_specs = []
for version_spec in args:
if isinstance(version_spec, (list, tuple)):
operator, v... | python | def requirement_spec(package_name, *args):
"""Identifier used when specifying a requirement to pip or setuptools."""
if not args or args == (None,):
return package_name
version_specs = []
for version_spec in args:
if isinstance(version_spec, (list, tuple)):
operator, v... | [
"def",
"requirement_spec",
"(",
"package_name",
",",
"*",
"args",
")",
":",
"if",
"not",
"args",
"or",
"args",
"==",
"(",
"None",
",",
")",
":",
"return",
"package_name",
"version_specs",
"=",
"[",
"]",
"for",
"version_spec",
"in",
"args",
":",
"if",
"... | Identifier used when specifying a requirement to pip or setuptools. | [
"Identifier",
"used",
"when",
"specifying",
"a",
"requirement",
"to",
"pip",
"or",
"setuptools",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/utility.py#L93-L106 |
suds-community/suds | tools/suds_devel/utility.py | script_folder | def script_folder(script_path):
"""
Return the given script's folder or None if it can not be determined.
Script is identified by its __file__ attribute. If the given __file__
attribute value contains no path information, it is expected to identify an
existing file in the current working fold... | python | def script_folder(script_path):
"""
Return the given script's folder or None if it can not be determined.
Script is identified by its __file__ attribute. If the given __file__
attribute value contains no path information, it is expected to identify an
existing file in the current working fold... | [
"def",
"script_folder",
"(",
"script_path",
")",
":",
"# There exist modules whose __file__ attribute does not correspond directly\r",
"# to a disk file, e.g. modules imported from inside zip archives.\r",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"script_path",
")",
":",
"ret... | Return the given script's folder or None if it can not be determined.
Script is identified by its __file__ attribute. If the given __file__
attribute value contains no path information, it is expected to identify an
existing file in the current working folder.
Returned folder may be specified re... | [
"Return",
"the",
"given",
"script",
"s",
"folder",
"or",
"None",
"if",
"it",
"can",
"not",
"be",
"determined",
".",
"Script",
"is",
"identified",
"by",
"its",
"__file__",
"attribute",
".",
"If",
"the",
"given",
"__file__",
"attribute",
"value",
"contains",
... | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/utility.py#L124-L144 |
suds-community/suds | tools/suds_devel/utility.py | path_iter | def path_iter(path):
"""Returns an iterator over all the file & folder names in a path."""
parts = []
while path:
path, item = os.path.split(path)
if item:
parts.append(item)
return reversed(parts) | python | def path_iter(path):
"""Returns an iterator over all the file & folder names in a path."""
parts = []
while path:
path, item = os.path.split(path)
if item:
parts.append(item)
return reversed(parts) | [
"def",
"path_iter",
"(",
"path",
")",
":",
"parts",
"=",
"[",
"]",
"while",
"path",
":",
"path",
",",
"item",
"=",
"os",
".",
"path",
".",
"split",
"(",
"path",
")",
"if",
"item",
":",
"parts",
".",
"append",
"(",
"item",
")",
"return",
"reversed... | Returns an iterator over all the file & folder names in a path. | [
"Returns",
"an",
"iterator",
"over",
"all",
"the",
"file",
"&",
"folder",
"names",
"in",
"a",
"path",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/utility.py#L147-L154 |
suds-community/suds | suds/bindings/document.py | Document.document | def document(self, wrapper):
"""
Get the document root. For I{document/literal}, this is the name of the
wrapper element qualified by the schema's target namespace.
@param wrapper: The method name.
@type wrapper: L{xsd.sxbase.SchemaObject}
@return: A root element.
... | python | def document(self, wrapper):
"""
Get the document root. For I{document/literal}, this is the name of the
wrapper element qualified by the schema's target namespace.
@param wrapper: The method name.
@type wrapper: L{xsd.sxbase.SchemaObject}
@return: A root element.
... | [
"def",
"document",
"(",
"self",
",",
"wrapper",
")",
":",
"tag",
"=",
"wrapper",
"[",
"1",
"]",
".",
"name",
"ns",
"=",
"wrapper",
"[",
"1",
"]",
".",
"namespace",
"(",
"\"ns0\"",
")",
"return",
"Element",
"(",
"tag",
",",
"ns",
"=",
"ns",
")"
] | Get the document root. For I{document/literal}, this is the name of the
wrapper element qualified by the schema's target namespace.
@param wrapper: The method name.
@type wrapper: L{xsd.sxbase.SchemaObject}
@return: A root element.
@rtype: L{Element} | [
"Get",
"the",
"document",
"root",
".",
"For",
"I",
"{",
"document",
"/",
"literal",
"}",
"this",
"is",
"the",
"name",
"of",
"the",
"wrapper",
"element",
"qualified",
"by",
"the",
"schema",
"s",
"target",
"namespace",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/document.py#L105-L118 |
suds-community/suds | suds/bindings/document.py | Document.mkparam | def mkparam(self, method, pdef, object):
"""
Expand list parameters into individual parameters each with the type
information. This is because in document arrays are simply
multi-occurrence elements.
"""
if isinstance(object, (list, tuple)):
return [self.mkpa... | python | def mkparam(self, method, pdef, object):
"""
Expand list parameters into individual parameters each with the type
information. This is because in document arrays are simply
multi-occurrence elements.
"""
if isinstance(object, (list, tuple)):
return [self.mkpa... | [
"def",
"mkparam",
"(",
"self",
",",
"method",
",",
"pdef",
",",
"object",
")",
":",
"if",
"isinstance",
"(",
"object",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"return",
"[",
"self",
".",
"mkparam",
"(",
"method",
",",
"pdef",
",",
"item",
... | Expand list parameters into individual parameters each with the type
information. This is because in document arrays are simply
multi-occurrence elements. | [
"Expand",
"list",
"parameters",
"into",
"individual",
"parameters",
"each",
"with",
"the",
"type",
"information",
".",
"This",
"is",
"because",
"in",
"document",
"arrays",
"are",
"simply",
"multi",
"-",
"occurrence",
"elements",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/document.py#L120-L129 |
suds-community/suds | suds/bindings/document.py | Document.param_defs | def param_defs(self, method):
"""Get parameter definitions for document literal."""
pts = self.bodypart_types(method)
if not method.soap.input.body.wrapped:
return pts
pt = pts[0][1].resolve()
return [(c.name, c, a) for c, a in pt if not c.isattr()] | python | def param_defs(self, method):
"""Get parameter definitions for document literal."""
pts = self.bodypart_types(method)
if not method.soap.input.body.wrapped:
return pts
pt = pts[0][1].resolve()
return [(c.name, c, a) for c, a in pt if not c.isattr()] | [
"def",
"param_defs",
"(",
"self",
",",
"method",
")",
":",
"pts",
"=",
"self",
".",
"bodypart_types",
"(",
"method",
")",
"if",
"not",
"method",
".",
"soap",
".",
"input",
".",
"body",
".",
"wrapped",
":",
"return",
"pts",
"pt",
"=",
"pts",
"[",
"0... | Get parameter definitions for document literal. | [
"Get",
"parameter",
"definitions",
"for",
"document",
"literal",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/bindings/document.py#L131-L137 |
suds-community/suds | suds/__init__.py | byte_str | def byte_str(s="", encoding="utf-8", input_encoding="utf-8", errors="strict"):
"""
Returns a byte string version of 's', encoded as specified in 'encoding'.
Accepts str & unicode objects, interpreting non-unicode strings as byte
strings encoded using the given input encoding.
"""
assert isinst... | python | def byte_str(s="", encoding="utf-8", input_encoding="utf-8", errors="strict"):
"""
Returns a byte string version of 's', encoded as specified in 'encoding'.
Accepts str & unicode objects, interpreting non-unicode strings as byte
strings encoded using the given input encoding.
"""
assert isinst... | [
"def",
"byte_str",
"(",
"s",
"=",
"\"\"",
",",
"encoding",
"=",
"\"utf-8\"",
",",
"input_encoding",
"=",
"\"utf-8\"",
",",
"errors",
"=",
"\"strict\"",
")",
":",
"assert",
"isinstance",
"(",
"s",
",",
"basestring",
")",
"if",
"isinstance",
"(",
"s",
",",... | Returns a byte string version of 's', encoded as specified in 'encoding'.
Accepts str & unicode objects, interpreting non-unicode strings as byte
strings encoded using the given input encoding. | [
"Returns",
"a",
"byte",
"string",
"version",
"of",
"s",
"encoded",
"as",
"specified",
"in",
"encoding",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/__init__.py#L144-L157 |
suds-community/suds | suds/sax/date.py | _bump_up_time_by_microsecond | def _bump_up_time_by_microsecond(time):
"""
Helper function bumping up the given datetime.time by a microsecond,
cycling around silently to 00:00:00.0 in case of an overflow.
@param time: Time object.
@type time: B{datetime}.I{time}
@return: Time object.
@rtype: B{datetime}.I{time}
"""... | python | def _bump_up_time_by_microsecond(time):
"""
Helper function bumping up the given datetime.time by a microsecond,
cycling around silently to 00:00:00.0 in case of an overflow.
@param time: Time object.
@type time: B{datetime}.I{time}
@return: Time object.
@rtype: B{datetime}.I{time}
"""... | [
"def",
"_bump_up_time_by_microsecond",
"(",
"time",
")",
":",
"dt",
"=",
"datetime",
".",
"datetime",
"(",
"2000",
",",
"1",
",",
"1",
",",
"time",
".",
"hour",
",",
"time",
".",
"minute",
",",
"time",
".",
"second",
",",
"time",
".",
"microsecond",
... | Helper function bumping up the given datetime.time by a microsecond,
cycling around silently to 00:00:00.0 in case of an overflow.
@param time: Time object.
@type time: B{datetime}.I{time}
@return: Time object.
@rtype: B{datetime}.I{time} | [
"Helper",
"function",
"bumping",
"up",
"the",
"given",
"datetime",
".",
"time",
"by",
"a",
"microsecond",
"cycling",
"around",
"silently",
"to",
"00",
":",
"00",
":",
"00",
".",
"0",
"in",
"case",
"of",
"an",
"overflow",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/date.py#L356-L370 |
suds-community/suds | suds/sax/date.py | _date_from_match | def _date_from_match(match_object):
"""
Create a date object from a regular expression match.
The regular expression match is expected to be from _RE_DATE or
_RE_DATETIME.
@param match_object: The regular expression match.
@type match_object: B{re}.I{MatchObject}
@return: A date object.
... | python | def _date_from_match(match_object):
"""
Create a date object from a regular expression match.
The regular expression match is expected to be from _RE_DATE or
_RE_DATETIME.
@param match_object: The regular expression match.
@type match_object: B{re}.I{MatchObject}
@return: A date object.
... | [
"def",
"_date_from_match",
"(",
"match_object",
")",
":",
"year",
"=",
"int",
"(",
"match_object",
".",
"group",
"(",
"\"year\"",
")",
")",
"month",
"=",
"int",
"(",
"match_object",
".",
"group",
"(",
"\"month\"",
")",
")",
"day",
"=",
"int",
"(",
"mat... | Create a date object from a regular expression match.
The regular expression match is expected to be from _RE_DATE or
_RE_DATETIME.
@param match_object: The regular expression match.
@type match_object: B{re}.I{MatchObject}
@return: A date object.
@rtype: B{datetime}.I{date} | [
"Create",
"a",
"date",
"object",
"from",
"a",
"regular",
"expression",
"match",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/date.py#L373-L389 |
suds-community/suds | suds/sax/date.py | _time_from_match | def _time_from_match(match_object):
"""
Create a time object from a regular expression match.
Returns the time object and information whether the resulting time should
be bumped up by one microsecond due to microsecond rounding.
Subsecond information is rounded to microseconds due to a restriction... | python | def _time_from_match(match_object):
"""
Create a time object from a regular expression match.
Returns the time object and information whether the resulting time should
be bumped up by one microsecond due to microsecond rounding.
Subsecond information is rounded to microseconds due to a restriction... | [
"def",
"_time_from_match",
"(",
"match_object",
")",
":",
"hour",
"=",
"int",
"(",
"match_object",
".",
"group",
"(",
"'hour'",
")",
")",
"minute",
"=",
"int",
"(",
"match_object",
".",
"group",
"(",
"'minute'",
")",
")",
"second",
"=",
"int",
"(",
"ma... | Create a time object from a regular expression match.
Returns the time object and information whether the resulting time should
be bumped up by one microsecond due to microsecond rounding.
Subsecond information is rounded to microseconds due to a restriction in
the python datetime.datetime/time implem... | [
"Create",
"a",
"time",
"object",
"from",
"a",
"regular",
"expression",
"match",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/date.py#L392-L422 |
suds-community/suds | suds/sax/date.py | _tzinfo_from_match | def _tzinfo_from_match(match_object):
"""
Create a timezone information object from a regular expression match.
The regular expression match is expected to be from _RE_DATE, _RE_DATETIME
or _RE_TIME.
@param match_object: The regular expression match.
@type match_object: B{re}.I{MatchObject}
... | python | def _tzinfo_from_match(match_object):
"""
Create a timezone information object from a regular expression match.
The regular expression match is expected to be from _RE_DATE, _RE_DATETIME
or _RE_TIME.
@param match_object: The regular expression match.
@type match_object: B{re}.I{MatchObject}
... | [
"def",
"_tzinfo_from_match",
"(",
"match_object",
")",
":",
"tz_utc",
"=",
"match_object",
".",
"group",
"(",
"\"tz_utc\"",
")",
"if",
"tz_utc",
":",
"return",
"UtcTimezone",
"(",
")",
"tz_sign",
"=",
"match_object",
".",
"group",
"(",
"\"tz_sign\"",
")",
"i... | Create a timezone information object from a regular expression match.
The regular expression match is expected to be from _RE_DATE, _RE_DATETIME
or _RE_TIME.
@param match_object: The regular expression match.
@type match_object: B{re}.I{MatchObject}
@return: A timezone information object.
@rty... | [
"Create",
"a",
"timezone",
"information",
"object",
"from",
"a",
"regular",
"expression",
"match",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/date.py#L425-L460 |
suds-community/suds | suds/sax/date.py | Date.__parse | def __parse(value):
"""
Parse the string date.
Supports the subset of ISO8601 used by xsd:date, but is lenient with
what is accepted, handling most reasonable syntax.
Any timezone is parsed but ignored because a) it is meaningless without
a time and b) B{datetime}.I{dat... | python | def __parse(value):
"""
Parse the string date.
Supports the subset of ISO8601 used by xsd:date, but is lenient with
what is accepted, handling most reasonable syntax.
Any timezone is parsed but ignored because a) it is meaningless without
a time and b) B{datetime}.I{dat... | [
"def",
"__parse",
"(",
"value",
")",
":",
"match_result",
"=",
"_RE_DATE",
".",
"match",
"(",
"value",
")",
"if",
"match_result",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"date data has invalid format '%s'\"",
"%",
"(",
"value",
",",
")",
")",
"retur... | Parse the string date.
Supports the subset of ISO8601 used by xsd:date, but is lenient with
what is accepted, handling most reasonable syntax.
Any timezone is parsed but ignored because a) it is meaningless without
a time and b) B{datetime}.I{date} does not support timezone
inf... | [
"Parse",
"the",
"string",
"date",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/date.py#L76-L96 |
suds-community/suds | suds/sax/date.py | DateTime.__parse | def __parse(value):
"""
Parse the string datetime.
Supports the subset of ISO8601 used by xsd:dateTime, but is lenient
with what is accepted, handling most reasonable syntax.
Subsecond information is rounded to microseconds due to a restriction
in the python datetime.da... | python | def __parse(value):
"""
Parse the string datetime.
Supports the subset of ISO8601 used by xsd:dateTime, but is lenient
with what is accepted, handling most reasonable syntax.
Subsecond information is rounded to microseconds due to a restriction
in the python datetime.da... | [
"def",
"__parse",
"(",
"value",
")",
":",
"match_result",
"=",
"_RE_DATETIME",
".",
"match",
"(",
"value",
")",
"if",
"match_result",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"date data has invalid format '%s'\"",
"%",
"(",
"value",
",",
")",
")",
"d... | Parse the string datetime.
Supports the subset of ISO8601 used by xsd:dateTime, but is lenient
with what is accepted, handling most reasonable syntax.
Subsecond information is rounded to microseconds due to a restriction
in the python datetime.datetime/time implementation.
@pa... | [
"Parse",
"the",
"string",
"datetime",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/date.py#L126-L154 |
suds-community/suds | suds/sax/date.py | Time.__parse | def __parse(value):
"""
Parse the string date.
Supports the subset of ISO8601 used by xsd:time, but is lenient with
what is accepted, handling most reasonable syntax.
Subsecond information is rounded to microseconds due to a restriction
in the python datetime.time imple... | python | def __parse(value):
"""
Parse the string date.
Supports the subset of ISO8601 used by xsd:time, but is lenient with
what is accepted, handling most reasonable syntax.
Subsecond information is rounded to microseconds due to a restriction
in the python datetime.time imple... | [
"def",
"__parse",
"(",
"value",
")",
":",
"match_result",
"=",
"_RE_TIME",
".",
"match",
"(",
"value",
")",
"if",
"match_result",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"date data has invalid format '%s'\"",
"%",
"(",
"value",
",",
")",
")",
"time"... | Parse the string date.
Supports the subset of ISO8601 used by xsd:time, but is lenient with
what is accepted, handling most reasonable syntax.
Subsecond information is rounded to microseconds due to a restriction
in the python datetime.time implementation.
@param value: A time... | [
"Parse",
"the",
"string",
"date",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/date.py#L184-L208 |
suds-community/suds | suds/sax/date.py | FixedOffsetTimezone.tzname | def tzname(self, dt):
"""
http://docs.python.org/library/datetime.html#datetime.tzinfo.tzname
"""
# total_seconds was introduced in Python 2.7
if hasattr(self.__offset, "total_seconds"):
total_seconds = self.__offset.total_seconds()
else:
total_se... | python | def tzname(self, dt):
"""
http://docs.python.org/library/datetime.html#datetime.tzinfo.tzname
"""
# total_seconds was introduced in Python 2.7
if hasattr(self.__offset, "total_seconds"):
total_seconds = self.__offset.total_seconds()
else:
total_se... | [
"def",
"tzname",
"(",
"self",
",",
"dt",
")",
":",
"# total_seconds was introduced in Python 2.7",
"if",
"hasattr",
"(",
"self",
".",
"__offset",
",",
"\"total_seconds\"",
")",
":",
"total_seconds",
"=",
"self",
".",
"__offset",
".",
"total_seconds",
"(",
")",
... | http://docs.python.org/library/datetime.html#datetime.tzinfo.tzname | [
"http",
":",
"//",
"docs",
".",
"python",
".",
"org",
"/",
"library",
"/",
"datetime",
".",
"html#datetime",
".",
"tzinfo",
".",
"tzname"
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/date.py#L251-L274 |
suds-community/suds | suds/umx/core.py | Core.postprocess | def postprocess(self, content):
"""
Perform final processing of the resulting data structure as follows:
- Mixed values (children and text) will have a result of the I{content.node}.
- Simi-simple values (attributes, no-children and text) will have a result of a
property... | python | def postprocess(self, content):
"""
Perform final processing of the resulting data structure as follows:
- Mixed values (children and text) will have a result of the I{content.node}.
- Simi-simple values (attributes, no-children and text) will have a result of a
property... | [
"def",
"postprocess",
"(",
"self",
",",
"content",
")",
":",
"node",
"=",
"content",
".",
"node",
"if",
"len",
"(",
"node",
".",
"children",
")",
"and",
"node",
".",
"hasText",
"(",
")",
":",
"return",
"node",
"attributes",
"=",
"AttrList",
"(",
"nod... | Perform final processing of the resulting data structure as follows:
- Mixed values (children and text) will have a result of the I{content.node}.
- Simi-simple values (attributes, no-children and text) will have a result of a
property object.
- Simple values (no-attributes, n... | [
"Perform",
"final",
"processing",
"of",
"the",
"resulting",
"data",
"structure",
"as",
"follows",
":",
"-",
"Mixed",
"values",
"(",
"children",
"and",
"text",
")",
"will",
"have",
"a",
"result",
"of",
"the",
"I",
"{",
"content",
".",
"node",
"}",
".",
... | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/umx/core.py#L66-L101 |
suds-community/suds | suds/umx/core.py | Core.append_children | def append_children(self, content):
"""
Append child nodes into L{Content.data}
@param content: The current content being unmarshalled.
@type content: L{Content}
"""
for child in content.node:
cont = Content(child)
cval = self.append(cont)
... | python | def append_children(self, content):
"""
Append child nodes into L{Content.data}
@param content: The current content being unmarshalled.
@type content: L{Content}
"""
for child in content.node:
cont = Content(child)
cval = self.append(cont)
... | [
"def",
"append_children",
"(",
"self",
",",
"content",
")",
":",
"for",
"child",
"in",
"content",
".",
"node",
":",
"cont",
"=",
"Content",
"(",
"child",
")",
"cval",
"=",
"self",
".",
"append",
"(",
"cont",
")",
"key",
"=",
"reserved",
".",
"get",
... | Append child nodes into L{Content.data}
@param content: The current content being unmarshalled.
@type content: L{Content} | [
"Append",
"child",
"nodes",
"into",
"L",
"{",
"Content",
".",
"data",
"}"
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/umx/core.py#L130-L153 |
suds-community/suds | suds/client.py | _parse | def _parse(string):
"""
Parses given XML document content.
Returns the resulting root XML element node or None if the given XML
content is empty.
@param string: XML document content to parse.
@type string: I{bytes}
@return: Resulting root XML element node or None.
@rtype: L{Element}|I{... | python | def _parse(string):
"""
Parses given XML document content.
Returns the resulting root XML element node or None if the given XML
content is empty.
@param string: XML document content to parse.
@type string: I{bytes}
@return: Resulting root XML element node or None.
@rtype: L{Element}|I{... | [
"def",
"_parse",
"(",
"string",
")",
":",
"if",
"string",
":",
"return",
"suds",
".",
"sax",
".",
"parser",
".",
"Parser",
"(",
")",
".",
"parse",
"(",
"string",
"=",
"string",
")"
] | Parses given XML document content.
Returns the resulting root XML element node or None if the given XML
content is empty.
@param string: XML document content to parse.
@type string: I{bytes}
@return: Resulting root XML element node or None.
@rtype: L{Element}|I{None} | [
"Parses",
"given",
"XML",
"document",
"content",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L933-L947 |
suds-community/suds | suds/client.py | Factory.create | def create(self, name):
"""
Create a WSDL type by name.
@param name: The name of a type defined in the WSDL.
@type name: str
@return: The requested object.
@rtype: L{Object}
"""
timer = metrics.Timer()
timer.start()
type = self.resolver.f... | python | def create(self, name):
"""
Create a WSDL type by name.
@param name: The name of a type defined in the WSDL.
@type name: str
@return: The requested object.
@rtype: L{Object}
"""
timer = metrics.Timer()
timer.start()
type = self.resolver.f... | [
"def",
"create",
"(",
"self",
",",
"name",
")",
":",
"timer",
"=",
"metrics",
".",
"Timer",
"(",
")",
"timer",
".",
"start",
"(",
")",
"type",
"=",
"self",
".",
"resolver",
".",
"find",
"(",
"name",
")",
"if",
"type",
"is",
"None",
":",
"raise",
... | Create a WSDL type by name.
@param name: The name of a type defined in the WSDL.
@type name: str
@return: The requested object.
@rtype: L{Object} | [
"Create",
"a",
"WSDL",
"type",
"by",
"name",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L220-L247 |
suds-community/suds | suds/client.py | ServiceSelector.__find | def __find(self, name):
"""
Find a I{service} by name (string) or index (integer).
@param name: The name (or index) of a service.
@type name: int|str
@return: A L{PortSelector} for the found service.
@rtype: L{PortSelector}.
"""
service = None
if... | python | def __find(self, name):
"""
Find a I{service} by name (string) or index (integer).
@param name: The name (or index) of a service.
@type name: int|str
@return: A L{PortSelector} for the found service.
@rtype: L{PortSelector}.
"""
service = None
if... | [
"def",
"__find",
"(",
"self",
",",
"name",
")",
":",
"service",
"=",
"None",
"if",
"not",
"self",
".",
"__services",
":",
"raise",
"Exception",
",",
"\"No services defined\"",
"if",
"isinstance",
"(",
"name",
",",
"int",
")",
":",
"try",
":",
"service",
... | Find a I{service} by name (string) or index (integer).
@param name: The name (or index) of a service.
@type name: int|str
@return: A L{PortSelector} for the found service.
@rtype: L{PortSelector}. | [
"Find",
"a",
"I",
"{",
"service",
"}",
"by",
"name",
"(",
"string",
")",
"or",
"index",
"(",
"integer",
")",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L331-L357 |
suds-community/suds | suds/client.py | ServiceSelector.__ds | def __ds(self):
"""
Get the I{default} service if defined in the I{options}.
@return: A L{PortSelector} for the I{default} service.
@rtype: L{PortSelector}.
"""
ds = self.__client.options.service
if ds is not None:
return self.__find(ds) | python | def __ds(self):
"""
Get the I{default} service if defined in the I{options}.
@return: A L{PortSelector} for the I{default} service.
@rtype: L{PortSelector}.
"""
ds = self.__client.options.service
if ds is not None:
return self.__find(ds) | [
"def",
"__ds",
"(",
"self",
")",
":",
"ds",
"=",
"self",
".",
"__client",
".",
"options",
".",
"service",
"if",
"ds",
"is",
"not",
"None",
":",
"return",
"self",
".",
"__find",
"(",
"ds",
")"
] | Get the I{default} service if defined in the I{options}.
@return: A L{PortSelector} for the I{default} service.
@rtype: L{PortSelector}. | [
"Get",
"the",
"I",
"{",
"default",
"}",
"service",
"if",
"defined",
"in",
"the",
"I",
"{",
"options",
"}",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L359-L369 |
suds-community/suds | suds/client.py | RequestContext.process_reply | def process_reply(self, reply, status=None, description=None):
"""
Re-entry for processing a successful reply.
Depending on how the ``retxml`` option is set, may return the SOAP
reply XML or process it and return the Python object representing the
returned value.
@param... | python | def process_reply(self, reply, status=None, description=None):
"""
Re-entry for processing a successful reply.
Depending on how the ``retxml`` option is set, may return the SOAP
reply XML or process it and return the Python object representing the
returned value.
@param... | [
"def",
"process_reply",
"(",
"self",
",",
"reply",
",",
"status",
"=",
"None",
",",
"description",
"=",
"None",
")",
":",
"return",
"self",
".",
"__process_reply",
"(",
"reply",
",",
"status",
",",
"description",
")"
] | Re-entry for processing a successful reply.
Depending on how the ``retxml`` option is set, may return the SOAP
reply XML or process it and return the Python object representing the
returned value.
@param reply: The SOAP reply envelope.
@type reply: I{bytes}
@param statu... | [
"Re",
"-",
"entry",
"for",
"processing",
"a",
"successful",
"reply",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L607-L625 |
suds-community/suds | suds/client.py | _SoapClient.send | def send(self, soapenv):
"""
Send SOAP message.
Depending on how the ``nosend`` & ``retxml`` options are set, may do
one of the following:
* Return a constructed web service operation request without sending
it to the web service.
* Invoke the web service... | python | def send(self, soapenv):
"""
Send SOAP message.
Depending on how the ``nosend`` & ``retxml`` options are set, may do
one of the following:
* Return a constructed web service operation request without sending
it to the web service.
* Invoke the web service... | [
"def",
"send",
"(",
"self",
",",
"soapenv",
")",
":",
"location",
"=",
"self",
".",
"__location",
"(",
")",
"log",
".",
"debug",
"(",
"\"sending to (%s)\\nmessage:\\n%s\"",
",",
"location",
",",
"soapenv",
")",
"plugins",
"=",
"PluginContainer",
"(",
"self",... | Send SOAP message.
Depending on how the ``nosend`` & ``retxml`` options are set, may do
one of the following:
* Return a constructed web service operation request without sending
it to the web service.
* Invoke the web service operation and return its SOAP reply XML.
... | [
"Send",
"SOAP",
"message",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L710-L753 |
suds-community/suds | suds/client.py | _SoapClient.process_reply | def process_reply(self, reply, status, description):
"""
Process a web service operation SOAP reply.
Depending on how the ``retxml`` option is set, may return the SOAP
reply XML or process it and return the Python object representing the
returned value.
@param reply: Th... | python | def process_reply(self, reply, status, description):
"""
Process a web service operation SOAP reply.
Depending on how the ``retxml`` option is set, may return the SOAP
reply XML or process it and return the Python object representing the
returned value.
@param reply: Th... | [
"def",
"process_reply",
"(",
"self",
",",
"reply",
",",
"status",
",",
"description",
")",
":",
"if",
"status",
"is",
"None",
":",
"status",
"=",
"httplib",
".",
"OK",
"debug_message",
"=",
"\"Reply HTTP status - %d\"",
"%",
"(",
"status",
",",
")",
"if",
... | Process a web service operation SOAP reply.
Depending on how the ``retxml`` option is set, may return the SOAP
reply XML or process it and return the Python object representing the
returned value.
@param reply: The SOAP reply envelope.
@type reply: I{bytes}
@param statu... | [
"Process",
"a",
"web",
"service",
"operation",
"SOAP",
"reply",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L755-L831 |
suds-community/suds | suds/client.py | _SoapClient.__get_fault | def __get_fault(self, replyroot):
"""
Extract fault information from a SOAP reply.
Returns an I{unmarshalled} fault L{Object} or None in case the given
XML document does not contain a SOAP <Fault> element.
@param replyroot: A SOAP reply message root XML element or None.
... | python | def __get_fault(self, replyroot):
"""
Extract fault information from a SOAP reply.
Returns an I{unmarshalled} fault L{Object} or None in case the given
XML document does not contain a SOAP <Fault> element.
@param replyroot: A SOAP reply message root XML element or None.
... | [
"def",
"__get_fault",
"(",
"self",
",",
"replyroot",
")",
":",
"envns",
"=",
"suds",
".",
"bindings",
".",
"binding",
".",
"envns",
"soapenv",
"=",
"replyroot",
"and",
"replyroot",
".",
"getChild",
"(",
"\"Envelope\"",
",",
"envns",
")",
"soapbody",
"=",
... | Extract fault information from a SOAP reply.
Returns an I{unmarshalled} fault L{Object} or None in case the given
XML document does not contain a SOAP <Fault> element.
@param replyroot: A SOAP reply message root XML element or None.
@type replyroot: L{Element}|I{None}
@return: ... | [
"Extract",
"fault",
"information",
"from",
"a",
"SOAP",
"reply",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L833-L850 |
suds-community/suds | suds/client.py | _SoapClient.__headers | def __headers(self):
"""
Get HTTP headers for a HTTP/HTTPS SOAP request.
@return: A dictionary of header/values.
@rtype: dict
"""
action = self.method.soap.action
if isinstance(action, unicode):
action = action.encode("utf-8")
result = {
... | python | def __headers(self):
"""
Get HTTP headers for a HTTP/HTTPS SOAP request.
@return: A dictionary of header/values.
@rtype: dict
"""
action = self.method.soap.action
if isinstance(action, unicode):
action = action.encode("utf-8")
result = {
... | [
"def",
"__headers",
"(",
"self",
")",
":",
"action",
"=",
"self",
".",
"method",
".",
"soap",
".",
"action",
"if",
"isinstance",
"(",
"action",
",",
"unicode",
")",
":",
"action",
"=",
"action",
".",
"encode",
"(",
"\"utf-8\"",
")",
"result",
"=",
"{... | Get HTTP headers for a HTTP/HTTPS SOAP request.
@return: A dictionary of header/values.
@rtype: dict | [
"Get",
"HTTP",
"headers",
"for",
"a",
"HTTP",
"/",
"HTTPS",
"SOAP",
"request",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L852-L868 |
suds-community/suds | suds/client.py | _SimClient.invoke | def invoke(self, args, kwargs):
"""
Invoke a specified web service method.
Uses an injected SOAP request/response instead of a regularly
constructed/received one.
Depending on how the ``nosend`` & ``retxml`` options are set, may do
one of the following:
* Retu... | python | def invoke(self, args, kwargs):
"""
Invoke a specified web service method.
Uses an injected SOAP request/response instead of a regularly
constructed/received one.
Depending on how the ``nosend`` & ``retxml`` options are set, may do
one of the following:
* Retu... | [
"def",
"invoke",
"(",
"self",
",",
"args",
",",
"kwargs",
")",
":",
"simulation",
"=",
"kwargs",
".",
"pop",
"(",
"self",
".",
"__injkey",
")",
"msg",
"=",
"simulation",
".",
"get",
"(",
"\"msg\"",
")",
"if",
"msg",
"is",
"not",
"None",
":",
"asser... | Invoke a specified web service method.
Uses an injected SOAP request/response instead of a regularly
constructed/received one.
Depending on how the ``nosend`` & ``retxml`` options are set, may do
one of the following:
* Return a constructed web service operation request witho... | [
"Invoke",
"a",
"specified",
"web",
"service",
"method",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/client.py#L891-L930 |
suds-community/suds | suds/transport/__init__.py | Request.__set_URL | def __set_URL(self, url):
"""
URL is stored as a str internally and must not contain ASCII chars.
Raised exception in case of detected non-ASCII URL characters may be
either UnicodeEncodeError or UnicodeDecodeError, depending on the used
Python version's str type and the exact v... | python | def __set_URL(self, url):
"""
URL is stored as a str internally and must not contain ASCII chars.
Raised exception in case of detected non-ASCII URL characters may be
either UnicodeEncodeError or UnicodeDecodeError, depending on the used
Python version's str type and the exact v... | [
"def",
"__set_URL",
"(",
"self",
",",
"url",
")",
":",
"if",
"isinstance",
"(",
"url",
",",
"str",
")",
":",
"url",
".",
"encode",
"(",
"\"ascii\"",
")",
"# Check for non-ASCII characters.",
"self",
".",
"url",
"=",
"url",
"elif",
"sys",
".",
"version_in... | URL is stored as a str internally and must not contain ASCII chars.
Raised exception in case of detected non-ASCII URL characters may be
either UnicodeEncodeError or UnicodeDecodeError, depending on the used
Python version's str type and the exact value passed as URL input data. | [
"URL",
"is",
"stored",
"as",
"a",
"str",
"internally",
"and",
"must",
"not",
"contain",
"ASCII",
"chars",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/transport/__init__.py#L75-L90 |
suds-community/suds | suds/mx/appender.py | ContentAppender.append | def append(self, parent, content):
"""
Select an appender and append the content to parent.
@param parent: A parent node.
@type parent: L{Element}
@param content: The content to append.
@type content: L{Content}
"""
appender = self.default
for matc... | python | def append(self, parent, content):
"""
Select an appender and append the content to parent.
@param parent: A parent node.
@type parent: L{Element}
@param content: The content to append.
@type content: L{Content}
"""
appender = self.default
for matc... | [
"def",
"append",
"(",
"self",
",",
"parent",
",",
"content",
")",
":",
"appender",
"=",
"self",
".",
"default",
"for",
"matcher",
",",
"candidate_appender",
"in",
"self",
".",
"appenders",
":",
"if",
"matcher",
"==",
"content",
".",
"value",
":",
"append... | Select an appender and append the content to parent.
@param parent: A parent node.
@type parent: L{Element}
@param content: The content to append.
@type content: L{Content} | [
"Select",
"an",
"appender",
"and",
"append",
"the",
"content",
"to",
"parent",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/mx/appender.py#L73-L86 |
suds-community/suds | suds/resolver.py | PathResolver.root | def root(self, parts):
"""
Find the path root.
@param parts: A list of path parts.
@type parts: [str,..]
@return: The root.
@rtype: L{xsd.sxbase.SchemaObject}
"""
result = None
name = parts[0]
log.debug('searching schema for (%s)', name)
... | python | def root(self, parts):
"""
Find the path root.
@param parts: A list of path parts.
@type parts: [str,..]
@return: The root.
@rtype: L{xsd.sxbase.SchemaObject}
"""
result = None
name = parts[0]
log.debug('searching schema for (%s)', name)
... | [
"def",
"root",
"(",
"self",
",",
"parts",
")",
":",
"result",
"=",
"None",
"name",
"=",
"parts",
"[",
"0",
"]",
"log",
".",
"debug",
"(",
"'searching schema for (%s)'",
",",
"name",
")",
"qref",
"=",
"self",
".",
"qualify",
"(",
"parts",
"[",
"0",
... | Find the path root.
@param parts: A list of path parts.
@type parts: [str,..]
@return: The root.
@rtype: L{xsd.sxbase.SchemaObject} | [
"Find",
"the",
"path",
"root",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/resolver.py#L119-L137 |
suds-community/suds | suds/resolver.py | PathResolver.branch | def branch(self, root, parts):
"""
Traverse the path until a leaf is reached.
@param parts: A list of path parts.
@type parts: [str,..]
@param root: The root.
@type root: L{xsd.sxbase.SchemaObject}
@return: The end of the branch.
@rtype: L{xsd.sxbase.Schem... | python | def branch(self, root, parts):
"""
Traverse the path until a leaf is reached.
@param parts: A list of path parts.
@type parts: [str,..]
@param root: The root.
@type root: L{xsd.sxbase.SchemaObject}
@return: The end of the branch.
@rtype: L{xsd.sxbase.Schem... | [
"def",
"branch",
"(",
"self",
",",
"root",
",",
"parts",
")",
":",
"result",
"=",
"root",
"for",
"part",
"in",
"parts",
"[",
"1",
":",
"-",
"1",
"]",
":",
"name",
"=",
"splitPrefix",
"(",
"part",
")",
"[",
"1",
"]",
"log",
".",
"debug",
"(",
... | Traverse the path until a leaf is reached.
@param parts: A list of path parts.
@type parts: [str,..]
@param root: The root.
@type root: L{xsd.sxbase.SchemaObject}
@return: The end of the branch.
@rtype: L{xsd.sxbase.SchemaObject} | [
"Traverse",
"the",
"path",
"until",
"a",
"leaf",
"is",
"reached",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/resolver.py#L139-L159 |
suds-community/suds | suds/resolver.py | TreeResolver.getchild | def getchild(self, name, parent):
"""Get a child by name."""
log.debug('searching parent (%s) for (%s)', Repr(parent), name)
if name.startswith('@'):
return parent.get_attribute(name[1:])
return parent.get_child(name) | python | def getchild(self, name, parent):
"""Get a child by name."""
log.debug('searching parent (%s) for (%s)', Repr(parent), name)
if name.startswith('@'):
return parent.get_attribute(name[1:])
return parent.get_child(name) | [
"def",
"getchild",
"(",
"self",
",",
"name",
",",
"parent",
")",
":",
"log",
".",
"debug",
"(",
"'searching parent (%s) for (%s)'",
",",
"Repr",
"(",
"parent",
")",
",",
"name",
")",
"if",
"name",
".",
"startswith",
"(",
"'@'",
")",
":",
"return",
"par... | Get a child by name. | [
"Get",
"a",
"child",
"by",
"name",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/resolver.py#L292-L297 |
suds-community/suds | tools/suds_devel/zip.py | _Archiver.__path_prefix | def __path_prefix(self, folder):
"""
Path prefix to be used when archiving any items from the given folder.
Expects the folder to be located under the base folder path and the
returned path prefix does not include the base folder information. This
makes sure we include jus... | python | def __path_prefix(self, folder):
"""
Path prefix to be used when archiving any items from the given folder.
Expects the folder to be located under the base folder path and the
returned path prefix does not include the base folder information. This
makes sure we include jus... | [
"def",
"__path_prefix",
"(",
"self",
",",
"folder",
")",
":",
"path_parts",
"=",
"path_iter",
"(",
"folder",
")",
"_skip_expected",
"(",
"path_parts",
",",
"self",
".",
"__base_folder_parts",
")",
"result",
"=",
"\"/\"",
".",
"join",
"(",
"path_parts",
")",
... | Path prefix to be used when archiving any items from the given folder.
Expects the folder to be located under the base folder path and the
returned path prefix does not include the base folder information. This
makes sure we include just the base folder's content in the archive,
an... | [
"Path",
"prefix",
"to",
"be",
"used",
"when",
"archiving",
"any",
"items",
"from",
"the",
"given",
"folder",
".",
"Expects",
"the",
"folder",
"to",
"be",
"located",
"under",
"the",
"base",
"folder",
"path",
"and",
"the",
"returned",
"path",
"prefix",
"does... | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/zip.py#L67-L82 |
suds-community/suds | suds/xsd/sxbuiltin.py | XDecimal._decimal_to_xsd_format | def _decimal_to_xsd_format(value):
"""
Converts a decimal.Decimal value to its XSD decimal type value.
Result is a string containing the XSD decimal type's lexical value
representation. The conversion is done without any precision loss.
Note that Python's native decimal.Decimal... | python | def _decimal_to_xsd_format(value):
"""
Converts a decimal.Decimal value to its XSD decimal type value.
Result is a string containing the XSD decimal type's lexical value
representation. The conversion is done without any precision loss.
Note that Python's native decimal.Decimal... | [
"def",
"_decimal_to_xsd_format",
"(",
"value",
")",
":",
"value",
"=",
"XDecimal",
".",
"_decimal_canonical",
"(",
"value",
")",
"negative",
",",
"digits",
",",
"exponent",
"=",
"value",
".",
"as_tuple",
"(",
")",
"# The following implementation assumes the followin... | Converts a decimal.Decimal value to its XSD decimal type value.
Result is a string containing the XSD decimal type's lexical value
representation. The conversion is done without any precision loss.
Note that Python's native decimal.Decimal string representation will
not do here as the ... | [
"Converts",
"a",
"decimal",
".",
"Decimal",
"value",
"to",
"its",
"XSD",
"decimal",
"type",
"value",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/xsd/sxbuiltin.py#L129-L192 |
suds-community/suds | suds/xsd/sxbuiltin.py | Factory.create | def create(cls, schema, name):
"""
Create an object based on the root tag name.
@param schema: A schema object.
@type schema: L{schema.Schema}
@param name: The name.
@type name: str
@return: The created object.
@rtype: L{XBuiltin}
"""
fn ... | python | def create(cls, schema, name):
"""
Create an object based on the root tag name.
@param schema: A schema object.
@type schema: L{schema.Schema}
@param name: The name.
@type name: str
@return: The created object.
@rtype: L{XBuiltin}
"""
fn ... | [
"def",
"create",
"(",
"cls",
",",
"schema",
",",
"name",
")",
":",
"fn",
"=",
"cls",
".",
"tags",
".",
"get",
"(",
"name",
",",
"XBuiltin",
")",
"return",
"fn",
"(",
"schema",
",",
"name",
")"
] | Create an object based on the root tag name.
@param schema: A schema object.
@type schema: L{schema.Schema}
@param name: The name.
@type name: str
@return: The created object.
@rtype: L{XBuiltin} | [
"Create",
"an",
"object",
"based",
"on",
"the",
"root",
"tag",
"name",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/xsd/sxbuiltin.py#L334-L347 |
suds-community/suds | tools/setup_base_environments.py | _avoid_setuptools_zipped_egg_upgrade_issue | def _avoid_setuptools_zipped_egg_upgrade_issue(env, ez_setup):
"""
Avoid the setuptools self-upgrade issue.
setuptools versions prior to version 3.5.2 have a bug that can cause their
upgrade installations to fail when installing a new zipped egg distribution
over an existing zipped egg setupt... | python | def _avoid_setuptools_zipped_egg_upgrade_issue(env, ez_setup):
"""
Avoid the setuptools self-upgrade issue.
setuptools versions prior to version 3.5.2 have a bug that can cause their
upgrade installations to fail when installing a new zipped egg distribution
over an existing zipped egg setupt... | [
"def",
"_avoid_setuptools_zipped_egg_upgrade_issue",
"(",
"env",
",",
"ez_setup",
")",
":",
"if",
"env",
".",
"sys_version_info",
"[",
":",
"2",
"]",
"!=",
"(",
"2",
",",
"5",
")",
":",
"return",
"# only Python 2.5.x affected by this\r",
"if",
"not",
"env",
".... | Avoid the setuptools self-upgrade issue.
setuptools versions prior to version 3.5.2 have a bug that can cause their
upgrade installations to fail when installing a new zipped egg distribution
over an existing zipped egg setuptools distribution with the same name.
The following Python versions ar... | [
"Avoid",
"the",
"setuptools",
"self",
"-",
"upgrade",
"issue",
".",
"setuptools",
"versions",
"prior",
"to",
"version",
"3",
".",
"5",
".",
"2",
"have",
"a",
"bug",
"that",
"can",
"cause",
"their",
"upgrade",
"installations",
"to",
"fail",
"when",
"install... | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/setup_base_environments.py#L494-L531 |
suds-community/suds | tools/setup_base_environments.py | _reuse_pre_installed_setuptools | def _reuse_pre_installed_setuptools(env, installer):
"""
Return whether a pre-installed setuptools distribution should be reused.
"""
if not env.setuptools_version:
return # no prior setuptools ==> no reuse
reuse_old = config.reuse_old_setuptools
reuse_best = config.reuse_best_... | python | def _reuse_pre_installed_setuptools(env, installer):
"""
Return whether a pre-installed setuptools distribution should be reused.
"""
if not env.setuptools_version:
return # no prior setuptools ==> no reuse
reuse_old = config.reuse_old_setuptools
reuse_best = config.reuse_best_... | [
"def",
"_reuse_pre_installed_setuptools",
"(",
"env",
",",
"installer",
")",
":",
"if",
"not",
"env",
".",
"setuptools_version",
":",
"return",
"# no prior setuptools ==> no reuse\r",
"reuse_old",
"=",
"config",
".",
"reuse_old_setuptools",
"reuse_best",
"=",
"config",
... | Return whether a pre-installed setuptools distribution should be reused. | [
"Return",
"whether",
"a",
"pre",
"-",
"installed",
"setuptools",
"distribution",
"should",
"be",
"reused",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/setup_base_environments.py#L534-L564 |
suds-community/suds | tools/setup_base_environments.py | download_pip | def download_pip(env, requirements):
"""Download pip and its requirements using setuptools."""
if config.installation_cache_folder() is None:
raise EnvironmentSetupError("Local installation cache folder not "
"defined but required for downloading a pip installation.")
# Installation... | python | def download_pip(env, requirements):
"""Download pip and its requirements using setuptools."""
if config.installation_cache_folder() is None:
raise EnvironmentSetupError("Local installation cache folder not "
"defined but required for downloading a pip installation.")
# Installation... | [
"def",
"download_pip",
"(",
"env",
",",
"requirements",
")",
":",
"if",
"config",
".",
"installation_cache_folder",
"(",
")",
"is",
"None",
":",
"raise",
"EnvironmentSetupError",
"(",
"\"Local installation cache folder not \"",
"\"defined but required for downloading a pip ... | Download pip and its requirements using setuptools. | [
"Download",
"pip",
"and",
"its",
"requirements",
"using",
"setuptools",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/setup_base_environments.py#L596-L613 |
suds-community/suds | tools/setup_base_environments.py | setuptools_install_options | def setuptools_install_options(local_storage_folder):
"""
Return options to make setuptools use installations from the given folder.
No other installation source is allowed.
"""
if local_storage_folder is None:
return []
# setuptools expects its find-links parameter to contain... | python | def setuptools_install_options(local_storage_folder):
"""
Return options to make setuptools use installations from the given folder.
No other installation source is allowed.
"""
if local_storage_folder is None:
return []
# setuptools expects its find-links parameter to contain... | [
"def",
"setuptools_install_options",
"(",
"local_storage_folder",
")",
":",
"if",
"local_storage_folder",
"is",
"None",
":",
"return",
"[",
"]",
"# setuptools expects its find-links parameter to contain a list of link\r",
"# sources (either local paths, file: URLs pointing to folders o... | Return options to make setuptools use installations from the given folder.
No other installation source is allowed. | [
"Return",
"options",
"to",
"make",
"setuptools",
"use",
"installations",
"from",
"the",
"given",
"folder",
".",
"No",
"other",
"installation",
"source",
"is",
"allowed",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/setup_base_environments.py#L616-L668 |
suds-community/suds | tools/setup_base_environments.py | install_pip | def install_pip(env, requirements):
"""Install pip and its requirements using setuptools."""
try:
installation_source_folder = config.installation_cache_folder()
options = setuptools_install_options(installation_source_folder)
if installation_source_folder is not None:
... | python | def install_pip(env, requirements):
"""Install pip and its requirements using setuptools."""
try:
installation_source_folder = config.installation_cache_folder()
options = setuptools_install_options(installation_source_folder)
if installation_source_folder is not None:
... | [
"def",
"install_pip",
"(",
"env",
",",
"requirements",
")",
":",
"try",
":",
"installation_source_folder",
"=",
"config",
".",
"installation_cache_folder",
"(",
")",
"options",
"=",
"setuptools_install_options",
"(",
"installation_source_folder",
")",
"if",
"installat... | Install pip and its requirements using setuptools. | [
"Install",
"pip",
"and",
"its",
"requirements",
"using",
"setuptools",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/setup_base_environments.py#L671-L682 |
suds-community/suds | tools/setup_base_environments.py | prepare_pip_requirements_file_if_needed | def prepare_pip_requirements_file_if_needed(requirements):
"""
Make requirements be passed to pip via a requirements file if needed.
We must be careful about how we pass shell operator characters (e.g. '<',
'>', '|' or '^') included in our command-line arguments or they might cause
problems i... | python | def prepare_pip_requirements_file_if_needed(requirements):
"""
Make requirements be passed to pip via a requirements file if needed.
We must be careful about how we pass shell operator characters (e.g. '<',
'>', '|' or '^') included in our command-line arguments or they might cause
problems i... | [
"def",
"prepare_pip_requirements_file_if_needed",
"(",
"requirements",
")",
":",
"if",
"utility",
".",
"any_contains_any",
"(",
"requirements",
",",
"\"<>|()&^\"",
")",
":",
"file_path",
",",
"janitor",
"=",
"pip_requirements_file",
"(",
"requirements",
")",
"requirem... | Make requirements be passed to pip via a requirements file if needed.
We must be careful about how we pass shell operator characters (e.g. '<',
'>', '|' or '^') included in our command-line arguments or they might cause
problems if run through an intermediate shell interpreter. If our pip
requirem... | [
"Make",
"requirements",
"be",
"passed",
"to",
"pip",
"via",
"a",
"requirements",
"file",
"if",
"needed",
".",
"We",
"must",
"be",
"careful",
"about",
"how",
"we",
"pass",
"shell",
"operator",
"characters",
"(",
"e",
".",
"g",
".",
"<",
">",
"|",
"or",
... | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/setup_base_environments.py#L743-L760 |
suds-community/suds | tools/setup_base_environments.py | download_pip_based_installations | def download_pip_based_installations(env, pip_invocation, requirements,
download_cache_folder):
"""Download requirements for pip based installation."""
if config.installation_cache_folder() is None:
raise EnvironmentSetupError("Local installation cache folder not "
"defined but ... | python | def download_pip_based_installations(env, pip_invocation, requirements,
download_cache_folder):
"""Download requirements for pip based installation."""
if config.installation_cache_folder() is None:
raise EnvironmentSetupError("Local installation cache folder not "
"defined but ... | [
"def",
"download_pip_based_installations",
"(",
"env",
",",
"pip_invocation",
",",
"requirements",
",",
"download_cache_folder",
")",
":",
"if",
"config",
".",
"installation_cache_folder",
"(",
")",
"is",
"None",
":",
"raise",
"EnvironmentSetupError",
"(",
"\"Local in... | Download requirements for pip based installation. | [
"Download",
"requirements",
"for",
"pip",
"based",
"installation",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/setup_base_environments.py#L778-L821 |
suds-community/suds | tools/setup_base_environments.py | enabled_actions_for_env | def enabled_actions_for_env(env):
"""Returns actions to perform when processing the given environment."""
def enabled(config_value, required):
if config_value is Config.TriBool.No:
return False
if config_value is Config.TriBool.Yes:
return True
assert confi... | python | def enabled_actions_for_env(env):
"""Returns actions to perform when processing the given environment."""
def enabled(config_value, required):
if config_value is Config.TriBool.No:
return False
if config_value is Config.TriBool.Yes:
return True
assert confi... | [
"def",
"enabled_actions_for_env",
"(",
"env",
")",
":",
"def",
"enabled",
"(",
"config_value",
",",
"required",
")",
":",
"if",
"config_value",
"is",
"Config",
".",
"TriBool",
".",
"No",
":",
"return",
"False",
"if",
"config_value",
"is",
"Config",
".",
"T... | Returns actions to perform when processing the given environment. | [
"Returns",
"actions",
"to",
"perform",
"when",
"processing",
"the",
"given",
"environment",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/setup_base_environments.py#L891-L936 |
suds-community/suds | tools/setup_base_environments.py | _ez_setup_script.__setuptools_version | def __setuptools_version(self):
"""Read setuptools version from the underlying ez_setup script."""
# Read the script directly as a file instead of importing it as a
# Python module and reading the value from the loaded module's global
# DEFAULT_VERSION variable. Not all ez_setup scri... | python | def __setuptools_version(self):
"""Read setuptools version from the underlying ez_setup script."""
# Read the script directly as a file instead of importing it as a
# Python module and reading the value from the loaded module's global
# DEFAULT_VERSION variable. Not all ez_setup scri... | [
"def",
"__setuptools_version",
"(",
"self",
")",
":",
"# Read the script directly as a file instead of importing it as a\r",
"# Python module and reading the value from the loaded module's global\r",
"# DEFAULT_VERSION variable. Not all ez_setup scripts are compatible\r",
"# with all Python enviro... | Read setuptools version from the underlying ez_setup script. | [
"Read",
"setuptools",
"version",
"from",
"the",
"underlying",
"ez_setup",
"script",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/setup_base_environments.py#L471-L491 |
suds-community/suds | suds/sax/element.py | Element.rename | def rename(self, name):
"""
Rename the element.
@param name: A new name for the element.
@type name: basestring
"""
if name is None:
raise Exception("name (%s) not-valid" % (name,))
self.prefix, self.name = splitPrefix(name) | python | def rename(self, name):
"""
Rename the element.
@param name: A new name for the element.
@type name: basestring
"""
if name is None:
raise Exception("name (%s) not-valid" % (name,))
self.prefix, self.name = splitPrefix(name) | [
"def",
"rename",
"(",
"self",
",",
"name",
")",
":",
"if",
"name",
"is",
"None",
":",
"raise",
"Exception",
"(",
"\"name (%s) not-valid\"",
"%",
"(",
"name",
",",
")",
")",
"self",
".",
"prefix",
",",
"self",
".",
"name",
"=",
"splitPrefix",
"(",
"na... | Rename the element.
@param name: A new name for the element.
@type name: basestring | [
"Rename",
"the",
"element",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L104-L114 |
suds-community/suds | suds/sax/element.py | Element.clone | def clone(self, parent=None):
"""
Deep clone of this element and children.
@param parent: An optional parent for the copied fragment.
@type parent: I{Element}
@return: A deep copy parented by I{parent}
@rtype: I{Element}
"""
root = Element(self.qname(), ... | python | def clone(self, parent=None):
"""
Deep clone of this element and children.
@param parent: An optional parent for the copied fragment.
@type parent: I{Element}
@return: A deep copy parented by I{parent}
@rtype: I{Element}
"""
root = Element(self.qname(), ... | [
"def",
"clone",
"(",
"self",
",",
"parent",
"=",
"None",
")",
":",
"root",
"=",
"Element",
"(",
"self",
".",
"qname",
"(",
")",
",",
"parent",
",",
"self",
".",
"namespace",
"(",
")",
")",
"for",
"a",
"in",
"self",
".",
"attributes",
":",
"root",... | Deep clone of this element and children.
@param parent: An optional parent for the copied fragment.
@type parent: I{Element}
@return: A deep copy parented by I{parent}
@rtype: I{Element} | [
"Deep",
"clone",
"of",
"this",
"element",
"and",
"children",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L158-L175 |
suds-community/suds | suds/sax/element.py | Element.unset | def unset(self, name):
"""
Unset (remove) an attribute.
@param name: The attribute name.
@type name: str
@return: self
@rtype: L{Element}
"""
try:
attr = self.getAttribute(name)
self.attributes.remove(attr)
except Exceptio... | python | def unset(self, name):
"""
Unset (remove) an attribute.
@param name: The attribute name.
@type name: str
@return: self
@rtype: L{Element}
"""
try:
attr = self.getAttribute(name)
self.attributes.remove(attr)
except Exceptio... | [
"def",
"unset",
"(",
"self",
",",
"name",
")",
":",
"try",
":",
"attr",
"=",
"self",
".",
"getAttribute",
"(",
"name",
")",
"self",
".",
"attributes",
".",
"remove",
"(",
"attr",
")",
"except",
"Exception",
":",
"pass",
"return",
"self"
] | Unset (remove) an attribute.
@param name: The attribute name.
@type name: str
@return: self
@rtype: L{Element} | [
"Unset",
"(",
"remove",
")",
"an",
"attribute",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L210-L225 |
suds-community/suds | suds/sax/element.py | Element.get | def get(self, name, ns=None, default=None):
"""
Get the value of an attribute by name.
@param name: The name of the attribute.
@type name: basestring
@param ns: The optional attribute's namespace.
@type ns: (I{prefix}, I{name})
@param default: An optional value t... | python | def get(self, name, ns=None, default=None):
"""
Get the value of an attribute by name.
@param name: The name of the attribute.
@type name: basestring
@param ns: The optional attribute's namespace.
@type ns: (I{prefix}, I{name})
@param default: An optional value t... | [
"def",
"get",
"(",
"self",
",",
"name",
",",
"ns",
"=",
"None",
",",
"default",
"=",
"None",
")",
":",
"attr",
"=",
"self",
".",
"getAttribute",
"(",
"name",
",",
"ns",
")",
"if",
"attr",
"is",
"None",
"or",
"attr",
".",
"value",
"is",
"None",
... | Get the value of an attribute by name.
@param name: The name of the attribute.
@type name: basestring
@param ns: The optional attribute's namespace.
@type ns: (I{prefix}, I{name})
@param default: An optional value to be returned when either the
attribute does not exi... | [
"Get",
"the",
"value",
"of",
"an",
"attribute",
"by",
"name",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L227-L246 |
suds-community/suds | suds/sax/element.py | Element.namespace | def namespace(self):
"""
Get the element's namespace.
@return: The element's namespace by resolving the prefix, the explicit
namespace or the inherited namespace.
@rtype: (I{prefix}, I{name})
"""
if self.prefix is None:
return self.defaultNamespa... | python | def namespace(self):
"""
Get the element's namespace.
@return: The element's namespace by resolving the prefix, the explicit
namespace or the inherited namespace.
@rtype: (I{prefix}, I{name})
"""
if self.prefix is None:
return self.defaultNamespa... | [
"def",
"namespace",
"(",
"self",
")",
":",
"if",
"self",
".",
"prefix",
"is",
"None",
":",
"return",
"self",
".",
"defaultNamespace",
"(",
")",
"return",
"self",
".",
"resolvePrefix",
"(",
"self",
".",
"prefix",
")"
] | Get the element's namespace.
@return: The element's namespace by resolving the prefix, the explicit
namespace or the inherited namespace.
@rtype: (I{prefix}, I{name}) | [
"Get",
"the",
"element",
"s",
"namespace",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L299-L310 |
suds-community/suds | suds/sax/element.py | Element.defaultNamespace | def defaultNamespace(self):
"""
Get the default (unqualified namespace).
This is the expns of the first node (looking up the tree) that has it
set.
@return: The namespace of a node when not qualified.
@rtype: (I{prefix}, I{name})
"""
p = self
wh... | python | def defaultNamespace(self):
"""
Get the default (unqualified namespace).
This is the expns of the first node (looking up the tree) that has it
set.
@return: The namespace of a node when not qualified.
@rtype: (I{prefix}, I{name})
"""
p = self
wh... | [
"def",
"defaultNamespace",
"(",
"self",
")",
":",
"p",
"=",
"self",
"while",
"p",
"is",
"not",
"None",
":",
"if",
"p",
".",
"expns",
"is",
"not",
"None",
":",
"return",
"None",
",",
"p",
".",
"expns",
"p",
"=",
"p",
".",
"parent",
"return",
"Name... | Get the default (unqualified namespace).
This is the expns of the first node (looking up the tree) that has it
set.
@return: The namespace of a node when not qualified.
@rtype: (I{prefix}, I{name}) | [
"Get",
"the",
"default",
"(",
"unqualified",
"namespace",
")",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L312-L328 |
suds-community/suds | suds/sax/element.py | Element.append | def append(self, objects):
"""
Append the specified child based on whether it is an element or an
attribute.
@param objects: A (single|collection) of attribute(s) or element(s) to
be added as children.
@type objects: (L{Element}|L{Attribute})
@return: self
... | python | def append(self, objects):
"""
Append the specified child based on whether it is an element or an
attribute.
@param objects: A (single|collection) of attribute(s) or element(s) to
be added as children.
@type objects: (L{Element}|L{Attribute})
@return: self
... | [
"def",
"append",
"(",
"self",
",",
"objects",
")",
":",
"if",
"not",
"isinstance",
"(",
"objects",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"objects",
"=",
"(",
"objects",
",",
")",
"for",
"child",
"in",
"objects",
":",
"if",
"isinstance",
"(... | Append the specified child based on whether it is an element or an
attribute.
@param objects: A (single|collection) of attribute(s) or element(s) to
be added as children.
@type objects: (L{Element}|L{Attribute})
@return: self
@rtype: L{Element} | [
"Append",
"the",
"specified",
"child",
"based",
"on",
"whether",
"it",
"is",
"an",
"element",
"or",
"an",
"attribute",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L330-L355 |
suds-community/suds | suds/sax/element.py | Element.insert | def insert(self, objects, index=0):
"""
Insert an L{Element} content at the specified index.
@param objects: A (single|collection) of attribute(s) or element(s) to
be added as children.
@type objects: (L{Element}|L{Attribute})
@param index: The position in the list o... | python | def insert(self, objects, index=0):
"""
Insert an L{Element} content at the specified index.
@param objects: A (single|collection) of attribute(s) or element(s) to
be added as children.
@type objects: (L{Element}|L{Attribute})
@param index: The position in the list o... | [
"def",
"insert",
"(",
"self",
",",
"objects",
",",
"index",
"=",
"0",
")",
":",
"objects",
"=",
"(",
"objects",
",",
")",
"for",
"child",
"in",
"objects",
":",
"if",
"not",
"isinstance",
"(",
"child",
",",
"Element",
")",
":",
"raise",
"Exception",
... | Insert an L{Element} content at the specified index.
@param objects: A (single|collection) of attribute(s) or element(s) to
be added as children.
@type objects: (L{Element}|L{Attribute})
@param index: The position in the list of children to insert.
@type index: int
@... | [
"Insert",
"an",
"L",
"{",
"Element",
"}",
"content",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L357-L377 |
suds-community/suds | suds/sax/element.py | Element.getChild | def getChild(self, name, ns=None, default=None):
"""
Get a child by (optional) name and/or (optional) namespace.
@param name: The name of a child element (may contain prefix).
@type name: basestring
@param ns: An optional namespace used to match the child.
@type ns: (I{p... | python | def getChild(self, name, ns=None, default=None):
"""
Get a child by (optional) name and/or (optional) namespace.
@param name: The name of a child element (may contain prefix).
@type name: basestring
@param ns: An optional namespace used to match the child.
@type ns: (I{p... | [
"def",
"getChild",
"(",
"self",
",",
"name",
",",
"ns",
"=",
"None",
",",
"default",
"=",
"None",
")",
":",
"if",
"ns",
"is",
"None",
":",
"prefix",
",",
"name",
"=",
"splitPrefix",
"(",
"name",
")",
"if",
"prefix",
"is",
"not",
"None",
":",
"ns"... | Get a child by (optional) name and/or (optional) namespace.
@param name: The name of a child element (may contain prefix).
@type name: basestring
@param ns: An optional namespace used to match the child.
@type ns: (I{prefix}, I{name})
@param default: Returned when child not-foun... | [
"Get",
"a",
"child",
"by",
"(",
"optional",
")",
"name",
"and",
"/",
"or",
"(",
"optional",
")",
"namespace",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L438-L459 |
suds-community/suds | suds/sax/element.py | Element.childAtPath | def childAtPath(self, path):
"""
Get a child at I{path} where I{path} is a (/) separated list of element
names that are expected to be children.
@param path: A (/) separated list of element names.
@type path: basestring
@return: The leaf node at the end of I{path}.
... | python | def childAtPath(self, path):
"""
Get a child at I{path} where I{path} is a (/) separated list of element
names that are expected to be children.
@param path: A (/) separated list of element names.
@type path: basestring
@return: The leaf node at the end of I{path}.
... | [
"def",
"childAtPath",
"(",
"self",
",",
"path",
")",
":",
"result",
"=",
"None",
"node",
"=",
"self",
"for",
"name",
"in",
"path",
".",
"split",
"(",
"\"/\"",
")",
":",
"if",
"not",
"name",
":",
"continue",
"ns",
"=",
"None",
"prefix",
",",
"name",... | Get a child at I{path} where I{path} is a (/) separated list of element
names that are expected to be children.
@param path: A (/) separated list of element names.
@type path: basestring
@return: The leaf node at the end of I{path}.
@rtype: L{Element} | [
"Get",
"a",
"child",
"at",
"I",
"{",
"path",
"}",
"where",
"I",
"{",
"path",
"}",
"is",
"a",
"(",
"/",
")",
"separated",
"list",
"of",
"element",
"names",
"that",
"are",
"expected",
"to",
"be",
"children",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L461-L485 |
suds-community/suds | suds/sax/element.py | Element.childrenAtPath | def childrenAtPath(self, path):
"""
Get a list of children at I{path} where I{path} is a (/) separated list
of element names expected to be children.
@param path: A (/) separated list of element names.
@type path: basestring
@return: The collection leaf nodes at the end ... | python | def childrenAtPath(self, path):
"""
Get a list of children at I{path} where I{path} is a (/) separated list
of element names expected to be children.
@param path: A (/) separated list of element names.
@type path: basestring
@return: The collection leaf nodes at the end ... | [
"def",
"childrenAtPath",
"(",
"self",
",",
"path",
")",
":",
"parts",
"=",
"[",
"p",
"for",
"p",
"in",
"path",
".",
"split",
"(",
"\"/\"",
")",
"if",
"p",
"]",
"if",
"len",
"(",
"parts",
")",
"==",
"1",
":",
"return",
"self",
".",
"getChildren",
... | Get a list of children at I{path} where I{path} is a (/) separated list
of element names expected to be children.
@param path: A (/) separated list of element names.
@type path: basestring
@return: The collection leaf nodes at the end of I{path}.
@rtype: [L{Element},...] | [
"Get",
"a",
"list",
"of",
"children",
"at",
"I",
"{",
"path",
"}",
"where",
"I",
"{",
"path",
"}",
"is",
"a",
"(",
"/",
")",
"separated",
"list",
"of",
"element",
"names",
"expected",
"to",
"be",
"children",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L487-L501 |
suds-community/suds | suds/sax/element.py | Element.getChildren | def getChildren(self, name=None, ns=None):
"""
Get a list of children by (optional) name and/or (optional) namespace.
@param name: The name of a child element (may contain a prefix).
@type name: basestring
@param ns: An optional namespace used to match the child.
@type n... | python | def getChildren(self, name=None, ns=None):
"""
Get a list of children by (optional) name and/or (optional) namespace.
@param name: The name of a child element (may contain a prefix).
@type name: basestring
@param ns: An optional namespace used to match the child.
@type n... | [
"def",
"getChildren",
"(",
"self",
",",
"name",
"=",
"None",
",",
"ns",
"=",
"None",
")",
":",
"if",
"ns",
"is",
"None",
":",
"if",
"name",
"is",
"None",
":",
"return",
"self",
".",
"children",
"prefix",
",",
"name",
"=",
"splitPrefix",
"(",
"name"... | Get a list of children by (optional) name and/or (optional) namespace.
@param name: The name of a child element (may contain a prefix).
@type name: basestring
@param ns: An optional namespace used to match the child.
@type ns: (I{prefix}, I{name})
@return: The list of matching c... | [
"Get",
"a",
"list",
"of",
"children",
"by",
"(",
"optional",
")",
"name",
"and",
"/",
"or",
"(",
"optional",
")",
"namespace",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L503-L521 |
suds-community/suds | suds/sax/element.py | Element.promotePrefixes | def promotePrefixes(self):
"""
Push prefix declarations up the tree as far as possible.
Prefix mapping are pushed to its parent unless the parent has the
prefix mapped to another URI or the parent has the prefix. This is
propagated up the tree until the top is reached.
... | python | def promotePrefixes(self):
"""
Push prefix declarations up the tree as far as possible.
Prefix mapping are pushed to its parent unless the parent has the
prefix mapped to another URI or the parent has the prefix. This is
propagated up the tree until the top is reached.
... | [
"def",
"promotePrefixes",
"(",
"self",
")",
":",
"for",
"c",
"in",
"self",
".",
"children",
":",
"c",
".",
"promotePrefixes",
"(",
")",
"if",
"self",
".",
"parent",
"is",
"None",
":",
"return",
"for",
"p",
",",
"u",
"in",
"self",
".",
"nsprefixes",
... | Push prefix declarations up the tree as far as possible.
Prefix mapping are pushed to its parent unless the parent has the
prefix mapped to another URI or the parent has the prefix. This is
propagated up the tree until the top is reached.
@return: self
@rtype: L{Element} | [
"Push",
"prefix",
"declarations",
"up",
"the",
"tree",
"as",
"far",
"as",
"possible",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L662-L687 |
suds-community/suds | suds/sax/element.py | Element.isempty | def isempty(self, content=True):
"""
Get whether the element has no children.
@param content: Test content (children & text) only.
@type content: boolean
@return: True when element has not children.
@rtype: boolean
"""
nochildren = not self.children
... | python | def isempty(self, content=True):
"""
Get whether the element has no children.
@param content: Test content (children & text) only.
@type content: boolean
@return: True when element has not children.
@rtype: boolean
"""
nochildren = not self.children
... | [
"def",
"isempty",
"(",
"self",
",",
"content",
"=",
"True",
")",
":",
"nochildren",
"=",
"not",
"self",
".",
"children",
"notext",
"=",
"self",
".",
"text",
"is",
"None",
"nocontent",
"=",
"nochildren",
"and",
"notext",
"if",
"content",
":",
"return",
... | Get whether the element has no children.
@param content: Test content (children & text) only.
@type content: boolean
@return: True when element has not children.
@rtype: boolean | [
"Get",
"whether",
"the",
"element",
"has",
"no",
"children",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L723-L739 |
suds-community/suds | suds/sax/element.py | Element.isnil | def isnil(self):
"""
Get whether the element is I{nil} as defined by having an
I{xsi:nil="true"} attribute.
@return: True if I{nil}, else False
@rtype: boolean
"""
nilattr = self.getAttribute("nil", ns=Namespace.xsins)
return nilattr is not None and (nil... | python | def isnil(self):
"""
Get whether the element is I{nil} as defined by having an
I{xsi:nil="true"} attribute.
@return: True if I{nil}, else False
@rtype: boolean
"""
nilattr = self.getAttribute("nil", ns=Namespace.xsins)
return nilattr is not None and (nil... | [
"def",
"isnil",
"(",
"self",
")",
":",
"nilattr",
"=",
"self",
".",
"getAttribute",
"(",
"\"nil\"",
",",
"ns",
"=",
"Namespace",
".",
"xsins",
")",
"return",
"nilattr",
"is",
"not",
"None",
"and",
"(",
"nilattr",
".",
"getValue",
"(",
")",
".",
"lowe... | Get whether the element is I{nil} as defined by having an
I{xsi:nil="true"} attribute.
@return: True if I{nil}, else False
@rtype: boolean | [
"Get",
"whether",
"the",
"element",
"is",
"I",
"{",
"nil",
"}",
"as",
"defined",
"by",
"having",
"an",
"I",
"{",
"xsi",
":",
"nil",
"=",
"true",
"}",
"attribute",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L741-L751 |
suds-community/suds | suds/sax/element.py | Element.setnil | def setnil(self, flag=True):
"""
Set this node to I{nil} as defined by having an I{xsi:nil}=I{flag}
attribute.
@param flag: A flag indicating how I{xsi:nil} will be set.
@type flag: boolean
@return: self
@rtype: L{Element}
"""
p, u = Namespace.xs... | python | def setnil(self, flag=True):
"""
Set this node to I{nil} as defined by having an I{xsi:nil}=I{flag}
attribute.
@param flag: A flag indicating how I{xsi:nil} will be set.
@type flag: boolean
@return: self
@rtype: L{Element}
"""
p, u = Namespace.xs... | [
"def",
"setnil",
"(",
"self",
",",
"flag",
"=",
"True",
")",
":",
"p",
",",
"u",
"=",
"Namespace",
".",
"xsins",
"name",
"=",
"\":\"",
".",
"join",
"(",
"(",
"p",
",",
"\"nil\"",
")",
")",
"self",
".",
"set",
"(",
"name",
",",
"str",
"(",
"fl... | Set this node to I{nil} as defined by having an I{xsi:nil}=I{flag}
attribute.
@param flag: A flag indicating how I{xsi:nil} will be set.
@type flag: boolean
@return: self
@rtype: L{Element} | [
"Set",
"this",
"node",
"to",
"I",
"{",
"nil",
"}",
"as",
"defined",
"by",
"having",
"an",
"I",
"{",
"xsi",
":",
"nil",
"}",
"=",
"I",
"{",
"flag",
"}",
"attribute",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L753-L770 |
suds-community/suds | suds/sax/element.py | Element.applyns | def applyns(self, ns):
"""
Apply the namespace to this node.
If the prefix is I{None} then this element's explicit namespace
I{expns} is set to the URI defined by I{ns}. Otherwise, the I{ns} is
simply mapped.
@param ns: A namespace.
@type ns: (I{prefix}, I{URI})... | python | def applyns(self, ns):
"""
Apply the namespace to this node.
If the prefix is I{None} then this element's explicit namespace
I{expns} is set to the URI defined by I{ns}. Otherwise, the I{ns} is
simply mapped.
@param ns: A namespace.
@type ns: (I{prefix}, I{URI})... | [
"def",
"applyns",
"(",
"self",
",",
"ns",
")",
":",
"if",
"ns",
"is",
"None",
":",
"return",
"if",
"not",
"isinstance",
"(",
"ns",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"raise",
"Exception",
"(",
"\"namespace must be a list or a tuple\"",
")",
... | Apply the namespace to this node.
If the prefix is I{None} then this element's explicit namespace
I{expns} is set to the URI defined by I{ns}. Otherwise, the I{ns} is
simply mapped.
@param ns: A namespace.
@type ns: (I{prefix}, I{URI}) | [
"Apply",
"the",
"namespace",
"to",
"this",
"node",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L772-L792 |
suds-community/suds | suds/sax/element.py | Element.str | def str(self, indent=0):
"""
Get a string representation of this XML fragment.
@param indent: The indent to be used in formatting the output.
@type indent: int
@return: A I{pretty} string.
@rtype: basestring
"""
tab = "%*s" % (indent * 3, "")
res... | python | def str(self, indent=0):
"""
Get a string representation of this XML fragment.
@param indent: The indent to be used in formatting the output.
@type indent: int
@return: A I{pretty} string.
@rtype: basestring
"""
tab = "%*s" % (indent * 3, "")
res... | [
"def",
"str",
"(",
"self",
",",
"indent",
"=",
"0",
")",
":",
"tab",
"=",
"\"%*s\"",
"%",
"(",
"indent",
"*",
"3",
",",
"\"\"",
")",
"result",
"=",
"[",
"]",
"result",
".",
"append",
"(",
"\"%s<%s\"",
"%",
"(",
"tab",
",",
"self",
".",
"qname",... | Get a string representation of this XML fragment.
@param indent: The indent to be used in formatting the output.
@type indent: int
@return: A I{pretty} string.
@rtype: basestring | [
"Get",
"a",
"string",
"representation",
"of",
"this",
"XML",
"fragment",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L794-L822 |
suds-community/suds | suds/sax/element.py | Element.plain | def plain(self):
"""
Get a string representation of this XML fragment.
@return: A I{plain} string.
@rtype: basestring
"""
result = ["<%s" % (self.qname(),), self.nsdeclarations()]
for a in self.attributes:
result.append(" %s" % (unicode(a),))
... | python | def plain(self):
"""
Get a string representation of this XML fragment.
@return: A I{plain} string.
@rtype: basestring
"""
result = ["<%s" % (self.qname(),), self.nsdeclarations()]
for a in self.attributes:
result.append(" %s" % (unicode(a),))
... | [
"def",
"plain",
"(",
"self",
")",
":",
"result",
"=",
"[",
"\"<%s\"",
"%",
"(",
"self",
".",
"qname",
"(",
")",
",",
")",
",",
"self",
".",
"nsdeclarations",
"(",
")",
"]",
"for",
"a",
"in",
"self",
".",
"attributes",
":",
"result",
".",
"append"... | Get a string representation of this XML fragment.
@return: A I{plain} string.
@rtype: basestring | [
"Get",
"a",
"string",
"representation",
"of",
"this",
"XML",
"fragment",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L824-L844 |
suds-community/suds | suds/sax/element.py | Element.nsdeclarations | def nsdeclarations(self):
"""
Get a string representation for all namespace declarations as xmlns=""
and xmlns:p="".
@return: A separated list of declarations.
@rtype: basestring
"""
s = []
myns = None, self.expns
if self.parent is None:
... | python | def nsdeclarations(self):
"""
Get a string representation for all namespace declarations as xmlns=""
and xmlns:p="".
@return: A separated list of declarations.
@rtype: basestring
"""
s = []
myns = None, self.expns
if self.parent is None:
... | [
"def",
"nsdeclarations",
"(",
"self",
")",
":",
"s",
"=",
"[",
"]",
"myns",
"=",
"None",
",",
"self",
".",
"expns",
"if",
"self",
".",
"parent",
"is",
"None",
":",
"pns",
"=",
"Namespace",
".",
"default",
"else",
":",
"pns",
"=",
"None",
",",
"se... | Get a string representation for all namespace declarations as xmlns=""
and xmlns:p="".
@return: A separated list of declarations.
@rtype: basestring | [
"Get",
"a",
"string",
"representation",
"for",
"all",
"namespace",
"declarations",
"as",
"xmlns",
"=",
"and",
"xmlns",
":",
"p",
"=",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/element.py#L846-L871 |
suds-community/suds | suds/reader.py | DefinitionsReader.open | def open(self, url):
"""
Open a WSDL schema at the specified I{URL}.
First, the WSDL schema is looked up in the I{object cache}. If not
found, a new one constructed using the I{fn} factory function and the
result is cached for the next open().
@param url: A WSDL URL.
... | python | def open(self, url):
"""
Open a WSDL schema at the specified I{URL}.
First, the WSDL schema is looked up in the I{object cache}. If not
found, a new one constructed using the I{fn} factory function and the
result is cached for the next open().
@param url: A WSDL URL.
... | [
"def",
"open",
"(",
"self",
",",
"url",
")",
":",
"cache",
"=",
"self",
".",
"__cache",
"(",
")",
"id",
"=",
"self",
".",
"mangle",
"(",
"url",
",",
"\"wsdl\"",
")",
"wsdl",
"=",
"cache",
".",
"get",
"(",
"id",
")",
"if",
"wsdl",
"is",
"None",
... | Open a WSDL schema at the specified I{URL}.
First, the WSDL schema is looked up in the I{object cache}. If not
found, a new one constructed using the I{fn} factory function and the
result is cached for the next open().
@param url: A WSDL URL.
@type url: str.
@return: Th... | [
"Open",
"a",
"WSDL",
"schema",
"at",
"the",
"specified",
"I",
"{",
"URL",
"}",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/reader.py#L86-L112 |
suds-community/suds | suds/reader.py | DefinitionsReader.__cache | def __cache(self):
"""
Get the I{object cache}.
@return: The I{cache} when I{cachingpolicy} = B{1}.
@rtype: L{Cache}
"""
if self.options.cachingpolicy == 1:
return self.options.cache
return suds.cache.NoCache() | python | def __cache(self):
"""
Get the I{object cache}.
@return: The I{cache} when I{cachingpolicy} = B{1}.
@rtype: L{Cache}
"""
if self.options.cachingpolicy == 1:
return self.options.cache
return suds.cache.NoCache() | [
"def",
"__cache",
"(",
"self",
")",
":",
"if",
"self",
".",
"options",
".",
"cachingpolicy",
"==",
"1",
":",
"return",
"self",
".",
"options",
".",
"cache",
"return",
"suds",
".",
"cache",
".",
"NoCache",
"(",
")"
] | Get the I{object cache}.
@return: The I{cache} when I{cachingpolicy} = B{1}.
@rtype: L{Cache} | [
"Get",
"the",
"I",
"{",
"object",
"cache",
"}",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/reader.py#L114-L124 |
suds-community/suds | suds/reader.py | DocumentReader.open | def open(self, url):
"""
Open an XML document at the specified I{URL}.
First, a preparsed document is looked up in the I{object cache}. If not
found, its content is fetched from an external source and parsed using
the SAX parser. The result is cached for the next open().
... | python | def open(self, url):
"""
Open an XML document at the specified I{URL}.
First, a preparsed document is looked up in the I{object cache}. If not
found, its content is fetched from an external source and parsed using
the SAX parser. The result is cached for the next open().
... | [
"def",
"open",
"(",
"self",
",",
"url",
")",
":",
"cache",
"=",
"self",
".",
"__cache",
"(",
")",
"id",
"=",
"self",
".",
"mangle",
"(",
"url",
",",
"\"document\"",
")",
"xml",
"=",
"cache",
".",
"get",
"(",
"id",
")",
"if",
"xml",
"is",
"None"... | Open an XML document at the specified I{URL}.
First, a preparsed document is looked up in the I{object cache}. If not
found, its content is fetched from an external source and parsed using
the SAX parser. The result is cached for the next open().
@param url: A document URL.
@ty... | [
"Open",
"an",
"XML",
"document",
"at",
"the",
"specified",
"I",
"{",
"URL",
"}",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/reader.py#L130-L151 |
suds-community/suds | suds/reader.py | DocumentReader.__fetch | def __fetch(self, url):
"""
Fetch document content from an external source.
The document content will first be looked up in the registered document
store, and if not found there, downloaded using the registered
transport system.
Before being returned, the fetched docume... | python | def __fetch(self, url):
"""
Fetch document content from an external source.
The document content will first be looked up in the registered document
store, and if not found there, downloaded using the registered
transport system.
Before being returned, the fetched docume... | [
"def",
"__fetch",
"(",
"self",
",",
"url",
")",
":",
"content",
"=",
"None",
"store",
"=",
"self",
".",
"options",
".",
"documentStore",
"if",
"store",
"is",
"not",
"None",
":",
"content",
"=",
"store",
".",
"open",
"(",
"url",
")",
"if",
"content",
... | Fetch document content from an external source.
The document content will first be looked up in the registered document
store, and if not found there, downloaded using the registered
transport system.
Before being returned, the fetched document content first gets
processed by a... | [
"Fetch",
"document",
"content",
"from",
"an",
"external",
"source",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/reader.py#L165-L196 |
suds-community/suds | suds/sax/enc.py | Encoder.encode | def encode(self, s):
"""
Encode special characters found in string I{s}.
@param s: A string to encode.
@type s: str
@return: The encoded string.
@rtype: str
"""
if isinstance(s, basestring) and self.__needs_encoding(s):
for x in self.encoding... | python | def encode(self, s):
"""
Encode special characters found in string I{s}.
@param s: A string to encode.
@type s: str
@return: The encoded string.
@rtype: str
"""
if isinstance(s, basestring) and self.__needs_encoding(s):
for x in self.encoding... | [
"def",
"encode",
"(",
"self",
",",
"s",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"basestring",
")",
"and",
"self",
".",
"__needs_encoding",
"(",
"s",
")",
":",
"for",
"x",
"in",
"self",
".",
"encodings",
":",
"s",
"=",
"re",
".",
"sub",
"(",
... | Encode special characters found in string I{s}.
@param s: A string to encode.
@type s: str
@return: The encoded string.
@rtype: str | [
"Encode",
"special",
"characters",
"found",
"in",
"string",
"I",
"{",
"s",
"}",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/enc.py#L51-L64 |
suds-community/suds | suds/sax/enc.py | Encoder.__needs_encoding | def __needs_encoding(self, s):
"""
Get whether string I{s} contains special characters.
@param s: A string to check.
@type s: str
@return: True if needs encoding.
@rtype: boolean
"""
if isinstance(s, basestring):
for c in self.special:
... | python | def __needs_encoding(self, s):
"""
Get whether string I{s} contains special characters.
@param s: A string to check.
@type s: str
@return: True if needs encoding.
@rtype: boolean
"""
if isinstance(s, basestring):
for c in self.special:
... | [
"def",
"__needs_encoding",
"(",
"self",
",",
"s",
")",
":",
"if",
"isinstance",
"(",
"s",
",",
"basestring",
")",
":",
"for",
"c",
"in",
"self",
".",
"special",
":",
"if",
"c",
"in",
"s",
":",
"return",
"True"
] | Get whether string I{s} contains special characters.
@param s: A string to check.
@type s: str
@return: True if needs encoding.
@rtype: boolean | [
"Get",
"whether",
"string",
"I",
"{",
"s",
"}",
"contains",
"special",
"characters",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sax/enc.py#L81-L94 |
suds-community/suds | tools/suds_devel/requirements.py | virtualenv_requirements | def virtualenv_requirements(version_info=sys.version_info):
"""
Generate Python version specific virtualenv package requirements.
The requirements are returned as setuptools/pip compatible requirement
specification strings.
"""
if version_info < (2, 5):
# 'virtualenv' release ... | python | def virtualenv_requirements(version_info=sys.version_info):
"""
Generate Python version specific virtualenv package requirements.
The requirements are returned as setuptools/pip compatible requirement
specification strings.
"""
if version_info < (2, 5):
# 'virtualenv' release ... | [
"def",
"virtualenv_requirements",
"(",
"version_info",
"=",
"sys",
".",
"version_info",
")",
":",
"if",
"version_info",
"<",
"(",
"2",
",",
"5",
")",
":",
"# 'virtualenv' release 1.8 dropped Python 2.4.x compatibility.\r",
"yield",
"requirement_spec",
"(",
"\"virtualenv... | Generate Python version specific virtualenv package requirements.
The requirements are returned as setuptools/pip compatible requirement
specification strings. | [
"Generate",
"Python",
"version",
"specific",
"virtualenv",
"package",
"requirements",
".",
"The",
"requirements",
"are",
"returned",
"as",
"setuptools",
"/",
"pip",
"compatible",
"requirement",
"specification",
"strings",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/requirements.py#L267-L284 |
suds-community/suds | tools/suds_devel/environment.py | Environment.__construct_python_version | def __construct_python_version(self):
"""
Construct a setuptools compatible Python version string.
Constructed based on the environment's reported sys.version_info.
"""
major, minor, micro, release_level, serial = self.sys_version_info
assert release_level in ("... | python | def __construct_python_version(self):
"""
Construct a setuptools compatible Python version string.
Constructed based on the environment's reported sys.version_info.
"""
major, minor, micro, release_level, serial = self.sys_version_info
assert release_level in ("... | [
"def",
"__construct_python_version",
"(",
"self",
")",
":",
"major",
",",
"minor",
",",
"micro",
",",
"release_level",
",",
"serial",
"=",
"self",
".",
"sys_version_info",
"assert",
"release_level",
"in",
"(",
"\"alfa\"",
",",
"\"beta\"",
",",
"\"candidate\"",
... | Construct a setuptools compatible Python version string.
Constructed based on the environment's reported sys.version_info. | [
"Construct",
"a",
"setuptools",
"compatible",
"Python",
"version",
"string",
".",
"Constructed",
"based",
"on",
"the",
"environment",
"s",
"reported",
"sys",
".",
"version_info",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/environment.py#L164-L178 |
suds-community/suds | tools/suds_devel/environment.py | Environment.__parse_scanned_version_info | def __parse_scanned_version_info(self):
"""Parses the environment's formatted version info string."""
string = self.sys_version_info_formatted
try:
major, minor, micro, release_level, serial = string.split(",")
if (release_level in ("alfa", "beta", "candidate", "fina... | python | def __parse_scanned_version_info(self):
"""Parses the environment's formatted version info string."""
string = self.sys_version_info_formatted
try:
major, minor, micro, release_level, serial = string.split(",")
if (release_level in ("alfa", "beta", "candidate", "fina... | [
"def",
"__parse_scanned_version_info",
"(",
"self",
")",
":",
"string",
"=",
"self",
".",
"sys_version_info_formatted",
"try",
":",
"major",
",",
"minor",
",",
"micro",
",",
"release_level",
",",
"serial",
"=",
"string",
".",
"split",
"(",
"\",\"",
")",
"if"... | Parses the environment's formatted version info string. | [
"Parses",
"the",
"environment",
"s",
"formatted",
"version",
"info",
"string",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/tools/suds_devel/environment.py#L233-L252 |
suds-community/suds | suds/sudsobject.py | Printer.print_dictionary | def print_dictionary(self, d, h, n, nl=False):
"""Print complex using the specified indent (n) and newline (nl)."""
if d in h:
return "{}..."
h.append(d)
s = []
if nl:
s.append("\n")
s.append(self.indent(n))
s.append("{")
for it... | python | def print_dictionary(self, d, h, n, nl=False):
"""Print complex using the specified indent (n) and newline (nl)."""
if d in h:
return "{}..."
h.append(d)
s = []
if nl:
s.append("\n")
s.append(self.indent(n))
s.append("{")
for it... | [
"def",
"print_dictionary",
"(",
"self",
",",
"d",
",",
"h",
",",
"n",
",",
"nl",
"=",
"False",
")",
":",
"if",
"d",
"in",
"h",
":",
"return",
"\"{}...\"",
"h",
".",
"append",
"(",
"d",
")",
"s",
"=",
"[",
"]",
"if",
"nl",
":",
"s",
".",
"ap... | Print complex using the specified indent (n) and newline (nl). | [
"Print",
"complex",
"using",
"the",
"specified",
"indent",
"(",
"n",
")",
"and",
"newline",
"(",
"nl",
")",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sudsobject.py#L326-L350 |
suds-community/suds | suds/sudsobject.py | Printer.print_collection | def print_collection(self, c, h, n):
"""Print collection using the specified indent (n) and newline (nl)."""
if c in h:
return "[]..."
h.append(c)
s = []
for item in c:
s.append("\n")
s.append(self.indent(n))
s.append(self.process(i... | python | def print_collection(self, c, h, n):
"""Print collection using the specified indent (n) and newline (nl)."""
if c in h:
return "[]..."
h.append(c)
s = []
for item in c:
s.append("\n")
s.append(self.indent(n))
s.append(self.process(i... | [
"def",
"print_collection",
"(",
"self",
",",
"c",
",",
"h",
",",
"n",
")",
":",
"if",
"c",
"in",
"h",
":",
"return",
"\"[]...\"",
"h",
".",
"append",
"(",
"c",
")",
"s",
"=",
"[",
"]",
"for",
"item",
"in",
"c",
":",
"s",
".",
"append",
"(",
... | Print collection using the specified indent (n) and newline (nl). | [
"Print",
"collection",
"using",
"the",
"specified",
"indent",
"(",
"n",
")",
"and",
"newline",
"(",
"nl",
")",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/sudsobject.py#L352-L364 |
suds-community/suds | suds/mx/literal.py | Typed.node | def node(self, content):
"""
Create an XML node.
The XML node is namespace qualified as defined by the corresponding
schema element.
"""
ns = content.type.namespace()
if content.type.form_qualified:
node = Element(content.tag, ns=ns)
if n... | python | def node(self, content):
"""
Create an XML node.
The XML node is namespace qualified as defined by the corresponding
schema element.
"""
ns = content.type.namespace()
if content.type.form_qualified:
node = Element(content.tag, ns=ns)
if n... | [
"def",
"node",
"(",
"self",
",",
"content",
")",
":",
"ns",
"=",
"content",
".",
"type",
".",
"namespace",
"(",
")",
"if",
"content",
".",
"type",
".",
"form_qualified",
":",
"node",
"=",
"Element",
"(",
"content",
".",
"tag",
",",
"ns",
"=",
"ns",... | Create an XML node.
The XML node is namespace qualified as defined by the corresponding
schema element. | [
"Create",
"an",
"XML",
"node",
"."
] | train | https://github.com/suds-community/suds/blob/6fb0a829337b5037a66c20aae6f89b41acd77e40/suds/mx/literal.py#L143-L160 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.