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
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/roslaunch/src/roslaunch/loader.py
python
LoaderContext.add_remap
(self, remap)
Add a new remap setting to the context. if a remap already exists with the same from key, it will be removed @param remap: remap setting @type remap: (str, str)
Add a new remap setting to the context. if a remap already exists with the same from key, it will be removed
[ "Add", "a", "new", "remap", "setting", "to", "the", "context", ".", "if", "a", "remap", "already", "exists", "with", "the", "same", "from", "key", "it", "will", "be", "removed" ]
def add_remap(self, remap): """ Add a new remap setting to the context. if a remap already exists with the same from key, it will be removed @param remap: remap setting @type remap: (str, str) """ remap = [canonicalize_name(x) for x in remap] if ...
[ "def", "add_remap", "(", "self", ",", "remap", ")", ":", "remap", "=", "[", "canonicalize_name", "(", "x", ")", "for", "x", "in", "remap", "]", "if", "not", "remap", "[", "0", "]", "or", "not", "remap", "[", "1", "]", ":", "raise", "RLException", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/loader.py#L193-L212
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py
python
Panedwindow.pane
(self, pane, option=None, **kw)
return _val_or_dict(kw, self.tk.call, self._w, "pane", pane)
Query or modify the options of the specified pane. pane is either an integer index or the name of a managed subwindow. If kw is not given, returns a dict of the pane option values. If option is specified then the value for that option is returned. Otherwise, sets the options to the corr...
Query or modify the options of the specified pane.
[ "Query", "or", "modify", "the", "options", "of", "the", "specified", "pane", "." ]
def pane(self, pane, option=None, **kw): """Query or modify the options of the specified pane. pane is either an integer index or the name of a managed subwindow. If kw is not given, returns a dict of the pane option values. If option is specified then the value for that option is retur...
[ "def", "pane", "(", "self", ",", "pane", ",", "option", "=", "None", ",", "*", "*", "kw", ")", ":", "if", "option", "is", "not", "None", ":", "kw", "[", "option", "]", "=", "None", "return", "_val_or_dict", "(", "kw", ",", "self", ".", "tk", "....
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py#L964-L973
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/glcanvas.py
python
GLCanvas.__init__
(self, *args, **kwargs)
__init__(self, Window parent, int id=-1, int attribList=None, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=GLCanvasNameStr, Palette palette=wxNullPalette) -> GLCanvas
__init__(self, Window parent, int id=-1, int attribList=None, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=GLCanvasNameStr, Palette palette=wxNullPalette) -> GLCanvas
[ "__init__", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "int", "attribList", "=", "None", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "0", "String", "name", "=", "GLCanvasNameStr", "Pal...
def __init__(self, *args, **kwargs): """ __init__(self, Window parent, int id=-1, int attribList=None, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=GLCanvasNameStr, Palette palette=wxNullPalette) -> GLCanvas """ _glcanvas.GLCanvas...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_glcanvas", ".", "GLCanvas_swiginit", "(", "self", ",", "_glcanvas", ".", "new_GLCanvas", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "self", ".", "_setOOR...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/glcanvas.py#L100-L107
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/incubate/fleet/base/role_maker.py
python
MPIRoleMaker._get_size
(self)
return self._size
Return size.
Return size.
[ "Return", "size", "." ]
def _get_size(self): """Return size.""" self._size = self._comm.Get_size() return self._size
[ "def", "_get_size", "(", "self", ")", ":", "self", ".", "_size", "=", "self", ".", "_comm", ".", "Get_size", "(", ")", "return", "self", ".", "_size" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/incubate/fleet/base/role_maker.py#L211-L214
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/internal/pdbstructure.py
python
PdbStructure._finalize
(self)
Establish first and last residues, atoms, etc.
Establish first and last residues, atoms, etc.
[ "Establish", "first", "and", "last", "residues", "atoms", "etc", "." ]
def _finalize(self): """Establish first and last residues, atoms, etc.""" for model in self.models: model._finalize()
[ "def", "_finalize", "(", "self", ")", ":", "for", "model", "in", "self", ".", "models", ":", "model", ".", "_finalize", "(", ")" ]
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/internal/pdbstructure.py#L302-L305
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py
python
DependencyFinder.add_distribution
(self, dist)
Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add.
[]
def add_distribution(self, dist): """ Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. """ logger.debug('adding distribution %s', dist) name = dist.key self.dists...
[ "def", "add_distribution", "(", "self", ",", "dist", ")", ":", "logger", ".", "debug", "(", "'adding distribution %s'", ",", "dist", ")", "name", "=", "dist", ".", "key", "self", ".", "dists_by_name", "[", "name", "]", "=", "dist", "self", ".", "dists", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/locators.py#L2161-L2187
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/platform/android_platform_backend.py
python
AndroidPlatformBackend.PurgeUnpinnedMemory
(self)
Purges the unpinned ashmem memory for the whole system. This can be used to make memory measurements more stable in particular.
Purges the unpinned ashmem memory for the whole system.
[ "Purges", "the", "unpinned", "ashmem", "memory", "for", "the", "whole", "system", "." ]
def PurgeUnpinnedMemory(self): """Purges the unpinned ashmem memory for the whole system. This can be used to make memory measurements more stable in particular. """ android_prebuilt_profiler_helper.InstallOnDevice(self._adb, 'purge_ashmem') if self._adb.RunShellCommand( android_prebuilt_pr...
[ "def", "PurgeUnpinnedMemory", "(", "self", ")", ":", "android_prebuilt_profiler_helper", ".", "InstallOnDevice", "(", "self", ".", "_adb", ",", "'purge_ashmem'", ")", "if", "self", ".", "_adb", ".", "RunShellCommand", "(", "android_prebuilt_profiler_helper", ".", "G...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/platform/android_platform_backend.py#L129-L139
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvs.py
python
GenerateDSP
(dspfile, source, env)
Generates a Project file based on the version of MSVS that is being used
Generates a Project file based on the version of MSVS that is being used
[ "Generates", "a", "Project", "file", "based", "on", "the", "version", "of", "MSVS", "that", "is", "being", "used" ]
def GenerateDSP(dspfile, source, env): """Generates a Project file based on the version of MSVS that is being used""" version_num = 6.0 if 'MSVS_VERSION' in env: version_num, suite = msvs_parse_version(env['MSVS_VERSION']) if version_num >= 10.0: g = _GenerateV10DSP(dspfile, source, env...
[ "def", "GenerateDSP", "(", "dspfile", ",", "source", ",", "env", ")", ":", "version_num", "=", "6.0", "if", "'MSVS_VERSION'", "in", "env", ":", "version_num", ",", "suite", "=", "msvs_parse_version", "(", "env", "[", "'MSVS_VERSION'", "]", ")", "if", "vers...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/msvs.py#L1671-L1685
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/attrs/attr/validators.py
python
instance_of
(type)
return _InstanceOfValidator(type)
A validator that raises a `TypeError` if the initializer is called with a wrong type for this particular attribute (checks are performed using `isinstance` therefore it's also valid to pass a tuple of types). :param type: The type to check for. :type type: type or tuple of types :raises TypeError:...
A validator that raises a `TypeError` if the initializer is called with a wrong type for this particular attribute (checks are performed using `isinstance` therefore it's also valid to pass a tuple of types).
[ "A", "validator", "that", "raises", "a", "TypeError", "if", "the", "initializer", "is", "called", "with", "a", "wrong", "type", "for", "this", "particular", "attribute", "(", "checks", "are", "performed", "using", "isinstance", "therefore", "it", "s", "also", ...
def instance_of(type): """ A validator that raises a `TypeError` if the initializer is called with a wrong type for this particular attribute (checks are performed using `isinstance` therefore it's also valid to pass a tuple of types). :param type: The type to check for. :type type: type or tup...
[ "def", "instance_of", "(", "type", ")", ":", "return", "_InstanceOfValidator", "(", "type", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/attrs/attr/validators.py#L54-L67
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/util.py
python
display_path
(path)
return path
Gives the display value for a given path, making it relative to cwd if possible.
Gives the display value for a given path, making it relative to cwd if possible.
[ "Gives", "the", "display", "value", "for", "a", "given", "path", "making", "it", "relative", "to", "cwd", "if", "possible", "." ]
def display_path(path): """Gives the display value for a given path, making it relative to cwd if possible.""" path = os.path.normcase(os.path.abspath(path)) if path.startswith(os.getcwd() + os.path.sep): path = '.' + path[len(os.getcwd()):] return path
[ "def", "display_path", "(", "path", ")", ":", "path", "=", "os", ".", "path", ".", "normcase", "(", "os", ".", "path", ".", "abspath", "(", "path", ")", ")", "if", "path", ".", "startswith", "(", "os", ".", "getcwd", "(", ")", "+", "os", ".", "...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pip/util.py#L64-L70
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/blackduck_hub.py
python
BuildLoggerReportLogger.__init__
(self, build_logger)
Init logger.
Init logger.
[ "Init", "logger", "." ]
def __init__(self, build_logger): """Init logger.""" self.build_logger = build_logger self.build_id = self.build_logger.new_build_id("bdh")
[ "def", "__init__", "(", "self", ",", "build_logger", ")", ":", "self", ".", "build_logger", "=", "build_logger", "self", ".", "build_id", "=", "self", ".", "build_logger", ".", "new_build_id", "(", "\"bdh\"", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/blackduck_hub.py#L692-L696
HKUST-Aerial-Robotics/Fast-Planner
2ddd7793eecd573dbb5b47e2c985aa06606df3cf
uav_simulator/Utils/quadrotor_msgs/src/quadrotor_msgs/msg/_PPROutputData.py
python
PPROutputData.deserialize_numpy
(self, str, numpy)
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module
[ "unpack", "serialized", "message", "in", "str", "into", "this", "message", "instance", "using", "numpy", "for", "array", "types", ":", "param", "str", ":", "byte", "array", "of", "serialized", "message", "str", ":", "param", "numpy", ":", "numpy", "python", ...
def deserialize_numpy(self, str, numpy): """ unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module """ try: if self.header is None: self.header = std_msgs.msg.H...
[ "def", "deserialize_numpy", "(", "self", ",", "str", ",", "numpy", ")", ":", "try", ":", "if", "self", ".", "header", "is", "None", ":", "self", ".", "header", "=", "std_msgs", ".", "msg", ".", "Header", "(", ")", "end", "=", "0", "_x", "=", "sel...
https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/quadrotor_msgs/src/quadrotor_msgs/msg/_PPROutputData.py#L206-L238
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py
python
ParseBaseException.markInputline
( self, markerString = ">!<" )
return line_str.strip()
Extracts the exception line from the input string, and marks the location of the exception with a special symbol.
Extracts the exception line from the input string, and marks the location of the exception with a special symbol.
[ "Extracts", "the", "exception", "line", "from", "the", "input", "string", "and", "marks", "the", "location", "of", "the", "exception", "with", "a", "special", "symbol", "." ]
def markInputline( self, markerString = ">!<" ): """Extracts the exception line from the input string, and marks the location of the exception with a special symbol. """ line_str = self.line line_column = self.column - 1 if markerString: line_str = "".join(...
[ "def", "markInputline", "(", "self", ",", "markerString", "=", "\">!<\"", ")", ":", "line_str", "=", "self", ".", "line", "line_column", "=", "self", ".", "column", "-", "1", "if", "markerString", ":", "line_str", "=", "\"\"", ".", "join", "(", "(", "l...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/_vendor/pyparsing.py#L248-L257
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
ImmediateFunction.WriteCmdSet
(self, file)
Overridden from Function
Overridden from Function
[ "Overridden", "from", "Function" ]
def WriteCmdSet(self, file): """Overridden from Function""" self.type_handler.WriteImmediateCmdSet(self, file)
[ "def", "WriteCmdSet", "(", "self", ",", "file", ")", ":", "self", ".", "type_handler", ".", "WriteImmediateCmdSet", "(", "self", ",", "file", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/gpu/command_buffer/build_gles2_cmd_buffer.py#L5458-L5460
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/jinja2/ext.py
python
babel_extract
(fileobj, keywords, comment_tags, options)
Babel extraction method for Jinja templates. .. versionchanged:: 2.3 Basic support for translation comments was added. If `comment_tags` is now set to a list of keywords for extraction, the extractor will try to find the best preceeding comment that begins with one of the keywords. Fo...
Babel extraction method for Jinja templates.
[ "Babel", "extraction", "method", "for", "Jinja", "templates", "." ]
def babel_extract(fileobj, keywords, comment_tags, options): """Babel extraction method for Jinja templates. .. versionchanged:: 2.3 Basic support for translation comments was added. If `comment_tags` is now set to a list of keywords for extraction, the extractor will try to find the best...
[ "def", "babel_extract", "(", "fileobj", ",", "keywords", ",", "comment_tags", ",", "options", ")", ":", "extensions", "=", "set", "(", ")", "for", "extension", "in", "options", ".", "get", "(", "'extensions'", ",", "''", ")", ".", "split", "(", "','", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/ext.py#L540-L604
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
python
ConvertVCMacrosToMSBuild
(s)
return s
Convert the the MSVS macros found in the string to the MSBuild equivalent. This list is probably not exhaustive. Add as needed.
Convert the the MSVS macros found in the string to the MSBuild equivalent.
[ "Convert", "the", "the", "MSVS", "macros", "found", "in", "the", "string", "to", "the", "MSBuild", "equivalent", "." ]
def ConvertVCMacrosToMSBuild(s): """Convert the the MSVS macros found in the string to the MSBuild equivalent. This list is probably not exhaustive. Add as needed. """ if '$' in s: replace_map = { '$(ConfigurationName)': '$(Configuration)', '$(InputDir)': '%(RelativeDir)', '$(Input...
[ "def", "ConvertVCMacrosToMSBuild", "(", "s", ")", ":", "if", "'$'", "in", "s", ":", "replace_map", "=", "{", "'$(ConfigurationName)'", ":", "'$(Configuration)'", ",", "'$(InputDir)'", ":", "'%(RelativeDir)'", ",", "'$(InputExt)'", ":", "'%(Extension)'", ",", "'$(I...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py#L419-L439
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/math/optimize.py
python
OptimizationProblemBuilder.feasibilityTestsPassSymbolic
(self,soft=False)
return res
Returns a symbolic.Expression, over variables in self.context, that evaluates to True if the black-box feasibility constraints are met
Returns a symbolic.Expression, over variables in self.context, that evaluates to True if the black-box feasibility constraints are met
[ "Returns", "a", "symbolic", ".", "Expression", "over", "variables", "in", "self", ".", "context", "that", "evaluates", "to", "True", "if", "the", "black", "-", "box", "feasibility", "constraints", "are", "met" ]
def feasibilityTestsPassSymbolic(self,soft=False): """Returns a symbolic.Expression, over variables in self.context, that evaluates to True if the black-box feasibility constraints are met""" components = [] for obj in self.objectives: if obj == 'feas' and (not obj.soft or so...
[ "def", "feasibilityTestsPassSymbolic", "(", "self", ",", "soft", "=", "False", ")", ":", "components", "=", "[", "]", "for", "obj", "in", "self", ".", "objectives", ":", "if", "obj", "==", "'feas'", "and", "(", "not", "obj", ".", "soft", "or", "soft", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/optimize.py#L1106-L1118
savoirfairelinux/jami-daemon
7634487e9f568ae727f2d4cffbb735d23fa0324c
tools/jamictrl/controller.py
python
DRingCtrl.switchInput
(self, callid, inputName)
return self.callmanager.switchInput(callid, inputName)
switch to input if exist
switch to input if exist
[ "switch", "to", "input", "if", "exist" ]
def switchInput(self, callid, inputName): """switch to input if exist""" return self.callmanager.switchInput(callid, inputName)
[ "def", "switchInput", "(", "self", ",", "callid", ",", "inputName", ")", ":", "return", "self", ".", "callmanager", ".", "switchInput", "(", "callid", ",", "inputName", ")" ]
https://github.com/savoirfairelinux/jami-daemon/blob/7634487e9f568ae727f2d4cffbb735d23fa0324c/tools/jamictrl/controller.py#L691-L694
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/linear_model/omp.py
python
orthogonal_mp
(X, y, n_nonzero_coefs=None, tol=None, precompute=False, copy_X=True, return_path=False, return_n_iter=False)
Orthogonal Matching Pursuit (OMP) Solves n_targets Orthogonal Matching Pursuit problems. An instance of the problem has the form: When parametrized by the number of non-zero coefficients using `n_nonzero_coefs`: argmin ||y - X\gamma||^2 subject to ||\gamma||_0 <= n_{nonzero coefs} When parame...
Orthogonal Matching Pursuit (OMP)
[ "Orthogonal", "Matching", "Pursuit", "(", "OMP", ")" ]
def orthogonal_mp(X, y, n_nonzero_coefs=None, tol=None, precompute=False, copy_X=True, return_path=False, return_n_iter=False): """Orthogonal Matching Pursuit (OMP) Solves n_targets Orthogonal Matching Pursuit problems. An instance of the problem has the form: When ...
[ "def", "orthogonal_mp", "(", "X", ",", "y", ",", "n_nonzero_coefs", "=", "None", ",", "tol", "=", "None", ",", "precompute", "=", "False", ",", "copy_X", "=", "True", ",", "return_path", "=", "False", ",", "return_n_iter", "=", "False", ")", ":", "X", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/linear_model/omp.py#L269-L408
wesnoth/wesnoth
6ccac5a5e8ff75303c9190c0da60580925cb32c0
data/tools/wesnoth/trackplacer3/tmxfileformat.py
python
TmxFileFormat.__init__
(self, wesnoth_data_dir)
The data dir is the same as wesnoth's --data-dir argument. The data dir is only used for the journey marker images.
The data dir is the same as wesnoth's --data-dir argument.
[ "The", "data", "dir", "is", "the", "same", "as", "wesnoth", "s", "--", "data", "-", "dir", "argument", "." ]
def __init__(self, wesnoth_data_dir): """The data dir is the same as wesnoth's --data-dir argument. The data dir is only used for the journey marker images. """ self.wesnoth_data_dir = wesnoth_data_dir
[ "def", "__init__", "(", "self", ",", "wesnoth_data_dir", ")", ":", "self", ".", "wesnoth_data_dir", "=", "wesnoth_data_dir" ]
https://github.com/wesnoth/wesnoth/blob/6ccac5a5e8ff75303c9190c0da60580925cb32c0/data/tools/wesnoth/trackplacer3/tmxfileformat.py#L64-L69
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/libmintsmolecule.py
python
LibmintsMolecule.name
(self)
return self.PYname
Get molecule name >>> print(H2OH2O.name()) water_dimer
Get molecule name
[ "Get", "molecule", "name" ]
def name(self): """Get molecule name >>> print(H2OH2O.name()) water_dimer """ return self.PYname
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "PYname" ]
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsmolecule.py#L167-L174
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2.py
python
BaseRoute.match
(self, request)
Matches all routes against a request object. The first one that matches is returned. :param request: A :class:`Request` instance. :returns: A tuple ``(route, args, kwargs)`` if a route matched, or None.
Matches all routes against a request object.
[ "Matches", "all", "routes", "against", "a", "request", "object", "." ]
def match(self, request): """Matches all routes against a request object. The first one that matches is returned. :param request: A :class:`Request` instance. :returns: A tuple ``(route, args, kwargs)`` if a route matched, or None. """ raise NotI...
[ "def", "match", "(", "self", ",", "request", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2.py#L770-L780
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlAttr.freeProp
(self)
Free one attribute, all the content is freed too
Free one attribute, all the content is freed too
[ "Free", "one", "attribute", "all", "the", "content", "is", "freed", "too" ]
def freeProp(self): """Free one attribute, all the content is freed too """ libxml2mod.xmlFreeProp(self._o)
[ "def", "freeProp", "(", "self", ")", ":", "libxml2mod", ".", "xmlFreeProp", "(", "self", ".", "_o", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L5603-L5605
vnpy/vnpy
f50f2535ed39dd33272e0985ed40c7078e4c19f6
vnpy/trader/converter.py
python
OffsetConverter.is_convert_required
(self, vt_symbol: str)
Check if the contract needs offset convert.
Check if the contract needs offset convert.
[ "Check", "if", "the", "contract", "needs", "offset", "convert", "." ]
def is_convert_required(self, vt_symbol: str) -> bool: """ Check if the contract needs offset convert. """ contract = self.main_engine.get_contract(vt_symbol) # Only contracts with long-short position mode requires convert if not contract: return False ...
[ "def", "is_convert_required", "(", "self", ",", "vt_symbol", ":", "str", ")", "->", "bool", ":", "contract", "=", "self", ".", "main_engine", ".", "get_contract", "(", "vt_symbol", ")", "# Only contracts with long-short position mode requires convert", "if", "not", ...
https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/trader/converter.py#L86-L98
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/nn/utils/parametrize.py
python
ParametrizationList.right_inverse
(self, value: Tensor)
r"""Calls the methods ``right_inverse`` (see :func:`register_parametrization`) of the parametrizations in the inverse order they were registered in. Then, it stores the result in ``self.original`` if ``right_inverse`` outputs one tensor or in ``self.original0``, ``self.original1``, ... if it out...
r"""Calls the methods ``right_inverse`` (see :func:`register_parametrization`) of the parametrizations in the inverse order they were registered in. Then, it stores the result in ``self.original`` if ``right_inverse`` outputs one tensor or in ``self.original0``, ``self.original1``, ... if it out...
[ "r", "Calls", "the", "methods", "right_inverse", "(", "see", ":", "func", ":", "register_parametrization", ")", "of", "the", "parametrizations", "in", "the", "inverse", "order", "they", "were", "registered", "in", ".", "Then", "it", "stores", "the", "result", ...
def right_inverse(self, value: Tensor) -> None: r"""Calls the methods ``right_inverse`` (see :func:`register_parametrization`) of the parametrizations in the inverse order they were registered in. Then, it stores the result in ``self.original`` if ``right_inverse`` outputs one tensor or ...
[ "def", "right_inverse", "(", "self", ",", "value", ":", "Tensor", ")", "->", "None", ":", "# All the exceptions in this function should almost never throw.", "# They could throw if, for example, right_inverse function returns a different", "# dtype when given a different input, which sho...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/utils/parametrize.py#L196-L255
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/remove_strings.py
python
RemoveStrings
(grd_path, string_names)
Removes strings with the given names from a GRD file. Overwrites the file. Args: grd_path: path to the GRD file. string_names: a list of string names to be removed.
Removes strings with the given names from a GRD file. Overwrites the file.
[ "Removes", "strings", "with", "the", "given", "names", "from", "a", "GRD", "file", ".", "Overwrites", "the", "file", "." ]
def RemoveStrings(grd_path, string_names): """Removes strings with the given names from a GRD file. Overwrites the file. Args: grd_path: path to the GRD file. string_names: a list of string names to be removed. """ with open(grd_path, 'r') as f: grd = f.read() names_pattern = '|'.join(map(re.esca...
[ "def", "RemoveStrings", "(", "grd_path", ",", "string_names", ")", ":", "with", "open", "(", "grd_path", ",", "'r'", ")", "as", "f", ":", "grd", "=", "f", ".", "read", "(", ")", "names_pattern", "=", "'|'", ".", "join", "(", "map", "(", "re", ".", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/remove_strings.py#L13-L26
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/boost/grad_freeze.py
python
GradientFreeze.split_parameters_groups
(self, net, freeze_para_groups_number)
return freeze_grouped_params
r""" Split parameter groups for gradients freezing training. Args: net (Cell): The training network. freeze_para_groups_number (int): The number of gradient freeze groups.
r""" Split parameter groups for gradients freezing training.
[ "r", "Split", "parameter", "groups", "for", "gradients", "freezing", "training", "." ]
def split_parameters_groups(self, net, freeze_para_groups_number): r""" Split parameter groups for gradients freezing training. Args: net (Cell): The training network. freeze_para_groups_number (int): The number of gradient freeze groups. """ grouped_para...
[ "def", "split_parameters_groups", "(", "self", ",", "net", ",", "freeze_para_groups_number", ")", ":", "grouped_params", "=", "[", "]", "tmp", "=", "[", "]", "for", "para", "in", "net", ".", "trainable_params", "(", ")", ":", "name", "=", "para", ".", "n...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/boost/grad_freeze.py#L182-L207
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/waiter.py
python
Waiter.__init__
(self, name, config, operation_method)
:type name: string :param name: The name of the waiter :type config: botocore.waiter.SingleWaiterConfig :param config: The configuration for the waiter. :type operation_method: callable :param operation_method: A callable that accepts **kwargs and returns a response...
[]
def __init__(self, name, config, operation_method): """ :type name: string :param name: The name of the waiter :type config: botocore.waiter.SingleWaiterConfig :param config: The configuration for the waiter. :type operation_method: callable :param operation_me...
[ "def", "__init__", "(", "self", ",", "name", ",", "config", ",", "operation_method", ")", ":", "self", ".", "_operation_method", "=", "operation_method", "# The two attributes are exposed to allow for introspection", "# and documentation.", "self", ".", "name", "=", "na...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/waiter.py#L266-L285
google/skia
82d65d0487bd72f5f7332d002429ec2dc61d2463
infra/bots/assets/win_ninja/create.py
python
create_asset
(target_dir)
Create the asset.
Create the asset.
[ "Create", "the", "asset", "." ]
def create_asset(target_dir): """Create the asset.""" subprocess.check_call(["curl", "-L", URL % VERSION, "-o", "ninja-win.zip"]) subprocess.check_call(["unzip", "ninja-win.zip", "-d", target_dir]) subprocess.check_call(["rm", "ninja-win.zip"])
[ "def", "create_asset", "(", "target_dir", ")", ":", "subprocess", ".", "check_call", "(", "[", "\"curl\"", ",", "\"-L\"", ",", "URL", "%", "VERSION", ",", "\"-o\"", ",", "\"ninja-win.zip\"", "]", ")", "subprocess", ".", "check_call", "(", "[", "\"unzip\"", ...
https://github.com/google/skia/blob/82d65d0487bd72f5f7332d002429ec2dc61d2463/infra/bots/assets/win_ninja/create.py#L20-L24
goldeneye-source/ges-code
2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d
thirdparty/protobuf-2.3.0/python/google/protobuf/service_reflection.py
python
_ServiceBuilder.__init__
(self, service_descriptor)
Initializes an instance of the service class builder. Args: service_descriptor: ServiceDescriptor to use when constructing the service class.
Initializes an instance of the service class builder.
[ "Initializes", "an", "instance", "of", "the", "service", "class", "builder", "." ]
def __init__(self, service_descriptor): """Initializes an instance of the service class builder. Args: service_descriptor: ServiceDescriptor to use when constructing the service class. """ self.descriptor = service_descriptor
[ "def", "__init__", "(", "self", ",", "service_descriptor", ")", ":", "self", ".", "descriptor", "=", "service_descriptor" ]
https://github.com/goldeneye-source/ges-code/blob/2630cd8ef3d015af53c72ec2e19fc1f7e7fe8d9d/thirdparty/protobuf-2.3.0/python/google/protobuf/service_reflection.py#L124-L131
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/util/structure.py
python
get_flat_tensor_shapes
(element_spec)
return [spec.shape for spec in get_flat_tensor_specs(element_spec)]
Returns a list `tf.TensorShapes`s for the element tensor representation. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to element type specification. Returns: A list `tf.TensorShapes`s for the element tensor representation.
Returns a list `tf.TensorShapes`s for the element tensor representation.
[ "Returns", "a", "list", "tf", ".", "TensorShapes", "s", "for", "the", "element", "tensor", "representation", "." ]
def get_flat_tensor_shapes(element_spec): """Returns a list `tf.TensorShapes`s for the element tensor representation. Args: element_spec: A nested structure of `tf.TypeSpec` objects representing to element type specification. Returns: A list `tf.TensorShapes`s for the element tensor representation...
[ "def", "get_flat_tensor_shapes", "(", "element_spec", ")", ":", "return", "[", "spec", ".", "shape", "for", "spec", "in", "get_flat_tensor_specs", "(", "element_spec", ")", "]" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/data/util/structure.py#L269-L279
facebook/mysql-5.6
65a650660ec7b4d627d1b738f397252ff4706207
arcanist/lint/cpp_linter/cpplint.py
python
PrintUsage
(message)
Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message.
Prints a brief usage string and exits, optionally with an error message.
[ "Prints", "a", "brief", "usage", "string", "and", "exits", "optionally", "with", "an", "error", "message", "." ]
def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. Args: message: The optional error message. """ sys.stderr.write(_USAGE) if message: sys.exit('\nFATAL ERROR: ' + message) else: sys.exit(1)
[ "def", "PrintUsage", "(", "message", ")", ":", "sys", ".", "stderr", ".", "write", "(", "_USAGE", ")", "if", "message", ":", "sys", ".", "exit", "(", "'\\nFATAL ERROR: '", "+", "message", ")", "else", ":", "sys", ".", "exit", "(", "1", ")" ]
https://github.com/facebook/mysql-5.6/blob/65a650660ec7b4d627d1b738f397252ff4706207/arcanist/lint/cpp_linter/cpplint.py#L4659-L4669
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pubsub/core/topicdefnprovider.py
python
ITopicDefnDeserializer.resetIter
(self)
Called by the TopicDefnProvider if it needs to restart the topic iteration. Override this only if special action needed, such as resetting a file pointer to beginning of file.
Called by the TopicDefnProvider if it needs to restart the topic iteration. Override this only if special action needed, such as resetting a file pointer to beginning of file.
[ "Called", "by", "the", "TopicDefnProvider", "if", "it", "needs", "to", "restart", "the", "topic", "iteration", ".", "Override", "this", "only", "if", "special", "action", "needed", "such", "as", "resetting", "a", "file", "pointer", "to", "beginning", "of", "...
def resetIter(self): """Called by the TopicDefnProvider if it needs to restart the topic iteration. Override this only if special action needed, such as resetting a file pointer to beginning of file.""" pass
[ "def", "resetIter", "(", "self", ")", ":", "pass" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/topicdefnprovider.py#L95-L99
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/imaplib.py
python
IMAP4.login_cram_md5
(self, user, password)
return self.authenticate('CRAM-MD5', self._CRAM_MD5_AUTH)
Force use of CRAM-MD5 authentication. (typ, [data]) = <instance>.login_cram_md5(user, password)
Force use of CRAM-MD5 authentication.
[ "Force", "use", "of", "CRAM", "-", "MD5", "authentication", "." ]
def login_cram_md5(self, user, password): """ Force use of CRAM-MD5 authentication. (typ, [data]) = <instance>.login_cram_md5(user, password) """ self.user, self.password = user, password return self.authenticate('CRAM-MD5', self._CRAM_MD5_AUTH)
[ "def", "login_cram_md5", "(", "self", ",", "user", ",", "password", ")", ":", "self", ".", "user", ",", "self", ".", "password", "=", "user", ",", "password", "return", "self", ".", "authenticate", "(", "'CRAM-MD5'", ",", "self", ".", "_CRAM_MD5_AUTH", "...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/imaplib.py#L512-L518
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pprint.py
python
PrettyPrinter.__init__
(self, indent=1, width=80, depth=None, stream=None, *, compact=False)
Handle pretty printing operations onto a stream using a set of configured parameters. indent Number of spaces to indent for each level of nesting. width Attempted maximum number of columns in the output. depth The maximum depth to print out nested s...
Handle pretty printing operations onto a stream using a set of configured parameters.
[ "Handle", "pretty", "printing", "operations", "onto", "a", "stream", "using", "a", "set", "of", "configured", "parameters", "." ]
def __init__(self, indent=1, width=80, depth=None, stream=None, *, compact=False): """Handle pretty printing operations onto a stream using a set of configured parameters. indent Number of spaces to indent for each level of nesting. width Attemp...
[ "def", "__init__", "(", "self", ",", "indent", "=", "1", ",", "width", "=", "80", ",", "depth", "=", "None", ",", "stream", "=", "None", ",", "*", ",", "compact", "=", "False", ")", ":", "indent", "=", "int", "(", "indent", ")", "width", "=", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pprint.py#L99-L136
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/Jinja2/py2/jinja2/parser.py
python
Parser.fail_unknown_tag
(self, name, lineno=None)
return self._fail_ut_eof(name, self._end_token_stack, lineno)
Called if the parser encounters an unknown tag. Tries to fail with a human readable error message that could help to identify the problem.
Called if the parser encounters an unknown tag. Tries to fail with a human readable error message that could help to identify the problem.
[ "Called", "if", "the", "parser", "encounters", "an", "unknown", "tag", ".", "Tries", "to", "fail", "with", "a", "human", "readable", "error", "message", "that", "could", "help", "to", "identify", "the", "problem", "." ]
def fail_unknown_tag(self, name, lineno=None): """Called if the parser encounters an unknown tag. Tries to fail with a human readable error message that could help to identify the problem. """ return self._fail_ut_eof(name, self._end_token_stack, lineno)
[ "def", "fail_unknown_tag", "(", "self", ",", "name", ",", "lineno", "=", "None", ")", ":", "return", "self", ".", "_fail_ut_eof", "(", "name", ",", "self", ".", "_end_token_stack", ",", "lineno", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py2/jinja2/parser.py#L103-L108
glotzerlab/hoomd-blue
f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a
hoomd/hpmc/compute.py
python
SDF.sdf
(self)
return self._cpp_obj.sdf
(*N_bins*,) `numpy.ndarray` of `float`): :math:`s[i]` - The scale \ distribution function :math:`[\\mathrm{probability\\ density}]`. Attention: In MPI parallel execution, the array is available on rank 0 only. `sdf` is `None` on ranks >= 1.
(*N_bins*,) `numpy.ndarray` of `float`): :math:`s[i]` - The scale \ distribution function :math:`[\\mathrm{probability\\ density}]`.
[ "(", "*", "N_bins", "*", ")", "numpy", ".", "ndarray", "of", "float", ")", ":", ":", "math", ":", "s", "[", "i", "]", "-", "The", "scale", "\\", "distribution", "function", ":", "math", ":", "[", "\\\\", "mathrm", "{", "probability", "\\\\", "densi...
def sdf(self): """(*N_bins*,) `numpy.ndarray` of `float`): :math:`s[i]` - The scale \ distribution function :math:`[\\mathrm{probability\\ density}]`. Attention: In MPI parallel execution, the array is available on rank 0 only. `sdf` is `None` on ranks >= 1. """ ...
[ "def", "sdf", "(", "self", ")", ":", "self", ".", "_cpp_obj", ".", "compute", "(", "self", ".", "_simulation", ".", "timestep", ")", "return", "self", ".", "_cpp_obj", ".", "sdf" ]
https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/hpmc/compute.py#L186-L195
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
python/gtsam/utils/plot.py
python
plot_pose3
( fignum: int, pose: Pose3, axis_length: float = 0.1, P: np.ndarray = None, axis_labels: Iterable[str] = ("X axis", "Y axis", "Z axis"), )
return fig
Plot a 3D pose on given figure with given `axis_length`. Args: fignum: Integer representing the figure number to use for plotting. pose (gtsam.Pose3): 3D pose to be plotted. axis_length: The length of the camera axes. P: Marginal covariance matrix to plot the uncertainty of the esti...
Plot a 3D pose on given figure with given `axis_length`.
[ "Plot", "a", "3D", "pose", "on", "given", "figure", "with", "given", "axis_length", "." ]
def plot_pose3( fignum: int, pose: Pose3, axis_length: float = 0.1, P: np.ndarray = None, axis_labels: Iterable[str] = ("X axis", "Y axis", "Z axis"), ) -> plt.Figure: """ Plot a 3D pose on given figure with given `axis_length`. Args: fignum: Integer representing the figure numb...
[ "def", "plot_pose3", "(", "fignum", ":", "int", ",", "pose", ":", "Pose3", ",", "axis_length", ":", "float", "=", "0.1", ",", "P", ":", "np", ".", "ndarray", "=", "None", ",", "axis_labels", ":", "Iterable", "[", "str", "]", "=", "(", "\"X axis\"", ...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/python/gtsam/utils/plot.py#L390-L423
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_layers.py
python
convert_dense
(builder, layer, input_names, output_names, keras_layer)
Convert a dense layer from keras to coreml. Parameters keras_layer: layer ---------- A keras layer object. builder: NeuralNetworkBuilder A neural network builder object.
Convert a dense layer from keras to coreml.
[ "Convert", "a", "dense", "layer", "from", "keras", "to", "coreml", "." ]
def convert_dense(builder, layer, input_names, output_names, keras_layer): """Convert a dense layer from keras to coreml. Parameters keras_layer: layer ---------- A keras layer object. builder: NeuralNetworkBuilder A neural network builder object. """ # Get input and output...
[ "def", "convert_dense", "(", "builder", ",", "layer", ",", "input_names", ",", "output_names", ",", "keras_layer", ")", ":", "# Get input and output names", "input_name", ",", "output_name", "=", "(", "input_names", "[", "0", "]", ",", "output_names", "[", "0", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_layers.py#L136-L164
apiaryio/drafter
4634ebd07f6c6f257cc656598ccd535492fdfb55
tools/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.WritePchTargets
(self, pch_commands)
Writes make rules to compile prefix headers.
Writes make rules to compile prefix headers.
[ "Writes", "make", "rules", "to", "compile", "prefix", "headers", "." ]
def WritePchTargets(self, pch_commands): """Writes make rules to compile prefix headers.""" if not pch_commands: return for gch, lang_flag, lang, input in pch_commands: extra_flags = { 'c': '$(CFLAGS_C_$(BUILDTYPE))', 'cc': '$(CFLAGS_CC_$(BUILDTYPE))', 'm': '$(CFLAGS_C_$...
[ "def", "WritePchTargets", "(", "self", ",", "pch_commands", ")", ":", "if", "not", "pch_commands", ":", "return", "for", "gch", ",", "lang_flag", ",", "lang", ",", "input", "in", "pch_commands", ":", "extra_flags", "=", "{", "'c'", ":", "'$(CFLAGS_C_$(BUILDT...
https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/generator/make.py#L1293-L1323
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/sched.py
python
scheduler.enterabs
(self, time, priority, action, argument)
return event
Enter a new event in the queue at an absolute time. Returns an ID for the event which can be used to remove it, if necessary.
Enter a new event in the queue at an absolute time.
[ "Enter", "a", "new", "event", "in", "the", "queue", "at", "an", "absolute", "time", "." ]
def enterabs(self, time, priority, action, argument): """Enter a new event in the queue at an absolute time. Returns an ID for the event which can be used to remove it, if necessary. """ event = Event(time, priority, action, argument) heapq.heappush(self._queue, event) ...
[ "def", "enterabs", "(", "self", ",", "time", ",", "priority", ",", "action", ",", "argument", ")", ":", "event", "=", "Event", "(", "time", ",", "priority", ",", "action", ",", "argument", ")", "heapq", ".", "heappush", "(", "self", ".", "_queue", ",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/sched.py#L46-L55
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Qrnn.py
python
Qrnn.filter
(self, blob)
Sets the trained weights for each gate. The blob dimensions: - **BatchLength** is 1 - **BatchWidt**h is 3 * hidden_size (contains the weights for each of the three gates in the order: update, forget, output) - **Height** is window_size - **Wi...
Sets the trained weights for each gate. The blob dimensions:
[ "Sets", "the", "trained", "weights", "for", "each", "gate", ".", "The", "blob", "dimensions", ":" ]
def filter(self, blob): """Sets the trained weights for each gate. The blob dimensions: - **BatchLength** is 1 - **BatchWidt**h is 3 * hidden_size (contains the weights for each of the three gates in the order: update, forget, output) - **Height*...
[ "def", "filter", "(", "self", ",", "blob", ")", ":", "if", "not", "type", "(", "blob", ")", "is", "Blob", ".", "Blob", ":", "raise", "ValueError", "(", "'The `blob` must be neoml.Blob.'", ")", "self", ".", "_internal", ".", "set_filter", "(", "blob", "."...
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Qrnn.py#L259-L273
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/tools/build/src/tools/common.py
python
reset
()
Clear the module state. This is mainly for testing purposes. Note that this must be called _after_ resetting the module 'feature'.
Clear the module state. This is mainly for testing purposes. Note that this must be called _after_ resetting the module 'feature'.
[ "Clear", "the", "module", "state", ".", "This", "is", "mainly", "for", "testing", "purposes", ".", "Note", "that", "this", "must", "be", "called", "_after_", "resetting", "the", "module", "feature", "." ]
def reset (): """ Clear the module state. This is mainly for testing purposes. Note that this must be called _after_ resetting the module 'feature'. """ global __had_unspecified_value, __had_value, __declared_subfeature global __init_loc global __all_signatures, __debug_configuration, __show...
[ "def", "reset", "(", ")", ":", "global", "__had_unspecified_value", ",", "__had_value", ",", "__declared_subfeature", "global", "__init_loc", "global", "__all_signatures", ",", "__debug_configuration", ",", "__show_configuration", "# Stores toolsets without specified initializa...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/tools/common.py#L28-L72
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/backends/qtbackend.py
python
QtGLWindow.show
(self)
Restores from a previous hide call
Restores from a previous hide call
[ "Restores", "from", "a", "previous", "hide", "call" ]
def show(self): """Restores from a previous hide call""" QGLWidget.show(self) if self.initialized: #boot it back up again self.idlesleep(0) self.refresh()
[ "def", "show", "(", "self", ")", ":", "QGLWidget", ".", "show", "(", "self", ")", "if", "self", ".", "initialized", ":", "#boot it back up again", "self", ".", "idlesleep", "(", "0", ")", "self", ".", "refresh", "(", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/backends/qtbackend.py#L197-L203
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
utils/grid.py
python
MainWindow.__output_png_cb
(self, widget)
return
! Output PNG Callback @param self this object @param widget widget @return none
! Output PNG Callback
[ "!", "Output", "PNG", "Callback" ]
def __output_png_cb(self, widget): """! Output PNG Callback @param self this object @param widget widget @return none """ dialog = gtk.FileChooserDialog("Output Png", self.__window, gtk.FILE_CHOOSER_ACTION_SAVE, ("Save", 1)) ...
[ "def", "__output_png_cb", "(", "self", ",", "widget", ")", ":", "dialog", "=", "gtk", ".", "FileChooserDialog", "(", "\"Output Png\"", ",", "self", ".", "__window", ",", "gtk", ".", "FILE_CHOOSER_ACTION_SAVE", ",", "(", "\"Save\"", ",", "1", ")", ")", "sel...
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/utils/grid.py#L1591-L1603
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Window.GetGtkWidget
(*args, **kwargs)
return _core_.Window_GetGtkWidget(*args, **kwargs)
GetGtkWidget(self) -> long On wxGTK returns a pointer to the GtkWidget for this window as a long integer. On the other platforms this method returns zero.
GetGtkWidget(self) -> long
[ "GetGtkWidget", "(", "self", ")", "-", ">", "long" ]
def GetGtkWidget(*args, **kwargs): """ GetGtkWidget(self) -> long On wxGTK returns a pointer to the GtkWidget for this window as a long integer. On the other platforms this method returns zero. """ return _core_.Window_GetGtkWidget(*args, **kwargs)
[ "def", "GetGtkWidget", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_GetGtkWidget", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L11194-L11201
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/gtk/gizmos.py
python
TreeListCtrl.AddColumn
(*args, **kwargs)
return _gizmos.TreeListCtrl_AddColumn(*args, **kwargs)
AddColumn(self, String text, int width=DEFAULT_COL_WIDTH, int flag=ALIGN_LEFT, int image=-1, bool shown=True, bool edit=False)
AddColumn(self, String text, int width=DEFAULT_COL_WIDTH, int flag=ALIGN_LEFT, int image=-1, bool shown=True, bool edit=False)
[ "AddColumn", "(", "self", "String", "text", "int", "width", "=", "DEFAULT_COL_WIDTH", "int", "flag", "=", "ALIGN_LEFT", "int", "image", "=", "-", "1", "bool", "shown", "=", "True", "bool", "edit", "=", "False", ")" ]
def AddColumn(*args, **kwargs): """ AddColumn(self, String text, int width=DEFAULT_COL_WIDTH, int flag=ALIGN_LEFT, int image=-1, bool shown=True, bool edit=False) """ return _gizmos.TreeListCtrl_AddColumn(*args, **kwargs)
[ "def", "AddColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_AddColumn", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/gtk/gizmos.py#L555-L560
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/AutoCompleteWindow.py
python
AutoCompleteWindow.show_window
(self, comp_lists, index, complete, mode, userWantsWin)
Show the autocomplete list, bind events. If complete is True, complete the text, and if there is exactly one matching completion, don't open a list.
Show the autocomplete list, bind events. If complete is True, complete the text, and if there is exactly one matching completion, don't open a list.
[ "Show", "the", "autocomplete", "list", "bind", "events", ".", "If", "complete", "is", "True", "complete", "the", "text", "and", "if", "there", "is", "exactly", "one", "matching", "completion", "don", "t", "open", "a", "list", "." ]
def show_window(self, comp_lists, index, complete, mode, userWantsWin): """Show the autocomplete list, bind events. If complete is True, complete the text, and if there is exactly one matching completion, don't open a list.""" # Handle the start we already have self.completions, ...
[ "def", "show_window", "(", "self", ",", "comp_lists", ",", "index", ",", "complete", ",", "mode", ",", "userWantsWin", ")", ":", "# Handle the start we already have", "self", ".", "completions", ",", "self", ".", "morecompletions", "=", "comp_lists", "self", "."...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/AutoCompleteWindow.py#L149-L215
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/showbase/DistancePhasedNode.py
python
DistancePhasedNode.__deallocateId
(id)
Reuse abandoned ids.
Reuse abandoned ids.
[ "Reuse", "abandoned", "ids", "." ]
def __deallocateId(id): """ Reuse abandoned ids. """ DistancePhasedNode.__InstanceDeque.append(id)
[ "def", "__deallocateId", "(", "id", ")", ":", "DistancePhasedNode", ".", "__InstanceDeque", ".", "append", "(", "id", ")" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/DistancePhasedNode.py#L77-L81
jeog/TDAmeritradeAPI
91c738afd7d57b54f6231170bd64c2550fafd34d
python/tdma_api/get.py
python
UserPrincipalsGetter.return_connection_info
(self, return_connection_info)
Sets/changes if streamer connection info should be retrieved.
Sets/changes if streamer connection info should be retrieved.
[ "Sets", "/", "changes", "if", "streamer", "connection", "info", "should", "be", "retrieved", "." ]
def return_connection_info(self, return_connection_info): """Sets/changes if streamer connection info should be retrieved.""" clib.set_val(self._abi('ReturnConnectionInfo'), c_int, return_connection_info, self._obj)
[ "def", "return_connection_info", "(", "self", ",", "return_connection_info", ")", ":", "clib", ".", "set_val", "(", "self", ".", "_abi", "(", "'ReturnConnectionInfo'", ")", ",", "c_int", ",", "return_connection_info", ",", "self", ".", "_obj", ")" ]
https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/get.py#L1267-L1270
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/bindings/python/MythTV/dataheap.py
python
Video.importMetadata
(self, metadata, overwrite=False)
Imports data from a VideoMetadata object.
Imports data from a VideoMetadata object.
[ "Imports", "data", "from", "a", "VideoMetadata", "object", "." ]
def importMetadata(self, metadata, overwrite=False): """Imports data from a VideoMetadata object.""" def _allow_change(self, tag, overwrite): if overwrite: return True if self[tag] is None: return True if self[tag] == '': return True if tag in self._defaul...
[ "def", "importMetadata", "(", "self", ",", "metadata", ",", "overwrite", "=", "False", ")", ":", "def", "_allow_change", "(", "self", ",", "tag", ",", "overwrite", ")", ":", "if", "overwrite", ":", "return", "True", "if", "self", "[", "tag", "]", "is",...
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/dataheap.py#L1058-L1113
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/urllib/parse.py
python
Quoter.__init__
(self, safe)
safe: bytes object.
safe: bytes object.
[ "safe", ":", "bytes", "object", "." ]
def __init__(self, safe): """safe: bytes object.""" self.safe = _ALWAYS_SAFE.union(safe)
[ "def", "__init__", "(", "self", ",", "safe", ")", ":", "self", ".", "safe", "=", "_ALWAYS_SAFE", ".", "union", "(", "safe", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/urllib/parse.py#L805-L807
eric1688/sphinx
514317761b35c07eb9f36db55a1ff365c4a9f0bc
api/sphinxapi.py
python
SphinxClient.UpdateAttributes
( self, index, attrs, values, mva=False, ignorenonexistent=False )
return updated
Update given attribute values on given documents in given indexes. Returns amount of updated documents (0 or more) on success, or -1 on failure. 'attrs' must be a list of strings. 'values' must be a dict with int key (document ID) and list of int values (new attribute values). optional boolean parameter 'mva' ...
Update given attribute values on given documents in given indexes. Returns amount of updated documents (0 or more) on success, or -1 on failure.
[ "Update", "given", "attribute", "values", "on", "given", "documents", "in", "given", "indexes", ".", "Returns", "amount", "of", "updated", "documents", "(", "0", "or", "more", ")", "on", "success", "or", "-", "1", "on", "failure", "." ]
def UpdateAttributes ( self, index, attrs, values, mva=False, ignorenonexistent=False ): """ Update given attribute values on given documents in given indexes. Returns amount of updated documents (0 or more) on success, or -1 on failure. 'attrs' must be a list of strings. 'values' must be a dict with int key...
[ "def", "UpdateAttributes", "(", "self", ",", "index", ",", "attrs", ",", "values", ",", "mva", "=", "False", ",", "ignorenonexistent", "=", "False", ")", ":", "assert", "(", "isinstance", "(", "index", ",", "str", ")", ")", "assert", "(", "isinstance", ...
https://github.com/eric1688/sphinx/blob/514317761b35c07eb9f36db55a1ff365c4a9f0bc/api/sphinxapi.py#L991-L1064
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/json_format.py
python
_ConvertBool
(value, require_str)
return value
Convert a boolean value. Args: value: A scalar value to convert. require_str: If True, value must be a str. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed.
Convert a boolean value.
[ "Convert", "a", "boolean", "value", "." ]
def _ConvertBool(value, require_str): """Convert a boolean value. Args: value: A scalar value to convert. require_str: If True, value must be a str. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed. """ if require_str: if value == 'true': ret...
[ "def", "_ConvertBool", "(", "value", ",", "require_str", ")", ":", "if", "require_str", ":", "if", "value", "==", "'true'", ":", "return", "True", "elif", "value", "==", "'false'", ":", "return", "False", "else", ":", "raise", "ParseError", "(", "'Expected...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/json_format.py#L816-L839
Komnomnomnom/swigibpy
cfd307fdbfaffabc69a2dc037538d7e34a8b8daf
swigibpy.py
python
EClientSocketBase.reqOpenOrders
(self)
return _swigibpy.EClientSocketBase_reqOpenOrders(self)
reqOpenOrders(EClientSocketBase self)
reqOpenOrders(EClientSocketBase self)
[ "reqOpenOrders", "(", "EClientSocketBase", "self", ")" ]
def reqOpenOrders(self): """reqOpenOrders(EClientSocketBase self)""" return _swigibpy.EClientSocketBase_reqOpenOrders(self)
[ "def", "reqOpenOrders", "(", "self", ")", ":", "return", "_swigibpy", ".", "EClientSocketBase_reqOpenOrders", "(", "self", ")" ]
https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L1472-L1474
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/tools/build/src/build/project.py
python
ProjectRegistry.load
(self, jamfile_location)
return mname
Loads jamfile at the given location. After loading, project global file and jamfile needed by the loaded one will be loaded recursively. If the jamfile at that location is loaded already, does nothing. Returns the project module for the Jamfile.
Loads jamfile at the given location. After loading, project global file and jamfile needed by the loaded one will be loaded recursively. If the jamfile at that location is loaded already, does nothing. Returns the project module for the Jamfile.
[ "Loads", "jamfile", "at", "the", "given", "location", ".", "After", "loading", "project", "global", "file", "and", "jamfile", "needed", "by", "the", "loaded", "one", "will", "be", "loaded", "recursively", ".", "If", "the", "jamfile", "at", "that", "location"...
def load (self, jamfile_location): """Loads jamfile at the given location. After loading, project global file and jamfile needed by the loaded one will be loaded recursively. If the jamfile at that location is loaded already, does nothing. Returns the project module for the Jamfile.""" ...
[ "def", "load", "(", "self", ",", "jamfile_location", ")", ":", "assert", "isinstance", "(", "jamfile_location", ",", "basestring", ")", "absolute", "=", "os", ".", "path", ".", "join", "(", "os", ".", "getcwd", "(", ")", ",", "jamfile_location", ")", "ab...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/project.py#L132-L164
plumonito/dtslam
5994bb9cf7a11981b830370db206bceb654c085d
3rdparty/opencv-git/3rdparty/jinja2/lexer.py
python
Lexer.wrap
(self, stream, name=None, filename=None)
This is called with the stream as returned by `tokenize` and wraps every token in a :class:`Token` and converts the value.
This is called with the stream as returned by `tokenize` and wraps every token in a :class:`Token` and converts the value.
[ "This", "is", "called", "with", "the", "stream", "as", "returned", "by", "tokenize", "and", "wraps", "every", "token", "in", "a", ":", "class", ":", "Token", "and", "converts", "the", "value", "." ]
def wrap(self, stream, name=None, filename=None): """This is called with the stream as returned by `tokenize` and wraps every token in a :class:`Token` and converts the value. """ for lineno, token, value in stream: if token in ignored_tokens: continue ...
[ "def", "wrap", "(", "self", ",", "stream", ",", "name", "=", "None", ",", "filename", "=", "None", ")", ":", "for", "lineno", ",", "token", ",", "value", "in", "stream", ":", "if", "token", "in", "ignored_tokens", ":", "continue", "elif", "token", "=...
https://github.com/plumonito/dtslam/blob/5994bb9cf7a11981b830370db206bceb654c085d/3rdparty/opencv-git/3rdparty/jinja2/lexer.py#L548-L591
bumptop/BumpTop
466d23597a07ae738f4265262fa01087fc6e257c
trunk/win/Source/bin/jinja2/utils.py
python
internalcode
(f)
return f
Marks the function as internally used
Marks the function as internally used
[ "Marks", "the", "function", "as", "internally", "used" ]
def internalcode(f): """Marks the function as internally used""" internal_code.add(f.func_code) return f
[ "def", "internalcode", "(", "f", ")", ":", "internal_code", ".", "add", "(", "f", ".", "func_code", ")", "return", "f" ]
https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/utils.py#L135-L138
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/dcdreporter.py
python
DCDReporter.report
(self, simulation, state)
Generate a report. Parameters ---------- simulation : Simulation The Simulation to generate a report for state : State The current state of the simulation
Generate a report.
[ "Generate", "a", "report", "." ]
def report(self, simulation, state): """Generate a report. Parameters ---------- simulation : Simulation The Simulation to generate a report for state : State The current state of the simulation """ if self._dcd is None: self....
[ "def", "report", "(", "self", ",", "simulation", ",", "state", ")", ":", "if", "self", ".", "_dcd", "is", "None", ":", "self", ".", "_dcd", "=", "DCDFile", "(", "self", ".", "_out", ",", "simulation", ".", "topology", ",", "simulation", ".", "integra...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/dcdreporter.py#L91-L107
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/pep425tags.py
python
get_flag
(var, fallback, expected=True, warn=True)
return val == expected
Use a fallback method for determining SOABI flags if the needed config var is unset or unavailable.
Use a fallback method for determining SOABI flags if the needed config var is unset or unavailable.
[ "Use", "a", "fallback", "method", "for", "determining", "SOABI", "flags", "if", "the", "needed", "config", "var", "is", "unset", "or", "unavailable", "." ]
def get_flag(var, fallback, expected=True, warn=True): """Use a fallback method for determining SOABI flags if the needed config var is unset or unavailable.""" val = get_config_var(var) if val is None: if warn: log.debug("Config variable '%s' is unset, Python ABI tag may " ...
[ "def", "get_flag", "(", "var", ",", "fallback", ",", "expected", "=", "True", ",", "warn", "=", "True", ")", ":", "val", "=", "get_config_var", "(", "var", ")", "if", "val", "is", "None", ":", "if", "warn", ":", "log", ".", "debug", "(", "\"Config ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/pep425tags.py#L69-L78
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/function.py
python
_parse_kwargs_as_attrs
(func_name, **kwargs)
return attrs
Parses **kwargs into a node's attributes.
Parses **kwargs into a node's attributes.
[ "Parses", "**", "kwargs", "into", "a", "node", "s", "attributes", "." ]
def _parse_kwargs_as_attrs(func_name, **kwargs): """Parses **kwargs into a node's attributes.""" attrs = {} noinline = kwargs.pop("noinline", None) if noinline is not None: attrs["_noinline"] = attr_value_pb2.AttrValue(b=bool(noinline)) # For compatibility with previous behavior, Defun does not perform ...
[ "def", "_parse_kwargs_as_attrs", "(", "func_name", ",", "*", "*", "kwargs", ")", ":", "attrs", "=", "{", "}", "noinline", "=", "kwargs", ".", "pop", "(", "\"noinline\"", ",", "None", ")", "if", "noinline", "is", "not", "None", ":", "attrs", "[", "\"_no...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/function.py#L1199-L1237
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/six.py
python
_SixMetaPathImporter.get_code
(self, fullname)
return None
Return None Required, if is_package is implemented
Return None
[ "Return", "None" ]
def get_code(self, fullname): """Return None Required, if is_package is implemented""" self.__get_module(fullname) # eventually raises ImportError return None
[ "def", "get_code", "(", "self", ",", "fullname", ")", ":", "self", ".", "__get_module", "(", "fullname", ")", "# eventually raises ImportError", "return", "None" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pkg_resources/_vendor/six.py#L218-L223
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Source/build/scripts/name_utilities.py
python
lower_first
(name)
return name[0].lower() + name[1:]
Return name with first letter or initial acronym lowercased. E.g., 'SetURL' becomes 'setURL', but 'URLFoo' becomes 'urlFoo'.
Return name with first letter or initial acronym lowercased.
[ "Return", "name", "with", "first", "letter", "or", "initial", "acronym", "lowercased", "." ]
def lower_first(name): """Return name with first letter or initial acronym lowercased. E.g., 'SetURL' becomes 'setURL', but 'URLFoo' becomes 'urlFoo'. """ for acronym in ACRONYMS: if name.startswith(acronym): return name.replace(acronym, acronym.lower(), 1) return name[0].lower(...
[ "def", "lower_first", "(", "name", ")", ":", "for", "acronym", "in", "ACRONYMS", ":", "if", "name", ".", "startswith", "(", "acronym", ")", ":", "return", "name", ".", "replace", "(", "acronym", ",", "acronym", ".", "lower", "(", ")", ",", "1", ")", ...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/build/scripts/name_utilities.py#L50-L58
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/twitter.py
python
Api.DestroyStatus
(self, id)
return Status.NewFromJsonDict(data)
Destroys the status specified by the required ID parameter. The twitter.Api instance must be authenticated and thee authenticating user must be the author of the specified status. Args: id: The numerical ID of the status you're trying to destroy. Returns: A twitter.Status instance represe...
Destroys the status specified by the required ID parameter.
[ "Destroys", "the", "status", "specified", "by", "the", "required", "ID", "parameter", "." ]
def DestroyStatus(self, id): '''Destroys the status specified by the required ID parameter. The twitter.Api instance must be authenticated and thee authenticating user must be the author of the specified status. Args: id: The numerical ID of the status you're trying to destroy. Returns: ...
[ "def", "DestroyStatus", "(", "self", ",", "id", ")", ":", "try", ":", "if", "id", ":", "int", "(", "id", ")", "except", ":", "raise", "TwitterError", "(", "\"id must be an integer\"", ")", "url", "=", "'http://twitter.com/statuses/destroy/%s.json'", "%", "id",...
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/twitter.py#L1015-L1035
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/cherry-pickup.py
python
Solution.cherryPickup
(self, grid)
return max(dp[n-1][n-1], 0)
:type grid: List[List[int]] :rtype: int
:type grid: List[List[int]] :rtype: int
[ ":", "type", "grid", ":", "List", "[", "List", "[", "int", "]]", ":", "rtype", ":", "int" ]
def cherryPickup(self, grid): """ :type grid: List[List[int]] :rtype: int """ # dp holds the max # of cherries two k-length paths can pickup. # The two k-length paths arrive at (i, k - i) and (j, k - j), # respectively. n = len(grid) dp = [[-1 for ...
[ "def", "cherryPickup", "(", "self", ",", "grid", ")", ":", "# dp holds the max # of cherries two k-length paths can pickup.", "# The two k-length paths arrive at (i, k - i) and (j, k - j),", "# respectively.", "n", "=", "len", "(", "grid", ")", "dp", "=", "[", "[", "-", "...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/cherry-pickup.py#L5-L33
ZhouWeikuan/DouDiZhu
0d84ff6c0bc54dba6ae37955de9ae9307513dc99
code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py
python
Cursor.canonical
(self)
return self._canonical
Return the canonical Cursor corresponding to this Cursor. The canonical cursor is the cursor which is representative for the underlying entity. For example, if you have multiple forward declarations for the same class, the canonical cursor for the forward declarations will be identical.
Return the canonical Cursor corresponding to this Cursor.
[ "Return", "the", "canonical", "Cursor", "corresponding", "to", "this", "Cursor", "." ]
def canonical(self): """Return the canonical Cursor corresponding to this Cursor. The canonical cursor is the cursor which is representative for the underlying entity. For example, if you have multiple forward declarations for the same class, the canonical cursor for the forward ...
[ "def", "canonical", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_canonical'", ")", ":", "self", ".", "_canonical", "=", "conf", ".", "lib", ".", "clang_getCanonicalCursor", "(", "self", ")", "return", "self", ".", "_canonical" ]
https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1161-L1172
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
storage/ndb/mcc/clusterhost.py
python
LocalClusterHost.open
(self, filename, mode='r')
return open(filename, mode)
Open a file on ABClusterHost.
Open a file on ABClusterHost.
[ "Open", "a", "file", "on", "ABClusterHost", "." ]
def open(self, filename, mode='r'): """Open a file on ABClusterHost.""" return open(filename, mode)
[ "def", "open", "(", "self", ",", "filename", ",", "mode", "=", "'r'", ")", ":", "return", "open", "(", "filename", ",", "mode", ")" ]
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/storage/ndb/mcc/clusterhost.py#L426-L428
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/logging/__init__.py
python
Handler.acquire
(self)
Acquire the I/O thread lock.
Acquire the I/O thread lock.
[ "Acquire", "the", "I", "/", "O", "thread", "lock", "." ]
def acquire(self): """ Acquire the I/O thread lock. """ if self.lock: self.lock.acquire()
[ "def", "acquire", "(", "self", ")", ":", "if", "self", ".", "lock", ":", "self", ".", "lock", ".", "acquire", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/logging/__init__.py#L693-L698
alibaba/MNN
c4d9566171d589c3ded23aa18ffb197016995a12
pymnn/pip_package/MNN/expr/__init__.py
python
squeeze
(x, axes=[])
return _F.squeeze(x, axes)
squeeze(x, axes=[]) Remove the `1` from the dimensions of `x` by `axes`. Parameters ---------- x : var_like, input value. axes : axis_like, input value. Default is []. Returns ------- squeeze_res : Var. Example: ------- >>> expr.squeeze([[[1.0, 2.0]]], [0, 1]) var([1.,...
squeeze(x, axes=[]) Remove the `1` from the dimensions of `x` by `axes`.
[ "squeeze", "(", "x", "axes", "=", "[]", ")", "Remove", "the", "1", "from", "the", "dimensions", "of", "x", "by", "axes", "." ]
def squeeze(x, axes=[]): ''' squeeze(x, axes=[]) Remove the `1` from the dimensions of `x` by `axes`. Parameters ---------- x : var_like, input value. axes : axis_like, input value. Default is []. Returns ------- squeeze_res : Var. Example: ------- >>> expr.squeeze...
[ "def", "squeeze", "(", "x", ",", "axes", "=", "[", "]", ")", ":", "x", "=", "_to_var", "(", "x", ")", "axes", "=", "_to_axis", "(", "axes", ")", "return", "_F", ".", "squeeze", "(", "x", ",", "axes", ")" ]
https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L2719-L2740
9miao/CrossApp
1f5375e061bf69841eb19728598f5ae3f508d620
tools/bindings-generator/clang/cindex.py
python
TranslationUnit.get_file
(self, filename)
return File.from_name(self, filename)
Obtain a File from this translation unit.
Obtain a File from this translation unit.
[ "Obtain", "a", "File", "from", "this", "translation", "unit", "." ]
def get_file(self, filename): """Obtain a File from this translation unit.""" return File.from_name(self, filename)
[ "def", "get_file", "(", "self", ",", "filename", ")", ":", "return", "File", ".", "from_name", "(", "self", ",", "filename", ")" ]
https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/clang/cindex.py#L2294-L2297
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/stub.py
python
Stubber.__init__
(self, client)
:param client: The client to add your stubs to.
:param client: The client to add your stubs to.
[ ":", "param", "client", ":", "The", "client", "to", "add", "your", "stubs", "to", "." ]
def __init__(self, client): """ :param client: The client to add your stubs to. """ self.client = client self._event_id = 'boto_stubber' self._expected_params_event_id = 'boto_stubber_expected_params' self._queue = deque()
[ "def", "__init__", "(", "self", ",", "client", ")", ":", "self", ".", "client", "=", "client", "self", ".", "_event_id", "=", "'boto_stubber'", "self", ".", "_expected_params_event_id", "=", "'boto_stubber_expected_params'", "self", ".", "_queue", "=", "deque", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/botocore/stub.py#L162-L169
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/google/protobuf/message_factory.py
python
MessageFactory.GetMessages
(self, files)
return result
Gets all the messages from a specified file. This will find and resolve dependencies, failing if the descriptor pool cannot satisfy them. Args: files: The file names to extract messages from. Returns: A dictionary mapping proto names to the message classes. This will include any dep...
Gets all the messages from a specified file.
[ "Gets", "all", "the", "messages", "from", "a", "specified", "file", "." ]
def GetMessages(self, files): """Gets all the messages from a specified file. This will find and resolve dependencies, failing if the descriptor pool cannot satisfy them. Args: files: The file names to extract messages from. Returns: A dictionary mapping proto names to the message cla...
[ "def", "GetMessages", "(", "self", ",", "files", ")", ":", "result", "=", "{", "}", "for", "file_name", "in", "files", ":", "file_desc", "=", "self", ".", "pool", ".", "FindFileByName", "(", "file_name", ")", "for", "name", ",", "msg", "in", "file_desc...
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/message_factory.py#L97-L136
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/v1/all_reduce.py
python
_build_shuffle_gather
(input_tensors, gather_devices, red_op, un_op=None)
return reduced_shards
Construct the gather (concentrate and reduce) phase of shuffle all-reduce. Args: input_tensors: list of `tf.Tensor` values to be reduced. gather_devices: list of names of devices on which reduction shards should be placed. red_op: the binary reduction Op un_op: optional elementwise unary Op to ...
Construct the gather (concentrate and reduce) phase of shuffle all-reduce.
[ "Construct", "the", "gather", "(", "concentrate", "and", "reduce", ")", "phase", "of", "shuffle", "all", "-", "reduce", "." ]
def _build_shuffle_gather(input_tensors, gather_devices, red_op, un_op=None): """Construct the gather (concentrate and reduce) phase of shuffle all-reduce. Args: input_tensors: list of `tf.Tensor` values to be reduced. gather_devices: list of names of devices on which reduction shards should be place...
[ "def", "_build_shuffle_gather", "(", "input_tensors", ",", "gather_devices", ",", "red_op", ",", "un_op", "=", "None", ")", ":", "num_source_devices", "=", "len", "(", "input_tensors", ")", "num_gather_devices", "=", "len", "(", "gather_devices", ")", "shape", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/v1/all_reduce.py#L588-L622
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/types.py
python
SphericalCamera.pixel_bearing_many
(self, pixels)
return np.column_stack([x, y, z]).astype(float)
Unit vector pointing to the pixel viewing directions.
Unit vector pointing to the pixel viewing directions.
[ "Unit", "vector", "pointing", "to", "the", "pixel", "viewing", "directions", "." ]
def pixel_bearing_many(self, pixels): """Unit vector pointing to the pixel viewing directions.""" lon = pixels[:, 0] * 2 * np.pi lat = -pixels[:, 1] * 2 * np.pi x = np.cos(lat) * np.sin(lon) y = -np.sin(lat) z = np.cos(lat) * np.cos(lon) return np.column_stack([x,...
[ "def", "pixel_bearing_many", "(", "self", ",", "pixels", ")", ":", "lon", "=", "pixels", "[", ":", ",", "0", "]", "*", "2", "*", "np", ".", "pi", "lat", "=", "-", "pixels", "[", ":", ",", "1", "]", "*", "2", "*", "np", ".", "pi", "x", "=", ...
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/types.py#L575-L582
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variable_scope.py
python
variable_creator_scope_v1
(variable_creator)
Scope which defines a variable creation function to be used by variable(). variable_creator is expected to be a function with the following signature: ``` def variable_creator(next_creator, **kwargs) ``` The creator is supposed to eventually call the next_creator to create a variable if it does want to...
Scope which defines a variable creation function to be used by variable().
[ "Scope", "which", "defines", "a", "variable", "creation", "function", "to", "be", "used", "by", "variable", "()", "." ]
def variable_creator_scope_v1(variable_creator): """Scope which defines a variable creation function to be used by variable(). variable_creator is expected to be a function with the following signature: ``` def variable_creator(next_creator, **kwargs) ``` The creator is supposed to eventually call the ...
[ "def", "variable_creator_scope_v1", "(", "variable_creator", ")", ":", "with", "ops", ".", "get_default_graph", "(", ")", ".", "_variable_creator_scope", "(", "variable_creator", ")", ":", "# pylint: disable=protected-access", "yield" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variable_scope.py#L2570-L2639
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/build/android/pylib/fake_dns.py
python
FakeDns.__init__
(self, adb, build_type)
Args: adb: the AndroidCommands to use. build_type: 'Release' or 'Debug'.
Args: adb: the AndroidCommands to use. build_type: 'Release' or 'Debug'.
[ "Args", ":", "adb", ":", "the", "AndroidCommands", "to", "use", ".", "build_type", ":", "Release", "or", "Debug", "." ]
def __init__(self, adb, build_type): """ Args: adb: the AndroidCommands to use. build_type: 'Release' or 'Debug'. """ self._adb = adb self._build_type = build_type self._fake_dns = None self._original_dns = None
[ "def", "__init__", "(", "self", ",", "adb", ",", "build_type", ")", ":", "self", ".", "_adb", "=", "adb", "self", ".", "_build_type", "=", "build_type", "self", ".", "_fake_dns", "=", "None", "self", ".", "_original_dns", "=", "None" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/pylib/fake_dns.py#L17-L26
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/tools/clang/bindings/python/clang/cindex.py
python
Cursor.is_default_constructor
(self)
return conf.lib.clang_CXXConstructor_isDefaultConstructor(self)
Returns True if the cursor refers to a C++ default constructor.
Returns True if the cursor refers to a C++ default constructor.
[ "Returns", "True", "if", "the", "cursor", "refers", "to", "a", "C", "++", "default", "constructor", "." ]
def is_default_constructor(self): """Returns True if the cursor refers to a C++ default constructor. """ return conf.lib.clang_CXXConstructor_isDefaultConstructor(self)
[ "def", "is_default_constructor", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_CXXConstructor_isDefaultConstructor", "(", "self", ")" ]
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L1457-L1460
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/parameters/InputParameters.py
python
InputParameters.__contains__
(self, name)
return name in self.__parameters
Allows keys to be tested via "in" keyword.
Allows keys to be tested via "in" keyword.
[ "Allows", "keys", "to", "be", "tested", "via", "in", "keyword", "." ]
def __contains__(self, name): """ Allows keys to be tested via "in" keyword. """ return name in self.__parameters
[ "def", "__contains__", "(", "self", ",", "name", ")", ":", "return", "name", "in", "self", ".", "__parameters" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/parameters/InputParameters.py#L65-L69
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py
python
Variable.trace_vinfo
(self)
return [self._tk.splitlist(x) for x in self._tk.splitlist( self._tk.call("trace", "vinfo", self._name))]
Return all trace callback information. This deprecated method wraps a deprecated Tcl method that will likely be removed in the future. Use trace_info() instead.
Return all trace callback information.
[ "Return", "all", "trace", "callback", "information", "." ]
def trace_vinfo(self): """Return all trace callback information. This deprecated method wraps a deprecated Tcl method that will likely be removed in the future. Use trace_info() instead. """ # TODO: Add deprecation warning return [self._tk.splitlist(x) for x in self._tk...
[ "def", "trace_vinfo", "(", "self", ")", ":", "# TODO: Add deprecation warning", "return", "[", "self", ".", "_tk", ".", "splitlist", "(", "x", ")", "for", "x", "in", "self", ".", "_tk", ".", "splitlist", "(", "self", ".", "_tk", ".", "call", "(", "\"tr...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L448-L456
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pydoc.py
python
Doc.fail
(self, object, name=None, *args)
Raise an exception for unimplemented types.
Raise an exception for unimplemented types.
[ "Raise", "an", "exception", "for", "unimplemented", "types", "." ]
def fail(self, object, name=None, *args): """Raise an exception for unimplemented types.""" message = "don't know how to document object%s of type %s" % ( name and ' ' + repr(name), type(object).__name__) raise TypeError(message)
[ "def", "fail", "(", "self", ",", "object", ",", "name", "=", "None", ",", "*", "args", ")", ":", "message", "=", "\"don't know how to document object%s of type %s\"", "%", "(", "name", "and", "' '", "+", "repr", "(", "name", ")", ",", "type", "(", "objec...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pydoc.py#L394-L398
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/cli/debugger_cli_common.py
python
MenuItem.__init__
(self, caption, content, enabled=True)
Menu constructor. TODO(cais): Nested menu is currently not supported. Support it. Args: caption: (str) caption of the menu item. content: Content of the menu item. For a menu item that triggers a command, for example, content is the command string. enabled: (bool) whether this menu i...
Menu constructor.
[ "Menu", "constructor", "." ]
def __init__(self, caption, content, enabled=True): """Menu constructor. TODO(cais): Nested menu is currently not supported. Support it. Args: caption: (str) caption of the menu item. content: Content of the menu item. For a menu item that triggers a command, for example, content is th...
[ "def", "__init__", "(", "self", ",", "caption", ",", "content", ",", "enabled", "=", "True", ")", ":", "self", ".", "_caption", "=", "caption", "self", ".", "_content", "=", "content", "self", ".", "_enabled", "=", "enabled" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/debugger_cli_common.py#L1109-L1123
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/dir_util.py
python
copy_tree
(src, dst, preserve_mode=1, preserve_times=1, preserve_symlinks=0, update=0, verbose=1, dry_run=0)
return outputs
Copy an entire directory tree 'src' to a new location 'dst'. Both 'src' and 'dst' must be directory names. If 'src' is not a directory, raise DistutilsFileError. If 'dst' does not exist, it is created with 'mkpath()'. The end result of the copy is that every file in 'src' is copied to 'dst', and dir...
Copy an entire directory tree 'src' to a new location 'dst'.
[ "Copy", "an", "entire", "directory", "tree", "src", "to", "a", "new", "location", "dst", "." ]
def copy_tree(src, dst, preserve_mode=1, preserve_times=1, preserve_symlinks=0, update=0, verbose=1, dry_run=0): """Copy an entire directory tree 'src' to a new location 'dst'. Both 'src' and 'dst' must be directory names. If 'src' is not a directory, raise DistutilsFileError. If 'dst' does...
[ "def", "copy_tree", "(", "src", ",", "dst", ",", "preserve_mode", "=", "1", ",", "preserve_times", "=", "1", ",", "preserve_symlinks", "=", "0", ",", "update", "=", "0", ",", "verbose", "=", "1", ",", "dry_run", "=", "0", ")", ":", "from", "distutils...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/distutils/dir_util.py#L99-L166
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/dtr/dtr.py
python
eviction_threshold
(mod)
return _eviction_threshold
r"""Get or set the eviction threshold in bytes. It can also be set to a string, whose formatting supports byte(B), kilobyte(KB), megabyte(MB) and gigabyte(GB) units. Note: When GPU memory usage exceeds this value, DTR will heuristically select and evict resident tensors until the amount ...
r"""Get or set the eviction threshold in bytes. It can also be set to a string, whose formatting supports byte(B), kilobyte(KB), megabyte(MB) and gigabyte(GB) units. Note: When GPU memory usage exceeds this value, DTR will heuristically select and evict resident tensors until the amount ...
[ "r", "Get", "or", "set", "the", "eviction", "threshold", "in", "bytes", ".", "It", "can", "also", "be", "set", "to", "a", "string", "whose", "formatting", "supports", "byte", "(", "B", ")", "kilobyte", "(", "KB", ")", "megabyte", "(", "MB", ")", "and...
def eviction_threshold(mod): r"""Get or set the eviction threshold in bytes. It can also be set to a string, whose formatting supports byte(B), kilobyte(KB), megabyte(MB) and gigabyte(GB) units. Note: When GPU memory usage exceeds this value, DTR will heuristically select and evict r...
[ "def", "eviction_threshold", "(", "mod", ")", ":", "return", "_eviction_threshold" ]
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/dtr/dtr.py#L32-L48
Genius-x/genius-x
9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0
cocos2d/tools/bindings-generator/clang/cindex.py
python
Config.set_library_file
(filename)
Set the exact location of libclang
Set the exact location of libclang
[ "Set", "the", "exact", "location", "of", "libclang" ]
def set_library_file(filename): """Set the exact location of libclang""" if Config.loaded: raise Exception("library file must be set before before using " \ "any other functionalities in libclang.") Config.library_file = filename
[ "def", "set_library_file", "(", "filename", ")", ":", "if", "Config", ".", "loaded", ":", "raise", "Exception", "(", "\"library file must be set before before using \"", "\"any other functionalities in libclang.\"", ")", "Config", ".", "library_file", "=", "filename" ]
https://github.com/Genius-x/genius-x/blob/9fc9f194e6d1fb92dd0e33d43db19ddb67cda7b0/cocos2d/tools/bindings-generator/clang/cindex.py#L3325-L3331
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/profiler/model_analyzer.py
python
Profiler.profile_operations
(self, options)
return tfprof_node
Profile the statistics of the Operation types (e.g. MatMul, Conv2D). Args: options: A dict of options. See core/profiler/g3doc/options.md. Returns: a MultiGraphNodeProto that records the results.
Profile the statistics of the Operation types (e.g. MatMul, Conv2D).
[ "Profile", "the", "statistics", "of", "the", "Operation", "types", "(", "e", ".", "g", ".", "MatMul", "Conv2D", ")", "." ]
def profile_operations(self, options): """Profile the statistics of the Operation types (e.g. MatMul, Conv2D). Args: options: A dict of options. See core/profiler/g3doc/options.md. Returns: a MultiGraphNodeProto that records the results. """ opts = _build_options(options) tfprof_nod...
[ "def", "profile_operations", "(", "self", ",", "options", ")", ":", "opts", "=", "_build_options", "(", "options", ")", "tfprof_node", "=", "tfprof_output_pb2", ".", "MultiGraphNodeProto", "(", ")", "tfprof_node", ".", "ParseFromString", "(", "print_mdl", ".", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/profiler/model_analyzer.py#L201-L213
jubatus/jubatus
1251ce551bac980488a6313728e72b3fe0b79a9f
tools/codestyle/cpplint/cpplint.py
python
CheckForMultilineCommentsAndStrings
(filename, clean_lines, linenum, error)
Logs an error if we see /* ... */ or "..." that extend past one line. /* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings to extend across multiple lines, as long as a line continuation character (backsla...
Logs an error if we see /* ... */ or "..." that extend past one line.
[ "Logs", "an", "error", "if", "we", "see", "/", "*", "...", "*", "/", "or", "...", "that", "extend", "past", "one", "line", "." ]
def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): """Logs an error if we see /* ... */ or "..." that extend past one line. /* ... */ comments are legit inside macros, for one line. Otherwise, we prefer // comments, so it's ok to warn about the other. Likewise, it's ok for strings...
[ "def", "CheckForMultilineCommentsAndStrings", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Remove all \\\\ (escaped backslashes) from the line. They are OK, and the", "# secon...
https://github.com/jubatus/jubatus/blob/1251ce551bac980488a6313728e72b3fe0b79a9f/tools/codestyle/cpplint/cpplint.py#L1167-L1202
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/sysconfig.py
python
get_makefile_filename
()
return os.path.join(lib_dir, "config", "Makefile")
Return full pathname of installed Makefile from the Python build.
Return full pathname of installed Makefile from the Python build.
[ "Return", "full", "pathname", "of", "installed", "Makefile", "from", "the", "Python", "build", "." ]
def get_makefile_filename(): """Return full pathname of installed Makefile from the Python build.""" if python_build: return os.path.join(project_base, "Makefile") lib_dir = get_python_lib(plat_specific=1, standard_lib=1) return os.path.join(lib_dir, "config", "Makefile")
[ "def", "get_makefile_filename", "(", ")", ":", "if", "python_build", ":", "return", "os", ".", "path", ".", "join", "(", "project_base", ",", "\"Makefile\"", ")", "lib_dir", "=", "get_python_lib", "(", "plat_specific", "=", "1", ",", "standard_lib", "=", "1"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/sysconfig.py#L248-L253
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pyparsing/py3/pyparsing/core.py
python
condition_as_parse_action
( fn: ParseCondition, message: str = None, fatal: bool = False )
return pa
Function to convert a simple predicate function that returns ``True`` or ``False`` into a parse action. Can be used in places when a parse action is required and :class:`ParserElement.add_condition` cannot be used (such as when adding a condition to an operator level in :class:`infix_notation`). Option...
Function to convert a simple predicate function that returns ``True`` or ``False`` into a parse action. Can be used in places when a parse action is required and :class:`ParserElement.add_condition` cannot be used (such as when adding a condition to an operator level in :class:`infix_notation`).
[ "Function", "to", "convert", "a", "simple", "predicate", "function", "that", "returns", "True", "or", "False", "into", "a", "parse", "action", ".", "Can", "be", "used", "in", "places", "when", "a", "parse", "action", "is", "required", "and", ":", "class", ...
def condition_as_parse_action( fn: ParseCondition, message: str = None, fatal: bool = False ) -> ParseAction: """ Function to convert a simple predicate function that returns ``True`` or ``False`` into a parse action. Can be used in places when a parse action is required and :class:`ParserElement.ad...
[ "def", "condition_as_parse_action", "(", "fn", ":", "ParseCondition", ",", "message", ":", "str", "=", "None", ",", "fatal", ":", "bool", "=", "False", ")", "->", "ParseAction", ":", "msg", "=", "message", "if", "message", "is", "not", "None", "else", "\...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pyparsing/py3/pyparsing/core.py#L314-L339
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py
python
wrap_popen3_for_win
(cygwin_path)
Wrap popen3 to support #!-script on Windows. Args: cygwin_path: path for cygwin binary if command path is needed to be translated. None if no translation required.
Wrap popen3 to support #!-script on Windows.
[ "Wrap", "popen3", "to", "support", "#!", "-", "script", "on", "Windows", "." ]
def wrap_popen3_for_win(cygwin_path): """Wrap popen3 to support #!-script on Windows. Args: cygwin_path: path for cygwin binary if command path is needed to be translated. None if no translation required. """ __orig_popen3 = os.popen3 def __wrap_popen3(cmd, mode='t', b...
[ "def", "wrap_popen3_for_win", "(", "cygwin_path", ")", ":", "__orig_popen3", "=", "os", ".", "popen3", "def", "__wrap_popen3", "(", "cmd", ",", "mode", "=", "'t'", ",", "bufsize", "=", "-", "1", ")", ":", "cmdline", "=", "cmd", ".", "split", "(", "' '"...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/util.py#L129-L146
nasa/fprime
595cf3682d8365943d86c1a6fe7c78f0a116acf0
Autocoders/Python/bin/tlm_packet_gen.py
python
TlmPacketParser.generate_channel_size_dict
(self, the_parsed_topology_xml, xml_filename)
return ch_size_dict
Generates GDS XML dictionary from parsed topology XML
Generates GDS XML dictionary from parsed topology XML
[ "Generates", "GDS", "XML", "dictionary", "from", "parsed", "topology", "XML" ]
def generate_channel_size_dict(self, the_parsed_topology_xml, xml_filename): """ Generates GDS XML dictionary from parsed topology XML """ if self.verbose: print("Topology xml type description file: %s" % xml_filename) model = TopoFactory.TopoFactory.getInstance() ...
[ "def", "generate_channel_size_dict", "(", "self", ",", "the_parsed_topology_xml", ",", "xml_filename", ")", ":", "if", "self", ".", "verbose", ":", "print", "(", "\"Topology xml type description file: %s\"", "%", "xml_filename", ")", "model", "=", "TopoFactory", ".", ...
https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/bin/tlm_packet_gen.py#L187-L264
deepmind/streetlearn
ccf1d60b9c45154894d45a897748aee85d7eb69b
streetlearn/python/environment/instructions_base.py
python
InstructionsBase.ground_truth_direction
(self)
return self._gt_direction
Returns the ground truth direction to take. Returns: ground_truth_direction: Float angle with the ground truth direction to be taken for the agent to go towards the goal.
Returns the ground truth direction to take.
[ "Returns", "the", "ground", "truth", "direction", "to", "take", "." ]
def ground_truth_direction(self): """Returns the ground truth direction to take. Returns: ground_truth_direction: Float angle with the ground truth direction to be taken for the agent to go towards the goal. """ return self._gt_direction
[ "def", "ground_truth_direction", "(", "self", ")", ":", "return", "self", ".", "_gt_direction" ]
https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/environment/instructions_base.py#L505-L512
wenwei202/caffe
f54a74abaf6951d8485cbdcfa1d74a4c37839466
scripts/cpp_lint.py
python
GetHeaderGuardCPPVariable
(filename)
return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_'
Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file.
Returns the CPP variable that should be used as a header guard.
[ "Returns", "the", "CPP", "variable", "that", "should", "be", "used", "as", "a", "header", "guard", "." ]
def GetHeaderGuardCPPVariable(filename): """Returns the CPP variable that should be used as a header guard. Args: filename: The name of a C++ header file. Returns: The CPP variable that should be used as a header guard in the named file. """ # Restores original filename in case that cpplint is...
[ "def", "GetHeaderGuardCPPVariable", "(", "filename", ")", ":", "# Restores original filename in case that cpplint is invoked from Emacs's", "# flymake.", "filename", "=", "re", ".", "sub", "(", "r'_flymake\\.h$'", ",", "'.h'", ",", "filename", ")", "filename", "=", "re", ...
https://github.com/wenwei202/caffe/blob/f54a74abaf6951d8485cbdcfa1d74a4c37839466/scripts/cpp_lint.py#L1384-L1405
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/ma/extras.py
python
notmasked_contiguous
(a, axis=None)
return result
Find contiguous unmasked data in a masked array along the given axis. Parameters ---------- a : array_like The input array. axis : int, optional Axis along which to perform the operation. If None (default), applies to a flattened version of the array, and this is the sam...
Find contiguous unmasked data in a masked array along the given axis.
[ "Find", "contiguous", "unmasked", "data", "in", "a", "masked", "array", "along", "the", "given", "axis", "." ]
def notmasked_contiguous(a, axis=None): """ Find contiguous unmasked data in a masked array along the given axis. Parameters ---------- a : array_like The input array. axis : int, optional Axis along which to perform the operation. If None (default), applies to a flatten...
[ "def", "notmasked_contiguous", "(", "a", ",", "axis", "=", "None", ")", ":", "a", "=", "asarray", "(", "a", ")", "nd", "=", "a", ".", "ndim", "if", "nd", ">", "2", ":", "raise", "NotImplementedError", "(", "\"Currently limited to atmost 2D array.\"", ")", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/ma/extras.py#L1660-L1738
WeitaoVan/L-GM-loss
598582f0631bac876b3eeb8d6c4cd1d780269e03
scripts/cpp_lint.py
python
CheckInvalidIncrement
(filename, clean_lines, linenum, error)
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the current file. ...
Checks for invalid increment *count++.
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ ...
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
https://github.com/WeitaoVan/L-GM-loss/blob/598582f0631bac876b3eeb8d6c4cd1d780269e03/scripts/cpp_lint.py#L1733-L1752
rodeofx/OpenWalter
6116fbe3f04f1146c854afbfbdbe944feaee647e
walter/common/walterWidgets/walterBaseTreeView.py
python
BaseItem.row
(self)
return 0
The index of current node in the list of children of the parent.
The index of current node in the list of children of the parent.
[ "The", "index", "of", "current", "node", "in", "the", "list", "of", "children", "of", "the", "parent", "." ]
def row(self): """The index of current node in the list of children of the parent.""" if self.parent(): return self.parent().childItems.index(self) return 0
[ "def", "row", "(", "self", ")", ":", "if", "self", ".", "parent", "(", ")", ":", "return", "self", ".", "parent", "(", ")", ".", "childItems", ".", "index", "(", "self", ")", "return", "0" ]
https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/common/walterWidgets/walterBaseTreeView.py#L548-L552
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/SimpleXMLRPCServer.py
python
SimpleXMLRPCDispatcher.system_listMethods
(self)
return methods
system.listMethods() => ['add', 'subtract', 'multiple'] Returns a list of the methods supported by the server.
system.listMethods() => ['add', 'subtract', 'multiple']
[ "system", ".", "listMethods", "()", "=", ">", "[", "add", "subtract", "multiple", "]" ]
def system_listMethods(self): """system.listMethods() => ['add', 'subtract', 'multiple'] Returns a list of the methods supported by the server.""" methods = self.funcs.keys() if self.instance is not None: # Instance can implement _listMethod to return a list of ...
[ "def", "system_listMethods", "(", "self", ")", ":", "methods", "=", "self", ".", "funcs", ".", "keys", "(", ")", "if", "self", ".", "instance", "is", "not", "None", ":", "# Instance can implement _listMethod to return a list of", "# methods", "if", "hasattr", "(...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/SimpleXMLRPCServer.py#L278-L299
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/perf/profile_creators/fast_navigation_profile_extender.py
python
FastNavigationProfileExtender.CleanUpAfterBatchNavigation
(self)
A hook for subclasses to perform cleanup after each batch of navigations. Can be overridden by subclasses.
A hook for subclasses to perform cleanup after each batch of navigations.
[ "A", "hook", "for", "subclasses", "to", "perform", "cleanup", "after", "each", "batch", "of", "navigations", "." ]
def CleanUpAfterBatchNavigation(self): """A hook for subclasses to perform cleanup after each batch of navigations. Can be overridden by subclasses. """ pass
[ "def", "CleanUpAfterBatchNavigation", "(", "self", ")", ":", "pass" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/profile_creators/fast_navigation_profile_extender.py#L89-L95
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
WindowList.__iter__
(*args, **kwargs)
return _core_.WindowList___iter__(*args, **kwargs)
__iter__(self) -> WindowList_iterator
__iter__(self) -> WindowList_iterator
[ "__iter__", "(", "self", ")", "-", ">", "WindowList_iterator" ]
def __iter__(*args, **kwargs): """__iter__(self) -> WindowList_iterator""" return _core_.WindowList___iter__(*args, **kwargs)
[ "def", "__iter__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "WindowList___iter__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L9067-L9069
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/ma/core.py
python
MaskedArray.hardmask
(self)
return self._hardmask
Hardness of the mask
Hardness of the mask
[ "Hardness", "of", "the", "mask" ]
def hardmask(self): """ Hardness of the mask """ return self._hardmask
[ "def", "hardmask", "(", "self", ")", ":", "return", "self", ".", "_hardmask" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/ma/core.py#L3574-L3576
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_cmdbar.py
python
CommandExecuter.OnKeyDown
(self, evt)
Records the key sequence that has been entered and performs actions based on that key sequence. @param evt: event that called this handler
Records the key sequence that has been entered and performs actions based on that key sequence. @param evt: event that called this handler
[ "Records", "the", "key", "sequence", "that", "has", "been", "entered", "and", "performs", "actions", "based", "on", "that", "key", "sequence", ".", "@param", "evt", ":", "event", "that", "called", "this", "handler" ]
def OnKeyDown(self, evt): """Records the key sequence that has been entered and performs actions based on that key sequence. @param evt: event that called this handler """ e_key = evt.GetKeyCode() cmd = self.GetValue() if e_key == wx.WXK_UP: if self....
[ "def", "OnKeyDown", "(", "self", ",", "evt", ")", ":", "e_key", "=", "evt", ".", "GetKeyCode", "(", ")", "cmd", "=", "self", ".", "GetValue", "(", ")", "if", "e_key", "==", "wx", ".", "WXK_UP", ":", "if", "self", ".", "_popup", ".", "HasSuggestions...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_cmdbar.py#L860-L897