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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ETH3D/badslam | 36cacb24565897190a2d985c60eb4848c174a1fc | libvis/third_party/flann/src/python/pyflann/index.py | python | FLANN.nn_index | (self, qpts, num_neighbors=1, **kwargs) | For each point in querypts, (which may be a single point), it
returns the num_neighbors nearest points in the index built by
calling build_index. | For each point in querypts, (which may be a single point), it
returns the num_neighbors nearest points in the index built by
calling build_index. | [
"For",
"each",
"point",
"in",
"querypts",
"(",
"which",
"may",
"be",
"a",
"single",
"point",
")",
"it",
"returns",
"the",
"num_neighbors",
"nearest",
"points",
"in",
"the",
"index",
"built",
"by",
"calling",
"build_index",
"."
] | def nn_index(self, qpts, num_neighbors=1, **kwargs):
"""
For each point in querypts, (which may be a single point), it
returns the num_neighbors nearest points in the index built by
calling build_index.
"""
if self.__curindex is None:
raise FLANNException(
... | [
"def",
"nn_index",
"(",
"self",
",",
"qpts",
",",
"num_neighbors",
"=",
"1",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"__curindex",
"is",
"None",
":",
"raise",
"FLANNException",
"(",
"'build_index(...) method not called first or current index deleted.... | https://github.com/ETH3D/badslam/blob/36cacb24565897190a2d985c60eb4848c174a1fc/libvis/third_party/flann/src/python/pyflann/index.py#L215-L260 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py | python | BasicFittingView.start_x | (self, value: float) | Sets the selected start X. | Sets the selected start X. | [
"Sets",
"the",
"selected",
"start",
"X",
"."
] | def start_x(self, value: float) -> None:
"""Sets the selected start X."""
self.fit_function_options.start_x = value | [
"def",
"start_x",
"(",
"self",
",",
"value",
":",
"float",
")",
"->",
"None",
":",
"self",
".",
"fit_function_options",
".",
"start_x",
"=",
"value"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py#L207-L209 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/install_lib.py | python | install_lib.get_exclusions | (self) | return set(starmap(self._exclude_pkg_path, excl_specs)) | Return a collections.Sized collections.Container of paths to be
excluded for single_version_externally_managed installations. | Return a collections.Sized collections.Container of paths to be
excluded for single_version_externally_managed installations. | [
"Return",
"a",
"collections",
".",
"Sized",
"collections",
".",
"Container",
"of",
"paths",
"to",
"be",
"excluded",
"for",
"single_version_externally_managed",
"installations",
"."
] | def get_exclusions(self):
"""
Return a collections.Sized collections.Container of paths to be
excluded for single_version_externally_managed installations.
"""
all_packages = (
pkg
for ns_pkg in self._get_SVEM_NSPs()
for pkg in self._all_packag... | [
"def",
"get_exclusions",
"(",
"self",
")",
":",
"all_packages",
"=",
"(",
"pkg",
"for",
"ns_pkg",
"in",
"self",
".",
"_get_SVEM_NSPs",
"(",
")",
"for",
"pkg",
"in",
"self",
".",
"_all_packages",
"(",
"ns_pkg",
")",
")",
"excl_specs",
"=",
"product",
"(",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/command/install_lib.py#L17-L29 | |
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/mac_tool.py | python | MacTool.ExecCopyInfoPlist | (self, source, dest) | Copies the |source| Info.plist to the destination directory |dest|. | Copies the |source| Info.plist to the destination directory |dest|. | [
"Copies",
"the",
"|source|",
"Info",
".",
"plist",
"to",
"the",
"destination",
"directory",
"|dest|",
"."
] | def ExecCopyInfoPlist(self, source, dest):
"""Copies the |source| Info.plist to the destination directory |dest|."""
# Read the source Info.plist into memory.
fd = open(source, 'r')
lines = fd.read()
fd.close()
# Go through all the environment variables and replace them as variables in
# th... | [
"def",
"ExecCopyInfoPlist",
"(",
"self",
",",
"source",
",",
"dest",
")",
":",
"# Read the source Info.plist into memory.",
"fd",
"=",
"open",
"(",
"source",
",",
"'r'",
")",
"lines",
"=",
"fd",
".",
"read",
"(",
")",
"fd",
".",
"close",
"(",
")",
"# Go ... | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/mac_tool.py#L108-L130 | ||
ablab/spades | 3a754192b88540524ce6fb69eef5ea9273a38465 | ioncommunity/AssemblerPlus/lib/hypertext.py | python | ATTR | (**kwargs) | Sets the given keyword-arguments as attributes of the current HTML element | Sets the given keyword-arguments as attributes of the current HTML element | [
"Sets",
"the",
"given",
"keyword",
"-",
"arguments",
"as",
"attributes",
"of",
"the",
"current",
"HTML",
"element"
] | def ATTR(**kwargs):
"""Sets the given keyword-arguments as attributes of the current HTML element"""
THIS()(**kwargs) | [
"def",
"ATTR",
"(",
"*",
"*",
"kwargs",
")",
":",
"THIS",
"(",
")",
"(",
"*",
"*",
"kwargs",
")"
] | https://github.com/ablab/spades/blob/3a754192b88540524ce6fb69eef5ea9273a38465/ioncommunity/AssemblerPlus/lib/hypertext.py#L232-L234 | ||
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | python/interfaces/visualfeedback.py | python | VisualFeedback.SampleVisibilityGoal | (self,numsamples=None) | return numpy.reshape(numpy.array(samples[1:],float),(returnedsamples,(len(samples)-1)/returnedsamples)) | See :ref:`module-visualfeedback-samplevisibilitygoal` | See :ref:`module-visualfeedback-samplevisibilitygoal` | [
"See",
":",
"ref",
":",
"module",
"-",
"visualfeedback",
"-",
"samplevisibilitygoal"
] | def SampleVisibilityGoal(self,numsamples=None):
"""See :ref:`module-visualfeedback-samplevisibilitygoal`
"""
cmd = 'SampleVisibilityGoal '
if numsamples is not None:
cmd += 'numsamples %d '%numsamples
res = self.prob.SendCommand(cmd)
if res is None:
... | [
"def",
"SampleVisibilityGoal",
"(",
"self",
",",
"numsamples",
"=",
"None",
")",
":",
"cmd",
"=",
"'SampleVisibilityGoal '",
"if",
"numsamples",
"is",
"not",
"None",
":",
"cmd",
"+=",
"'numsamples %d '",
"%",
"numsamples",
"res",
"=",
"self",
".",
"prob",
".... | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/interfaces/visualfeedback.py#L145-L156 | |
InsightSoftwareConsortium/ITK | 87acfce9a93d928311c38bc371b666b515b9f19d | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/container_traits.py | python | find_container_traits | (cls_or_string) | Find the container traits type of a declaration.
Args:
cls_or_string (str | declarations.declaration_t): a string
Returns:
declarations.container_traits: a container traits | Find the container traits type of a declaration. | [
"Find",
"the",
"container",
"traits",
"type",
"of",
"a",
"declaration",
"."
] | def find_container_traits(cls_or_string):
"""
Find the container traits type of a declaration.
Args:
cls_or_string (str | declarations.declaration_t): a string
Returns:
declarations.container_traits: a container traits
"""
if utils.is_str(cls_or_string):
if not templat... | [
"def",
"find_container_traits",
"(",
"cls_or_string",
")",
":",
"if",
"utils",
".",
"is_str",
"(",
"cls_or_string",
")",
":",
"if",
"not",
"templates",
".",
"is_instantiation",
"(",
"cls_or_string",
")",
":",
"return",
"None",
"name",
"=",
"templates",
".",
... | https://github.com/InsightSoftwareConsortium/ITK/blob/87acfce9a93d928311c38bc371b666b515b9f19d/Modules/ThirdParty/pygccxml/src/pygccxml/declarations/container_traits.py#L697-L732 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/site_compare/site_compare.py | python | main | () | return 0 | Main executable. Parse the command line and invoke the command. | Main executable. Parse the command line and invoke the command. | [
"Main",
"executable",
".",
"Parse",
"the",
"command",
"line",
"and",
"invoke",
"the",
"command",
"."
] | def main():
"""Main executable. Parse the command line and invoke the command."""
cmdline = command_line.CommandLine()
# The below two commands are currently unstable so have been disabled
# commands.compare2.CreateCommand(cmdline)
# commands.maskmaker.CreateCommand(cmdline)
commands.measure.CreateCommand(... | [
"def",
"main",
"(",
")",
":",
"cmdline",
"=",
"command_line",
".",
"CommandLine",
"(",
")",
"# The below two commands are currently unstable so have been disabled",
"# commands.compare2.CreateCommand(cmdline)",
"# commands.maskmaker.CreateCommand(cmdline)",
"commands",
".",
"measur... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/site_compare/site_compare.py#L161-L172 | |
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | scripts/cpp_lint.py | python | CheckCheck | (filename, clean_lines, linenum, error) | Checks the use of CHECK and EXPECT macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks the use of CHECK and EXPECT macros. | [
"Checks",
"the",
"use",
"of",
"CHECK",
"and",
"EXPECT",
"macros",
"."
] | def CheckCheck(filename, clean_lines, linenum, error):
"""Checks the use of CHECK and EXPECT macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found.
... | [
"def",
"CheckCheck",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Decide the set of replacement macros that should be suggested",
"lines",
"=",
"clean_lines",
".",
"elided",
"check_macro",
"=",
"None",
"start_pos",
"=",
"-",
"1",
"... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L3278-L3402 | ||
microsoft/Azure-Kinect-Sensor-SDK | d87ef578676c05b9a5d23c097502942753bf3777 | examples/calibration_registration/camera_tools.py | python | r_as_matrix | (rotation:np.array) | return rmat | Convert a 3vec rotation array to a rotation matrix.
Args:
rotation (np.array): 3 vector array representing rotation.
Returns:
[np.array]: Rotation matrix. | Convert a 3vec rotation array to a rotation matrix. | [
"Convert",
"a",
"3vec",
"rotation",
"array",
"to",
"a",
"rotation",
"matrix",
"."
] | def r_as_matrix(rotation:np.array):
"""Convert a 3vec rotation array to a rotation matrix.
Args:
rotation (np.array): 3 vector array representing rotation.
Returns:
[np.array]: Rotation matrix.
"""
rmat = np.zeros(shape=(3,3))
cv2.Rodrigues(rotation, rmat)
return rmat | [
"def",
"r_as_matrix",
"(",
"rotation",
":",
"np",
".",
"array",
")",
":",
"rmat",
"=",
"np",
".",
"zeros",
"(",
"shape",
"=",
"(",
"3",
",",
"3",
")",
")",
"cv2",
".",
"Rodrigues",
"(",
"rotation",
",",
"rmat",
")",
"return",
"rmat"
] | https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/d87ef578676c05b9a5d23c097502942753bf3777/examples/calibration_registration/camera_tools.py#L64-L75 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/hyperlink.py | python | HyperLinkCtrl.GetURL | (self) | return self._URL | Retrieve the URL associated to the :class:`HyperLinkCtrl`. | Retrieve the URL associated to the :class:`HyperLinkCtrl`. | [
"Retrieve",
"the",
"URL",
"associated",
"to",
"the",
":",
"class",
":",
"HyperLinkCtrl",
"."
] | def GetURL(self):
""" Retrieve the URL associated to the :class:`HyperLinkCtrl`. """
return self._URL | [
"def",
"GetURL",
"(",
"self",
")",
":",
"return",
"self",
".",
"_URL"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/hyperlink.py#L561-L564 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextDrawingContext.GetVirtualAttributes | (*args, **kwargs) | return _richtext.RichTextDrawingContext_GetVirtualAttributes(*args, **kwargs) | GetVirtualAttributes(self, RichTextObject obj) -> RichTextAttr | GetVirtualAttributes(self, RichTextObject obj) -> RichTextAttr | [
"GetVirtualAttributes",
"(",
"self",
"RichTextObject",
"obj",
")",
"-",
">",
"RichTextAttr"
] | def GetVirtualAttributes(*args, **kwargs):
"""GetVirtualAttributes(self, RichTextObject obj) -> RichTextAttr"""
return _richtext.RichTextDrawingContext_GetVirtualAttributes(*args, **kwargs) | [
"def",
"GetVirtualAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextDrawingContext_GetVirtualAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L1094-L1096 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/gluon/trainer.py | python | Trainer.load_states | (self, fname) | Loads trainer states (e.g. optimizer, momentum) from a file.
Parameters
----------
fname : str
Path to input states file.
Note
----
`optimizer.param_dict`, which contains Parameter information (such as
`lr_mult` and `wd_mult`) will not be loaded from... | Loads trainer states (e.g. optimizer, momentum) from a file. | [
"Loads",
"trainer",
"states",
"(",
"e",
".",
"g",
".",
"optimizer",
"momentum",
")",
"from",
"a",
"file",
"."
] | def load_states(self, fname):
"""Loads trainer states (e.g. optimizer, momentum) from a file.
Parameters
----------
fname : str
Path to input states file.
Note
----
`optimizer.param_dict`, which contains Parameter information (such as
`lr_mul... | [
"def",
"load_states",
"(",
"self",
",",
"fname",
")",
":",
"if",
"not",
"self",
".",
"_kv_initialized",
":",
"self",
".",
"_init_kvstore",
"(",
")",
"if",
"self",
".",
"_params_to_init",
":",
"self",
".",
"_init_params",
"(",
")",
"if",
"self",
".",
"_... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/gluon/trainer.py#L465-L495 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | ToolBarToolBase.GetDisabledBitmap | (*args, **kwargs) | return _controls_.ToolBarToolBase_GetDisabledBitmap(*args, **kwargs) | GetDisabledBitmap(self) -> Bitmap | GetDisabledBitmap(self) -> Bitmap | [
"GetDisabledBitmap",
"(",
"self",
")",
"-",
">",
"Bitmap"
] | def GetDisabledBitmap(*args, **kwargs):
"""GetDisabledBitmap(self) -> Bitmap"""
return _controls_.ToolBarToolBase_GetDisabledBitmap(*args, **kwargs) | [
"def",
"GetDisabledBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ToolBarToolBase_GetDisabledBitmap",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L3501-L3503 | |
mysql/mysql-router | cc0179f982bb9739a834eb6fd205a56224616133 | ext/gmock/scripts/upload.py | python | HttpRpcServer._Authenticate | (self) | Save the cookie jar after authentication. | Save the cookie jar after authentication. | [
"Save",
"the",
"cookie",
"jar",
"after",
"authentication",
"."
] | def _Authenticate(self):
"""Save the cookie jar after authentication."""
super(HttpRpcServer, self)._Authenticate()
if self.save_cookies:
StatusUpdate("Saving authentication cookies to %s" % self.cookie_file)
self.cookie_jar.save() | [
"def",
"_Authenticate",
"(",
"self",
")",
":",
"super",
"(",
"HttpRpcServer",
",",
"self",
")",
".",
"_Authenticate",
"(",
")",
"if",
"self",
".",
"save_cookies",
":",
"StatusUpdate",
"(",
"\"Saving authentication cookies to %s\"",
"%",
"self",
".",
"cookie_file... | https://github.com/mysql/mysql-router/blob/cc0179f982bb9739a834eb6fd205a56224616133/ext/gmock/scripts/upload.py#L347-L352 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py | python | MergeManifests._ReplaceArgumentPlaceholders | (self, dom) | Replaces argument placeholders with their values.
Modifies the attribute values of the input node.
Args:
dom: Xml node that should get placeholders replaced. | Replaces argument placeholders with their values. | [
"Replaces",
"argument",
"placeholders",
"with",
"their",
"values",
"."
] | def _ReplaceArgumentPlaceholders(self, dom):
"""Replaces argument placeholders with their values.
Modifies the attribute values of the input node.
Args:
dom: Xml node that should get placeholders replaced.
"""
placeholders = {
'packageName': self._merger_dom.getElementsByTagName(
... | [
"def",
"_ReplaceArgumentPlaceholders",
"(",
"self",
",",
"dom",
")",
":",
"placeholders",
"=",
"{",
"'packageName'",
":",
"self",
".",
"_merger_dom",
".",
"getElementsByTagName",
"(",
"self",
".",
"_MANIFEST",
")",
".",
"item",
"(",
"0",
")",
".",
"getAttrib... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/external/bazel_tools/tools/android/merge_manifests.py#L253-L270 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/wheel/bdist_wheel.py | python | bdist_wheel.egg2dist | (self, egginfo_path, distinfo_path) | Convert an .egg-info directory into a .dist-info directory | Convert an .egg-info directory into a .dist-info directory | [
"Convert",
"an",
".",
"egg",
"-",
"info",
"directory",
"into",
"a",
".",
"dist",
"-",
"info",
"directory"
] | def egg2dist(self, egginfo_path, distinfo_path):
"""Convert an .egg-info directory into a .dist-info directory"""
def adios(p):
"""Appropriately delete directory, file or link."""
if os.path.exists(p) and not os.path.islink(p) and os.path.isdir(p):
shutil.rmtree(p... | [
"def",
"egg2dist",
"(",
"self",
",",
"egginfo_path",
",",
"distinfo_path",
")",
":",
"def",
"adios",
"(",
"p",
")",
":",
"\"\"\"Appropriately delete directory, file or link.\"\"\"",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"p",
")",
"and",
"not",
"os",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/wheel/bdist_wheel.py#L437-L492 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/onnx2mx/_op_translations.py | python | add_n | (attrs, inputs, proto_obj) | return 'add_n', attrs, inputs | Elementwise sum of arrays | Elementwise sum of arrays | [
"Elementwise",
"sum",
"of",
"arrays"
] | def add_n(attrs, inputs, proto_obj):
"""Elementwise sum of arrays"""
return 'add_n', attrs, inputs | [
"def",
"add_n",
"(",
"attrs",
",",
"inputs",
",",
"proto_obj",
")",
":",
"return",
"'add_n'",
",",
"attrs",
",",
"inputs"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L141-L143 | |
v8mips/v8mips | f0c9cc0bbfd461c7f516799d9a58e9a7395f737e | tools/stats-viewer.py | python | ChromeCounter.Value | (self) | return self.data.IntAt(self.value_offset) | Return the integer value of this counter. | Return the integer value of this counter. | [
"Return",
"the",
"integer",
"value",
"of",
"this",
"counter",
"."
] | def Value(self):
"""Return the integer value of this counter."""
return self.data.IntAt(self.value_offset) | [
"def",
"Value",
"(",
"self",
")",
":",
"return",
"self",
".",
"data",
".",
"IntAt",
"(",
"self",
".",
"value_offset",
")"
] | https://github.com/v8mips/v8mips/blob/f0c9cc0bbfd461c7f516799d9a58e9a7395f737e/tools/stats-viewer.py#L398-L400 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/learn/python/learn/preprocessing/text.py | python | VocabularyProcessor.save | (self, filename) | Saves vocabulary processor into given file.
Args:
filename: Path to output file. | Saves vocabulary processor into given file. | [
"Saves",
"vocabulary",
"processor",
"into",
"given",
"file",
"."
] | def save(self, filename):
"""Saves vocabulary processor into given file.
Args:
filename: Path to output file.
"""
with gfile.Open(filename, 'wb') as f:
f.write(pickle.dumps(self)) | [
"def",
"save",
"(",
"self",
",",
"filename",
")",
":",
"with",
"gfile",
".",
"Open",
"(",
"filename",
",",
"'wb'",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"pickle",
".",
"dumps",
"(",
"self",
")",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/preprocessing/text.py#L206-L213 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | Printout.GetPaperRectPixels | (*args, **kwargs) | return _windows_.Printout_GetPaperRectPixels(*args, **kwargs) | GetPaperRectPixels(self) -> Rect | GetPaperRectPixels(self) -> Rect | [
"GetPaperRectPixels",
"(",
"self",
")",
"-",
">",
"Rect"
] | def GetPaperRectPixels(*args, **kwargs):
"""GetPaperRectPixels(self) -> Rect"""
return _windows_.Printout_GetPaperRectPixels(*args, **kwargs) | [
"def",
"GetPaperRectPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"Printout_GetPaperRectPixels",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5367-L5369 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/FactorySystem/Parser.py | python | Parser.check | (self) | Perform error checking on the loaded hit tree | Perform error checking on the loaded hit tree | [
"Perform",
"error",
"checking",
"on",
"the",
"loaded",
"hit",
"tree"
] | def check(self):
"""Perform error checking on the loaded hit tree"""
for err in Parser.checkDuplicates(self.root):
self.error(*err) | [
"def",
"check",
"(",
"self",
")",
":",
"for",
"err",
"in",
"Parser",
".",
"checkDuplicates",
"(",
"self",
".",
"root",
")",
":",
"self",
".",
"error",
"(",
"*",
"err",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/FactorySystem/Parser.py#L61-L64 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/gui/DirectOptionMenu.py | python | DirectOptionMenu.hidePopupMenu | (self, event = None) | Put away popup and cancel frame | Put away popup and cancel frame | [
"Put",
"away",
"popup",
"and",
"cancel",
"frame"
] | def hidePopupMenu(self, event = None):
""" Put away popup and cancel frame """
self.popupMenu.hide()
self.cancelFrame.hide() | [
"def",
"hidePopupMenu",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"self",
".",
"popupMenu",
".",
"hide",
"(",
")",
"self",
".",
"cancelFrame",
".",
"hide",
"(",
")"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/gui/DirectOptionMenu.py#L250-L253 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/linalg/python/ops/linear_operator.py | python | LinearOperator._check_input_dtype | (self, arg) | Check that arg.dtype == self.dtype. | Check that arg.dtype == self.dtype. | [
"Check",
"that",
"arg",
".",
"dtype",
"==",
"self",
".",
"dtype",
"."
] | def _check_input_dtype(self, arg):
"""Check that arg.dtype == self.dtype."""
if arg.dtype != self.dtype:
raise TypeError(
"Expected argument to have dtype %s. Found: %s in tensor %s" %
(self.dtype, arg.dtype, arg)) | [
"def",
"_check_input_dtype",
"(",
"self",
",",
"arg",
")",
":",
"if",
"arg",
".",
"dtype",
"!=",
"self",
".",
"dtype",
":",
"raise",
"TypeError",
"(",
"\"Expected argument to have dtype %s. Found: %s in tensor %s\"",
"%",
"(",
"self",
".",
"dtype",
",",
"arg",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/linalg/python/ops/linear_operator.py#L573-L578 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py | python | LoadVesuvio._get_foil_periods | (self) | return foil_out_periods, foil_thin_periods, foil_thick_periods | Return the period numbers (starting from 1) that contribute to the
respective foil states | Return the period numbers (starting from 1) that contribute to the
respective foil states | [
"Return",
"the",
"period",
"numbers",
"(",
"starting",
"from",
"1",
")",
"that",
"contribute",
"to",
"the",
"respective",
"foil",
"states"
] | def _get_foil_periods(self):
"""
Return the period numbers (starting from 1) that contribute to the
respective foil states
"""
if self._nperiods == 2:
foil_out_periods = (2,)
foil_thin_periods = (1,)
foil_thick_periods = None
elif self.... | [
"def",
"_get_foil_periods",
"(",
"self",
")",
":",
"if",
"self",
".",
"_nperiods",
"==",
"2",
":",
"foil_out_periods",
"=",
"(",
"2",
",",
")",
"foil_thin_periods",
"=",
"(",
"1",
",",
")",
"foil_thick_periods",
"=",
"None",
"elif",
"self",
".",
"_nperio... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/LoadVesuvio.py#L783-L808 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | resetLastError | () | Cleanup the last global error registered. For parsing error
this does not change the well-formedness result. | Cleanup the last global error registered. For parsing error
this does not change the well-formedness result. | [
"Cleanup",
"the",
"last",
"global",
"error",
"registered",
".",
"For",
"parsing",
"error",
"this",
"does",
"not",
"change",
"the",
"well",
"-",
"formedness",
"result",
"."
] | def resetLastError():
"""Cleanup the last global error registered. For parsing error
this does not change the well-formedness result. """
libxml2mod.xmlResetLastError() | [
"def",
"resetLastError",
"(",
")",
":",
"libxml2mod",
".",
"xmlResetLastError",
"(",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L1146-L1149 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | llvm/tools/sancov/coverage-report-server.py | python | SymcovData.compute_filecoverage | (self) | return result | Build a filename->pct coverage. | Build a filename->pct coverage. | [
"Build",
"a",
"filename",
"-",
">",
"pct",
"coverage",
"."
] | def compute_filecoverage(self):
"""Build a filename->pct coverage."""
result = dict()
for filename, fns in self.point_symbol_info.items():
file_points = []
for fn, points in fns.items():
file_points.extend(points.keys())
covered_points = self.c... | [
"def",
"compute_filecoverage",
"(",
"self",
")",
":",
"result",
"=",
"dict",
"(",
")",
"for",
"filename",
",",
"fns",
"in",
"self",
".",
"point_symbol_info",
".",
"items",
"(",
")",
":",
"file_points",
"=",
"[",
"]",
"for",
"fn",
",",
"points",
"in",
... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/llvm/tools/sancov/coverage-report-server.py#L107-L117 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiDockInfo.IsHorizontal | (*args, **kwargs) | return _aui.AuiDockInfo_IsHorizontal(*args, **kwargs) | IsHorizontal(self) -> bool | IsHorizontal(self) -> bool | [
"IsHorizontal",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsHorizontal(*args, **kwargs):
"""IsHorizontal(self) -> bool"""
return _aui.AuiDockInfo_IsHorizontal(*args, **kwargs) | [
"def",
"IsHorizontal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiDockInfo_IsHorizontal",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L885-L887 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.GetSelectedItemCount | (self) | return countSel | Returns the number of selected items in :class:`UltimateListCtrl`. | Returns the number of selected items in :class:`UltimateListCtrl`. | [
"Returns",
"the",
"number",
"of",
"selected",
"items",
"in",
":",
"class",
":",
"UltimateListCtrl",
"."
] | def GetSelectedItemCount(self):
""" Returns the number of selected items in :class:`UltimateListCtrl`. """
# deal with the quick case first
if self.IsSingleSel():
return (self.HasCurrent() and [self.IsHighlighted(self._current)] or [False])[0]
# virtual controls remmebers a... | [
"def",
"GetSelectedItemCount",
"(",
"self",
")",
":",
"# deal with the quick case first",
"if",
"self",
".",
"IsSingleSel",
"(",
")",
":",
"return",
"(",
"self",
".",
"HasCurrent",
"(",
")",
"and",
"[",
"self",
".",
"IsHighlighted",
"(",
"self",
".",
"_curre... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L9489-L9508 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py | python | ConfigDialog.deactivate_current_config | (self) | Remove current key bindings.
Iterate over window instances defined in parent and remove
the keybindings. | Remove current key bindings.
Iterate over window instances defined in parent and remove
the keybindings. | [
"Remove",
"current",
"key",
"bindings",
".",
"Iterate",
"over",
"window",
"instances",
"defined",
"in",
"parent",
"and",
"remove",
"the",
"keybindings",
"."
] | def deactivate_current_config(self):
"""Remove current key bindings.
Iterate over window instances defined in parent and remove
the keybindings.
"""
# Before a config is saved, some cleanup of current
# config must be done - remove the previous keybindings.
win_in... | [
"def",
"deactivate_current_config",
"(",
"self",
")",
":",
"# Before a config is saved, some cleanup of current",
"# config must be done - remove the previous keybindings.",
"win_instances",
"=",
"self",
".",
"parent",
".",
"instance_dict",
".",
"keys",
"(",
")",
"for",
"inst... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py#L217-L226 | ||
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_delivery.py | python | Delivery.local_state | (self) | return DispositionType.get(pn_delivery_local_state(self._impl)) | A local state of the delivery. | A local state of the delivery. | [
"A",
"local",
"state",
"of",
"the",
"delivery",
"."
] | def local_state(self) -> DispositionType:
"""A local state of the delivery."""
return DispositionType.get(pn_delivery_local_state(self._impl)) | [
"def",
"local_state",
"(",
"self",
")",
"->",
"DispositionType",
":",
"return",
"DispositionType",
".",
"get",
"(",
"pn_delivery_local_state",
"(",
"self",
".",
"_impl",
")",
")"
] | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_delivery.py#L380-L382 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/cross_device_ops.py | python | AllReduceCrossDeviceOps._do_batch_all_reduce_sparse | (self, reduce_op, sparse_values) | return self._simple_cross_replica_ops.batch_reduce(
reduce_op, zip(sparse_values, sparse_values)) | Run batch all-reduce for sparse values. | Run batch all-reduce for sparse values. | [
"Run",
"batch",
"all",
"-",
"reduce",
"for",
"sparse",
"values",
"."
] | def _do_batch_all_reduce_sparse(self, reduce_op, sparse_values):
"""Run batch all-reduce for sparse values."""
logging.log_first_n(
logging.WARN,
"Efficient allreduce is not supported for %d IndexedSlices" %
len(sparse_values), 10)
# Use `sparse_values` as destinations to do all-redu... | [
"def",
"_do_batch_all_reduce_sparse",
"(",
"self",
",",
"reduce_op",
",",
"sparse_values",
")",
":",
"logging",
".",
"log_first_n",
"(",
"logging",
".",
"WARN",
",",
"\"Efficient allreduce is not supported for %d IndexedSlices\"",
"%",
"len",
"(",
"sparse_values",
")",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/cross_device_ops.py#L774-L783 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-digital/python/digital/qa_ofdm_txrx.py | python | test_ofdm_txrx.test_004_tx1packet_large_fO | (self) | Transmit one packet, with slight AWGN and large frequency offset.
Check packet is received and no bit errors have occurred. | Transmit one packet, with slight AWGN and large frequency offset.
Check packet is received and no bit errors have occurred. | [
"Transmit",
"one",
"packet",
"with",
"slight",
"AWGN",
"and",
"large",
"frequency",
"offset",
".",
"Check",
"packet",
"is",
"received",
"and",
"no",
"bit",
"errors",
"have",
"occurred",
"."
] | def test_004_tx1packet_large_fO(self):
""" Transmit one packet, with slight AWGN and large frequency offset.
Check packet is received and no bit errors have occurred. """
fft_len = 64
len_tag_key = 'frame_len'
n_bytes = 21
test_data = list([random.randint(0, 255) for x in... | [
"def",
"test_004_tx1packet_large_fO",
"(",
"self",
")",
":",
"fft_len",
"=",
"64",
"len_tag_key",
"=",
"'frame_len'",
"n_bytes",
"=",
"21",
"test_data",
"=",
"list",
"(",
"[",
"random",
".",
"randint",
"(",
"0",
",",
"255",
")",
"for",
"x",
"in",
"range"... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qa_ofdm_txrx.py#L172-L191 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/roslisp/rosbuild/scripts/genmsg_lisp.py | python | write_defclass | (s, spec) | Writes the defclass that defines the message type | Writes the defclass that defines the message type | [
"Writes",
"the",
"defclass",
"that",
"defines",
"the",
"message",
"type"
] | def write_defclass(s, spec):
"Writes the defclass that defines the message type"
cl = message_class(spec)
new_cl = new_message_class(spec)
suffix = 'srv' if spec.component_type == 'service' else 'msg'
s.write('(cl:defclass %s (roslisp-msg-protocol:ros-message)'%cl)
with Indent(s):
s.writ... | [
"def",
"write_defclass",
"(",
"s",
",",
"spec",
")",
":",
"cl",
"=",
"message_class",
"(",
"spec",
")",
"new_cl",
"=",
"new_message_class",
"(",
"spec",
")",
"suffix",
"=",
"'srv'",
"if",
"spec",
".",
"component_type",
"==",
"'service'",
"else",
"'msg'",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/roslisp/rosbuild/scripts/genmsg_lisp.py#L248-L271 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | clang/bindings/python/clang/cindex.py | python | CursorKind.is_declaration | (self) | return conf.lib.clang_isDeclaration(self) | Test if this is a declaration kind. | Test if this is a declaration kind. | [
"Test",
"if",
"this",
"is",
"a",
"declaration",
"kind",
"."
] | def is_declaration(self):
"""Test if this is a declaration kind."""
return conf.lib.clang_isDeclaration(self) | [
"def",
"is_declaration",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isDeclaration",
"(",
"self",
")"
] | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/bindings/python/clang/cindex.py#L671-L673 | |
HKUST-Aerial-Robotics/Fast-Planner | 2ddd7793eecd573dbb5b47e2c985aa06606df3cf | uav_simulator/Utils/multi_map_server/quadrotor_msgs/build/catkin_generated/installspace/_setup_util.py | python | rollback_env_variables | (environ, env_var_subfolders) | return lines | Generate shell code to reset environment variables
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
This does not cover modifications performed by environment hooks. | Generate shell code to reset environment variables
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
This does not cover modifications performed by environment hooks. | [
"Generate",
"shell",
"code",
"to",
"reset",
"environment",
"variables",
"by",
"unrolling",
"modifications",
"based",
"on",
"all",
"workspaces",
"in",
"CMAKE_PREFIX_PATH",
".",
"This",
"does",
"not",
"cover",
"modifications",
"performed",
"by",
"environment",
"hooks"... | def rollback_env_variables(environ, env_var_subfolders):
'''
Generate shell code to reset environment variables
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
This does not cover modifications performed by environment hooks.
'''
lines = []
unmodified_environ = copy.... | [
"def",
"rollback_env_variables",
"(",
"environ",
",",
"env_var_subfolders",
")",
":",
"lines",
"=",
"[",
"]",
"unmodified_environ",
"=",
"copy",
".",
"copy",
"(",
"environ",
")",
"for",
"key",
"in",
"sorted",
"(",
"env_var_subfolders",
".",
"keys",
"(",
")",... | https://github.com/HKUST-Aerial-Robotics/Fast-Planner/blob/2ddd7793eecd573dbb5b47e2c985aa06606df3cf/uav_simulator/Utils/multi_map_server/quadrotor_msgs/build/catkin_generated/installspace/_setup_util.py#L62-L81 | |
genn-team/genn | 75e1eb218cafa228bf36ae4613d1ce26e877b12c | pygenn/genn_groups.py | python | SynapseGroup.push_connectivity_to_device | (self) | Wrapper around GeNNModel.push_connectivity_to_device | Wrapper around GeNNModel.push_connectivity_to_device | [
"Wrapper",
"around",
"GeNNModel",
".",
"push_connectivity_to_device"
] | def push_connectivity_to_device(self):
"""Wrapper around GeNNModel.push_connectivity_to_device"""
self._model.push_connectivity_to_device(self.name) | [
"def",
"push_connectivity_to_device",
"(",
"self",
")",
":",
"self",
".",
"_model",
".",
"push_connectivity_to_device",
"(",
"self",
".",
"name",
")"
] | https://github.com/genn-team/genn/blob/75e1eb218cafa228bf36ae4613d1ce26e877b12c/pygenn/genn_groups.py#L1138-L1140 | ||
RcppCore/RcppParallel | ff49e84602a1771c06bc39fdea995447564f2b7f | src/tbb/python/tbb/__init__.py | python | TBBProcessPool3._repopulate_pool | (self) | Bring the number of pool processes up to the specified number,
for use after reaping workers which have exited. | Bring the number of pool processes up to the specified number,
for use after reaping workers which have exited. | [
"Bring",
"the",
"number",
"of",
"pool",
"processes",
"up",
"to",
"the",
"specified",
"number",
"for",
"use",
"after",
"reaping",
"workers",
"which",
"have",
"exited",
"."
] | def _repopulate_pool(self):
"""Bring the number of pool processes up to the specified number,
for use after reaping workers which have exited.
"""
from multiprocessing.util import debug
for i in range(self._processes - len(self._pool)):
w = self.Process(target=tbb_pr... | [
"def",
"_repopulate_pool",
"(",
"self",
")",
":",
"from",
"multiprocessing",
".",
"util",
"import",
"debug",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"_processes",
"-",
"len",
"(",
"self",
".",
"_pool",
")",
")",
":",
"w",
"=",
"self",
".",
"Proc... | https://github.com/RcppCore/RcppParallel/blob/ff49e84602a1771c06bc39fdea995447564f2b7f/src/tbb/python/tbb/__init__.py#L117-L134 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/apitools/ez_setup.py | python | use_setuptools | (
version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
download_delay=15
) | return do_download() | Automatically find/download setuptools and make it available on sys.path
`version` should be a valid setuptools version number that is available
as an egg for download under the `download_base` URL (which should end with
a '/'). `to_dir` is the directory where setuptools will be downloaded, if
it is n... | Automatically find/download setuptools and make it available on sys.path | [
"Automatically",
"find",
"/",
"download",
"setuptools",
"and",
"make",
"it",
"available",
"on",
"sys",
".",
"path"
] | def use_setuptools(
version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
download_delay=15
):
"""Automatically find/download setuptools and make it available on sys.path
`version` should be a valid setuptools version number that is available
as an egg for download under the `downlo... | [
"def",
"use_setuptools",
"(",
"version",
"=",
"DEFAULT_VERSION",
",",
"download_base",
"=",
"DEFAULT_URL",
",",
"to_dir",
"=",
"os",
".",
"curdir",
",",
"download_delay",
"=",
"15",
")",
":",
"was_imported",
"=",
"'pkg_resources'",
"in",
"sys",
".",
"modules",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/apitools/ez_setup.py#L53-L92 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/peacock/base/PreferenceWidget.py | python | PreferenceWidget.count | (self) | return len(self._widgets) | Returns the number of preferences widgets | Returns the number of preferences widgets | [
"Returns",
"the",
"number",
"of",
"preferences",
"widgets"
] | def count(self):
"""
Returns the number of preferences widgets
"""
return len(self._widgets) | [
"def",
"count",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_widgets",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/base/PreferenceWidget.py#L64-L68 | |
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | SourceRange.end | (self) | return conf.lib.clang_getRangeEnd(self) | Return a SourceLocation representing the last character within a
source range. | Return a SourceLocation representing the last character within a
source range. | [
"Return",
"a",
"SourceLocation",
"representing",
"the",
"last",
"character",
"within",
"a",
"source",
"range",
"."
] | def end(self):
"""
Return a SourceLocation representing the last character within a
source range.
"""
return conf.lib.clang_getRangeEnd(self) | [
"def",
"end",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getRangeEnd",
"(",
"self",
")"
] | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L256-L261 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextObjectList.__getitem__ | (*args, **kwargs) | return _richtext.RichTextObjectList___getitem__(*args, **kwargs) | __getitem__(self, size_t index) -> RichTextObject | __getitem__(self, size_t index) -> RichTextObject | [
"__getitem__",
"(",
"self",
"size_t",
"index",
")",
"-",
">",
"RichTextObject"
] | def __getitem__(*args, **kwargs):
"""__getitem__(self, size_t index) -> RichTextObject"""
return _richtext.RichTextObjectList___getitem__(*args, **kwargs) | [
"def",
"__getitem__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextObjectList___getitem__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L1530-L1532 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py | python | Series.axes | (self) | return [self.index] | Return a list of the row axis labels. | Return a list of the row axis labels. | [
"Return",
"a",
"list",
"of",
"the",
"row",
"axis",
"labels",
"."
] | def axes(self):
"""
Return a list of the row axis labels.
"""
return [self.index] | [
"def",
"axes",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"index",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py#L797-L801 | |
etternagame/etterna | 8775f74ac9c353320128609d4b4150672e9a6d04 | extern/crashpad/buildtools/checkdeps/builddeps.py | python | DepsBuilder._ApplyRules | (self, existing_rules, includes, specific_includes,
cur_dir_norm) | return rules | Applies the given include rules, returning the new rules.
Args:
existing_rules: A set of existing rules that will be combined.
include: The list of rules from the "include_rules" section of DEPS.
specific_includes: E.g. {'.*_unittest\.cc': ['+foo', '-blat']} rules
from th... | Applies the given include rules, returning the new rules. | [
"Applies",
"the",
"given",
"include",
"rules",
"returning",
"the",
"new",
"rules",
"."
] | def _ApplyRules(self, existing_rules, includes, specific_includes,
cur_dir_norm):
"""Applies the given include rules, returning the new rules.
Args:
existing_rules: A set of existing rules that will be combined.
include: The list of rules from the "include_rules" section of DEPS.
... | [
"def",
"_ApplyRules",
"(",
"self",
",",
"existing_rules",
",",
"includes",
",",
"specific_includes",
",",
"cur_dir_norm",
")",
":",
"rules",
"=",
"copy",
".",
"deepcopy",
"(",
"existing_rules",
")",
"# First apply the implicit \"allow\" rule for the current directory.",
... | https://github.com/etternagame/etterna/blob/8775f74ac9c353320128609d4b4150672e9a6d04/extern/crashpad/buildtools/checkdeps/builddeps.py#L124-L187 | |
greenheartgames/greenworks | 3ea4ab490b56676de3f0a237c74bcfdb17323e60 | deps/cpplint/cpplint.py | python | ParseNolintSuppressions | (filename, raw_line, linenum, error) | Updates the global list of line error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, the name of the input file.
raw_line: str, the line of input text, with comments... | Updates the global list of line error-suppressions. | [
"Updates",
"the",
"global",
"list",
"of",
"line",
"error",
"-",
"suppressions",
"."
] | def ParseNolintSuppressions(filename, raw_line, linenum, error):
"""Updates the global list of line error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, the name of th... | [
"def",
"ParseNolintSuppressions",
"(",
"filename",
",",
"raw_line",
",",
"linenum",
",",
"error",
")",
":",
"matched",
"=",
"Search",
"(",
"r'\\bNOLINT(NEXTLINE)?\\b(\\([^)]+\\))?'",
",",
"raw_line",
")",
"if",
"matched",
":",
"if",
"matched",
".",
"group",
"(",... | https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L571-L600 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/framework/function.py | python | _DefinedFunction.definition | (self) | return self._definition | Function definition proto. | Function definition proto. | [
"Function",
"definition",
"proto",
"."
] | def definition(self):
"""Function definition proto."""
self._create_definition_if_needed()
return self._definition | [
"def",
"definition",
"(",
"self",
")",
":",
"self",
".",
"_create_definition_if_needed",
"(",
")",
"return",
"self",
".",
"_definition"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/function.py#L461-L464 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.SetCaretWidth | (*args, **kwargs) | return _stc.StyledTextCtrl_SetCaretWidth(*args, **kwargs) | SetCaretWidth(self, int pixelWidth)
Set the width of the insert mode caret. | SetCaretWidth(self, int pixelWidth) | [
"SetCaretWidth",
"(",
"self",
"int",
"pixelWidth",
")"
] | def SetCaretWidth(*args, **kwargs):
"""
SetCaretWidth(self, int pixelWidth)
Set the width of the insert mode caret.
"""
return _stc.StyledTextCtrl_SetCaretWidth(*args, **kwargs) | [
"def",
"SetCaretWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_SetCaretWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L3697-L3703 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/sessions.py | python | SessionRedirectMixin.rebuild_auth | (self, prepared_request, response) | return | When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss. | When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss. | [
"When",
"being",
"redirected",
"we",
"may",
"want",
"to",
"strip",
"authentication",
"from",
"the",
"request",
"to",
"avoid",
"leaking",
"credentials",
".",
"This",
"method",
"intelligently",
"removes",
"and",
"reapplies",
"authentication",
"where",
"possible",
"t... | def rebuild_auth(self, prepared_request, response):
"""
When being redirected we may want to strip authentication from the
request to avoid leaking credentials. This method intelligently removes
and reapplies authentication where possible to avoid credential loss.
"""
hea... | [
"def",
"rebuild_auth",
"(",
"self",
",",
"prepared_request",
",",
"response",
")",
":",
"headers",
"=",
"prepared_request",
".",
"headers",
"url",
"=",
"prepared_request",
".",
"url",
"if",
"'Authorization'",
"in",
"headers",
":",
"# If we get redirected to a new ho... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/sessions.py#L204-L227 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/multitype_ops/add_impl.py | python | _tensor_add_tensor | (x, y) | return F.add(x, y) | Returns x + y element-wise.
Args:
x (Tensor): x
y (Tensor): The dtype is same as x.
Returns:
Tensor, has the same dtype as x. | Returns x + y element-wise. | [
"Returns",
"x",
"+",
"y",
"element",
"-",
"wise",
"."
] | def _tensor_add_tensor(x, y):
"""
Returns x + y element-wise.
Args:
x (Tensor): x
y (Tensor): The dtype is same as x.
Returns:
Tensor, has the same dtype as x.
"""
return F.add(x, y) | [
"def",
"_tensor_add_tensor",
"(",
"x",
",",
"y",
")",
":",
"return",
"F",
".",
"add",
"(",
"x",
",",
"y",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/add_impl.py#L201-L212 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/serialwin32.py | python | Serial._reconfigure_port | (self) | Set communication parameters on opened port. | Set communication parameters on opened port. | [
"Set",
"communication",
"parameters",
"on",
"opened",
"port",
"."
] | def _reconfigure_port(self):
"""Set communication parameters on opened port."""
if not self._port_handle:
raise SerialException("Can only operate on a valid port handle")
# Set Windows timeout values
# timeouts is a tuple with the following items:
# (ReadIntervalTime... | [
"def",
"_reconfigure_port",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_port_handle",
":",
"raise",
"SerialException",
"(",
"\"Can only operate on a valid port handle\"",
")",
"# Set Windows timeout values",
"# timeouts is a tuple with the following items:",
"# (ReadInte... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/serialwin32.py#L98-L222 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/utils/unpacking.py | python | untar_file | (filename, location) | Untar the file (with path `filename`) to the destination `location`.
All files are written based on system defaults and umask (i.e. permissions
are not preserved), except that regular file members with any execute
permissions (user, group, or world) have "chmod +x" applied after being
written. Note tha... | Untar the file (with path `filename`) to the destination `location`.
All files are written based on system defaults and umask (i.e. permissions
are not preserved), except that regular file members with any execute
permissions (user, group, or world) have "chmod +x" applied after being
written. Note tha... | [
"Untar",
"the",
"file",
"(",
"with",
"path",
"filename",
")",
"to",
"the",
"destination",
"location",
".",
"All",
"files",
"are",
"written",
"based",
"on",
"system",
"defaults",
"and",
"umask",
"(",
"i",
".",
"e",
".",
"permissions",
"are",
"not",
"prese... | def untar_file(filename, location):
# type: (str, str) -> None
"""
Untar the file (with path `filename`) to the destination `location`.
All files are written based on system defaults and umask (i.e. permissions
are not preserved), except that regular file members with any execute
permissions (us... | [
"def",
"untar_file",
"(",
"filename",
",",
"location",
")",
":",
"# type: (str, str) -> None",
"ensure_dir",
"(",
"location",
")",
"if",
"filename",
".",
"lower",
"(",
")",
".",
"endswith",
"(",
"'.gz'",
")",
"or",
"filename",
".",
"lower",
"(",
")",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/utils/unpacking.py#L161-L239 | ||
rbgirshick/caffe-fast-rcnn | 28a579eaf0668850705598b3075b8969f22226d9 | scripts/cpp_lint.py | python | _IncludeState.CanonicalizeAlphabeticalOrder | (self, header_path) | return header_path.replace('-inl.h', '.h').replace('-', '_').lower() | Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_path: Path to be canonicalized.
Returns:
Canonicali... | Returns a path canonicalized for alphabetical comparison. | [
"Returns",
"a",
"path",
"canonicalized",
"for",
"alphabetical",
"comparison",
"."
] | def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
- replaces "-" with "_" so they both cmp the same.
- removes '-inl' since we don't require them to be after the main header.
- lowercase everything, just in case.
Args:
header_p... | [
"def",
"CanonicalizeAlphabeticalOrder",
"(",
"self",
",",
"header_path",
")",
":",
"return",
"header_path",
".",
"replace",
"(",
"'-inl.h'",
",",
"'.h'",
")",
".",
"replace",
"(",
"'-'",
",",
"'_'",
")",
".",
"lower",
"(",
")"
] | https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/scripts/cpp_lint.py#L597-L610 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/fixer_util.py | python | FromImport | (package_name, name_leafs) | return imp | Return an import statement in the form:
from package import name_leafs | Return an import statement in the form:
from package import name_leafs | [
"Return",
"an",
"import",
"statement",
"in",
"the",
"form",
":",
"from",
"package",
"import",
"name_leafs"
] | def FromImport(package_name, name_leafs):
""" Return an import statement in the form:
from package import name_leafs"""
# XXX: May not handle dotted imports properly (eg, package_name='foo.bar')
#assert package_name == '.' or '.' not in package_name, "FromImport has "\
# "not been tested w... | [
"def",
"FromImport",
"(",
"package_name",
",",
"name_leafs",
")",
":",
"# XXX: May not handle dotted imports properly (eg, package_name='foo.bar')",
"#assert package_name == '.' or '.' not in package_name, \"FromImport has \"\\",
"# \"not been tested with dotted package names -- use at you... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/fixer_util.py#L113-L130 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/gradle/generate_gradle.py | python | _CreateJavaSourceDir | (entry_output_dir, java_sources_file) | return java_dirs | Computes and constructs when necessary the list of java source directories.
1. Computes the root java source directories from the list of files.
2. Determines whether there are any .java files in them that are not included
in |java_sources_file|.
3. If not, returns the list of java source directories. If so... | Computes and constructs when necessary the list of java source directories. | [
"Computes",
"and",
"constructs",
"when",
"necessary",
"the",
"list",
"of",
"java",
"source",
"directories",
"."
] | def _CreateJavaSourceDir(entry_output_dir, java_sources_file):
"""Computes and constructs when necessary the list of java source directories.
1. Computes the root java source directories from the list of files.
2. Determines whether there are any .java files in them that are not included
in |java_sources_fi... | [
"def",
"_CreateJavaSourceDir",
"(",
"entry_output_dir",
",",
"java_sources_file",
")",
":",
"java_dirs",
"=",
"[",
"]",
"if",
"java_sources_file",
":",
"java_files",
"=",
"_RebasePath",
"(",
"build_utils",
".",
"ReadSourcesList",
"(",
"java_sources_file",
")",
")",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/gradle/generate_gradle.py#L167-L193 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextBuffer.EndFontSize | (*args, **kwargs) | return _richtext.RichTextBuffer_EndFontSize(*args, **kwargs) | EndFontSize(self) -> bool | EndFontSize(self) -> bool | [
"EndFontSize",
"(",
"self",
")",
"-",
">",
"bool"
] | def EndFontSize(*args, **kwargs):
"""EndFontSize(self) -> bool"""
return _richtext.RichTextBuffer_EndFontSize(*args, **kwargs) | [
"def",
"EndFontSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_EndFontSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2361-L2363 | |
musescore/MuseScore | a817fea23e3c2be30847b7fde5b01746222c252e | tools/crashdump/posix/generate_breakpad_symbols.py | python | Resolve | (path, exe_path, loader_path, rpaths) | return path | Resolve a dyld path.
@executable_path is replaced with |exe_path|
@loader_path is replaced with |loader_path|
@rpath is replaced with the first path in |rpaths| where the referenced file
is found | Resolve a dyld path. | [
"Resolve",
"a",
"dyld",
"path",
"."
] | def Resolve(path, exe_path, loader_path, rpaths):
"""Resolve a dyld path.
@executable_path is replaced with |exe_path|
@loader_path is replaced with |loader_path|
@rpath is replaced with the first path in |rpaths| where the referenced file
is found
"""
path = path.replace('@loader_path', loader_path)... | [
"def",
"Resolve",
"(",
"path",
",",
"exe_path",
",",
"loader_path",
",",
"rpaths",
")",
":",
"path",
"=",
"path",
".",
"replace",
"(",
"'@loader_path'",
",",
"loader_path",
")",
"path",
"=",
"path",
".",
"replace",
"(",
"'@executable_path'",
",",
"exe_path... | https://github.com/musescore/MuseScore/blob/a817fea23e3c2be30847b7fde5b01746222c252e/tools/crashdump/posix/generate_breakpad_symbols.py#L47-L63 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | SizerItemWindow | (*args, **kwargs) | return val | SizerItemWindow(Window window, int proportion=0, int flag=0, int border=0,
PyObject userData=None) -> SizerItem
Constructs a `wx.SizerItem` for tracking a window. | SizerItemWindow(Window window, int proportion=0, int flag=0, int border=0,
PyObject userData=None) -> SizerItem | [
"SizerItemWindow",
"(",
"Window",
"window",
"int",
"proportion",
"=",
"0",
"int",
"flag",
"=",
"0",
"int",
"border",
"=",
"0",
"PyObject",
"userData",
"=",
"None",
")",
"-",
">",
"SizerItem"
] | def SizerItemWindow(*args, **kwargs):
"""
SizerItemWindow(Window window, int proportion=0, int flag=0, int border=0,
PyObject userData=None) -> SizerItem
Constructs a `wx.SizerItem` for tracking a window.
"""
val = _core_.new_SizerItemWindow(*args, **kwargs)
return val | [
"def",
"SizerItemWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_core_",
".",
"new_SizerItemWindow",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L14385-L14393 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBStructuredData.GetValueForKey | (self, key) | return _lldb.SBStructuredData_GetValueForKey(self, key) | GetValueForKey(SBStructuredData self, char const * key) -> SBStructuredData | GetValueForKey(SBStructuredData self, char const * key) -> SBStructuredData | [
"GetValueForKey",
"(",
"SBStructuredData",
"self",
"char",
"const",
"*",
"key",
")",
"-",
">",
"SBStructuredData"
] | def GetValueForKey(self, key):
"""GetValueForKey(SBStructuredData self, char const * key) -> SBStructuredData"""
return _lldb.SBStructuredData_GetValueForKey(self, key) | [
"def",
"GetValueForKey",
"(",
"self",
",",
"key",
")",
":",
"return",
"_lldb",
".",
"SBStructuredData_GetValueForKey",
"(",
"self",
",",
"key",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L9713-L9715 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/tools/scan-build-py/libscanbuild/report.py | python | create_counters | () | return predicate | Create counters for bug statistics.
Two entries are maintained: 'total' is an integer, represents the
number of bugs. The 'categories' is a two level categorisation of bug
counters. The first level is 'bug category' the second is 'bug type'.
Each entry in this classification is a dictionary of 'count',... | Create counters for bug statistics. | [
"Create",
"counters",
"for",
"bug",
"statistics",
"."
] | def create_counters():
""" Create counters for bug statistics.
Two entries are maintained: 'total' is an integer, represents the
number of bugs. The 'categories' is a two level categorisation of bug
counters. The first level is 'bug category' the second is 'bug type'.
Each entry in this classificat... | [
"def",
"create_counters",
"(",
")",
":",
"def",
"predicate",
"(",
"bug",
")",
":",
"bug_category",
"=",
"bug",
"[",
"'bug_category'",
"]",
"bug_type",
"=",
"bug",
"[",
"'bug_type'",
"]",
"current_category",
"=",
"predicate",
".",
"categories",
".",
"get",
... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/tools/scan-build-py/libscanbuild/report.py#L369-L394 | |
microsoft/clang | 86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5 | bindings/python/clang/cindex.py | python | TranslationUnit.from_ast_file | (cls, filename, index=None) | return cls(ptr=ptr, index=index) | Create a TranslationUnit instance from a saved AST file.
A previously-saved AST file (provided with -emit-ast or
TranslationUnit.save()) is loaded from the filename specified.
If the file cannot be loaded, a TranslationUnitLoadError will be
raised.
index is optional and is the... | Create a TranslationUnit instance from a saved AST file. | [
"Create",
"a",
"TranslationUnit",
"instance",
"from",
"a",
"saved",
"AST",
"file",
"."
] | def from_ast_file(cls, filename, index=None):
"""Create a TranslationUnit instance from a saved AST file.
A previously-saved AST file (provided with -emit-ast or
TranslationUnit.save()) is loaded from the filename specified.
If the file cannot be loaded, a TranslationUnitLoadError will... | [
"def",
"from_ast_file",
"(",
"cls",
",",
"filename",
",",
"index",
"=",
"None",
")",
":",
"if",
"index",
"is",
"None",
":",
"index",
"=",
"Index",
".",
"create",
"(",
")",
"ptr",
"=",
"conf",
".",
"lib",
".",
"clang_createTranslationUnit",
"(",
"index"... | https://github.com/microsoft/clang/blob/86d4513d3e0daa4d5a29b0b1de7c854ca15f9fe5/bindings/python/clang/cindex.py#L2818-L2837 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/mox3/mox3/mox.py | python | MockAnything._Reset | (self) | Reset the state of this mock to record mode with an empty queue. | Reset the state of this mock to record mode with an empty queue. | [
"Reset",
"the",
"state",
"of",
"this",
"mock",
"to",
"record",
"mode",
"with",
"an",
"empty",
"queue",
"."
] | def _Reset(self):
"""Reset the state of this mock to record mode with an empty queue."""
# Maintain a list of method calls we are expecting
self._expected_calls_queue = collections.deque()
# Make sure we are in setup mode, not replay mode
self._replay_mode = False | [
"def",
"_Reset",
"(",
"self",
")",
":",
"# Maintain a list of method calls we are expecting",
"self",
".",
"_expected_calls_queue",
"=",
"collections",
".",
"deque",
"(",
")",
"# Make sure we are in setup mode, not replay mode",
"self",
".",
"_replay_mode",
"=",
"False"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/mox3/mox3/mox.py#L545-L552 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/multiprocessing/util.py | python | get_logger | () | return _logger | Returns logger used by multiprocessing | Returns logger used by multiprocessing | [
"Returns",
"logger",
"used",
"by",
"multiprocessing"
] | def get_logger():
'''
Returns logger used by multiprocessing
'''
global _logger
import logging
logging._acquireLock()
try:
if not _logger:
_logger = logging.getLogger(LOGGER_NAME)
_logger.propagate = 0
# XXX multiprocessing should cleanup before... | [
"def",
"get_logger",
"(",
")",
":",
"global",
"_logger",
"import",
"logging",
"logging",
".",
"_acquireLock",
"(",
")",
"try",
":",
"if",
"not",
"_logger",
":",
"_logger",
"=",
"logging",
".",
"getLogger",
"(",
"LOGGER_NAME",
")",
"_logger",
".",
"propagat... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/util.py#L60-L85 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/contrib/tensorrt.py | python | set_use_fp16 | (status) | Set an environment variable which will enable or disable the use of FP16 precision in
TensorRT
Note: The mode FP16 force the whole TRT node to be executed in FP16
:param status: Boolean, True if TensorRT should run in FP16, False for FP32 | Set an environment variable which will enable or disable the use of FP16 precision in
TensorRT
Note: The mode FP16 force the whole TRT node to be executed in FP16
:param status: Boolean, True if TensorRT should run in FP16, False for FP32 | [
"Set",
"an",
"environment",
"variable",
"which",
"will",
"enable",
"or",
"disable",
"the",
"use",
"of",
"FP16",
"precision",
"in",
"TensorRT",
"Note",
":",
"The",
"mode",
"FP16",
"force",
"the",
"whole",
"TRT",
"node",
"to",
"be",
"executed",
"in",
"FP16",... | def set_use_fp16(status):
"""
Set an environment variable which will enable or disable the use of FP16 precision in
TensorRT
Note: The mode FP16 force the whole TRT node to be executed in FP16
:param status: Boolean, True if TensorRT should run in FP16, False for FP32
"""
os.environ["MXNET_T... | [
"def",
"set_use_fp16",
"(",
"status",
")",
":",
"os",
".",
"environ",
"[",
"\"MXNET_TENSORRT_USE_FP16\"",
"]",
"=",
"str",
"(",
"int",
"(",
"status",
")",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/contrib/tensorrt.py#L21-L28 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/layers/python/layers/layers.py | python | batch_norm | (inputs,
decay=0.999,
center=True,
scale=False,
epsilon=0.001,
activation_fn=None,
param_initializers=None,
param_regularizers=None,
updates_collections=ops.GraphKeys.UPDATE_OPS,
is_tra... | Adds a Batch Normalization layer from http://arxiv.org/abs/1502.03167.
"Batch Normalization: Accelerating Deep Network Training by Reducing
Internal Covariate Shift"
Sergey Ioffe, Christian Szegedy
Can be used as a normalizer function for conv2d and fully_connected.
Note: when training, the moving_m... | Adds a Batch Normalization layer from http://arxiv.org/abs/1502.03167. | [
"Adds",
"a",
"Batch",
"Normalization",
"layer",
"from",
"http",
":",
"//",
"arxiv",
".",
"org",
"/",
"abs",
"/",
"1502",
".",
"03167",
"."
] | def batch_norm(inputs,
decay=0.999,
center=True,
scale=False,
epsilon=0.001,
activation_fn=None,
param_initializers=None,
param_regularizers=None,
updates_collections=ops.GraphKeys.UPDATE_OPS,
... | [
"def",
"batch_norm",
"(",
"inputs",
",",
"decay",
"=",
"0.999",
",",
"center",
"=",
"True",
",",
"scale",
"=",
"False",
",",
"epsilon",
"=",
"0.001",
",",
"activation_fn",
"=",
"None",
",",
"param_initializers",
"=",
"None",
",",
"param_regularizers",
"=",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/layers.py#L445-L842 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py | python | _SparseMetaData.__init__ | (self, sparse, map_op, rank) | Create the metadata.
Args:
sparse: Python boolean.
map_op: The `Operation` that created the `SparseTensorsMap` in question.
This Op contains information about the underlying Map object and the
dtype of the original data.
rank: The statically known rank of the `SparseTensor`. | Create the metadata. | [
"Create",
"the",
"metadata",
"."
] | def __init__(self, sparse, map_op, rank):
"""Create the metadata.
Args:
sparse: Python boolean.
map_op: The `Operation` that created the `SparseTensorsMap` in question.
This Op contains information about the underlying Map object and the
dtype of the original data.
rank: The s... | [
"def",
"__init__",
"(",
"self",
",",
"sparse",
",",
"map_op",
",",
"rank",
")",
":",
"self",
".",
"_sparse",
"=",
"sparse",
"self",
".",
"_map_op",
"=",
"map_op",
"self",
".",
"_rank",
"=",
"tensor_shape",
".",
"Dimension",
"(",
"rank",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/training/input.py#L389-L401 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/psutil/psutil/__init__.py | python | disk_usage | (path) | return _psplatform.get_disk_usage(path) | Return disk usage statistics about the given path as a namedtuple
including total, used and free space expressed in bytes plus the
percentage usage. | Return disk usage statistics about the given path as a namedtuple
including total, used and free space expressed in bytes plus the
percentage usage. | [
"Return",
"disk",
"usage",
"statistics",
"about",
"the",
"given",
"path",
"as",
"a",
"namedtuple",
"including",
"total",
"used",
"and",
"free",
"space",
"expressed",
"in",
"bytes",
"plus",
"the",
"percentage",
"usage",
"."
] | def disk_usage(path):
"""Return disk usage statistics about the given path as a namedtuple
including total, used and free space expressed in bytes plus the
percentage usage.
"""
return _psplatform.get_disk_usage(path) | [
"def",
"disk_usage",
"(",
"path",
")",
":",
"return",
"_psplatform",
".",
"get_disk_usage",
"(",
"path",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/__init__.py#L1191-L1196 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/plot.py | python | PlotCanvas.SetPointLabelFunc | (self, func) | Sets the function with custom code for pointLabel drawing
******** more info needed *************** | Sets the function with custom code for pointLabel drawing
******** more info needed *************** | [
"Sets",
"the",
"function",
"with",
"custom",
"code",
"for",
"pointLabel",
"drawing",
"********",
"more",
"info",
"needed",
"***************"
] | def SetPointLabelFunc(self, func):
"""Sets the function with custom code for pointLabel drawing
******** more info needed ***************
"""
self._pointLabelFunc = func | [
"def",
"SetPointLabelFunc",
"(",
"self",
",",
"func",
")",
":",
"self",
".",
"_pointLabelFunc",
"=",
"func"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/plot.py#L988-L992 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/sessions.py | python | Session.request | (self, method, url,
params=None, data=None, headers=None, cookies=None, files=None,
auth=None, timeout=None, allow_redirects=True, proxies=None,
hooks=None, stream=None, verify=None, cert=None, json=None) | return resp | Constructs a :class:`Request <Request>`, prepares it and sends it.
Returns :class:`Response <Response>` object.
:param method: method for the new :class:`Request` object.
:param url: URL for the new :class:`Request` object.
:param params: (optional) Dictionary or bytes to be sent in the... | Constructs a :class:`Request <Request>`, prepares it and sends it.
Returns :class:`Response <Response>` object. | [
"Constructs",
"a",
":",
"class",
":",
"Request",
"<Request",
">",
"prepares",
"it",
"and",
"sends",
"it",
".",
"Returns",
":",
"class",
":",
"Response",
"<Response",
">",
"object",
"."
] | def request(self, method, url,
params=None, data=None, headers=None, cookies=None, files=None,
auth=None, timeout=None, allow_redirects=True, proxies=None,
hooks=None, stream=None, verify=None, cert=None, json=None):
"""Constructs a :class:`Request <Request>`, prepares it and... | [
"def",
"request",
"(",
"self",
",",
"method",
",",
"url",
",",
"params",
"=",
"None",
",",
"data",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"cookies",
"=",
"None",
",",
"files",
"=",
"None",
",",
"auth",
"=",
"None",
",",
"timeout",
"=",
"N... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/sessions.py#L466-L535 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatToolbarItem.Select | (self, select=True) | Selects or checks a radio or check item.
:param bool `select`: ``True`` to select or check a tool, ``False`` to unselect
or uncheck it. | Selects or checks a radio or check item. | [
"Selects",
"or",
"checks",
"a",
"radio",
"or",
"check",
"item",
"."
] | def Select(self, select=True):
"""
Selects or checks a radio or check item.
:param bool `select`: ``True`` to select or check a tool, ``False`` to unselect
or uncheck it.
"""
self._selected = select | [
"def",
"Select",
"(",
"self",
",",
"select",
"=",
"True",
")",
":",
"self",
".",
"_selected",
"=",
"select"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L4702-L4710 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/lib/debug_data.py | python | DebugDumpDir.transitive_inputs | (self,
node_name,
include_control=True,
include_reversed_ref=False,
device_name=None,) | return tracer.inputs() | Get the transitive inputs of given node according to partition graphs.
Args:
node_name: Name of the node.
include_control: Include control inputs (True by default).
include_reversed_ref: Whether a ref input, say from A to B, is to be also
considered as an input from B to A. The rationale ... | Get the transitive inputs of given node according to partition graphs. | [
"Get",
"the",
"transitive",
"inputs",
"of",
"given",
"node",
"according",
"to",
"partition",
"graphs",
"."
] | def transitive_inputs(self,
node_name,
include_control=True,
include_reversed_ref=False,
device_name=None,):
"""Get the transitive inputs of given node according to partition graphs.
Args:
node_name: Name of t... | [
"def",
"transitive_inputs",
"(",
"self",
",",
"node_name",
",",
"include_control",
"=",
"True",
",",
"include_reversed_ref",
"=",
"False",
",",
"device_name",
"=",
"None",
",",
")",
":",
"if",
"not",
"self",
".",
"_debug_graphs",
":",
"raise",
"LookupError",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/debug_data.py#L1093-L1135 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintsmolecule.py | python | LibmintsMolecule.full_geometry | (self, np_out=False) | Returns the full (dummies included) geometry in Bohr as a N X 3 array.
>>> print(H2OH2O.full_geometry())
[[-2.930978460188563, -0.21641143673806384, 0.0], [-3.655219780069251, 1.4409218455037016, 0.0], [-1.1332252981904638, 0.0769345303220403, 0.0], [0.0, 0.0, 0.0], [2.5523113582286716, 0.2106458823066... | Returns the full (dummies included) geometry in Bohr as a N X 3 array. | [
"Returns",
"the",
"full",
"(",
"dummies",
"included",
")",
"geometry",
"in",
"Bohr",
"as",
"a",
"N",
"X",
"3",
"array",
"."
] | def full_geometry(self, np_out=False):
"""Returns the full (dummies included) geometry in Bohr as a N X 3 array.
>>> print(H2OH2O.full_geometry())
[[-2.930978460188563, -0.21641143673806384, 0.0], [-3.655219780069251, 1.4409218455037016, 0.0], [-1.1332252981904638, 0.0769345303220403, 0.0], [0.... | [
"def",
"full_geometry",
"(",
"self",
",",
"np_out",
"=",
"False",
")",
":",
"geom",
"=",
"np",
".",
"asarray",
"(",
"[",
"self",
".",
"full_atoms",
"[",
"at",
"]",
".",
"compute",
"(",
")",
"for",
"at",
"in",
"range",
"(",
"self",
".",
"nallatom",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsmolecule.py#L1249-L1261 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/shape_base.py | python | get_array_prepare | (*args) | return None | Find the wrapper for the array with the highest priority.
In case of ties, leftmost wins. If no wrapper is found, return None | Find the wrapper for the array with the highest priority. | [
"Find",
"the",
"wrapper",
"for",
"the",
"array",
"with",
"the",
"highest",
"priority",
"."
] | def get_array_prepare(*args):
"""Find the wrapper for the array with the highest priority.
In case of ties, leftmost wins. If no wrapper is found, return None
"""
wrappers = sorted((getattr(x, '__array_priority__', 0), -i,
x.__array_prepare__) for i, x in enumerate(args)
... | [
"def",
"get_array_prepare",
"(",
"*",
"args",
")",
":",
"wrappers",
"=",
"sorted",
"(",
"(",
"getattr",
"(",
"x",
",",
"'__array_priority__'",
",",
"0",
")",
",",
"-",
"i",
",",
"x",
".",
"__array_prepare__",
")",
"for",
"i",
",",
"x",
"in",
"enumera... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/shape_base.py#L1036-L1046 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewModelNotifier.SetOwner | (*args, **kwargs) | return _dataview.DataViewModelNotifier_SetOwner(*args, **kwargs) | SetOwner(self, DataViewModel owner)
Sets the owner (the model) of this notifier. Used internally. | SetOwner(self, DataViewModel owner) | [
"SetOwner",
"(",
"self",
"DataViewModel",
"owner",
")"
] | def SetOwner(*args, **kwargs):
"""
SetOwner(self, DataViewModel owner)
Sets the owner (the model) of this notifier. Used internally.
"""
return _dataview.DataViewModelNotifier_SetOwner(*args, **kwargs) | [
"def",
"SetOwner",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewModelNotifier_SetOwner",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L276-L282 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | MenuBar.EnableTop | (*args, **kwargs) | return _core_.MenuBar_EnableTop(*args, **kwargs) | EnableTop(self, size_t pos, bool enable) | EnableTop(self, size_t pos, bool enable) | [
"EnableTop",
"(",
"self",
"size_t",
"pos",
"bool",
"enable",
")"
] | def EnableTop(*args, **kwargs):
"""EnableTop(self, size_t pos, bool enable)"""
return _core_.MenuBar_EnableTop(*args, **kwargs) | [
"def",
"EnableTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuBar_EnableTop",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12296-L12298 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/mimify.py | python | mimify_part | (ifile, ofile, is_mime) | Convert an 8bit part of a MIME mail message to quoted-printable. | Convert an 8bit part of a MIME mail message to quoted-printable. | [
"Convert",
"an",
"8bit",
"part",
"of",
"a",
"MIME",
"mail",
"message",
"to",
"quoted",
"-",
"printable",
"."
] | def mimify_part(ifile, ofile, is_mime):
"""Convert an 8bit part of a MIME mail message to quoted-printable."""
has_cte = is_qp = is_base64 = 0
multipart = None
must_quote_body = must_quote_header = has_iso_chars = 0
header = []
header_end = ''
message = []
message_end = ''
# read he... | [
"def",
"mimify_part",
"(",
"ifile",
",",
"ofile",
",",
"is_mime",
")",
":",
"has_cte",
"=",
"is_qp",
"=",
"is_base64",
"=",
"0",
"multipart",
"=",
"None",
"must_quote_body",
"=",
"must_quote_header",
"=",
"has_iso_chars",
"=",
"0",
"header",
"=",
"[",
"]",... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mimify.py#L280-L413 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | gpu/command_buffer/build_gles2_cmd_buffer.py | python | DELnHandler.WriteImmediateServiceUnitTest | (self, func, file) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def WriteImmediateServiceUnitTest(self, func, file):
"""Overrriden from TypeHandler."""
valid_test = """
TEST_F(%(test_name)s, %(name)sValidArgs) {
EXPECT_CALL(
*gl_,
%(gl_func_name)s(1, Pointee(kService%(upper_resource_name)sId)))
.Times(1);
cmds::%(name)s& cmd = *GetImmediateAs<cmds::%(n... | [
"def",
"WriteImmediateServiceUnitTest",
"(",
"self",
",",
"func",
",",
"file",
")",
":",
"valid_test",
"=",
"\"\"\"\nTEST_F(%(test_name)s, %(name)sValidArgs) {\n EXPECT_CALL(\n *gl_,\n %(gl_func_name)s(1, Pointee(kService%(upper_resource_name)sId)))\n .Times(1);\n cmds::%(na... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L4320-L4352 | ||
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | BoolSortRef.cast | (self, val) | return val | Try to cast `val` as a Boolean.
>>> x = BoolSort().cast(True)
>>> x
True
>>> is_expr(x)
True
>>> is_expr(True)
False
>>> x.sort()
Bool | Try to cast `val` as a Boolean. | [
"Try",
"to",
"cast",
"val",
"as",
"a",
"Boolean",
"."
] | def cast(self, val):
"""Try to cast `val` as a Boolean.
>>> x = BoolSort().cast(True)
>>> x
True
>>> is_expr(x)
True
>>> is_expr(True)
False
>>> x.sort()
Bool
"""
if isinstance(val, bool):
return BoolVal(val, se... | [
"def",
"cast",
"(",
"self",
",",
"val",
")",
":",
"if",
"isinstance",
"(",
"val",
",",
"bool",
")",
":",
"return",
"BoolVal",
"(",
"val",
",",
"self",
".",
"ctx",
")",
"if",
"z3_debug",
"(",
")",
":",
"if",
"not",
"is_expr",
"(",
"val",
")",
":... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L1487-L1508 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/ops.py | python | SparseTensor.values | (self) | return self._values | The non-zero values in the represented dense tensor.
Returns:
A 1-D Tensor of any data type. | The non-zero values in the represented dense tensor. | [
"The",
"non",
"-",
"zero",
"values",
"in",
"the",
"represented",
"dense",
"tensor",
"."
] | def values(self):
"""The non-zero values in the represented dense tensor.
Returns:
A 1-D Tensor of any data type.
"""
return self._values | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"self",
".",
"_values"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/ops.py#L1007-L1013 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/jax/utils.py | python | tree_leaf_isreal | (pars: PyTree) | return any(jax.tree_leaves(jax.tree_map(is_real, pars))) | Returns true if at least one leaf in the tree has real dtype. | Returns true if at least one leaf in the tree has real dtype. | [
"Returns",
"true",
"if",
"at",
"least",
"one",
"leaf",
"in",
"the",
"tree",
"has",
"real",
"dtype",
"."
] | def tree_leaf_isreal(pars: PyTree) -> bool:
"""
Returns true if at least one leaf in the tree has real dtype.
"""
return any(jax.tree_leaves(jax.tree_map(is_real, pars))) | [
"def",
"tree_leaf_isreal",
"(",
"pars",
":",
"PyTree",
")",
"->",
"bool",
":",
"return",
"any",
"(",
"jax",
".",
"tree_leaves",
"(",
"jax",
".",
"tree_map",
"(",
"is_real",
",",
"pars",
")",
")",
")"
] | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/jax/utils.py#L97-L101 | |
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/mpcd/data.py | python | system.take_snapshot | (self, particles=True) | return snapshot(self.data.takeSnapshot(particles)) | R""" Takes a snapshot of the current state of the MPCD system
Args:
particles (bool): If true, include particle data in snapshot
Examples::
snap = mpcd_sys.take_snapshot() | R""" Takes a snapshot of the current state of the MPCD system | [
"R",
"Takes",
"a",
"snapshot",
"of",
"the",
"current",
"state",
"of",
"the",
"MPCD",
"system"
] | def take_snapshot(self, particles=True):
R""" Takes a snapshot of the current state of the MPCD system
Args:
particles (bool): If true, include particle data in snapshot
Examples::
snap = mpcd_sys.take_snapshot()
"""
return snapshot(self.data.takeSnaps... | [
"def",
"take_snapshot",
"(",
"self",
",",
"particles",
"=",
"True",
")",
":",
"return",
"snapshot",
"(",
"self",
".",
"data",
".",
"takeSnapshot",
"(",
"particles",
")",
")"
] | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/mpcd/data.py#L260-L271 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/misc/shapefile.py | python | Reader.shapeRecord | (self, i=0) | return _ShapeRecord(shape=self.shape(i),
record=self.record(i)) | Returns a combination geometry and attribute record for the
supplied record index. | Returns a combination geometry and attribute record for the
supplied record index. | [
"Returns",
"a",
"combination",
"geometry",
"and",
"attribute",
"record",
"for",
"the",
"supplied",
"record",
"index",
"."
] | def shapeRecord(self, i=0):
"""Returns a combination geometry and attribute record for the
supplied record index."""
i = self.__restrictIndex(i)
return _ShapeRecord(shape=self.shape(i),
record=self.record(i)) | [
"def",
"shapeRecord",
"(",
"self",
",",
"i",
"=",
"0",
")",
":",
"i",
"=",
"self",
".",
"__restrictIndex",
"(",
"i",
")",
"return",
"_ShapeRecord",
"(",
"shape",
"=",
"self",
".",
"shape",
"(",
"i",
")",
",",
"record",
"=",
"self",
".",
"record",
... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/misc/shapefile.py#L453-L458 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/regression/linear_regression.py | python | LinearRegression.__repr__ | (self) | return _toolkit_repr_print(self, sections, section_titles, width=30) | Return a string description of the model, including a description of
the training data, training statistics, and model hyper-parameters.
Returns
-------
out : string
A description of the model. | Return a string description of the model, including a description of
the training data, training statistics, and model hyper-parameters. | [
"Return",
"a",
"string",
"description",
"of",
"the",
"model",
"including",
"a",
"description",
"of",
"the",
"training",
"data",
"training",
"statistics",
"and",
"model",
"hyper",
"-",
"parameters",
"."
] | def __repr__(self):
"""
Return a string description of the model, including a description of
the training data, training statistics, and model hyper-parameters.
Returns
-------
out : string
A description of the model.
"""
(sections, section_t... | [
"def",
"__repr__",
"(",
"self",
")",
":",
"(",
"sections",
",",
"section_titles",
")",
"=",
"self",
".",
"_get_summary_struct",
"(",
")",
"return",
"_toolkit_repr_print",
"(",
"self",
",",
"sections",
",",
"section_titles",
",",
"width",
"=",
"30",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/regression/linear_regression.py#L432-L445 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/signal/ltisys.py | python | TransferFunction.num | (self) | return self._num | Numerator of the `TransferFunction` system. | Numerator of the `TransferFunction` system. | [
"Numerator",
"of",
"the",
"TransferFunction",
"system",
"."
] | def num(self):
"""Numerator of the `TransferFunction` system."""
return self._num | [
"def",
"num",
"(",
"self",
")",
":",
"return",
"self",
".",
"_num"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/ltisys.py#L604-L606 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/credentials.py | python | RefreshableCredentials.get_frozen_credentials | (self) | return self._frozen_credentials | Return immutable credentials.
The ``access_key``, ``secret_key``, and ``token`` properties
on this class will always check and refresh credentials if
needed before returning the particular credentials.
This has an edge case where you can get inconsistent
credentials. Imagine t... | Return immutable credentials. | [
"Return",
"immutable",
"credentials",
"."
] | def get_frozen_credentials(self):
"""Return immutable credentials.
The ``access_key``, ``secret_key``, and ``token`` properties
on this class will always check and refresh credentials if
needed before returning the particular credentials.
This has an edge case where you can get... | [
"def",
"get_frozen_credentials",
"(",
"self",
")",
":",
"self",
".",
"_refresh",
"(",
")",
"return",
"self",
".",
"_frozen_credentials"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/credentials.py#L557-L592 | |
networkit/networkit | 695b7a786a894a303fa8587597d5ef916e797729 | networkit/profiling/plot.py | python | Theme.getDefaultWidth | (self) | return self.__defaultWidth | returns the default width value of the theme | returns the default width value of the theme | [
"returns",
"the",
"default",
"width",
"value",
"of",
"the",
"theme"
] | def getDefaultWidth(self):
""" returns the default width value of the theme """
return self.__defaultWidth | [
"def",
"getDefaultWidth",
"(",
"self",
")",
":",
"return",
"self",
".",
"__defaultWidth"
] | https://github.com/networkit/networkit/blob/695b7a786a894a303fa8587597d5ef916e797729/networkit/profiling/plot.py#L96-L98 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/index.py | python | PackageIndex._reader | (self, name, stream, outbuf) | Thread runner for reading lines of from a subprocess into a buffer.
:param name: The logical name of the stream (used for logging only).
:param stream: The stream to read from. This will typically a pipe
connected to the output stream of a subprocess.
:param outbuf: The l... | Thread runner for reading lines of from a subprocess into a buffer. | [
"Thread",
"runner",
"for",
"reading",
"lines",
"of",
"from",
"a",
"subprocess",
"into",
"a",
"buffer",
"."
] | def _reader(self, name, stream, outbuf):
"""
Thread runner for reading lines of from a subprocess into a buffer.
:param name: The logical name of the stream (used for logging only).
:param stream: The stream to read from. This will typically a pipe
connected to th... | [
"def",
"_reader",
"(",
"self",
",",
"name",
",",
"stream",
",",
"outbuf",
")",
":",
"while",
"True",
":",
"s",
"=",
"stream",
".",
"readline",
"(",
")",
"if",
"not",
"s",
":",
"break",
"s",
"=",
"s",
".",
"decode",
"(",
"'utf-8'",
")",
".",
"rs... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/index.py#L134-L150 | ||
moai/moai-dev | 0ba7c678311d1fa9dbc091f60665e95e54169fdf | 3rdparty/libwebp-0.4.1/swig/libwebp.py | python | WebPDecodeBGR | (*args) | return _libwebp.WebPDecodeBGR(*args) | WebPDecodeBGR(uint8_t data) -> (rgb, width, height) | WebPDecodeBGR(uint8_t data) -> (rgb, width, height) | [
"WebPDecodeBGR",
"(",
"uint8_t",
"data",
")",
"-",
">",
"(",
"rgb",
"width",
"height",
")"
] | def WebPDecodeBGR(*args):
"""WebPDecodeBGR(uint8_t data) -> (rgb, width, height)"""
return _libwebp.WebPDecodeBGR(*args) | [
"def",
"WebPDecodeBGR",
"(",
"*",
"args",
")",
":",
"return",
"_libwebp",
".",
"WebPDecodeBGR",
"(",
"*",
"args",
")"
] | https://github.com/moai/moai-dev/blob/0ba7c678311d1fa9dbc091f60665e95e54169fdf/3rdparty/libwebp-0.4.1/swig/libwebp.py#L91-L93 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/slim/python/slim/evaluation.py | python | evaluate_once | (master,
checkpoint_path,
logdir,
num_evals=1,
initial_op=None,
initial_op_feed_dict=None,
eval_op=None,
eval_op_feed_dict=None,
final_op=None,
final_op_feed_... | return evaluation.evaluate_once(
checkpoint_path,
master=master,
scaffold=monitored_session.Scaffold(
init_op=initial_op, init_feed_dict=initial_op_feed_dict, saver=saver),
eval_ops=eval_op,
feed_dict=eval_op_feed_dict,
final_ops=final_op,
final_ops_feed_dict=final_op... | Evaluates the model at the given checkpoint path.
Args:
master: The BNS address of the TensorFlow master.
checkpoint_path: The path to a checkpoint to use for evaluation.
logdir: The directory where the TensorFlow summaries are written to.
num_evals: The number of times to run `eval_op`.
initial_... | Evaluates the model at the given checkpoint path. | [
"Evaluates",
"the",
"model",
"at",
"the",
"given",
"checkpoint",
"path",
"."
] | def evaluate_once(master,
checkpoint_path,
logdir,
num_evals=1,
initial_op=None,
initial_op_feed_dict=None,
eval_op=None,
eval_op_feed_dict=None,
final_op=None,
... | [
"def",
"evaluate_once",
"(",
"master",
",",
"checkpoint_path",
",",
"logdir",
",",
"num_evals",
"=",
"1",
",",
"initial_op",
"=",
"None",
",",
"initial_op_feed_dict",
"=",
"None",
",",
"eval_op",
"=",
"None",
",",
"eval_op_feed_dict",
"=",
"None",
",",
"fina... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/slim/python/slim/evaluation.py#L143-L207 | |
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/internal/decoder.py | python | MessageSetItemDecoder | (descriptor) | return DecodeItem | Returns a decoder for a MessageSet item.
The parameter is the message Descriptor.
The message set message looks like this:
message MessageSet {
repeated group Item = 1 {
required int32 type_id = 2;
required string message = 3;
}
} | Returns a decoder for a MessageSet item. | [
"Returns",
"a",
"decoder",
"for",
"a",
"MessageSet",
"item",
"."
] | def MessageSetItemDecoder(descriptor):
"""Returns a decoder for a MessageSet item.
The parameter is the message Descriptor.
The message set message looks like this:
message MessageSet {
repeated group Item = 1 {
required int32 type_id = 2;
required string message = 3;
}
}
"... | [
"def",
"MessageSetItemDecoder",
"(",
"descriptor",
")",
":",
"type_id_tag_bytes",
"=",
"encoder",
".",
"TagBytes",
"(",
"2",
",",
"wire_format",
".",
"WIRETYPE_VARINT",
")",
"message_tag_bytes",
"=",
"encoder",
".",
"TagBytes",
"(",
"3",
",",
"wire_format",
".",... | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/internal/decoder.py#L645-L715 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/distributions/python/ops/wishart.py | python | _WishartLinearOperator.cholesky_input_output_matrices | (self) | return self._cholesky_input_output_matrices | Boolean indicating if `Tensor` input/outputs are Cholesky factorized. | Boolean indicating if `Tensor` input/outputs are Cholesky factorized. | [
"Boolean",
"indicating",
"if",
"Tensor",
"input",
"/",
"outputs",
"are",
"Cholesky",
"factorized",
"."
] | def cholesky_input_output_matrices(self):
"""Boolean indicating if `Tensor` input/outputs are Cholesky factorized."""
return self._cholesky_input_output_matrices | [
"def",
"cholesky_input_output_matrices",
"(",
"self",
")",
":",
"return",
"self",
".",
"_cholesky_input_output_matrices"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/distributions/python/ops/wishart.py#L190-L192 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/resources/find_unused_resources.py | python | GetBaseResourceId | (resource_id) | return resource_id | Removes common suffixes from a resource ID.
Removes suffixies that may be added by macros like IMAGE_GRID or IMAGE_BORDER.
For example, converts IDR_FOO_LEFT and IDR_FOO_RIGHT to just IDR_FOO.
Args:
resource_id: String resource ID.
Returns:
A string with the base part of the resource ID. | Removes common suffixes from a resource ID. | [
"Removes",
"common",
"suffixes",
"from",
"a",
"resource",
"ID",
"."
] | def GetBaseResourceId(resource_id):
"""Removes common suffixes from a resource ID.
Removes suffixies that may be added by macros like IMAGE_GRID or IMAGE_BORDER.
For example, converts IDR_FOO_LEFT and IDR_FOO_RIGHT to just IDR_FOO.
Args:
resource_id: String resource ID.
Returns:
A string with the b... | [
"def",
"GetBaseResourceId",
"(",
"resource_id",
")",
":",
"suffixes",
"=",
"[",
"'_TOP_LEFT'",
",",
"'_TOP'",
",",
"'_TOP_RIGHT'",
",",
"'_LEFT'",
",",
"'_CENTER'",
",",
"'_RIGHT'",
",",
"'_BOTTOM_LEFT'",
",",
"'_BOTTOM'",
",",
"'_BOTTOM_RIGHT'",
",",
"'_TL'",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/resources/find_unused_resources.py#L27-L51 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/cluster/vq.py | python | _missing_raise | () | raise a ClusterError when called. | raise a ClusterError when called. | [
"raise",
"a",
"ClusterError",
"when",
"called",
"."
] | def _missing_raise():
"""raise a ClusterError when called."""
raise ClusterError("One of the clusters is empty. "
"Re-run kmeans with a different initialization.") | [
"def",
"_missing_raise",
"(",
")",
":",
"raise",
"ClusterError",
"(",
"\"One of the clusters is empty. \"",
"\"Re-run kmeans with a different initialization.\"",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/cluster/vq.py#L584-L587 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/_collections_abc.py | python | pop | (self, key, default=__marker) | D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised. | D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised. | [
"D",
".",
"pop",
"(",
"k",
"[",
"d",
"]",
")",
"-",
">",
"v",
"remove",
"specified",
"key",
"and",
"return",
"the",
"corresponding",
"value",
".",
"If",
"key",
"is",
"not",
"found",
"d",
"is",
"returned",
"if",
"given",
"otherwise",
"KeyError",
"is",... | def pop(self, key, default=__marker):
'''D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
'''
try:
value = self[key]
except KeyError:
if default is self... | [
"def",
"pop",
"(",
"self",
",",
"key",
",",
"default",
"=",
"__marker",
")",
":",
"try",
":",
"value",
"=",
"self",
"[",
"key",
"]",
"except",
"KeyError",
":",
"if",
"default",
"is",
"self",
".",
"__marker",
":",
"raise",
"return",
"default",
"else",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/_collections_abc.py#L899-L911 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py | python | convert_ceil | (node, **kwargs) | return create_basic_op_node('Ceil', node, kwargs) | Map MXNet's ceil operator attributes to onnx's Ceil operator
and return the created node. | Map MXNet's ceil operator attributes to onnx's Ceil operator
and return the created node. | [
"Map",
"MXNet",
"s",
"ceil",
"operator",
"attributes",
"to",
"onnx",
"s",
"Ceil",
"operator",
"and",
"return",
"the",
"created",
"node",
"."
] | def convert_ceil(node, **kwargs):
"""Map MXNet's ceil operator attributes to onnx's Ceil operator
and return the created node.
"""
return create_basic_op_node('Ceil', node, kwargs) | [
"def",
"convert_ceil",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"create_basic_op_node",
"(",
"'Ceil'",
",",
"node",
",",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset12.py#L1749-L1753 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang/tools/scan-build-py/lib/libscanbuild/analyze.py | python | ctu_collect_phase | (opts) | Preprocess source by generating all data needed by CTU analysis. | Preprocess source by generating all data needed by CTU analysis. | [
"Preprocess",
"source",
"by",
"generating",
"all",
"data",
"needed",
"by",
"CTU",
"analysis",
"."
] | def ctu_collect_phase(opts):
""" Preprocess source by generating all data needed by CTU analysis. """
def generate_ast(triple_arch):
""" Generates ASTs for the current compilation command. """
args = opts['direct_args'] + opts['flags']
ast_joined_path = os.path.join(opts['ctu'].dir, tr... | [
"def",
"ctu_collect_phase",
"(",
"opts",
")",
":",
"def",
"generate_ast",
"(",
"triple_arch",
")",
":",
"\"\"\" Generates ASTs for the current compilation command. \"\"\"",
"args",
"=",
"opts",
"[",
"'direct_args'",
"]",
"+",
"opts",
"[",
"'flags'",
"]",
"ast_joined_p... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/tools/scan-build-py/lib/libscanbuild/analyze.py#L599-L657 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/specs/python/specs.py | python | eval_spec | (spec, environment=None) | return bindings | Evaluates a spec and returns the environment.
This function allows you to use a spec to obtain multiple bindings
in an environment. That is useful if you use the spec language to
specify multiple components of a larger network, for example: "left
= Cr(64, [5,5]); right = Fc(64)" Usually, you will want to use
... | Evaluates a spec and returns the environment. | [
"Evaluates",
"a",
"spec",
"and",
"returns",
"the",
"environment",
"."
] | def eval_spec(spec, environment=None):
"""Evaluates a spec and returns the environment.
This function allows you to use a spec to obtain multiple bindings
in an environment. That is useful if you use the spec language to
specify multiple components of a larger network, for example: "left
= Cr(64, [5,5]); rig... | [
"def",
"eval_spec",
"(",
"spec",
",",
"environment",
"=",
"None",
")",
":",
"specs_lib",
".",
"check_keywords",
"(",
"spec",
")",
"bindings",
"=",
"{",
"}",
"if",
"environment",
":",
"bindings",
".",
"update",
"(",
"environment",
")",
"exec_",
"(",
"spec... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/specs/python/specs.py#L51-L76 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/drafttaskpanels/task_shapestring.py | python | ShapeStringTaskPanel.action | (self, arg) | scene event handler | scene event handler | [
"scene",
"event",
"handler"
] | def action(self, arg):
"""scene event handler"""
if arg["Type"] == "SoKeyboardEvent":
if arg["Key"] == "ESCAPE":
self.reject()
elif arg["Type"] == "SoLocation2Event": # mouse movement detection
self.point,ctrlPoint,info = gui_tool_utils.getPoint(self.sour... | [
"def",
"action",
"(",
"self",
",",
"arg",
")",
":",
"if",
"arg",
"[",
"\"Type\"",
"]",
"==",
"\"SoKeyboardEvent\"",
":",
"if",
"arg",
"[",
"\"Key\"",
"]",
"==",
"\"ESCAPE\"",
":",
"self",
".",
"reject",
"(",
")",
"elif",
"arg",
"[",
"\"Type\"",
"]",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/drafttaskpanels/task_shapestring.py#L100-L112 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/generator/ninja.py | python | OpenOutput | (path, mode='w') | return open(path, mode) | Open |path| for writing, creating directories if necessary. | Open |path| for writing, creating directories if necessary. | [
"Open",
"|path|",
"for",
"writing",
"creating",
"directories",
"if",
"necessary",
"."
] | def OpenOutput(path, mode='w'):
"""Open |path| for writing, creating directories if necessary."""
gyp.common.EnsureDirExists(path)
return open(path, mode) | [
"def",
"OpenOutput",
"(",
"path",
",",
"mode",
"=",
"'w'",
")",
":",
"gyp",
".",
"common",
".",
"EnsureDirExists",
"(",
"path",
")",
"return",
"open",
"(",
"path",
",",
"mode",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/ninja.py#L1736-L1739 | |
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/encoder.py | python | GroupEncoder | (field_number, is_repeated, is_packed) | Returns an encoder for a group field. | Returns an encoder for a group field. | [
"Returns",
"an",
"encoder",
"for",
"a",
"group",
"field",
"."
] | def GroupEncoder(field_number, is_repeated, is_packed):
"""Returns an encoder for a group field."""
start_tag = TagBytes(field_number, wire_format.WIRETYPE_START_GROUP)
end_tag = TagBytes(field_number, wire_format.WIRETYPE_END_GROUP)
assert not is_packed
if is_repeated:
def EncodeRepeatedField(write, val... | [
"def",
"GroupEncoder",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"start_tag",
"=",
"TagBytes",
"(",
"field_number",
",",
"wire_format",
".",
"WIRETYPE_START_GROUP",
")",
"end_tag",
"=",
"TagBytes",
"(",
"field_number",
",",
"wire_format"... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/encoder.py#L725-L743 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | ext/ply/example/ansic/cparse.py | python | p_jump_statement_1 | (t) | jump_statement : GOTO ID SEMI | jump_statement : GOTO ID SEMI | [
"jump_statement",
":",
"GOTO",
"ID",
"SEMI"
] | def p_jump_statement_1(t):
'jump_statement : GOTO ID SEMI'
pass | [
"def",
"p_jump_statement_1",
"(",
"t",
")",
":",
"pass"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/ansic/cparse.py#L541-L543 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.