nwo
stringlengths
5
86
sha
stringlengths
40
40
path
stringlengths
4
189
language
stringclasses
1 value
identifier
stringlengths
1
94
parameters
stringlengths
2
4.03k
argument_list
stringclasses
1 value
return_statement
stringlengths
0
11.5k
docstring
stringlengths
1
33.2k
docstring_summary
stringlengths
0
5.15k
docstring_tokens
list
function
stringlengths
34
151k
function_tokens
list
url
stringlengths
90
278
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.ScrollToColumn
(*args, **kwargs)
return _stc.StyledTextCtrl_ScrollToColumn(*args, **kwargs)
ScrollToColumn(self, int column) Scroll enough to make the given column visible
ScrollToColumn(self, int column)
[ "ScrollToColumn", "(", "self", "int", "column", ")" ]
def ScrollToColumn(*args, **kwargs): """ ScrollToColumn(self, int column) Scroll enough to make the given column visible """ return _stc.StyledTextCtrl_ScrollToColumn(*args, **kwargs)
[ "def", "ScrollToColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_ScrollToColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L6613-L6619
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/head.py
python
_MultiHead._merge_train
(self, all_model_fn_ops, train_op_fn)
return model_fn.ModelFnOps( mode=model_fn.ModeKeys.TRAIN, loss=loss, train_op=train_op, eval_metric_ops=metrics)
Merges list of ModelFnOps for training. Args: all_model_fn_ops: list of ModelFnOps for the individual heads. train_op_fn: Function to create train op. See `create_model_fn_ops` documentation for more details. Returns: ModelFnOps that merges all heads for TRAIN.
Merges list of ModelFnOps for training.
[ "Merges", "list", "of", "ModelFnOps", "for", "training", "." ]
def _merge_train(self, all_model_fn_ops, train_op_fn): """Merges list of ModelFnOps for training. Args: all_model_fn_ops: list of ModelFnOps for the individual heads. train_op_fn: Function to create train op. See `create_model_fn_ops` documentation for more details. Returns: Mo...
[ "def", "_merge_train", "(", "self", ",", "all_model_fn_ops", ",", "train_op_fn", ")", ":", "losses", "=", "[", "]", "metrics", "=", "{", "}", "additional_train_ops", "=", "[", "]", "for", "m", "in", "all_model_fn_ops", ":", "losses", ".", "append", "(", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/learn/python/learn/estimators/head.py#L1695-L1724
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
external_tools/ply_info/example/BASIC/basparse.py
python
p_command_def_bad_arg
(p)
command : DEF ID LPAREN error RPAREN EQUALS expr
command : DEF ID LPAREN error RPAREN EQUALS expr
[ "command", ":", "DEF", "ID", "LPAREN", "error", "RPAREN", "EQUALS", "expr" ]
def p_command_def_bad_arg(p): '''command : DEF ID LPAREN error RPAREN EQUALS expr''' p[0] = "BAD ARGUMENT IN DEF STATEMENT"
[ "def", "p_command_def_bad_arg", "(", "p", ")", ":", "p", "[", "0", "]", "=", "\"BAD ARGUMENT IN DEF STATEMENT\"" ]
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/BASIC/basparse.py#L229-L231
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/handlers.py
python
DatagramHandler.__init__
(self, host, port)
Initializes the handler with a specific host address and port.
Initializes the handler with a specific host address and port.
[ "Initializes", "the", "handler", "with", "a", "specific", "host", "address", "and", "port", "." ]
def __init__(self, host, port): """ Initializes the handler with a specific host address and port. """ SocketHandler.__init__(self, host, port) self.closeOnError = 0
[ "def", "__init__", "(", "self", ",", "host", ",", "port", ")", ":", "SocketHandler", ".", "__init__", "(", "self", ",", "host", ",", "port", ")", "self", ".", "closeOnError", "=", "0" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/handlers.py#L609-L614
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/httplib.py
python
HTTPConnection.getresponse
(self)
return response
Get the response from the server.
Get the response from the server.
[ "Get", "the", "response", "from", "the", "server", "." ]
def getresponse(self): "Get the response from the server." # if a prior response has been completed, then forget about it. if self.__response and self.__response.isclosed(): self.__response = None # # if a prior response exists, then it must be completed (otherwise,...
[ "def", "getresponse", "(", "self", ")", ":", "# if a prior response has been completed, then forget about it.", "if", "self", ".", "__response", "and", "self", ".", "__response", ".", "isclosed", "(", ")", ":", "self", ".", "__response", "=", "None", "#", "# if a ...
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/httplib.py#L952-L997
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
python
_AddCompileTargets
(target, roots, add_if_no_ancestor, result)
Recurses through all targets that depend on |target|, adding all targets that need to be built (and are in |roots|) to |result|. roots: set of root targets. add_if_no_ancestor: If true and there are no ancestors of |target| then add |target| to |result|. |target| must still be in |roots|. result: targets that...
Recurses through all targets that depend on |target|, adding all targets that need to be built (and are in |roots|) to |result|. roots: set of root targets. add_if_no_ancestor: If true and there are no ancestors of |target| then add |target| to |result|. |target| must still be in |roots|. result: targets that...
[ "Recurses", "through", "all", "targets", "that", "depend", "on", "|target|", "adding", "all", "targets", "that", "need", "to", "be", "built", "(", "and", "are", "in", "|roots|", ")", "to", "|result|", ".", "roots", ":", "set", "of", "root", "targets", "....
def _AddCompileTargets(target, roots, add_if_no_ancestor, result): """Recurses through all targets that depend on |target|, adding all targets that need to be built (and are in |roots|) to |result|. roots: set of root targets. add_if_no_ancestor: If true and there are no ancestors of |target| then add |targ...
[ "def", "_AddCompileTargets", "(", "target", ",", "roots", ",", "add_if_no_ancestor", ",", "result", ")", ":", "if", "target", ".", "visited", ":", "return", "target", ".", "visited", "=", "True", "target", ".", "in_roots", "=", "target", "in", "roots", "fo...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py#L480-L534
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/abseil/absl/abseil.podspec.gen.py
python
collect_rules
(root_path)
return rules
Collects and returns all rules from root path recursively.
Collects and returns all rules from root path recursively.
[ "Collects", "and", "returns", "all", "rules", "from", "root", "path", "recursively", "." ]
def collect_rules(root_path): """Collects and returns all rules from root path recursively.""" rules = [] for cur, _, _ in os.walk(root_path): build_path = os.path.join(cur, "BUILD.bazel") if os.path.exists(build_path): rules.extend(read_build("//" + cur)) return rules
[ "def", "collect_rules", "(", "root_path", ")", ":", "rules", "=", "[", "]", "for", "cur", ",", "_", ",", "_", "in", "os", ".", "walk", "(", "root_path", ")", ":", "build_path", "=", "os", ".", "path", ".", "join", "(", "cur", ",", "\"BUILD.bazel\""...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/abseil/absl/abseil.podspec.gen.py#L101-L108
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
libcxx/utils/libcxx/sym_check/extract.py
python
NMExtractor.find_tool
()
return distutils.spawn.find_executable('nm')
Search for the nm executable and return the path.
Search for the nm executable and return the path.
[ "Search", "for", "the", "nm", "executable", "and", "return", "the", "path", "." ]
def find_tool(): """ Search for the nm executable and return the path. """ return distutils.spawn.find_executable('nm')
[ "def", "find_tool", "(", ")", ":", "return", "distutils", ".", "spawn", ".", "find_executable", "(", "'nm'", ")" ]
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/libcxx/utils/libcxx/sym_check/extract.py#L28-L32
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/idlelib/SearchEngine.py
python
get
(root)
return root._searchengine
Return the singleton SearchEngine instance for the process. The single SearchEngine saves settings between dialog instances. If there is not a SearchEngine already, make one.
Return the singleton SearchEngine instance for the process.
[ "Return", "the", "singleton", "SearchEngine", "instance", "for", "the", "process", "." ]
def get(root): '''Return the singleton SearchEngine instance for the process. The single SearchEngine saves settings between dialog instances. If there is not a SearchEngine already, make one. ''' if not hasattr(root, "_searchengine"): root._searchengine = SearchEngine(root) # This ...
[ "def", "get", "(", "root", ")", ":", "if", "not", "hasattr", "(", "root", ",", "\"_searchengine\"", ")", ":", "root", ".", "_searchengine", "=", "SearchEngine", "(", "root", ")", "# This creates a cycle that persists until root is deleted.", "return", "root", ".",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/SearchEngine.py#L6-L15
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py
python
set_log_device_placement
(enabled)
Set if device placements should be logged. Args: enabled: Whether to enabled device placement logging.
Set if device placements should be logged.
[ "Set", "if", "device", "placements", "should", "be", "logged", "." ]
def set_log_device_placement(enabled): """Set if device placements should be logged. Args: enabled: Whether to enabled device placement logging. """ context().log_device_placement = enabled
[ "def", "set_log_device_placement", "(", "enabled", ")", ":", "context", "(", ")", ".", "log_device_placement", "=", "enabled" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/eager/context.py#L1705-L1711
bilibili/biliobs
573613dc3b2b63fe7c1506cc94717609a2c52c0c
base/android/jni_generator/jni_generator.py
python
InlHeaderFileGenerator.GetMethodIDImpl
(self, called_by_native)
return template.substitute(values)
Returns the implementation of GetMethodID.
Returns the implementation of GetMethodID.
[ "Returns", "the", "implementation", "of", "GetMethodID", "." ]
def GetMethodIDImpl(self, called_by_native): """Returns the implementation of GetMethodID.""" if self.options.eager_called_by_natives: template = Template("""\ env->Get${STATIC_METHOD_PART}MethodID( ${JAVA_CLASS}_clazz(env), "${JNI_NAME}", ${JNI_SIGNATURE});""") else: template = Temp...
[ "def", "GetMethodIDImpl", "(", "self", ",", "called_by_native", ")", ":", "if", "self", ".", "options", ".", "eager_called_by_natives", ":", "template", "=", "Template", "(", "\"\"\"\\\nenv->Get${STATIC_METHOD_PART}MethodID(\n ${JAVA_CLASS}_clazz(env),\n \"${JNI_NAME}...
https://github.com/bilibili/biliobs/blob/573613dc3b2b63fe7c1506cc94717609a2c52c0c/base/android/jni_generator/jni_generator.py#L1362-L1397
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
src/visualizer/visualizer/ipython_view.py
python
IPythonView.onKeyPressExtend
(self, event)
! Key press callback with plenty of shell goodness, like history, autocompletions, etc. @param event: Event object. @return True if event should not trickle.
! Key press callback with plenty of shell goodness, like history, autocompletions, etc.
[ "!", "Key", "press", "callback", "with", "plenty", "of", "shell", "goodness", "like", "history", "autocompletions", "etc", "." ]
def onKeyPressExtend(self, event): """! Key press callback with plenty of shell goodness, like history, autocompletions, etc. @param event: Event object. @return True if event should not trickle. """ if event.get_state() & Gdk.ModifierType.CONTROL_MASK and event.keyval == 99: se...
[ "def", "onKeyPressExtend", "(", "self", ",", "event", ")", ":", "if", "event", ".", "get_state", "(", ")", "&", "Gdk", ".", "ModifierType", ".", "CONTROL_MASK", "and", "event", ".", "keyval", "==", "99", ":", "self", ".", "interrupt", "=", "True", "sel...
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/ipython_view.py#L611-L644
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/tkFont.py
python
families
(root=None)
return root.tk.splitlist(root.tk.call("font", "families"))
Get font families (as a tuple)
Get font families (as a tuple)
[ "Get", "font", "families", "(", "as", "a", "tuple", ")" ]
def families(root=None): "Get font families (as a tuple)" if not root: root = Tkinter._default_root return root.tk.splitlist(root.tk.call("font", "families"))
[ "def", "families", "(", "root", "=", "None", ")", ":", "if", "not", "root", ":", "root", "=", "Tkinter", ".", "_default_root", "return", "root", ".", "tk", ".", "splitlist", "(", "root", ".", "tk", ".", "call", "(", "\"font\"", ",", "\"families\"", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/tkFont.py#L166-L170
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/imports.py
python
get_web_links_offsets_from_plain_text
(plain_text)
return web_links
Parse plain text for possible web links
Parse plain text for possible web links
[ "Parse", "plain", "text", "for", "possible", "web", "links" ]
def get_web_links_offsets_from_plain_text(plain_text): """Parse plain text for possible web links""" web_links = [] max_end_offset = len(plain_text) max_start_offset = max_end_offset - 7 start_offset = 0 while start_offset < max_start_offset: if support.get_first_chars_of_string_at_offse...
[ "def", "get_web_links_offsets_from_plain_text", "(", "plain_text", ")", ":", "web_links", "=", "[", "]", "max_end_offset", "=", "len", "(", "plain_text", ")", "max_start_offset", "=", "max_end_offset", "-", "7", "start_offset", "=", "0", "while", "start_offset", "...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/imports.py#L47-L62
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
xmlTextReader.Read
(self)
return ret
Moves the position of the current instance to the next node in the stream, exposing its properties.
Moves the position of the current instance to the next node in the stream, exposing its properties.
[ "Moves", "the", "position", "of", "the", "current", "instance", "to", "the", "next", "node", "in", "the", "stream", "exposing", "its", "properties", "." ]
def Read(self): """Moves the position of the current instance to the next node in the stream, exposing its properties. """ ret = libxml2mod.xmlTextReaderRead(self._o) return ret
[ "def", "Read", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlTextReaderRead", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6036-L6040
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/imputil.py
python
_compile
(pathname, timestamp)
return code
Compile (and cache) a Python source file. The file specified by <pathname> is compiled to a code object and returned. Presuming the appropriate privileges exist, the bytecodes will be saved back to the filesystem for future imports. The source file's modification timestamp must be provided as a Lo...
Compile (and cache) a Python source file.
[ "Compile", "(", "and", "cache", ")", "a", "Python", "source", "file", "." ]
def _compile(pathname, timestamp): """Compile (and cache) a Python source file. The file specified by <pathname> is compiled to a code object and returned. Presuming the appropriate privileges exist, the bytecodes will be saved back to the filesystem for future imports. The source file's modif...
[ "def", "_compile", "(", "pathname", ",", "timestamp", ")", ":", "codestring", "=", "open", "(", "pathname", ",", "'rU'", ")", ".", "read", "(", ")", "if", "codestring", "and", "codestring", "[", "-", "1", "]", "!=", "'\\n'", ":", "codestring", "=", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/imputil.py#L415-L444
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/layers/base.py
python
Network.updates
(self)
return updates
Retrieve the network's updates. Will only include updates that are either unconditional, or conditional on inputs to this model (e.g. will not include updates that depend on tensors that aren't inputs to this model). Returns: A list of update ops.
Retrieve the network's updates.
[ "Retrieve", "the", "network", "s", "updates", "." ]
def updates(self): """Retrieve the network's updates. Will only include updates that are either unconditional, or conditional on inputs to this model (e.g. will not include updates that depend on tensors that aren't inputs to this model). Returns: A list of update ops. """ upda...
[ "def", "updates", "(", "self", ")", ":", "updates", "=", "[", "]", "for", "layer", "in", "self", ".", "layers", ":", "if", "hasattr", "(", "layer", ",", "'updates'", ")", ":", "# Collect updates that are dependent on inputs", "# that are part of the model.", "fo...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/layers/base.py#L1853-L1877
zlgopen/awtk
2c49e854a78749d9092907c027a7fba9062be549
3rd/mbedtls/scripts/assemble_changelog.py
python
finish_output
(changelog, output_file, input_file, merged_files)
Write the changelog to the output file. The input file and the list of merged files are used only for sanity checks on the output.
Write the changelog to the output file.
[ "Write", "the", "changelog", "to", "the", "output", "file", "." ]
def finish_output(changelog, output_file, input_file, merged_files): """Write the changelog to the output file. The input file and the list of merged files are used only for sanity checks on the output. """ if os.path.exists(output_file) and not os.path.isfile(output_file): # The output is ...
[ "def", "finish_output", "(", "changelog", ",", "output_file", ",", "input_file", ",", "merged_files", ")", ":", "if", "os", ".", "path", ".", "exists", "(", "output_file", ")", "and", "not", "os", ".", "path", ".", "isfile", "(", "output_file", ")", ":",...
https://github.com/zlgopen/awtk/blob/2c49e854a78749d9092907c027a7fba9062be549/3rd/mbedtls/scripts/assemble_changelog.py#L399-L415
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py
python
ResourceManager._warn_unsafe_extraction_path
(path)
If the default extraction path is overridden and set to an insecure location, such as /tmp, it opens up an opportunity for an attacker to replace an extracted file with an unauthorized payload. Warn the user if a known insecure location is used. See Distribute #375 for more details.
If the default extraction path is overridden and set to an insecure location, such as /tmp, it opens up an opportunity for an attacker to replace an extracted file with an unauthorized payload. Warn the user if a known insecure location is used.
[ "If", "the", "default", "extraction", "path", "is", "overridden", "and", "set", "to", "an", "insecure", "location", "such", "as", "/", "tmp", "it", "opens", "up", "an", "opportunity", "for", "an", "attacker", "to", "replace", "an", "extracted", "file", "wi...
def _warn_unsafe_extraction_path(path): """ If the default extraction path is overridden and set to an insecure location, such as /tmp, it opens up an opportunity for an attacker to replace an extracted file with an unauthorized payload. Warn the user if a known insecure location...
[ "def", "_warn_unsafe_extraction_path", "(", "path", ")", ":", "if", "os", ".", "name", "==", "'nt'", "and", "not", "path", ".", "startswith", "(", "os", ".", "environ", "[", "'windir'", "]", ")", ":", "# On Windows, permissions are generally restrictive by default...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L1218-L1241
apache/qpid-proton
6bcdfebb55ea3554bc29b1901422532db331a591
python/proton/_endpoints.py
python
Receiver.drain
(self, n: int)
Grant credit for incoming deliveries on this receiver, and set drain mode to true. Use :attr:`drain_mode` to set the drain mode explicitly. :param n: The amount by which to increment the link credit
Grant credit for incoming deliveries on this receiver, and set drain mode to true.
[ "Grant", "credit", "for", "incoming", "deliveries", "on", "this", "receiver", "and", "set", "drain", "mode", "to", "true", "." ]
def drain(self, n: int) -> None: """ Grant credit for incoming deliveries on this receiver, and set drain mode to true. Use :attr:`drain_mode` to set the drain mode explicitly. :param n: The amount by which to increment the link credit """ pn_link_drain(self._im...
[ "def", "drain", "(", "self", ",", "n", ":", "int", ")", "->", "None", ":", "pn_link_drain", "(", "self", ".", "_impl", ",", "n", ")" ]
https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_endpoints.py#L1254-L1263
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/parallel/algo_parameter_config.py
python
_AlgoParameterConfig.set_dp_algo_approxi_epsilon
(self, epsilon)
Set the epsilon value used in the approximation DP algorithm. Default: 0.1. Args: epsilon (float): The epsilon value, should in the range dp_(0, 1].
Set the epsilon value used in the approximation DP algorithm. Default: 0.1.
[ "Set", "the", "epsilon", "value", "used", "in", "the", "approximation", "DP", "algorithm", ".", "Default", ":", "0", ".", "1", "." ]
def set_dp_algo_approxi_epsilon(self, epsilon): """ Set the epsilon value used in the approximation DP algorithm. Default: 0.1. Args: epsilon (float): The epsilon value, should in the range dp_(0, 1]. """ self.check_config_handle() self._config_handle...
[ "def", "set_dp_algo_approxi_epsilon", "(", "self", ",", "epsilon", ")", ":", "self", ".", "check_config_handle", "(", ")", "self", ".", "_config_handle", ".", "set_dp_algo_approxi_epsilon", "(", "epsilon", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/parallel/algo_parameter_config.py#L157-L166
lawy623/SVS
b7c7ae367c82a4797ff4a896a2ff304f02e7f724
caffe/scripts/cpp_lint.py
python
FindNextMultiLineCommentEnd
(lines, lineix)
return len(lines)
We are inside a comment, find the end marker.
We are inside a comment, find the end marker.
[ "We", "are", "inside", "a", "comment", "find", "the", "end", "marker", "." ]
def FindNextMultiLineCommentEnd(lines, lineix): """We are inside a comment, find the end marker.""" while lineix < len(lines): if lines[lineix].strip().endswith('*/'): return lineix lineix += 1 return len(lines)
[ "def", "FindNextMultiLineCommentEnd", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "endswith", "(", "'*/'", ")", ":", "return", "lineix", ...
https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/scripts/cpp_lint.py#L1134-L1140
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py
python
MaskedArray.__rtruediv__
(self, other)
return true_divide(other, self)
Return divide(other, self)
Return divide(other, self)
[ "Return", "divide", "(", "other", "self", ")" ]
def __rtruediv__(self, other): "Return divide(other, self)" return true_divide(other, self)
[ "def", "__rtruediv__", "(", "self", ",", "other", ")", ":", "return", "true_divide", "(", "other", ",", "self", ")" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/oldnumeric/ma.py#L969-L971
lzhang10/maxent
3560c94b737d4272ed86de529e50d823200e6d8e
example/postagger/context.py
python
get_context17
(words, pos, i, rare_word)
return context
get tag context for words[i]
get tag context for words[i]
[ "get", "tag", "context", "for", "words", "[", "i", "]" ]
def get_context17(words, pos, i, rare_word): 'get tag context for words[i]' context = [] w = words[i] n = len(words) if rare_word: pass else: context.append('curword=' + w) if i > 0: context.append('tag-1=' + pos[i - 1]) if i > 1: context.append('...
[ "def", "get_context17", "(", "words", ",", "pos", ",", "i", ",", "rare_word", ")", ":", "context", "=", "[", "]", "w", "=", "words", "[", "i", "]", "n", "=", "len", "(", "words", ")", "if", "rare_word", ":", "pass", "else", ":", "context", ".", ...
https://github.com/lzhang10/maxent/blob/3560c94b737d4272ed86de529e50d823200e6d8e/example/postagger/context.py#L399-L421
oneapi-src/oneTBB
c9e43df34675ae5d9481c7ceab048085e3d5dae1
python/tbb/pool.py
python
Pool.apply_async
(self, func, args=(), kwds=dict(), callback=None)
return apply_result
A variant of the apply() method which returns an ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready, callback is applied to it (unless the call failed). callback should complete immediately sin...
A variant of the apply() method which returns an ApplyResult object.
[ "A", "variant", "of", "the", "apply", "()", "method", "which", "returns", "an", "ApplyResult", "object", "." ]
def apply_async(self, func, args=(), kwds=dict(), callback=None): """A variant of the apply() method which returns an ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready, callback is applied to ...
[ "def", "apply_async", "(", "self", ",", "func", ",", "args", "=", "(", ")", ",", "kwds", "=", "dict", "(", ")", ",", "callback", "=", "None", ")", ":", "assert", "not", "self", ".", "_closed", "# No lock here. We assume it's atomic...", "apply_result", "="...
https://github.com/oneapi-src/oneTBB/blob/c9e43df34675ae5d9481c7ceab048085e3d5dae1/python/tbb/pool.py#L143-L156
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/common/htmlutil.py
python
ScriptExtractor.__init__
(self)
Initialize a ScriptExtractor.
Initialize a ScriptExtractor.
[ "Initialize", "a", "ScriptExtractor", "." ]
def __init__(self): """Initialize a ScriptExtractor.""" htmllib.HTMLParser.__init__(self, formatter.NullFormatter()) self._in_script = False self._text = ''
[ "def", "__init__", "(", "self", ")", ":", "htmllib", ".", "HTMLParser", ".", "__init__", "(", "self", ",", "formatter", ".", "NullFormatter", "(", ")", ")", "self", ".", "_in_script", "=", "False", "self", ".", "_text", "=", "''" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/common/htmlutil.py#L35-L39
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/segmentbk.py
python
SegmentBook.SetPageImage
(self, index, img_id)
Set the image to use on the given page @param index: page index @param img_id: image list index
Set the image to use on the given page @param index: page index @param img_id: image list index
[ "Set", "the", "image", "to", "use", "on", "the", "given", "page", "@param", "index", ":", "page", "index", "@param", "img_id", ":", "image", "list", "index" ]
def SetPageImage(self, index, img_id): """Set the image to use on the given page @param index: page index @param img_id: image list index """ page = self._pages[index] page['img'] = img_id self._segbar.SetSegmentImage(self._imglst.GetBitmap(img_id)) self....
[ "def", "SetPageImage", "(", "self", ",", "index", ",", "img_id", ")", ":", "page", "=", "self", ".", "_pages", "[", "index", "]", "page", "[", "'img'", "]", "=", "img_id", "self", ".", "_segbar", ".", "SetSegmentImage", "(", "self", ".", "_imglst", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/segmentbk.py#L403-L412
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Fem/femsolver/settings.py
python
get_write_comments
(name)
Check whether "write_comments" is set for solver. Returns ``True`` if the "write_comments" setting/parameter is set for the solver with the id *name*. Returns ``False`` otherwise. If the solver is not supported ``None`` is returned. :param name: solver id as a ``str`` (see :mod:`femsolver.settings`)
Check whether "write_comments" is set for solver.
[ "Check", "whether", "write_comments", "is", "set", "for", "solver", "." ]
def get_write_comments(name): """ Check whether "write_comments" is set for solver. Returns ``True`` if the "write_comments" setting/parameter is set for the solver with the id *name*. Returns ``False`` otherwise. If the solver is not supported ``None`` is returned. :param name: solver id as a ``s...
[ "def", "get_write_comments", "(", "name", ")", ":", "if", "name", "in", "_SOLVER_PARAM", ":", "return", "_SOLVER_PARAM", "[", "name", "]", ".", "get_write_comments", "(", ")", "else", ":", "FreeCAD", ".", "Console", ".", "PrintError", "(", "\"Settings solver n...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/femsolver/settings.py#L111-L128
wyrover/book-code
7f4883d9030d553bc6bcfa3da685e34789839900
3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py
python
Any.Pack
(self, msg, type_url_prefix='type.googleapis.com/')
Packs the specified message into current Any message.
Packs the specified message into current Any message.
[ "Packs", "the", "specified", "message", "into", "current", "Any", "message", "." ]
def Pack(self, msg, type_url_prefix='type.googleapis.com/'): """Packs the specified message into current Any message.""" if len(type_url_prefix) < 1 or type_url_prefix[-1] != '/': self.type_url = '%s/%s' % (type_url_prefix, msg.DESCRIPTOR.full_name) else: self.type_url = '%s%s' % (type_url_prefi...
[ "def", "Pack", "(", "self", ",", "msg", ",", "type_url_prefix", "=", "'type.googleapis.com/'", ")", ":", "if", "len", "(", "type_url_prefix", ")", "<", "1", "or", "type_url_prefix", "[", "-", "1", "]", "!=", "'/'", ":", "self", ".", "type_url", "=", "'...
https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py#L69-L75
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
protobuf/python/google/protobuf/text_format.py
python
PrintFieldValue
(field, value, out, indent=0, as_utf8=False, as_one_line=False, pointy_brackets=False, use_index_order=False, float_format=None)
Print a single field value (not including name). For repeated fields, the value should be a single element.
Print a single field value (not including name). For repeated fields, the value should be a single element.
[ "Print", "a", "single", "field", "value", "(", "not", "including", "name", ")", ".", "For", "repeated", "fields", "the", "value", "should", "be", "a", "single", "element", "." ]
def PrintFieldValue(field, value, out, indent=0, as_utf8=False, as_one_line=False, pointy_brackets=False, use_index_order=False, float_format=None): """Print a single field value (not including name). For repeated fields, the value should be a single elem...
[ "def", "PrintFieldValue", "(", "field", ",", "value", ",", "out", ",", "indent", "=", "0", ",", "as_utf8", "=", "False", ",", "as_one_line", "=", "False", ",", "pointy_brackets", "=", "False", ",", "use_index_order", "=", "False", ",", "float_format", "=",...
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/text_format.py#L177-L233
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/closure_linter/closure_linter/indentation.py
python
TokenInfo.__init__
(self, token, is_block=False)
Initializes a TokenInfo object. Args: token: The token is_block: Whether the token represents a block indentation.
Initializes a TokenInfo object.
[ "Initializes", "a", "TokenInfo", "object", "." ]
def __init__(self, token, is_block=False): """Initializes a TokenInfo object. Args: token: The token is_block: Whether the token represents a block indentation. """ self.token = token self.overridden_by = None self.is_permanent_override = False self.is_block = is_block self....
[ "def", "__init__", "(", "self", ",", "token", ",", "is_block", "=", "False", ")", ":", "self", ".", "token", "=", "token", "self", ".", "overridden_by", "=", "None", "self", ".", "is_permanent_override", "=", "False", "self", ".", "is_block", "=", "is_bl...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/indentation.py#L81-L94
inviwo/inviwo
a744539ecddca3542a1bd50a86c8db8f985a0757
tools/bm-plot.py
python
read_data
(args)
return data
Read and process dataframe using commandline args
Read and process dataframe using commandline args
[ "Read", "and", "process", "dataframe", "using", "commandline", "args" ]
def read_data(args): """Read and process dataframe using commandline args""" try: data = pd.read_csv(args.file, usecols=['name', args.metric], skiprows=8) except ValueError: msg = 'Could not parse the benchmark data. Did you forget "--benchmark_format=csv"?' logging.error(msg) ...
[ "def", "read_data", "(", "args", ")", ":", "try", ":", "data", "=", "pd", ".", "read_csv", "(", "args", ".", "file", ",", "usecols", "=", "[", "'name'", ",", "args", ".", "metric", "]", ",", "skiprows", "=", "8", ")", "except", "ValueError", ":", ...
https://github.com/inviwo/inviwo/blob/a744539ecddca3542a1bd50a86c8db8f985a0757/tools/bm-plot.py#L69-L91
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py
python
ParserElement.split
(self, instring, maxsplit=_MAX_INT, includeSeparators=False)
Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (default=C{False}), if the separating matching text should be included in the split result...
Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (default=C{False}), if the separating matching text should be included in the split result...
[ "Generator", "method", "to", "split", "a", "string", "using", "the", "given", "expression", "as", "a", "separator", ".", "May", "be", "called", "with", "optional", "C", "{", "maxsplit", "}", "argument", "to", "limit", "the", "number", "of", "splits", ";", ...
def split(self, instring, maxsplit=_MAX_INT, includeSeparators=False): """ Generator method to split a string using the given expression as a separator. May be called with optional C{maxsplit} argument, to limit the number of splits; and the optional C{includeSeparators} argument (defaul...
[ "def", "split", "(", "self", ",", "instring", ",", "maxsplit", "=", "_MAX_INT", ",", "includeSeparators", "=", "False", ")", ":", "splits", "=", "0", "last", "=", "0", "for", "t", ",", "s", ",", "e", "in", "self", ".", "scanString", "(", "instring", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py#L1800-L1820
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/uuid.py
python
_netbios_getnode
()
Get the hardware address on Windows using NetBIOS calls. See http://support.microsoft.com/kb/118623 for details.
Get the hardware address on Windows using NetBIOS calls. See http://support.microsoft.com/kb/118623 for details.
[ "Get", "the", "hardware", "address", "on", "Windows", "using", "NetBIOS", "calls", ".", "See", "http", ":", "//", "support", ".", "microsoft", ".", "com", "/", "kb", "/", "118623", "for", "details", "." ]
def _netbios_getnode(): """Get the hardware address on Windows using NetBIOS calls. See http://support.microsoft.com/kb/118623 for details.""" import win32wnet, netbios ncb = netbios.NCB() ncb.Command = netbios.NCBENUM ncb.Buffer = adapters = netbios.LANA_ENUM() adapters._pack() if win32...
[ "def", "_netbios_getnode", "(", ")", ":", "import", "win32wnet", ",", "netbios", "ncb", "=", "netbios", ".", "NCB", "(", ")", "ncb", ".", "Command", "=", "netbios", ".", "NCBENUM", "ncb", ".", "Buffer", "=", "adapters", "=", "netbios", ".", "LANA_ENUM", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/uuid.py#L425-L452
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-utils/modtool/cli/add.py
python
get_blockname
(self)
Get the blockname
Get the blockname
[ "Get", "the", "blockname" ]
def get_blockname(self): """ Get the blockname""" if not self.info['blockname'] or self.info['blockname'].isspace(): while not self.info['blockname'] or self.info['blockname'].isspace(): self.info['blockname'] = cli_input( "Enter name of block/code (without module name prefix...
[ "def", "get_blockname", "(", "self", ")", ":", "if", "not", "self", ".", "info", "[", "'blockname'", "]", "or", "self", ".", "info", "[", "'blockname'", "]", ".", "isspace", "(", ")", ":", "while", "not", "self", ".", "info", "[", "'blockname'", "]",...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/modtool/cli/add.py#L93-L107
apache/incubator-mxnet
f03fb23f1d103fec9541b5ae59ee06b1734a51d9
python/mxnet/symbol/symbol.py
python
Symbol.ceil
(self, *args, **kwargs)
return op.ceil(self, *args, **kwargs)
Convenience fluent method for :py:func:`ceil`. The arguments are the same as for :py:func:`ceil`, with this array as data.
Convenience fluent method for :py:func:`ceil`.
[ "Convenience", "fluent", "method", "for", ":", "py", ":", "func", ":", "ceil", "." ]
def ceil(self, *args, **kwargs): """Convenience fluent method for :py:func:`ceil`. The arguments are the same as for :py:func:`ceil`, with this array as data. """ return op.ceil(self, *args, **kwargs)
[ "def", "ceil", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "op", ".", "ceil", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/symbol.py#L2349-L2355
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/compression/quant/qat.py
python
QuantizationAwareTraining._convert_activation
(self, activation)
convert activation cell to quant cell
convert activation cell to quant cell
[ "convert", "activation", "cell", "to", "quant", "cell" ]
def _convert_activation(self, activation): """ convert activation cell to quant cell """ act_class = activation.__class__ act_list = [nn.ReLU, nn.ReLU6, nn.Sigmoid] act_list_with_fake_before = [nn.LeakyReLU, nn.HSigmoid, nn.HSwish] if act_class in act_list: ...
[ "def", "_convert_activation", "(", "self", ",", "activation", ")", ":", "act_class", "=", "activation", ".", "__class__", "act_list", "=", "[", "nn", ".", "ReLU", ",", "nn", ".", "ReLU6", ",", "nn", ".", "Sigmoid", "]", "act_list_with_fake_before", "=", "[...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/compression/quant/qat.py#L517-L535
infinit/elle
a8154593c42743f45b9df09daf62b44630c24a02
drake/src/drake/__init__.py
python
Expander.__init__
(self, dicts, target, sources=[], matcher='@([a-zA-Z0-9_-]+)@', missing_fatal=True)
Create and expander that expands the given dictionaries. dicts -- The dictionaries from which to expand keys. sources -- List of additional source nodes, or additional source node if there's only one. target -- The target Node where to store the result. ...
Create and expander that expands the given dictionaries.
[ "Create", "and", "expander", "that", "expands", "the", "given", "dictionaries", "." ]
def __init__(self, dicts, target, sources=[], matcher='@([a-zA-Z0-9_-]+)@', missing_fatal=True): """Create and expander that expands the given dictionaries. dicts -- The dictionaries from which to expand keys. sources -- List of additional source nodes, ...
[ "def", "__init__", "(", "self", ",", "dicts", ",", "target", ",", "sources", "=", "[", "]", ",", "matcher", "=", "'@([a-zA-Z0-9_-]+)@'", ",", "missing_fatal", "=", "True", ")", ":", "if", "not", "isinstance", "(", "dicts", ",", "list", ")", ":", "dicts...
https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L2735-L2754
aimerykong/Low-Rank-Bilinear-Pooling
487eb2c857fd9c95357a5166b0c15ad0fe135b28
caffe-20160312/scripts/cpp_lint.py
python
_CppLintState.SetCountingStyle
(self, counting_style)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style
[ "def", "SetCountingStyle", "(", "self", ",", "counting_style", ")", ":", "self", ".", "counting", "=", "counting_style" ]
https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/caffe-20160312/scripts/cpp_lint.py#L713-L715
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozbuild/preprocessor.py
python
Preprocessor.computeDependencies
(self, input)
Reads the ``input`` stream, and computes the dependencies for that input.
Reads the ``input`` stream, and computes the dependencies for that input.
[ "Reads", "the", "input", "stream", "and", "computes", "the", "dependencies", "for", "that", "input", "." ]
def computeDependencies(self, input): """ Reads the ``input`` stream, and computes the dependencies for that input. """ try: old_out = self.out self.out = None self.do_include(input, False) return self.includes finally: ...
[ "def", "computeDependencies", "(", "self", ",", "input", ")", ":", "try", ":", "old_out", "=", "self", ".", "out", "self", ".", "out", "=", "None", "self", ".", "do_include", "(", "input", ",", "False", ")", "return", "self", ".", "includes", "finally"...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/preprocessor.py#L388-L399
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
_SetFilters
(filters)
Sets the module's error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die.
Sets the module's error-message filters.
[ "Sets", "the", "module", "s", "error", "-", "message", "filters", "." ]
def _SetFilters(filters): """Sets the module's error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "whitespace/indent"). Each filter should start with + or -; else we die. """ _cpplint...
[ "def", "_SetFilters", "(", "filters", ")", ":", "_cpplint_state", ".", "SetFilters", "(", "filters", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L661-L671
facebook/hermes
b1b1a00ab468ec1b397b31b71587110044830970
external/llvh/utils/lit/lit/worker.py
python
run_one_test
(test_index, test)
Run one test in a multiprocessing.Pool Side effects in this function and functions it calls are not visible in the main lit process. Arguments and results of this function are pickled, so they should be cheap to copy. For efficiency, we copy all data needed to execute all tests into each worker an...
Run one test in a multiprocessing.Pool
[ "Run", "one", "test", "in", "a", "multiprocessing", ".", "Pool" ]
def run_one_test(test_index, test): """Run one test in a multiprocessing.Pool Side effects in this function and functions it calls are not visible in the main lit process. Arguments and results of this function are pickled, so they should be cheap to copy. For efficiency, we copy all data needed t...
[ "def", "run_one_test", "(", "test_index", ",", "test", ")", ":", "try", ":", "_execute_test_in_parallelism_group", "(", "test", ",", "_lit_config", ",", "_parallelism_semaphores", ")", "return", "(", "test_index", ",", "test", ")", "except", "KeyboardInterrupt", "...
https://github.com/facebook/hermes/blob/b1b1a00ab468ec1b397b31b71587110044830970/external/llvh/utils/lit/lit/worker.py#L19-L41
bryanyzhu/Hidden-Two-Stream
f7f684adbdacb6df6b1cf196c3a476cd23484a0f
scripts/cpp_lint.py
python
CheckForBadCharacters
(filename, lines, error)
Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that it's possible for this to throw off line numbering if...
Logs an error for each line containing bad characters.
[ "Logs", "an", "error", "for", "each", "line", "containing", "bad", "characters", "." ]
def CheckForBadCharacters(filename, lines, error): """Logs an error for each line containing bad characters. Two kinds of bad characters: 1. Unicode replacement characters: These indicate that either the file contained invalid UTF-8 (likely) or Unicode replacement characters (which it shouldn't). Note that...
[ "def", "CheckForBadCharacters", "(", "filename", ",", "lines", ",", "error", ")", ":", "for", "linenum", ",", "line", "in", "enumerate", "(", "lines", ")", ":", "if", "u'\\ufffd'", "in", "line", ":", "error", "(", "filename", ",", "linenum", ",", "'reada...
https://github.com/bryanyzhu/Hidden-Two-Stream/blob/f7f684adbdacb6df6b1cf196c3a476cd23484a0f/scripts/cpp_lint.py#L1483-L1505
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/tlslite/tlslite/Session.py
python
Session.getCipherName
(self)
Get the name of the cipher used with this connection. @rtype: str @return: The name of the cipher used with this connection. Either 'aes128', 'aes256', 'rc4', or '3des'.
Get the name of the cipher used with this connection.
[ "Get", "the", "name", "of", "the", "cipher", "used", "with", "this", "connection", "." ]
def getCipherName(self): """Get the name of the cipher used with this connection. @rtype: str @return: The name of the cipher used with this connection. Either 'aes128', 'aes256', 'rc4', or '3des'. """ if self.cipherSuite in CipherSuite.aes128Suites: return "...
[ "def", "getCipherName", "(", "self", ")", ":", "if", "self", ".", "cipherSuite", "in", "CipherSuite", ".", "aes128Suites", ":", "return", "\"aes128\"", "elif", "self", ".", "cipherSuite", "in", "CipherSuite", ".", "aes256Suites", ":", "return", "\"aes256\"", "...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/tlslite/tlslite/Session.py#L91-L107
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
Printer.Setup
(*args, **kwargs)
return _windows_.Printer_Setup(*args, **kwargs)
Setup(self, Window parent) -> bool
Setup(self, Window parent) -> bool
[ "Setup", "(", "self", "Window", "parent", ")", "-", ">", "bool" ]
def Setup(*args, **kwargs): """Setup(self, Window parent) -> bool""" return _windows_.Printer_Setup(*args, **kwargs)
[ "def", "Setup", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Printer_Setup", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5223-L5225
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/json_schema_compiler/preview.py
python
CompilerHandler._GetHighlighterParams
(self, parsed_url)
return (query_dict.get('highlighter', ['pygments'])[0], query_dict.get('style', ['colorful'])[0])
Get the highlighting parameters from a parsed url.
Get the highlighting parameters from a parsed url.
[ "Get", "the", "highlighting", "parameters", "from", "a", "parsed", "url", "." ]
def _GetHighlighterParams(self, parsed_url): """Get the highlighting parameters from a parsed url. """ query_dict = urlparse.parse_qs(parsed_url.query) return (query_dict.get('highlighter', ['pygments'])[0], query_dict.get('style', ['colorful'])[0])
[ "def", "_GetHighlighterParams", "(", "self", ",", "parsed_url", ")", ":", "query_dict", "=", "urlparse", ".", "parse_qs", "(", "parsed_url", ".", "query", ")", "return", "(", "query_dict", ".", "get", "(", "'highlighter'", ",", "[", "'pygments'", "]", ")", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/json_schema_compiler/preview.py#L232-L237
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/apply_adadelta.py
python
_apply_adadelta_tbe
()
return
ApplyAdadeltaD TBE register
ApplyAdadeltaD TBE register
[ "ApplyAdadeltaD", "TBE", "register" ]
def _apply_adadelta_tbe(): """ApplyAdadeltaD TBE register""" return
[ "def", "_apply_adadelta_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/apply_adadelta.py#L64-L66
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/lookup/lookup_ops.py
python
index_to_string
(tensor, mapping, default_value="UNK", name=None)
return table.lookup(tensor)
Maps `tensor` of indices into string values based on `mapping`. This operation converts `int64` indices into string values. The mapping is initialized from a string `mapping` tensor where each element is a value and the corresponding index within the tensor is the key. Any input which does not have a correspo...
Maps `tensor` of indices into string values based on `mapping`.
[ "Maps", "tensor", "of", "indices", "into", "string", "values", "based", "on", "mapping", "." ]
def index_to_string(tensor, mapping, default_value="UNK", name=None): """Maps `tensor` of indices into string values based on `mapping`. This operation converts `int64` indices into string values. The mapping is initialized from a string `mapping` tensor where each element is a value and the corresponding inde...
[ "def", "index_to_string", "(", "tensor", ",", "mapping", ",", "default_value", "=", "\"UNK\"", ",", "name", "=", "None", ")", ":", "table", "=", "index_to_string_table_from_tensor", "(", "mapping", "=", "mapping", ",", "default_value", "=", "default_value", ",",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/lookup/lookup_ops.py#L247-L286
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/learn/python/learn/learn_runner.py
python
_wrapped_experiment_fn_with_uid_check
(experiment_fn, require_hparams=False)
return wrapped_experiment_fn
Wraps the `RunConfig` uid check with `experiment_fn`. For `experiment_fn` which takes `run_config`, it is expected that the `run_config` is passed to the Estimator correctly. Toward that, the wrapped `experiment_fn` compares the `uid` of the `RunConfig` instance. Args: experiment_fn: The original `experim...
Wraps the `RunConfig` uid check with `experiment_fn`.
[ "Wraps", "the", "RunConfig", "uid", "check", "with", "experiment_fn", "." ]
def _wrapped_experiment_fn_with_uid_check(experiment_fn, require_hparams=False): """Wraps the `RunConfig` uid check with `experiment_fn`. For `experiment_fn` which takes `run_config`, it is expected that the `run_config` is passed to the Estimator correctly. Toward that, the wrapped `experiment_fn` compares th...
[ "def", "_wrapped_experiment_fn_with_uid_check", "(", "experiment_fn", ",", "require_hparams", "=", "False", ")", ":", "def", "wrapped_experiment_fn", "(", "run_config", ",", "hparams", ")", ":", "\"\"\"Calls experiment_fn and checks the uid of `RunConfig`.\"\"\"", "if", "not"...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/learn_runner.py#L49-L99
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/atoms/one_minus_pos.py
python
diff_pos
(x, y)
return multiply(x, one_minus_pos(y/x))
r"""The difference :math:`x - y` with domain `\{x, y : x > y > 0\}`. This atom is log-log concave. Parameters ---------- x : :class:`~cvxpy.expressions.expression.Expression` An Expression. y : :class:`~cvxpy.expressions.expression.Expression` An Expression.
r"""The difference :math:`x - y` with domain `\{x, y : x > y > 0\}`.
[ "r", "The", "difference", ":", "math", ":", "x", "-", "y", "with", "domain", "\\", "{", "x", "y", ":", "x", ">", "y", ">", "0", "\\", "}", "." ]
def diff_pos(x, y): r"""The difference :math:`x - y` with domain `\{x, y : x > y > 0\}`. This atom is log-log concave. Parameters ---------- x : :class:`~cvxpy.expressions.expression.Expression` An Expression. y : :class:`~cvxpy.expressions.expression.Expression` An Expression....
[ "def", "diff_pos", "(", "x", ",", "y", ")", ":", "return", "multiply", "(", "x", ",", "one_minus_pos", "(", "y", "/", "x", ")", ")" ]
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/one_minus_pos.py#L26-L38
microsoft/BlingFire
7634ad43b521ee6a596266d82c3f0c46cd43e222
ldbsrc/roberta/code.py
python
tokenize_with_bpe
(text)
return bpe_tokens
Tokenize a string.
Tokenize a string.
[ "Tokenize", "a", "string", "." ]
def tokenize_with_bpe(text): """ Tokenize a string. """ bpe_tokens = [] for token in re.findall(pat, text): token = "".join( byte_encoder[b] for b in token.encode("utf-8") ) # Maps all our bytes to unicode strings, avoiding controle tokens of the BPE (spaces in our case) ...
[ "def", "tokenize_with_bpe", "(", "text", ")", ":", "bpe_tokens", "=", "[", "]", "for", "token", "in", "re", ".", "findall", "(", "pat", ",", "text", ")", ":", "token", "=", "\"\"", ".", "join", "(", "byte_encoder", "[", "b", "]", "for", "b", "in", ...
https://github.com/microsoft/BlingFire/blob/7634ad43b521ee6a596266d82c3f0c46cd43e222/ldbsrc/roberta/code.py#L113-L121
opengauss-mirror/openGauss-server
e383f1b77720a00ddbe4c0655bc85914d9b02a2b
src/gausskernel/dbmind/tools/anomaly_detection/detector/service/storage/sqlite_storage.py
python
SQLiteStorage.get_timeseries
(self, table, field, period, timestamp=None)
return timeseries
Acquire timeseries from database by timestamp or number. :param table: string, table name from database. :param period: int or string, represent number or period like: 100, '100S'. :return: list, timeseries dataset.
Acquire timeseries from database by timestamp or number. :param table: string, table name from database. :param period: int or string, represent number or period like: 100, '100S'. :return: list, timeseries dataset.
[ "Acquire", "timeseries", "from", "database", "by", "timestamp", "or", "number", ".", ":", "param", "table", ":", "string", "table", "name", "from", "database", ".", ":", "param", "period", ":", "int", "or", "string", "represent", "number", "or", "period", ...
def get_timeseries(self, table, field, period, timestamp=None): """ Acquire timeseries from database by timestamp or number. :param table: string, table name from database. :param period: int or string, represent number or period like: 100, '100S'. :return: list, timeseries datas...
[ "def", "get_timeseries", "(", "self", ",", "table", ",", "field", ",", "period", ",", "timestamp", "=", "None", ")", ":", "if", "not", "self", ".", "check_table", "(", "table", ")", ":", "return", "[", "]", "if", "isinstance", "(", "period", ",", "in...
https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/anomaly_detection/detector/service/storage/sqlite_storage.py#L183-L198
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/basic_lstm_cell_weight_grad.py
python
_basic_lstm_cell_weight_grad_tbe
()
return
BasicLSTMCellWeightGrad TBE register
BasicLSTMCellWeightGrad TBE register
[ "BasicLSTMCellWeightGrad", "TBE", "register" ]
def _basic_lstm_cell_weight_grad_tbe(): """BasicLSTMCellWeightGrad TBE register""" return
[ "def", "_basic_lstm_cell_weight_grad_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/basic_lstm_cell_weight_grad.py#L39-L41
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
DQM/Integration/scripts/harvesting_tools/cmsHarvester.py
python
CMSHarvester.dbs_check_dataset_spread
(self, dataset_name)
return num_events_catalog
Figure out the number of events in each run of this dataset. This is a more efficient way of doing this than calling dbs_resolve_number_of_events for each run.
Figure out the number of events in each run of this dataset.
[ "Figure", "out", "the", "number", "of", "events", "in", "each", "run", "of", "this", "dataset", "." ]
def dbs_check_dataset_spread(self, dataset_name): """Figure out the number of events in each run of this dataset. This is a more efficient way of doing this than calling dbs_resolve_number_of_events for each run. """ self.logger.debug("Checking spread of dataset `%s'" % datase...
[ "def", "dbs_check_dataset_spread", "(", "self", ",", "dataset_name", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Checking spread of dataset `%s'\"", "%", "dataset_name", ")", "# DEBUG DEBUG DEBUG", "# If we get here DBS should have been set up already.", "assert", ...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DQM/Integration/scripts/harvesting_tools/cmsHarvester.py#L3076-L3298
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/modes/notemacs.py
python
NotEmacsMode.readline
(self, prompt='')
return self.l_buffer.get_line_text() + '\n'
Try to act like GNU readline.
Try to act like GNU readline.
[ "Try", "to", "act", "like", "GNU", "readline", "." ]
def readline(self, prompt=''): '''Try to act like GNU readline.''' # handle startup_hook if self.first_prompt: self.first_prompt = False if self.startup_hook: try: self.startup_hook() except: print 's...
[ "def", "readline", "(", "self", ",", "prompt", "=", "''", ")", ":", "# handle startup_hook", "if", "self", ".", "first_prompt", ":", "self", ".", "first_prompt", "=", "False", "if", "self", ".", "startup_hook", ":", "try", ":", "self", ".", "startup_hook",...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/notemacs.py#L51-L89
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/examples/image_retraining/retrain.py
python
add_input_distortions
(flip_left_right, random_crop, random_scale, random_brightness, input_width, input_height, input_depth, input_mean, input_std)
return jpeg_data, distort_result
Creates the operations to apply the specified distortions. During training it can help to improve the results if we run the images through simple distortions like crops, scales, and flips. These reflect the kind of variations we expect in the real world, and so can help train the model to cope with natural dat...
Creates the operations to apply the specified distortions.
[ "Creates", "the", "operations", "to", "apply", "the", "specified", "distortions", "." ]
def add_input_distortions(flip_left_right, random_crop, random_scale, random_brightness, input_width, input_height, input_depth, input_mean, input_std): """Creates the operations to apply the specified distortions. During training it can help to improve the resul...
[ "def", "add_input_distortions", "(", "flip_left_right", ",", "random_crop", ",", "random_scale", ",", "random_brightness", ",", "input_width", ",", "input_height", ",", "input_depth", ",", "input_mean", ",", "input_std", ")", ":", "jpeg_data", "=", "tf", ".", "pla...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/examples/image_retraining/retrain.py#L626-L719
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/base.py
python
IndexOpsMixin.argmax
(self, axis=None, skipna=True)
return nanops.nanargmax(self._values, skipna=skipna)
Return a ndarray of the maximum argument indexer. Parameters ---------- axis : {None} Dummy argument for consistency with Series skipna : bool, default True See Also -------- numpy.ndarray.argmax
Return a ndarray of the maximum argument indexer.
[ "Return", "a", "ndarray", "of", "the", "maximum", "argument", "indexer", "." ]
def argmax(self, axis=None, skipna=True): """ Return a ndarray of the maximum argument indexer. Parameters ---------- axis : {None} Dummy argument for consistency with Series skipna : bool, default True See Also -------- numpy.ndarray...
[ "def", "argmax", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "True", ")", ":", "nv", ".", "validate_minmax_axis", "(", "axis", ")", "return", "nanops", ".", "nanargmax", "(", "self", ".", "_values", ",", "skipna", "=", "skipna", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/base.py#L1022-L1037
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/control_flow_ops.py
python
ControlFlowContext.ExitResult
(self, result)
Make a list of tensors available in the outer context.
Make a list of tensors available in the outer context.
[ "Make", "a", "list", "of", "tensors", "available", "in", "the", "outer", "context", "." ]
def ExitResult(self, result): """Make a list of tensors available in the outer context.""" if self._outer_context: nest.map_structure(lambda x: self._outer_context.AddName(x.name), result)
[ "def", "ExitResult", "(", "self", ",", "result", ")", ":", "if", "self", ".", "_outer_context", ":", "nest", ".", "map_structure", "(", "lambda", "x", ":", "self", ".", "_outer_context", ".", "AddName", "(", "x", ".", "name", ")", ",", "result", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/control_flow_ops.py#L1463-L1466
davisking/dlib
d665bfb8994a52029bdf56576ad4e982cbc684be
setup.py
python
read_entire_file
(fname)
return open(os.path.join(fname)).read()
Read text out of a file relative to setup.py.
Read text out of a file relative to setup.py.
[ "Read", "text", "out", "of", "a", "file", "relative", "to", "setup", ".", "py", "." ]
def read_entire_file(fname): """Read text out of a file relative to setup.py. """ return open(os.path.join(fname)).read()
[ "def", "read_entire_file", "(", "fname", ")", ":", "return", "open", "(", "os", ".", "path", ".", "join", "(", "fname", ")", ")", ".", "read", "(", ")" ]
https://github.com/davisking/dlib/blob/d665bfb8994a52029bdf56576ad4e982cbc684be/setup.py#L217-L220
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/idlelib/help.py
python
HelpParser.handle_data
(self, data)
Handle date segments in help.html.
Handle date segments in help.html.
[ "Handle", "date", "segments", "in", "help", ".", "html", "." ]
def handle_data(self, data): "Handle date segments in help.html." if self.show and not self.hdrlink: d = data if self.pre else data.replace('\n', ' ') if self.tags == 'h1': self.hprefix = d[0:d.index(' ')] if self.tags in ['h1', 'h2', 'h3'] and self.hp...
[ "def", "handle_data", "(", "self", ",", "data", ")", ":", "if", "self", ".", "show", "and", "not", "self", ".", "hdrlink", ":", "d", "=", "data", "if", "self", ".", "pre", "else", "data", ".", "replace", "(", "'\\n'", ",", "' '", ")", "if", "self...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/idlelib/help.py#L141-L151
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
win32/Demos/winprocess.py
python
run
(cmd, mSec=None, stdin=None, stdout=None, stderr=None, **kw)
return child.exitCode()
Run cmd as a child process and return exit code. mSec: terminate cmd after specified number of milliseconds stdin, stdout, stderr: file objects for child I/O (use hStdin etc. to attach handles instead of files); default is caller's stdin, stdout & stderr; kw: see Process...
Run cmd as a child process and return exit code. mSec: terminate cmd after specified number of milliseconds stdin, stdout, stderr: file objects for child I/O (use hStdin etc. to attach handles instead of files); default is caller's stdin, stdout & stderr; kw: see Process...
[ "Run", "cmd", "as", "a", "child", "process", "and", "return", "exit", "code", ".", "mSec", ":", "terminate", "cmd", "after", "specified", "number", "of", "milliseconds", "stdin", "stdout", "stderr", ":", "file", "objects", "for", "child", "I", "/", "O", ...
def run(cmd, mSec=None, stdin=None, stdout=None, stderr=None, **kw): """ Run cmd as a child process and return exit code. mSec: terminate cmd after specified number of milliseconds stdin, stdout, stderr: file objects for child I/O (use hStdin etc. to attach handles instead of file...
[ "def", "run", "(", "cmd", ",", "mSec", "=", "None", ",", "stdin", "=", "None", ",", "stdout", "=", "None", ",", "stderr", "=", "None", ",", "*", "*", "kw", ")", ":", "if", "stdin", "is", "not", "None", ":", "kw", "[", "\"hStdin\"", "]", "=", ...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/win32/Demos/winprocess.py#L157-L177
flexflow/FlexFlow
581fad8ba8d10a16a3102ee2b406b0319586df24
examples/python/pytorch/resnet_torch.py
python
conv3x3
(in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1)
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
3x3 convolution with padding
3x3 convolution with padding
[ "3x3", "convolution", "with", "padding" ]
def conv3x3(in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1) -> nn.Conv2d: """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilation, groups=groups, bias=False, dilation=dilation)
[ "def", "conv3x3", "(", "in_planes", ":", "int", ",", "out_planes", ":", "int", ",", "stride", ":", "int", "=", "1", ",", "groups", ":", "int", "=", "1", ",", "dilation", ":", "int", "=", "1", ")", "->", "nn", ".", "Conv2d", ":", "return", "nn", ...
https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/examples/python/pytorch/resnet_torch.py#L7-L10
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeUint64
(self)
return result
Consumes an unsigned 64bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 64bit integer couldn't be consumed.
Consumes an unsigned 64bit integer number.
[ "Consumes", "an", "unsigned", "64bit", "integer", "number", "." ]
def ConsumeUint64(self): """Consumes an unsigned 64bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 64bit integer couldn't be consumed. """ try: result = self._ParseInteger(self.token, is_signed=False, is_long=True) except ValueError, e: ...
[ "def", "ConsumeUint64", "(", "self", ")", ":", "try", ":", "result", "=", "self", ".", "_ParseInteger", "(", "self", ".", "token", ",", "is_signed", "=", "False", ",", "is_long", "=", "True", ")", "except", "ValueError", ",", "e", ":", "raise", "self",...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/text_format.py#L471-L485
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/slim/python/slim/data/data_decoder.py
python
DataDecoder.list_items
(self)
Lists the names of the items that the decoder can decode. Returns: A list of string names.
Lists the names of the items that the decoder can decode.
[ "Lists", "the", "names", "of", "the", "items", "that", "the", "decoder", "can", "decode", "." ]
def list_items(self): """Lists the names of the items that the decoder can decode. Returns: A list of string names. """ pass
[ "def", "list_items", "(", "self", ")", ":", "pass" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/slim/python/slim/data/data_decoder.py#L66-L72
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
PreTextCtrl
(*args, **kwargs)
return val
PreTextCtrl() -> TextCtrl
PreTextCtrl() -> TextCtrl
[ "PreTextCtrl", "()", "-", ">", "TextCtrl" ]
def PreTextCtrl(*args, **kwargs): """PreTextCtrl() -> TextCtrl""" val = _controls_.new_PreTextCtrl(*args, **kwargs) return val
[ "def", "PreTextCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_controls_", ".", "new_PreTextCtrl", "(", "*", "args", ",", "*", "*", "kwargs", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L2075-L2078
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/gyp/pylib/gyp/MSVSProject.py
python
Tool.__init__
(self, name, attrs=None)
Initializes the tool. Args: name: Tool name. attrs: Dict of tool attributes; may be None.
Initializes the tool.
[ "Initializes", "the", "tool", "." ]
def __init__(self, name, attrs=None): """Initializes the tool. Args: name: Tool name. attrs: Dict of tool attributes; may be None. """ self._attrs = attrs or {} self._attrs['Name'] = name
[ "def", "__init__", "(", "self", ",", "name", ",", "attrs", "=", "None", ")", ":", "self", ".", "_attrs", "=", "attrs", "or", "{", "}", "self", ".", "_attrs", "[", "'Name'", "]", "=", "name" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/MSVSProject.py#L16-L24
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/mox.py
python
Reset
(*args)
Reset mocks. Args: # args is any number of mocks to be reset.
Reset mocks.
[ "Reset", "mocks", "." ]
def Reset(*args): """Reset mocks. Args: # args is any number of mocks to be reset. """ for mock in args: mock._Reset()
[ "def", "Reset", "(", "*", "args", ")", ":", "for", "mock", "in", "args", ":", "mock", ".", "_Reset", "(", ")" ]
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/mox.py#L257-L265
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/blogger/service.py
python
BloggerService.GetPostCommentFeed
(self, blog_id=None, post_id=None, uri=None)
return self.Get(uri, converter=gdata.blogger.CommentFeedFromString)
Retrieve a list of the comments for this particular blog post.
Retrieve a list of the comments for this particular blog post.
[ "Retrieve", "a", "list", "of", "the", "comments", "for", "this", "particular", "blog", "post", "." ]
def GetPostCommentFeed(self, blog_id=None, post_id=None, uri=None): """Retrieve a list of the comments for this particular blog post.""" if blog_id and post_id: uri = '/feeds/%s/%s/comments/default' % (blog_id, post_id) return self.Get(uri, converter=gdata.blogger.CommentFeedFromString)
[ "def", "GetPostCommentFeed", "(", "self", ",", "blog_id", "=", "None", ",", "post_id", "=", "None", ",", "uri", "=", "None", ")", ":", "if", "blog_id", "and", "post_id", ":", "uri", "=", "'/feeds/%s/%s/comments/default'", "%", "(", "blog_id", ",", "post_id...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/blogger/service.py#L62-L66
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/graph_actions.py
python
run_feeds_iter
(output_dict, feed_dicts, restore_checkpoint_path=None)
Run `output_dict` tensors with each input in `feed_dicts`. If `restore_checkpoint_path` is supplied, restore from checkpoint. Otherwise, init all variables. Args: output_dict: A `dict` mapping string names to `Tensor` objects to run. Tensors must all be from the same graph. feed_dicts: Iterable of...
Run `output_dict` tensors with each input in `feed_dicts`.
[ "Run", "output_dict", "tensors", "with", "each", "input", "in", "feed_dicts", "." ]
def run_feeds_iter(output_dict, feed_dicts, restore_checkpoint_path=None): """Run `output_dict` tensors with each input in `feed_dicts`. If `restore_checkpoint_path` is supplied, restore from checkpoint. Otherwise, init all variables. Args: output_dict: A `dict` mapping string names to `Tensor` objects to...
[ "def", "run_feeds_iter", "(", "output_dict", ",", "feed_dicts", ",", "restore_checkpoint_path", "=", "None", ")", ":", "if", "not", "output_dict", ":", "raise", "ValueError", "(", "'output_dict is invalid: %s.'", "%", "output_dict", ")", "if", "not", "feed_dicts", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/graph_actions.py#L815-L861
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/random.py
python
Random.getstate
(self)
return self.VERSION, super(Random, self).getstate(), self.gauss_next
Return internal state; can be passed to setstate() later.
Return internal state; can be passed to setstate() later.
[ "Return", "internal", "state", ";", "can", "be", "passed", "to", "setstate", "()", "later", "." ]
def getstate(self): """Return internal state; can be passed to setstate() later.""" return self.VERSION, super(Random, self).getstate(), self.gauss_next
[ "def", "getstate", "(", "self", ")", ":", "return", "self", ".", "VERSION", ",", "super", "(", "Random", ",", "self", ")", ".", "getstate", "(", ")", ",", "self", ".", "gauss_next" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/random.py#L119-L121
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/jinja2/sandbox.py
python
SandboxedEnvironment.format_string
(self, s, args, kwargs)
return type(s)(rv)
If a format call is detected, then this is routed through this method so that our safety sandbox can be used for it.
If a format call is detected, then this is routed through this method so that our safety sandbox can be used for it.
[ "If", "a", "format", "call", "is", "detected", "then", "this", "is", "routed", "through", "this", "method", "so", "that", "our", "safety", "sandbox", "can", "be", "used", "for", "it", "." ]
def format_string(self, s, args, kwargs): """If a format call is detected, then this is routed through this method so that our safety sandbox can be used for it. """ if isinstance(s, Markup): formatter = SandboxedEscapeFormatter(self, s.escape) else: forma...
[ "def", "format_string", "(", "self", ",", "s", ",", "args", ",", "kwargs", ")", ":", "if", "isinstance", "(", "s", ",", "Markup", ")", ":", "formatter", "=", "SandboxedEscapeFormatter", "(", "self", ",", "s", ".", "escape", ")", "else", ":", "formatter...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/sandbox.py#L405-L415
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/base.py
python
BaseEstimator._get_param_names
(cls)
return sorted([p.name for p in parameters])
Get parameter names for the estimator
Get parameter names for the estimator
[ "Get", "parameter", "names", "for", "the", "estimator" ]
def _get_param_names(cls): """Get parameter names for the estimator""" # fetch the constructor or the original constructor before # deprecation wrapping if any init = getattr(cls.__init__, 'deprecated_original', cls.__init__) if init is object.__init__: # No explicit ...
[ "def", "_get_param_names", "(", "cls", ")", ":", "# fetch the constructor or the original constructor before", "# deprecation wrapping if any", "init", "=", "getattr", "(", "cls", ".", "__init__", ",", "'deprecated_original'", ",", "cls", ".", "__init__", ")", "if", "in...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/base.py#L194-L218
Cantera/cantera
0119484b261967ccb55a0066c020599cacc312e4
interfaces/cython/cantera/ctml2yaml.py
python
SpeciesTransport.to_yaml
(cls, representer, data)
return representer.represent_dict(data.attribs)
Serialize the class instance to YAML format suitable for ruamel.yaml. :param representer: An instance of a ruamel.yaml representer type. :param data: An instance of this class that will be serialized. The class instance should have an instance attribute called ``attribs...
Serialize the class instance to YAML format suitable for ruamel.yaml.
[ "Serialize", "the", "class", "instance", "to", "YAML", "format", "suitable", "for", "ruamel", ".", "yaml", "." ]
def to_yaml(cls, representer, data): """Serialize the class instance to YAML format suitable for ruamel.yaml. :param representer: An instance of a ruamel.yaml representer type. :param data: An instance of this class that will be serialized. The class instance sh...
[ "def", "to_yaml", "(", "cls", ",", "representer", ",", "data", ")", ":", "return", "representer", ".", "represent_dict", "(", "data", ".", "attribs", ")" ]
https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/ctml2yaml.py#L1724-L1736
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
MoveEvent.GetPosition
(*args, **kwargs)
return _core_.MoveEvent_GetPosition(*args, **kwargs)
GetPosition(self) -> Point Returns the position of the window generating the move change event.
GetPosition(self) -> Point
[ "GetPosition", "(", "self", ")", "-", ">", "Point" ]
def GetPosition(*args, **kwargs): """ GetPosition(self) -> Point Returns the position of the window generating the move change event. """ return _core_.MoveEvent_GetPosition(*args, **kwargs)
[ "def", "GetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MoveEvent_GetPosition", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L6189-L6195
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py
python
ParserElement.scanString
( self, instring, maxMatches=_MAX_INT, overlap=False )
Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional C{maxMatches} argument, to clip scanning after 'n' matches are found. If C{overlap} is specified, then overlapping matches will be reported. ...
Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional C{maxMatches} argument, to clip scanning after 'n' matches are found. If C{overlap} is specified, then overlapping matches will be reported.
[ "Scan", "the", "input", "string", "for", "expression", "matches", ".", "Each", "match", "will", "return", "the", "matching", "tokens", "start", "location", "and", "end", "location", ".", "May", "be", "called", "with", "optional", "C", "{", "maxMatches", "}",...
def scanString( self, instring, maxMatches=_MAX_INT, overlap=False ): """ Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be called with optional C{maxMatches} argument, to clip scanning after 'n' matches a...
[ "def", "scanString", "(", "self", ",", "instring", ",", "maxMatches", "=", "_MAX_INT", ",", "overlap", "=", "False", ")", ":", "if", "not", "self", ".", "streamlined", ":", "self", ".", "streamline", "(", ")", "for", "e", "in", "self", ".", "ignoreExpr...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py#L1658-L1727
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
SizerItem.GetFlag
(*args, **kwargs)
return _core_.SizerItem_GetFlag(*args, **kwargs)
GetFlag(self) -> int Get the flag value for this item.
GetFlag(self) -> int
[ "GetFlag", "(", "self", ")", "-", ">", "int" ]
def GetFlag(*args, **kwargs): """ GetFlag(self) -> int Get the flag value for this item. """ return _core_.SizerItem_GetFlag(*args, **kwargs)
[ "def", "GetFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SizerItem_GetFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L14215-L14221
msracver/Deep-Image-Analogy
632b9287b42552e32dad64922967c8c9ec7fc4d3
python/caffe/net_spec.py
python
assign_proto
(proto, name, val)
Assign a Python object to a protobuf message, based on the Python type (in recursive fashion). Lists become repeated fields/messages, dicts become messages, and other types are assigned directly. For convenience, repeated fields whose values are not lists are converted to single-element lists; e.g., `my...
Assign a Python object to a protobuf message, based on the Python type (in recursive fashion). Lists become repeated fields/messages, dicts become messages, and other types are assigned directly. For convenience, repeated fields whose values are not lists are converted to single-element lists; e.g., `my...
[ "Assign", "a", "Python", "object", "to", "a", "protobuf", "message", "based", "on", "the", "Python", "type", "(", "in", "recursive", "fashion", ")", ".", "Lists", "become", "repeated", "fields", "/", "messages", "dicts", "become", "messages", "and", "other",...
def assign_proto(proto, name, val): """Assign a Python object to a protobuf message, based on the Python type (in recursive fashion). Lists become repeated fields/messages, dicts become messages, and other types are assigned directly. For convenience, repeated fields whose values are not lists are conve...
[ "def", "assign_proto", "(", "proto", ",", "name", ",", "val", ")", ":", "is_repeated_field", "=", "hasattr", "(", "getattr", "(", "proto", ",", "name", ")", ",", "'extend'", ")", "if", "is_repeated_field", "and", "not", "isinstance", "(", "val", ",", "li...
https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/python/caffe/net_spec.py#L56-L79
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/tools/grokdump.py
python
InspectionShell.do_dd
(self, args)
Interpret memory in the given region [address, address + num * word_size) (if available) as a sequence of words. Automatic alignment is not performed. If the num is not specified, a default value of 16 words is usif not self.Is If no address is given, dd continues printing at the next word. Synops...
Interpret memory in the given region [address, address + num * word_size)
[ "Interpret", "memory", "in", "the", "given", "region", "[", "address", "address", "+", "num", "*", "word_size", ")" ]
def do_dd(self, args): """ Interpret memory in the given region [address, address + num * word_size) (if available) as a sequence of words. Automatic alignment is not performed. If the num is not specified, a default value of 16 words is usif not self.Is If no address is given, dd continues pri...
[ "def", "do_dd", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "!=", "0", ":", "args", "=", "args", ".", "split", "(", "' '", ")", "self", ".", "dd_start", "=", "self", ".", "ParseAddressExpr", "(", "args", "[", "0", "]", ")...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/tools/grokdump.py#L3515-L3534
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/cephfs/kernel_mount.py
python
KernelMount.get_global_inst
(self)
return self._global_inst
Look up the CephFS client instance for this mount
Look up the CephFS client instance for this mount
[ "Look", "up", "the", "CephFS", "client", "instance", "for", "this", "mount" ]
def get_global_inst(self): """ Look up the CephFS client instance for this mount """ return self._global_inst
[ "def", "get_global_inst", "(", "self", ")", ":", "return", "self", ".", "_global_inst" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/cephfs/kernel_mount.py#L326-L330
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PGCell.GetFont
(*args, **kwargs)
return _propgrid.PGCell_GetFont(*args, **kwargs)
GetFont(self) -> Font
GetFont(self) -> Font
[ "GetFont", "(", "self", ")", "-", ">", "Font" ]
def GetFont(*args, **kwargs): """GetFont(self) -> Font""" return _propgrid.PGCell_GetFont(*args, **kwargs)
[ "def", "GetFont", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGCell_GetFont", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L183-L185
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py
python
Treeview.selection_toggle
(self, items)
Toggle the selection state of each item in items.
Toggle the selection state of each item in items.
[ "Toggle", "the", "selection", "state", "of", "each", "item", "in", "items", "." ]
def selection_toggle(self, items): """Toggle the selection state of each item in items.""" self.selection("toggle", items)
[ "def", "selection_toggle", "(", "self", ",", "items", ")", ":", "self", ".", "selection", "(", "\"toggle\"", ",", "items", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/ttk.py#L1411-L1413
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/ISISFermi.py
python
ISISFermi.setChopper
(self, choppername, freq=50, diskchopper_phase=None, diskchopper_freq=None)
Resets the chopper type of this chopper object mychop = ISISFermi('MAPS', 'S', 400) mychop.setChopper('A', 500) Chopper frequency must also be given
Resets the chopper type of this chopper object
[ "Resets", "the", "chopper", "type", "of", "this", "chopper", "object" ]
def setChopper(self, choppername, freq=50, diskchopper_phase=None, diskchopper_freq=None): """ Resets the chopper type of this chopper object mychop = ISISFermi('MAPS', 'S', 400) mychop.setChopper('A', 500) Chopper frequency must also be given """ choppername = ...
[ "def", "setChopper", "(", "self", ",", "choppername", ",", "freq", "=", "50", ",", "diskchopper_phase", "=", "None", ",", "diskchopper_freq", "=", "None", ")", ":", "choppername", "=", "choppername", ".", "upper", "(", ")", "if", "choppername", "not", "in"...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/ISISFermi.py#L118-L137
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/inspect.py
python
getmoduleinfo
(path)
Get the module name, suffix, mode, and module type for a given file.
Get the module name, suffix, mode, and module type for a given file.
[ "Get", "the", "module", "name", "suffix", "mode", "and", "module", "type", "for", "a", "given", "file", "." ]
def getmoduleinfo(path): """Get the module name, suffix, mode, and module type for a given file.""" filename = os.path.basename(path) suffixes = map(lambda info: (-len(info[0]), info[0], info[1], info[2]), imp.get_suffixes()) suffixes.sort() # try longest suffixes ...
[ "def", "getmoduleinfo", "(", "path", ")", ":", "filename", "=", "os", ".", "path", ".", "basename", "(", "path", ")", "suffixes", "=", "map", "(", "lambda", "info", ":", "(", "-", "len", "(", "info", "[", "0", "]", ")", ",", "info", "[", "0", "...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/inspect.py#L424-L433
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/rnn_cell.py
python
BasicRNNCell.__call__
(self, inputs, state, scope=None)
return output, output
Most basic RNN: output = new_state = activation(W * input + U * state + B).
Most basic RNN: output = new_state = activation(W * input + U * state + B).
[ "Most", "basic", "RNN", ":", "output", "=", "new_state", "=", "activation", "(", "W", "*", "input", "+", "U", "*", "state", "+", "B", ")", "." ]
def __call__(self, inputs, state, scope=None): """Most basic RNN: output = new_state = activation(W * input + U * state + B).""" with vs.variable_scope(scope or type(self).__name__): # "BasicRNNCell" output = self._activation(_linear([inputs, state], self._num_units, True)) return output, output
[ "def", "__call__", "(", "self", ",", "inputs", ",", "state", ",", "scope", "=", "None", ")", ":", "with", "vs", ".", "variable_scope", "(", "scope", "or", "type", "(", "self", ")", ".", "__name__", ")", ":", "# \"BasicRNNCell\"", "output", "=", "self",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/rnn_cell.py#L196-L200
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py
python
ParserElement.setDebug
(self, flag=True)
return self
Enable display of debugging messages while doing pattern matching. Set ``flag`` to True to enable, False to disable. Example:: wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd | integer # turn on debugging for wd ...
Enable display of debugging messages while doing pattern matching. Set ``flag`` to True to enable, False to disable.
[ "Enable", "display", "of", "debugging", "messages", "while", "doing", "pattern", "matching", ".", "Set", "flag", "to", "True", "to", "enable", "False", "to", "disable", "." ]
def setDebug(self, flag=True): """ Enable display of debugging messages while doing pattern matching. Set ``flag`` to True to enable, False to disable. Example:: wd = Word(alphas).setName("alphaword") integer = Word(nums).setName("numword") term = wd...
[ "def", "setDebug", "(", "self", ",", "flag", "=", "True", ")", ":", "if", "flag", ":", "self", ".", "setDebugActions", "(", "_defaultStartDebugAction", ",", "_defaultSuccessDebugAction", ",", "_defaultExceptionDebugAction", ")", "else", ":", "self", ".", "debug"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L2502-L2543
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
GLGenerator.WriteServiceUtilsHeader
(self, filename)
Writes the gles2 auto generated utility header.
Writes the gles2 auto generated utility header.
[ "Writes", "the", "gles2", "auto", "generated", "utility", "header", "." ]
def WriteServiceUtilsHeader(self, filename): """Writes the gles2 auto generated utility header.""" file = CHeaderWriter(filename) for enum in sorted(_ENUM_LISTS.keys()): file.Write("ValueValidator<%s> %s;\n" % (_ENUM_LISTS[enum]['type'], ToUnderscore(enum))) file.Write("\n") f...
[ "def", "WriteServiceUtilsHeader", "(", "self", ",", "filename", ")", ":", "file", "=", "CHeaderWriter", "(", "filename", ")", "for", "enum", "in", "sorted", "(", "_ENUM_LISTS", ".", "keys", "(", ")", ")", ":", "file", ".", "Write", "(", "\"ValueValidator<%...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L7523-L7530
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
build/linux/rewrite_dirs.py
python
RewriteLine
(line, opts)
return ' '.join(args)
Rewrites all the paths in recognized options.
Rewrites all the paths in recognized options.
[ "Rewrites", "all", "the", "paths", "in", "recognized", "options", "." ]
def RewriteLine(line, opts): """Rewrites all the paths in recognized options.""" args = line.split() count = len(args) i = 0 while i < count: for prefix in REWRITE_PREFIX: # The option can be either in the form "-I /path/to/dir" or # "-I/path/to/dir" so handle both. if args[i] == prefix:...
[ "def", "RewriteLine", "(", "line", ",", "opts", ")", ":", "args", "=", "line", ".", "split", "(", ")", "count", "=", "len", "(", "args", ")", "i", "=", "0", "while", "i", "<", "count", ":", "for", "prefix", "in", "REWRITE_PREFIX", ":", "# The optio...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/build/linux/rewrite_dirs.py#L35-L55
lightvector/KataGo
20d34784703c5b4000643d3ccc43bb37d418f3b5
python/sgfmill/sgf.py
python
Sgf_game.get_main_sequence
(self)
return result
Return the 'leftmost' variation. Returns a list of Tree_nodes, from the root to a leaf.
Return the 'leftmost' variation.
[ "Return", "the", "leftmost", "variation", "." ]
def get_main_sequence(self): """Return the 'leftmost' variation. Returns a list of Tree_nodes, from the root to a leaf. """ node = self.root result = [node] while node: node = node[0] result.append(node) return result
[ "def", "get_main_sequence", "(", "self", ")", ":", "node", "=", "self", ".", "root", "result", "=", "[", "node", "]", "while", "node", ":", "node", "=", "node", "[", "0", "]", "result", ".", "append", "(", "node", ")", "return", "result" ]
https://github.com/lightvector/KataGo/blob/20d34784703c5b4000643d3ccc43bb37d418f3b5/python/sgfmill/sgf.py#L680-L691
libLAS/libLAS
e6a1aaed412d638687b8aec44f7b12df7ca2bbbb
python/liblas/srs.py
python
SRS.set_wkt
(self, value)
return core.las.LASSRS_SetWKT(self.handle, value)
Sets the wkt for the SRS. An exception will be thrown if the WKT is invalid, GDAL can't ingest it, or GDAL_ is not linked into libLAS
Sets the wkt for the SRS. An exception will be thrown if the WKT is invalid, GDAL can't ingest it, or GDAL_ is not linked into libLAS
[ "Sets", "the", "wkt", "for", "the", "SRS", ".", "An", "exception", "will", "be", "thrown", "if", "the", "WKT", "is", "invalid", "GDAL", "can", "t", "ingest", "it", "or", "GDAL_", "is", "not", "linked", "into", "libLAS" ]
def set_wkt(self, value): """Sets the wkt for the SRS. An exception will be thrown if the WKT is invalid, GDAL can't ingest it, or GDAL_ is not linked into libLAS""" return core.las.LASSRS_SetWKT(self.handle, value)
[ "def", "set_wkt", "(", "self", ",", "value", ")", ":", "return", "core", ".", "las", ".", "LASSRS_SetWKT", "(", "self", ".", "handle", ",", "value", ")" ]
https://github.com/libLAS/libLAS/blob/e6a1aaed412d638687b8aec44f7b12df7ca2bbbb/python/liblas/srs.py#L105-L108
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/math_ops.py
python
logical_xor
(x, y, name="LogicalXor")
return gen_math_ops.logical_and( gen_math_ops.logical_or(x, y), gen_math_ops.logical_not(gen_math_ops.logical_and(x, y)), name=name)
x ^ y = (x | y) & ~(x & y).
x ^ y = (x | y) & ~(x & y).
[ "x", "^", "y", "=", "(", "x", "|", "y", ")", "&", "~", "(", "x", "&", "y", ")", "." ]
def logical_xor(x, y, name="LogicalXor"): """x ^ y = (x | y) & ~(x & y).""" # TODO(alemi) Make this a cwise op if people end up relying on it. return gen_math_ops.logical_and( gen_math_ops.logical_or(x, y), gen_math_ops.logical_not(gen_math_ops.logical_and(x, y)), name=name)
[ "def", "logical_xor", "(", "x", ",", "y", ",", "name", "=", "\"LogicalXor\"", ")", ":", "# TODO(alemi) Make this a cwise op if people end up relying on it.", "return", "gen_math_ops", ".", "logical_and", "(", "gen_math_ops", ".", "logical_or", "(", "x", ",", "y", ")...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/math_ops.py#L1151-L1157
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/findreplace.py
python
FindReplace.get_inner_start_iter
(self, text_buffer, forward, node_id)
return start_iter
Get start_iter when not at beginning or end
Get start_iter when not at beginning or end
[ "Get", "start_iter", "when", "not", "at", "beginning", "or", "end" ]
def get_inner_start_iter(self, text_buffer, forward, node_id): """Get start_iter when not at beginning or end""" if text_buffer.get_has_selection(): iter_start, iter_end = text_buffer.get_selection_bounds() offsets = [iter_start.get_offset(), iter_end.get_offset()] else: ...
[ "def", "get_inner_start_iter", "(", "self", ",", "text_buffer", ",", "forward", ",", "node_id", ")", ":", "if", "text_buffer", ".", "get_has_selection", "(", ")", ":", "iter_start", ",", "iter_end", "=", "text_buffer", ".", "get_selection_bounds", "(", ")", "o...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/findreplace.py#L713-L741
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBModuleSpec.SetSymbolFileSpec
(self, fspec)
return _lldb.SBModuleSpec_SetSymbolFileSpec(self, fspec)
SetSymbolFileSpec(SBModuleSpec self, SBFileSpec fspec)
SetSymbolFileSpec(SBModuleSpec self, SBFileSpec fspec)
[ "SetSymbolFileSpec", "(", "SBModuleSpec", "self", "SBFileSpec", "fspec", ")" ]
def SetSymbolFileSpec(self, fspec): """SetSymbolFileSpec(SBModuleSpec self, SBFileSpec fspec)""" return _lldb.SBModuleSpec_SetSymbolFileSpec(self, fspec)
[ "def", "SetSymbolFileSpec", "(", "self", ",", "fspec", ")", ":", "return", "_lldb", ".", "SBModuleSpec_SetSymbolFileSpec", "(", "self", ",", "fspec", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L7800-L7802
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/collective_util.py
python
Options.merge
(self, options)
return merged
Merges with another options and returns a new one. Values specified in the `options` takes precedence if they're not the default. Args: options: a `tf.distribute.experimental.CollectiveCommunication`. Returns: A new `tf.distribute.experimental.CollectiveCommunication`.
Merges with another options and returns a new one.
[ "Merges", "with", "another", "options", "and", "returns", "a", "new", "one", "." ]
def merge(self, options): """Merges with another options and returns a new one. Values specified in the `options` takes precedence if they're not the default. Args: options: a `tf.distribute.experimental.CollectiveCommunication`. Returns: A new `tf.distribute.experimental.CollectiveCo...
[ "def", "merge", "(", "self", ",", "options", ")", ":", "merged", "=", "copy", ".", "deepcopy", "(", "self", ")", "if", "options", "is", "None", ":", "return", "merged", "if", "options", ".", "bytes_per_pack", "!=", "0", ":", "merged", ".", "bytes_per_p...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/collective_util.py#L139-L160
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/internal/decoder.py
python
GroupDecoder
(field_number, is_repeated, is_packed, key, new_default)
Returns a decoder for a group field.
Returns a decoder for a group field.
[ "Returns", "a", "decoder", "for", "a", "group", "field", "." ]
def GroupDecoder(field_number, is_repeated, is_packed, key, new_default): """Returns a decoder for a group field.""" end_tag_bytes = encoder.TagBytes(field_number, wire_format.WIRETYPE_END_GROUP) end_tag_len = len(end_tag_bytes) assert not is_packed if is_repeated: tag...
[ "def", "GroupDecoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ",", "key", ",", "new_default", ")", ":", "end_tag_bytes", "=", "encoder", ".", "TagBytes", "(", "field_number", ",", "wire_format", ".", "WIRETYPE_END_GROUP", ")", "end_tag_len", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/decoder.py#L665-L709
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/imp.py
python
source_from_cache
(path)
return util.source_from_cache(path)
**DEPRECATED** Given the path to a .pyc. file, return the path to its .py file. The .pyc file does not need to exist; this simply returns the path to the .py file calculated to correspond to the .pyc file. If path does not conform to PEP 3147 format, ValueError will be raised. If sys.implementati...
**DEPRECATED**
[ "**", "DEPRECATED", "**" ]
def source_from_cache(path): """**DEPRECATED** Given the path to a .pyc. file, return the path to its .py file. The .pyc file does not need to exist; this simply returns the path to the .py file calculated to correspond to the .pyc file. If path does not conform to PEP 3147 format, ValueError wil...
[ "def", "source_from_cache", "(", "path", ")", ":", "return", "util", ".", "source_from_cache", "(", "path", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/imp.py#L91-L102
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/check_ops.py
python
assert_same_float_dtype
(tensors=None, dtype=None)
return dtype
Validate and return float type based on `tensors` and `dtype`. For ops such as matrix multiplication, inputs and weights must be of the same float type. This function validates that all `tensors` are the same type, validates that type is `dtype` (if supplied), and returns the type. Type must be a floating poin...
Validate and return float type based on `tensors` and `dtype`.
[ "Validate", "and", "return", "float", "type", "based", "on", "tensors", "and", "dtype", "." ]
def assert_same_float_dtype(tensors=None, dtype=None): """Validate and return float type based on `tensors` and `dtype`. For ops such as matrix multiplication, inputs and weights must be of the same float type. This function validates that all `tensors` are the same type, validates that type is `dtype` (if sup...
[ "def", "assert_same_float_dtype", "(", "tensors", "=", "None", ",", "dtype", "=", "None", ")", ":", "if", "tensors", ":", "dtype", "=", "_assert_same_base_type", "(", "tensors", ",", "dtype", ")", "if", "not", "dtype", ":", "dtype", "=", "dtypes", ".", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/check_ops.py#L2204-L2231
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/combo.py
python
ComboCtrl.SetPopupAnchor
(*args, **kwargs)
return _combo.ComboCtrl_SetPopupAnchor(*args, **kwargs)
SetPopupAnchor(self, int anchorSide) Set side of the control to which the popup will align itself. Valid values are wx.LEFT, wx.RIGHT and 0. The default value 0 means that the most appropriate side is used (which, currently, is always wx.LEFT).
SetPopupAnchor(self, int anchorSide)
[ "SetPopupAnchor", "(", "self", "int", "anchorSide", ")" ]
def SetPopupAnchor(*args, **kwargs): """ SetPopupAnchor(self, int anchorSide) Set side of the control to which the popup will align itself. Valid values are wx.LEFT, wx.RIGHT and 0. The default value 0 means that the most appropriate side is used (which, currently, is always wx....
[ "def", "SetPopupAnchor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "ComboCtrl_SetPopupAnchor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L316-L324
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
TextAreaBase.HitTestPos
(*args, **kwargs)
return _core_.TextAreaBase_HitTestPos(*args, **kwargs)
HitTestPos(Point pt) -> (result, position) Find the character position in the text coresponding to the point given in pixels. NB: pt is in device coords but is not adjusted for the client area origin nor scrolling.
HitTestPos(Point pt) -> (result, position)
[ "HitTestPos", "(", "Point", "pt", ")", "-", ">", "(", "result", "position", ")" ]
def HitTestPos(*args, **kwargs): """ HitTestPos(Point pt) -> (result, position) Find the character position in the text coresponding to the point given in pixels. NB: pt is in device coords but is not adjusted for the client area origin nor scrolling. """ return...
[ "def", "HitTestPos", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "TextAreaBase_HitTestPos", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L13462-L13470
s5z/zsim
fb4d6e0475a25cffd23f0687ede2d43d96b4a99f
misc/cpplint.py
python
CheckEmptyLoopBody
(filename, clean_lines, linenum, error)
Loop for empty loop body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Loop for empty loop body with only a single semicolon.
[ "Loop", "for", "empty", "loop", "body", "with", "only", "a", "single", "semicolon", "." ]
def CheckEmptyLoopBody(filename, clean_lines, linenum, error): """Loop for empty loop body with only a single semicolon. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call wit...
[ "def", "CheckEmptyLoopBody", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "# Search for loop keywords at the beginning of the line. Because only", "# whitespaces are allowed before the keywords, this will also ignore most", "# do-while-loops, since those ...
https://github.com/s5z/zsim/blob/fb4d6e0475a25cffd23f0687ede2d43d96b4a99f/misc/cpplint.py#L2641-L2665
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/aui/auibar.py
python
AuiToolBar.SetMarginsXY
(self, x, y)
Set the values to be used as margins for the toolbar. :param integer `x`: left margin, right margin and inter-tool separation value; :param integer `y`: top margin, bottom margin and inter-tool separation value.
Set the values to be used as margins for the toolbar. :param integer `x`: left margin, right margin and inter-tool separation value; :param integer `y`: top margin, bottom margin and inter-tool separation value.
[ "Set", "the", "values", "to", "be", "used", "as", "margins", "for", "the", "toolbar", ".", ":", "param", "integer", "x", ":", "left", "margin", "right", "margin", "and", "inter", "-", "tool", "separation", "value", ";", ":", "param", "integer", "y", ":...
def SetMarginsXY(self, x, y): """ Set the values to be used as margins for the toolbar. :param integer `x`: left margin, right margin and inter-tool separation value; :param integer `y`: top margin, bottom margin and inter-tool separation value. """ self...
[ "def", "SetMarginsXY", "(", "self", ",", "x", ",", "y", ")", ":", "self", ".", "SetMargins", "(", "x", ",", "x", ",", "y", ",", "y", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibar.py#L2463-L2471