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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apple/swift-clang | d7403439fc6641751840b723e7165fb02f52db95 | tools/scan-build-py/libscanbuild/report.py | python | commonprefix_from | (filename) | Create file prefix from a compilation database entries. | Create file prefix from a compilation database entries. | [
"Create",
"file",
"prefix",
"from",
"a",
"compilation",
"database",
"entries",
"."
] | def commonprefix_from(filename):
""" Create file prefix from a compilation database entries. """
with open(filename, 'r') as handle:
return commonprefix(item['file'] for item in json.load(handle)) | [
"def",
"commonprefix_from",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
",",
"'r'",
")",
"as",
"handle",
":",
"return",
"commonprefix",
"(",
"item",
"[",
"'file'",
"]",
"for",
"item",
"in",
"json",
".",
"load",
"(",
"handle",
")",
")"
] | https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/tools/scan-build-py/libscanbuild/report.py#L481-L485 | ||
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | scripts/kat/spectra.py | python | KmerSpectra._createInitialPeaks | (self) | return | Creates a set of peaks based on the global maxima (ignoring the likely first peak at low k-mer frequency).
Because we expect this to be a poisson distribution we assume peaks can be found at multiples, or fractions, of
the global maxima. | Creates a set of peaks based on the global maxima (ignoring the likely first peak at low k-mer frequency).
Because we expect this to be a poisson distribution we assume peaks can be found at multiples, or fractions, of
the global maxima. | [
"Creates",
"a",
"set",
"of",
"peaks",
"based",
"on",
"the",
"global",
"maxima",
"(",
"ignoring",
"the",
"likely",
"first",
"peak",
"at",
"low",
"k",
"-",
"mer",
"frequency",
")",
".",
"Because",
"we",
"expect",
"this",
"to",
"be",
"a",
"poisson",
"dist... | def _createInitialPeaks(self):
"""
Creates a set of peaks based on the global maxima (ignoring the likely first peak at low k-mer frequency).
Because we expect this to be a poisson distribution we assume peaks can be found at multiples, or fractions, of
the global maxima.
"""
# Walk till first local minimu... | [
"def",
"_createInitialPeaks",
"(",
"self",
")",
":",
"# Walk till first local minimum (d(f)>0)",
"# Also double check the following two steps, rather than just the next one.",
"# Sometimes we can get a strange laddering affect in alternate frequencies which prevent",
"# us from correctly detecting... | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/scripts/kat/spectra.py#L274-L349 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/html.py | python | HtmlContainerCell.__init__ | (self, *args, **kwargs) | __init__(self, HtmlContainerCell parent) -> HtmlContainerCell | __init__(self, HtmlContainerCell parent) -> HtmlContainerCell | [
"__init__",
"(",
"self",
"HtmlContainerCell",
"parent",
")",
"-",
">",
"HtmlContainerCell"
] | def __init__(self, *args, **kwargs):
"""__init__(self, HtmlContainerCell parent) -> HtmlContainerCell"""
_html.HtmlContainerCell_swiginit(self,_html.new_HtmlContainerCell(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_html",
".",
"HtmlContainerCell_swiginit",
"(",
"self",
",",
"_html",
".",
"new_HtmlContainerCell",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L798-L800 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/param_attr.py | python | ParamAttr._to_kwargs | (self, with_initializer=False) | return kwargs | Returns the attributes of this parameter.
Args:
with_initializer(bool): Whether to add initializer attr.
Returns:
Parameter attributes(map): The attributes of this parameter. | Returns the attributes of this parameter. | [
"Returns",
"the",
"attributes",
"of",
"this",
"parameter",
"."
] | def _to_kwargs(self, with_initializer=False):
"""
Returns the attributes of this parameter.
Args:
with_initializer(bool): Whether to add initializer attr.
Returns:
Parameter attributes(map): The attributes of this parameter.
"""
kwargs = {
... | [
"def",
"_to_kwargs",
"(",
"self",
",",
"with_initializer",
"=",
"False",
")",
":",
"kwargs",
"=",
"{",
"'name'",
":",
"self",
".",
"name",
",",
"'optimize_attr'",
":",
"{",
"'learning_rate'",
":",
"self",
".",
"learning_rate",
"}",
",",
"'regularizer'",
":... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/param_attr.py#L189-L211 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/estimators/linear.py | python | _SdcaUpdateWeightsHook.begin | (self) | Construct the update_weights op.
The op is implicitly added to the default graph. | Construct the update_weights op. | [
"Construct",
"the",
"update_weights",
"op",
"."
] | def begin(self):
"""Construct the update_weights op.
The op is implicitly added to the default graph.
"""
self._update_op = self._sdca_model.update_weights(self._train_op) | [
"def",
"begin",
"(",
"self",
")",
":",
"self",
".",
"_update_op",
"=",
"self",
".",
"_sdca_model",
".",
"update_weights",
"(",
"self",
".",
"_train_op",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/estimators/linear.py#L293-L298 | ||
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/metadata/Music/musicbrainzngs/util.py | python | _unicode | (string, encoding=None) | return unicode_string.replace('\x00', '').strip() | Try to decode byte strings to unicode.
This can only be a guess, but this might be better than failing.
It is safe to use this on numbers or strings that are already unicode. | Try to decode byte strings to unicode.
This can only be a guess, but this might be better than failing.
It is safe to use this on numbers or strings that are already unicode. | [
"Try",
"to",
"decode",
"byte",
"strings",
"to",
"unicode",
".",
"This",
"can",
"only",
"be",
"a",
"guess",
"but",
"this",
"might",
"be",
"better",
"than",
"failing",
".",
"It",
"is",
"safe",
"to",
"use",
"this",
"on",
"numbers",
"or",
"strings",
"that"... | def _unicode(string, encoding=None):
"""Try to decode byte strings to unicode.
This can only be a guess, but this might be better than failing.
It is safe to use this on numbers or strings that are already unicode.
"""
if isinstance(string, compat.unicode):
unicode_string = string
elif i... | [
"def",
"_unicode",
"(",
"string",
",",
"encoding",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"string",
",",
"compat",
".",
"unicode",
")",
":",
"unicode_string",
"=",
"string",
"elif",
"isinstance",
"(",
"string",
",",
"compat",
".",
"bytes",
")",
... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/metadata/Music/musicbrainzngs/util.py#L12-L28 | |
BertaBescos/DynaSLAM | 8f894a8b9d63c0a608fd871d63c10796491b9312 | src/python/model.py | python | clip_boxes_graph | (boxes, window) | return clipped | boxes: [N, 4] each row is y1, x1, y2, x2
window: [4] in the form y1, x1, y2, x2 | boxes: [N, 4] each row is y1, x1, y2, x2
window: [4] in the form y1, x1, y2, x2 | [
"boxes",
":",
"[",
"N",
"4",
"]",
"each",
"row",
"is",
"y1",
"x1",
"y2",
"x2",
"window",
":",
"[",
"4",
"]",
"in",
"the",
"form",
"y1",
"x1",
"y2",
"x2"
] | def clip_boxes_graph(boxes, window):
"""
boxes: [N, 4] each row is y1, x1, y2, x2
window: [4] in the form y1, x1, y2, x2
"""
# Split corners
wy1, wx1, wy2, wx2 = tf.split(window, 4)
y1, x1, y2, x2 = tf.split(boxes, 4, axis=1)
# Clip
y1 = tf.maximum(tf.minimum(y1, wy2), wy1)
x1 = ... | [
"def",
"clip_boxes_graph",
"(",
"boxes",
",",
"window",
")",
":",
"# Split corners",
"wy1",
",",
"wx1",
",",
"wy2",
",",
"wx2",
"=",
"tf",
".",
"split",
"(",
"window",
",",
"4",
")",
"y1",
",",
"x1",
",",
"y2",
",",
"x2",
"=",
"tf",
".",
"split",... | https://github.com/BertaBescos/DynaSLAM/blob/8f894a8b9d63c0a608fd871d63c10796491b9312/src/python/model.py#L207-L221 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | Window.HitTest | (*args, **kwargs) | return _core_.Window_HitTest(*args, **kwargs) | HitTest(self, Point pt) -> int
Test where the given (in client coords) point lies | HitTest(self, Point pt) -> int | [
"HitTest",
"(",
"self",
"Point",
"pt",
")",
"-",
">",
"int"
] | def HitTest(*args, **kwargs):
"""
HitTest(self, Point pt) -> int
Test where the given (in client coords) point lies
"""
return _core_.Window_HitTest(*args, **kwargs) | [
"def",
"HitTest",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_HitTest",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L11088-L11094 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/util/connection.py | python | allowed_gai_family | () | return family | This function is designed to work in the context of
getaddrinfo, where family=socket.AF_UNSPEC is the default and
will perform a DNS search for both IPv6 and IPv4 records. | This function is designed to work in the context of | [
"This",
"function",
"is",
"designed",
"to",
"work",
"in",
"the",
"context",
"of"
] | def allowed_gai_family():
"""This function is designed to work in the context of
getaddrinfo, where family=socket.AF_UNSPEC is the default and
will perform a DNS search for both IPv6 and IPv4 records."""
family = socket.AF_INET
if HAS_IPV6:
family = socket.AF_UNSPEC
return famil... | [
"def",
"allowed_gai_family",
"(",
")",
":",
"family",
"=",
"socket",
".",
"AF_INET",
"if",
"HAS_IPV6",
":",
"family",
"=",
"socket",
".",
"AF_UNSPEC",
"return",
"family"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/util/connection.py#L217-L233 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_encoder.py | python | _overlay_barcode_and_base_frames | (barcodes_file, base_file, output_file,
barcodes_component_sizes,
base_component_sizes) | return True | Overlays the next YUV frame from a file with a barcode.
Args:
barcodes_file(FileObject): The YUV file containing the barcodes (opened).
base_file(FileObject): The base YUV file (opened).
output_file(FileObject): The output overlaid file (opened).
barcodes_component_sizes(list of tuples): The width an... | Overlays the next YUV frame from a file with a barcode. | [
"Overlays",
"the",
"next",
"YUV",
"frame",
"from",
"a",
"file",
"with",
"a",
"barcode",
"."
] | def _overlay_barcode_and_base_frames(barcodes_file, base_file, output_file,
barcodes_component_sizes,
base_component_sizes):
"""Overlays the next YUV frame from a file with a barcode.
Args:
barcodes_file(FileObject): The YUV file contain... | [
"def",
"_overlay_barcode_and_base_frames",
"(",
"barcodes_file",
",",
"base_file",
",",
"output_file",
",",
"barcodes_component_sizes",
",",
"base_component_sizes",
")",
":",
"# We will loop three times - once for the Y, U and V planes",
"for",
"(",
"(",
"barcode_comp_width",
"... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/webrtc/tools/barcode_tools/barcode_encoder.py#L162-L201 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/plugdlg.py | python | InstallPanel.AddItemToInstall | (self, item) | Adds an item to the install list, the item
should be a string of the path to the item or
the items name if it is an in memory file from the
download page.
@param item: path or name of plugin item | Adds an item to the install list, the item
should be a string of the path to the item or
the items name if it is an in memory file from the
download page.
@param item: path or name of plugin item | [
"Adds",
"an",
"item",
"to",
"the",
"install",
"list",
"the",
"item",
"should",
"be",
"a",
"string",
"of",
"the",
"path",
"to",
"the",
"item",
"or",
"the",
"items",
"name",
"if",
"it",
"is",
"an",
"in",
"memory",
"file",
"from",
"the",
"download",
"pa... | def AddItemToInstall(self, item):
"""Adds an item to the install list, the item
should be a string of the path to the item or
the items name if it is an in memory file from the
download page.
@param item: path or name of plugin item
"""
if self._install.FindStrin... | [
"def",
"AddItemToInstall",
"(",
"self",
",",
"item",
")",
":",
"if",
"self",
".",
"_install",
".",
"FindString",
"(",
"item",
")",
"==",
"wx",
".",
"NOT_FOUND",
":",
"self",
".",
"_instb",
".",
"Enable",
"(",
")",
"self",
".",
"_install",
".",
"Appen... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/plugdlg.py#L834-L846 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/user_preferences.py | python | UserPreferences.disable_push | (self, disable_push) | Sets the disable_push of this UserPreferences.
:param disable_push: The disable_push of this UserPreferences. # noqa: E501
:type: list[str] | Sets the disable_push of this UserPreferences. | [
"Sets",
"the",
"disable_push",
"of",
"this",
"UserPreferences",
"."
] | def disable_push(self, disable_push):
"""Sets the disable_push of this UserPreferences.
:param disable_push: The disable_push of this UserPreferences. # noqa: E501
:type: list[str]
"""
self._disable_push = disable_push | [
"def",
"disable_push",
"(",
"self",
",",
"disable_push",
")",
":",
"self",
".",
"_disable_push",
"=",
"disable_push"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user_preferences.py#L359-L367 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/tools/inspector_protocol/jinja2/environment.py | python | Environment.compile_templates | (self, target, extensions=None, filter_func=None,
zip='deflated', log_function=None,
ignore_errors=True, py_compile=False) | Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `None`, instead of in a
zipfile, the templates will be stored in a directory.
By default a deflate zip algorithm is used. To switch to
the stored algorithm, `zip` can be set to ``'stored'... | Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `None`, instead of in a
zipfile, the templates will be stored in a directory.
By default a deflate zip algorithm is used. To switch to
the stored algorithm, `zip` can be set to ``'stored'... | [
"Finds",
"all",
"the",
"templates",
"the",
"loader",
"can",
"find",
"compiles",
"them",
"and",
"stores",
"them",
"in",
"target",
".",
"If",
"zip",
"is",
"None",
"instead",
"of",
"in",
"a",
"zipfile",
"the",
"templates",
"will",
"be",
"stored",
"in",
"a",... | def compile_templates(self, target, extensions=None, filter_func=None,
zip='deflated', log_function=None,
ignore_errors=True, py_compile=False):
"""Finds all the templates the loader can find, compiles them
and stores them in `target`. If `zip` is `No... | [
"def",
"compile_templates",
"(",
"self",
",",
"target",
",",
"extensions",
"=",
"None",
",",
"filter_func",
"=",
"None",
",",
"zip",
"=",
"'deflated'",
",",
"log_function",
"=",
"None",
",",
"ignore_errors",
"=",
"True",
",",
"py_compile",
"=",
"False",
")... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/inspector_protocol/jinja2/environment.py#L638-L731 | ||
gv22ga/dlib-face-recognition-android | 42d6305cbd85833f2b85bb79b70ab9ab004153c9 | tools/lint/cpplint.py | python | IsDecltype | (clean_lines, linenum, column) | return False | Check if the token ending on (linenum, column) is decltype().
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: the number of the line to check.
column: end column of the token to check.
Returns:
True if this token is decltype() expression, False otherwise. | Check if the token ending on (linenum, column) is decltype().
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: the number of the line to check.
column: end column of the token to check.
Returns:
True if this token is decltype() expression, False otherwise. | [
"Check",
"if",
"the",
"token",
"ending",
"on",
"(",
"linenum",
"column",
")",
"is",
"decltype",
"()",
".",
"Args",
":",
"clean_lines",
":",
"A",
"CleansedLines",
"instance",
"containing",
"the",
"file",
".",
"linenum",
":",
"the",
"number",
"of",
"the",
... | def IsDecltype(clean_lines, linenum, column):
"""Check if the token ending on (linenum, column) is decltype().
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: the number of the line to check.
column: end column of the token to check.
Returns:
True if this token is decltyp... | [
"def",
"IsDecltype",
"(",
"clean_lines",
",",
"linenum",
",",
"column",
")",
":",
"(",
"text",
",",
"_",
",",
"start_col",
")",
"=",
"ReverseCloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"column",
")",
"if",
"start_col",
"<",
"0",
":",
"retu... | https://github.com/gv22ga/dlib-face-recognition-android/blob/42d6305cbd85833f2b85bb79b70ab9ab004153c9/tools/lint/cpplint.py#L3419-L3433 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | KeyEvent.GetY | (*args, **kwargs) | return _core_.KeyEvent_GetY(*args, **kwargs) | GetY(self) -> int
Returns the Y position (in client coordinates) of the event, if
applicable. | GetY(self) -> int | [
"GetY",
"(",
"self",
")",
"-",
">",
"int"
] | def GetY(*args, **kwargs):
"""
GetY(self) -> int
Returns the Y position (in client coordinates) of the event, if
applicable.
"""
return _core_.KeyEvent_GetY(*args, **kwargs) | [
"def",
"GetY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"KeyEvent_GetY",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L6086-L6093 | |
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | dev/archery/archery/bot.py | python | _clone_arrow_and_crossbow | (dest, crossbow_repo, pull_request) | return (arrow, queue) | Clone the repositories and initialize crossbow objects.
Parameters
----------
dest : Path
Filesystem path to clone the repositories to.
crossbow_repo : str
Github repository name, like kszucs/crossbow.
pull_request : pygithub.PullRequest
Object containing information about t... | Clone the repositories and initialize crossbow objects. | [
"Clone",
"the",
"repositories",
"and",
"initialize",
"crossbow",
"objects",
"."
] | def _clone_arrow_and_crossbow(dest, crossbow_repo, pull_request):
"""
Clone the repositories and initialize crossbow objects.
Parameters
----------
dest : Path
Filesystem path to clone the repositories to.
crossbow_repo : str
Github repository name, like kszucs/crossbow.
pul... | [
"def",
"_clone_arrow_and_crossbow",
"(",
"dest",
",",
"crossbow_repo",
",",
"pull_request",
")",
":",
"arrow_path",
"=",
"dest",
"/",
"'arrow'",
"queue_path",
"=",
"dest",
"/",
"'crossbow'",
"# clone arrow and checkout the pull request's branch",
"pull_request_ref",
"=",
... | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/dev/archery/archery/bot.py#L190-L224 | |
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | configs/example/arm/starter_fs.py | python | create_cow_image | (name) | return image | Helper function to create a Copy-on-Write disk image | Helper function to create a Copy-on-Write disk image | [
"Helper",
"function",
"to",
"create",
"a",
"Copy",
"-",
"on",
"-",
"Write",
"disk",
"image"
] | def create_cow_image(name):
"""Helper function to create a Copy-on-Write disk image"""
image = CowDiskImage()
image.child.image_file = SysPaths.disk(name)
return image; | [
"def",
"create_cow_image",
"(",
"name",
")",
":",
"image",
"=",
"CowDiskImage",
"(",
")",
"image",
".",
"child",
".",
"image_file",
"=",
"SysPaths",
".",
"disk",
"(",
"name",
")",
"return",
"image"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/configs/example/arm/starter_fs.py#L77-L82 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/containers.py | python | RepeatedScalarFieldContainer.__delitem__ | (self, key) | Deletes the item at the specified position. | Deletes the item at the specified position. | [
"Deletes",
"the",
"item",
"at",
"the",
"specified",
"position",
"."
] | def __delitem__(self, key):
"""Deletes the item at the specified position."""
del self._values[key]
self._message_listener.Modified() | [
"def",
"__delitem__",
"(",
"self",
",",
"key",
")",
":",
"del",
"self",
".",
"_values",
"[",
"key",
"]",
"self",
".",
"_message_listener",
".",
"Modified",
"(",
")"
] | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/containers.py#L166-L169 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/ssl.py | python | cert_time_to_seconds | (cert_time) | Return the time in seconds since the Epoch, given the timestring
representing the "notBefore" or "notAfter" date from a certificate
in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale).
"notBefore" or "notAfter" dates must use UTC (RFC 5280).
Month is one of: Jan Feb Mar Apr May Jun Jul Aug Sep Oc... | Return the time in seconds since the Epoch, given the timestring
representing the "notBefore" or "notAfter" date from a certificate
in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale). | [
"Return",
"the",
"time",
"in",
"seconds",
"since",
"the",
"Epoch",
"given",
"the",
"timestring",
"representing",
"the",
"notBefore",
"or",
"notAfter",
"date",
"from",
"a",
"certificate",
"in",
"%b",
"%d",
"%H",
":",
"%M",
":",
"%S",
"%Y",
"%Z",
"strptime",... | def cert_time_to_seconds(cert_time):
"""Return the time in seconds since the Epoch, given the timestring
representing the "notBefore" or "notAfter" date from a certificate
in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale).
"notBefore" or "notAfter" dates must use UTC (RFC 5280).
Month is on... | [
"def",
"cert_time_to_seconds",
"(",
"cert_time",
")",
":",
"from",
"time",
"import",
"strptime",
"from",
"calendar",
"import",
"timegm",
"months",
"=",
"(",
"\"Jan\"",
",",
"\"Feb\"",
",",
"\"Mar\"",
",",
"\"Apr\"",
",",
"\"May\"",
",",
"\"Jun\"",
",",
"\"Ju... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ssl.py#L1243-L1271 | ||
runtimejs/runtime | 0a6e84c30823d35a4548d6634166784260ae7b74 | deps/v8/tools/sanitizers/sancov_formatter.py | python | get_instrumented_lines | (executable) | return process_symbolizer_output(output) | Return the instrumented lines of an executable.
Called trough multiprocessing pool.
Returns: Post-processed llvm output as returned by process_symbolizer_output. | Return the instrumented lines of an executable. | [
"Return",
"the",
"instrumented",
"lines",
"of",
"an",
"executable",
"."
] | def get_instrumented_lines(executable):
"""Return the instrumented lines of an executable.
Called trough multiprocessing pool.
Returns: Post-processed llvm output as returned by process_symbolizer_output.
"""
# The first two pipes are from llvm's tool sancov.py with 0x added to the hex
# numbers. The resu... | [
"def",
"get_instrumented_lines",
"(",
"executable",
")",
":",
"# The first two pipes are from llvm's tool sancov.py with 0x added to the hex",
"# numbers. The results are piped into the llvm symbolizer, which outputs for",
"# each PC: <file name with abs path>:<line number>:<character number>.",
"... | https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/tools/sanitizers/sancov_formatter.py#L157-L184 | |
vtraag/leidenalg | b53366829360e10922a2dbf57eb405a516c23bc9 | src/leidenalg/VertexPartition.py | python | MutableVertexPartition.move_node | (self,v,new_comm) | Move node ``v`` to community ``new_comm``.
Parameters
----------
v
Node to move.
new_comm
Community to move to.
Examples
--------
>>> G = ig.Graph.Famous('Zachary')
>>> partition = la.ModularityVertexPartition(G)
>>> partition.move_node(0, 1) | Move node ``v`` to community ``new_comm``. | [
"Move",
"node",
"v",
"to",
"community",
"new_comm",
"."
] | def move_node(self,v,new_comm):
""" Move node ``v`` to community ``new_comm``.
Parameters
----------
v
Node to move.
new_comm
Community to move to.
Examples
--------
>>> G = ig.Graph.Famous('Zachary')
>>> partition = la.ModularityVertexPartition(G)
>>> partition.mo... | [
"def",
"move_node",
"(",
"self",
",",
"v",
",",
"new_comm",
")",
":",
"_c_leiden",
".",
"_MutableVertexPartition_move_node",
"(",
"self",
".",
"_partition",
",",
"v",
",",
"new_comm",
")",
"# Make sure this move is also reflected in the membership vector of the python obj... | https://github.com/vtraag/leidenalg/blob/b53366829360e10922a2dbf57eb405a516c23bc9/src/leidenalg/VertexPartition.py#L181-L201 | ||
gwaldron/osgearth | 4c521857d59a69743e4a9cedba00afe570f984e8 | src/third_party/tinygltf/deps/cpplint.py | python | Error | (filename, linenum, category, confidence, message) | Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
False positives can be suppressed by the use of
"cpplint(categor... | Logs the fact we've found a lint error. | [
"Logs",
"the",
"fact",
"we",
"ve",
"found",
"a",
"lint",
"error",
"."
] | def Error(filename, linenum, category, confidence, message):
"""Logs the fact we've found a lint error.
We log where the error was found, and also our confidence in the error,
that is, how certain we are this is a legitimate style regression, and
not a misidentification or a use that's sometimes justified.
... | [
"def",
"Error",
"(",
"filename",
",",
"linenum",
",",
"category",
",",
"confidence",
",",
"message",
")",
":",
"if",
"_ShouldPrintError",
"(",
"category",
",",
"confidence",
",",
"linenum",
")",
":",
"_cpplint_state",
".",
"IncrementErrorCount",
"(",
"category... | https://github.com/gwaldron/osgearth/blob/4c521857d59a69743e4a9cedba00afe570f984e8/src/third_party/tinygltf/deps/cpplint.py#L1092-L1124 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PGProperty.SetValueToUnspecified | (*args, **kwargs) | return _propgrid.PGProperty_SetValueToUnspecified(*args, **kwargs) | SetValueToUnspecified(self) | SetValueToUnspecified(self) | [
"SetValueToUnspecified",
"(",
"self",
")"
] | def SetValueToUnspecified(*args, **kwargs):
"""SetValueToUnspecified(self)"""
return _propgrid.PGProperty_SetValueToUnspecified(*args, **kwargs) | [
"def",
"SetValueToUnspecified",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_SetValueToUnspecified",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L763-L765 | |
ufal/udpipe | e51f02d2744cdfd4a29efc1320644ea04d535f0b | doc/t2t_docsys/txt2tags.py | python | ConfigMaster.get_target_raw | (self) | return ret | Returns the raw config for self.target or 'all | Returns the raw config for self.target or 'all | [
"Returns",
"the",
"raw",
"config",
"for",
"self",
".",
"target",
"or",
"all"
] | def get_target_raw(self):
"Returns the raw config for self.target or 'all'"
ret = []
self._check_target()
for entry in self.raw:
if entry[0] == self.target or entry[0] == 'all':
ret.append(entry)
return ret | [
"def",
"get_target_raw",
"(",
"self",
")",
":",
"ret",
"=",
"[",
"]",
"self",
".",
"_check_target",
"(",
")",
"for",
"entry",
"in",
"self",
".",
"raw",
":",
"if",
"entry",
"[",
"0",
"]",
"==",
"self",
".",
"target",
"or",
"entry",
"[",
"0",
"]",
... | https://github.com/ufal/udpipe/blob/e51f02d2744cdfd4a29efc1320644ea04d535f0b/doc/t2t_docsys/txt2tags.py#L2744-L2751 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction/instruments/sans/sans_reduction_steps.py | python | Mask._finite_cylinder | (self, centre, radius, height, axis, id='shape') | return '<cylinder id="' + str(id) + '">' + \
'<centre-of-bottom-base x="' + str(centre[0]) + '" y="' + str(centre[1]) + '" z="' + \
str(centre[2]) + '" />' + \
'<axis x="' + str(axis[0]) + '" y="' + str(axis[1]) + '" z="' + str(axis[2]) + '" />' + \
'<radius v... | Generates xml code for an infintely long cylinder
@param centre: a tuple for a point on the axis
@param radius: cylinder radius
@param height: cylinder height
@param axis: cylinder orientation
@param id: a string to refer to the shape by
@return th... | Generates xml code for an infintely long cylinder | [
"Generates",
"xml",
"code",
"for",
"an",
"infintely",
"long",
"cylinder"
] | def _finite_cylinder(self, centre, radius, height, axis, id='shape'):
"""
Generates xml code for an infintely long cylinder
@param centre: a tuple for a point on the axis
@param radius: cylinder radius
@param height: cylinder height
@param axis: cylind... | [
"def",
"_finite_cylinder",
"(",
"self",
",",
"centre",
",",
"radius",
",",
"height",
",",
"axis",
",",
"id",
"=",
"'shape'",
")",
":",
"return",
"'<cylinder id=\"'",
"+",
"str",
"(",
"id",
")",
"+",
"'\">'",
"+",
"'<centre-of-bottom-base x=\"'",
"+",
"str"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction/instruments/sans/sans_reduction_steps.py#L251-L265 | |
GoSSIP-SJTU/Armariris | ad5d868482956b2194a77b39c8d543c7c2318200 | tools/clang/tools/scan-build-py/libscanbuild/report.py | python | read_crashes | (output_dir) | return (parse_crash(filename)
for filename in glob.iglob(os.path.join(output_dir, 'failures',
'*.info.txt'))) | Generate a unique sequence of crashes from given output directory. | Generate a unique sequence of crashes from given output directory. | [
"Generate",
"a",
"unique",
"sequence",
"of",
"crashes",
"from",
"given",
"output",
"directory",
"."
] | def read_crashes(output_dir):
""" Generate a unique sequence of crashes from given output directory. """
return (parse_crash(filename)
for filename in glob.iglob(os.path.join(output_dir, 'failures',
'*.info.txt'))) | [
"def",
"read_crashes",
"(",
"output_dir",
")",
":",
"return",
"(",
"parse_crash",
"(",
"filename",
")",
"for",
"filename",
"in",
"glob",
".",
"iglob",
"(",
"os",
".",
"path",
".",
"join",
"(",
"output_dir",
",",
"'failures'",
",",
"'*.info.txt'",
")",
")... | https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/tools/scan-build-py/libscanbuild/report.py#L284-L289 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/utils/context_managers.py | python | control_dependency_on_returns | (return_value) | return ops.control_dependencies(return_value) | Create a TF control dependency on the return values of a function.
If the function had no return value, a no-op context is returned.
Args:
return_value: The return value to set as control dependency.
Returns:
A context manager. | Create a TF control dependency on the return values of a function. | [
"Create",
"a",
"TF",
"control",
"dependency",
"on",
"the",
"return",
"values",
"of",
"a",
"function",
"."
] | def control_dependency_on_returns(return_value):
"""Create a TF control dependency on the return values of a function.
If the function had no return value, a no-op context is returned.
Args:
return_value: The return value to set as control dependency.
Returns:
A context manager.
"""
def control_d... | [
"def",
"control_dependency_on_returns",
"(",
"return_value",
")",
":",
"def",
"control_dependency_handle",
"(",
"t",
")",
":",
"if",
"isinstance",
"(",
"t",
",",
"tensor_array_ops",
".",
"TensorArray",
")",
":",
"return",
"t",
".",
"flow",
"return",
"t",
"if",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/utils/context_managers.py#L27-L49 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/losses/python/losses/loss_ops.py | python | get_total_loss | (add_regularization_losses=True, name="total_loss") | return math_ops.add_n(losses, name=name) | Returns a tensor whose value represents the total loss.
Notice that the function adds the given losses to the regularization losses.
Args:
add_regularization_losses: A boolean indicating whether or not to use the
regularization losses in the sum.
name: The name of the returned tensor.
Returns:
... | Returns a tensor whose value represents the total loss. | [
"Returns",
"a",
"tensor",
"whose",
"value",
"represents",
"the",
"total",
"loss",
"."
] | def get_total_loss(add_regularization_losses=True, name="total_loss"):
"""Returns a tensor whose value represents the total loss.
Notice that the function adds the given losses to the regularization losses.
Args:
add_regularization_losses: A boolean indicating whether or not to use the
regularization ... | [
"def",
"get_total_loss",
"(",
"add_regularization_losses",
"=",
"True",
",",
"name",
"=",
"\"total_loss\"",
")",
":",
"losses",
"=",
"get_losses",
"(",
")",
"if",
"add_regularization_losses",
":",
"losses",
"+=",
"get_regularization_losses",
"(",
")",
"return",
"m... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/losses/python/losses/loss_ops.py#L246-L265 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/rospkg_loader.py | python | RosPkgLoader.get_rosdeps | (self, resource_name, implicit=True) | If *resource_name* is a stack, returns an empty list.
:raises: :exc:`rospkg.ResourceNotFound` if *resource_name* cannot be found. | If *resource_name* is a stack, returns an empty list.
:raises: :exc:`rospkg.ResourceNotFound` if *resource_name* cannot be found. | [
"If",
"*",
"resource_name",
"*",
"is",
"a",
"stack",
"returns",
"an",
"empty",
"list",
".",
":",
"raises",
":",
":",
"exc",
":",
"rospkg",
".",
"ResourceNotFound",
"if",
"*",
"resource_name",
"*",
"cannot",
"be",
"found",
"."
] | def get_rosdeps(self, resource_name, implicit=True):
"""
If *resource_name* is a stack, returns an empty list.
:raises: :exc:`rospkg.ResourceNotFound` if *resource_name* cannot be found.
"""
if resource_name in self.get_loadable_resources():
m = self._rospack... | [
"def",
"get_rosdeps",
"(",
"self",
",",
"resource_name",
",",
"implicit",
"=",
"True",
")",
":",
"if",
"resource_name",
"in",
"self",
".",
"get_loadable_resources",
"(",
")",
":",
"m",
"=",
"self",
".",
"_rospack",
".",
"get_manifest",
"(",
"resource_name",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/rospkg_loader.py#L120-L139 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/__init__.py | python | Lock | () | return Lock() | Returns a non-recursive lock object | Returns a non-recursive lock object | [
"Returns",
"a",
"non",
"-",
"recursive",
"lock",
"object"
] | def Lock():
'''
Returns a non-recursive lock object
'''
from multiprocessing.synchronize import Lock
return Lock() | [
"def",
"Lock",
"(",
")",
":",
"from",
"multiprocessing",
".",
"synchronize",
"import",
"Lock",
"return",
"Lock",
"(",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/multiprocessing/__init__.py#L171-L176 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/keras/python/keras/backend.py | python | switch | (condition, then_expression, else_expression) | return x | Switches between two operations depending on a scalar value.
Note that both `then_expression` and `else_expression`
should be symbolic tensors of the *same shape*.
Arguments:
condition: scalar tensor (`int` or `bool`).
then_expression: either a tensor, or a callable that returns a tensor.
else... | Switches between two operations depending on a scalar value. | [
"Switches",
"between",
"two",
"operations",
"depending",
"on",
"a",
"scalar",
"value",
"."
] | def switch(condition, then_expression, else_expression):
"""Switches between two operations depending on a scalar value.
Note that both `then_expression` and `else_expression`
should be symbolic tensors of the *same shape*.
Arguments:
condition: scalar tensor (`int` or `bool`).
then_expression: ei... | [
"def",
"switch",
"(",
"condition",
",",
"then_expression",
",",
"else_expression",
")",
":",
"if",
"condition",
".",
"dtype",
"!=",
"dtypes_module",
".",
"bool",
":",
"condition",
"=",
"math_ops",
".",
"cast",
"(",
"condition",
",",
"'bool'",
")",
"if",
"n... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/backend.py#L2700-L2729 | |
llvm/llvm-project | ffa6262cb4e2a335d26416fad39a581b4f98c5f4 | clang/tools/scan-build-py/lib/libscanbuild/analyze.py | python | classify_parameters | (command) | return result | Prepare compiler flags (filters some and add others) and take out
language (-x) and architecture (-arch) flags for future processing. | Prepare compiler flags (filters some and add others) and take out
language (-x) and architecture (-arch) flags for future processing. | [
"Prepare",
"compiler",
"flags",
"(",
"filters",
"some",
"and",
"add",
"others",
")",
"and",
"take",
"out",
"language",
"(",
"-",
"x",
")",
"and",
"architecture",
"(",
"-",
"arch",
")",
"flags",
"for",
"future",
"processing",
"."
] | def classify_parameters(command):
""" Prepare compiler flags (filters some and add others) and take out
language (-x) and architecture (-arch) flags for future processing. """
result = {
'flags': [], # the filtered compiler flags
'arch_list': [], # list of architecture flags
'lang... | [
"def",
"classify_parameters",
"(",
"command",
")",
":",
"result",
"=",
"{",
"'flags'",
":",
"[",
"]",
",",
"# the filtered compiler flags",
"'arch_list'",
":",
"[",
"]",
",",
"# list of architecture flags",
"'language'",
":",
"None",
",",
"# compilation language, No... | https://github.com/llvm/llvm-project/blob/ffa6262cb4e2a335d26416fad39a581b4f98c5f4/clang/tools/scan-build-py/lib/libscanbuild/analyze.py#L779-L815 | |
sfzhang15/RefineDet | 52b6fe23dc1a160fe710b7734576dca509bf4fae | scripts/cpp_lint.py | python | CheckSectionSpacing | (filename, clean_lines, class_info, linenum, error) | Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
class_info: A _ClassInfo objects.
linenum: The number ... | Checks for additional blank line issues related to sections. | [
"Checks",
"for",
"additional",
"blank",
"line",
"issues",
"related",
"to",
"sections",
"."
] | def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
"""Checks for additional blank line issues related to sections.
Currently the only thing checked here is blank line before protected/private.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance co... | [
"def",
"CheckSectionSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"class_info",
",",
"linenum",
",",
"error",
")",
":",
"# Skip checks if the class is small, where small means 25 lines or less.",
"# 25 lines seems like a good cutoff since that's the usual height of",
"# termina... | https://github.com/sfzhang15/RefineDet/blob/52b6fe23dc1a160fe710b7734576dca509bf4fae/scripts/cpp_lint.py#L2995-L3047 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | demo/MaskedEditControls.py | python | demoPage1.onShowFill | ( self, event ) | Set fillChar parameter to '?' or ' ' | Set fillChar parameter to '?' or ' ' | [
"Set",
"fillChar",
"parameter",
"to",
"?",
"or"
] | def onShowFill( self, event ):
""" Set fillChar parameter to '?' or ' ' """
self.changeControlParams( event, "fillChar", '?', ' ' ) | [
"def",
"onShowFill",
"(",
"self",
",",
"event",
")",
":",
"self",
".",
"changeControlParams",
"(",
"event",
",",
"\"fillChar\"",
",",
"'?'",
",",
"' '",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/demo/MaskedEditControls.py#L141-L143 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/data.py | python | Expansion.is_static_string | (self) | return True | An Expansion is static if all its components are strings, not
functions. | An Expansion is static if all its components are strings, not
functions. | [
"An",
"Expansion",
"is",
"static",
"if",
"all",
"its",
"components",
"are",
"strings",
"not",
"functions",
"."
] | def is_static_string(self):
"""An Expansion is static if all its components are strings, not
functions."""
for e, is_func in self:
if is_func:
return False
return True | [
"def",
"is_static_string",
"(",
"self",
")",
":",
"for",
"e",
",",
"is_func",
"in",
"self",
":",
"if",
"is_func",
":",
"return",
"False",
"return",
"True"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/data.py#L342-L349 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/filecmp.py | python | cmp | (f1, f2, shallow=1) | return outcome | Compare two files.
Arguments:
f1 -- First file name
f2 -- Second file name
shallow -- Just check stat signature (do not read the files).
defaults to 1.
Return value:
True if the files are the same, False otherwise.
This function uses a cache for past comparisons and the... | Compare two files. | [
"Compare",
"two",
"files",
"."
] | def cmp(f1, f2, shallow=1):
"""Compare two files.
Arguments:
f1 -- First file name
f2 -- Second file name
shallow -- Just check stat signature (do not read the files).
defaults to 1.
Return value:
True if the files are the same, False otherwise.
This function uses a... | [
"def",
"cmp",
"(",
"f1",
",",
"f2",
",",
"shallow",
"=",
"1",
")",
":",
"s1",
"=",
"_sig",
"(",
"os",
".",
"stat",
"(",
"f1",
")",
")",
"s2",
"=",
"_sig",
"(",
"os",
".",
"stat",
"(",
"f2",
")",
")",
"if",
"s1",
"[",
"0",
"]",
"!=",
"st... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/filecmp.py#L21-L57 | |
eerolanguage/clang | 91360bee004a1cbdb95fe5eb605ef243152da41b | bindings/python/clang/cindex.py | python | Diagnostic.category_name | (self) | return conf.lib.clang_getDiagnosticCategoryName(self.category_number) | The string name of the category for this diagnostic. | The string name of the category for this diagnostic. | [
"The",
"string",
"name",
"of",
"the",
"category",
"for",
"this",
"diagnostic",
"."
] | def category_name(self):
"""The string name of the category for this diagnostic."""
return conf.lib.clang_getDiagnosticCategoryName(self.category_number) | [
"def",
"category_name",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getDiagnosticCategoryName",
"(",
"self",
".",
"category_number",
")"
] | https://github.com/eerolanguage/clang/blob/91360bee004a1cbdb95fe5eb605ef243152da41b/bindings/python/clang/cindex.py#L368-L370 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | bin/start-impala-cluster.py | python | DockerMiniClusterOperations.get_cluster | (self) | return ImpalaCluster(docker_network=self.network_name,
use_admission_service=options.enable_admission_service) | Return an ImpalaCluster instance. | Return an ImpalaCluster instance. | [
"Return",
"an",
"ImpalaCluster",
"instance",
"."
] | def get_cluster(self):
"""Return an ImpalaCluster instance."""
return ImpalaCluster(docker_network=self.network_name,
use_admission_service=options.enable_admission_service) | [
"def",
"get_cluster",
"(",
"self",
")",
":",
"return",
"ImpalaCluster",
"(",
"docker_network",
"=",
"self",
".",
"network_name",
",",
"use_admission_service",
"=",
"options",
".",
"enable_admission_service",
")"
] | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/bin/start-impala-cluster.py#L571-L574 | |
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/regression/xsl_reports/email_maintainers.py | python | Report.composeTestingSummaryEmail | (self) | return message | Compose a message to send to the Boost Testing list. Returns
the message text if a message is needed, returns None
otherwise. | Compose a message to send to the Boost Testing list. Returns
the message text if a message is needed, returns None
otherwise. | [
"Compose",
"a",
"message",
"to",
"send",
"to",
"the",
"Boost",
"Testing",
"list",
".",
"Returns",
"the",
"message",
"text",
"if",
"a",
"message",
"is",
"needed",
"returns",
"None",
"otherwise",
"."
] | def composeTestingSummaryEmail(self):
"""
Compose a message to send to the Boost Testing list. Returns
the message text if a message is needed, returns None
otherwise.
"""
brokenPlatforms = 0
for platform in sorted_keys( self.platforms ):
if self.platf... | [
"def",
"composeTestingSummaryEmail",
"(",
"self",
")",
":",
"brokenPlatforms",
"=",
"0",
"for",
"platform",
"in",
"sorted_keys",
"(",
"self",
".",
"platforms",
")",
":",
"if",
"self",
".",
"platforms",
"[",
"platform",
"]",
".",
"isBroken",
"(",
")",
":",
... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/regression/xsl_reports/email_maintainers.py#L579-L625 | |
OAID/Tengine | 66b2c22ad129d25e2fc6de3b22a608bb54dd90db | tools/optimize/segformer-opt.py | python | keep_or_del_elem | (obj, elem_name_list, keep=False) | return del_elem_list | keep/delete elem from input objectes | keep/delete elem from input objectes | [
"keep",
"/",
"delete",
"elem",
"from",
"input",
"objectes"
] | def keep_or_del_elem(obj, elem_name_list, keep=False):
"""
keep/delete elem from input objectes
"""
del_elem_list = []
for i, n in enumerate(obj):
if (n.name in elem_name_list and not keep) or (n.name not in elem_name_list and keep):
del_elem_list.append(i)
#print("del elem ... | [
"def",
"keep_or_del_elem",
"(",
"obj",
",",
"elem_name_list",
",",
"keep",
"=",
"False",
")",
":",
"del_elem_list",
"=",
"[",
"]",
"for",
"i",
",",
"n",
"in",
"enumerate",
"(",
"obj",
")",
":",
"if",
"(",
"n",
".",
"name",
"in",
"elem_name_list",
"an... | https://github.com/OAID/Tengine/blob/66b2c22ad129d25e2fc6de3b22a608bb54dd90db/tools/optimize/segformer-opt.py#L120-L134 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/_custom_op/cholesky_trsm_impl.py | python | cus_cholesky_trsm | (input_x, output, kernel_name) | return tik_instance | cus_cholesky_trsm | cus_cholesky_trsm | [
"cus_cholesky_trsm"
] | def cus_cholesky_trsm(input_x, output, kernel_name):
"""cus_cholesky_trsm"""
input_x_shape = input_x.get("shape")
output_shape = output.get("shape")
split_dim = 128
matrix_dim = input_x_shape[0]
split_dim = min(matrix_dim, split_dim)
vector_repeat_times = int(split_dim // 64)
blocks = in... | [
"def",
"cus_cholesky_trsm",
"(",
"input_x",
",",
"output",
",",
"kernel_name",
")",
":",
"input_x_shape",
"=",
"input_x",
".",
"get",
"(",
"\"shape\"",
")",
"output_shape",
"=",
"output",
".",
"get",
"(",
"\"shape\"",
")",
"split_dim",
"=",
"128",
"matrix_di... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/cholesky_trsm_impl.py#L34-L111 | |
IfcOpenShell/IfcOpenShell | 2c2954b11a9c9d581bef03240836d4567e69ad0b | src/ifc2ca/scriptSalome.py | python | MODEL.makeFace | (self, pl) | return self.geompy.MakeFaceWires(LineList, 1) | Function to define a Face from
a polyline (list of points) | Function to define a Face from
a polyline (list of points) | [
"Function",
"to",
"define",
"a",
"Face",
"from",
"a",
"polyline",
"(",
"list",
"of",
"points",
")"
] | def makeFace(self, pl):
"""Function to define a Face from
a polyline (list of points)"""
pointList = [None for _ in range(len(pl))]
for ip, (x, y, z) in enumerate(pl):
pointList[ip] = self.geompy.MakeVertex(x, y, z)
LineList = [None for _ in range(len(pl))]
... | [
"def",
"makeFace",
"(",
"self",
",",
"pl",
")",
":",
"pointList",
"=",
"[",
"None",
"for",
"_",
"in",
"range",
"(",
"len",
"(",
"pl",
")",
")",
"]",
"for",
"ip",
",",
"(",
"x",
",",
"y",
",",
"z",
")",
"in",
"enumerate",
"(",
"pl",
")",
":"... | https://github.com/IfcOpenShell/IfcOpenShell/blob/2c2954b11a9c9d581bef03240836d4567e69ad0b/src/ifc2ca/scriptSalome.py#L70-L83 | |
jts/sga | 229293b2c97777aa015581b6075ed6b60050b34d | src/bin/sga-preqc-report.py | python | get_distinct_colors | (nr) | return [ hexcols[xarr[nr-1][i]] for i in range(nr) ] | get nr distinct fairly colorblind-safe colors
:params nr: should be 1 to 12, above 12 returns 12
:returns: list of colours in HTML hex
adapted form work by Paul Tol Pieter van der Meer at
SRON - Netherlands Institute for Space Research | get nr distinct fairly colorblind-safe colors
:params nr: should be 1 to 12, above 12 returns 12
:returns: list of colours in HTML hex
adapted form work by Paul Tol Pieter van der Meer at
SRON - Netherlands Institute for Space Research | [
"get",
"nr",
"distinct",
"fairly",
"colorblind",
"-",
"safe",
"colors",
":",
"params",
"nr",
":",
"should",
"be",
"1",
"to",
"12",
"above",
"12",
"returns",
"12",
":",
"returns",
":",
"list",
"of",
"colours",
"in",
"HTML",
"hex",
"adapted",
"form",
"wo... | def get_distinct_colors(nr):
"""get nr distinct fairly colorblind-safe colors
:params nr: should be 1 to 12, above 12 returns 12
:returns: list of colours in HTML hex
adapted form work by Paul Tol Pieter van der Meer at
SRON - Netherlands Institute for Space Research"""
# col... | [
"def",
"get_distinct_colors",
"(",
"nr",
")",
":",
"# color table in HTML hex format",
"hexcols",
"=",
"[",
"'#332288'",
",",
"'#88CCEE'",
",",
"'#44AA99'",
",",
"'#117733'",
",",
"'#999933'",
",",
"'#DDCC77'",
",",
"'#CC6677'",
",",
"'#882255'",
",",
"'#AA4499'",... | https://github.com/jts/sga/blob/229293b2c97777aa015581b6075ed6b60050b34d/src/bin/sga-preqc-report.py#L118-L146 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/mozbuild/mozbuild/frontend/reader.py | python | MozbuildSandbox.exec_file | (self, path, filesystem_absolute=False) | Override exec_file to normalize paths and restrict file loading.
Paths will be rejected if they do not fall under topsrcdir or one of
the external roots. | Override exec_file to normalize paths and restrict file loading. | [
"Override",
"exec_file",
"to",
"normalize",
"paths",
"and",
"restrict",
"file",
"loading",
"."
] | def exec_file(self, path, filesystem_absolute=False):
"""Override exec_file to normalize paths and restrict file loading.
Paths will be rejected if they do not fall under topsrcdir or one of
the external roots.
"""
# realpath() is needed for true security. But, this isn't for s... | [
"def",
"exec_file",
"(",
"self",
",",
"path",
",",
"filesystem_absolute",
"=",
"False",
")",
":",
"# realpath() is needed for true security. But, this isn't for security",
"# protection, so it is omitted.",
"normalized_path",
"=",
"self",
".",
"normalize_path",
"(",
"path",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozbuild/frontend/reader.py#L190-L205 | ||
jiaxiang-wu/quantized-cnn | 4d020e17026df90e40111d219e3eb74e0afb1588 | cpplint.py | python | _IncludeState.ResetSection | (self, directive) | Reset section checking for preprocessor directive.
Args:
directive: preprocessor directive (e.g. "if", "else"). | Reset section checking for preprocessor directive. | [
"Reset",
"section",
"checking",
"for",
"preprocessor",
"directive",
"."
] | def ResetSection(self, directive):
"""Reset section checking for preprocessor directive.
Args:
directive: preprocessor directive (e.g. "if", "else").
"""
# The name of the current section.
self._section = self._INITIAL_SECTION
# The path of last found header.
self._last_header = ''
... | [
"def",
"ResetSection",
"(",
"self",
",",
"directive",
")",
":",
"# The name of the current section.",
"self",
".",
"_section",
"=",
"self",
".",
"_INITIAL_SECTION",
"# The path of last found header.",
"self",
".",
"_last_header",
"=",
"''",
"# Update list of includes. No... | https://github.com/jiaxiang-wu/quantized-cnn/blob/4d020e17026df90e40111d219e3eb74e0afb1588/cpplint.py#L646-L662 | ||
lzhang10/maxent | 3560c94b737d4272ed86de529e50d823200e6d8e | python/maxent/pymaxent.py | python | MaxentModel.eval | (self, context) | return sorted(outcomes, key=lambda x: x[1], reverse=True) | Evaluates given context and return a outcome distribution.
i.e. Pr(outcome | context)
context is a list of string names of the contextual predicates
contextual predicates which are not seen during training are
simply dropped off.
eval() return a list of all possible outcomes wit... | Evaluates given context and return a outcome distribution. | [
"Evaluates",
"given",
"context",
"and",
"return",
"a",
"outcome",
"distribution",
"."
] | def eval(self, context):
"""Evaluates given context and return a outcome distribution.
i.e. Pr(outcome | context)
context is a list of string names of the contextual predicates
contextual predicates which are not seen during training are
simply dropped off.
eval() return... | [
"def",
"eval",
"(",
"self",
",",
"context",
")",
":",
"assert",
"type",
"(",
"context",
")",
"==",
"list",
"or",
"type",
"(",
"context",
")",
"==",
"tuple",
"n_outcome",
"=",
"len",
"(",
"self",
".",
"outcome_map",
")",
"probs",
"=",
"[",
"0.0",
"]... | https://github.com/lzhang10/maxent/blob/3560c94b737d4272ed86de529e50d823200e6d8e/python/maxent/pymaxent.py#L192-L229 | |
Harick1/caffe-yolo | eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3 | scripts/cpp_lint.py | python | CheckForMultilineCommentsAndStrings | (filename, clean_lines, linenum, error) | Logs an error if we see /* ... */ or "..." that extend past one line.
/* ... */ comments are legit inside macros, for one line.
Otherwise, we prefer // comments, so it's ok to warn about the
other. Likewise, it's ok for strings to extend across multiple
lines, as long as a line continuation character (backsla... | Logs an error if we see /* ... */ or "..." that extend past one line. | [
"Logs",
"an",
"error",
"if",
"we",
"see",
"/",
"*",
"...",
"*",
"/",
"or",
"...",
"that",
"extend",
"past",
"one",
"line",
"."
] | def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
"""Logs an error if we see /* ... */ or "..." that extend past one line.
/* ... */ comments are legit inside macros, for one line.
Otherwise, we prefer // comments, so it's ok to warn about the
other. Likewise, it's ok for strings... | [
"def",
"CheckForMultilineCommentsAndStrings",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Remove all \\\\ (escaped backslashes) from the line. They are OK, and the",
"# secon... | https://github.com/Harick1/caffe-yolo/blob/eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3/scripts/cpp_lint.py#L1526-L1561 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/systrace/systrace/tracing_agents/atrace_agent.py | python | _construct_extra_atrace_args | (options, categories) | return extra_args | Construct extra arguments (-a, -k, categories) for atrace command.
Args:
options: Tracing options.
categories: Categories of trace events to capture. | Construct extra arguments (-a, -k, categories) for atrace command. | [
"Construct",
"extra",
"arguments",
"(",
"-",
"a",
"-",
"k",
"categories",
")",
"for",
"atrace",
"command",
"."
] | def _construct_extra_atrace_args(options, categories):
"""Construct extra arguments (-a, -k, categories) for atrace command.
Args:
options: Tracing options.
categories: Categories of trace events to capture.
"""
extra_args = []
if options.app_name is not None:
extra_args.extend(['-a', option... | [
"def",
"_construct_extra_atrace_args",
"(",
"options",
",",
"categories",
")",
":",
"extra_args",
"=",
"[",
"]",
"if",
"options",
".",
"app_name",
"is",
"not",
"None",
":",
"extra_args",
".",
"extend",
"(",
"[",
"'-a'",
",",
"options",
".",
"app_name",
"]"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/systrace/systrace/tracing_agents/atrace_agent.py#L93-L109 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/generator/msvs.py | python | _NormalizedSource | (source) | return source | Normalize the path.
But not if that gets rid of a variable, as this may expand to something
larger than one directory.
Arguments:
source: The path to be normalize.d
Returns:
The normalized path. | Normalize the path. | [
"Normalize",
"the",
"path",
"."
] | def _NormalizedSource(source):
"""Normalize the path.
But not if that gets rid of a variable, as this may expand to something
larger than one directory.
Arguments:
source: The path to be normalize.d
Returns:
The normalized path.
"""
normalized = os.path.normpath(source)
if source.co... | [
"def",
"_NormalizedSource",
"(",
"source",
")",
":",
"normalized",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"source",
")",
"if",
"source",
".",
"count",
"(",
"\"$\"",
")",
"==",
"normalized",
".",
"count",
"(",
"\"$\"",
")",
":",
"source",
"=",
... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/generator/msvs.py#L137-L152 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/websockify/websockify/websocket.py | python | WebSocketServer.msg | (self, *args, **kwargs) | Output message as info | Output message as info | [
"Output",
"message",
"as",
"info"
] | def msg(self, *args, **kwargs):
""" Output message as info """
self.logger.log(logging.INFO, *args, **kwargs) | [
"def",
"msg",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"logger",
".",
"log",
"(",
"logging",
".",
"INFO",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/websockify/websockify/websocket.py#L869-L871 | ||
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/core/mesh.py | python | __Mesh_cutBoundary__ | (self, marker, boundaryMarker=None) | Cut the mesh along a given inner boundary.
Cut the mesh along a given boundary and convert this inner boundary to an outer. There will be new nodes to cut the connection between neighbouring cells. The new boundary can have an optional boundaryMarker.
Restrictions
------------
* 2D p1
* on... | Cut the mesh along a given inner boundary. | [
"Cut",
"the",
"mesh",
"along",
"a",
"given",
"inner",
"boundary",
"."
] | def __Mesh_cutBoundary__(self, marker, boundaryMarker=None):
"""Cut the mesh along a given inner boundary.
Cut the mesh along a given boundary and convert this inner boundary to an outer. There will be new nodes to cut the connection between neighbouring cells. The new boundary can have an optional boundaryMar... | [
"def",
"__Mesh_cutBoundary__",
"(",
"self",
",",
"marker",
",",
"boundaryMarker",
"=",
"None",
")",
":",
"import",
"pygimli",
"as",
"pg",
"if",
"boundaryMarker",
"is",
"None",
":",
"boundaryMarker",
"=",
"marker",
"mesh",
"=",
"self",
"def",
"replaceNode_",
... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/core/mesh.py#L432-L586 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | python | _BaseEstimator.set_params | (self, **params) | return self | Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
``<component>__<parameter>`` so that it's possible to update each
component of a nested object.
Args:
**params: Parameters.
... | Set the parameters of this estimator. | [
"Set",
"the",
"parameters",
"of",
"this",
"estimator",
"."
] | def set_params(self, **params):
"""Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The former have parameters of the form
``<component>__<parameter>`` so that it's possible to update each
component of a nested object.
... | [
"def",
"set_params",
"(",
"self",
",",
"*",
"*",
"params",
")",
":",
"if",
"not",
"params",
":",
"# Simple optimisation to gain speed (inspect is slow)",
"return",
"self",
"valid_params",
"=",
"self",
".",
"get_params",
"(",
"deep",
"=",
"True",
")",
"for",
"k... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/estimators/_sklearn.py#L68-L109 | |
KDE/krita | 10ea63984e00366865769c193ab298de73a59c5c | plugins/python/batch_exporter/COATools.py | python | COAToolsFormat.save | (self, output_dir="") | Parses layers configured to export to COA Tools and builds the JSON data
COA Tools need to import the files | Parses layers configured to export to COA Tools and builds the JSON data
COA Tools need to import the files | [
"Parses",
"layers",
"configured",
"to",
"export",
"to",
"COA",
"Tools",
"and",
"builds",
"the",
"JSON",
"data",
"COA",
"Tools",
"need",
"to",
"import",
"the",
"files"
] | def save(self, output_dir=""):
"""
Parses layers configured to export to COA Tools and builds the JSON data
COA Tools need to import the files
"""
# For each top-level node (Group Layer)
export_dir = output_dir
for wn in self.nodes:
children = wn.child... | [
"def",
"save",
"(",
"self",
",",
"output_dir",
"=",
"\"\"",
")",
":",
"# For each top-level node (Group Layer)",
"export_dir",
"=",
"output_dir",
"for",
"wn",
"in",
"self",
".",
"nodes",
":",
"children",
"=",
"wn",
".",
"children",
"path",
"=",
"wn",
".",
... | https://github.com/KDE/krita/blob/10ea63984e00366865769c193ab298de73a59c5c/plugins/python/batch_exporter/COATools.py#L31-L96 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/special/orthogonal.py | python | chebyc | (n, monic=False) | return p | r"""Chebyshev polynomial of the first kind on :math:`[-2, 2]`.
Defined as :math:`C_n(x) = 2T_n(x/2)`, where :math:`T_n` is the
nth Chebychev polynomial of the first kind.
Parameters
----------
n : int
Degree of the polynomial.
monic : bool, optional
If `True`, scale the leading... | r"""Chebyshev polynomial of the first kind on :math:`[-2, 2]`. | [
"r",
"Chebyshev",
"polynomial",
"of",
"the",
"first",
"kind",
"on",
":",
"math",
":",
"[",
"-",
"2",
"2",
"]",
"."
] | def chebyc(n, monic=False):
r"""Chebyshev polynomial of the first kind on :math:`[-2, 2]`.
Defined as :math:`C_n(x) = 2T_n(x/2)`, where :math:`T_n` is the
nth Chebychev polynomial of the first kind.
Parameters
----------
n : int
Degree of the polynomial.
monic : bool, optional
... | [
"def",
"chebyc",
"(",
"n",
",",
"monic",
"=",
"False",
")",
":",
"if",
"n",
"<",
"0",
":",
"raise",
"ValueError",
"(",
"\"n must be nonnegative.\"",
")",
"if",
"n",
"==",
"0",
":",
"n1",
"=",
"n",
"+",
"1",
"else",
":",
"n1",
"=",
"n",
"x",
","... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/orthogonal.py#L1581-L1633 | |
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | sp/src/thirdparty/protobuf-2.3.0/python/mox.py | python | StrContains.__init__ | (self, search_string) | Initialize.
Args:
# search_string: the string you are searching for
search_string: str | Initialize. | [
"Initialize",
"."
] | def __init__(self, search_string):
"""Initialize.
Args:
# search_string: the string you are searching for
search_string: str
"""
self._search_string = search_string | [
"def",
"__init__",
"(",
"self",
",",
"search_string",
")",
":",
"self",
".",
"_search_string",
"=",
"search_string"
] | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/mox.py#L874-L882 | ||
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | pynest/examples/Potjans_2014/helpers.py | python | boxplot | (path, populations) | Creates a boxblot of the firing rates of all populations.
To create the boxplot, the firing rates of each neuron in each population
need to be computed with the function ``firing_rate()``.
Parameters
-----------
path
Path where the firing rates are stored.
populations
Names of ... | Creates a boxblot of the firing rates of all populations. | [
"Creates",
"a",
"boxblot",
"of",
"the",
"firing",
"rates",
"of",
"all",
"populations",
"."
] | def boxplot(path, populations):
""" Creates a boxblot of the firing rates of all populations.
To create the boxplot, the firing rates of each neuron in each population
need to be computed with the function ``firing_rate()``.
Parameters
-----------
path
Path where the firing rates are s... | [
"def",
"boxplot",
"(",
"path",
",",
"populations",
")",
":",
"fs",
"=",
"18",
"pop_names",
"=",
"[",
"string",
".",
"replace",
"(",
"'23'",
",",
"'2/3'",
")",
"for",
"string",
"in",
"populations",
"]",
"label_pos",
"=",
"list",
"(",
"range",
"(",
"le... | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/examples/Potjans_2014/helpers.py#L300-L352 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/examples/image_retraining/label_image.py | python | main | (argv) | Runs inference on an image. | Runs inference on an image. | [
"Runs",
"inference",
"on",
"an",
"image",
"."
] | def main(argv):
"""Runs inference on an image."""
if argv[1:]:
raise ValueError('Unused Command Line Args: %s' % argv[1:])
if not tf.gfile.Exists(FLAGS.image):
tf.logging.fatal('image file does not exist %s', FLAGS.image)
if not tf.gfile.Exists(FLAGS.labels):
tf.logging.fatal('labels file does not... | [
"def",
"main",
"(",
"argv",
")",
":",
"if",
"argv",
"[",
"1",
":",
"]",
":",
"raise",
"ValueError",
"(",
"'Unused Command Line Args: %s'",
"%",
"argv",
"[",
"1",
":",
"]",
")",
"if",
"not",
"tf",
".",
"gfile",
".",
"Exists",
"(",
"FLAGS",
".",
"ima... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/examples/image_retraining/label_image.py#L118-L142 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Dir.py | python | DirEntryScanner | (**kw) | return SCons.Scanner.Base(scan_in_memory, "DirEntryScanner", **kw) | Return a prototype Scanner instance for "scanning"
directory Nodes for their in-memory entries | Return a prototype Scanner instance for "scanning"
directory Nodes for their in-memory entries | [
"Return",
"a",
"prototype",
"Scanner",
"instance",
"for",
"scanning",
"directory",
"Nodes",
"for",
"their",
"in",
"-",
"memory",
"entries"
] | def DirEntryScanner(**kw):
"""Return a prototype Scanner instance for "scanning"
directory Nodes for their in-memory entries"""
kw['node_factory'] = SCons.Node.FS.Entry
kw['recursive'] = None
return SCons.Scanner.Base(scan_in_memory, "DirEntryScanner", **kw) | [
"def",
"DirEntryScanner",
"(",
"*",
"*",
"kw",
")",
":",
"kw",
"[",
"'node_factory'",
"]",
"=",
"SCons",
".",
"Node",
".",
"FS",
".",
"Entry",
"kw",
"[",
"'recursive'",
"]",
"=",
"None",
"return",
"SCons",
".",
"Scanner",
".",
"Base",
"(",
"scan_in_m... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Scanner/Dir.py#L39-L44 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/textwrap.py | python | shorten | (text, width, **kwargs) | return w.fill(' '.join(text.strip().split())) | Collapse and truncate the given text to fit in the given width.
The text first has its whitespace collapsed. If it then fits in
the *width*, it is returned as is. Otherwise, as many words
as possible are joined and then the placeholder is appended::
>>> textwrap.shorten("Hello world!", width=12... | Collapse and truncate the given text to fit in the given width. | [
"Collapse",
"and",
"truncate",
"the",
"given",
"text",
"to",
"fit",
"in",
"the",
"given",
"width",
"."
] | def shorten(text, width, **kwargs):
"""Collapse and truncate the given text to fit in the given width.
The text first has its whitespace collapsed. If it then fits in
the *width*, it is returned as is. Otherwise, as many words
as possible are joined and then the placeholder is appended::
>>>... | [
"def",
"shorten",
"(",
"text",
",",
"width",
",",
"*",
"*",
"kwargs",
")",
":",
"w",
"=",
"TextWrapper",
"(",
"width",
"=",
"width",
",",
"max_lines",
"=",
"1",
",",
"*",
"*",
"kwargs",
")",
"return",
"w",
".",
"fill",
"(",
"' '",
".",
"join",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/textwrap.py#L393-L406 | |
monacoinproject/monacoin | 0d94a247eeabf0c1ed43ff1e1a62d115043a056e | contrib/devtools/security-check.py | python | check_ELF_Canary | (executable) | return ok | Check for use of stack canary | Check for use of stack canary | [
"Check",
"for",
"use",
"of",
"stack",
"canary"
] | def check_ELF_Canary(executable):
'''
Check for use of stack canary
'''
p = subprocess.Popen([READELF_CMD, '--dyn-syms', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
(stdout, stderr) = p.communicate()
if p.returncode:
... | [
"def",
"check_ELF_Canary",
"(",
"executable",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"READELF_CMD",
",",
"'--dyn-syms'",
",",
"'-W'",
",",
"executable",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"stderr",
"=",
"subprocess"... | https://github.com/monacoinproject/monacoin/blob/0d94a247eeabf0c1ed43ff1e1a62d115043a056e/contrib/devtools/security-check.py#L105-L117 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextCtrl.ApplyStyleSheet | (*args, **kwargs) | return _richtext.RichTextCtrl_ApplyStyleSheet(*args, **kwargs) | ApplyStyleSheet(self, wxRichTextStyleSheet styleSheet=None) -> bool
Apply the style sheet to the buffer, for example if the styles have
changed. | ApplyStyleSheet(self, wxRichTextStyleSheet styleSheet=None) -> bool | [
"ApplyStyleSheet",
"(",
"self",
"wxRichTextStyleSheet",
"styleSheet",
"=",
"None",
")",
"-",
">",
"bool"
] | def ApplyStyleSheet(*args, **kwargs):
"""
ApplyStyleSheet(self, wxRichTextStyleSheet styleSheet=None) -> bool
Apply the style sheet to the buffer, for example if the styles have
changed.
"""
return _richtext.RichTextCtrl_ApplyStyleSheet(*args, **kwargs) | [
"def",
"ApplyStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_ApplyStyleSheet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4023-L4030 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/pyct/cfg.py | python | GraphBuilder._connect_nodes | (self, first, second) | Connects nodes to signify that control flows from first to second.
Args:
first: Union[Set[Node, ...], Node]
second: Node | Connects nodes to signify that control flows from first to second. | [
"Connects",
"nodes",
"to",
"signify",
"that",
"control",
"flows",
"from",
"first",
"to",
"second",
"."
] | def _connect_nodes(self, first, second):
"""Connects nodes to signify that control flows from first to second.
Args:
first: Union[Set[Node, ...], Node]
second: Node
"""
if isinstance(first, Node):
first.next.add(second)
second.prev.add(first)
self.forward_edges.add((first,... | [
"def",
"_connect_nodes",
"(",
"self",
",",
"first",
",",
"second",
")",
":",
"if",
"isinstance",
"(",
"first",
",",
"Node",
")",
":",
"first",
".",
"next",
".",
"add",
"(",
"second",
")",
"second",
".",
"prev",
".",
"add",
"(",
"first",
")",
"self"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/pyct/cfg.py#L326-L339 | ||
imistyrain/MTCNN | 1a28eb3b93d73d496d411977ea5520810609d376 | python/Mtcnndnn.py | python | MTCNNDetector.bbreg | (self,boundingbox,reg) | return boundingbox | Calibrate bounding boxes | Calibrate bounding boxes | [
"Calibrate",
"bounding",
"boxes"
] | def bbreg(self,boundingbox,reg):
'''Calibrate bounding boxes'''
if reg.shape[1]==1:
reg = np.shape(reg,(reg.shape[2],reg.shape[3])).T
w = boundingbox[:,2]-boundingbox[:,0]+1
h = boundingbox[:,3]-boundingbox[:,1]+1
boundingbox[:,0:4] = np.reshape(np.hstac... | [
"def",
"bbreg",
"(",
"self",
",",
"boundingbox",
",",
"reg",
")",
":",
"if",
"reg",
".",
"shape",
"[",
"1",
"]",
"==",
"1",
":",
"reg",
"=",
"np",
".",
"shape",
"(",
"reg",
",",
"(",
"reg",
".",
"shape",
"[",
"2",
"]",
",",
"reg",
".",
"sha... | https://github.com/imistyrain/MTCNN/blob/1a28eb3b93d73d496d411977ea5520810609d376/python/Mtcnndnn.py#L21-L31 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/framework.py | python | Block._insert_op | (self, index, *args, **kwargs) | return self._insert_op_without_sync(index, *args, **kwargs) | Insert a Operator according to the giving arguments.
Args:
index(int): the place that the operator to insert.
Returns:
Operator: the insert Operator. | Insert a Operator according to the giving arguments. | [
"Insert",
"a",
"Operator",
"according",
"to",
"the",
"giving",
"arguments",
"."
] | def _insert_op(self, index, *args, **kwargs):
"""
Insert a Operator according to the giving arguments.
Args:
index(int): the place that the operator to insert.
Returns:
Operator: the insert Operator.
"""
self._sync_with_cpp()
return self.... | [
"def",
"_insert_op",
"(",
"self",
",",
"index",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_sync_with_cpp",
"(",
")",
"return",
"self",
".",
"_insert_op_without_sync",
"(",
"index",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/framework.py#L3503-L3514 | |
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/155.min-stack.py | python | MinStack.__init__ | (self) | initialize your data structure here. | initialize your data structure here. | [
"initialize",
"your",
"data",
"structure",
"here",
"."
] | def __init__(self):
"""
initialize your data structure here.
"""
self.stack = []
self.mini = [] | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"stack",
"=",
"[",
"]",
"self",
".",
"mini",
"=",
"[",
"]"
] | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/155.min-stack.py#L3-L8 | ||
chanyn/3Dpose_ssl | 585696676279683a279b1ecca136c0e0d02aef2a | caffe-3dssl/scripts/cpp_lint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance contai... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"startchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"startchar",
"not",
"in",
"'({[<'",
":",
"return",
"(",
... | https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/scripts/cpp_lint.py#L1254-L1297 | |
kevinlin311tw/caffe-cvprw15 | 45c2a1bf0368569c54e0be4edf8d34285cf79e70 | scripts/cpp_lint.py | python | _CppLintState.SetFilters | (self, filters) | Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Raises:
ValueError: The comma-sepa... | Sets the error-message filters. | [
"Sets",
"the",
"error",
"-",
"message",
"filters",
"."
] | def SetFilters(self, filters):
"""Sets the error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "+whitespace/indent").
Each filter should start with + or -; else we die.
Ra... | [
"def",
"SetFilters",
"(",
"self",
",",
"filters",
")",
":",
"# Default filters always have less priority than the flag ones.",
"self",
".",
"filters",
"=",
"_DEFAULT_FILTERS",
"[",
":",
"]",
"for",
"filt",
"in",
"filters",
".",
"split",
"(",
"','",
")",
":",
"cl... | https://github.com/kevinlin311tw/caffe-cvprw15/blob/45c2a1bf0368569c54e0be4edf8d34285cf79e70/scripts/cpp_lint.py#L717-L740 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/linalg/interpolative.py | python | id_to_svd | (B, idx, proj) | return U, S, V | Convert ID to SVD.
The SVD reconstruction of a matrix with skeleton matrix `B` and ID indices and
coefficients `idx` and `proj`, respectively, is::
U, S, V = id_to_svd(B, idx, proj)
A = numpy.dot(U, numpy.dot(numpy.diag(S), V.conj().T))
See also :func:`svd`.
.. This function automat... | Convert ID to SVD. | [
"Convert",
"ID",
"to",
"SVD",
"."
] | def id_to_svd(B, idx, proj):
"""
Convert ID to SVD.
The SVD reconstruction of a matrix with skeleton matrix `B` and ID indices and
coefficients `idx` and `proj`, respectively, is::
U, S, V = id_to_svd(B, idx, proj)
A = numpy.dot(U, numpy.dot(numpy.diag(S), V.conj().T))
See also :f... | [
"def",
"id_to_svd",
"(",
"B",
",",
"idx",
",",
"proj",
")",
":",
"if",
"_is_real",
"(",
"B",
")",
":",
"U",
",",
"V",
",",
"S",
"=",
"backend",
".",
"idd_id2svd",
"(",
"B",
",",
"idx",
"+",
"1",
",",
"proj",
")",
"else",
":",
"U",
",",
"V",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/linalg/interpolative.py#L705-L743 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py | python | _CudnnRNN._canonical_bias_shape | (self, unused_layer) | return [[self._num_units]] * num_dirs * self._num_params_per_layer | Shapes of Cudnn canonical bias tensors for given layer. | Shapes of Cudnn canonical bias tensors for given layer. | [
"Shapes",
"of",
"Cudnn",
"canonical",
"bias",
"tensors",
"for",
"given",
"layer",
"."
] | def _canonical_bias_shape(self, unused_layer):
"""Shapes of Cudnn canonical bias tensors for given layer."""
num_dirs = 1 if self._direction == CUDNN_RNN_UNIDIRECTION else 2
return [[self._num_units]] * num_dirs * self._num_params_per_layer | [
"def",
"_canonical_bias_shape",
"(",
"self",
",",
"unused_layer",
")",
":",
"num_dirs",
"=",
"1",
"if",
"self",
".",
"_direction",
"==",
"CUDNN_RNN_UNIDIRECTION",
"else",
"2",
"return",
"[",
"[",
"self",
".",
"_num_units",
"]",
"]",
"*",
"num_dirs",
"*",
"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/layers/cudnn_rnn.py#L481-L484 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py | python | Mozilla_suite_Events.Go | (self, _object, _attributes={}, **_arguments) | Go: navigate a window: back, forward, again(reload), home)
Required argument: window
Keyword argument direction: undocumented, typecode 'dire'
Keyword argument _attributes: AppleEvent attribute dictionary | Go: navigate a window: back, forward, again(reload), home)
Required argument: window
Keyword argument direction: undocumented, typecode 'dire'
Keyword argument _attributes: AppleEvent attribute dictionary | [
"Go",
":",
"navigate",
"a",
"window",
":",
"back",
"forward",
"again",
"(",
"reload",
")",
"home",
")",
"Required",
"argument",
":",
"window",
"Keyword",
"argument",
"direction",
":",
"undocumented",
"typecode",
"dire",
"Keyword",
"argument",
"_attributes",
":... | def Go(self, _object, _attributes={}, **_arguments):
"""Go: navigate a window: back, forward, again(reload), home)
Required argument: window
Keyword argument direction: undocumented, typecode 'dire'
Keyword argument _attributes: AppleEvent attribute dictionary
"""
_code =... | [
"def",
"Go",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MOSS'",
"_subcode",
"=",
"'gogo'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_Go",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py#L79-L99 | ||
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | cpp/build-support/iwyu/iwyu_tool.py | python | iwyu_formatter | (output) | Process iwyu's output, basically a no-op. | Process iwyu's output, basically a no-op. | [
"Process",
"iwyu",
"s",
"output",
"basically",
"a",
"no",
"-",
"op",
"."
] | def iwyu_formatter(output):
""" Process iwyu's output, basically a no-op. """
print('\n'.join(output)) | [
"def",
"iwyu_formatter",
"(",
"output",
")",
":",
"print",
"(",
"'\\n'",
".",
"join",
"(",
"output",
")",
")"
] | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/cpp/build-support/iwyu/iwyu_tool.py#L86-L88 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/optimizer.py | python | Optimizer._get_global_accumulator | (self, name) | return self._global_accumulators[name] | Utility function to fetch a global accumulator
Args:
name: name of the accumulator
Returns:
accumulator variable | Utility function to fetch a global accumulator | [
"Utility",
"function",
"to",
"fetch",
"a",
"global",
"accumulator"
] | def _get_global_accumulator(self, name):
"""Utility function to fetch a global accumulator
Args:
name: name of the accumulator
Returns:
accumulator variable
"""
if self._name is not None:
name = self._name + "_" + name
if (name not in... | [
"def",
"_get_global_accumulator",
"(",
"self",
",",
"name",
")",
":",
"if",
"self",
".",
"_name",
"is",
"not",
"None",
":",
"name",
"=",
"self",
".",
"_name",
"+",
"\"_\"",
"+",
"name",
"if",
"(",
"name",
"not",
"in",
"self",
".",
"_global_accumulators... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/optimizer.py#L708-L721 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/ndarray/ndarray.py | python | NDArray.ceil | (self, *args, **kwargs) | return op.ceil(self, *args, **kwargs) | Convenience fluent method for :py:func:`ceil`.
The arguments are the same as for :py:func:`ceil`, with
this array as data. | Convenience fluent method for :py:func:`ceil`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"ceil",
"."
] | def ceil(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`ceil`.
The arguments are the same as for :py:func:`ceil`, with
this array as data.
"""
return op.ceil(self, *args, **kwargs) | [
"def",
"ceil",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"ceil",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/ndarray/ndarray.py#L1998-L2004 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | WorldModel.saveFile | (self, fn: str, elementDir: str=None) | return _robotsim.WorldModel_saveFile(self, fn, elementDir) | r"""
Saves to a world XML file. If elementDir is provided, then robots, terrains,
etc. will be saved there. Otherwise they will be saved to a folder with the same
base name as fn (without the trailing .xml)
Args:
fn (str)
elementDir (str, optional): default val... | r"""
Saves to a world XML file. If elementDir is provided, then robots, terrains,
etc. will be saved there. Otherwise they will be saved to a folder with the same
base name as fn (without the trailing .xml) | [
"r",
"Saves",
"to",
"a",
"world",
"XML",
"file",
".",
"If",
"elementDir",
"is",
"provided",
"then",
"robots",
"terrains",
"etc",
".",
"will",
"be",
"saved",
"there",
".",
"Otherwise",
"they",
"will",
"be",
"saved",
"to",
"a",
"folder",
"with",
"the",
"... | def saveFile(self, fn: str, elementDir: str=None) ->bool:
r"""
Saves to a world XML file. If elementDir is provided, then robots, terrains,
etc. will be saved there. Otherwise they will be saved to a folder with the same
base name as fn (without the trailing .xml)
Args:
... | [
"def",
"saveFile",
"(",
"self",
",",
"fn",
":",
"str",
",",
"elementDir",
":",
"str",
"=",
"None",
")",
"->",
"bool",
":",
"return",
"_robotsim",
".",
"WorldModel_saveFile",
"(",
"self",
",",
"fn",
",",
"elementDir",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L5685-L5695 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/floor_mod.py | python | _floor_mod_tbe | () | return | FloorMod TBE register | FloorMod TBE register | [
"FloorMod",
"TBE",
"register"
] | def _floor_mod_tbe():
"""FloorMod TBE register"""
return | [
"def",
"_floor_mod_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/floor_mod.py#L37-L39 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | PyApp.GetMacPreferencesMenuItemId | (*args, **kwargs) | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) | GetMacPreferencesMenuItemId() -> long | GetMacPreferencesMenuItemId() -> long | [
"GetMacPreferencesMenuItemId",
"()",
"-",
">",
"long"
] | def GetMacPreferencesMenuItemId(*args, **kwargs):
"""GetMacPreferencesMenuItemId() -> long"""
return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) | [
"def",
"GetMacPreferencesMenuItemId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_GetMacPreferencesMenuItemId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L8150-L8152 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/knobctrl.py | python | KnobCtrl.DrawDiagonalGradient | (self, dc, size) | Draw a shading of diagonal gradient to :class:`KnobCtrl`.
:param `dc`: an instance of :class:`DC`;
:param `size`: the control size. | Draw a shading of diagonal gradient to :class:`KnobCtrl`. | [
"Draw",
"a",
"shading",
"of",
"diagonal",
"gradient",
"to",
":",
"class",
":",
"KnobCtrl",
"."
] | def DrawDiagonalGradient(self, dc, size):
"""
Draw a shading of diagonal gradient to :class:`KnobCtrl`.
:param `dc`: an instance of :class:`DC`;
:param `size`: the control size.
"""
col1 = self._startcolour
col2 = self._endcolour
r1, g1, b1 = in... | [
"def",
"DrawDiagonalGradient",
"(",
"self",
",",
"dc",
",",
"size",
")",
":",
"col1",
"=",
"self",
".",
"_startcolour",
"col2",
"=",
"self",
".",
"_endcolour",
"r1",
",",
"g1",
",",
"b1",
"=",
"int",
"(",
"col1",
".",
"Red",
"(",
")",
")",
",",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/knobctrl.py#L651-L690 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/asyncio/tasks.py | python | __sleep0 | () | Skip one event loop run cycle.
This is a private helper for 'asyncio.sleep()', used
when the 'delay' is set to 0. It uses a bare 'yield'
expression (which Task.__step knows how to handle)
instead of creating a Future object. | Skip one event loop run cycle. | [
"Skip",
"one",
"event",
"loop",
"run",
"cycle",
"."
] | def __sleep0():
"""Skip one event loop run cycle.
This is a private helper for 'asyncio.sleep()', used
when the 'delay' is set to 0. It uses a bare 'yield'
expression (which Task.__step knows how to handle)
instead of creating a Future object.
"""
yield | [
"def",
"__sleep0",
"(",
")",
":",
"yield"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/asyncio/tasks.py#L571-L579 | ||
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/experimental/distrdf/python/DistRDF/HeadNode.py | python | TreeHeadNode.generate_rdf_creator | (self) | return build_rdf_from_range | Generates a function that is responsible for building an instance of
RDataFrame on a distributed mapper for a given entry range. Specific for
the TTree data source. | Generates a function that is responsible for building an instance of
RDataFrame on a distributed mapper for a given entry range. Specific for
the TTree data source. | [
"Generates",
"a",
"function",
"that",
"is",
"responsible",
"for",
"building",
"an",
"instance",
"of",
"RDataFrame",
"on",
"a",
"distributed",
"mapper",
"for",
"a",
"given",
"entry",
"range",
".",
"Specific",
"for",
"the",
"TTree",
"data",
"source",
"."
] | def generate_rdf_creator(self):
"""
Generates a function that is responsible for building an instance of
RDataFrame on a distributed mapper for a given entry range. Specific for
the TTree data source.
"""
maintreename = self.maintreename
defaultbranches = self.de... | [
"def",
"generate_rdf_creator",
"(",
"self",
")",
":",
"maintreename",
"=",
"self",
".",
"maintreename",
"defaultbranches",
"=",
"self",
".",
"defaultbranches",
"def",
"build_rdf_from_range",
"(",
"current_range",
")",
":",
"\"\"\"\n Builds an RDataFrame instanc... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/experimental/distrdf/python/DistRDF/HeadNode.py#L230-L316 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/jinja2/sandbox.py | python | SandboxedEnvironment.getattr | (self, obj, attribute) | return self.undefined(obj=obj, name=attribute) | Subscribe an object from sandboxed code and prefer the
attribute. The attribute passed *must* be a bytestring. | Subscribe an object from sandboxed code and prefer the
attribute. The attribute passed *must* be a bytestring. | [
"Subscribe",
"an",
"object",
"from",
"sandboxed",
"code",
"and",
"prefer",
"the",
"attribute",
".",
"The",
"attribute",
"passed",
"*",
"must",
"*",
"be",
"a",
"bytestring",
"."
] | def getattr(self, obj, attribute):
"""Subscribe an object from sandboxed code and prefer the
attribute. The attribute passed *must* be a bytestring.
"""
try:
value = getattr(obj, attribute)
except AttributeError:
try:
return obj[attribute]... | [
"def",
"getattr",
"(",
"self",
",",
"obj",
",",
"attribute",
")",
":",
"try",
":",
"value",
"=",
"getattr",
"(",
"obj",
",",
"attribute",
")",
"except",
"AttributeError",
":",
"try",
":",
"return",
"obj",
"[",
"attribute",
"]",
"except",
"(",
"TypeErro... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/jinja2/sandbox.py#L318-L333 | |
esphome/esphome-core | 254d059945932adb64f5cbe8f4928ea19b4f6f00 | travis/run-clang-format.py | python | run_tidy | (args, queue, lock) | Takes filenames out of queue and runs clang-tidy on them. | Takes filenames out of queue and runs clang-tidy on them. | [
"Takes",
"filenames",
"out",
"of",
"queue",
"and",
"runs",
"clang",
"-",
"tidy",
"on",
"them",
"."
] | def run_tidy(args, queue, lock):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
name = queue.get()
invocation = get_tidy_invocation(name, args.inplace)
proc = subprocess.Popen(invocation, stdout=subprocess.PIPE,
stderr=subproc... | [
"def",
"run_tidy",
"(",
"args",
",",
"queue",
",",
"lock",
")",
":",
"while",
"True",
":",
"name",
"=",
"queue",
".",
"get",
"(",
")",
"invocation",
"=",
"get_tidy_invocation",
"(",
"name",
",",
"args",
".",
"inplace",
")",
"proc",
"=",
"subprocess",
... | https://github.com/esphome/esphome-core/blob/254d059945932adb64f5cbe8f4928ea19b4f6f00/travis/run-clang-format.py#L47-L61 | ||
sundyCoder/DEye | f1b35e8ab20f10f669fdbc9a6f54e666f4d4e1da | extra/tensorflow-r1.4/gemmlowp/src/gemmlowp/meta/generators/neon_emitter_64.py | python | NeonEmitter64.EmitVLoadAE | (self,
load_type,
elem_count,
destinations,
source,
alignment=None) | Generate assembly to load an array of elements of given size. | Generate assembly to load an array of elements of given size. | [
"Generate",
"assembly",
"to",
"load",
"an",
"array",
"of",
"elements",
"of",
"given",
"size",
"."
] | def EmitVLoadAE(self,
load_type,
elem_count,
destinations,
source,
alignment=None):
"""Generate assembly to load an array of elements of given size."""
bits_to_load = load_type * elem_count
min_bits = min([destination.... | [
"def",
"EmitVLoadAE",
"(",
"self",
",",
"load_type",
",",
"elem_count",
",",
"destinations",
",",
"source",
",",
"alignment",
"=",
"None",
")",
":",
"bits_to_load",
"=",
"load_type",
"*",
"elem_count",
"min_bits",
"=",
"min",
"(",
"[",
"destination",
".",
... | https://github.com/sundyCoder/DEye/blob/f1b35e8ab20f10f669fdbc9a6f54e666f4d4e1da/extra/tensorflow-r1.4/gemmlowp/src/gemmlowp/meta/generators/neon_emitter_64.py#L837-L902 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/linalg/linear_operator.py | python | LinearOperator.assert_positive_definite | (self, name="assert_positive_definite") | Returns an `Op` that asserts this operator is positive definite.
Here, positive definite means that the quadratic form `x^H A x` has positive
real part for all nonzero `x`. Note that we do not require the operator to
be self-adjoint to be positive definite.
Args:
name: A name to give this `Op`... | Returns an `Op` that asserts this operator is positive definite. | [
"Returns",
"an",
"Op",
"that",
"asserts",
"this",
"operator",
"is",
"positive",
"definite",
"."
] | def assert_positive_definite(self, name="assert_positive_definite"):
"""Returns an `Op` that asserts this operator is positive definite.
Here, positive definite means that the quadratic form `x^H A x` has positive
real part for all nonzero `x`. Note that we do not require the operator to
be self-adjoi... | [
"def",
"assert_positive_definite",
"(",
"self",
",",
"name",
"=",
"\"assert_positive_definite\"",
")",
":",
"with",
"self",
".",
"_name_scope",
"(",
"name",
")",
":",
"return",
"self",
".",
"_assert_positive_definite",
"(",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/linalg/linear_operator.py#L531-L546 | ||
wuye9036/SalviaRenderer | a3931dec1b1e5375ef497a9d4d064f0521ba6f37 | blibs/cpuinfo.py | python | _get_cpu_info_from_ibm_pa_features | () | Returns the CPU info gathered from lsprop /proc/device-tree/cpus/*/ibm,pa-features
Returns {} if lsprop is not found or ibm,pa-features does not have the desired info. | Returns the CPU info gathered from lsprop /proc/device-tree/cpus/*/ibm,pa-features
Returns {} if lsprop is not found or ibm,pa-features does not have the desired info. | [
"Returns",
"the",
"CPU",
"info",
"gathered",
"from",
"lsprop",
"/",
"proc",
"/",
"device",
"-",
"tree",
"/",
"cpus",
"/",
"*",
"/",
"ibm",
"pa",
"-",
"features",
"Returns",
"{}",
"if",
"lsprop",
"is",
"not",
"found",
"or",
"ibm",
"pa",
"-",
"features... | def _get_cpu_info_from_ibm_pa_features():
'''
Returns the CPU info gathered from lsprop /proc/device-tree/cpus/*/ibm,pa-features
Returns {} if lsprop is not found or ibm,pa-features does not have the desired info.
'''
try:
# Just return {} if there is no lsprop
if not DataSource.has_ibm_pa_features():
retur... | [
"def",
"_get_cpu_info_from_ibm_pa_features",
"(",
")",
":",
"try",
":",
"# Just return {} if there is no lsprop",
"if",
"not",
"DataSource",
".",
"has_ibm_pa_features",
"(",
")",
":",
"return",
"{",
"}",
"# If ibm,pa-features fails return {}",
"returncode",
",",
"output",... | https://github.com/wuye9036/SalviaRenderer/blob/a3931dec1b1e5375ef497a9d4d064f0521ba6f37/blibs/cpuinfo.py#L1532-L1650 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | lldb/examples/python/dict_utils.py | python | LookupDictionary.get_first_key_for_value | (self, value, fail_value=None) | return fail_value | return the first key of this dictionary given the value | return the first key of this dictionary given the value | [
"return",
"the",
"first",
"key",
"of",
"this",
"dictionary",
"given",
"the",
"value"
] | def get_first_key_for_value(self, value, fail_value=None):
"""return the first key of this dictionary given the value"""
list_result = [item[0] for item in self.items() if item[1] == value]
if len(list_result) > 0:
return list_result[0]
return fail_value | [
"def",
"get_first_key_for_value",
"(",
"self",
",",
"value",
",",
"fail_value",
"=",
"None",
")",
":",
"list_result",
"=",
"[",
"item",
"[",
"0",
"]",
"for",
"item",
"in",
"self",
".",
"items",
"(",
")",
"if",
"item",
"[",
"1",
"]",
"==",
"value",
... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/lldb/examples/python/dict_utils.py#L18-L23 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/computation/engines.py | python | AbstractEngine.evaluate | (self) | return _reconstruct_object(self.result_type, res, self.aligned_axes,
self.expr.terms.return_type) | Run the engine on the expression
This method performs alignment which is necessary no matter what engine
is being used, thus its implementation is in the base class.
Returns
-------
obj : object
The result of the passed expression. | Run the engine on the expression | [
"Run",
"the",
"engine",
"on",
"the",
"expression"
] | def evaluate(self):
"""Run the engine on the expression
This method performs alignment which is necessary no matter what engine
is being used, thus its implementation is in the base class.
Returns
-------
obj : object
The result of the passed expression.
... | [
"def",
"evaluate",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_is_aligned",
":",
"self",
".",
"result_type",
",",
"self",
".",
"aligned_axes",
"=",
"_align",
"(",
"self",
".",
"expr",
".",
"terms",
")",
"# make sure no names in resolvers and locals/glob... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/computation/engines.py#L61-L78 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/codegen/codegen.py | python | CodegenDirWrapper.get_reads | (self) | Returns an iterable of all path component tuples for files that have
been read. | Returns an iterable of all path component tuples for files that have
been read. | [
"Returns",
"an",
"iterable",
"of",
"all",
"path",
"component",
"tuples",
"for",
"files",
"that",
"have",
"been",
"read",
"."
] | def get_reads(self):
"""
Returns an iterable of all path component tuples for files that have
been read.
"""
for parts in self.reads:
yield parts
self.reads.clear() | [
"def",
"get_reads",
"(",
"self",
")",
":",
"for",
"parts",
"in",
"self",
".",
"reads",
":",
"yield",
"parts",
"self",
".",
"reads",
".",
"clear",
"(",
")"
] | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/codegen/codegen.py#L83-L91 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/rnn_cell_impl.py | python | ResidualWrapper.__init__ | (self, cell) | Constructs a `ResidualWrapper` for `cell`.
Args:
cell: An instance of `RNNCell`. | Constructs a `ResidualWrapper` for `cell`. | [
"Constructs",
"a",
"ResidualWrapper",
"for",
"cell",
"."
] | def __init__(self, cell):
"""Constructs a `ResidualWrapper` for `cell`.
Args:
cell: An instance of `RNNCell`.
"""
self._cell = cell | [
"def",
"__init__",
"(",
"self",
",",
"cell",
")",
":",
"self",
".",
"_cell",
"=",
"cell"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/rnn_cell_impl.py#L789-L795 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/pyshell.py | python | ModifiedInterpreter.showsyntaxerror | (self, filename=None) | Override Interactive Interpreter method: Use Colorizing
Color the offending position instead of printing it and pointing at it
with a caret. | Override Interactive Interpreter method: Use Colorizing | [
"Override",
"Interactive",
"Interpreter",
"method",
":",
"Use",
"Colorizing"
] | def showsyntaxerror(self, filename=None):
"""Override Interactive Interpreter method: Use Colorizing
Color the offending position instead of printing it and pointing at it
with a caret.
"""
tkconsole = self.tkconsole
text = tkconsole.text
text.tag_remove("ERROR"... | [
"def",
"showsyntaxerror",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"tkconsole",
"=",
"self",
".",
"tkconsole",
"text",
"=",
"tkconsole",
".",
"text",
"text",
".",
"tag_remove",
"(",
"\"ERROR\"",
",",
"\"1.0\"",
",",
"\"end\"",
")",
"type",
",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/pyshell.py#L705-L729 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | cpp.py | python | PreProcessor.start_handling_includes | (self, t=None) | Causes the PreProcessor object to start processing #import,
#include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif
evaluates True, or when we reach the #else in a #if, #ifdef,
#ifndef or #elif block where a condition already evaluated
F... | Causes the PreProcessor object to start processing #import,
#include and #include_next lines. | [
"Causes",
"the",
"PreProcessor",
"object",
"to",
"start",
"processing",
"#import",
"#include",
"and",
"#include_next",
"lines",
"."
] | def start_handling_includes(self, t=None):
"""
Causes the PreProcessor object to start processing #import,
#include and #include_next lines.
This method will be called when a #if, #ifdef, #ifndef or #elif
evaluates True, or when we reach the #else in a #if, #ifdef,
#ifnd... | [
"def",
"start_handling_includes",
"(",
"self",
",",
"t",
"=",
"None",
")",
":",
"d",
"=",
"self",
".",
"dispatch_table",
"p",
"=",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
"if",
"self",
".",
"stack",
"else",
"self",
".",
"default_table",
"for",
"k",... | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/cpp.py#L388-L403 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | ArtProvider.Delete | (*args, **kwargs) | return val | Delete(ArtProvider provider) -> bool
Remove provider. The provider must have been added previously! The
provider is _not_ deleted. | Delete(ArtProvider provider) -> bool | [
"Delete",
"(",
"ArtProvider",
"provider",
")",
"-",
">",
"bool"
] | def Delete(*args, **kwargs):
"""
Delete(ArtProvider provider) -> bool
Remove provider. The provider must have been added previously! The
provider is _not_ deleted.
"""
val = _misc_.ArtProvider_Delete(*args, **kwargs)
args[1].thisown = 1
return val | [
"def",
"Delete",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_misc_",
".",
"ArtProvider_Delete",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"args",
"[",
"1",
"]",
".",
"thisown",
"=",
"1",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2806-L2815 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ftplib.py | python | FTP.voidcmd | (self, cmd) | return self.voidresp() | Send a command and expect a response beginning with '2'. | Send a command and expect a response beginning with '2'. | [
"Send",
"a",
"command",
"and",
"expect",
"a",
"response",
"beginning",
"with",
"2",
"."
] | def voidcmd(self, cmd):
"""Send a command and expect a response beginning with '2'."""
self.putcmd(cmd)
return self.voidresp() | [
"def",
"voidcmd",
"(",
"self",
",",
"cmd",
")",
":",
"self",
".",
"putcmd",
"(",
"cmd",
")",
"return",
"self",
".",
"voidresp",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ftplib.py#L275-L278 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py | python | Node.get_abspath | (self) | return str(self) | Return an absolute path to the Node. This will return simply
str(Node) by default, but for Node types that have a concept of
relative path, this might return something different. | Return an absolute path to the Node. This will return simply
str(Node) by default, but for Node types that have a concept of
relative path, this might return something different. | [
"Return",
"an",
"absolute",
"path",
"to",
"the",
"Node",
".",
"This",
"will",
"return",
"simply",
"str",
"(",
"Node",
")",
"by",
"default",
"but",
"for",
"Node",
"types",
"that",
"have",
"a",
"concept",
"of",
"relative",
"path",
"this",
"might",
"return"... | def get_abspath(self):
"""
Return an absolute path to the Node. This will return simply
str(Node) by default, but for Node types that have a concept of
relative path, this might return something different.
"""
return str(self) | [
"def",
"get_abspath",
"(",
"self",
")",
":",
"return",
"str",
"(",
"self",
")"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py#L1524-L1530 | |
raymondlu/super-animation-samples | 04234269112ff0dc32447f27a761dbbb00b8ba17 | samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | TranslationUnit.diagnostics | (self) | return DiagIterator(self) | Return an iterable (and indexable) object containing the diagnostics. | Return an iterable (and indexable) object containing the diagnostics. | [
"Return",
"an",
"iterable",
"(",
"and",
"indexable",
")",
"object",
"containing",
"the",
"diagnostics",
"."
] | def diagnostics(self):
"""
Return an iterable (and indexable) object containing the diagnostics.
"""
class DiagIterator:
def __init__(self, tu):
self.tu = tu
def __len__(self):
return int(conf.lib.clang_getNumDiagnostics(self.tu))
... | [
"def",
"diagnostics",
"(",
"self",
")",
":",
"class",
"DiagIterator",
":",
"def",
"__init__",
"(",
"self",
",",
"tu",
")",
":",
"self",
".",
"tu",
"=",
"tu",
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"int",
"(",
"conf",
".",
"lib",
".",
... | https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L2180-L2197 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py | python | _WeightedSparseColumn.key | (self) | return "{}".format(self) | Returns a string which will be used as a key when we do sorting. | Returns a string which will be used as a key when we do sorting. | [
"Returns",
"a",
"string",
"which",
"will",
"be",
"used",
"as",
"a",
"key",
"when",
"we",
"do",
"sorting",
"."
] | def key(self):
"""Returns a string which will be used as a key when we do sorting."""
return "{}".format(self) | [
"def",
"key",
"(",
"self",
")",
":",
"return",
"\"{}\"",
".",
"format",
"(",
"self",
")"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py#L486-L488 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/aoc/upgrade_attribute_subprocessor.py | python | AoCUpgradeAttributeSubprocessor.ballistics_upgrade | (converter_group, line, value, operator, team=False) | return patches | Creates a patch for the ballistics modify effect (ID: 19).
:param converter_group: Tech/Civ that gets the patch.
:type converter_group: ...dataformat.converter_object.ConverterObjectGroup
:param line: Unit/Building line that has the ability.
:type line: ...dataformat.converter_object.Co... | Creates a patch for the ballistics modify effect (ID: 19). | [
"Creates",
"a",
"patch",
"for",
"the",
"ballistics",
"modify",
"effect",
"(",
"ID",
":",
"19",
")",
"."
] | def ballistics_upgrade(converter_group, line, value, operator, team=False):
"""
Creates a patch for the ballistics modify effect (ID: 19).
:param converter_group: Tech/Civ that gets the patch.
:type converter_group: ...dataformat.converter_object.ConverterObjectGroup
:param line... | [
"def",
"ballistics_upgrade",
"(",
"converter_group",
",",
"line",
",",
"value",
",",
"operator",
",",
"team",
"=",
"False",
")",
":",
"head_unit",
"=",
"line",
".",
"get_head_unit",
"(",
")",
"head_unit_id",
"=",
"line",
".",
"get_head_unit_id",
"(",
")",
... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/aoc/upgrade_attribute_subprocessor.py#L324-L475 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/mnvsearch/mnvsearch_api.py | python | OutStreamEncoder.__getattr__ | (self, attr) | return getattr(self.out, attr) | Delegate everything but write to the stream | Delegate everything but write to the stream | [
"Delegate",
"everything",
"but",
"write",
"to",
"the",
"stream"
] | def __getattr__(self, attr):
"""Delegate everything but write to the stream"""
return getattr(self.out, attr) | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"return",
"getattr",
"(",
"self",
".",
"out",
",",
"attr",
")"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/mnvsearch/mnvsearch_api.py#L55-L57 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pydoc.py | python | apropos | (key) | Print all the one-line module summaries that contain a substring. | Print all the one-line module summaries that contain a substring. | [
"Print",
"all",
"the",
"one",
"-",
"line",
"module",
"summaries",
"that",
"contain",
"a",
"substring",
"."
] | def apropos(key):
"""Print all the one-line module summaries that contain a substring."""
def callback(path, modname, desc):
if modname[-9:] == '.__init__':
modname = modname[:-9] + ' (package)'
print modname, desc and '- ' + desc
def onerror(modname):
pass
with warni... | [
"def",
"apropos",
"(",
"key",
")",
":",
"def",
"callback",
"(",
"path",
",",
"modname",
",",
"desc",
")",
":",
"if",
"modname",
"[",
"-",
"9",
":",
"]",
"==",
"'.__init__'",
":",
"modname",
"=",
"modname",
"[",
":",
"-",
"9",
"]",
"+",
"' (packag... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pydoc.py#L1985-L1995 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | DateTime.GetAmPmStrings | (*args, **kwargs) | return _misc_.DateTime_GetAmPmStrings(*args, **kwargs) | GetAmPmStrings() -> (am, pm)
Get the AM and PM strings in the current locale (may be empty) | GetAmPmStrings() -> (am, pm) | [
"GetAmPmStrings",
"()",
"-",
">",
"(",
"am",
"pm",
")"
] | def GetAmPmStrings(*args, **kwargs):
"""
GetAmPmStrings() -> (am, pm)
Get the AM and PM strings in the current locale (may be empty)
"""
return _misc_.DateTime_GetAmPmStrings(*args, **kwargs) | [
"def",
"GetAmPmStrings",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_GetAmPmStrings",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3742-L3748 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/gan/mnist.py | python | discriminator_loss | (discriminator_real_outputs, discriminator_gen_outputs) | return loss | Original discriminator loss for GANs, with label smoothing.
See `Generative Adversarial Nets` (https://arxiv.org/abs/1406.2661) for more
details.
Args:
discriminator_real_outputs: Discriminator output on real data.
discriminator_gen_outputs: Discriminator output on generated data. Expected
to be i... | Original discriminator loss for GANs, with label smoothing. | [
"Original",
"discriminator",
"loss",
"for",
"GANs",
"with",
"label",
"smoothing",
"."
] | def discriminator_loss(discriminator_real_outputs, discriminator_gen_outputs):
"""Original discriminator loss for GANs, with label smoothing.
See `Generative Adversarial Nets` (https://arxiv.org/abs/1406.2661) for more
details.
Args:
discriminator_real_outputs: Discriminator output on real data.
discr... | [
"def",
"discriminator_loss",
"(",
"discriminator_real_outputs",
",",
"discriminator_gen_outputs",
")",
":",
"loss_on_real",
"=",
"tf",
".",
"losses",
".",
"sigmoid_cross_entropy",
"(",
"tf",
".",
"ones_like",
"(",
"discriminator_real_outputs",
")",
",",
"discriminator_r... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/eager/python/examples/gan/mnist.py#L150-L173 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.