nwo
stringlengths
5
106
sha
stringlengths
40
40
path
stringlengths
4
174
language
stringclasses
1 value
identifier
stringlengths
1
140
parameters
stringlengths
0
87.7k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
426k
docstring
stringlengths
0
64.3k
docstring_summary
stringlengths
0
26.3k
docstring_tokens
list
function
stringlengths
18
4.83M
function_tokens
list
url
stringlengths
83
304
yanzhou/CnkiSpider
348d7114f3ffee7b0a134cf6c5d01150433f3fde
src/bs4/element.py
python
_alias
(attr)
return alias
Alias one attribute name to another for backward compatibility
Alias one attribute name to another for backward compatibility
[ "Alias", "one", "attribute", "name", "to", "another", "for", "backward", "compatibility" ]
def _alias(attr): """Alias one attribute name to another for backward compatibility""" @property def alias(self): return getattr(self, attr) @alias.setter def alias(self): return setattr(self, attr) return alias
[ "def", "_alias", "(", "attr", ")", ":", "@", "property", "def", "alias", "(", "self", ")", ":", "return", "getattr", "(", "self", ",", "attr", ")", "@", "alias", ".", "setter", "def", "alias", "(", "self", ")", ":", "return", "setattr", "(", "self"...
https://github.com/yanzhou/CnkiSpider/blob/348d7114f3ffee7b0a134cf6c5d01150433f3fde/src/bs4/element.py#L12-L21
ConvLab/ConvLab
a04582a77537c1a706fbf64715baa9ad0be1301a
convlab/lib/util.py
python
write_as_df
(data, data_path)
return data_path
Submethod to write data as DataFrame
Submethod to write data as DataFrame
[ "Submethod", "to", "write", "data", "as", "DataFrame" ]
def write_as_df(data, data_path): '''Submethod to write data as DataFrame''' df = cast_df(data) ext = get_file_ext(data_path) df.to_csv(data_path, index=False) return data_path
[ "def", "write_as_df", "(", "data", ",", "data_path", ")", ":", "df", "=", "cast_df", "(", "data", ")", "ext", "=", "get_file_ext", "(", "data_path", ")", "df", ".", "to_csv", "(", "data_path", ",", "index", "=", "False", ")", "return", "data_path" ]
https://github.com/ConvLab/ConvLab/blob/a04582a77537c1a706fbf64715baa9ad0be1301a/convlab/lib/util.py#L652-L657
sidewalklabs/s2sphere
d1d067e8c06e5fbaf0cc0158bade947b4a03a438
s2sphere/sphere.py
python
LatLngRect.is_empty
(self)
return self.lat().is_empty()
[]
def is_empty(self): return self.lat().is_empty()
[ "def", "is_empty", "(", "self", ")", ":", "return", "self", ".", "lat", "(", ")", ".", "is_empty", "(", ")" ]
https://github.com/sidewalklabs/s2sphere/blob/d1d067e8c06e5fbaf0cc0158bade947b4a03a438/s2sphere/sphere.py#L631-L632
conan7882/CNN-Visualization
e08650cc126a3a489f7d633dc18bf3f0009792b1
lib/models/cam.py
python
BaseCAM._get_optimizer
(self)
return tf.train.AdamOptimizer( beta1=0.5, learning_rate=self._learning_rate)
[]
def _get_optimizer(self): return tf.train.AdamOptimizer( beta1=0.5, learning_rate=self._learning_rate)
[ "def", "_get_optimizer", "(", "self", ")", ":", "return", "tf", ".", "train", ".", "AdamOptimizer", "(", "beta1", "=", "0.5", ",", "learning_rate", "=", "self", ".", "_learning_rate", ")" ]
https://github.com/conan7882/CNN-Visualization/blob/e08650cc126a3a489f7d633dc18bf3f0009792b1/lib/models/cam.py#L51-L53
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_flaskbb/lib/python2.7/site-packages/kombu/transport/virtual/base.py
python
Transport.on_message_ready
(self, channel, message, queue)
[]
def on_message_ready(self, channel, message, queue): if not queue or queue not in self._callbacks: raise KeyError( 'Message for queue {0!r} without consumers: {1}'.format( queue, message)) self._callbacks[queue](message)
[ "def", "on_message_ready", "(", "self", ",", "channel", ",", "message", ",", "queue", ")", ":", "if", "not", "queue", "or", "queue", "not", "in", "self", ".", "_callbacks", ":", "raise", "KeyError", "(", "'Message for queue {0!r} without consumers: {1}'", ".", ...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_flaskbb/lib/python2.7/site-packages/kombu/transport/virtual/base.py#L991-L996
grow/grow
97fc21730b6a674d5d33948d94968e79447ce433
grow/server/manager.py
python
print_server_ready_message
(pod, host, port)
return (url_root, extra_urls)
[]
def print_server_ready_message(pod, host, port): try: home_doc = pod.get_home_doc() root_path = home_doc.url.path if home_doc and home_doc.exists else '/' except: # Allow the user to fix the problem without restarting the server manually. root_path = '/' pod.logger.exception('Failed to determine root URL path.') url_base = 'http://{}:{}/'.format(host, port) url_root = 'http://{}:{}{}'.format(host, port, root_path) messages = ServerMessages() messages.add_message('Pod:', pod.root, colors.HIGHLIGHT) messages.add_message('Server:', url_root, colors.HIGHLIGHT) # Trigger the dev manager message hook. extra_urls = pod.extensions_controller.trigger( 'dev_manager_message', messages.add_message, url_base, url_root) or [] messages.add_message( 'Ready.', 'Press ctrl-c to quit.', colors.SUCCESS, colors.SUCCESS) messages.print(pod.logger.info) return (url_root, extra_urls)
[ "def", "print_server_ready_message", "(", "pod", ",", "host", ",", "port", ")", ":", "try", ":", "home_doc", "=", "pod", ".", "get_home_doc", "(", ")", "root_path", "=", "home_doc", ".", "url", ".", "path", "if", "home_doc", "and", "home_doc", ".", "exis...
https://github.com/grow/grow/blob/97fc21730b6a674d5d33948d94968e79447ce433/grow/server/manager.py#L66-L90
alicevision/meshroom
92004286fd0bc8ab36bd3575b4c0166090e665e1
meshroom/core/node.py
python
nodeFactory
(nodeDict, name=None)
return node
Create a node instance by deserializing the given node data. If the serialized data matches the corresponding node type description, a Node instance is created. If any compatibility issue occurs, a NodeCompatibility instance is created instead. Args: nodeDict (dict): the serialization of the node name (str): (optional) the node's name Returns: BaseNode: the created node
Create a node instance by deserializing the given node data. If the serialized data matches the corresponding node type description, a Node instance is created. If any compatibility issue occurs, a NodeCompatibility instance is created instead.
[ "Create", "a", "node", "instance", "by", "deserializing", "the", "given", "node", "data", ".", "If", "the", "serialized", "data", "matches", "the", "corresponding", "node", "type", "description", "a", "Node", "instance", "is", "created", ".", "If", "any", "c...
def nodeFactory(nodeDict, name=None): """ Create a node instance by deserializing the given node data. If the serialized data matches the corresponding node type description, a Node instance is created. If any compatibility issue occurs, a NodeCompatibility instance is created instead. Args: nodeDict (dict): the serialization of the node name (str): (optional) the node's name Returns: BaseNode: the created node """ nodeType = nodeDict["nodeType"] # retro-compatibility: inputs were previously saved as "attributes" if "inputs" not in nodeDict and "attributes" in nodeDict: nodeDict["inputs"] = nodeDict["attributes"] del nodeDict["attributes"] # get node inputs/outputs inputs = nodeDict.get("inputs", {}) outputs = nodeDict.get("outputs", {}) version = nodeDict.get("version", None) internalFolder = nodeDict.get("internalFolder", None) position = Position(*nodeDict.get("position", [])) compatibilityIssue = None nodeDesc = None try: nodeDesc = meshroom.core.nodesDesc[nodeType] except KeyError: # unknown node type compatibilityIssue = CompatibilityIssue.UnknownNodeType if nodeDesc: # compare serialized node version with current node version currentNodeVersion = meshroom.core.nodeVersion(nodeDesc) # if both versions are available, check for incompatibility in major version if version and currentNodeVersion and Version(version).major != Version(currentNodeVersion).major: compatibilityIssue = CompatibilityIssue.VersionConflict # in other cases, check attributes compatibility between serialized node and its description else: # check that the node has the exact same set of inputs/outputs as its description if sorted([attr.name for attr in nodeDesc.inputs]) != sorted(inputs.keys()) or \ sorted([attr.name for attr in nodeDesc.outputs]) != sorted(outputs.keys()): compatibilityIssue = CompatibilityIssue.DescriptionConflict # verify that all inputs match their descriptions for attrName, value in inputs.items(): if not CompatibilityNode.attributeDescFromName(nodeDesc.inputs, attrName, value): compatibilityIssue = CompatibilityIssue.DescriptionConflict break # verify that all outputs match their descriptions for attrName, value in outputs.items(): if not CompatibilityNode.attributeDescFromName(nodeDesc.outputs, attrName, value): compatibilityIssue = CompatibilityIssue.DescriptionConflict break if compatibilityIssue is None: node = Node(nodeType, position, **inputs) else: logging.warning("Compatibility issue detected for node '{}': {}".format(name, compatibilityIssue.name)) node = CompatibilityNode(nodeType, nodeDict, position, compatibilityIssue) # retro-compatibility: no internal folder saved # can't spawn meaningful CompatibilityNode with precomputed outputs # => automatically try to perform node upgrade if not internalFolder and nodeDesc: logging.warning("No serialized output data: performing automatic upgrade on '{}'".format(name)) node = node.upgrade() return node
[ "def", "nodeFactory", "(", "nodeDict", ",", "name", "=", "None", ")", ":", "nodeType", "=", "nodeDict", "[", "\"nodeType\"", "]", "# retro-compatibility: inputs were previously saved as \"attributes\"", "if", "\"inputs\"", "not", "in", "nodeDict", "and", "\"attributes\"...
https://github.com/alicevision/meshroom/blob/92004286fd0bc8ab36bd3575b4c0166090e665e1/meshroom/core/node.py#L1396-L1467
google/grr
8ad8a4d2c5a93c92729206b7771af19d92d4f915
grr/server/grr_response_server/rdfvalues/objects.py
python
SHA256HashID.FromData
(cls, data)
return SHA256HashID(h)
[]
def FromData(cls, data): h = hashlib.sha256(data).digest() return SHA256HashID(h)
[ "def", "FromData", "(", "cls", ",", "data", ")", ":", "h", "=", "hashlib", ".", "sha256", "(", "data", ")", ".", "digest", "(", ")", "return", "SHA256HashID", "(", "h", ")" ]
https://github.com/google/grr/blob/8ad8a4d2c5a93c92729206b7771af19d92d4f915/grr/server/grr_response_server/rdfvalues/objects.py#L645-L647
niosus/EasyClangComplete
3b16eb17735aaa3f56bb295fc5481b269ee9f2ef
plugin/clang/cindex35.py
python
Type.element_count
(self)
return result
Retrieve the number of elements in this type. Returns an int. If the Type is not an array or vector, this raises.
Retrieve the number of elements in this type.
[ "Retrieve", "the", "number", "of", "elements", "in", "this", "type", "." ]
def element_count(self): """Retrieve the number of elements in this type. Returns an int. If the Type is not an array or vector, this raises. """ result = conf.lib.clang_getNumElements(self) if result < 0: raise Exception('Type does not have elements.') return result
[ "def", "element_count", "(", "self", ")", ":", "result", "=", "conf", ".", "lib", ".", "clang_getNumElements", "(", "self", ")", "if", "result", "<", "0", ":", "raise", "Exception", "(", "'Type does not have elements.'", ")", "return", "result" ]
https://github.com/niosus/EasyClangComplete/blob/3b16eb17735aaa3f56bb295fc5481b269ee9f2ef/plugin/clang/cindex35.py#L1707-L1718
yiyiliao/deep_marching_cubes
afcad99742435eb0d57d32770befed74faaad2ab
marching_cube/model/table.py
python
get_full_table
()
return [ [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1], [3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1], [3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1], [3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1], [9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1], [9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1], [2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1], [8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1], [9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1], [4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1], [3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1], [1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1], [4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1], [4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1], [9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1], [5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1], [2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1], [9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1], [0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1], [2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1], [10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1], [4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1], [5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1], [5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1], [9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1], [0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1], [1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1], [10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1], [8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1], [2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1], [7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1], [9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1], [2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1], [11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1], [9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1], [5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1], [11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1], [11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1], [1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1], [9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1], [5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1], [2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1], [0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1], [5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1], [6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1], [0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1], [3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1], [6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1], [5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1], [1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1], [10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1], [6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1], [1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1], [8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1], [7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1], [3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1], [5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1], [0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1], [9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1], [8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1], [5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1], [0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1], [6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1], [10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1], [10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1], [8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1], [1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1], [3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1], [0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1], [10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1], [0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1], [3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1], [6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1], [9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1], [8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1], [3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1], [6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1], [0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1], [10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1], [10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1], [1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1], [2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1], [7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1], [7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1], [2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1], [1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1], [11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1], [8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1], [0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1], [7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1], [10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1], [2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1], [6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1], [7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1], [2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1], [1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1], [10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1], [10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1], [0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1], [7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1], [6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1], [8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1], [9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1], [6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1], [4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1], [10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1], [8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1], [0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1], [1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1], [8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1], [10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1], [4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1], [10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1], [5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1], [11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1], [9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1], [6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1], [7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1], [3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1], [7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1], [9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1], [3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1], [6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1], [9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1], [1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1], [4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1], [7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1], [6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1], [3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1], [0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1], [6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1], [0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1], [11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1], [6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1], [5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1], [9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1], [1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1], [1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1], [10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1], [0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1], [5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1], [10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1], [11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1], [9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1], [7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1], [2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1], [8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1], [9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1], [9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1], [1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1], [9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1], [9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1], [5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1], [0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1], [10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1], [2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1], [0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1], [0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1], [9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1], [5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1], [3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1], [5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1], [8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1], [0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1], [9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1], [1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1], [3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1], [4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1], [9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1], [11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1], [11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1], [2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1], [9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1], [3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1], [1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1], [4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1], [4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1], [0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1], [3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1], [3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1], [0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1], [9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1], [1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] ]
Return the look-up-table of the Marching Cubes algorithm
Return the look-up-table of the Marching Cubes algorithm
[ "Return", "the", "look", "-", "up", "-", "table", "of", "the", "Marching", "Cubes", "algorithm" ]
def get_full_table(): """Return the look-up-table of the Marching Cubes algorithm""" return [ [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1], [3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1], [3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1], [3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1], [9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1], [9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1], [2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1], [8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1], [9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1], [4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1], [3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1], [1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1], [4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1], [4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1], [9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1], [5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1], [2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1], [9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1], [0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1], [2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1], [10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1], [4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1], [5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1], [5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1], [9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1], [0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1], [1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1], [10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1], [8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1], [2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1], [7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1], [9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1], [2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1], [11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1], [9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1], [5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1], [11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1], [11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1], [1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1], [9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1], [5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1], [2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1], [0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1], [5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1], [6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1], [0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1], [3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1], [6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1], [5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1], [1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1], [10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1], [6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1], [1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1], [8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1], [7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1], [3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1], [5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1], [0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1], [9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1], [8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1], [5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1], [0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1], [6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1], [10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1], [10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1], [8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1], [1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1], [3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1], [0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1], [10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1], [0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1], [3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1], [6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1], [9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1], [8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1], [3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1], [6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1], [0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1], [10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1], [10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1], [1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1], [2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1], [7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1], [7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1], [2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1], [1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1], [11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1], [8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1], [0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1], [7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1], [10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1], [2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1], [6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1], [7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1], [2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1], [1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1], [10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1], [10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1], [0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1], [7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1], [6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1], [8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1], [9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1], [6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1], [4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1], [10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1], [8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1], [0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1], [1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1], [8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1], [10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1], [4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1], [10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1], [5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1], [11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1], [9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1], [6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1], [7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1], [3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1], [7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1], [9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1], [3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1], [6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1], [9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1], [1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1], [4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1], [7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1], [6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1], [3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1], [0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1], [6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1], [0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1], [11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1], [6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1], [5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1], [9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1], [1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1], [1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1], [10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1], [0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1], [5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1], [10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1], [11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1], [9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1], [7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1], [2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1], [8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1], [9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1], [9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1], [1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1], [9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1], [9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1], [5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1], [0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1], [10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1], [2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1], [0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1], [0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1], [9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1], [5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1], [3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1], [5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1], [8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1], [0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1], [9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1], [0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1], [1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1], [3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1], [4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1], [9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1], [11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1], [11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1], [2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1], [9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1], [3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1], [1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1], [4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1], [4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1], [0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1], [3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1], [3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1], [0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1], [9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1], [1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1] ]
[ "def", "get_full_table", "(", ")", ":", "return", "[", "[", "-", "1", ",", "-", "1", ",", "-", "1", ",", "-", "1", ",", "-", "1", ",", "-", "1", ",", "-", "1", ",", "-", "1", ",", "-", "1", ",", "-", "1", ",", "-", "1", ",", "-", "1...
https://github.com/yiyiliao/deep_marching_cubes/blob/afcad99742435eb0d57d32770befed74faaad2ab/marching_cube/model/table.py#L24-L283
Dozed12/df-style-worldgen
937455d54f4b02df9c4b10ae6418f4c932fd97bf
libtcodpy.py
python
image_hflip
(image)
[]
def image_hflip(image) : _lib.TCOD_image_hflip(image)
[ "def", "image_hflip", "(", "image", ")", ":", "_lib", ".", "TCOD_image_hflip", "(", "image", ")" ]
https://github.com/Dozed12/df-style-worldgen/blob/937455d54f4b02df9c4b10ae6418f4c932fd97bf/libtcodpy.py#L1098-L1099
google/trax
d6cae2067dedd0490b78d831033607357e975015
trax/layers/initializers.py
python
InitializerFromFile
(path)
return Initializer
Loads parameters from .npy file.
Loads parameters from .npy file.
[ "Loads", "parameters", "from", ".", "npy", "file", "." ]
def InitializerFromFile(path): """Loads parameters from .npy file.""" def Initializer(shape, rng): del rng logging.info('Loading pretrained embeddings from %s', path) with tf.io.gfile.GFile(path, 'rb') as f: parameters = jnp.load(f) assert jnp.shape(parameters) == shape, ( 'Expected shape %s, got %s' % (shape, jnp.shape(parameters))) return parameters return Initializer
[ "def", "InitializerFromFile", "(", "path", ")", ":", "def", "Initializer", "(", "shape", ",", "rng", ")", ":", "del", "rng", "logging", ".", "info", "(", "'Loading pretrained embeddings from %s'", ",", "path", ")", "with", "tf", ".", "io", ".", "gfile", "....
https://github.com/google/trax/blob/d6cae2067dedd0490b78d831033607357e975015/trax/layers/initializers.py#L55-L67
robotlearn/pyrobolearn
9cd7c060723fda7d2779fa255ac998c2c82b8436
pyrobolearn/envs/env.py
python
Env.reward_range
(self)
return self._rewards.range
Return the range of the reward function; a tuple corresponding to the min and max possible rewards
Return the range of the reward function; a tuple corresponding to the min and max possible rewards
[ "Return", "the", "range", "of", "the", "reward", "function", ";", "a", "tuple", "corresponding", "to", "the", "min", "and", "max", "possible", "rewards" ]
def reward_range(self): """Return the range of the reward function; a tuple corresponding to the min and max possible rewards""" return self._rewards.range
[ "def", "reward_range", "(", "self", ")", ":", "return", "self", ".", "_rewards", ".", "range" ]
https://github.com/robotlearn/pyrobolearn/blob/9cd7c060723fda7d2779fa255ac998c2c82b8436/pyrobolearn/envs/env.py#L255-L257
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_hxb2/lib/python3.5/site-packages/wagtail_bak/api/v2/endpoints.py
python
BaseAPIEndpoint.get_meta_fields
(cls, model)
return cls._convert_api_fields(cls.meta_fields + list(getattr(model, 'api_meta_fields', ())))
[]
def get_meta_fields(cls, model): return cls._convert_api_fields(cls.meta_fields + list(getattr(model, 'api_meta_fields', ())))
[ "def", "get_meta_fields", "(", "cls", ",", "model", ")", ":", "return", "cls", ".", "_convert_api_fields", "(", "cls", ".", "meta_fields", "+", "list", "(", "getattr", "(", "model", ",", "'api_meta_fields'", ",", "(", ")", ")", ")", ")" ]
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/wagtail_bak/api/v2/endpoints.py#L111-L112
serge-sans-paille/pythran
f9f73aa5a965adc4ebcb91a439784dbe9ef911fa
pythran/analyses/range_values.py
python
RangeValuesBase.visit_Name
(self, node)
return self.add(node, self.result[node.id])
Get range for parameters for examples or false branching.
Get range for parameters for examples or false branching.
[ "Get", "range", "for", "parameters", "for", "examples", "or", "false", "branching", "." ]
def visit_Name(self, node): """ Get range for parameters for examples or false branching. """ return self.add(node, self.result[node.id])
[ "def", "visit_Name", "(", "self", ",", "node", ")", ":", "return", "self", ".", "add", "(", "node", ",", "self", ".", "result", "[", "node", ".", "id", "]", ")" ]
https://github.com/serge-sans-paille/pythran/blob/f9f73aa5a965adc4ebcb91a439784dbe9ef911fa/pythran/analyses/range_values.py#L428-L430
maurosoria/dirsearch
b83e68c8fdf360ab06be670d7b92b263262ee5b1
thirdparty/requests/cookies.py
python
cookiejar_from_dict
(cookie_dict, cookiejar=None, overwrite=True)
return cookiejar
Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. :rtype: CookieJar
Returns a CookieJar from a key/value dictionary.
[ "Returns", "a", "CookieJar", "from", "a", "key", "/", "value", "dictionary", "." ]
def cookiejar_from_dict(cookie_dict, cookiejar=None, overwrite=True): """Returns a CookieJar from a key/value dictionary. :param cookie_dict: Dict of key/values to insert into CookieJar. :param cookiejar: (optional) A cookiejar to add the cookies to. :param overwrite: (optional) If False, will not replace cookies already in the jar with new ones. :rtype: CookieJar """ if cookiejar is None: cookiejar = RequestsCookieJar() if cookie_dict is not None: names_from_jar = [cookie.name for cookie in cookiejar] for name in cookie_dict: if overwrite or (name not in names_from_jar): cookiejar.set_cookie(create_cookie(name, cookie_dict[name])) return cookiejar
[ "def", "cookiejar_from_dict", "(", "cookie_dict", ",", "cookiejar", "=", "None", ",", "overwrite", "=", "True", ")", ":", "if", "cookiejar", "is", "None", ":", "cookiejar", "=", "RequestsCookieJar", "(", ")", "if", "cookie_dict", "is", "not", "None", ":", ...
https://github.com/maurosoria/dirsearch/blob/b83e68c8fdf360ab06be670d7b92b263262ee5b1/thirdparty/requests/cookies.py#L508-L526
jantman/misc-scripts
dba5680bafbc5c5d2d9d4abcc305c57df373cd26
lastpass2vault.py
python
LastpassToVault._connect_lp
(self, lp_user)
return lp
Connect to LastPass; return the connection. :param lp_user: LastPass username :type lp_user: str :returns: connected LastPass Vault object :rtype: lastpass.vault.Vault
Connect to LastPass; return the connection.
[ "Connect", "to", "LastPass", ";", "return", "the", "connection", "." ]
def _connect_lp(self, lp_user): """ Connect to LastPass; return the connection. :param lp_user: LastPass username :type lp_user: str :returns: connected LastPass Vault object :rtype: lastpass.vault.Vault """ logger.debug('Authenticating to LastPass with username: %s', lp_user) passwd = getpass('LastPass Password: ').strip() mfa = input_func( 'LastPass MFA (OTP or YubiKey; Return for no MFA): ' ).strip() if mfa == '': logger.info('Authenticating to LastPass without MFA') lp = lastpass.Vault.open_remote(lp_user, passwd) else: logger.info('Authenticating to LastPass with MFA code %s', mfa) lp = lastpass.Vault.open_remote( lp_user, passwd, multifactor_password=mfa) return lp
[ "def", "_connect_lp", "(", "self", ",", "lp_user", ")", ":", "logger", ".", "debug", "(", "'Authenticating to LastPass with username: %s'", ",", "lp_user", ")", "passwd", "=", "getpass", "(", "'LastPass Password: '", ")", ".", "strip", "(", ")", "mfa", "=", "i...
https://github.com/jantman/misc-scripts/blob/dba5680bafbc5c5d2d9d4abcc305c57df373cd26/lastpass2vault.py#L123-L144
samuelclay/NewsBlur
2c45209df01a1566ea105e04d499367f32ac9ad2
apps/social/models.py
python
MSocialServices.set_photo
(self, service)
return profile
[]
def set_photo(self, service): profile = MSocialProfile.get_user(self.user_id) if service == 'nothing': service = None profile.photo_service = service if not service: profile.photo_url = None elif service == 'twitter': profile.photo_url = self.twitter_picture_url elif service == 'facebook': profile.photo_url = self.facebook_picture_url elif service == 'upload': profile.photo_url = self.upload_picture_url elif service == 'gravatar': user = User.objects.get(pk=self.user_id) profile.photo_url = "https://www.gravatar.com/avatar/" + \ hashlib.md5(user.email.encode('utf-8')).hexdigest() profile.save() return profile
[ "def", "set_photo", "(", "self", ",", "service", ")", ":", "profile", "=", "MSocialProfile", ".", "get_user", "(", "self", ".", "user_id", ")", "if", "service", "==", "'nothing'", ":", "service", "=", "None", "profile", ".", "photo_service", "=", "service"...
https://github.com/samuelclay/NewsBlur/blob/2c45209df01a1566ea105e04d499367f32ac9ad2/apps/social/models.py#L2693-L2712
feincms/feincms
be35576fa86083a969ae56aaf848173d1a5a3c5d
feincms/utils/managers.py
python
ActiveAwareContentManagerMixin.active
(self)
return self.apply_active_filters(self)
Return only currently active objects.
Return only currently active objects.
[ "Return", "only", "currently", "active", "objects", "." ]
def active(self): """ Return only currently active objects. """ return self.apply_active_filters(self)
[ "def", "active", "(", "self", ")", ":", "return", "self", ".", "apply_active_filters", "(", "self", ")" ]
https://github.com/feincms/feincms/blob/be35576fa86083a969ae56aaf848173d1a5a3c5d/feincms/utils/managers.py#L49-L53
visinf/n3net
5d5883a374aab343ca4091d8a072e83629d53516
src_correspondences/network.py
python
MyNetwork.comp
(self, data)
Goodie for competitors
Goodie for competitors
[ "Goodie", "for", "competitors" ]
def comp(self, data): """Goodie for competitors""" # Run competitors on dataset for test_mode in ["test", "valid"]: comp_process( test_mode, data[test_mode], getattr(self, "res_dir_" + test_mode[:2]), self.config)
[ "def", "comp", "(", "self", ",", "data", ")", ":", "# Run competitors on dataset", "for", "test_mode", "in", "[", "\"test\"", ",", "\"valid\"", "]", ":", "comp_process", "(", "test_mode", ",", "data", "[", "test_mode", "]", ",", "getattr", "(", "self", ","...
https://github.com/visinf/n3net/blob/5d5883a374aab343ca4091d8a072e83629d53516/src_correspondences/network.py#L495-L503
freqtrade/freqtrade
13651fd3be8d5ce8dcd7c94b920bda4e00b75aca
freqtrade/exchange/exchange.py
python
Exchange.validate_stakecurrency
(self, stake_currency: str)
Checks stake-currency against available currencies on the exchange. Only runs on startup. If markets have not been loaded, there's been a problem with the connection to the exchange. :param stake_currency: Stake-currency to validate :raise: OperationalException if stake-currency is not available.
Checks stake-currency against available currencies on the exchange. Only runs on startup. If markets have not been loaded, there's been a problem with the connection to the exchange. :param stake_currency: Stake-currency to validate :raise: OperationalException if stake-currency is not available.
[ "Checks", "stake", "-", "currency", "against", "available", "currencies", "on", "the", "exchange", ".", "Only", "runs", "on", "startup", ".", "If", "markets", "have", "not", "been", "loaded", "there", "s", "been", "a", "problem", "with", "the", "connection",...
def validate_stakecurrency(self, stake_currency: str) -> None: """ Checks stake-currency against available currencies on the exchange. Only runs on startup. If markets have not been loaded, there's been a problem with the connection to the exchange. :param stake_currency: Stake-currency to validate :raise: OperationalException if stake-currency is not available. """ if not self._markets: raise OperationalException( 'Could not load markets, therefore cannot start. ' 'Please investigate the above error for more details.' ) quote_currencies = self.get_quote_currencies() if stake_currency not in quote_currencies: raise OperationalException( f"{stake_currency} is not available as stake on {self.name}. " f"Available currencies are: {', '.join(quote_currencies)}")
[ "def", "validate_stakecurrency", "(", "self", ",", "stake_currency", ":", "str", ")", "->", "None", ":", "if", "not", "self", ".", "_markets", ":", "raise", "OperationalException", "(", "'Could not load markets, therefore cannot start. '", "'Please investigate the above e...
https://github.com/freqtrade/freqtrade/blob/13651fd3be8d5ce8dcd7c94b920bda4e00b75aca/freqtrade/exchange/exchange.py#L367-L384
mathics/Mathics
318e06dea8f1c70758a50cb2f95c9900150e3a68
mathics/builtin/numbers/algebra.py
python
CoefficientList.apply_noform
(self, expr, evaluation)
return evaluation.message("CoefficientList", "argtu")
CoefficientList[expr_]
CoefficientList[expr_]
[ "CoefficientList", "[", "expr_", "]" ]
def apply_noform(self, expr, evaluation): "CoefficientList[expr_]" return evaluation.message("CoefficientList", "argtu")
[ "def", "apply_noform", "(", "self", ",", "expr", ",", "evaluation", ")", ":", "return", "evaluation", ".", "message", "(", "\"CoefficientList\"", ",", "\"argtu\"", ")" ]
https://github.com/mathics/Mathics/blob/318e06dea8f1c70758a50cb2f95c9900150e3a68/mathics/builtin/numbers/algebra.py#L1317-L1319
gramps-project/gramps
04d4651a43eb210192f40a9f8c2bad8ee8fa3753
gramps/gui/editors/displaytabs/citationembedlist.py
python
CitationEmbedList._handle_drag
(self, row, handle)
A CITATION_LINK has been dragged
A CITATION_LINK has been dragged
[ "A", "CITATION_LINK", "has", "been", "dragged" ]
def _handle_drag(self, row, handle): """ A CITATION_LINK has been dragged """ if handle: objct = self.dbstate.db.get_citation_from_handle(handle) if isinstance(objct, Citation): try: from .. import EditCitation EditCitation(self.dbstate, self.uistate, self.track, objct, callback=self.add_callback, callertitle=self.callertitle) except WindowActiveError: from ...dialog import WarningDialog WarningDialog(_("Cannot share this reference"), self.__blocked_text(), parent=self.uistate.window) else: raise ValueError("selection must be either source or citation")
[ "def", "_handle_drag", "(", "self", ",", "row", ",", "handle", ")", ":", "if", "handle", ":", "objct", "=", "self", ".", "dbstate", ".", "db", ".", "get_citation_from_handle", "(", "handle", ")", "if", "isinstance", "(", "objct", ",", "Citation", ")", ...
https://github.com/gramps-project/gramps/blob/04d4651a43eb210192f40a9f8c2bad8ee8fa3753/gramps/gui/editors/displaytabs/citationembedlist.py#L246-L264
Source-Python-Dev-Team/Source.Python
d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb
addons/source-python/Python3/operator.py
python
truth
(a)
return True if a else False
Return True if a is true, False otherwise.
Return True if a is true, False otherwise.
[ "Return", "True", "if", "a", "is", "true", "False", "otherwise", "." ]
def truth(a): "Return True if a is true, False otherwise." return True if a else False
[ "def", "truth", "(", "a", ")", ":", "return", "True", "if", "a", "else", "False" ]
https://github.com/Source-Python-Dev-Team/Source.Python/blob/d0ffd8ccbd1e9923c9bc44936f20613c1c76b7fb/addons/source-python/Python3/operator.py#L57-L59
allegroai/clearml
5953dc6eefadcdfcc2bdbb6a0da32be58823a5af
examples/frameworks/scikit-learn/sklearn_matplotlib_example.py
python
plot_learning_curve
(estimator, title, X, y, axes=None, ylim=None, cv=None, n_jobs=None, train_sizes=np.linspace(.1, 1.0, 5))
return plt
Generate 3 plots: the test and training learning curve, the training samples vs fit times curve, the fit times vs score curve. Parameters ---------- estimator : object type that implements the "fit" and "predict" methods An object of that type which is cloned for each validation. title : string Title for the chart. X : array-like, shape (n_samples, n_features) Training vector, where n_samples is the number of samples and n_features is the number of features. y : array-like, shape (n_samples) or (n_samples, n_features), optional Target relative to X for classification or regression; None for unsupervised learning. axes : array of 3 axes, optional (default=None) Axes to use for plotting the curves. ylim : tuple, shape (ymin, ymax), optional Defines minimum and maximum yvalues plotted. cv : int, cross-validation generator or an iterable, optional Determines the cross-validation splitting strategy. Possible inputs for cv are: - None, to use the default 5-fold cross-validation, - integer, to specify the number of folds. - :term:`CV splitter`, - An iterable yielding (train, test) splits as arrays of indices. For integer/None inputs, if ``y`` is binary or multiclass, :class:`StratifiedKFold` used. If the estimator is not a classifier or if ``y`` is neither binary nor multiclass, :class:`KFold` is used. Refer :ref:`User Guide <cross_validation>` for the various cross-validators that can be used here. n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary <n_jobs>` for more details. train_sizes : array-like, shape (n_ticks,), dtype float or int Relative or absolute numbers of training examples that will be used to generate the learning curve. If the dtype is float, it is regarded as a fraction of the maximum size of the training set (that is determined by the selected validation method), i.e. it has to be within (0, 1]. Otherwise it is interpreted as absolute sizes of the training sets. Note that for classification the number of samples usually have to be big enough to contain at least one sample from each class. (default: np.linspace(0.1, 1.0, 5))
Generate 3 plots: the test and training learning curve, the training samples vs fit times curve, the fit times vs score curve.
[ "Generate", "3", "plots", ":", "the", "test", "and", "training", "learning", "curve", "the", "training", "samples", "vs", "fit", "times", "curve", "the", "fit", "times", "vs", "score", "curve", "." ]
def plot_learning_curve(estimator, title, X, y, axes=None, ylim=None, cv=None, n_jobs=None, train_sizes=np.linspace(.1, 1.0, 5)): """ Generate 3 plots: the test and training learning curve, the training samples vs fit times curve, the fit times vs score curve. Parameters ---------- estimator : object type that implements the "fit" and "predict" methods An object of that type which is cloned for each validation. title : string Title for the chart. X : array-like, shape (n_samples, n_features) Training vector, where n_samples is the number of samples and n_features is the number of features. y : array-like, shape (n_samples) or (n_samples, n_features), optional Target relative to X for classification or regression; None for unsupervised learning. axes : array of 3 axes, optional (default=None) Axes to use for plotting the curves. ylim : tuple, shape (ymin, ymax), optional Defines minimum and maximum yvalues plotted. cv : int, cross-validation generator or an iterable, optional Determines the cross-validation splitting strategy. Possible inputs for cv are: - None, to use the default 5-fold cross-validation, - integer, to specify the number of folds. - :term:`CV splitter`, - An iterable yielding (train, test) splits as arrays of indices. For integer/None inputs, if ``y`` is binary or multiclass, :class:`StratifiedKFold` used. If the estimator is not a classifier or if ``y`` is neither binary nor multiclass, :class:`KFold` is used. Refer :ref:`User Guide <cross_validation>` for the various cross-validators that can be used here. n_jobs : int or None, optional (default=None) Number of jobs to run in parallel. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary <n_jobs>` for more details. train_sizes : array-like, shape (n_ticks,), dtype float or int Relative or absolute numbers of training examples that will be used to generate the learning curve. If the dtype is float, it is regarded as a fraction of the maximum size of the training set (that is determined by the selected validation method), i.e. it has to be within (0, 1]. Otherwise it is interpreted as absolute sizes of the training sets. Note that for classification the number of samples usually have to be big enough to contain at least one sample from each class. (default: np.linspace(0.1, 1.0, 5)) """ if axes is None: _, axes = plt.subplots(1, 3, figsize=(20, 5)) axes[0].set_title(title) if ylim is not None: axes[0].set_ylim(*ylim) axes[0].set_xlabel("Training examples") axes[0].set_ylabel("Score") train_sizes, train_scores, test_scores, fit_times, _ = \ learning_curve(estimator, X, y, cv=cv, n_jobs=n_jobs, train_sizes=train_sizes, return_times=True) train_scores_mean = np.mean(train_scores, axis=1) train_scores_std = np.std(train_scores, axis=1) test_scores_mean = np.mean(test_scores, axis=1) test_scores_std = np.std(test_scores, axis=1) fit_times_mean = np.mean(fit_times, axis=1) fit_times_std = np.std(fit_times, axis=1) # Plot learning curve axes[0].grid() axes[0].fill_between(train_sizes, train_scores_mean - train_scores_std, train_scores_mean + train_scores_std, alpha=0.1, color="r") axes[0].fill_between(train_sizes, test_scores_mean - test_scores_std, test_scores_mean + test_scores_std, alpha=0.1, color="g") axes[0].plot(train_sizes, train_scores_mean, 'o-', color="r", label="Training score") axes[0].plot(train_sizes, test_scores_mean, 'o-', color="g", label="Cross-validation score") axes[0].legend(loc="best") # Plot n_samples vs fit_times axes[1].grid() axes[1].plot(train_sizes, fit_times_mean, 'o-') axes[1].fill_between(train_sizes, fit_times_mean - fit_times_std, fit_times_mean + fit_times_std, alpha=0.1) axes[1].set_xlabel("Training examples") axes[1].set_ylabel("fit_times") axes[1].set_title("Scalability of the model") # Plot fit_time vs score axes[2].grid() axes[2].plot(fit_times_mean, test_scores_mean, 'o-') axes[2].fill_between(fit_times_mean, test_scores_mean - test_scores_std, test_scores_mean + test_scores_std, alpha=0.1) axes[2].set_xlabel("fit_times") axes[2].set_ylabel("Score") axes[2].set_title("Performance of the model") return plt
[ "def", "plot_learning_curve", "(", "estimator", ",", "title", ",", "X", ",", "y", ",", "axes", "=", "None", ",", "ylim", "=", "None", ",", "cv", "=", "None", ",", "n_jobs", "=", "None", ",", "train_sizes", "=", "np", ".", "linspace", "(", ".1", ","...
https://github.com/allegroai/clearml/blob/5953dc6eefadcdfcc2bdbb6a0da32be58823a5af/examples/frameworks/scikit-learn/sklearn_matplotlib_example.py#L12-L124
nextml/NEXT
4c8f4d5a66376a18c047f4c9409f73c75925bf07
apps/PoolBasedTripletMDS/algs/UncertaintySampling/utilsMDS.py
python
computeEmbedding
(n,d,S,num_random_restarts=0,max_num_passes=0,max_iter_GD=0,max_norm=0,epsilon=0.01,verbose=False)
return X_old,emp_loss_old
Computes an embedding of n objects in d dimensions usin the triplets of S. S is a list of triplets such that for each q in S, q = [i,j,k] means that object k should be closer to i than j. Inputs: (int) n : number of objects in embedding (int) d : desired dimension (list [(int) i, (int) j,(int) k]) S : list of triplets, i,j,k must be in [n]. (int) num_random_restarts : number of random restarts (nonconvex optimization, may converge to local minima). E.g., 9 random restarts means take the best of 10 runs of the optimization routine. (int) max_num_passes : maximum number of passes over data SGD makes before proceeding to GD (default equals 16) (int) max_iter_GD: maximum number of GD iteration (default equals 50) (float) max_norm : the maximum allowed norm of any one object (default equals 10*d) (float) epsilon : parameter that controls stopping condition, smaller means more accurate (default = 0.01) (boolean) verbose : outputs some progress (default equals False) Outputs: (numpy.ndarray) X : output embedding (float) gamma : Equal to a/b where a is max row norm of the gradient matrix and b is the avg row norm of the centered embedding matrix X. This is a means to determine how close the current solution is to the "best" solution.
Computes an embedding of n objects in d dimensions usin the triplets of S. S is a list of triplets such that for each q in S, q = [i,j,k] means that object k should be closer to i than j.
[ "Computes", "an", "embedding", "of", "n", "objects", "in", "d", "dimensions", "usin", "the", "triplets", "of", "S", ".", "S", "is", "a", "list", "of", "triplets", "such", "that", "for", "each", "q", "in", "S", "q", "=", "[", "i", "j", "k", "]", "...
def computeEmbedding(n,d,S,num_random_restarts=0,max_num_passes=0,max_iter_GD=0,max_norm=0,epsilon=0.01,verbose=False): """ Computes an embedding of n objects in d dimensions usin the triplets of S. S is a list of triplets such that for each q in S, q = [i,j,k] means that object k should be closer to i than j. Inputs: (int) n : number of objects in embedding (int) d : desired dimension (list [(int) i, (int) j,(int) k]) S : list of triplets, i,j,k must be in [n]. (int) num_random_restarts : number of random restarts (nonconvex optimization, may converge to local minima). E.g., 9 random restarts means take the best of 10 runs of the optimization routine. (int) max_num_passes : maximum number of passes over data SGD makes before proceeding to GD (default equals 16) (int) max_iter_GD: maximum number of GD iteration (default equals 50) (float) max_norm : the maximum allowed norm of any one object (default equals 10*d) (float) epsilon : parameter that controls stopping condition, smaller means more accurate (default = 0.01) (boolean) verbose : outputs some progress (default equals False) Outputs: (numpy.ndarray) X : output embedding (float) gamma : Equal to a/b where a is max row norm of the gradient matrix and b is the avg row norm of the centered embedding matrix X. This is a means to determine how close the current solution is to the "best" solution. """ if max_num_passes==0: max_num_passes_SGD = 16 else: max_num_passes_SGD = max_num_passes if max_iter_GD ==0: max_iter_GD = 50 X_old = None emp_loss_old = float('inf') num_restarts = -1 while num_restarts < num_random_restarts: num_restarts += 1 ts = time.time() X,acc = computeEmbeddingWithEpochSGD(n,d,S,max_num_passes=max_num_passes_SGD,max_norm=max_norm,epsilon=epsilon,verbose=verbose) te_sgd = time.time()-ts ts = time.time() X_new,emp_loss_new,hinge_loss_new,acc_new = computeEmbeddingWithGD(X,S,max_iters=max_iter_GD,max_norm=max_norm,epsilon=epsilon,verbose=verbose) te_gd = time.time()-ts if emp_loss_new<emp_loss_old: X_old = X_new emp_loss_old = emp_loss_new if verbose: print "restart %d: emp_loss = %f, hinge_loss = %f, duration=%f+%f" %(num_restarts,emp_loss_new,hinge_loss_new,te_sgd,te_gd) return X_old,emp_loss_old
[ "def", "computeEmbedding", "(", "n", ",", "d", ",", "S", ",", "num_random_restarts", "=", "0", ",", "max_num_passes", "=", "0", ",", "max_iter_GD", "=", "0", ",", "max_norm", "=", "0", ",", "epsilon", "=", "0.01", ",", "verbose", "=", "False", ")", "...
https://github.com/nextml/NEXT/blob/4c8f4d5a66376a18c047f4c9409f73c75925bf07/apps/PoolBasedTripletMDS/algs/UncertaintySampling/utilsMDS.py#L196-L252
Azure/azure-devops-cli-extension
11334cd55806bef0b99c3bee5a438eed71e44037
azure-devops/azext_devops/dev/pipelines/pipeline_run.py
python
pipeline_run_add_tag
(run_id, tags, organization=None, project=None, detect=None)
return tags
Add tag(s) for a pipeline run. :param run_id: ID of the pipeline run. :type run_id: int :param tags: Tag(s) to be added to the pipeline run. [Comma seperated values] :type tags: str :rtype: list of str
Add tag(s) for a pipeline run. :param run_id: ID of the pipeline run. :type run_id: int :param tags: Tag(s) to be added to the pipeline run. [Comma seperated values] :type tags: str :rtype: list of str
[ "Add", "tag", "(", "s", ")", "for", "a", "pipeline", "run", ".", ":", "param", "run_id", ":", "ID", "of", "the", "pipeline", "run", ".", ":", "type", "run_id", ":", "int", ":", "param", "tags", ":", "Tag", "(", "s", ")", "to", "be", "added", "t...
def pipeline_run_add_tag(run_id, tags, organization=None, project=None, detect=None): """ Add tag(s) for a pipeline run. :param run_id: ID of the pipeline run. :type run_id: int :param tags: Tag(s) to be added to the pipeline run. [Comma seperated values] :type tags: str :rtype: list of str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_build_client(organization) tags = list(map(str, tags.split(','))) if len(tags) == 1: tags = client.add_build_tag( project=project, build_id=run_id, tag=tags[0]) else: tags = client.add_build_tags( tags=tags, project=project, build_id=run_id) return tags
[ "def", "pipeline_run_add_tag", "(", "run_id", ",", "tags", ",", "organization", "=", "None", ",", "project", "=", "None", ",", "detect", "=", "None", ")", ":", "organization", ",", "project", "=", "resolve_instance_and_project", "(", "detect", "=", "detect", ...
https://github.com/Azure/azure-devops-cli-extension/blob/11334cd55806bef0b99c3bee5a438eed71e44037/azure-devops/azext_devops/dev/pipelines/pipeline_run.py#L90-L109
twilio/twilio-python
6e1e811ea57a1edfadd5161ace87397c563f6915
twilio/rest/preview/deployed_devices/fleet/deployment.py
python
DeploymentList.stream
(self, limit=None, page_size=None)
return self._version.stream(page, limits['limit'])
Streams DeploymentInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentInstance]
Streams DeploymentInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient.
[ "Streams", "DeploymentInstance", "records", "from", "the", "API", "as", "a", "generator", "stream", ".", "This", "operation", "lazily", "loads", "records", "as", "efficiently", "as", "possible", "until", "the", "limit", "is", "reached", ".", "The", "results", ...
def stream(self, limit=None, page_size=None): """ Streams DeploymentInstance records from the API as a generator stream. This operation lazily loads records as efficiently as possible until the limit is reached. The results are returned as a generator, so this operation is memory efficient. :param int limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param int page_size: Number of records to fetch per request, when not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000) :returns: Generator that will yield up to limit results :rtype: list[twilio.rest.preview.deployed_devices.fleet.deployment.DeploymentInstance] """ limits = self._version.read_limits(limit, page_size) page = self.page(page_size=limits['page_size'], ) return self._version.stream(page, limits['limit'])
[ "def", "stream", "(", "self", ",", "limit", "=", "None", ",", "page_size", "=", "None", ")", ":", "limits", "=", "self", ".", "_version", ".", "read_limits", "(", "limit", ",", "page_size", ")", "page", "=", "self", ".", "page", "(", "page_size", "="...
https://github.com/twilio/twilio-python/blob/6e1e811ea57a1edfadd5161ace87397c563f6915/twilio/rest/preview/deployed_devices/fleet/deployment.py#L54-L75
PanJinquan/tensorflow_models_learning
e7a2773d526e01c76fc8366868099ca3d7a819b4
slim/datasets/download_and_convert_mnist.py
python
_extract_labels
(filename, num_labels)
return labels
Extract the labels into a vector of int64 label IDs. Args: filename: The path to an MNIST labels file. num_labels: The number of labels in the file. Returns: A numpy array of shape [number_of_labels]
Extract the labels into a vector of int64 label IDs.
[ "Extract", "the", "labels", "into", "a", "vector", "of", "int64", "label", "IDs", "." ]
def _extract_labels(filename, num_labels): """Extract the labels into a vector of int64 label IDs. Args: filename: The path to an MNIST labels file. num_labels: The number of labels in the file. Returns: A numpy array of shape [number_of_labels] """ print('Extracting labels from: ', filename) with gzip.open(filename) as bytestream: bytestream.read(8) buf = bytestream.read(1 * num_labels) labels = np.frombuffer(buf, dtype=np.uint8).astype(np.int64) return labels
[ "def", "_extract_labels", "(", "filename", ",", "num_labels", ")", ":", "print", "(", "'Extracting labels from: '", ",", "filename", ")", "with", "gzip", ".", "open", "(", "filename", ")", "as", "bytestream", ":", "bytestream", ".", "read", "(", "8", ")", ...
https://github.com/PanJinquan/tensorflow_models_learning/blob/e7a2773d526e01c76fc8366868099ca3d7a819b4/slim/datasets/download_and_convert_mnist.py#L84-L99
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/site-packages/yaml/__init__.py
python
safe_dump_all
(documents, stream=None, **kwds)
return dump_all(documents, stream, Dumper=SafeDumper, **kwds)
Serialize a sequence of Python objects into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead.
Serialize a sequence of Python objects into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead.
[ "Serialize", "a", "sequence", "of", "Python", "objects", "into", "a", "YAML", "stream", ".", "Produce", "only", "basic", "YAML", "tags", ".", "If", "stream", "is", "None", "return", "the", "produced", "string", "instead", "." ]
def safe_dump_all(documents, stream=None, **kwds): """ Serialize a sequence of Python objects into a YAML stream. Produce only basic YAML tags. If stream is None, return the produced string instead. """ return dump_all(documents, stream, Dumper=SafeDumper, **kwds)
[ "def", "safe_dump_all", "(", "documents", ",", "stream", "=", "None", ",", "*", "*", "kwds", ")", ":", "return", "dump_all", "(", "documents", ",", "stream", ",", "Dumper", "=", "SafeDumper", ",", "*", "*", "kwds", ")" ]
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/yaml/__init__.py#L292-L298
baidu/DuReader
43577e29435f5abcb7b02ce6a0019b3f42b1221d
DuReader-2.0/paddle/vocab.py
python
Vocab.get_token
(self, idx)
gets the token corresponding to idx, returns unk token if idx is not in vocab Args: idx: an integer returns: a token string
gets the token corresponding to idx, returns unk token if idx is not in vocab Args: idx: an integer returns: a token string
[ "gets", "the", "token", "corresponding", "to", "idx", "returns", "unk", "token", "if", "idx", "is", "not", "in", "vocab", "Args", ":", "idx", ":", "an", "integer", "returns", ":", "a", "token", "string" ]
def get_token(self, idx): """ gets the token corresponding to idx, returns unk token if idx is not in vocab Args: idx: an integer returns: a token string """ try: return self.id2token[idx] except KeyError: return self.unk_token
[ "def", "get_token", "(", "self", ",", "idx", ")", ":", "try", ":", "return", "self", ".", "id2token", "[", "idx", "]", "except", "KeyError", ":", "return", "self", ".", "unk_token" ]
https://github.com/baidu/DuReader/blob/43577e29435f5abcb7b02ce6a0019b3f42b1221d/DuReader-2.0/paddle/vocab.py#L82-L93
benedekrozemberczki/GAM
cd66582215d6f06441ce93981e76af0214b292f3
src/utils.py
python
tab_printer
(args)
Function to print the logs in a nice tabular format. :param args: Parameters used for the model.
Function to print the logs in a nice tabular format. :param args: Parameters used for the model.
[ "Function", "to", "print", "the", "logs", "in", "a", "nice", "tabular", "format", ".", ":", "param", "args", ":", "Parameters", "used", "for", "the", "model", "." ]
def tab_printer(args): """ Function to print the logs in a nice tabular format. :param args: Parameters used for the model. """ args = vars(args) keys = sorted(args.keys()) t = Texttable() t.add_rows([["Parameter", "Value"]]) t.add_rows([[k.replace("_", " ").capitalize(), args[k]] for k in keys]) print(t.draw())
[ "def", "tab_printer", "(", "args", ")", ":", "args", "=", "vars", "(", "args", ")", "keys", "=", "sorted", "(", "args", ".", "keys", "(", ")", ")", "t", "=", "Texttable", "(", ")", "t", ".", "add_rows", "(", "[", "[", "\"Parameter\"", ",", "\"Val...
https://github.com/benedekrozemberczki/GAM/blob/cd66582215d6f06441ce93981e76af0214b292f3/src/utils.py#L11-L21
francisck/DanderSpritz_docs
86bb7caca5a957147f120b18bb5c31f299914904
Python/Core/Lib/sysconfig.py
python
get_config_vars
(*args)
With no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary.
With no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary.
[ "With", "no", "arguments", "return", "a", "dictionary", "of", "all", "configuration", "variables", "relevant", "for", "the", "current", "platform", ".", "On", "Unix", "this", "means", "every", "variable", "defined", "in", "Python", "s", "installed", "Makefile", ...
def get_config_vars(*args): """With no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. """ global _CONFIG_VARS import re if _CONFIG_VARS is None: _CONFIG_VARS = {} _CONFIG_VARS['prefix'] = _PREFIX _CONFIG_VARS['exec_prefix'] = _EXEC_PREFIX _CONFIG_VARS['py_version'] = _PY_VERSION _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT _CONFIG_VARS['py_version_nodot'] = _PY_VERSION[0] + _PY_VERSION[2] _CONFIG_VARS['base'] = _PREFIX _CONFIG_VARS['platbase'] = _EXEC_PREFIX _CONFIG_VARS['projectbase'] = _PROJECT_BASE if os.name in ('nt', 'os2'): _init_non_posix(_CONFIG_VARS) if os.name == 'posix': _init_posix(_CONFIG_VARS) _CONFIG_VARS['userbase'] = _getuserbase() if 'srcdir' not in _CONFIG_VARS: _CONFIG_VARS['srcdir'] = _PROJECT_BASE if _PYTHON_BUILD and os.name == 'posix': base = _PROJECT_BASE try: cwd = os.getcwd() except OSError: cwd = None if not os.path.isabs(_CONFIG_VARS['srcdir']) and base != cwd: srcdir = os.path.join(base, _CONFIG_VARS['srcdir']) _CONFIG_VARS['srcdir'] = os.path.normpath(srcdir) if sys.platform == 'darwin': kernel_version = os.uname()[2] major_version = int(kernel_version.split('.')[0]) if major_version < 8: for key in ('LDFLAGS', 'BASECFLAGS', 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _CONFIG_VARS[key] flags = re.sub('-arch\\s+\\w+\\s', ' ', flags) flags = re.sub('-isysroot [^ \t]*', ' ', flags) _CONFIG_VARS[key] = flags else: if 'ARCHFLAGS' in os.environ: arch = os.environ['ARCHFLAGS'] for key in ('LDFLAGS', 'BASECFLAGS', 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _CONFIG_VARS[key] flags = re.sub('-arch\\s+\\w+\\s', ' ', flags) flags = flags + ' ' + arch _CONFIG_VARS[key] = flags CFLAGS = _CONFIG_VARS.get('CFLAGS', '') m = re.search('-isysroot\\s+(\\S+)', CFLAGS) if m is not None: sdk = m.group(1) if not os.path.exists(sdk): for key in ('LDFLAGS', 'BASECFLAGS', 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _CONFIG_VARS[key] flags = re.sub('-isysroot\\s+\\S+(\\s|$)', ' ', flags) _CONFIG_VARS[key] = flags if args: vals = [] for name in args: vals.append(_CONFIG_VARS.get(name)) return vals else: return _CONFIG_VARS return
[ "def", "get_config_vars", "(", "*", "args", ")", ":", "global", "_CONFIG_VARS", "import", "re", "if", "_CONFIG_VARS", "is", "None", ":", "_CONFIG_VARS", "=", "{", "}", "_CONFIG_VARS", "[", "'prefix'", "]", "=", "_PREFIX", "_CONFIG_VARS", "[", "'exec_prefix'", ...
https://github.com/francisck/DanderSpritz_docs/blob/86bb7caca5a957147f120b18bb5c31f299914904/Python/Core/Lib/sysconfig.py#L375-L452
ahmetcemturan/SFACT
7576e29ba72b33e5058049b77b7b558875542747
fabmetheus_utilities/geometry/geometry_utilities/matrix.py
python
getTransformedVector3
(tetragrid, vector3)
return getTransformedVector3Blindly(tetragrid, vector3)
Get the vector3 multiplied by a matrix.
Get the vector3 multiplied by a matrix.
[ "Get", "the", "vector3", "multiplied", "by", "a", "matrix", "." ]
def getTransformedVector3(tetragrid, vector3): 'Get the vector3 multiplied by a matrix.' if getIsIdentityTetragridOrNone(tetragrid): return vector3.copy() return getTransformedVector3Blindly(tetragrid, vector3)
[ "def", "getTransformedVector3", "(", "tetragrid", ",", "vector3", ")", ":", "if", "getIsIdentityTetragridOrNone", "(", "tetragrid", ")", ":", "return", "vector3", ".", "copy", "(", ")", "return", "getTransformedVector3Blindly", "(", "tetragrid", ",", "vector3", ")...
https://github.com/ahmetcemturan/SFACT/blob/7576e29ba72b33e5058049b77b7b558875542747/fabmetheus_utilities/geometry/geometry_utilities/matrix.py#L351-L355
akshaybahadur21/Digit-Recognizer
703fa8728d4a053af37fe07a97169b776520e01b
Digit-Recognizer/Digit_Recognizer_DL.py
python
softmax
(z)
return sm, cache
[]
def softmax(z): cache = z z -= np.max(z) sm = (np.exp(z).T / np.sum(np.exp(z), axis=1)) return sm, cache
[ "def", "softmax", "(", "z", ")", ":", "cache", "=", "z", "z", "-=", "np", ".", "max", "(", "z", ")", "sm", "=", "(", "np", ".", "exp", "(", "z", ")", ".", "T", "/", "np", ".", "sum", "(", "np", ".", "exp", "(", "z", ")", ",", "axis", ...
https://github.com/akshaybahadur21/Digit-Recognizer/blob/703fa8728d4a053af37fe07a97169b776520e01b/Digit-Recognizer/Digit_Recognizer_DL.py#L5-L9
vertexproject/synapse
8173f43cb5fba5ca2648d12a659afb432139b0a7
synapse/lib/hive.py
python
Hive.open
(self, full)
return await self._getHiveNode(full)
Open and return a hive Node(). Args: full (tuple): A full path tuple. Returns: Node: A Hive node.
Open and return a hive Node().
[ "Open", "and", "return", "a", "hive", "Node", "()", "." ]
async def open(self, full): ''' Open and return a hive Node(). Args: full (tuple): A full path tuple. Returns: Node: A Hive node. ''' return await self._getHiveNode(full)
[ "async", "def", "open", "(", "self", ",", "full", ")", ":", "return", "await", "self", ".", "_getHiveNode", "(", "full", ")" ]
https://github.com/vertexproject/synapse/blob/8173f43cb5fba5ca2648d12a659afb432139b0a7/synapse/lib/hive.py#L299-L309
andresriancho/w3af
cd22e5252243a87aaa6d0ddea47cf58dacfe00a9
w3af/plugins/attack/db/sqlmap/tamper/versionedmorekeywords.py
python
tamper
(payload, **kwargs)
return retVal
Encloses each keyword with versioned MySQL comment Requirement: * MySQL >= 5.1.13 Tested against: * MySQL 5.1.56, 5.5.11 Notes: * Useful to bypass several web application firewalls when the back-end database management system is MySQL >>> tamper('1 UNION ALL SELECT NULL, NULL, CONCAT(CHAR(58,122,114,115,58),IFNULL(CAST(CURRENT_USER() AS CHAR),CHAR(32)),CHAR(58,115,114,121,58))#') '1/*!UNION*//*!ALL*//*!SELECT*//*!NULL*/,/*!NULL*/,/*!CONCAT*/(/*!CHAR*/(58,122,114,115,58),/*!IFNULL*/(CAST(/*!CURRENT_USER*/()/*!AS*//*!CHAR*/),/*!CHAR*/(32)),/*!CHAR*/(58,115,114,121,58))#'
Encloses each keyword with versioned MySQL comment
[ "Encloses", "each", "keyword", "with", "versioned", "MySQL", "comment" ]
def tamper(payload, **kwargs): """ Encloses each keyword with versioned MySQL comment Requirement: * MySQL >= 5.1.13 Tested against: * MySQL 5.1.56, 5.5.11 Notes: * Useful to bypass several web application firewalls when the back-end database management system is MySQL >>> tamper('1 UNION ALL SELECT NULL, NULL, CONCAT(CHAR(58,122,114,115,58),IFNULL(CAST(CURRENT_USER() AS CHAR),CHAR(32)),CHAR(58,115,114,121,58))#') '1/*!UNION*//*!ALL*//*!SELECT*//*!NULL*/,/*!NULL*/,/*!CONCAT*/(/*!CHAR*/(58,122,114,115,58),/*!IFNULL*/(CAST(/*!CURRENT_USER*/()/*!AS*//*!CHAR*/),/*!CHAR*/(32)),/*!CHAR*/(58,115,114,121,58))#' """ def process(match): word = match.group('word') if word.upper() in kb.keywords and word.upper() not in IGNORE_SPACE_AFFECTED_KEYWORDS: return match.group().replace(word, "/*!%s*/" % word) else: return match.group() retVal = payload if payload: retVal = re.sub(r"(?<=\W)(?P<word>[A-Za-z_]+)(?=\W|\Z)", lambda match: process(match), retVal) retVal = retVal.replace(" /*!", "/*!").replace("*/ ", "*/") return retVal
[ "def", "tamper", "(", "payload", ",", "*", "*", "kwargs", ")", ":", "def", "process", "(", "match", ")", ":", "word", "=", "match", ".", "group", "(", "'word'", ")", "if", "word", ".", "upper", "(", ")", "in", "kb", ".", "keywords", "and", "word"...
https://github.com/andresriancho/w3af/blob/cd22e5252243a87aaa6d0ddea47cf58dacfe00a9/w3af/plugins/attack/db/sqlmap/tamper/versionedmorekeywords.py#L22-L53
Yuliang-Liu/Box_Discretization_Network
5b3a30c97429ef8e5c5e1c4e2476c7d9abdc03e6
maskrcnn_benchmark/utils/c2_model_loading.py
python
load_resnet_c2_format
(cfg, f)
return dict(model=state_dict)
[]
def load_resnet_c2_format(cfg, f): state_dict = _load_c2_pickled_weights(f) conv_body = cfg.MODEL.BACKBONE.CONV_BODY arch = conv_body.replace("-C4", "").replace("-C5", "").replace("-FPN", "") arch = arch.replace("-RETINANET", "").replace("-PAN", "") stages = _C2_STAGE_NAMES[arch] state_dict = _rename_weights_for_resnet(state_dict, stages) return dict(model=state_dict)
[ "def", "load_resnet_c2_format", "(", "cfg", ",", "f", ")", ":", "state_dict", "=", "_load_c2_pickled_weights", "(", "f", ")", "conv_body", "=", "cfg", ".", "MODEL", ".", "BACKBONE", ".", "CONV_BODY", "arch", "=", "conv_body", ".", "replace", "(", "\"-C4\"", ...
https://github.com/Yuliang-Liu/Box_Discretization_Network/blob/5b3a30c97429ef8e5c5e1c4e2476c7d9abdc03e6/maskrcnn_benchmark/utils/c2_model_loading.py#L166-L173
apple/ccs-calendarserver
13c706b985fb728b9aab42dc0fef85aae21921c3
twistedcaldav/method/report_common.py
python
responseForHref
(request, responses, href, resource, propertiesForResource, propertyreq, isowner=True, calendar=None, timezone=None, vcard=None)
return d
Create an appropriate property status response for the given resource. @param request: the L{IRequest} for the current request. @param responses: the list of responses to append the result of this method to. @param href: the L{HRef} element of the resource being targeted. @param resource: the L{CalDAVResource} for the targeted resource. @param calendar: the L{Component} for the calendar for the resource. This may be None if the calendar has not already been read in, in which case the resource will be used to get the calendar if needed. @param vcard: the L{Component} for the vcard for the resource. This may be None if the vcard has not already been read in, in which case the resource will be used to get the vcard if needed. @param propertiesForResource: the method to use to get the list of properties to return. This is a callable object with a signature matching that of L{allPropertiesForResource}. @param propertyreq: the L{PropertyContainer} element for the properties of interest. @param isowner: C{True} if the authorized principal making the request is the DAV:owner, C{False} otherwise.
Create an appropriate property status response for the given resource.
[ "Create", "an", "appropriate", "property", "status", "response", "for", "the", "given", "resource", "." ]
def responseForHref(request, responses, href, resource, propertiesForResource, propertyreq, isowner=True, calendar=None, timezone=None, vcard=None): """ Create an appropriate property status response for the given resource. @param request: the L{IRequest} for the current request. @param responses: the list of responses to append the result of this method to. @param href: the L{HRef} element of the resource being targeted. @param resource: the L{CalDAVResource} for the targeted resource. @param calendar: the L{Component} for the calendar for the resource. This may be None if the calendar has not already been read in, in which case the resource will be used to get the calendar if needed. @param vcard: the L{Component} for the vcard for the resource. This may be None if the vcard has not already been read in, in which case the resource will be used to get the vcard if needed. @param propertiesForResource: the method to use to get the list of properties to return. This is a callable object with a signature matching that of L{allPropertiesForResource}. @param propertyreq: the L{PropertyContainer} element for the properties of interest. @param isowner: C{True} if the authorized principal making the request is the DAV:owner, C{False} otherwise. """ def _defer(properties_by_status): propstats = [] for status in properties_by_status: properties = properties_by_status[status] if properties: xml_status = element.Status.fromResponseCode(status) xml_container = element.PropertyContainer(*properties) xml_propstat = element.PropertyStatus(xml_container, xml_status) propstats.append(xml_propstat) # Always need to have at least one propstat present (required by Prefer header behavior) if len(propstats) == 0: propstats.append(element.PropertyStatus( element.PropertyContainer(), element.Status.fromResponseCode(responsecode.OK) )) if propstats: responses.append(element.PropertyStatusResponse(href, *propstats)) d = propertiesForResource(request, propertyreq, resource, calendar, timezone, vcard, isowner) d.addCallback(_defer) return d
[ "def", "responseForHref", "(", "request", ",", "responses", ",", "href", ",", "resource", ",", "propertiesForResource", ",", "propertyreq", ",", "isowner", "=", "True", ",", "calendar", "=", "None", ",", "timezone", "=", "None", ",", "vcard", "=", "None", ...
https://github.com/apple/ccs-calendarserver/blob/13c706b985fb728b9aab42dc0fef85aae21921c3/twistedcaldav/method/report_common.py#L133-L181
pyfa-org/Pyfa
feaa52c36beeda21ab380fc74d8f871b81d49729
eos/gamedata.py
python
Effect.activeByDefault
(self, value)
Just assign the input values to the activeByDefault attribute. You *could* do something more interesting here if you wanted.
Just assign the input values to the activeByDefault attribute. You *could* do something more interesting here if you wanted.
[ "Just", "assign", "the", "input", "values", "to", "the", "activeByDefault", "attribute", ".", "You", "*", "could", "*", "do", "something", "more", "interesting", "here", "if", "you", "wanted", "." ]
def activeByDefault(self, value): """ Just assign the input values to the activeByDefault attribute. You *could* do something more interesting here if you wanted. """ self.__activeByDefault = value
[ "def", "activeByDefault", "(", "self", ",", "value", ")", ":", "self", ".", "__activeByDefault", "=", "value" ]
https://github.com/pyfa-org/Pyfa/blob/feaa52c36beeda21ab380fc74d8f871b81d49729/eos/gamedata.py#L117-L122
khanhnamle1994/natural-language-processing
01d450d5ac002b0156ef4cf93a07cb508c1bcdc5
assignment1/.env/lib/python2.7/site-packages/pip/vcs/git.py
python
Git.get_short_refs
(self, location)
return rv
Return map of named refs (branches or tags) to commit hashes.
Return map of named refs (branches or tags) to commit hashes.
[ "Return", "map", "of", "named", "refs", "(", "branches", "or", "tags", ")", "to", "commit", "hashes", "." ]
def get_short_refs(self, location): """Return map of named refs (branches or tags) to commit hashes.""" rv = {} for commit, ref in self.get_full_refs(location): ref_name = None if self.is_ref_remote(ref): ref_name = ref[len('refs/remotes/'):] elif self.is_ref_branch(ref): ref_name = ref[len('refs/heads/'):] elif self.is_ref_tag(ref): ref_name = ref[len('refs/tags/'):] if ref_name is not None: rv[ref_name] = commit return rv
[ "def", "get_short_refs", "(", "self", ",", "location", ")", ":", "rv", "=", "{", "}", "for", "commit", ",", "ref", "in", "self", ".", "get_full_refs", "(", "location", ")", ":", "ref_name", "=", "None", "if", "self", ".", "is_ref_remote", "(", "ref", ...
https://github.com/khanhnamle1994/natural-language-processing/blob/01d450d5ac002b0156ef4cf93a07cb508c1bcdc5/assignment1/.env/lib/python2.7/site-packages/pip/vcs/git.py#L203-L216
replit-archive/empythoned
977ec10ced29a3541a4973dc2b59910805695752
cpython/Lib/logging/__init__.py
python
PlaceHolder.__init__
(self, alogger)
Initialize with the specified logger being a child of this placeholder.
Initialize with the specified logger being a child of this placeholder.
[ "Initialize", "with", "the", "specified", "logger", "being", "a", "child", "of", "this", "placeholder", "." ]
def __init__(self, alogger): """ Initialize with the specified logger being a child of this placeholder. """ #self.loggers = [alogger] self.loggerMap = { alogger : None }
[ "def", "__init__", "(", "self", ",", "alogger", ")", ":", "#self.loggers = [alogger]", "self", ".", "loggerMap", "=", "{", "alogger", ":", "None", "}" ]
https://github.com/replit-archive/empythoned/blob/977ec10ced29a3541a4973dc2b59910805695752/cpython/Lib/logging/__init__.py#L938-L943
amymcgovern/pyparrot
bf4775ec1199b282e4edde1e4a8e018dcc8725e0
pyparrot/utils/vlc.py
python
libvlc_log_unset
(p_instance)
return f(p_instance)
Unsets the logging callback. This function deregisters the logging callback for a LibVLC instance. This is rarely needed as the callback is implicitly unset when the instance is destroyed. @note: This function will wait for any pending callbacks invocation to complete (causing a deadlock if called from within the callback). @param p_instance: libvlc instance. @version: LibVLC 2.1.0 or later.
Unsets the logging callback. This function deregisters the logging callback for a LibVLC instance. This is rarely needed as the callback is implicitly unset when the instance is destroyed.
[ "Unsets", "the", "logging", "callback", ".", "This", "function", "deregisters", "the", "logging", "callback", "for", "a", "LibVLC", "instance", ".", "This", "is", "rarely", "needed", "as", "the", "callback", "is", "implicitly", "unset", "when", "the", "instanc...
def libvlc_log_unset(p_instance): '''Unsets the logging callback. This function deregisters the logging callback for a LibVLC instance. This is rarely needed as the callback is implicitly unset when the instance is destroyed. @note: This function will wait for any pending callbacks invocation to complete (causing a deadlock if called from within the callback). @param p_instance: libvlc instance. @version: LibVLC 2.1.0 or later. ''' f = _Cfunctions.get('libvlc_log_unset', None) or \ _Cfunction('libvlc_log_unset', ((1,),), None, None, Instance) return f(p_instance)
[ "def", "libvlc_log_unset", "(", "p_instance", ")", ":", "f", "=", "_Cfunctions", ".", "get", "(", "'libvlc_log_unset'", ",", "None", ")", "or", "_Cfunction", "(", "'libvlc_log_unset'", ",", "(", "(", "1", ",", ")", ",", ")", ",", "None", ",", "None", "...
https://github.com/amymcgovern/pyparrot/blob/bf4775ec1199b282e4edde1e4a8e018dcc8725e0/pyparrot/utils/vlc.py#L4580-L4593
zhl2008/awd-platform
0416b31abea29743387b10b3914581fbe8e7da5e
web_hxb2/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/escprober.py
python
EscCharSetProber.__init__
(self)
[]
def __init__(self): CharSetProber.__init__(self) self._mCodingSM = [ CodingStateMachine(HZSMModel), CodingStateMachine(ISO2022CNSMModel), CodingStateMachine(ISO2022JPSMModel), CodingStateMachine(ISO2022KRSMModel) ] self.reset()
[ "def", "__init__", "(", "self", ")", ":", "CharSetProber", ".", "__init__", "(", "self", ")", "self", ".", "_mCodingSM", "=", "[", "CodingStateMachine", "(", "HZSMModel", ")", ",", "CodingStateMachine", "(", "ISO2022CNSMModel", ")", ",", "CodingStateMachine", ...
https://github.com/zhl2008/awd-platform/blob/0416b31abea29743387b10b3914581fbe8e7da5e/web_hxb2/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/escprober.py#L37-L45
JiYou/openstack
8607dd488bde0905044b303eb6e52bdea6806923
packages/source/nova/nova/cells/messaging.py
python
MessageRunner.instance_destroy_at_top
(self, ctxt, instance)
Destroy an instance at the top level cell.
Destroy an instance at the top level cell.
[ "Destroy", "an", "instance", "at", "the", "top", "level", "cell", "." ]
def instance_destroy_at_top(self, ctxt, instance): """Destroy an instance at the top level cell.""" message = _BroadcastMessage(self, ctxt, 'instance_destroy_at_top', dict(instance=instance), 'up', run_locally=False) message.process()
[ "def", "instance_destroy_at_top", "(", "self", ",", "ctxt", ",", "instance", ")", ":", "message", "=", "_BroadcastMessage", "(", "self", ",", "ctxt", ",", "'instance_destroy_at_top'", ",", "dict", "(", "instance", "=", "instance", ")", ",", "'up'", ",", "run...
https://github.com/JiYou/openstack/blob/8607dd488bde0905044b303eb6e52bdea6806923/packages/source/nova/nova/cells/messaging.py#L1110-L1115
jimmysong/programmingbitcoin
3fba6b992ece443e4256df057595cfbe91edda75
code-ch08/tx.py
python
Tx.hash
(self)
return hash256(self.serialize())[::-1]
Binary hash of the legacy serialization
Binary hash of the legacy serialization
[ "Binary", "hash", "of", "the", "legacy", "serialization" ]
def hash(self): '''Binary hash of the legacy serialization''' return hash256(self.serialize())[::-1]
[ "def", "hash", "(", "self", ")", ":", "return", "hash256", "(", "self", ".", "serialize", "(", ")", ")", "[", ":", ":", "-", "1", "]" ]
https://github.com/jimmysong/programmingbitcoin/blob/3fba6b992ece443e4256df057595cfbe91edda75/code-ch08/tx.py#L100-L102
bloomberg/phabricator-tools
09bd1587fe8945d93a891162fd4c89640c6fada7
py/abd/abdt_branchmock.py
python
BranchMock.verify_review_branch_base
(self)
Raise exception if review branch has invalid base.
Raise exception if review branch has invalid base.
[ "Raise", "exception", "if", "review", "branch", "has", "invalid", "base", "." ]
def verify_review_branch_base(self): """Raise exception if review branch has invalid base.""" if not self._data.is_base_ok: raise abdt_exception.MissingBaseException( self._data.review_branch, 'description', self._data.base_branch)
[ "def", "verify_review_branch_base", "(", "self", ")", ":", "if", "not", "self", ".", "_data", ".", "is_base_ok", ":", "raise", "abdt_exception", ".", "MissingBaseException", "(", "self", ".", "_data", ".", "review_branch", ",", "'description'", ",", "self", "....
https://github.com/bloomberg/phabricator-tools/blob/09bd1587fe8945d93a891162fd4c89640c6fada7/py/abd/abdt_branchmock.py#L318-L324
johntruckenbrodt/pyroSAR
efac51134ba42d20120b259f968afe5a4ddcc46a
pyroSAR/gamma/parser_demo.py
python
ph_slope_base
(int_in, SLC_par, OFF_par, base, int_out, int_type='-', inverse='-', logpath=None, outdir=None, shellscript=None)
| Subtract/add interferogram flat-Earth phase trend as estimated from initial baseline | Copyright 2006, Gamma Remote Sensing, v4.4 3-Nov-2006 clw Parameters ---------- int_in: (input) interferogram (FCOMPLEX) or unwrapped phase (FLOAT) (unflattened) SLC_par: (input) ISP parameter file for the reference SLC OFF_par: (input) ISP offset/interferogram parameter file base: (input) baseline file int_out: (output) interferogram (FCOMPLEX) or unwrapped phase (FLOAT) with phase trend subtracted/added int_type: interferogram type: 0=unwrapped phase, 1=complex interf. (default=1) inverse: subtract/add inversion flag (0=subtract phase ramp, 1=add phase ramp (default=0) logpath: str or None a directory to write command logfiles to outdir: str or None the directory to execute the command in shellscript: str or None a file to write the Gamma commands to in shell format
| Subtract/add interferogram flat-Earth phase trend as estimated from initial baseline | Copyright 2006, Gamma Remote Sensing, v4.4 3-Nov-2006 clw
[ "|", "Subtract", "/", "add", "interferogram", "flat", "-", "Earth", "phase", "trend", "as", "estimated", "from", "initial", "baseline", "|", "Copyright", "2006", "Gamma", "Remote", "Sensing", "v4", ".", "4", "3", "-", "Nov", "-", "2006", "clw" ]
def ph_slope_base(int_in, SLC_par, OFF_par, base, int_out, int_type='-', inverse='-', logpath=None, outdir=None, shellscript=None): """ | Subtract/add interferogram flat-Earth phase trend as estimated from initial baseline | Copyright 2006, Gamma Remote Sensing, v4.4 3-Nov-2006 clw Parameters ---------- int_in: (input) interferogram (FCOMPLEX) or unwrapped phase (FLOAT) (unflattened) SLC_par: (input) ISP parameter file for the reference SLC OFF_par: (input) ISP offset/interferogram parameter file base: (input) baseline file int_out: (output) interferogram (FCOMPLEX) or unwrapped phase (FLOAT) with phase trend subtracted/added int_type: interferogram type: 0=unwrapped phase, 1=complex interf. (default=1) inverse: subtract/add inversion flag (0=subtract phase ramp, 1=add phase ramp (default=0) logpath: str or None a directory to write command logfiles to outdir: str or None the directory to execute the command in shellscript: str or None a file to write the Gamma commands to in shell format """ process( ['/usr/local/GAMMA_SOFTWARE-20180703/ISP/bin/ph_slope_base', int_in, SLC_par, OFF_par, base, int_out, int_type, inverse], logpath=logpath, outdir=outdir, shellscript=shellscript)
[ "def", "ph_slope_base", "(", "int_in", ",", "SLC_par", ",", "OFF_par", ",", "base", ",", "int_out", ",", "int_type", "=", "'-'", ",", "inverse", "=", "'-'", ",", "logpath", "=", "None", ",", "outdir", "=", "None", ",", "shellscript", "=", "None", ")", ...
https://github.com/johntruckenbrodt/pyroSAR/blob/efac51134ba42d20120b259f968afe5a4ddcc46a/pyroSAR/gamma/parser_demo.py#L3590-L3621
FSecureLABS/Jandroid
e31d0dab58a2bfd6ed8e0a387172b8bd7c893436
src/plugins/android/graph_helper_worker.py
python
GraphHelperWorker.fn_get_class_method_desc_from_string
(self, input_string)
return [class_part, method_part, desc_part]
Gets class/method/descriptor parts from a string. A method call in smali is of the format classname->methodname descriptor (without the space) For example: Landroid/util/ArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object; In the above example: The class part is Landroid/util/ArrayMap; The method part is get The descriptor part is (Ljava/lang/Object;)Ljava/lang/Object; The method part is separated from the class by "->" and from the descriptor by an opening parenthesis. This function takes as input a string in the smali format and splits it into the class, method and descriptor parts. If "->" is not present in the string, then the entire string is assumed to be the class name and the method and descriptor are assigned values of ".*" (which is considered in Androguard as "any" or "don't care". If an opening parenthesis is not present, then it is assumed that there is no descriptor part, and only the descriptor is assigned ".*". :param input_string: a string representation of a class/method :returns: a list containing (in order) the class, method and descriptor parts obtained from the string
Gets class/method/descriptor parts from a string. A method call in smali is of the format classname->methodname descriptor (without the space) For example: Landroid/util/ArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object; In the above example: The class part is Landroid/util/ArrayMap; The method part is get The descriptor part is (Ljava/lang/Object;)Ljava/lang/Object; The method part is separated from the class by "->" and from the descriptor by an opening parenthesis. This function takes as input a string in the smali format and splits it into the class, method and descriptor parts. If "->" is not present in the string, then the entire string is assumed to be the class name and the method and descriptor are assigned values of ".*" (which is considered in Androguard as "any" or "don't care". If an opening parenthesis is not present, then it is assumed that there is no descriptor part, and only the descriptor is assigned ".*". :param input_string: a string representation of a class/method :returns: a list containing (in order) the class, method and descriptor parts obtained from the string
[ "Gets", "class", "/", "method", "/", "descriptor", "parts", "from", "a", "string", ".", "A", "method", "call", "in", "smali", "is", "of", "the", "format", "classname", "-", ">", "methodname", "descriptor", "(", "without", "the", "space", ")", "For", "exa...
def fn_get_class_method_desc_from_string(self, input_string): """Gets class/method/descriptor parts from a string. A method call in smali is of the format classname->methodname descriptor (without the space) For example: Landroid/util/ArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object; In the above example: The class part is Landroid/util/ArrayMap; The method part is get The descriptor part is (Ljava/lang/Object;)Ljava/lang/Object; The method part is separated from the class by "->" and from the descriptor by an opening parenthesis. This function takes as input a string in the smali format and splits it into the class, method and descriptor parts. If "->" is not present in the string, then the entire string is assumed to be the class name and the method and descriptor are assigned values of ".*" (which is considered in Androguard as "any" or "don't care". If an opening parenthesis is not present, then it is assumed that there is no descriptor part, and only the descriptor is assigned ".*". :param input_string: a string representation of a class/method :returns: a list containing (in order) the class, method and descriptor parts obtained from the string """ # Assign default values of "don't care" to method and descriptor. method_part = '.*' desc_part = '.*' # In a smali method specification, the class and method must be # separated using '->'. if '->' in input_string: # There must be some string fragment after the '->'. split_string = input_string.split('->') if ((len(split_string) != 2) or (split_string[1] == '')): raise JandroidException( { 'type': str(os.path.basename(__file__)) + ': IncorrectMethodCall', 'reason': 'Call to method specified incorrectly in ' + 'string: "' + input_string + '". Ensure that correct smali format is used.' } ) # The class part is easy: it's the part preceding the '->'. class_part = split_string[0] # The part following the '->' may comprise the method *and* descriptor. method_desc_part = split_string[1] # However, it's possible that the descriptor part is not specified. # If the descriptor *is* included, it will begin with an # opening parenthesis. if '(' in method_desc_part: method_part = method_desc_part.split('(')[0] desc_part = '(' + method_desc_part.split('(')[1] # If no opening parenthesis exists, we assume the descriptor hasn't # been provided, i.e., the entire string is the method name. else: method_part = method_desc_part desc_part = '.' # If there is no "->" then assume that the entire string is the # class name. else: class_part = input_string return [class_part, method_part, desc_part]
[ "def", "fn_get_class_method_desc_from_string", "(", "self", ",", "input_string", ")", ":", "# Assign default values of \"don't care\" to method and descriptor.", "method_part", "=", "'.*'", "desc_part", "=", "'.*'", "# In a smali method specification, the class and method must be", "...
https://github.com/FSecureLABS/Jandroid/blob/e31d0dab58a2bfd6ed8e0a387172b8bd7c893436/src/plugins/android/graph_helper_worker.py#L511-L580
holzschu/Carnets
44effb10ddfc6aa5c8b0687582a724ba82c6b547
Library/lib/python3.7/site-packages/numpy-1.16.0-py3.7-macosx-10.9-x86_64.egg/numpy/ma/core.py
python
masked_invalid
(a, copy=True)
return result
Mask an array where invalid values occur (NaNs or infs). This function is a shortcut to ``masked_where``, with `condition` = ~(np.isfinite(a)). Any pre-existing mask is conserved. Only applies to arrays with a dtype where NaNs or infs make sense (i.e. floating point types), but accepts any array_like object. See Also -------- masked_where : Mask where a condition is met. Examples -------- >>> import numpy.ma as ma >>> a = np.arange(5, dtype=float) >>> a[2] = np.NaN >>> a[3] = np.PINF >>> a array([ 0., 1., NaN, Inf, 4.]) >>> ma.masked_invalid(a) masked_array(data = [0.0 1.0 -- -- 4.0], mask = [False False True True False], fill_value=1e+20)
Mask an array where invalid values occur (NaNs or infs).
[ "Mask", "an", "array", "where", "invalid", "values", "occur", "(", "NaNs", "or", "infs", ")", "." ]
def masked_invalid(a, copy=True): """ Mask an array where invalid values occur (NaNs or infs). This function is a shortcut to ``masked_where``, with `condition` = ~(np.isfinite(a)). Any pre-existing mask is conserved. Only applies to arrays with a dtype where NaNs or infs make sense (i.e. floating point types), but accepts any array_like object. See Also -------- masked_where : Mask where a condition is met. Examples -------- >>> import numpy.ma as ma >>> a = np.arange(5, dtype=float) >>> a[2] = np.NaN >>> a[3] = np.PINF >>> a array([ 0., 1., NaN, Inf, 4.]) >>> ma.masked_invalid(a) masked_array(data = [0.0 1.0 -- -- 4.0], mask = [False False True True False], fill_value=1e+20) """ a = np.array(a, copy=copy, subok=True) mask = getattr(a, '_mask', None) if mask is not None: condition = ~(np.isfinite(getdata(a))) if mask is not nomask: condition |= mask cls = type(a) else: condition = ~(np.isfinite(a)) cls = MaskedArray result = a.view(cls) result._mask = condition return result
[ "def", "masked_invalid", "(", "a", ",", "copy", "=", "True", ")", ":", "a", "=", "np", ".", "array", "(", "a", ",", "copy", "=", "copy", ",", "subok", "=", "True", ")", "mask", "=", "getattr", "(", "a", ",", "'_mask'", ",", "None", ")", "if", ...
https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/numpy-1.16.0-py3.7-macosx-10.9-x86_64.egg/numpy/ma/core.py#L2331-L2370
Chaffelson/nipyapi
d3b186fd701ce308c2812746d98af9120955e810
nipyapi/nifi/models/versioned_controller_service.py
python
VersionedControllerService.component_type
(self)
return self._component_type
Gets the component_type of this VersionedControllerService. :return: The component_type of this VersionedControllerService. :rtype: str
Gets the component_type of this VersionedControllerService.
[ "Gets", "the", "component_type", "of", "this", "VersionedControllerService", "." ]
def component_type(self): """ Gets the component_type of this VersionedControllerService. :return: The component_type of this VersionedControllerService. :rtype: str """ return self._component_type
[ "def", "component_type", "(", "self", ")", ":", "return", "self", ".", "_component_type" ]
https://github.com/Chaffelson/nipyapi/blob/d3b186fd701ce308c2812746d98af9120955e810/nipyapi/nifi/models/versioned_controller_service.py#L337-L344
brython-dev/brython
9cba5fb7f43a9b52fff13e89b403e02a1dfaa5f3
www/src/Lib/cmath.py
python
cos
(x)
return cosh(complex(-x.imag, x.real))
Return the cosine of x.
Return the cosine of x.
[ "Return", "the", "cosine", "of", "x", "." ]
def cos(x): """Return the cosine of x.""" return cosh(complex(-x.imag, x.real))
[ "def", "cos", "(", "x", ")", ":", "return", "cosh", "(", "complex", "(", "-", "x", ".", "imag", ",", "x", ".", "real", ")", ")" ]
https://github.com/brython-dev/brython/blob/9cba5fb7f43a9b52fff13e89b403e02a1dfaa5f3/www/src/Lib/cmath.py#L369-L371
DxCx/plugin.video.9anime
34358c2f701e5ddf19d3276926374a16f63f7b6a
resources/lib/ui/js2py/es6/babel.py
python
PyJs_anonymous_3559_
(require, module, exports, this, arguments, var=var)
[]
def PyJs_anonymous_3559_(require, module, exports, this, arguments, var=var): var = Scope({u'this':this, u'require':require, u'exports':exports, u'module':module, u'arguments':arguments}, var) var.registers([u'baseIndexOf', u'exports', u'basePullAll', u'baseIndexOfWith', u'arrayProto', u'require', u'arrayMap', u'module', u'copyArray', u'splice', u'baseUnary']) @Js def PyJsHoisted_basePullAll_(array, values, iteratee, comparator, this, arguments, var=var): var = Scope({u'values':values, u'arguments':arguments, u'comparator':comparator, u'iteratee':iteratee, u'this':this, u'array':array}, var) var.registers([u'index', u'computed', u'comparator', u'indexOf', u'fromIndex', u'value', u'length', u'values', u'iteratee', u'seen', u'array']) var.put(u'indexOf', (var.get(u'baseIndexOfWith') if var.get(u'comparator') else var.get(u'baseIndexOf'))) var.put(u'index', (-Js(1.0))) var.put(u'length', var.get(u'values').get(u'length')) var.put(u'seen', var.get(u'array')) if PyJsStrictEq(var.get(u'array'),var.get(u'values')): var.put(u'values', var.get(u'copyArray')(var.get(u'values'))) if var.get(u'iteratee'): var.put(u'seen', var.get(u'arrayMap')(var.get(u'array'), var.get(u'baseUnary')(var.get(u'iteratee')))) while (var.put(u'index',Js(var.get(u'index').to_number())+Js(1))<var.get(u'length')): var.put(u'fromIndex', Js(0.0)) var.put(u'value', var.get(u'values').get(var.get(u'index'))) var.put(u'computed', (var.get(u'iteratee')(var.get(u'value')) if var.get(u'iteratee') else var.get(u'value'))) while (var.put(u'fromIndex', var.get(u'indexOf')(var.get(u'seen'), var.get(u'computed'), var.get(u'fromIndex'), var.get(u'comparator')))>(-Js(1.0))): if PyJsStrictNeq(var.get(u'seen'),var.get(u'array')): var.get(u'splice').callprop(u'call', var.get(u'seen'), var.get(u'fromIndex'), Js(1.0)) var.get(u'splice').callprop(u'call', var.get(u'array'), var.get(u'fromIndex'), Js(1.0)) return var.get(u'array') PyJsHoisted_basePullAll_.func_name = u'basePullAll' var.put(u'basePullAll', PyJsHoisted_basePullAll_) var.put(u'arrayMap', var.get(u'require')(Js(u'./_arrayMap'))) var.put(u'baseIndexOf', var.get(u'require')(Js(u'./_baseIndexOf'))) var.put(u'baseIndexOfWith', var.get(u'require')(Js(u'./_baseIndexOfWith'))) var.put(u'baseUnary', var.get(u'require')(Js(u'./_baseUnary'))) var.put(u'copyArray', var.get(u'require')(Js(u'./_copyArray'))) var.put(u'arrayProto', var.get(u'Array').get(u'prototype')) var.put(u'splice', var.get(u'arrayProto').get(u'splice')) pass var.get(u'module').put(u'exports', var.get(u'basePullAll'))
[ "def", "PyJs_anonymous_3559_", "(", "require", ",", "module", ",", "exports", ",", "this", ",", "arguments", ",", "var", "=", "var", ")", ":", "var", "=", "Scope", "(", "{", "u'this'", ":", "this", ",", "u'require'", ":", "require", ",", "u'exports'", ...
https://github.com/DxCx/plugin.video.9anime/blob/34358c2f701e5ddf19d3276926374a16f63f7b6a/resources/lib/ui/js2py/es6/babel.py#L40299-L40333
fastnlp/fitlog
ba9547a56f4855a2d9cf26ae709d01922befa077
fitlog/fastserver/line_app.py
python
line_index
()
return render_template('line.html', data=data, column_order=column_order, column_dict=column_dict, hidden_columns=hidden_columns)
[]
def line_index(): ids = request.values['ids'] # 取出所有的logs flat_logs = [all_data['data'][id].copy() for id in ids.split(',')] hidden_columns = all_data['hidden_columns'].copy() # 删除不是共有的部分 value_dict_count = defaultdict(list) # 每个key有多少个 for log in flat_logs: for key in log.keys(): value_dict_count[key] += [log[key]] for key, _lst in list(value_dict_count.items()): if len(_lst) != len(flat_logs): # 有些没有这个值 for log in flat_logs: log.pop(key, None) if len(set(_lst)) == 1: # 只有一个值 hidden_columns[key] = 1 logs = [expand_dict([log])[0] for log in flat_logs] # column_order, column_dict, hidden_columns, settings, logs hidden_columns['id'] = 1 hidden_columns['memo'] = 1 hidden_columns['meta'] = 1 res = generate_columns(logs, hidden_columns=hidden_columns, column_order=all_data['column_order'], editable_columns={}, exclude_columns={}, ignore_unchanged_columns=False, str_max_length=20, round_to=6, num_extra_log=0) column_order = res['column_order'] column_order.pop('id') column_order['OrderKeys'].remove('id') if 'metric' in column_order: # 将metric放在第一的位置 column_order['OrderKeys'].remove('metric') column_order['OrderKeys'].insert(0, 'metric') column_dict = res['column_dict'] column_dict.pop('id') hidden_columns = res['hidden_columns'] data = res['data'] for key, log in data.items(): log.pop('id') return render_template('line.html', data=data, column_order=column_order, column_dict=column_dict, hidden_columns=hidden_columns)
[ "def", "line_index", "(", ")", ":", "ids", "=", "request", ".", "values", "[", "'ids'", "]", "# 取出所有的logs", "flat_logs", "=", "[", "all_data", "[", "'data'", "]", "[", "id", "]", ".", "copy", "(", ")", "for", "id", "in", "ids", ".", "split", "(", ...
https://github.com/fastnlp/fitlog/blob/ba9547a56f4855a2d9cf26ae709d01922befa077/fitlog/fastserver/line_app.py#L14-L55
twisted/twisted
dee676b040dd38b847ea6fb112a712cb5e119490
src/twisted/mail/mail.py
python
DomainWithDefaultDict.__len__
(self)
return len(self.domains)
Return the number of domains in this dictionary. @rtype: L{int} @return: The number of domains in this dictionary.
Return the number of domains in this dictionary.
[ "Return", "the", "number", "of", "domains", "in", "this", "dictionary", "." ]
def __len__(self): """ Return the number of domains in this dictionary. @rtype: L{int} @return: The number of domains in this dictionary. """ return len(self.domains)
[ "def", "__len__", "(", "self", ")", ":", "return", "len", "(", "self", ".", "domains", ")" ]
https://github.com/twisted/twisted/blob/dee676b040dd38b847ea6fb112a712cb5e119490/src/twisted/mail/mail.py#L158-L165
rcorcs/NatI
fdf014f4292afdc95250add7b6658468043228e1
en/wordnet/wordnet.py
python
Word.__str__
(self)
return self.form + "(" + abbrs[self.pos] + ")"
Return a human-readable representation. >>> str(N['dog']) 'dog(n.)'
Return a human-readable representation. >>> str(N['dog']) 'dog(n.)'
[ "Return", "a", "human", "-", "readable", "representation", ".", ">>>", "str", "(", "N", "[", "dog", "]", ")", "dog", "(", "n", ".", ")" ]
def __str__(self): """Return a human-readable representation. >>> str(N['dog']) 'dog(n.)' """ abbrs = {NOUN: 'n.', VERB: 'v.', ADJECTIVE: 'adj.', ADVERB: 'adv.'} return self.form + "(" + abbrs[self.pos] + ")"
[ "def", "__str__", "(", "self", ")", ":", "abbrs", "=", "{", "NOUN", ":", "'n.'", ",", "VERB", ":", "'v.'", ",", "ADJECTIVE", ":", "'adj.'", ",", "ADVERB", ":", "'adv.'", "}", "return", "self", ".", "form", "+", "\"(\"", "+", "abbrs", "[", "self", ...
https://github.com/rcorcs/NatI/blob/fdf014f4292afdc95250add7b6658468043228e1/en/wordnet/wordnet.py#L286-L293
markovmodel/PyEMMA
e9d08d715dde17ceaa96480a9ab55d5e87d3a4b3
pyemma/coordinates/data/_base/datasource.py
python
DataSourceIterator.return_traj_index
(self, value)
Setter for return_traj_index, determining if the trajectory index gets returned in the iteration loop. Parameters ---------- value : bool True if it should be returned, otherwise False
Setter for return_traj_index, determining if the trajectory index gets returned in the iteration loop. Parameters ---------- value : bool True if it should be returned, otherwise False
[ "Setter", "for", "return_traj_index", "determining", "if", "the", "trajectory", "index", "gets", "returned", "in", "the", "iteration", "loop", ".", "Parameters", "----------", "value", ":", "bool", "True", "if", "it", "should", "be", "returned", "otherwise", "Fa...
def return_traj_index(self, value): """ Setter for return_traj_index, determining if the trajectory index gets returned in the iteration loop. Parameters ---------- value : bool True if it should be returned, otherwise False """ self.state.return_trajindex = value
[ "def", "return_traj_index", "(", "self", ",", "value", ")", ":", "self", ".", "state", ".", "return_trajindex", "=", "value" ]
https://github.com/markovmodel/PyEMMA/blob/e9d08d715dde17ceaa96480a9ab55d5e87d3a4b3/pyemma/coordinates/data/_base/datasource.py#L986-L994
Xonshiz/anime-dl
d40f0ca11b894dbbf17edbb9d0f069e741be902f
anime_dl/external/utils.py
python
get_elements_by_attribute
(attribute, value, html, escape_value=True)
return retlist
Return the content of the tag with the specified attribute in the passed HTML document
Return the content of the tag with the specified attribute in the passed HTML document
[ "Return", "the", "content", "of", "the", "tag", "with", "the", "specified", "attribute", "in", "the", "passed", "HTML", "document" ]
def get_elements_by_attribute(attribute, value, html, escape_value=True): """Return the content of the tag with the specified attribute in the passed HTML document""" value = re.escape(value) if escape_value else value retlist = [] for m in re.finditer(r'''(?xs) <([a-zA-Z0-9:._-]+) (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'))*? \s+%s=['"]?%s['"]? (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'))*? \s*> (?P<content>.*?) </\1> ''' % (re.escape(attribute), value), html): res = m.group('content') if res.startswith('"') or res.startswith("'"): res = res[1:-1] retlist.append(unescapeHTML(res)) return retlist
[ "def", "get_elements_by_attribute", "(", "attribute", ",", "value", ",", "html", ",", "escape_value", "=", "True", ")", ":", "value", "=", "re", ".", "escape", "(", "value", ")", "if", "escape_value", "else", "value", "retlist", "=", "[", "]", "for", "m"...
https://github.com/Xonshiz/anime-dl/blob/d40f0ca11b894dbbf17edbb9d0f069e741be902f/anime_dl/external/utils.py#L358-L380
pyeve/eve
30a7cc80e9a1b40665cd7e7ef93a470ae692da02
eve/flaskapp.py
python
Eve.validate_methods
(self, allowed, proposed, item)
Compares allowed and proposed methods, raising a `ConfigException` when they don't match. :param allowed: a list of supported (allowed) methods. :param proposed: a list of proposed methods. :param item: name of the item to which the methods would be applied. Used when raising the exception.
Compares allowed and proposed methods, raising a `ConfigException` when they don't match.
[ "Compares", "allowed", "and", "proposed", "methods", "raising", "a", "ConfigException", "when", "they", "don", "t", "match", "." ]
def validate_methods(self, allowed, proposed, item): """Compares allowed and proposed methods, raising a `ConfigException` when they don't match. :param allowed: a list of supported (allowed) methods. :param proposed: a list of proposed methods. :param item: name of the item to which the methods would be applied. Used when raising the exception. """ diff = set(proposed) - set(allowed) if diff: raise ConfigException( "Unallowed %s method(s): %s. " "Supported: %s" % (item, ", ".join(diff), ", ".join(allowed)) )
[ "def", "validate_methods", "(", "self", ",", "allowed", ",", "proposed", ",", "item", ")", ":", "diff", "=", "set", "(", "proposed", ")", "-", "set", "(", "allowed", ")", "if", "diff", ":", "raise", "ConfigException", "(", "\"Unallowed %s method(s): %s. \"",...
https://github.com/pyeve/eve/blob/30a7cc80e9a1b40665cd7e7ef93a470ae692da02/eve/flaskapp.py#L426-L440
WikidPad/WikidPad
558109638807bc76b4672922686e416ab2d5f79c
WikidPad/lib/pwiki/customtreectrl.py
python
CustomTreeCtrl.GetNextVisible
(self, item)
return None
Returns the next visible item.
Returns the next visible item.
[ "Returns", "the", "next", "visible", "item", "." ]
def GetNextVisible(self, item): """Returns the next visible item.""" if not item: raise Exception("\nERROR: Invalid Tree Item. ") id = item while id: id = self.GetNext(id) if id and self.IsVisible(id): return id return None
[ "def", "GetNextVisible", "(", "self", ",", "item", ")", ":", "if", "not", "item", ":", "raise", "Exception", "(", "\"\\nERROR: Invalid Tree Item. \"", ")", "id", "=", "item", "while", "id", ":", "id", "=", "self", ".", "GetNext", "(", "id", ")", "if", ...
https://github.com/WikidPad/WikidPad/blob/558109638807bc76b4672922686e416ab2d5f79c/WikidPad/lib/pwiki/customtreectrl.py#L3147-L3160
tensorflow/mesh
57ed4018e6a173952501b074daabad32b6449f3d
mesh_tensorflow/transformer/transformer_layers.py
python
relative_position_spans
(context, num_sentinels=gin.REQUIRED)
return dec_to_enc_pos - encoder_pos
Compute relative positions between inputs and targets. Used by enc_dec_attention_bias. Assumes that inputs and targets were generated by a span-filling objective: The inputs consist of the original text with some spans removed and replaced by single sentinels. The targets consist of the dropped spans, each preceded by a single sentinel. Sentinels are the last tokens in the vocabulary. e.g. inputs: A B C <S> F G H <S> shifted-targets: <BOS> <S> D E <S> I J K Relative positions are computed by identifying a target token with the corresponding sentinel in the input and returning the distance between these two tokens in the input. Target tokens which precede all sentinels get identified with the beginning of the input. So if we apply this to a problem with no sentinels, all target tokens will be indentified with the beginning of the input. We assume this is the case during incremental decoding, so this code will not work properly to incrementally decode a problem with sentinels. This may not be an issue, since the span-filling objective is primarily used for unsupervised pre-training. Args: context: a Context num_sentinels: an integer. Should have the same value as SentencePieceVocabulary.extra_ids Returns: a Tensor
Compute relative positions between inputs and targets.
[ "Compute", "relative", "positions", "between", "inputs", "and", "targets", "." ]
def relative_position_spans(context, num_sentinels=gin.REQUIRED): """Compute relative positions between inputs and targets. Used by enc_dec_attention_bias. Assumes that inputs and targets were generated by a span-filling objective: The inputs consist of the original text with some spans removed and replaced by single sentinels. The targets consist of the dropped spans, each preceded by a single sentinel. Sentinels are the last tokens in the vocabulary. e.g. inputs: A B C <S> F G H <S> shifted-targets: <BOS> <S> D E <S> I J K Relative positions are computed by identifying a target token with the corresponding sentinel in the input and returning the distance between these two tokens in the input. Target tokens which precede all sentinels get identified with the beginning of the input. So if we apply this to a problem with no sentinels, all target tokens will be indentified with the beginning of the input. We assume this is the case during incremental decoding, so this code will not work properly to incrementally decode a problem with sentinels. This may not be an issue, since the span-filling objective is primarily used for unsupervised pre-training. Args: context: a Context num_sentinels: an integer. Should have the same value as SentencePieceVocabulary.extra_ids Returns: a Tensor """ decoder_id = context.inputs encoder_id = context.encoder_inputs decoder_length = context.length_dim encoder_length = context.encoder_length_dim mesh = encoder_id.mesh encoder_pos = mtf.range(mesh, encoder_length, tf.int32) if decoder_length not in decoder_id.shape.dims: # we are doing incremental decoding. # Map the target token to the beginning of the input. dec_to_enc_pos = 0 else: vocab_size = context.model.input_vocab_size_unpadded def sentinel_mask(t): return mtf.cast(mtf.greater_equal( t, vocab_size - num_sentinels), tf.int32) decoder_is_sentinel = sentinel_mask(decoder_id) encoder_is_sentinel = sentinel_mask(encoder_id) encoder_segment_id = mtf.cumsum(encoder_is_sentinel, encoder_length) decoder_segment_id = mtf.cumsum(decoder_is_sentinel, decoder_length) encoder_sequence_id = context.encoder_sequence_id decoder_sequence_id = context.sequence_id if encoder_sequence_id is not None: # distinguish segments from different sequences multiplier = max(encoder_length.size, decoder_length.size) encoder_segment_id += encoder_sequence_id * multiplier decoder_segment_id += decoder_sequence_id * multiplier dec_to_enc_pos = mtf.reduce_sum( mtf.cast(mtf.less(encoder_segment_id, decoder_segment_id), tf.int32), reduced_dim=encoder_length) return dec_to_enc_pos - encoder_pos
[ "def", "relative_position_spans", "(", "context", ",", "num_sentinels", "=", "gin", ".", "REQUIRED", ")", ":", "decoder_id", "=", "context", ".", "inputs", "encoder_id", "=", "context", ".", "encoder_inputs", "decoder_length", "=", "context", ".", "length_dim", ...
https://github.com/tensorflow/mesh/blob/57ed4018e6a173952501b074daabad32b6449f3d/mesh_tensorflow/transformer/transformer_layers.py#L617-L680
robotlearn/pyrobolearn
9cd7c060723fda7d2779fa255ac998c2c82b8436
pyrobolearn/simulators/middlewares/ros.py
python
ROS.load_config_file
(filename, namespace=None)
Load a control configuration YAML file. Args: filename (str): path to the YAML file. namespace (str): default namespace. Returns: list[dict[str,dict[str:dict[str:dict]]], str]: [{robot_name: {param_name: value}}, namespace]
Load a control configuration YAML file.
[ "Load", "a", "control", "configuration", "YAML", "file", "." ]
def load_config_file(filename, namespace=None): """ Load a control configuration YAML file. Args: filename (str): path to the YAML file. namespace (str): default namespace. Returns: list[dict[str,dict[str:dict[str:dict]]], str]: [{robot_name: {param_name: value}}, namespace] """ params = rosparam.load_file(filename, default_namespace=namespace) params = params[0] namespace = params[1] + 'rrbot/' # TODO: replace rrbot params = params[0]['rrbot'] for key, value in params.items(): rosparam.upload_params(ns=namespace + key, values=value)
[ "def", "load_config_file", "(", "filename", ",", "namespace", "=", "None", ")", ":", "params", "=", "rosparam", ".", "load_file", "(", "filename", ",", "default_namespace", "=", "namespace", ")", "params", "=", "params", "[", "0", "]", "namespace", "=", "p...
https://github.com/robotlearn/pyrobolearn/blob/9cd7c060723fda7d2779fa255ac998c2c82b8436/pyrobolearn/simulators/middlewares/ros.py#L949-L965
SanPen/GridCal
d3f4566d2d72c11c7e910c9d162538ef0e60df31
src/GridCal/Engine/IO/zip_interface.py
python
get_frames_from_zip
(file_name_zip, text_func=None, progress_func=None, logger=Logger())
return data
Open the csv files from a zip file :param file_name_zip: name of the zip file :param text_func: pointer to function that prints the names :param progress_func: pointer to function that prints the progress 0~100 :param logger: :return: list of DataFrames
Open the csv files from a zip file :param file_name_zip: name of the zip file :param text_func: pointer to function that prints the names :param progress_func: pointer to function that prints the progress 0~100 :param logger: :return: list of DataFrames
[ "Open", "the", "csv", "files", "from", "a", "zip", "file", ":", "param", "file_name_zip", ":", "name", "of", "the", "zip", "file", ":", "param", "text_func", ":", "pointer", "to", "function", "that", "prints", "the", "names", ":", "param", "progress_func",...
def get_frames_from_zip(file_name_zip, text_func=None, progress_func=None, logger=Logger()): """ Open the csv files from a zip file :param file_name_zip: name of the zip file :param text_func: pointer to function that prints the names :param progress_func: pointer to function that prints the progress 0~100 :param logger: :return: list of DataFrames """ # open the zip file try: zip_file_pointer = zipfile.ZipFile(file_name_zip) except zipfile.BadZipFile: return None names = zip_file_pointer.namelist() n = len(names) data = dict() # for each file in the zip file... for i, file_name in enumerate(names): # split the file name into name and extension name, extension = os.path.splitext(file_name) if text_func is not None: text_func('Unpacking ' + name + ' from ' + file_name_zip) if progress_func is not None: progress_func((i + 1) / n * 100) # create a buffer to read the file file_pointer = zip_file_pointer.open(file_name) if name.lower() == "config": df = read_data_frame_from_zip(file_pointer, extension, index_col=0, logger=logger) data = parse_config_df(df, data) else: # make pandas read the file df = read_data_frame_from_zip(file_pointer, extension, logger=logger) # append the DataFrame to the list if df is not None: data[name] = df return data
[ "def", "get_frames_from_zip", "(", "file_name_zip", ",", "text_func", "=", "None", ",", "progress_func", "=", "None", ",", "logger", "=", "Logger", "(", ")", ")", ":", "# open the zip file", "try", ":", "zip_file_pointer", "=", "zipfile", ".", "ZipFile", "(", ...
https://github.com/SanPen/GridCal/blob/d3f4566d2d72c11c7e910c9d162538ef0e60df31/src/GridCal/Engine/IO/zip_interface.py#L148-L195
bruderstein/PythonScript
df9f7071ddf3a079e3a301b9b53a6dc78cf1208f
PythonLib/full/pickle.py
python
_Pickler.__init__
(self, file, protocol=None, *, fix_imports=True, buffer_callback=None)
This takes a binary file for writing a pickle data stream. The optional *protocol* argument tells the pickler to use the given protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default protocol is 4. It was introduced in Python 3.4, and is incompatible with previous versions. Specifying a negative protocol version selects the highest protocol version supported. The higher the protocol used, the more recent the version of Python needed to read the pickle produced. The *file* argument must have a write() method that accepts a single bytes argument. It can thus be a file object opened for binary writing, an io.BytesIO instance, or any other custom object that meets this interface. If *fix_imports* is True and *protocol* is less than 3, pickle will try to map the new Python 3 names to the old module names used in Python 2, so that the pickle data stream is readable with Python 2. If *buffer_callback* is None (the default), buffer views are serialized into *file* as part of the pickle stream. If *buffer_callback* is not None, then it can be called any number of times with a buffer view. If the callback returns a false value (such as None), the given buffer is out-of-band; otherwise the buffer is serialized in-band, i.e. inside the pickle stream. It is an error if *buffer_callback* is not None and *protocol* is None or smaller than 5.
This takes a binary file for writing a pickle data stream.
[ "This", "takes", "a", "binary", "file", "for", "writing", "a", "pickle", "data", "stream", "." ]
def __init__(self, file, protocol=None, *, fix_imports=True, buffer_callback=None): """This takes a binary file for writing a pickle data stream. The optional *protocol* argument tells the pickler to use the given protocol; supported protocols are 0, 1, 2, 3, 4 and 5. The default protocol is 4. It was introduced in Python 3.4, and is incompatible with previous versions. Specifying a negative protocol version selects the highest protocol version supported. The higher the protocol used, the more recent the version of Python needed to read the pickle produced. The *file* argument must have a write() method that accepts a single bytes argument. It can thus be a file object opened for binary writing, an io.BytesIO instance, or any other custom object that meets this interface. If *fix_imports* is True and *protocol* is less than 3, pickle will try to map the new Python 3 names to the old module names used in Python 2, so that the pickle data stream is readable with Python 2. If *buffer_callback* is None (the default), buffer views are serialized into *file* as part of the pickle stream. If *buffer_callback* is not None, then it can be called any number of times with a buffer view. If the callback returns a false value (such as None), the given buffer is out-of-band; otherwise the buffer is serialized in-band, i.e. inside the pickle stream. It is an error if *buffer_callback* is not None and *protocol* is None or smaller than 5. """ if protocol is None: protocol = DEFAULT_PROTOCOL if protocol < 0: protocol = HIGHEST_PROTOCOL elif not 0 <= protocol <= HIGHEST_PROTOCOL: raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL) if buffer_callback is not None and protocol < 5: raise ValueError("buffer_callback needs protocol >= 5") self._buffer_callback = buffer_callback try: self._file_write = file.write except AttributeError: raise TypeError("file must have a 'write' attribute") self.framer = _Framer(self._file_write) self.write = self.framer.write self._write_large_bytes = self.framer.write_large_bytes self.memo = {} self.proto = int(protocol) self.bin = protocol >= 1 self.fast = 0 self.fix_imports = fix_imports and protocol < 3
[ "def", "__init__", "(", "self", ",", "file", ",", "protocol", "=", "None", ",", "*", ",", "fix_imports", "=", "True", ",", "buffer_callback", "=", "None", ")", ":", "if", "protocol", "is", "None", ":", "protocol", "=", "DEFAULT_PROTOCOL", "if", "protocol...
https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/full/pickle.py#L409-L464
mcfletch/pyopengl
02d11dad9ff18e50db10e975c4756e17bf198464
OpenGL/GL/INTEL/performance_query.py
python
glInitPerformanceQueryINTEL
()
return extensions.hasGLExtension( _EXTENSION_NAME )
Return boolean indicating whether this extension is available
Return boolean indicating whether this extension is available
[ "Return", "boolean", "indicating", "whether", "this", "extension", "is", "available" ]
def glInitPerformanceQueryINTEL(): '''Return boolean indicating whether this extension is available''' from OpenGL import extensions return extensions.hasGLExtension( _EXTENSION_NAME )
[ "def", "glInitPerformanceQueryINTEL", "(", ")", ":", "from", "OpenGL", "import", "extensions", "return", "extensions", ".", "hasGLExtension", "(", "_EXTENSION_NAME", ")" ]
https://github.com/mcfletch/pyopengl/blob/02d11dad9ff18e50db10e975c4756e17bf198464/OpenGL/GL/INTEL/performance_query.py#L58-L61
JiYou/openstack
8607dd488bde0905044b303eb6e52bdea6806923
packages/source/cinder/tools/hacking.py
python
cinder_import_module_only
(logical_line)
Check for import module only. cinder HACKING guide recommends importing only modules: Do not import objects, only modules N302 import only modules N303 Invalid Import N304 Relative Import
Check for import module only.
[ "Check", "for", "import", "module", "only", "." ]
def cinder_import_module_only(logical_line): """Check for import module only. cinder HACKING guide recommends importing only modules: Do not import objects, only modules N302 import only modules N303 Invalid Import N304 Relative Import """ def importModuleCheck(mod, parent=None, added=False): """ If can't find module on first try, recursively check for relative imports """ current_path = os.path.dirname(pep8.current_file) try: with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) valid = True if parent: if is_import_exception(parent): return parent_mod = __import__(parent, globals(), locals(), [mod], -1) valid = inspect.ismodule(getattr(parent_mod, mod)) else: __import__(mod, globals(), locals(), [], -1) valid = inspect.ismodule(sys.modules[mod]) if not valid: if added: sys.path.pop() added = False return (logical_line.find(mod), ("CINDER N304: No " "relative imports. '%s' is a relative import" % logical_line)) return (logical_line.find(mod), ("CINDER N302: import only " "modules. '%s' does not import a module" % logical_line)) except (ImportError, NameError) as exc: if not added: added = True sys.path.append(current_path) return importModuleCheck(mod, parent, added) else: name = logical_line.split()[1] if name not in _missingImport: if VERBOSE_MISSING_IMPORT: print >> sys.stderr, ("ERROR: import '%s' failed: %s" % (name, exc)) _missingImport.add(name) added = False sys.path.pop() return except AttributeError: # Invalid import return logical_line.find(mod), ("CINDER N303: Invalid import, " "AttributeError raised") # convert "from x import y" to " import x.y" # convert "from x import y as z" to " import x.y" import_normalize(logical_line) split_line = logical_line.split() if (logical_line.startswith("import ") and "," not in logical_line and (len(split_line) == 2 or (len(split_line) == 4 and split_line[2] == "as"))): mod = split_line[1] rval = importModuleCheck(mod) if rval is not None: yield rval
[ "def", "cinder_import_module_only", "(", "logical_line", ")", ":", "def", "importModuleCheck", "(", "mod", ",", "parent", "=", "None", ",", "added", "=", "False", ")", ":", "\"\"\"\n If can't find module on first try, recursively check for relative\n imports\n ...
https://github.com/JiYou/openstack/blob/8607dd488bde0905044b303eb6e52bdea6806923/packages/source/cinder/tools/hacking.py#L125-L202
cloudera/hue
23f02102d4547c17c32bd5ea0eb24e9eadd657a4
desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/Cipher/_mode_gcm.py
python
GcmMode.decrypt
(self, ciphertext, output=None)
return self._cipher.decrypt(ciphertext, output=output)
Decrypt data with the key and the parameters set at initialization. A cipher object is stateful: once you have decrypted a message you cannot decrypt (or encrypt) another message with the same object. The data to decrypt can be broken up in two or more pieces and `decrypt` can be called multiple times. That is, the statement: >>> c.decrypt(a) + c.decrypt(b) is equivalent to: >>> c.decrypt(a+b) This function does not remove any padding from the plaintext. :Parameters: ciphertext : bytes/bytearray/memoryview The piece of data to decrypt. It can be of any length. :Keywords: output : bytearray/memoryview The location where the plaintext must be written to. If ``None``, the plaintext is returned. :Return: If ``output`` is ``None``, the plaintext as ``bytes``. Otherwise, ``None``.
Decrypt data with the key and the parameters set at initialization.
[ "Decrypt", "data", "with", "the", "key", "and", "the", "parameters", "set", "at", "initialization", "." ]
def decrypt(self, ciphertext, output=None): """Decrypt data with the key and the parameters set at initialization. A cipher object is stateful: once you have decrypted a message you cannot decrypt (or encrypt) another message with the same object. The data to decrypt can be broken up in two or more pieces and `decrypt` can be called multiple times. That is, the statement: >>> c.decrypt(a) + c.decrypt(b) is equivalent to: >>> c.decrypt(a+b) This function does not remove any padding from the plaintext. :Parameters: ciphertext : bytes/bytearray/memoryview The piece of data to decrypt. It can be of any length. :Keywords: output : bytearray/memoryview The location where the plaintext must be written to. If ``None``, the plaintext is returned. :Return: If ``output`` is ``None``, the plaintext as ``bytes``. Otherwise, ``None``. """ if self.decrypt not in self._next: raise TypeError("decrypt() can only be called" " after initialization or an update()") self._next = [self.decrypt, self.verify] if self._status == MacStatus.PROCESSING_AUTH_DATA: self._pad_cache_and_update() self._status = MacStatus.PROCESSING_CIPHERTEXT self._update(ciphertext) self._msg_len += len(ciphertext) return self._cipher.decrypt(ciphertext, output=output)
[ "def", "decrypt", "(", "self", ",", "ciphertext", ",", "output", "=", "None", ")", ":", "if", "self", ".", "decrypt", "not", "in", "self", ".", "_next", ":", "raise", "TypeError", "(", "\"decrypt() can only be called\"", "\" after initialization or an update()\"",...
https://github.com/cloudera/hue/blob/23f02102d4547c17c32bd5ea0eb24e9eadd657a4/desktop/core/ext-py/pycryptodomex-3.9.7/lib/Cryptodome/Cipher/_mode_gcm.py#L387-L432
cuthbertLab/music21
bd30d4663e52955ed922c10fdf541419d8c67671
music21/stream/makeNotation.py
python
moveNotesToVoices
(source: 'music21.stream.Stream', classFilterList=('GeneralNote',))
Move notes into voices. Happens inplace always. Returns None
Move notes into voices. Happens inplace always. Returns None
[ "Move", "notes", "into", "voices", ".", "Happens", "inplace", "always", ".", "Returns", "None" ]
def moveNotesToVoices(source: 'music21.stream.Stream', classFilterList=('GeneralNote',)): ''' Move notes into voices. Happens inplace always. Returns None ''' from music21.stream import Voice dst = Voice() # cast to list so source can be edited. affectedElements = list(source.getElementsByClass(classFilterList)) for e in affectedElements: dst.insert(source.elementOffset(e), e) source.remove(e) source.insert(0, dst)
[ "def", "moveNotesToVoices", "(", "source", ":", "'music21.stream.Stream'", ",", "classFilterList", "=", "(", "'GeneralNote'", ",", ")", ")", ":", "from", "music21", ".", "stream", "import", "Voice", "dst", "=", "Voice", "(", ")", "# cast to list so source can be e...
https://github.com/cuthbertLab/music21/blob/bd30d4663e52955ed922c10fdf541419d8c67671/music21/stream/makeNotation.py#L1551-L1564
wummel/linkchecker
c2ce810c3fb00b895a841a7be6b2e78c64e7b042
linkcheck/plugins/parseword.py
python
open_wordfile
(app, filename)
return app.Documents.Open(filename, ReadOnly=True, AddToRecentFiles=False, Visible=False, NoEncodingDialog=True)
Open given Word file with application object.
Open given Word file with application object.
[ "Open", "given", "Word", "file", "with", "application", "object", "." ]
def open_wordfile (app, filename): """Open given Word file with application object.""" return app.Documents.Open(filename, ReadOnly=True, AddToRecentFiles=False, Visible=False, NoEncodingDialog=True)
[ "def", "open_wordfile", "(", "app", ",", "filename", ")", ":", "return", "app", ".", "Documents", ".", "Open", "(", "filename", ",", "ReadOnly", "=", "True", ",", "AddToRecentFiles", "=", "False", ",", "Visible", "=", "False", ",", "NoEncodingDialog", "=",...
https://github.com/wummel/linkchecker/blob/c2ce810c3fb00b895a841a7be6b2e78c64e7b042/linkcheck/plugins/parseword.py#L93-L96
selfteaching/selfteaching-python-camp
9982ee964b984595e7d664b07c389cddaf158f1e
exercises/1901010064/d12/mymodule/stats_word.py
python
stats_text_cn
(text,count)
统计参数中每个中文汉字出现的次数,最后返回一个按字频降序排列的数组
统计参数中每个中文汉字出现的次数,最后返回一个按字频降序排列的数组
[ "统计参数中每个中文汉字出现的次数,最后返回一个按字频降序排列的数组" ]
def stats_text_cn(text,count): """统计参数中每个中文汉字出现的次数,最后返回一个按字频降序排列的数组""" if isinstance(text,str): string=text text_0=re.sub('[a-zA-Z0-9’!"#$%&\'()*+,-.:/:;<=>?@,。?★、…【】《》?“”‘’![\\]^_`{|}~\s]+', "", string) seg_list_0 = list(jieba.cut(text_0,cut_all=False)) seg_list_1=[] for i in seg_list_0: if len(i) >=2: seg_list_1.append(i) x=int(count) y=len(seg_list_1) x <= y tuple_1=tuple(seg_list_1) return collections.Counter(tuple_1).most_common(100)
[ "def", "stats_text_cn", "(", "text", ",", "count", ")", ":", "if", "isinstance", "(", "text", ",", "str", ")", ":", "string", "=", "text", "text_0", "=", "re", ".", "sub", "(", "'[a-zA-Z0-9’!\"#$%&\\'()*+,-.:/:;<=>?@,。?★、…【】《》?“”‘’![\\\\]^_`{|}~\\s]+', \"\", string)...
https://github.com/selfteaching/selfteaching-python-camp/blob/9982ee964b984595e7d664b07c389cddaf158f1e/exercises/1901010064/d12/mymodule/stats_word.py#L9-L23
douban/pymesos
047c7bac8ca98772f63192aed063148fdf399b55
pymesos/interface.py
python
OperatorMaster.agentAdded
(self, agent_info)
Sent whenever an agent becomes known to it. This can happen when an agent registered for the first time, or reregistered after a master failover.
Sent whenever an agent becomes known to it. This can happen when an agent registered for the first time, or reregistered after a master failover.
[ "Sent", "whenever", "an", "agent", "becomes", "known", "to", "it", ".", "This", "can", "happen", "when", "an", "agent", "registered", "for", "the", "first", "time", "or", "reregistered", "after", "a", "master", "failover", "." ]
def agentAdded(self, agent_info): """ Sent whenever an agent becomes known to it. This can happen when an agent registered for the first time, or reregistered after a master failover. """
[ "def", "agentAdded", "(", "self", ",", "agent_info", ")", ":" ]
https://github.com/douban/pymesos/blob/047c7bac8ca98772f63192aed063148fdf399b55/pymesos/interface.py#L727-L731
CoinAlpha/hummingbot
36f6149c1644c07cd36795b915f38b8f49b798e7
hummingbot/connector/exchange/hitbtc/hitbtc_exchange.py
python
HitbtcExchange.__init__
(self, hitbtc_api_key: str, hitbtc_secret_key: str, trading_pairs: Optional[List[str]] = None, trading_required: bool = True )
:param hitbtc_api_key: The API key to connect to private HitBTC APIs. :param hitbtc_secret_key: The API secret. :param trading_pairs: The market trading pairs which to track order book data. :param trading_required: Whether actual trading is needed.
:param hitbtc_api_key: The API key to connect to private HitBTC APIs. :param hitbtc_secret_key: The API secret. :param trading_pairs: The market trading pairs which to track order book data. :param trading_required: Whether actual trading is needed.
[ ":", "param", "hitbtc_api_key", ":", "The", "API", "key", "to", "connect", "to", "private", "HitBTC", "APIs", ".", ":", "param", "hitbtc_secret_key", ":", "The", "API", "secret", ".", ":", "param", "trading_pairs", ":", "The", "market", "trading", "pairs", ...
def __init__(self, hitbtc_api_key: str, hitbtc_secret_key: str, trading_pairs: Optional[List[str]] = None, trading_required: bool = True ): """ :param hitbtc_api_key: The API key to connect to private HitBTC APIs. :param hitbtc_secret_key: The API secret. :param trading_pairs: The market trading pairs which to track order book data. :param trading_required: Whether actual trading is needed. """ super().__init__() self._trading_required = trading_required self._trading_pairs = trading_pairs self._hitbtc_auth = HitbtcAuth(hitbtc_api_key, hitbtc_secret_key) self._order_book_tracker = HitbtcOrderBookTracker(trading_pairs=trading_pairs) self._user_stream_tracker = HitbtcUserStreamTracker(self._hitbtc_auth, trading_pairs) self._ev_loop = asyncio.get_event_loop() self._shared_client = None self._poll_notifier = asyncio.Event() self._last_timestamp = 0 self._in_flight_orders = {} # Dict[client_order_id:str, HitbtcInFlightOrder] self._order_not_found_records = {} # Dict[client_order_id:str, count:int] self._trading_rules = {} # Dict[trading_pair:str, TradingRule] self._status_polling_task = None self._user_stream_event_listener_task = None self._trading_rules_polling_task = None self._last_poll_timestamp = 0
[ "def", "__init__", "(", "self", ",", "hitbtc_api_key", ":", "str", ",", "hitbtc_secret_key", ":", "str", ",", "trading_pairs", ":", "Optional", "[", "List", "[", "str", "]", "]", "=", "None", ",", "trading_required", ":", "bool", "=", "True", ")", ":", ...
https://github.com/CoinAlpha/hummingbot/blob/36f6149c1644c07cd36795b915f38b8f49b798e7/hummingbot/connector/exchange/hitbtc/hitbtc_exchange.py#L75-L103
robotlearn/pyrobolearn
9cd7c060723fda7d2779fa255ac998c2c82b8436
pyrobolearn/filters/histogram_filter.py
python
HistogramFilter.measurement_update
(self, h, z)
return self.p
Predict (a posteriori) the next state by incorporating the measurement :math:`z_t`. Args: h (callable class/function): probabilistic (nonlinear) measurement function to see measurement from region k. This function should return an array of the same shape as the one provided in argument where each cell contains the probability to see the measurement `z` from that region (i.e. index). z (np.array): measurement array
Predict (a posteriori) the next state by incorporating the measurement :math:`z_t`.
[ "Predict", "(", "a", "posteriori", ")", "the", "next", "state", "by", "incorporating", "the", "measurement", ":", "math", ":", "z_t", "." ]
def measurement_update(self, h, z): """ Predict (a posteriori) the next state by incorporating the measurement :math:`z_t`. Args: h (callable class/function): probabilistic (nonlinear) measurement function to see measurement from region k. This function should return an array of the same shape as the one provided in argument where each cell contains the probability to see the measurement `z` from that region (i.e. index). z (np.array): measurement array """ # probability to see measurement z from region k (multiplication operation) self.p = h(z, self.p.shape) * self.p # normalize to get a proper probability distribution self.p /= np.sum(self.p) # return belief return self.p
[ "def", "measurement_update", "(", "self", ",", "h", ",", "z", ")", ":", "# probability to see measurement z from region k (multiplication operation)", "self", ".", "p", "=", "h", "(", "z", ",", "self", ".", "p", ".", "shape", ")", "*", "self", ".", "p", "# n...
https://github.com/robotlearn/pyrobolearn/blob/9cd7c060723fda7d2779fa255ac998c2c82b8436/pyrobolearn/filters/histogram_filter.py#L66-L83
andrewgodwin/channels-examples
5fa86dff822f411e1e6f01765c71eaf8d4f19977
news_collector/collector/views.py
python
index
(request)
return render(request, "index.html", {})
Main page is just a template
Main page is just a template
[ "Main", "page", "is", "just", "a", "template" ]
def index(request): """ Main page is just a template """ return render(request, "index.html", {})
[ "def", "index", "(", "request", ")", ":", "return", "render", "(", "request", ",", "\"index.html\"", ",", "{", "}", ")" ]
https://github.com/andrewgodwin/channels-examples/blob/5fa86dff822f411e1e6f01765c71eaf8d4f19977/news_collector/collector/views.py#L8-L12
JaniceWuo/MovieRecommend
4c86db64ca45598917d304f535413df3bc9fea65
movierecommend/venv1/Lib/site-packages/django/contrib/auth/management/__init__.py
python
get_system_username
()
return result
Try to determine the current system user's username. :returns: The username as a unicode string, or an empty string if the username could not be determined.
Try to determine the current system user's username.
[ "Try", "to", "determine", "the", "current", "system", "user", "s", "username", "." ]
def get_system_username(): """ Try to determine the current system user's username. :returns: The username as a unicode string, or an empty string if the username could not be determined. """ try: result = getpass.getuser() except (ImportError, KeyError): # KeyError will be raised by os.getpwuid() (called by getuser()) # if there is no corresponding entry in the /etc/passwd file # (a very restricted chroot environment, for example). return '' if six.PY2: try: result = result.decode(DEFAULT_LOCALE_ENCODING) except UnicodeDecodeError: # UnicodeDecodeError - preventive treatment for non-latin Windows. return '' return result
[ "def", "get_system_username", "(", ")", ":", "try", ":", "result", "=", "getpass", ".", "getuser", "(", ")", "except", "(", "ImportError", ",", "KeyError", ")", ":", "# KeyError will be raised by os.getpwuid() (called by getuser())", "# if there is no corresponding entry ...
https://github.com/JaniceWuo/MovieRecommend/blob/4c86db64ca45598917d304f535413df3bc9fea65/movierecommend/venv1/Lib/site-packages/django/contrib/auth/management/__init__.py#L89-L109
JiYou/openstack
8607dd488bde0905044b303eb6e52bdea6806923
packages/source/nova/nova/api/openstack/wsgi.py
python
deserializers
(**deserializers)
return decorator
Attaches deserializers to a method. This decorator associates a dictionary of deserializers with a method. Note that the function attributes are directly manipulated; the method is not wrapped.
Attaches deserializers to a method.
[ "Attaches", "deserializers", "to", "a", "method", "." ]
def deserializers(**deserializers): """Attaches deserializers to a method. This decorator associates a dictionary of deserializers with a method. Note that the function attributes are directly manipulated; the method is not wrapped. """ def decorator(func): if not hasattr(func, 'wsgi_deserializers'): func.wsgi_deserializers = {} func.wsgi_deserializers.update(deserializers) return func return decorator
[ "def", "deserializers", "(", "*", "*", "deserializers", ")", ":", "def", "decorator", "(", "func", ")", ":", "if", "not", "hasattr", "(", "func", ",", "'wsgi_deserializers'", ")", ":", "func", ".", "wsgi_deserializers", "=", "{", "}", "func", ".", "wsgi_...
https://github.com/JiYou/openstack/blob/8607dd488bde0905044b303eb6e52bdea6806923/packages/source/nova/nova/api/openstack/wsgi.py#L447-L460
Qirky/FoxDot
76318f9630bede48ff3994146ed644affa27bfa4
FoxDot/lib/OSC.py
python
OSCRequestHandler.finish
(self)
Finish handling OSCMessage. Send any reply returned by the callback(s) back to the originating client as an OSCMessage or OSCBundle
Finish handling OSCMessage. Send any reply returned by the callback(s) back to the originating client as an OSCMessage or OSCBundle
[ "Finish", "handling", "OSCMessage", ".", "Send", "any", "reply", "returned", "by", "the", "callback", "(", "s", ")", "back", "to", "the", "originating", "client", "as", "an", "OSCMessage", "or", "OSCBundle" ]
def finish(self): """Finish handling OSCMessage. Send any reply returned by the callback(s) back to the originating client as an OSCMessage or OSCBundle """ if self.server.return_port: self.client_address = (self.client_address[0], self.server.return_port) if len(self.replies) > 1: msg = OSCBundle() for reply in self.replies: msg.append(reply) elif len(self.replies) == 1: msg = self.replies[0] else: return self.server.client.sendto(msg, self.client_address)
[ "def", "finish", "(", "self", ")", ":", "if", "self", ".", "server", ".", "return_port", ":", "self", ".", "client_address", "=", "(", "self", ".", "client_address", "[", "0", "]", ",", "self", ".", "server", ".", "return_port", ")", "if", "len", "("...
https://github.com/Qirky/FoxDot/blob/76318f9630bede48ff3994146ed644affa27bfa4/FoxDot/lib/OSC.py#L1796-L1813
aiidateam/aiida-core
c743a335480f8bb3a5e4ebd2463a31f9f3b9f9b2
aiida/cmdline/utils/echo.py
python
echo
(message: str, fg: str = None, bold: bool = False, nl: bool = True, err: bool = False)
Log a message to the cmdline logger. .. note:: The message will be logged at the ``REPORT`` level but always without the log level prefix. :param message: the message to log. :param fg: if provided this will become the foreground color. :param bold: whether to print the messaformat bold. :param nl: whether to print a newlineaddhe end of the message. :param err: whether to log to stderr.
Log a message to the cmdline logger.
[ "Log", "a", "message", "to", "the", "cmdline", "logger", "." ]
def echo(message: str, fg: str = None, bold: bool = False, nl: bool = True, err: bool = False) -> None: """Log a message to the cmdline logger. .. note:: The message will be logged at the ``REPORT`` level but always without the log level prefix. :param message: the message to log. :param fg: if provided this will become the foreground color. :param bold: whether to print the messaformat bold. :param nl: whether to print a newlineaddhe end of the message. :param err: whether to log to stderr. """ message = click.style(message, fg=fg, bold=bold) CMDLINE_LOGGER.report(message, extra=dict(nl=nl, err=err, prefix=False))
[ "def", "echo", "(", "message", ":", "str", ",", "fg", ":", "str", "=", "None", ",", "bold", ":", "bool", "=", "False", ",", "nl", ":", "bool", "=", "True", ",", "err", ":", "bool", "=", "False", ")", "->", "None", ":", "message", "=", "click", ...
https://github.com/aiidateam/aiida-core/blob/c743a335480f8bb3a5e4ebd2463a31f9f3b9f9b2/aiida/cmdline/utils/echo.py#L46-L58
pulp/pulp
a0a28d804f997b6f81c391378aff2e4c90183df9
nodes/common/pulp_node/manifest.py
python
RemoteManifest.fetch
(self)
Fetch the manifest file using the specified URL. :raise ManifestDownloadError: on downloading errors. :raise HTTPError: on URL errors. :raise ValueError: on json decoding errors
Fetch the manifest file using the specified URL. :raise ManifestDownloadError: on downloading errors. :raise HTTPError: on URL errors. :raise ValueError: on json decoding errors
[ "Fetch", "the", "manifest", "file", "using", "the", "specified", "URL", ".", ":", "raise", "ManifestDownloadError", ":", "on", "downloading", "errors", ".", ":", "raise", "HTTPError", ":", "on", "URL", "errors", ".", ":", "raise", "ValueError", ":", "on", ...
def fetch(self): """ Fetch the manifest file using the specified URL. :raise ManifestDownloadError: on downloading errors. :raise HTTPError: on URL errors. :raise ValueError: on json decoding errors """ listener = AggregatingEventListener() destination = os.path.join(os.path.dirname(self.path), '.' + MANIFEST_FILE_NAME) request = DownloadRequest(self.url, destination) self.downloader.event_listener = listener self.downloader.download([request]) if listener.failed_reports: report = listener.failed_reports[0] raise ManifestDownloadError(self.url, report.error_msg) self.read(destination)
[ "def", "fetch", "(", "self", ")", ":", "listener", "=", "AggregatingEventListener", "(", ")", "destination", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "self", ".", "path", ")", ",", "'.'", "+", "MANIFEST_FILE_NAM...
https://github.com/pulp/pulp/blob/a0a28d804f997b6f81c391378aff2e4c90183df9/nodes/common/pulp_node/manifest.py#L260-L275
Chaffelson/nipyapi
d3b186fd701ce308c2812746d98af9120955e810
nipyapi/nifi/models/system_diagnostics_snapshot_dto.py
python
SystemDiagnosticsSnapshotDTO.content_repository_storage_usage
(self, content_repository_storage_usage)
Sets the content_repository_storage_usage of this SystemDiagnosticsSnapshotDTO. The content repository storage usage. :param content_repository_storage_usage: The content_repository_storage_usage of this SystemDiagnosticsSnapshotDTO. :type: list[StorageUsageDTO]
Sets the content_repository_storage_usage of this SystemDiagnosticsSnapshotDTO. The content repository storage usage.
[ "Sets", "the", "content_repository_storage_usage", "of", "this", "SystemDiagnosticsSnapshotDTO", ".", "The", "content", "repository", "storage", "usage", "." ]
def content_repository_storage_usage(self, content_repository_storage_usage): """ Sets the content_repository_storage_usage of this SystemDiagnosticsSnapshotDTO. The content repository storage usage. :param content_repository_storage_usage: The content_repository_storage_usage of this SystemDiagnosticsSnapshotDTO. :type: list[StorageUsageDTO] """ self._content_repository_storage_usage = content_repository_storage_usage
[ "def", "content_repository_storage_usage", "(", "self", ",", "content_repository_storage_usage", ")", ":", "self", ".", "_content_repository_storage_usage", "=", "content_repository_storage_usage" ]
https://github.com/Chaffelson/nipyapi/blob/d3b186fd701ce308c2812746d98af9120955e810/nipyapi/nifi/models/system_diagnostics_snapshot_dto.py#L755-L764
open-telemetry/opentelemetry-python
f5d872050204685b5ef831d02ec593956820ebe6
exporter/opentelemetry-exporter-jaeger-proto-grpc/src/opentelemetry/exporter/jaeger/proto/grpc/translate/__init__.py
python
_get_double_key_value
(key: str, value: float)
return model_pb2.KeyValue( key=key, v_float64=value, v_type=model_pb2.ValueType.FLOAT64 )
Returns jaeger double KeyValue.
Returns jaeger double KeyValue.
[ "Returns", "jaeger", "double", "KeyValue", "." ]
def _get_double_key_value(key: str, value: float) -> model_pb2.KeyValue: """Returns jaeger double KeyValue.""" return model_pb2.KeyValue( key=key, v_float64=value, v_type=model_pb2.ValueType.FLOAT64 )
[ "def", "_get_double_key_value", "(", "key", ":", "str", ",", "value", ":", "float", ")", "->", "model_pb2", ".", "KeyValue", ":", "return", "model_pb2", ".", "KeyValue", "(", "key", "=", "key", ",", "v_float64", "=", "value", ",", "v_type", "=", "model_p...
https://github.com/open-telemetry/opentelemetry-python/blob/f5d872050204685b5ef831d02ec593956820ebe6/exporter/opentelemetry-exporter-jaeger-proto-grpc/src/opentelemetry/exporter/jaeger/proto/grpc/translate/__init__.py#L136-L140
oilshell/oil
94388e7d44a9ad879b12615f6203b38596b5a2d3
opy/compiler2/transformer.py
python
Transformer.if_stmt
(self, nodelist)
return If(tests, elseNode, lineno=nodelist[0][2])
[]
def if_stmt(self, nodelist): # if: test ':' suite ('elif' test ':' suite)* ['else' ':' suite] tests = [] for i in range(0, len(nodelist) - 3, 4): testNode = self.com_node(nodelist[i + 1]) suiteNode = self.com_node(nodelist[i + 3]) tests.append((testNode, suiteNode)) if len(nodelist) % 4 == 3: elseNode = self.com_node(nodelist[-1]) ## elseNode.lineno = nodelist[-1][1][2] else: elseNode = None return If(tests, elseNode, lineno=nodelist[0][2])
[ "def", "if_stmt", "(", "self", ",", "nodelist", ")", ":", "# if: test ':' suite ('elif' test ':' suite)* ['else' ':' suite]", "tests", "=", "[", "]", "for", "i", "in", "range", "(", "0", ",", "len", "(", "nodelist", ")", "-", "3", ",", "4", ")", ":", "test...
https://github.com/oilshell/oil/blob/94388e7d44a9ad879b12615f6203b38596b5a2d3/opy/compiler2/transformer.py#L590-L603
pydanny/django-uni-form
159f539e2fb98752b7964d75e955fc62881c28fb
uni_form/layout.py
python
BaseInput.render
(self, form, form_style, context)
return render_to_string(self.template, Context({'input': self}))
Renders an `<input />` if container is used as a Layout object
Renders an `<input />` if container is used as a Layout object
[ "Renders", "an", "<input", "/", ">", "if", "container", "is", "used", "as", "a", "Layout", "object" ]
def render(self, form, form_style, context): """ Renders an `<input />` if container is used as a Layout object """ return render_to_string(self.template, Context({'input': self}))
[ "def", "render", "(", "self", ",", "form", ",", "form_style", ",", "context", ")", ":", "return", "render_to_string", "(", "self", ".", "template", ",", "Context", "(", "{", "'input'", ":", "self", "}", ")", ")" ]
https://github.com/pydanny/django-uni-form/blob/159f539e2fb98752b7964d75e955fc62881c28fb/uni_form/layout.py#L95-L99
deanishe/alfred-convert
97407f4ec8dbca5abbc6952b2b56cf3918624177
src/pint/registry.py
python
BaseRegistry._convert
(self, value, src, dst, inplace=False, check_dimensionality=True)
return value
Convert value from some source to destination units. :param value: value :param src: source units. :type src: UnitsContainer :param dst: destination units. :type dst: UnitsContainer :return: converted value
Convert value from some source to destination units.
[ "Convert", "value", "from", "some", "source", "to", "destination", "units", "." ]
def _convert(self, value, src, dst, inplace=False, check_dimensionality=True): """Convert value from some source to destination units. :param value: value :param src: source units. :type src: UnitsContainer :param dst: destination units. :type dst: UnitsContainer :return: converted value """ if check_dimensionality: src_dim = self._get_dimensionality(src) dst_dim = self._get_dimensionality(dst) # If the source and destination dimensionality are different, # then the conversion cannot be performed. if src_dim != dst_dim: raise DimensionalityError(src, dst, src_dim, dst_dim) # Here src and dst have only multiplicative units left. Thus we can # convert with a factor. factor, units = self._get_root_units(src / dst) # factor is type float and if our magnitude is type Decimal then # must first convert to Decimal before we can '*' the values if isinstance(value, Decimal): factor = Decimal(str(factor)) elif isinstance(value, Fraction): factor = Fraction(str(factor)) if inplace: value *= factor else: value = value * factor return value
[ "def", "_convert", "(", "self", ",", "value", ",", "src", ",", "dst", ",", "inplace", "=", "False", ",", "check_dimensionality", "=", "True", ")", ":", "if", "check_dimensionality", ":", "src_dim", "=", "self", ".", "_get_dimensionality", "(", "src", ")", ...
https://github.com/deanishe/alfred-convert/blob/97407f4ec8dbca5abbc6952b2b56cf3918624177/src/pint/registry.py#L713-L751
krintoxi/NoobSec-Toolkit
38738541cbc03cedb9a3b3ed13b629f781ad64f6
NoobSecToolkit /tools/sqli/plugins/dbms/maxdb/fingerprint.py
python
Fingerprint.__init__
(self)
[]
def __init__(self): GenericFingerprint.__init__(self, DBMS.MAXDB)
[ "def", "__init__", "(", "self", ")", ":", "GenericFingerprint", ".", "__init__", "(", "self", ",", "DBMS", ".", "MAXDB", ")" ]
https://github.com/krintoxi/NoobSec-Toolkit/blob/38738541cbc03cedb9a3b3ed13b629f781ad64f6/NoobSecToolkit /tools/sqli/plugins/dbms/maxdb/fingerprint.py#L22-L23
easyw/kicadStepUpMod
9d78e59b97cedc4915ee3a290126a88dcdf11277
fcad_parser/sexp_parser/sexp_parser.py
python
Sexp._exportValue
(self,out,value,prefix,indent)
Called by `_export()` to export each individual value It tries ``value._export()`` before fallback to str(value) Subclass can override this method to customize the behavior
Called by `_export()` to export each individual value
[ "Called", "by", "_export", "()", "to", "export", "each", "individual", "value" ]
def _exportValue(self,out,value,prefix,indent): '''Called by `_export()` to export each individual value It tries ``value._export()`` before fallback to str(value) Subclass can override this method to customize the behavior ''' p = getattr(value,'_export',None) if p is not None: p(out,prefix,indent) else: out.write(' {}'.format(value))
[ "def", "_exportValue", "(", "self", ",", "out", ",", "value", ",", "prefix", ",", "indent", ")", ":", "p", "=", "getattr", "(", "value", ",", "'_export'", ",", "None", ")", "if", "p", "is", "not", "None", ":", "p", "(", "out", ",", "prefix", ",",...
https://github.com/easyw/kicadStepUpMod/blob/9d78e59b97cedc4915ee3a290126a88dcdf11277/fcad_parser/sexp_parser/sexp_parser.py#L241-L251
isnowfy/pydown
71ecc891868cd2a34b7e5fe662c99474f2d0fd7f
markdown/odict.py
python
OrderedDict.items
(self)
return zip(self.keyOrder, self.values())
[]
def items(self): return zip(self.keyOrder, self.values())
[ "def", "items", "(", "self", ")", ":", "return", "zip", "(", "self", ".", "keyOrder", ",", "self", ".", "values", "(", ")", ")" ]
https://github.com/isnowfy/pydown/blob/71ecc891868cd2a34b7e5fe662c99474f2d0fd7f/markdown/odict.py#L57-L58
Azure/azure-devops-cli-extension
11334cd55806bef0b99c3bee5a438eed71e44037
azure-devops/azext_devops/devops_sdk/v6_0/identity/identity_client.py
python
IdentityClient.add_member
(self, container_id, member_id)
return self._deserialize('bool', response)
AddMember. [Preview API] :param str container_id: :param str member_id: :rtype: bool
AddMember. [Preview API] :param str container_id: :param str member_id: :rtype: bool
[ "AddMember", ".", "[", "Preview", "API", "]", ":", "param", "str", "container_id", ":", ":", "param", "str", "member_id", ":", ":", "rtype", ":", "bool" ]
def add_member(self, container_id, member_id): """AddMember. [Preview API] :param str container_id: :param str member_id: :rtype: bool """ route_values = {} if container_id is not None: route_values['containerId'] = self._serialize.url('container_id', container_id, 'str') if member_id is not None: route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') response = self._send(http_method='PUT', location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', version='6.0-preview.1', route_values=route_values) return self._deserialize('bool', response)
[ "def", "add_member", "(", "self", ",", "container_id", ",", "member_id", ")", ":", "route_values", "=", "{", "}", "if", "container_id", "is", "not", "None", ":", "route_values", "[", "'containerId'", "]", "=", "self", ".", "_serialize", ".", "url", "(", ...
https://github.com/Azure/azure-devops-cli-extension/blob/11334cd55806bef0b99c3bee5a438eed71e44037/azure-devops/azext_devops/devops_sdk/v6_0/identity/identity_client.py#L334-L350
randy3k/SendCode
6775b40613bb4911ba0499ff8a600c41f48a62c2
code_getter/getter.py
python
CodeGetter.get_code
(self)
return cmd
[]
def get_code(self): view = self.view cmd = '' moved = False sels = [s for s in view.sel()] for s in sels: if s.empty(): original_s = s s = self.expand_cursor(s) if self.auto_advance: view.sel().subtract(original_s) self.advance(s) moved = True cmd += self.substr(s) + '\n' if moved: view.show(view.sel()) return cmd
[ "def", "get_code", "(", "self", ")", ":", "view", "=", "self", ".", "view", "cmd", "=", "''", "moved", "=", "False", "sels", "=", "[", "s", "for", "s", "in", "view", ".", "sel", "(", ")", "]", "for", "s", "in", "sels", ":", "if", "s", ".", ...
https://github.com/randy3k/SendCode/blob/6775b40613bb4911ba0499ff8a600c41f48a62c2/code_getter/getter.py#L80-L99
aws-quickstart/quickstart-redhat-openshift
2b87dd38b72e7e4c439a606c5a9ea458d72da612
functions/source/KeyGen/asn1crypto/core.py
python
Concat.__copy__
(self)
return new_obj
Implements the copy.copy() interface :return: A new shallow copy of the Concat object
Implements the copy.copy() interface
[ "Implements", "the", "copy", ".", "copy", "()", "interface" ]
def __copy__(self): """ Implements the copy.copy() interface :return: A new shallow copy of the Concat object """ new_obj = self.__class__() new_obj._copy(self, copy.copy) return new_obj
[ "def", "__copy__", "(", "self", ")", ":", "new_obj", "=", "self", ".", "__class__", "(", ")", "new_obj", ".", "_copy", "(", "self", ",", "copy", ".", "copy", ")", "return", "new_obj" ]
https://github.com/aws-quickstart/quickstart-redhat-openshift/blob/2b87dd38b72e7e4c439a606c5a9ea458d72da612/functions/source/KeyGen/asn1crypto/core.py#L1396-L1406
django-nonrel/django-nonrel
4fbfe7344481a5eab8698f79207f09124310131b
django/contrib/gis/geos/geometry.py
python
GEOSGeometry.simple
(self)
return capi.geos_issimple(self.ptr)
Returns false if the Geometry not simple.
Returns false if the Geometry not simple.
[ "Returns", "false", "if", "the", "Geometry", "not", "simple", "." ]
def simple(self): "Returns false if the Geometry not simple." return capi.geos_issimple(self.ptr)
[ "def", "simple", "(", "self", ")", ":", "return", "capi", ".", "geos_issimple", "(", "self", ".", "ptr", ")" ]
https://github.com/django-nonrel/django-nonrel/blob/4fbfe7344481a5eab8698f79207f09124310131b/django/contrib/gis/geos/geometry.py#L270-L272
fniephaus/alfred-pocket
c8ff8b23d708a746cce2888398cc566bef687a14
src/workflow/workflow.py
python
Workflow.clear_data
(self, filter_func=lambda f: True)
Delete all files in workflow's :attr:`datadir`. :param filter_func: Callable to determine whether a file should be deleted or not. ``filter_func`` is called with the filename of each file in the data directory. If it returns ``True``, the file will be deleted. By default, *all* files will be deleted. :type filter_func: ``callable``
Delete all files in workflow's :attr:`datadir`.
[ "Delete", "all", "files", "in", "workflow", "s", ":", "attr", ":", "datadir", "." ]
def clear_data(self, filter_func=lambda f: True): """Delete all files in workflow's :attr:`datadir`. :param filter_func: Callable to determine whether a file should be deleted or not. ``filter_func`` is called with the filename of each file in the data directory. If it returns ``True``, the file will be deleted. By default, *all* files will be deleted. :type filter_func: ``callable`` """ self._delete_directory_contents(self.datadir, filter_func)
[ "def", "clear_data", "(", "self", ",", "filter_func", "=", "lambda", "f", ":", "True", ")", ":", "self", ".", "_delete_directory_contents", "(", "self", ".", "datadir", ",", "filter_func", ")" ]
https://github.com/fniephaus/alfred-pocket/blob/c8ff8b23d708a746cce2888398cc566bef687a14/src/workflow/workflow.py#L2611-L2621
inasafe/inasafe
355eb2ce63f516b9c26af0c86a24f99e53f63f87
extras/xml_tools.py
python
dom2object
(node)
return X
Convert DOM representation to XML_object hierarchy.
Convert DOM representation to XML_object hierarchy.
[ "Convert", "DOM", "representation", "to", "XML_object", "hierarchy", "." ]
def dom2object(node): """Convert DOM representation to XML_object hierarchy. """ value = [] textnode_encountered = None for n in node.childNodes: if n.nodeType == 3: # Child is a text element - omit the dom tag #text and # go straight to the text value. # Note - only the last text value will be recorded msg = 'Text element has child nodes - this shouldn\'t happen' verify(len(n.childNodes) == 0, msg) x = n.nodeValue.strip() if len(x) == 0: # Skip empty text children continue textnode_encountered = value = x else: # XML element if textnode_encountered is not None: msg = 'A text node was followed by a non-text tag. This is not allowed.\n' msg += 'Offending text node: "%s" ' %str(textnode_encountered) msg += 'was followed by node named: "<%s>"' %str(n.nodeName) raise Exception, msg value.append(dom2object(n)) # Deal with empty elements if len(value) == 0: value = '' if node.nodeType == 9: # Root node (document) tag = None else: # Normal XML node tag = node.nodeName X = XML_element(tag=tag, value=value) return X
[ "def", "dom2object", "(", "node", ")", ":", "value", "=", "[", "]", "textnode_encountered", "=", "None", "for", "n", "in", "node", ".", "childNodes", ":", "if", "n", ".", "nodeType", "==", "3", ":", "# Child is a text element - omit the dom tag #text and", "# ...
https://github.com/inasafe/inasafe/blob/355eb2ce63f516b9c26af0c86a24f99e53f63f87/extras/xml_tools.py#L260-L313
KristianOellegaard/django-hvad
b4fb1ff3674bd8309530ed5dcb95e9c3afd53a10
hvad/admin.py
python
TranslatableInlineModelAdmin.response_change
(self, request, obj)
return redirect
[]
def response_change(self, request, obj): redirect = super(TranslatableAdmin, self).response_change(request, obj) uri = iri_to_uri(request.path) if redirect['Location'] in (uri, "../add/"): if self.query_language_key in request.GET: redirect['Location'] = '%s?%s=%s' % (redirect['Location'], self.query_language_key, request.GET[self.query_language_key]) return redirect
[ "def", "response_change", "(", "self", ",", "request", ",", "obj", ")", ":", "redirect", "=", "super", "(", "TranslatableAdmin", ",", "self", ")", ".", "response_change", "(", "request", ",", "obj", ")", "uri", "=", "iri_to_uri", "(", "request", ".", "pa...
https://github.com/KristianOellegaard/django-hvad/blob/b4fb1ff3674bd8309530ed5dcb95e9c3afd53a10/hvad/admin.py#L430-L437
F8LEFT/DecLLVM
d38e45e3d0dd35634adae1d0cf7f96f3bd96e74c
python/idaapi.py
python
py_clinked_object_t.__del__
(self)
Delete the link upon object destruction (only if not static)
Delete the link upon object destruction (only if not static)
[ "Delete", "the", "link", "upon", "object", "destruction", "(", "only", "if", "not", "static", ")" ]
def __del__(self): """ Delete the link upon object destruction (only if not static) """ self._free()
[ "def", "__del__", "(", "self", ")", ":", "self", ".", "_free", "(", ")" ]
https://github.com/F8LEFT/DecLLVM/blob/d38e45e3d0dd35634adae1d0cf7f96f3bd96e74c/python/idaapi.py#L200-L204
mrkipling/maraschino
c6be9286937783ae01df2d6d8cebfc8b2734a7d7
lib/werkzeug/http.py
python
http_date
(timestamp=None)
return _dump_date(timestamp, ' ')
Formats the time to match the RFC1123 date format. Accepts a floating point number expressed in seconds since the epoch in, a datetime object or a timetuple. All times in UTC. The :func:`parse_date` function can be used to parse such a date. Outputs a string in the format ``Wdy, DD Mon YYYY HH:MM:SS GMT``. :param timestamp: If provided that date is used, otherwise the current.
Formats the time to match the RFC1123 date format.
[ "Formats", "the", "time", "to", "match", "the", "RFC1123", "date", "format", "." ]
def http_date(timestamp=None): """Formats the time to match the RFC1123 date format. Accepts a floating point number expressed in seconds since the epoch in, a datetime object or a timetuple. All times in UTC. The :func:`parse_date` function can be used to parse such a date. Outputs a string in the format ``Wdy, DD Mon YYYY HH:MM:SS GMT``. :param timestamp: If provided that date is used, otherwise the current. """ return _dump_date(timestamp, ' ')
[ "def", "http_date", "(", "timestamp", "=", "None", ")", ":", "return", "_dump_date", "(", "timestamp", ",", "' '", ")" ]
https://github.com/mrkipling/maraschino/blob/c6be9286937783ae01df2d6d8cebfc8b2734a7d7/lib/werkzeug/http.py#L612-L623
scanny/python-pptx
71d1ca0b2b3b9178d64cdab565e8503a25a54e0b
pptx/oxml/dml/fill.py
python
CT_GradientFillProperties._new_gsLst
(self)
return CT_GradientStopList.new_gsLst()
Override default to add minimum subtree.
Override default to add minimum subtree.
[ "Override", "default", "to", "add", "minimum", "subtree", "." ]
def _new_gsLst(self): """Override default to add minimum subtree.""" return CT_GradientStopList.new_gsLst()
[ "def", "_new_gsLst", "(", "self", ")", ":", "return", "CT_GradientStopList", ".", "new_gsLst", "(", ")" ]
https://github.com/scanny/python-pptx/blob/71d1ca0b2b3b9178d64cdab565e8503a25a54e0b/pptx/oxml/dml/fill.py#L89-L91
jeetsukumaran/DendroPy
29fd294bf05d890ebf6a8d576c501e471db27ca1
src/dendropy/calculate/statistics.py
python
rank
(value_to_be_ranked, value_providing_rank)
return len(num_lesser)
Returns the rank of ``value_to_be_ranked`` in set of values, ``values``. Works even if ``values`` is a non-orderable collection (e.g., a set). A binary search would be an optimized way of doing this if we can constrain ``values`` to be an ordered collection.
Returns the rank of ``value_to_be_ranked`` in set of values, ``values``. Works even if ``values`` is a non-orderable collection (e.g., a set). A binary search would be an optimized way of doing this if we can constrain ``values`` to be an ordered collection.
[ "Returns", "the", "rank", "of", "value_to_be_ranked", "in", "set", "of", "values", "values", ".", "Works", "even", "if", "values", "is", "a", "non", "-", "orderable", "collection", "(", "e", ".", "g", ".", "a", "set", ")", ".", "A", "binary", "search",...
def rank(value_to_be_ranked, value_providing_rank): """ Returns the rank of ``value_to_be_ranked`` in set of values, ``values``. Works even if ``values`` is a non-orderable collection (e.g., a set). A binary search would be an optimized way of doing this if we can constrain ``values`` to be an ordered collection. """ num_lesser = [v for v in value_providing_rank if v < value_to_be_ranked] return len(num_lesser)
[ "def", "rank", "(", "value_to_be_ranked", ",", "value_providing_rank", ")", ":", "num_lesser", "=", "[", "v", "for", "v", "in", "value_providing_rank", "if", "v", "<", "value_to_be_ranked", "]", "return", "len", "(", "num_lesser", ")" ]
https://github.com/jeetsukumaran/DendroPy/blob/29fd294bf05d890ebf6a8d576c501e471db27ca1/src/dendropy/calculate/statistics.py#L250-L258
nipy/heudiconv
80a65385ef867124611d037fceac27d27e30f480
heudiconv/due.py
python
InactiveDueCreditCollector._donothing
(self, *args, **kwargs)
Perform no good and no bad
Perform no good and no bad
[ "Perform", "no", "good", "and", "no", "bad" ]
def _donothing(self, *args, **kwargs): """Perform no good and no bad""" pass
[ "def", "_donothing", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "pass" ]
https://github.com/nipy/heudiconv/blob/80a65385ef867124611d037fceac27d27e30f480/heudiconv/due.py#L32-L34
ydkhatri/mac_apt
729630c8bbe7a73cce3ca330305d3301a919cb07
plugins/helpers/macinfo.py
python
MountedMacInfo._GetDarwinFoldersInfo
(self)
Gets DARWIN_*_DIR paths
Gets DARWIN_*_DIR paths
[ "Gets", "DARWIN_", "*", "_DIR", "paths" ]
def _GetDarwinFoldersInfo(self): '''Gets DARWIN_*_DIR paths ''' if not self.is_windows: # Unix/Linux or Mac mounted disks should preserve UID/GID, so we can read it normally from the files. super()._GetDarwinFoldersInfo() return for user in self.users: if user.UUID != '' and user.UID not in ('', '-2', '1', '201'): # Users nobody, daemon, guest don't have one darwin_path = '/private/var/folders/' + GetDarwinPath2(user.UUID, user.UID) if not self.IsValidFolderPath(darwin_path): darwin_path = '/private/var/folders/' + GetDarwinPath(user.UUID, user.UID) if not self.IsValidFolderPath(darwin_path): if user.user_name.startswith('_') and user.UUID.upper().startswith('FFFFEEEE'): pass else: log.warning(f'Could not find DARWIN_PATH for user {user.user_name}, uid={user.UID}, uuid={user.UUID}') continue user.DARWIN_USER_DIR = darwin_path + '/0' user.DARWIN_USER_CACHE_DIR = darwin_path + '/C' user.DARWIN_USER_TEMP_DIR = darwin_path + '/T'
[ "def", "_GetDarwinFoldersInfo", "(", "self", ")", ":", "if", "not", "self", ".", "is_windows", ":", "# Unix/Linux or Mac mounted disks should preserve UID/GID, so we can read it normally from the files.", "super", "(", ")", ".", "_GetDarwinFoldersInfo", "(", ")", "return", ...
https://github.com/ydkhatri/mac_apt/blob/729630c8bbe7a73cce3ca330305d3301a919cb07/plugins/helpers/macinfo.py#L1485-L1505