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/_gdi.py
python
RendererVersion.IsCompatible
(*args, **kwargs)
return _gdi_.RendererVersion_IsCompatible(*args, **kwargs)
IsCompatible(RendererVersion ver) -> bool
IsCompatible(RendererVersion ver) -> bool
[ "IsCompatible", "(", "RendererVersion", "ver", ")", "-", ">", "bool" ]
def IsCompatible(*args, **kwargs): """IsCompatible(RendererVersion ver) -> bool""" return _gdi_.RendererVersion_IsCompatible(*args, **kwargs)
[ "def", "IsCompatible", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "RendererVersion_IsCompatible", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L7233-L7235
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
Cursor.referenced
(self)
return self._referenced
For a cursor that is a reference, returns a cursor representing the entity that it references.
For a cursor that is a reference, returns a cursor representing the entity that it references.
[ "For", "a", "cursor", "that", "is", "a", "reference", "returns", "a", "cursor", "representing", "the", "entity", "that", "it", "references", "." ]
def referenced(self): """ For a cursor that is a reference, returns a cursor representing the entity that it references. """ if not hasattr(self, '_referenced'): self._referenced = conf.lib.clang_getCursorReferenced(self) return self._referenced
[ "def", "referenced", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_referenced'", ")", ":", "self", ".", "_referenced", "=", "conf", ".", "lib", ".", "clang_getCursorReferenced", "(", "self", ")", "return", "self", ".", "_referenced" ]
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L1780-L1788
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pytree.py
python
LeafPattern.match
(self, node, results=None)
return BasePattern.match(self, node, results)
Override match() to insist on a leaf node.
Override match() to insist on a leaf node.
[ "Override", "match", "()", "to", "insist", "on", "a", "leaf", "node", "." ]
def match(self, node, results=None): """Override match() to insist on a leaf node.""" if not isinstance(node, Leaf): return False return BasePattern.match(self, node, results)
[ "def", "match", "(", "self", ",", "node", ",", "results", "=", "None", ")", ":", "if", "not", "isinstance", "(", "node", ",", "Leaf", ")", ":", "return", "False", "return", "BasePattern", ".", "match", "(", "self", ",", "node", ",", "results", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pytree.py#L522-L526
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/deps/v8/tools/run-clang-tidy.py
python
GenerateCompileCommands
(build_folder)
Generate a compilation database. Currently clang-tidy-4 does not understand all flags that are passed by the build system, therefore, we remove them from the generated file.
Generate a compilation database.
[ "Generate", "a", "compilation", "database", "." ]
def GenerateCompileCommands(build_folder): """ Generate a compilation database. Currently clang-tidy-4 does not understand all flags that are passed by the build system, therefore, we remove them from the generated file. """ ninja_ps = subprocess.Popen( ['ninja', '-t', 'compdb', 'cxx', 'cc'], stdou...
[ "def", "GenerateCompileCommands", "(", "build_folder", ")", ":", "ninja_ps", "=", "subprocess", ".", "Popen", "(", "[", "'ninja'", ",", "'-t'", ",", "'compdb'", ",", "'cxx'", ",", "'cc'", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "cwd", "=...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/run-clang-tidy.py#L55-L81
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/imaplib.py
python
IMAP4.close
(self)
return typ, dat
Close currently selected mailbox. Deleted messages are removed from writable mailbox. This is the recommended command before 'LOGOUT'. (typ, [data]) = <instance>.close()
Close currently selected mailbox.
[ "Close", "currently", "selected", "mailbox", "." ]
def close(self): """Close currently selected mailbox. Deleted messages are removed from writable mailbox. This is the recommended command before 'LOGOUT'. (typ, [data]) = <instance>.close() """ try: typ, dat = self._simple_command('CLOSE') finally: ...
[ "def", "close", "(", "self", ")", ":", "try", ":", "typ", ",", "dat", "=", "self", ".", "_simple_command", "(", "'CLOSE'", ")", "finally", ":", "self", ".", "state", "=", "'AUTH'", "return", "typ", ",", "dat" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/imaplib.py#L389-L401
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/markupsafe/_native.py
python
escape_silent
(s)
return escape(s)
Like :func:`escape` but converts `None` into an empty markup string.
Like :func:`escape` but converts `None` into an empty markup string.
[ "Like", ":", "func", ":", "escape", "but", "converts", "None", "into", "an", "empty", "markup", "string", "." ]
def escape_silent(s): """Like :func:`escape` but converts `None` into an empty markup string. """ if s is None: return Markup() return escape(s)
[ "def", "escape_silent", "(", "s", ")", ":", "if", "s", "is", "None", ":", "return", "Markup", "(", ")", "return", "escape", "(", "s", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/markupsafe/_native.py#L31-L37
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/inspector_protocol/jinja2/parser.py
python
Parser.parse
(self)
return result
Parse the whole template into a `Template` node.
Parse the whole template into a `Template` node.
[ "Parse", "the", "whole", "template", "into", "a", "Template", "node", "." ]
def parse(self): """Parse the whole template into a `Template` node.""" result = nodes.Template(self.subparse(), lineno=1) result.set_environment(self.environment) return result
[ "def", "parse", "(", "self", ")", ":", "result", "=", "nodes", ".", "Template", "(", "self", ".", "subparse", "(", ")", ",", "lineno", "=", "1", ")", "result", ".", "set_environment", "(", "self", ".", "environment", ")", "return", "result" ]
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/parser.py#L899-L903
jiangxiluning/FOTS.PyTorch
b1851c170b4f1ad18406766352cb5171648ce603
FOTS/utils/eval_tools/icdar2015/rrc_evaluation_funcs_1_1.py
python
get_tl_dict_values_from_array
(array,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0,sort_by_confidences=True,validNumPoints=[],validate_cw=True)
return pointsList,confidencesList,transcriptionsList
Returns all points, confindences and transcriptions of a file in lists. Valid dict formats: {"points":[[x1,y1],[x2,y2],[x3,x3],..,[xn,yn]],"transcription":"###","confidence":0.4}
Returns all points, confindences and transcriptions of a file in lists. Valid dict formats: {"points":[[x1,y1],[x2,y2],[x3,x3],..,[xn,yn]],"transcription":"###","confidence":0.4}
[ "Returns", "all", "points", "confindences", "and", "transcriptions", "of", "a", "file", "in", "lists", ".", "Valid", "dict", "formats", ":", "{", "points", ":", "[[", "x1", "y1", "]", "[", "x2", "y2", "]", "[", "x3", "x3", "]", "..", "[", "xn", "yn...
def get_tl_dict_values_from_array(array,withTranscription=False,withConfidence=False,imWidth=0,imHeight=0,sort_by_confidences=True,validNumPoints=[],validate_cw=True): """ Returns all points, confindences and transcriptions of a file in lists. Valid dict formats: {"points":[[x1,y1],[x2,y2],[x3,x3],..,[xn,yn...
[ "def", "get_tl_dict_values_from_array", "(", "array", ",", "withTranscription", "=", "False", ",", "withConfidence", "=", "False", ",", "imWidth", "=", "0", ",", "imHeight", "=", "0", ",", "sort_by_confidences", "=", "True", ",", "validNumPoints", "=", "[", "]...
https://github.com/jiangxiluning/FOTS.PyTorch/blob/b1851c170b4f1ad18406766352cb5171648ce603/FOTS/utils/eval_tools/icdar2015/rrc_evaluation_funcs_1_1.py#L346-L369
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
memoryUsed
()
return ret
Returns the total amount of memory allocated by libxml2
Returns the total amount of memory allocated by libxml2
[ "Returns", "the", "total", "amount", "of", "memory", "allocated", "by", "libxml2" ]
def memoryUsed(): """Returns the total amount of memory allocated by libxml2 """ ret = libxml2mod.xmlMemoryUsed() return ret
[ "def", "memoryUsed", "(", ")", ":", "ret", "=", "libxml2mod", ".", "xmlMemoryUsed", "(", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L1601-L1604
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/module/sequential_module.py
python
SequentialModule.update
(self)
Updates parameters according to installed optimizer and the gradient computed in the previous forward-backward cycle.
Updates parameters according to installed optimizer and the gradient computed in the previous forward-backward cycle.
[ "Updates", "parameters", "according", "to", "installed", "optimizer", "and", "the", "gradient", "computed", "in", "the", "previous", "forward", "-", "backward", "cycle", "." ]
def update(self): """Updates parameters according to installed optimizer and the gradient computed in the previous forward-backward cycle. """ assert self.binded and self.params_initialized and self.optimizer_initialized for module in self._modules: module.update()
[ "def", "update", "(", "self", ")", ":", "assert", "self", ".", "binded", "and", "self", ".", "params_initialized", "and", "self", ".", "optimizer_initialized", "for", "module", "in", "self", ".", "_modules", ":", "module", ".", "update", "(", ")" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/module/sequential_module.py#L369-L376
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py
python
CloudPickler.inject_addons
(self)
Plug in system. Register additional pickling functions if modules already loaded
Plug in system. Register additional pickling functions if modules already loaded
[ "Plug", "in", "system", ".", "Register", "additional", "pickling", "functions", "if", "modules", "already", "loaded" ]
def inject_addons(self): """Plug in system. Register additional pickling functions if modules already loaded""" self.inject_numpy() self.inject_unity_proxy()
[ "def", "inject_addons", "(", "self", ")", ":", "self", ".", "inject_numpy", "(", ")", "self", ".", "inject_unity_proxy", "(", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/util/_cloudpickle/_cloudpickle_py27.py#L1024-L1027
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/python_gflags/gflags.py
python
DuplicateFlagError.__init__
(self, flagname, flag_values, other_flag_values=None)
Create a DuplicateFlagError. Args: flagname: Name of the flag being redefined. flag_values: FlagValues object containing the first definition of flagname. other_flag_values: If this argument is not None, it should be the FlagValues object where the second definition of flagnam...
Create a DuplicateFlagError.
[ "Create", "a", "DuplicateFlagError", "." ]
def __init__(self, flagname, flag_values, other_flag_values=None): """Create a DuplicateFlagError. Args: flagname: Name of the flag being redefined. flag_values: FlagValues object containing the first definition of flagname. other_flag_values: If this argument is not None, it should...
[ "def", "__init__", "(", "self", ",", "flagname", ",", "flag_values", ",", "other_flag_values", "=", "None", ")", ":", "self", ".", "flagname", "=", "flagname", "first_module", "=", "flag_values", ".", "FindModuleDefiningFlag", "(", "flagname", ",", "default", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/python_gflags/gflags.py#L477-L500
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py
python
_Filters
()
return _cpplint_state.filters
Returns the module's list of output filters, as a list.
Returns the module's list of output filters, as a list.
[ "Returns", "the", "module", "s", "list", "of", "output", "filters", "as", "a", "list", "." ]
def _Filters(): """Returns the module's list of output filters, as a list.""" return _cpplint_state.filters
[ "def", "_Filters", "(", ")", ":", "return", "_cpplint_state", ".", "filters" ]
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L1195-L1197
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py
python
FTP.sendeprt
(self, host, port)
return self.voidcmd(cmd)
Send an EPRT command with the current host and the given port number.
Send an EPRT command with the current host and the given port number.
[ "Send", "an", "EPRT", "command", "with", "the", "current", "host", "and", "the", "given", "port", "number", "." ]
def sendeprt(self, host, port): '''Send an EPRT command with the current host and the given port number.''' af = 0 if self.af == socket.AF_INET: af = 1 if self.af == socket.AF_INET6: af = 2 if af == 0: raise error_proto('unsupported address fam...
[ "def", "sendeprt", "(", "self", ",", "host", ",", "port", ")", ":", "af", "=", "0", "if", "self", ".", "af", "==", "socket", ".", "AF_INET", ":", "af", "=", "1", "if", "self", ".", "af", "==", "socket", ".", "AF_INET6", ":", "af", "=", "2", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py#L290-L301
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/artmanager.py
python
ArtManager.PaintCrescentGradientBox
(self, dc, rect, startColour, endColour, concave=True)
Paint a region with gradient colouring. The gradient is in crescent shape which fits the 2007 style. :param `dc`: an instance of :class:`DC`; :param Rect `rect`: the rectangle to be filled with gradient shading; :param Colour `startColour`: the first colour of the gradient shading; ...
Paint a region with gradient colouring. The gradient is in crescent shape which fits the 2007 style.
[ "Paint", "a", "region", "with", "gradient", "colouring", ".", "The", "gradient", "is", "in", "crescent", "shape", "which", "fits", "the", "2007", "style", "." ]
def PaintCrescentGradientBox(self, dc, rect, startColour, endColour, concave=True): """ Paint a region with gradient colouring. The gradient is in crescent shape which fits the 2007 style. :param `dc`: an instance of :class:`DC`; :param Rect `rect`: the rectangle to be filled wi...
[ "def", "PaintCrescentGradientBox", "(", "self", ",", "dc", ",", "rect", ",", "startColour", ",", "endColour", ",", "concave", "=", "True", ")", ":", "diagonalRectWidth", "=", "rect", ".", "GetWidth", "(", ")", "/", "4", "spare", "=", "rect", ".", "width"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/artmanager.py#L1076-L1103
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/gtk/gizmos.py
python
TreeListCtrl.SetImageList
(*args, **kwargs)
return _gizmos.TreeListCtrl_SetImageList(*args, **kwargs)
SetImageList(self, ImageList imageList)
SetImageList(self, ImageList imageList)
[ "SetImageList", "(", "self", "ImageList", "imageList", ")" ]
def SetImageList(*args, **kwargs): """SetImageList(self, ImageList imageList)""" return _gizmos.TreeListCtrl_SetImageList(*args, **kwargs)
[ "def", "SetImageList", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_SetImageList", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/gtk/gizmos.py#L531-L533
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Configuration/DataProcessing/python/Impl/relvalmcfs.py
python
relvalmcfs.dqmHarvesting
(self, datasetName, runNumber, globalTag, **args)
return process
_dqmHarvesting_ DQM Harvesting for RelVal MC production
_dqmHarvesting_
[ "_dqmHarvesting_" ]
def dqmHarvesting(self, datasetName, runNumber, globalTag, **args): """ _dqmHarvesting_ DQM Harvesting for RelVal MC production """ options = defaultOptions options.scenario = "pp" options.step = "HARVESTING:validationHarvestingFS" options.isMC = True ...
[ "def", "dqmHarvesting", "(", "self", ",", "datasetName", ",", "runNumber", ",", "globalTag", ",", "*", "*", "args", ")", ":", "options", "=", "defaultOptions", "options", ".", "scenario", "=", "\"pp\"", "options", ".", "step", "=", "\"HARVESTING:validationHarv...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Configuration/DataProcessing/python/Impl/relvalmcfs.py#L27-L56
CaoWGG/TensorRT-YOLOv4
4d7c2edce99e8794a4cb4ea3540d51ce91158a36
onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py
python
TokenKind.register
(value, name)
Register a new TokenKind enumeration. This should only be called at module load time by code within this package.
Register a new TokenKind enumeration.
[ "Register", "a", "new", "TokenKind", "enumeration", "." ]
def register(value, name): """Register a new TokenKind enumeration. This should only be called at module load time by code within this package. """ if value in TokenKind._value_map: raise ValueError('TokenKind already registered: %d' % value) kind = TokenKin...
[ "def", "register", "(", "value", ",", "name", ")", ":", "if", "value", "in", "TokenKind", ".", "_value_map", ":", "raise", "ValueError", "(", "'TokenKind already registered: %d'", "%", "value", ")", "kind", "=", "TokenKind", "(", "value", ",", "name", ")", ...
https://github.com/CaoWGG/TensorRT-YOLOv4/blob/4d7c2edce99e8794a4cb4ea3540d51ce91158a36/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L502-L513
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py
python
_count_leading
(line, ch)
return i
Return number of `ch` characters at the start of `line`. Example: >>> _count_leading(' abc', ' ') 3
Return number of `ch` characters at the start of `line`.
[ "Return", "number", "of", "ch", "characters", "at", "the", "start", "of", "line", "." ]
def _count_leading(line, ch): """ Return number of `ch` characters at the start of `line`. Example: >>> _count_leading(' abc', ' ') 3 """ i, n = 0, len(line) while i < n and line[i] == ch: i += 1 return i
[ "def", "_count_leading", "(", "line", ",", "ch", ")", ":", "i", ",", "n", "=", "0", ",", "len", "(", "line", ")", "while", "i", "<", "n", "and", "line", "[", "i", "]", "==", "ch", ":", "i", "+=", "1", "return", "i" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/difflib.py#L751-L764
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/rds2/layer1.py
python
RDSConnection.reset_db_parameter_group
(self, db_parameter_group_name, reset_all_parameters=None, parameters=None)
return self._make_request( action='ResetDBParameterGroup', verb='POST', path='/', params=params)
Modifies the parameters of a DB parameter group to the engine/system default value. To reset specific parameters submit a list of the following: `ParameterName` and `ApplyMethod`. To reset the entire DB parameter group, specify the `DBParameterGroup` name and `ResetAllParameters` ...
Modifies the parameters of a DB parameter group to the engine/system default value. To reset specific parameters submit a list of the following: `ParameterName` and `ApplyMethod`. To reset the entire DB parameter group, specify the `DBParameterGroup` name and `ResetAllParameters` ...
[ "Modifies", "the", "parameters", "of", "a", "DB", "parameter", "group", "to", "the", "engine", "/", "system", "default", "value", ".", "To", "reset", "specific", "parameters", "submit", "a", "list", "of", "the", "following", ":", "ParameterName", "and", "App...
def reset_db_parameter_group(self, db_parameter_group_name, reset_all_parameters=None, parameters=None): """ Modifies the parameters of a DB parameter group to the engine/system default value. To reset specific parameters submit a list of the following: `...
[ "def", "reset_db_parameter_group", "(", "self", ",", "db_parameter_group_name", ",", "reset_all_parameters", "=", "None", ",", "parameters", "=", "None", ")", ":", "params", "=", "{", "'DBParameterGroupName'", ":", "db_parameter_group_name", ",", "}", "if", "reset_a...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/rds2/layer1.py#L3234-L3295
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
ext/ply/example/optcalc/calc.py
python
p_expression_number
(t)
expression : NUMBER
expression : NUMBER
[ "expression", ":", "NUMBER" ]
def p_expression_number(t): 'expression : NUMBER' t[0] = t[1]
[ "def", "p_expression_number", "(", "t", ")", ":", "t", "[", "0", "]", "=", "t", "[", "1", "]" ]
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/optcalc/calc.py#L92-L94
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibar.py
python
AuiToolBar.OnSetCursor
(self, event)
Handles the ``wx.EVT_SET_CURSOR`` event for :class:`AuiToolBar`. :param `event`: a :class:`SetCursorEvent` event to be processed.
Handles the ``wx.EVT_SET_CURSOR`` event for :class:`AuiToolBar`.
[ "Handles", "the", "wx", ".", "EVT_SET_CURSOR", "event", "for", ":", "class", ":", "AuiToolBar", "." ]
def OnSetCursor(self, event): """ Handles the ``wx.EVT_SET_CURSOR`` event for :class:`AuiToolBar`. :param `event`: a :class:`SetCursorEvent` event to be processed. """ cursor = wx.NullCursor if self._gripper_sizer_item: gripper_rect...
[ "def", "OnSetCursor", "(", "self", ",", "event", ")", ":", "cursor", "=", "wx", ".", "NullCursor", "if", "self", ".", "_gripper_sizer_item", ":", "gripper_rect", "=", "self", ".", "_gripper_sizer_item", ".", "GetRect", "(", ")", "if", "gripper_rect", ".", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L3917-L3932
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/minimum-falling-path-sum-ii.py
python
Solution.minFallingPathSum
(self, arr)
return min(arr[-1])
:type arr: List[List[int]] :rtype: int
:type arr: List[List[int]] :rtype: int
[ ":", "type", "arr", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def minFallingPathSum(self, arr): """ :type arr: List[List[int]] :rtype: int """ for i in xrange(1, len(arr)): smallest_two = heapq.nsmallest(2, arr[i-1]) for j in xrange(len(arr[0])): arr[i][j] += smallest_two[1] if arr[i-1][j] == smallest...
[ "def", "minFallingPathSum", "(", "self", ",", "arr", ")", ":", "for", "i", "in", "xrange", "(", "1", ",", "len", "(", "arr", ")", ")", ":", "smallest_two", "=", "heapq", ".", "nsmallest", "(", "2", ",", "arr", "[", "i", "-", "1", "]", ")", "for...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-falling-path-sum-ii.py#L8-L17
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.WriteCopies
(self, copies, extra_outputs, part_of_all)
Write Makefile code for any 'copies' from the gyp input. extra_outputs: a list that will be filled in with any outputs of this action (used to make other pieces dependent on this action) part_of_all: flag indicating this target is part of 'all'
Write Makefile code for any 'copies' from the gyp input.
[ "Write", "Makefile", "code", "for", "any", "copies", "from", "the", "gyp", "input", "." ]
def WriteCopies(self, copies, extra_outputs, part_of_all): """Write Makefile code for any 'copies' from the gyp input. extra_outputs: a list that will be filled in with any outputs of this action (used to make other pieces dependent on this action) part_of_all: flag indicating this targe...
[ "def", "WriteCopies", "(", "self", ",", "copies", ",", "extra_outputs", ",", "part_of_all", ")", ":", "self", ".", "WriteLn", "(", "'### Generated for copy rule.'", ")", "variable", "=", "StringToMakefileVariable", "(", "self", ".", "qualified_target", "+", "'_cop...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/generator/make.py#L1139-L1174
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/linter/git_base.py
python
GitCommandResult.__init__
( # pylint: disable=too-many-arguments self, cmd, process_args, returncode, stdout=None, stderr=None)
Initialize GitCommandResult.
Initialize GitCommandResult.
[ "Initialize", "GitCommandResult", "." ]
def __init__( # pylint: disable=too-many-arguments self, cmd, process_args, returncode, stdout=None, stderr=None): """Initialize GitCommandResult.""" self.cmd = cmd self.process_args = process_args self.returncode = returncode self.stdout = stdout self.stderr...
[ "def", "__init__", "(", "# pylint: disable=too-many-arguments", "self", ",", "cmd", ",", "process_args", ",", "returncode", ",", "stdout", "=", "None", ",", "stderr", "=", "None", ")", ":", "self", ".", "cmd", "=", "cmd", "self", ".", "process_args", "=", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/linter/git_base.py#L263-L270
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/clang/utils/check_cfc/obj_diff.py
python
disassemble
(objfile)
return filter(keep_line, out.split(os.linesep))
Disassemble object to a file.
Disassemble object to a file.
[ "Disassemble", "object", "to", "a", "file", "." ]
def disassemble(objfile): """Disassemble object to a file.""" p = subprocess.Popen([disassembler, '-d', objfile], stdout=subprocess.PIPE, stderr=subprocess.PIPE) (out, err) = p.communicate() if p.returncode or err: print("Disassemble failed: {}"....
[ "def", "disassemble", "(", "objfile", ")", ":", "p", "=", "subprocess", ".", "Popen", "(", "[", "disassembler", ",", "'-d'", ",", "objfile", "]", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "PIPE", ")", "(", ...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/utils/check_cfc/obj_diff.py#L19-L28
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/lldbutils/lldbutils/content.py
python
ptag
(debugger, command, result, dict)
Displays the tag name of a content node.
Displays the tag name of a content node.
[ "Displays", "the", "tag", "name", "of", "a", "content", "node", "." ]
def ptag(debugger, command, result, dict): """Displays the tag name of a content node.""" debugger.HandleCommand("expr (" + command + ")->mNodeInfo.mRawPtr->mInner.mName")
[ "def", "ptag", "(", "debugger", ",", "command", ",", "result", ",", "dict", ")", ":", "debugger", ".", "HandleCommand", "(", "\"expr (\"", "+", "command", "+", "\")->mNodeInfo.mRawPtr->mInner.mName\"", ")" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/lldbutils/lldbutils/content.py#L15-L17
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.ClipHorzGridLines
(*args, **kwargs)
return _grid.Grid_ClipHorzGridLines(*args, **kwargs)
ClipHorzGridLines(self, bool clip)
ClipHorzGridLines(self, bool clip)
[ "ClipHorzGridLines", "(", "self", "bool", "clip", ")" ]
def ClipHorzGridLines(*args, **kwargs): """ClipHorzGridLines(self, bool clip)""" return _grid.Grid_ClipHorzGridLines(*args, **kwargs)
[ "def", "ClipHorzGridLines", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_ClipHorzGridLines", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1674-L1676
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/closure_linter/closure_linter/tokenutil.py
python
GetFirstTokenInPreviousLine
(token)
return None
Returns the first token in the previous line as token. Args: token: Any token in the line. Returns: The first token in the previous line as token, or None if token is on the first line.
Returns the first token in the previous line as token.
[ "Returns", "the", "first", "token", "in", "the", "previous", "line", "as", "token", "." ]
def GetFirstTokenInPreviousLine(token): """Returns the first token in the previous line as token. Args: token: Any token in the line. Returns: The first token in the previous line as token, or None if token is on the first line. """ first_in_line = GetFirstTokenInSameLine(token) if first_in_li...
[ "def", "GetFirstTokenInPreviousLine", "(", "token", ")", ":", "first_in_line", "=", "GetFirstTokenInSameLine", "(", "token", ")", "if", "first_in_line", ".", "previous", ":", "return", "GetFirstTokenInSameLine", "(", "first_in_line", ".", "previous", ")", "return", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/tokenutil.py#L46-L60
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/numbers.py
python
Complex.__rmul__
(self, other)
other * self
other * self
[ "other", "*", "self" ]
def __rmul__(self, other): """other * self""" raise NotImplementedError
[ "def", "__rmul__", "(", "self", ",", "other", ")", ":", "raise", "NotImplementedError" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/numbers.py#L106-L108
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py
python
spawn._log_control
(self, s)
Write control characters to the appropriate log files
Write control characters to the appropriate log files
[ "Write", "control", "characters", "to", "the", "appropriate", "log", "files" ]
def _log_control(self, s): """Write control characters to the appropriate log files""" if self.encoding is not None: s = s.decode(self.encoding, 'replace') self._log(s, 'send')
[ "def", "_log_control", "(", "self", ",", "s", ")", ":", "if", "self", ".", "encoding", "is", "not", "None", ":", "s", "=", "s", ".", "decode", "(", "self", ".", "encoding", ",", "'replace'", ")", "self", ".", "_log", "(", "s", ",", "'send'", ")" ...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L557-L561
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/config_key.py
python
GetKeysDialog.toggle_level
(self)
Toggle between basic and advanced keys.
Toggle between basic and advanced keys.
[ "Toggle", "between", "basic", "and", "advanced", "keys", "." ]
def toggle_level(self): "Toggle between basic and advanced keys." if self.button_level.cget('text').startswith('Advanced'): self.clear_key_seq() self.button_level.config(text='<< Basic Key Binding Entry') self.frame_keyseq_advanced.lift() self.frame_help_...
[ "def", "toggle_level", "(", "self", ")", ":", "if", "self", ".", "button_level", ".", "cget", "(", "'text'", ")", ".", "startswith", "(", "'Advanced'", ")", ":", "self", ".", "clear_key_seq", "(", ")", "self", ".", "button_level", ".", "config", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/config_key.py#L216-L230
epiqc/ScaffCC
66a79944ee4cd116b27bc1a69137276885461db8
llvm/bindings/python/llvm/object.py
python
Section.expire
(self)
Expire the section. This is called internally by the section iterator.
Expire the section.
[ "Expire", "the", "section", "." ]
def expire(self): """Expire the section. This is called internally by the section iterator. """ self.expired = True
[ "def", "expire", "(", "self", ")", ":", "self", ".", "expired", "=", "True" ]
https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/llvm/bindings/python/llvm/object.py#L282-L287
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/log.py
python
Logger._stdout_level
(self)
return self.FATAL
Returns the level that stdout runs at
Returns the level that stdout runs at
[ "Returns", "the", "level", "that", "stdout", "runs", "at" ]
def _stdout_level(self): """Returns the level that stdout runs at""" for level, consumer in self.consumers: if consumer is sys.stdout: return level return self.FATAL
[ "def", "_stdout_level", "(", "self", ")", ":", "for", "level", ",", "consumer", "in", "self", ".", "consumers", ":", "if", "consumer", "is", "sys", ".", "stdout", ":", "return", "level", "return", "self", ".", "FATAL" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/log.py#L134-L139
baidu/bigflow
449245016c0df7d1252e85581e588bfc60cefad3
bigflow_python/python/bigflow/transforms.py
python
window_into
(pcollection, window, **options)
return bigflow.transform_impls.window_into.window_into(pcollection, window, **options)
利用给定的window对输入PCollection分组,返回一个表示分组结果的PTable Args: pcollection (PCollection): 输入PCollection window(Window): 输入Window Returns: PTable: 分组结果
利用给定的window对输入PCollection分组,返回一个表示分组结果的PTable
[ "利用给定的window对输入PCollection分组,返回一个表示分组结果的PTable" ]
def window_into(pcollection, window, **options): """ 利用给定的window对输入PCollection分组,返回一个表示分组结果的PTable Args: pcollection (PCollection): 输入PCollection window(Window): 输入Window Returns: PTable: 分组结果 """ import bigflow.transform_impls.window_into return bigflow.transform_imp...
[ "def", "window_into", "(", "pcollection", ",", "window", ",", "*", "*", "options", ")", ":", "import", "bigflow", ".", "transform_impls", ".", "window_into", "return", "bigflow", ".", "transform_impls", ".", "window_into", ".", "window_into", "(", "pcollection",...
https://github.com/baidu/bigflow/blob/449245016c0df7d1252e85581e588bfc60cefad3/bigflow_python/python/bigflow/transforms.py#L486-L499
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/optimize/zeros.py
python
ridder
(f, a, b, args=(), xtol=_xtol, rtol=_rtol, maxiter=_iter, full_output=False, disp=True)
return results_c(full_output, r)
Find a root of a function in an interval using Ridder's method. Parameters ---------- f : function Python function returning a number. f must be continuous, and f(a) and f(b) must have opposite signs. a : scalar One end of the bracketing interval [a,b]. b : scalar T...
Find a root of a function in an interval using Ridder's method.
[ "Find", "a", "root", "of", "a", "function", "in", "an", "interval", "using", "Ridder", "s", "method", "." ]
def ridder(f, a, b, args=(), xtol=_xtol, rtol=_rtol, maxiter=_iter, full_output=False, disp=True): """ Find a root of a function in an interval using Ridder's method. Parameters ---------- f : function Python function returning a number. f must be continuous, and f(a)...
[ "def", "ridder", "(", "f", ",", "a", ",", "b", ",", "args", "=", "(", ")", ",", "xtol", "=", "_xtol", ",", "rtol", "=", "_rtol", ",", "maxiter", "=", "_iter", ",", "full_output", "=", "False", ",", "disp", "=", "True", ")", ":", "if", "not", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/zeros.py#L535-L628
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Window.ToggleWindowStyle
(*args, **kwargs)
return _core_.Window_ToggleWindowStyle(*args, **kwargs)
ToggleWindowStyle(self, int flag) -> bool Turn the flag on if it had been turned off before and vice versa, returns True if the flag is turned on by this function call.
ToggleWindowStyle(self, int flag) -> bool
[ "ToggleWindowStyle", "(", "self", "int", "flag", ")", "-", ">", "bool" ]
def ToggleWindowStyle(*args, **kwargs): """ ToggleWindowStyle(self, int flag) -> bool Turn the flag on if it had been turned off before and vice versa, returns True if the flag is turned on by this function call. """ return _core_.Window_ToggleWindowStyle(*args, **kwargs...
[ "def", "ToggleWindowStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_ToggleWindowStyle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L10054-L10061
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/transformed_distribution.py
python
TransformedDistribution.get_event_shape
(self)
return self._base_dist.get_event_shape()
`TensorShape` available at graph construction time. Same meaning as `event_shape`. May be only partially defined. Returns: event shape
`TensorShape` available at graph construction time.
[ "TensorShape", "available", "at", "graph", "construction", "time", "." ]
def get_event_shape(self): """`TensorShape` available at graph construction time. Same meaning as `event_shape`. May be only partially defined. Returns: event shape """ return self._base_dist.get_event_shape()
[ "def", "get_event_shape", "(", "self", ")", ":", "return", "self", ".", "_base_dist", ".", "get_event_shape", "(", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/transformed_distribution.py#L143-L151
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_ops.py
python
matvec
(a, b, transpose_a=False, adjoint_a=False, a_is_sparse=False, b_is_sparse=False, name=None)
Multiplies matrix `a` by vector `b`, producing `a` * `b`. The matrix `a` must, following any transpositions, be a tensor of rank >= 2, with `shape(a)[-1] == shape(b)[-1]`, and `shape(a)[:-2]` able to broadcast with `shape(b)[:-1]`. Both `a` and `b` must be of the same type. The supported types are: `float16...
Multiplies matrix `a` by vector `b`, producing `a` * `b`.
[ "Multiplies", "matrix", "a", "by", "vector", "b", "producing", "a", "*", "b", "." ]
def matvec(a, b, transpose_a=False, adjoint_a=False, a_is_sparse=False, b_is_sparse=False, name=None): """Multiplies matrix `a` by vector `b`, producing `a` * `b`. The matrix `a` must, following any transpositions, be a tensor of rank >= 2, with `...
[ "def", "matvec", "(", "a", ",", "b", ",", "transpose_a", "=", "False", ",", "adjoint_a", "=", "False", ",", "a_is_sparse", "=", "False", ",", "b_is_sparse", "=", "False", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "nam...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_ops.py#L3719-L3814
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/metrics/histograms/pretty_print.py
python
PrettyPrint
(raw_xml)
return PrettyPrintNode(tree)
Pretty-print the given XML. Args: xml: The contents of the histograms XML file, as a string. Returns: The pretty-printed version.
Pretty-print the given XML.
[ "Pretty", "-", "print", "the", "given", "XML", "." ]
def PrettyPrint(raw_xml): """Pretty-print the given XML. Args: xml: The contents of the histograms XML file, as a string. Returns: The pretty-printed version. """ tree = xml.dom.minidom.parseString(raw_xml) tree = TransformByAlphabetizing(tree) return PrettyPrintNode(tree)
[ "def", "PrettyPrint", "(", "raw_xml", ")", ":", "tree", "=", "xml", ".", "dom", ".", "minidom", ".", "parseString", "(", "raw_xml", ")", "tree", "=", "TransformByAlphabetizing", "(", "tree", ")", "return", "PrettyPrintNode", "(", "tree", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/metrics/histograms/pretty_print.py#L303-L314
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/decomposition/online_lda.py
python
LatentDirichletAllocation.partial_fit
(self, X, y=None)
return self
Online VB with Mini-Batch update. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Document word matrix. Returns ------- self
Online VB with Mini-Batch update.
[ "Online", "VB", "with", "Mini", "-", "Batch", "update", "." ]
def partial_fit(self, X, y=None): """Online VB with Mini-Batch update. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Document word matrix. Returns ------- self """ self._check_params() X ...
[ "def", "partial_fit", "(", "self", ",", "X", ",", "y", "=", "None", ")", ":", "self", ".", "_check_params", "(", ")", "X", "=", "self", ".", "_check_non_neg_array", "(", "X", ",", "\"LatentDirichletAllocation.partial_fit\"", ")", "n_samples", ",", "n_feature...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/decomposition/online_lda.py#L445-L481
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_presenter.py
python
PlottingCanvasPresenter.replace_workspace_in_plot
(self, workspace)
Replace specified workspace in the plot with a new and presumably updated instance
Replace specified workspace in the plot with a new and presumably updated instance
[ "Replace", "specified", "workspace", "in", "the", "plot", "with", "a", "new", "and", "presumably", "updated", "instance" ]
def replace_workspace_in_plot(self, workspace): """Replace specified workspace in the plot with a new and presumably updated instance""" self._view.replace_specified_workspace_in_plot(workspace)
[ "def", "replace_workspace_in_plot", "(", "self", ",", "workspace", ")", ":", "self", ".", "_view", ".", "replace_specified_workspace_in_plot", "(", "workspace", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/plot_widget/plotting_canvas/plotting_canvas_presenter.py#L50-L52
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/process.py
python
BaseProcess.daemon
(self, daemonic)
Set whether process is a daemon
Set whether process is a daemon
[ "Set", "whether", "process", "is", "a", "daemon" ]
def daemon(self, daemonic): ''' Set whether process is a daemon ''' assert self._popen is None, 'process has already started' self._config['daemon'] = daemonic
[ "def", "daemon", "(", "self", ",", "daemonic", ")", ":", "assert", "self", ".", "_popen", "is", "None", ",", "'process has already started'", "self", ".", "_config", "[", "'daemon'", "]", "=", "daemonic" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/multiprocessing/process.py#L197-L202
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/common.py
python
is_true_slices
(line)
return [isinstance(k, slice) and not is_null_slice(k) for k in line]
Find non-trivial slices in "line": return a list of booleans with same length.
Find non-trivial slices in "line": return a list of booleans with same length.
[ "Find", "non", "-", "trivial", "slices", "in", "line", ":", "return", "a", "list", "of", "booleans", "with", "same", "length", "." ]
def is_true_slices(line) -> list[bool]: """ Find non-trivial slices in "line": return a list of booleans with same length. """ return [isinstance(k, slice) and not is_null_slice(k) for k in line]
[ "def", "is_true_slices", "(", "line", ")", "->", "list", "[", "bool", "]", ":", "return", "[", "isinstance", "(", "k", ",", "slice", ")", "and", "not", "is_null_slice", "(", "k", ")", "for", "k", "in", "line", "]" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/common.py#L309-L313
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/filedialog.py
python
askdirectory
(**options)
return Directory(**options).show()
Ask for a directory, and return the file name
Ask for a directory, and return the file name
[ "Ask", "for", "a", "directory", "and", "return", "the", "file", "name" ]
def askdirectory (**options): "Ask for a directory, and return the file name" return Directory(**options).show()
[ "def", "askdirectory", "(", "*", "*", "options", ")", ":", "return", "Directory", "(", "*", "*", "options", ")", ".", "show", "(", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/filedialog.py#L426-L428
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/muelu/research/q2q1/status.py
python
make_colormap
(seq)
return mcolors.LinearSegmentedColormap.from_list('CustomMap', seq, N=len(seq))
Return a LinearSegmentedColormap seq: a sequence of floats and RGB-tuples. The floats should be increasing and in the interval (0,1).
Return a LinearSegmentedColormap seq: a sequence of floats and RGB-tuples. The floats should be increasing and in the interval (0,1).
[ "Return", "a", "LinearSegmentedColormap", "seq", ":", "a", "sequence", "of", "floats", "and", "RGB", "-", "tuples", ".", "The", "floats", "should", "be", "increasing", "and", "in", "the", "interval", "(", "0", "1", ")", "." ]
def make_colormap(seq): """Return a LinearSegmentedColormap seq: a sequence of floats and RGB-tuples. The floats should be increasing and in the interval (0,1). """ return mcolors.LinearSegmentedColormap.from_list('CustomMap', seq, N=len(seq))
[ "def", "make_colormap", "(", "seq", ")", ":", "return", "mcolors", ".", "LinearSegmentedColormap", ".", "from_list", "(", "'CustomMap'", ",", "seq", ",", "N", "=", "len", "(", "seq", ")", ")" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/muelu/research/q2q1/status.py#L18-L23
perilouswithadollarsign/cstrike15_src
f82112a2388b841d72cb62ca48ab1846dfcc11c8
thirdparty/protobuf-2.5.0/python/google/protobuf/internal/python_message.py
python
_AddPropertiesForRepeatedField
(field, cls)
Adds a public property for a "repeated" protocol message field. Clients can use this property to get the value of the field, which will be either a _RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see below). Note that when clients add values to these containers, we perform type-checking i...
Adds a public property for a "repeated" protocol message field. Clients can use this property to get the value of the field, which will be either a _RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see below).
[ "Adds", "a", "public", "property", "for", "a", "repeated", "protocol", "message", "field", ".", "Clients", "can", "use", "this", "property", "to", "get", "the", "value", "of", "the", "field", "which", "will", "be", "either", "a", "_RepeatedScalarFieldContainer...
def _AddPropertiesForRepeatedField(field, cls): """Adds a public property for a "repeated" protocol message field. Clients can use this property to get the value of the field, which will be either a _RepeatedScalarFieldContainer or _RepeatedCompositeFieldContainer (see below). Note that when clients add val...
[ "def", "_AddPropertiesForRepeatedField", "(", "field", ",", "cls", ")", ":", "proto_field_name", "=", "field", ".", "name", "property_name", "=", "_PropertyName", "(", "proto_field_name", ")", "def", "getter", "(", "self", ")", ":", "field_value", "=", "self", ...
https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/python_message.py#L386-L427
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/fft/_pocketfft.py
python
rfftn
(a, s=None, axes=None, norm=None)
return a
Compute the N-dimensional discrete Fourier Transform for real input. This function computes the N-dimensional discrete Fourier Transform over any number of axes in an M-dimensional real array by means of the Fast Fourier Transform (FFT). By default, all axes are transformed, with the real transform pe...
Compute the N-dimensional discrete Fourier Transform for real input.
[ "Compute", "the", "N", "-", "dimensional", "discrete", "Fourier", "Transform", "for", "real", "input", "." ]
def rfftn(a, s=None, axes=None, norm=None): """ Compute the N-dimensional discrete Fourier Transform for real input. This function computes the N-dimensional discrete Fourier Transform over any number of axes in an M-dimensional real array by means of the Fast Fourier Transform (FFT). By default, ...
[ "def", "rfftn", "(", "a", ",", "s", "=", "None", ",", "axes", "=", "None", ",", "norm", "=", "None", ")", ":", "a", "=", "asarray", "(", "a", ")", "s", ",", "axes", "=", "_cook_nd_args", "(", "a", ",", "s", ",", "axes", ")", "a", "=", "rfft...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/fft/_pocketfft.py#L1039-L1127
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py
python
MemorizingFile.__init__
(self, file_, max_memorized_lines=sys.maxint)
Construct an instance. Args: file_: the file object to wrap. max_memorized_lines: the maximum number of lines to memorize. Only the first max_memorized_lines are memorized. Default: sys.maxint.
Construct an instance.
[ "Construct", "an", "instance", "." ]
def __init__(self, file_, max_memorized_lines=sys.maxint): """Construct an instance. Args: file_: the file object to wrap. max_memorized_lines: the maximum number of lines to memorize. Only the first max_memorized_lines are memorized. Default: sys...
[ "def", "__init__", "(", "self", ",", "file_", ",", "max_memorized_lines", "=", "sys", ".", "maxint", ")", ":", "self", ".", "_file", "=", "file_", "self", ".", "_memorized_lines", "=", "[", "]", "self", ".", "_max_memorized_lines", "=", "max_memorized_lines"...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py#L50-L64
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
NativePixelData_Accessor.Offset
(*args, **kwargs)
return _gdi_.NativePixelData_Accessor_Offset(*args, **kwargs)
Offset(self, NativePixelData data, int x, int y)
Offset(self, NativePixelData data, int x, int y)
[ "Offset", "(", "self", "NativePixelData", "data", "int", "x", "int", "y", ")" ]
def Offset(*args, **kwargs): """Offset(self, NativePixelData data, int x, int y)""" return _gdi_.NativePixelData_Accessor_Offset(*args, **kwargs)
[ "def", "Offset", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "NativePixelData_Accessor_Offset", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L1100-L1102
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py
python
check_identifier_name_in_declaration
(filename, line_number, line, file_state, error)
Checks if identifier names contain any underscores. As identifiers in libraries we are using have a bunch of underscores, we only warn about the declarations of identifiers and don't check use of identifiers. Args: filename: The name of the current file. line_number: The number of the line...
Checks if identifier names contain any underscores.
[ "Checks", "if", "identifier", "names", "contain", "any", "underscores", "." ]
def check_identifier_name_in_declaration(filename, line_number, line, file_state, error): """Checks if identifier names contain any underscores. As identifiers in libraries we are using have a bunch of underscores, we only warn about the declarations of identifiers and don't check use of identifiers. ...
[ "def", "check_identifier_name_in_declaration", "(", "filename", ",", "line_number", ",", "line", ",", "file_state", ",", "error", ")", ":", "# We don't check a return statement.", "if", "match", "(", "r'\\s*(return|delete)\\b'", ",", "line", ")", ":", "return", "# Mak...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/style/checkers/cpp.py#L3285-L3431
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/srv/_GetRoutePlan.py
python
GetRoutePlanResponse.deserialize
(self, str)
unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str``
unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str``
[ "unpack", "serialized", "message", "in", "str", "into", "this", "message", "instance", ":", "param", "str", ":", "byte", "array", "of", "serialized", "message", "str" ]
def deserialize(self, str): """ unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str`` """ try: if self.plan is None: self.plan = geographic_msgs.msg.RoutePath() end = 0 start = end end += 1 (self.succes...
[ "def", "deserialize", "(", "self", ",", "str", ")", ":", "try", ":", "if", "self", ".", "plan", "is", "None", ":", "self", ".", "plan", "=", "geographic_msgs", ".", "msg", ".", "RoutePath", "(", ")", "end", "=", "0", "start", "=", "end", "end", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/geographic_msgs/srv/_GetRoutePlan.py#L359-L434
zhaoweicai/hwgq
ebc706bee3e2d145de1da4be446ce8de8740738f
python/caffe/draw.py
python
get_layer_label
(layer, rankdir)
return node_label
Define node label based on layer type. Parameters ---------- layer : ? rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. Returns ------- string : A label for the current layer
Define node label based on layer type.
[ "Define", "node", "label", "based", "on", "layer", "type", "." ]
def get_layer_label(layer, rankdir): """Define node label based on layer type. Parameters ---------- layer : ? rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. Returns ------- string : A label for the current layer """ if rankdir in ('TB', 'BT'): ...
[ "def", "get_layer_label", "(", "layer", ",", "rankdir", ")", ":", "if", "rankdir", "in", "(", "'TB'", ",", "'BT'", ")", ":", "# If graph orientation is vertical, horizontal space is free and", "# vertical space is not; separate words with spaces", "separator", "=", "' '", ...
https://github.com/zhaoweicai/hwgq/blob/ebc706bee3e2d145de1da4be446ce8de8740738f/python/caffe/draw.py#L62-L114
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBType.GetTypeFlags
(self)
return _lldb.SBType_GetTypeFlags(self)
GetTypeFlags(self) -> uint32_t
GetTypeFlags(self) -> uint32_t
[ "GetTypeFlags", "(", "self", ")", "-", ">", "uint32_t" ]
def GetTypeFlags(self): """GetTypeFlags(self) -> uint32_t""" return _lldb.SBType_GetTypeFlags(self)
[ "def", "GetTypeFlags", "(", "self", ")", ":", "return", "_lldb", ".", "SBType_GetTypeFlags", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10509-L10511
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_credd/condor_credmon_oauth/credmon/utils/utils.py
python
create_credentials
()
Auto-create the credentials for the condor_credmon; if there are already credentials present, leave them alone.
Auto-create the credentials for the condor_credmon; if there are already credentials present, leave them alone.
[ "Auto", "-", "create", "the", "credentials", "for", "the", "condor_credmon", ";", "if", "there", "are", "already", "credentials", "present", "leave", "them", "alone", "." ]
def create_credentials(): """ Auto-create the credentials for the condor_credmon; if there are already credentials present, leave them alone. """ if not htcondor: return logger = logging.getLogger(os.path.basename(sys.argv[0])) private_keyfile = htcondor.param.get("LOCAL_CREDMON_PRI...
[ "def", "create_credentials", "(", ")", ":", "if", "not", "htcondor", ":", "return", "logger", "=", "logging", ".", "getLogger", "(", "os", ".", "path", ".", "basename", "(", "sys", ".", "argv", "[", "0", "]", ")", ")", "private_keyfile", "=", "htcondor...
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_credd/condor_credmon_oauth/credmon/utils/utils.py#L42-L87
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/common/walterWidgets/walterBaseTreeView.py
python
BaseDelegate.__init__
(self, treeView)
Called after the instance has been created.
Called after the instance has been created.
[ "Called", "after", "the", "instance", "has", "been", "created", "." ]
def __init__(self, treeView): """Called after the instance has been created.""" super(BaseDelegate, self).__init__() self.treeView = weakref.ref(treeView) self.lastHitAction = None self.textColor = self.treeView().palette().text().color()
[ "def", "__init__", "(", "self", ",", "treeView", ")", ":", "super", "(", "BaseDelegate", ",", "self", ")", ".", "__init__", "(", ")", "self", ".", "treeView", "=", "weakref", ".", "ref", "(", "treeView", ")", "self", ".", "lastHitAction", "=", "None", ...
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/common/walterWidgets/walterBaseTreeView.py#L256-L261
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/ao/quantization/observer.py
python
MinMaxObserver.calculate_qparams
(self)
return self._calculate_qparams(self.min_val, self.max_val)
r"""Calculates the quantization parameters.
r"""Calculates the quantization parameters.
[ "r", "Calculates", "the", "quantization", "parameters", "." ]
def calculate_qparams(self): r"""Calculates the quantization parameters.""" return self._calculate_qparams(self.min_val, self.max_val)
[ "def", "calculate_qparams", "(", "self", ")", ":", "return", "self", ".", "_calculate_qparams", "(", "self", ".", "min_val", ",", "self", ".", "max_val", ")" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/observer.py#L455-L457
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
uCSIsDevanagari
(code)
return ret
Check whether the character is part of Devanagari UCS Block
Check whether the character is part of Devanagari UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "Devanagari", "UCS", "Block" ]
def uCSIsDevanagari(code): """Check whether the character is part of Devanagari UCS Block """ ret = libxml2mod.xmlUCSIsDevanagari(code) return ret
[ "def", "uCSIsDevanagari", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsDevanagari", "(", "code", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2489-L2492
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/netem.py
python
Toggle.cleanup
(self)
Invoked during unwinding if the test fails or exits before executing task 'link_recover'
Invoked during unwinding if the test fails or exits before executing task 'link_recover'
[ "Invoked", "during", "unwinding", "if", "the", "test", "fails", "or", "exits", "before", "executing", "task", "link_recover" ]
def cleanup(self): """ Invoked during unwinding if the test fails or exits before executing task 'link_recover' """ log.info('Clean up') self.stop_event.set() self.thread.get()
[ "def", "cleanup", "(", "self", ")", ":", "log", ".", "info", "(", "'Clean up'", ")", "self", ".", "stop_event", ".", "set", "(", ")", "self", ".", "thread", ".", "get", "(", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/netem.py#L187-L193
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/variables.py
python
Variable.op
(self)
return self._variable.op
The `Operation` of this variable.
The `Operation` of this variable.
[ "The", "Operation", "of", "this", "variable", "." ]
def op(self): """The `Operation` of this variable.""" return self._variable.op
[ "def", "op", "(", "self", ")", ":", "return", "self", ".", "_variable", ".", "op" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/variables.py#L893-L895
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py
python
BaseSpecifier.__eq__
(self, other)
Returns a boolean representing whether or not the two Specifier like objects are equal.
Returns a boolean representing whether or not the two Specifier like objects are equal.
[ "Returns", "a", "boolean", "representing", "whether", "or", "not", "the", "two", "Specifier", "like", "objects", "are", "equal", "." ]
def __eq__(self, other): """ Returns a boolean representing whether or not the two Specifier like objects are equal. """
[ "def", "__eq__", "(", "self", ",", "other", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py#L36-L40
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/lacros/mojo_connection_lacros_launcher.py
python
_MaybeClosing
(fileobj)
return (contextlib.closing if fileobj else NullContext)(fileobj)
Returns closing context manager, if given fileobj is not None. If the given fileobj is none, return nullcontext.
Returns closing context manager, if given fileobj is not None.
[ "Returns", "closing", "context", "manager", "if", "given", "fileobj", "is", "not", "None", "." ]
def _MaybeClosing(fileobj): """Returns closing context manager, if given fileobj is not None. If the given fileobj is none, return nullcontext. """ return (contextlib.closing if fileobj else NullContext)(fileobj)
[ "def", "_MaybeClosing", "(", "fileobj", ")", ":", "return", "(", "contextlib", ".", "closing", "if", "fileobj", "else", "NullContext", ")", "(", "fileobj", ")" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/lacros/mojo_connection_lacros_launcher.py#L110-L115
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/xcode_emulation.py
python
XcodeSettings.GetBundleResourceFolder
(self)
return os.path.join(self.GetBundleContentsFolderPath(), 'Resources')
Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.
Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.
[ "Returns", "the", "qualified", "path", "to", "the", "bundle", "s", "resource", "folder", ".", "E", ".", "g", ".", "Chromium", ".", "app", "/", "Contents", "/", "Resources", ".", "Only", "valid", "for", "bundles", "." ]
def GetBundleResourceFolder(self): """Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.""" assert self._IsBundle() return os.path.join(self.GetBundleContentsFolderPath(), 'Resources')
[ "def", "GetBundleResourceFolder", "(", "self", ")", ":", "assert", "self", ".", "_IsBundle", "(", ")", "return", "os", ".", "path", ".", "join", "(", "self", ".", "GetBundleContentsFolderPath", "(", ")", ",", "'Resources'", ")" ]
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/xcode_emulation.py#L112-L116
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py
python
Maildir.__contains__
(self, key)
return key in self._toc
Return True if the keyed message exists, False otherwise.
Return True if the keyed message exists, False otherwise.
[ "Return", "True", "if", "the", "keyed", "message", "exists", "False", "otherwise", "." ]
def __contains__(self, key): """Return True if the keyed message exists, False otherwise.""" self._refresh() return key in self._toc
[ "def", "__contains__", "(", "self", ",", "key", ")", ":", "self", ".", "_refresh", "(", ")", "return", "key", "in", "self", ".", "_toc" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/mailbox.py#L405-L408
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
TaggedOutput.setbreaklines
(self, breaklines)
return self
Set the value for breaklines.
Set the value for breaklines.
[ "Set", "the", "value", "for", "breaklines", "." ]
def setbreaklines(self, breaklines): "Set the value for breaklines." self.breaklines = breaklines return self
[ "def", "setbreaklines", "(", "self", ",", "breaklines", ")", ":", "self", ".", "breaklines", "=", "breaklines", "return", "self" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L1617-L1620
swift/swift
12d031cf8177fdec0137f9aa7e2912fa23c4416b
3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/intelc.py
python
linux_ver_normalize
(vstr)
Normalize a Linux compiler version number. Intel changed from "80" to "9.0" in 2005, so we assume if the number is greater than 60 it's an old-style number and otherwise new-style. Always returns an old-style float like 80 or 90 for compatibility with Windows. Shades of Y2K!
Normalize a Linux compiler version number. Intel changed from "80" to "9.0" in 2005, so we assume if the number is greater than 60 it's an old-style number and otherwise new-style. Always returns an old-style float like 80 or 90 for compatibility with Windows. Shades of Y2K!
[ "Normalize", "a", "Linux", "compiler", "version", "number", ".", "Intel", "changed", "from", "80", "to", "9", ".", "0", "in", "2005", "so", "we", "assume", "if", "the", "number", "is", "greater", "than", "60", "it", "s", "an", "old", "-", "style", "n...
def linux_ver_normalize(vstr): """Normalize a Linux compiler version number. Intel changed from "80" to "9.0" in 2005, so we assume if the number is greater than 60 it's an old-style number and otherwise new-style. Always returns an old-style float like 80 or 90 for compatibility with Windows. Shade...
[ "def", "linux_ver_normalize", "(", "vstr", ")", ":", "# Check for version number like 9.1.026: return 91.026", "# XXX needs to be updated for 2011+ versions (like 2011.11.344 which is compiler v12.1.5)", "m", "=", "re", ".", "match", "(", "r'([0-9]+)\\.([0-9]+)\\.([0-9]+)'", ",", "vs...
https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/intelc.py#L65-L83
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/applications/workbench/workbench/plotting/plotscriptgenerator/__init__.py
python
get_axis_label_cmds
(ax, ax_object_var)
return ["{ax_obj}.{cmd}".format(ax_obj=ax_object_var, cmd=cmd) for cmd in axis_label_cmds]
Get commands such as axes.set_xlabel and axes.set_ylabel
Get commands such as axes.set_xlabel and axes.set_ylabel
[ "Get", "commands", "such", "as", "axes", ".", "set_xlabel", "and", "axes", ".", "set_ylabel" ]
def get_axis_label_cmds(ax, ax_object_var): """Get commands such as axes.set_xlabel and axes.set_ylabel""" axis_label_cmds = generate_axis_label_commands(ax) return ["{ax_obj}.{cmd}".format(ax_obj=ax_object_var, cmd=cmd) for cmd in axis_label_cmds]
[ "def", "get_axis_label_cmds", "(", "ax", ",", "ax_object_var", ")", ":", "axis_label_cmds", "=", "generate_axis_label_commands", "(", "ax", ")", "return", "[", "\"{ax_obj}.{cmd}\"", ".", "format", "(", "ax_obj", "=", "ax_object_var", ",", "cmd", "=", "cmd", ")",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/plotting/plotscriptgenerator/__init__.py#L150-L153
sc0ty/subsync
be5390d00ff475b6543eb0140c7e65b34317d95b
subsync/synchro/input.py
python
getLangFromPath
(path)
Get language code from file name. Reads 2- or 3-letter language code from file name, if code is present as last thing before file extension. Returns ------- str 3-letter language code or `None` if code is not present. Examples -------- - `subtitles.eng.srt` - eng - `subtit...
Get language code from file name.
[ "Get", "language", "code", "from", "file", "name", "." ]
def getLangFromPath(path): """Get language code from file name. Reads 2- or 3-letter language code from file name, if code is present as last thing before file extension. Returns ------- str 3-letter language code or `None` if code is not present. Examples -------- - `subt...
[ "def", "getLangFromPath", "(", "path", ")", ":", "name", "=", "path", ".", "rsplit", "(", "'.'", ",", "1", ")", "[", "0", "]", "size", "=", "0", "for", "c", "in", "reversed", "(", "name", ")", ":", "if", "c", ".", "isalpha", "(", ")", ":", "s...
https://github.com/sc0ty/subsync/blob/be5390d00ff475b6543eb0140c7e65b34317d95b/subsync/synchro/input.py#L218-L245
keyboardio/Kaleidoscope
d59604e98b2439d108647f15be52984a6837d360
bin/cpplint.py
python
_Quiet
()
return _cpplint_state.quiet
Return's the module's quiet setting.
Return's the module's quiet setting.
[ "Return", "s", "the", "module", "s", "quiet", "setting", "." ]
def _Quiet(): """Return's the module's quiet setting.""" return _cpplint_state.quiet
[ "def", "_Quiet", "(", ")", ":", "return", "_cpplint_state", ".", "quiet" ]
https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L1171-L1173
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/pickle.py
python
Pickler.clear_memo
(self)
Clears the pickler's "memo". The memo is the data structure that remembers which objects the pickler has already seen, so that shared or recursive objects are pickled by reference and not by value. This method is useful when re-using picklers.
Clears the pickler's "memo".
[ "Clears", "the", "pickler", "s", "memo", "." ]
def clear_memo(self): """Clears the pickler's "memo". The memo is the data structure that remembers which objects the pickler has already seen, so that shared or recursive objects are pickled by reference and not by value. This method is useful when re-using picklers. ...
[ "def", "clear_memo", "(", "self", ")", ":", "self", ".", "memo", ".", "clear", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pickle.py#L209-L218
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
build/android/pylib/linker/setup.py
python
Setup
(args, devices)
return (TestRunnerFactory, all_tests)
Creates a list of test cases and a runner factory. Args: args: an argparse.Namespace object. devices: an iterable of available devices. Returns: A tuple of (TestRunnerFactory, tests).
Creates a list of test cases and a runner factory.
[ "Creates", "a", "list", "of", "test", "cases", "and", "a", "runner", "factory", "." ]
def Setup(args, devices): """Creates a list of test cases and a runner factory. Args: args: an argparse.Namespace object. devices: an iterable of available devices. Returns: A tuple of (TestRunnerFactory, tests). """ legacy_linker_tests = [ test_case.LinkerSharedRelroTest(is_modern_linker=F...
[ "def", "Setup", "(", "args", ",", "devices", ")", ":", "legacy_linker_tests", "=", "[", "test_case", ".", "LinkerSharedRelroTest", "(", "is_modern_linker", "=", "False", ",", "is_low_memory", "=", "False", ")", ",", "test_case", ".", "LinkerSharedRelroTest", "("...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/pylib/linker/setup.py#L20-L60
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_view.py
python
BackgroundCorrectionsView.set_slot_for_use_raw_changed
(self, slot)
Sets the slot for when a use raw table cell is changed.
Sets the slot for when a use raw table cell is changed.
[ "Sets", "the", "slot", "for", "when", "a", "use", "raw", "table", "cell", "is", "changed", "." ]
def set_slot_for_use_raw_changed(self, slot) -> None: """Sets the slot for when a use raw table cell is changed.""" self._handle_use_raw_changed = slot
[ "def", "set_slot_for_use_raw_changed", "(", "self", ",", "slot", ")", "->", "None", ":", "self", ".", "_handle_use_raw_changed", "=", "slot" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/background_corrections_view.py#L93-L95
infinisql/infinisql
6e858e142196e20b6779e1ee84c4a501e246c1f8
manager/infinisqlmgr/management/__init__.py
python
Controller.shutdown
(self)
Shuts down this management node, releases all resources. :return: None
Shuts down this management node, releases all resources. :return: None
[ "Shuts", "down", "this", "management", "node", "releases", "all", "resources", ".", ":", "return", ":", "None" ]
def shutdown(self): """ Shuts down this management node, releases all resources. :return: None """ self.stop() self.presence_poller.unregister(self.presence_socket) for sock in self.sub_sockets.values(): self.poller.unregister(sock) self.prese...
[ "def", "shutdown", "(", "self", ")", ":", "self", ".", "stop", "(", ")", "self", ".", "presence_poller", ".", "unregister", "(", "self", ".", "presence_socket", ")", "for", "sock", "in", "self", ".", "sub_sockets", ".", "values", "(", ")", ":", "self",...
https://github.com/infinisql/infinisql/blob/6e858e142196e20b6779e1ee84c4a501e246c1f8/manager/infinisqlmgr/management/__init__.py#L575-L588
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/richtext.py
python
RichTextParagraph.__init__
(self, *args, **kwargs)
__init__(self, String text, RichTextObject parent=None, RichTextAttr paraStyle=None, RichTextAttr charStyle=None) -> RichTextParagraph This object represents a single paragraph (or in a straight text editor, a line).
__init__(self, String text, RichTextObject parent=None, RichTextAttr paraStyle=None, RichTextAttr charStyle=None) -> RichTextParagraph
[ "__init__", "(", "self", "String", "text", "RichTextObject", "parent", "=", "None", "RichTextAttr", "paraStyle", "=", "None", "RichTextAttr", "charStyle", "=", "None", ")", "-", ">", "RichTextParagraph" ]
def __init__(self, *args, **kwargs): """ __init__(self, String text, RichTextObject parent=None, RichTextAttr paraStyle=None, RichTextAttr charStyle=None) -> RichTextParagraph This object represents a single paragraph (or in a straight text editor, a line). """ ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_richtext", ".", "RichTextParagraph_swiginit", "(", "self", ",", "_richtext", ".", "new_RichTextParagraph", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L1972-L1980
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
PyLocale.GetPluralString
(*args, **kwargs)
return _gdi_.PyLocale_GetPluralString(*args, **kwargs)
GetPluralString(self, String origString, String origString2, size_t n, String domain=EmptyString) -> String
GetPluralString(self, String origString, String origString2, size_t n, String domain=EmptyString) -> String
[ "GetPluralString", "(", "self", "String", "origString", "String", "origString2", "size_t", "n", "String", "domain", "=", "EmptyString", ")", "-", ">", "String" ]
def GetPluralString(*args, **kwargs): """GetPluralString(self, String origString, String origString2, size_t n, String domain=EmptyString) -> String""" return _gdi_.PyLocale_GetPluralString(*args, **kwargs)
[ "def", "GetPluralString", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "PyLocale_GetPluralString", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L3256-L3258
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/cpu/reduce_sum.py
python
_reduce_sum_cpu
()
return
ReduceSum cpu register
ReduceSum cpu register
[ "ReduceSum", "cpu", "register" ]
def _reduce_sum_cpu(): """ReduceSum cpu register""" return
[ "def", "_reduce_sum_cpu", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/cpu/reduce_sum.py#L31-L33
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/bindings/samples/server/glfw.py
python
set_window_size_callback
(window, cbfun)
Sets the size callback for the specified window. Wrapper for: GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);
Sets the size callback for the specified window.
[ "Sets", "the", "size", "callback", "for", "the", "specified", "window", "." ]
def set_window_size_callback(window, cbfun): """ Sets the size callback for the specified window. Wrapper for: GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun); """ window_addr = ctypes.cast(ctypes.pointer(window), ctypes...
[ "def", "set_window_size_callback", "(", "window", ",", "cbfun", ")", ":", "window_addr", "=", "ctypes", ".", "cast", "(", "ctypes", ".", "pointer", "(", "window", ")", ",", "ctypes", ".", "POINTER", "(", "ctypes", ".", "c_long", ")", ")", ".", "contents"...
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/glfw.py#L1255-L1275
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/inspector_protocol/jinja2/lexer.py
python
Lexer.tokenize
(self, source, name=None, filename=None, state=None)
return TokenStream(self.wrap(stream, name, filename), name, filename)
Calls tokeniter + tokenize and wraps it in a token stream.
Calls tokeniter + tokenize and wraps it in a token stream.
[ "Calls", "tokeniter", "+", "tokenize", "and", "wraps", "it", "in", "a", "token", "stream", "." ]
def tokenize(self, source, name=None, filename=None, state=None): """Calls tokeniter + tokenize and wraps it in a token stream. """ stream = self.tokeniter(source, name, filename, state) return TokenStream(self.wrap(stream, name, filename), name, filename)
[ "def", "tokenize", "(", "self", ",", "source", ",", "name", "=", "None", ",", "filename", "=", "None", ",", "state", "=", "None", ")", ":", "stream", "=", "self", ".", "tokeniter", "(", "source", ",", "name", ",", "filename", ",", "state", ")", "re...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/lexer.py#L552-L556
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
util/style/sort_includes.py
python
SortIncludes.dump_blocks
(self, block_types)
return sorted(set(includes))
Merge includes of from several block types into one large block of sorted includes. This is useful when we have multiple include block types (e.g., swig includes) with the same priority.
Merge includes of from several block types into one large block of sorted includes. This is useful when we have multiple include block types (e.g., swig includes) with the same priority.
[ "Merge", "includes", "of", "from", "several", "block", "types", "into", "one", "large", "block", "of", "sorted", "includes", ".", "This", "is", "useful", "when", "we", "have", "multiple", "include", "block", "types", "(", "e", ".", "g", ".", "swig", "inc...
def dump_blocks(self, block_types): """Merge includes of from several block types into one large block of sorted includes. This is useful when we have multiple include block types (e.g., swig includes) with the same priority.""" includes = [] for block_type in block_type...
[ "def", "dump_blocks", "(", "self", ",", "block_types", ")", ":", "includes", "=", "[", "]", "for", "block_type", "in", "block_types", ":", "try", ":", "includes", "+=", "self", ".", "includes", "[", "block_type", "]", "except", "KeyError", ":", "pass", "...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/util/style/sort_includes.py#L193-L206
flexflow/FlexFlow
581fad8ba8d10a16a3102ee2b406b0319586df24
examples/python/onnx/resnet_pt.py
python
conv1x1
(in_planes: int, out_planes: int, stride: int = 1)
return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
1x1 convolution
1x1 convolution
[ "1x1", "convolution" ]
def conv1x1(in_planes: int, out_planes: int, stride: int = 1) -> nn.Conv2d: """1x1 convolution""" return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False)
[ "def", "conv1x1", "(", "in_planes", ":", "int", ",", "out_planes", ":", "int", ",", "stride", ":", "int", "=", "1", ")", "->", "nn", ".", "Conv2d", ":", "return", "nn", ".", "Conv2d", "(", "in_planes", ",", "out_planes", ",", "kernel_size", "=", "1",...
https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/examples/python/onnx/resnet_pt.py#L14-L16
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/flatnotebook.py
python
PageContainer.DeletePage
(self, page)
Delete the specified page from L{FlatNotebook}.
Delete the specified page from L{FlatNotebook}.
[ "Delete", "the", "specified", "page", "from", "L", "{", "FlatNotebook", "}", "." ]
def DeletePage(self, page): """ Delete the specified page from L{FlatNotebook}. """ book = self.GetParent() book.DeletePage(page) book.Refresh()
[ "def", "DeletePage", "(", "self", ",", "page", ")", ":", "book", "=", "self", ".", "GetParent", "(", ")", "book", ".", "DeletePage", "(", "page", ")", "book", ".", "Refresh", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/flatnotebook.py#L4243-L4248
pytorch/ELF
e851e786ced8d26cf470f08a6b9bf7e413fc63f7
src_py/rlpytorch/methods/policy_gradient.py
python
PolicyGradient._compute_policy_entropy_err
(self, pi, a)
return errs
Compute policy error and entropy error for a batch. Pass in ``min_prob`` to avoid ``Nan`` in logrithms. Returns: dict of ``logpi``: log policy ``policy_err``: polict error ``entropy_err``: entropy error
Compute policy error and entropy error for a batch.
[ "Compute", "policy", "error", "and", "entropy", "error", "for", "a", "batch", "." ]
def _compute_policy_entropy_err(self, pi, a): """Compute policy error and entropy error for a batch. Pass in ``min_prob`` to avoid ``Nan`` in logrithms. Returns: dict of ``logpi``: log policy ``policy_err``: polict error ``entropy_err``: entropy ...
[ "def", "_compute_policy_entropy_err", "(", "self", ",", "pi", ",", "a", ")", ":", "errs", "=", "{", "}", "if", "isinstance", "(", "pi", ",", "list", ")", ":", "# Action map, and we need compute the error one by one.", "for", "i", ",", "pix", "in", "enumerate",...
https://github.com/pytorch/ELF/blob/e851e786ced8d26cf470f08a6b9bf7e413fc63f7/src_py/rlpytorch/methods/policy_gradient.py#L81-L105
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/dashboard/dashboard/change_internal_only.py
python
ChangeInternalOnlyHandler._UpdateTest
(self, test_key_urlsafe, internal_only, cursor=None)
Updates the given TestMetadata and associated Row entities.
Updates the given TestMetadata and associated Row entities.
[ "Updates", "the", "given", "TestMetadata", "and", "associated", "Row", "entities", "." ]
def _UpdateTest(self, test_key_urlsafe, internal_only, cursor=None): """Updates the given TestMetadata and associated Row entities.""" test_key = ndb.Key(urlsafe=test_key_urlsafe) if not cursor: # First time updating for this TestMetadata. test_entity = test_key.get() if test_entity.intern...
[ "def", "_UpdateTest", "(", "self", ",", "test_key_urlsafe", ",", "internal_only", ",", "cursor", "=", "None", ")", ":", "test_key", "=", "ndb", ".", "Key", "(", "urlsafe", "=", "test_key_urlsafe", ")", "if", "not", "cursor", ":", "# First time updating for thi...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/change_internal_only.py#L152-L192
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
python
_MapFileToMsBuildSourceType
(source, rule_dependencies, extension_to_rule_name)
return (group, element)
Returns the group and element type of the source file. Arguments: source: The source file name. extension_to_rule_name: A dictionary mapping file extensions to rules. Returns: A pair of (group this file should be part of, the label of element)
Returns the group and element type of the source file.
[ "Returns", "the", "group", "and", "element", "type", "of", "the", "source", "file", "." ]
def _MapFileToMsBuildSourceType(source, rule_dependencies, extension_to_rule_name): """Returns the group and element type of the source file. Arguments: source: The source file name. extension_to_rule_name: A dictionary mapping file extensions to rules. Returns: ...
[ "def", "_MapFileToMsBuildSourceType", "(", "source", ",", "rule_dependencies", ",", "extension_to_rule_name", ")", ":", "_", ",", "ext", "=", "os", ".", "path", ".", "splitext", "(", "source", ")", "if", "ext", "in", "extension_to_rule_name", ":", "group", "="...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L2106-L2142
giuspen/cherrytree
84712f206478fcf9acf30174009ad28c648c6344
pygtk2/modules/core.py
python
CherryTree.nodes_add_from_basket_folder
(self, action)
Add Nodes Parsing a Basket Folder
Add Nodes Parsing a Basket Folder
[ "Add", "Nodes", "Parsing", "a", "Basket", "Folder" ]
def nodes_add_from_basket_folder(self, action): """Add Nodes Parsing a Basket Folder""" start_folder = os.path.join(os.path.expanduser('~'), ".kde", "share", "apps", "basket", "baskets") folderpath = support.dialog_folder_select(curr_folder=start_folder, parent=self.window) if not folder...
[ "def", "nodes_add_from_basket_folder", "(", "self", ",", "action", ")", ":", "start_folder", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "expanduser", "(", "'~'", ")", ",", "\".kde\"", ",", "\"share\"", ",", "\"apps\"", ",", "\"bask...
https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L969-L978
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/wheel.py
python
Wheel.tags
(self)
return itertools.product(self.py_version.split('.'), self.abi.split('.'), self.platform.split('.'))
List tags (py_version, abi, platform) supported by this wheel.
List tags (py_version, abi, platform) supported by this wheel.
[ "List", "tags", "(", "py_version", "abi", "platform", ")", "supported", "by", "this", "wheel", "." ]
def tags(self): '''List tags (py_version, abi, platform) supported by this wheel.''' return itertools.product(self.py_version.split('.'), self.abi.split('.'), self.platform.split('.'))
[ "def", "tags", "(", "self", ")", ":", "return", "itertools", ".", "product", "(", "self", ".", "py_version", ".", "split", "(", "'.'", ")", ",", "self", ".", "abi", ".", "split", "(", "'.'", ")", ",", "self", ".", "platform", ".", "split", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/wheel.py#L63-L67
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/distributions/normal.py
python
Normal.__init__
(self, loc, scale, validate_args=False, allow_nan_stats=True, name="Normal")
Construct Normal distributions with mean and stddev `loc` and `scale`. The parameters `loc` and `scale` must be shaped in a way that supports broadcasting (e.g. `loc + scale` is a valid operation). Args: loc: Floating point tensor; the means of the distribution(s). scale: Floating point tensor...
Construct Normal distributions with mean and stddev `loc` and `scale`.
[ "Construct", "Normal", "distributions", "with", "mean", "and", "stddev", "loc", "and", "scale", "." ]
def __init__(self, loc, scale, validate_args=False, allow_nan_stats=True, name="Normal"): """Construct Normal distributions with mean and stddev `loc` and `scale`. The parameters `loc` and `scale` must be shaped in a way that supports ...
[ "def", "__init__", "(", "self", ",", "loc", ",", "scale", ",", "validate_args", "=", "False", ",", "allow_nan_stats", "=", "True", ",", "name", "=", "\"Normal\"", ")", ":", "parameters", "=", "locals", "(", ")", "with", "ops", ".", "name_scope", "(", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/distributions/normal.py#L104-L146
projectchrono/chrono
92015a8a6f84ef63ac8206a74e54a676251dcc89
src/demos/python/chrono-tensorflow/PPO/train_serial.py
python
add_value
(trajectories, val_func)
Adds estimated value to all time steps of all trajectories Args: trajectories: as returned by run_policy() val_func: object with predict() method, takes observations and returns predicted state value Returns: None (mutates trajectories dictionary to add 'values')
Adds estimated value to all time steps of all trajectories
[ "Adds", "estimated", "value", "to", "all", "time", "steps", "of", "all", "trajectories" ]
def add_value(trajectories, val_func): """ Adds estimated value to all time steps of all trajectories Args: trajectories: as returned by run_policy() val_func: object with predict() method, takes observations and returns predicted state value Returns: None (mutates traj...
[ "def", "add_value", "(", "trajectories", ",", "val_func", ")", ":", "for", "trajectory", "in", "trajectories", ":", "observes", "=", "trajectory", "[", "'observes'", "]", "values", "=", "val_func", ".", "predict", "(", "observes", ")", "trajectory", "[", "'v...
https://github.com/projectchrono/chrono/blob/92015a8a6f84ef63ac8206a74e54a676251dcc89/src/demos/python/chrono-tensorflow/PPO/train_serial.py#L156-L170
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Menu.GetParent
(*args, **kwargs)
return _core_.Menu_GetParent(*args, **kwargs)
GetParent(self) -> Menu
GetParent(self) -> Menu
[ "GetParent", "(", "self", ")", "-", ">", "Menu" ]
def GetParent(*args, **kwargs): """GetParent(self) -> Menu""" return _core_.Menu_GetParent(*args, **kwargs)
[ "def", "GetParent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Menu_GetParent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12246-L12248
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
PhysicsTools/PythonAnalysis/python/rootplot/utilities.py
python
irootglob
(tdirectory, pathname)
Return an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch.
Return an iterator which yields the paths matching a pathname pattern.
[ "Return", "an", "iterator", "which", "yields", "the", "paths", "matching", "a", "pathname", "pattern", "." ]
def irootglob(tdirectory, pathname): """Return an iterator which yields the paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. """ if not has_glob_magic(pathname): if tdirectory.Get(pathname): yield pathname return dirn...
[ "def", "irootglob", "(", "tdirectory", ",", "pathname", ")", ":", "if", "not", "has_glob_magic", "(", "pathname", ")", ":", "if", "tdirectory", ".", "Get", "(", "pathname", ")", ":", "yield", "pathname", "return", "dirname", ",", "basename", "=", "os", "...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/PythonAnalysis/python/rootplot/utilities.py#L577-L598
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/base/ViewerCornerWidget.py
python
ViewerCornerWidget._setupCloseButton
(self, qobject)
Setup method for close button.
Setup method for close button.
[ "Setup", "method", "for", "close", "button", "." ]
def _setupCloseButton(self, qobject): """ Setup method for close button. """ qobject.setEnabled(False) qobject.clicked.connect(self._callbackCloseButton)
[ "def", "_setupCloseButton", "(", "self", ",", "qobject", ")", ":", "qobject", ".", "setEnabled", "(", "False", ")", "qobject", ".", "clicked", ".", "connect", "(", "self", ".", "_callbackCloseButton", ")" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/base/ViewerCornerWidget.py#L45-L50
nnrg/opennero
43e12a1bcba6e228639db3886fec1dc47ddc24cb
mods/Roomba/roomba.py
python
RoombaBrain.destroy
(self)
return True
called when the agent is destroyed
called when the agent is destroyed
[ "called", "when", "the", "agent", "is", "destroyed" ]
def destroy(self): """ called when the agent is destroyed """ self.time = 0 return True
[ "def", "destroy", "(", "self", ")", ":", "self", ".", "time", "=", "0", "return", "True" ]
https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Roomba/roomba.py#L59-L64
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/ogr.py
python
Geometry.SetMeasured
(self, *args)
return _ogr.Geometry_SetMeasured(self, *args)
r""" SetMeasured(Geometry self, int bMeasured) void OGR_G_SetMeasured(OGRGeometryH hGeom, int bIsMeasured) Add or remove the M coordinate dimension. This method adds or removes the explicit M coordinate dimension. Removing the M coordinate dimension of a geometry will r...
r""" SetMeasured(Geometry self, int bMeasured) void OGR_G_SetMeasured(OGRGeometryH hGeom, int bIsMeasured)
[ "r", "SetMeasured", "(", "Geometry", "self", "int", "bMeasured", ")", "void", "OGR_G_SetMeasured", "(", "OGRGeometryH", "hGeom", "int", "bIsMeasured", ")" ]
def SetMeasured(self, *args): r""" SetMeasured(Geometry self, int bMeasured) void OGR_G_SetMeasured(OGRGeometryH hGeom, int bIsMeasured) Add or remove the M coordinate dimension. This method adds or removes the explicit M coordinate dimension. Removing the M coo...
[ "def", "SetMeasured", "(", "self", ",", "*", "args", ")", ":", "return", "_ogr", ".", "Geometry_SetMeasured", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L7373-L7396
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/linalg.py
python
_system_check_dimensionally_valid
(a, b)
Check that AX=B style system input is dimensionally valid.
Check that AX=B style system input is dimensionally valid.
[ "Check", "that", "AX", "=", "B", "style", "system", "input", "is", "dimensionally", "valid", "." ]
def _system_check_dimensionally_valid(a, b): """ Check that AX=B style system input is dimensionally valid. """ raise NotImplementedError
[ "def", "_system_check_dimensionally_valid", "(", "a", ",", "b", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/targets/linalg.py#L1448-L1452
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/SConf.py
python
SConfBase._startup
(self)
Private method. Set up logstream, and set the environment variables necessary for a piped build
Private method. Set up logstream, and set the environment variables necessary for a piped build
[ "Private", "method", ".", "Set", "up", "logstream", "and", "set", "the", "environment", "variables", "necessary", "for", "a", "piped", "build" ]
def _startup(self): """Private method. Set up logstream, and set the environment variables necessary for a piped build """ global _ac_config_logs global sconf_global global SConfFS self.lastEnvFs = self.env.fs self.env.fs = SConfFS self._createDir...
[ "def", "_startup", "(", "self", ")", ":", "global", "_ac_config_logs", "global", "sconf_global", "global", "SConfFS", "self", ".", "lastEnvFs", "=", "self", ".", "env", ".", "fs", "self", ".", "env", ".", "fs", "=", "SConfFS", "self", ".", "_createDir", ...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/SConf.py#L736-L785
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
parserCtxt.parseSystemLiteral
(self)
return ret
parse an XML Literal [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
parse an XML Literal [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
[ "parse", "an", "XML", "Literal", "[", "11", "]", "SystemLiteral", "::", "=", "(", "[", "^", "]", "*", ")", "|", "(", "[", "^", "]", "*", ")" ]
def parseSystemLiteral(self): """parse an XML Literal [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'") """ ret = libxml2mod.xmlParseSystemLiteral(self._o) return ret
[ "def", "parseSystemLiteral", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlParseSystemLiteral", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L4674-L4678
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/agilepy/lib_base/classman.py
python
Attrsman.init_postload_external
(self)
Called after set state. Link external states.
Called after set state. Link external states.
[ "Called", "after", "set", "state", ".", "Link", "external", "states", "." ]
def init_postload_external(self): """ Called after set state. Link external states. """ # print 'Attrsman.init_postload_external',self._obj.get_ident() for attrconfig in self.get_configs(is_all=True): # print ' call',attrconfig.attrname,attrconfig.metatype ...
[ "def", "init_postload_external", "(", "self", ")", ":", "# print 'Attrsman.init_postload_external',self._obj.get_ident()", "for", "attrconfig", "in", "self", ".", "get_configs", "(", "is_all", "=", "True", ")", ":", "# print ' call',attrconfig.attrname,attrconfig.metatype", ...
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_base/classman.py#L2182-L2191
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/wheel.py
python
Wheel.__init__
(self, filename=None, sign=False, verify=False)
Initialise an instance using a (valid) filename.
Initialise an instance using a (valid) filename.
[ "Initialise", "an", "instance", "using", "a", "(", "valid", ")", "filename", "." ]
def __init__(self, filename=None, sign=False, verify=False): """ Initialise an instance using a (valid) filename. """ self.sign = sign self.should_verify = verify self.buildver = '' self.pyver = [PYVER] self.abi = ['none'] self.arch = ['any'] ...
[ "def", "__init__", "(", "self", ",", "filename", "=", "None", ",", "sign", "=", "False", ",", "verify", "=", "False", ")", ":", "self", ".", "sign", "=", "sign", "self", ".", "should_verify", "=", "verify", "self", ".", "buildver", "=", "''", "self",...
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/distlib/wheel.py#L145-L184
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/style_editor.py
python
StyleEditorBox.SheetExistOnDisk
(self, sheet_name)
return exists
Check if the given style sheet exists on disk @param sheet_name: style sheet name @return: bool
Check if the given style sheet exists on disk @param sheet_name: style sheet name @return: bool
[ "Check", "if", "the", "given", "style", "sheet", "exists", "on", "disk", "@param", "sheet_name", ":", "style", "sheet", "name", "@return", ":", "bool" ]
def SheetExistOnDisk(self, sheet_name): """Check if the given style sheet exists on disk @param sheet_name: style sheet name @return: bool """ path = self.GetStyleSheetPath(sheet_name) # User path syspath = self.GetStyleSheetPath(sheet_name, True) # System path e...
[ "def", "SheetExistOnDisk", "(", "self", ",", "sheet_name", ")", ":", "path", "=", "self", ".", "GetStyleSheetPath", "(", "sheet_name", ")", "# User path", "syspath", "=", "self", ".", "GetStyleSheetPath", "(", "sheet_name", ",", "True", ")", "# System path", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/style_editor.py#L329-L338
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/vis/gldraw.py
python
circle
(center,radius,res=0.01,filled=True)
Draws a 2D circle with the given center, radius, and angular resolution. If filled=true, it is drawn filled, otherwise, it is drawn as a wireframe.
Draws a 2D circle with the given center, radius, and angular resolution. If filled=true, it is drawn filled, otherwise, it is drawn as a wireframe.
[ "Draws", "a", "2D", "circle", "with", "the", "given", "center", "radius", "and", "angular", "resolution", ".", "If", "filled", "=", "true", "it", "is", "drawn", "filled", "otherwise", "it", "is", "drawn", "as", "a", "wireframe", "." ]
def circle(center,radius,res=0.01,filled=True): """Draws a 2D circle with the given center, radius, and angular resolution. If filled=true, it is drawn filled, otherwise, it is drawn as a wireframe.""" numdivs = int(math.ceil(radius*math.pi*2/res)) glNormal3f(0,0,1) if filled: glBegin(G...
[ "def", "circle", "(", "center", ",", "radius", ",", "res", "=", "0.01", ",", "filled", "=", "True", ")", ":", "numdivs", "=", "int", "(", "math", ".", "ceil", "(", "radius", "*", "math", ".", "pi", "*", "2", "/", "res", ")", ")", "glNormal3f", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/gldraw.py#L22-L36