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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/RemoteDebugger.py | python | wrap_info | (info) | replace info[2], a traceback instance, by its ID | replace info[2], a traceback instance, by its ID | [
"replace",
"info",
"[",
"2",
"]",
"a",
"traceback",
"instance",
"by",
"its",
"ID"
] | def wrap_info(info):
"replace info[2], a traceback instance, by its ID"
if info is None:
return None
else:
traceback = info[2]
assert isinstance(traceback, types.TracebackType)
traceback_id = id(traceback)
tracebacktable[traceback_id] = traceback
modified_info... | [
"def",
"wrap_info",
"(",
"info",
")",
":",
"if",
"info",
"is",
"None",
":",
"return",
"None",
"else",
":",
"traceback",
"=",
"info",
"[",
"2",
"]",
"assert",
"isinstance",
"(",
"traceback",
",",
"types",
".",
"TracebackType",
")",
"traceback_id",
"=",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/RemoteDebugger.py#L46-L56 | ||
SmartisanTech/Wrench | 27f3c17692910997bba3a3c9fd88c8717497aac6 | extra-cmake-modules/usr/share/ECM/find-modules/sip_generator.py | python | SipGenerator._container_get | (self, container, level, h_file, include_filename) | return body | Generate the (recursive) translation for a class or namespace.
:param container: A class or namespace.
:param h_file: Name of header file being processed.
:param level: Recursion level controls indentation.
:return: A string. | Generate the (recursive) translation for a class or namespace. | [
"Generate",
"the",
"(",
"recursive",
")",
"translation",
"for",
"a",
"class",
"or",
"namespace",
"."
] | def _container_get(self, container, level, h_file, include_filename):
"""
Generate the (recursive) translation for a class or namespace.
:param container: A class or namespace.
:param h_file: Name of header file being processed.
:param level: ... | [
"def",
"_container_get",
"(",
"self",
",",
"container",
",",
"level",
",",
"h_file",
",",
"include_filename",
")",
":",
"def",
"skippable_attribute",
"(",
"member",
",",
"text",
")",
":",
"\"\"\"\n We don't seem to have access to the __attribute__(())s, but at ... | https://github.com/SmartisanTech/Wrench/blob/27f3c17692910997bba3a3c9fd88c8717497aac6/extra-cmake-modules/usr/share/ECM/find-modules/sip_generator.py#L135-L329 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TIntIntVH.__init__ | (self, *args) | __init__(THash<(TInt,TVec<(TInt,int)>)> self) -> TIntIntVH
__init__(THash<(TInt,TVec<(TInt,int)>)> self, TIntIntVH Hash) -> TIntIntVH
Parameters:
Hash: THash< TInt,TVec< TInt,int > > const &
__init__(THash<(TInt,TVec<(TInt,int)>)> self, int const & ExpectVals, bool const & _AutoSiz... | __init__(THash<(TInt,TVec<(TInt,int)>)> self) -> TIntIntVH
__init__(THash<(TInt,TVec<(TInt,int)>)> self, TIntIntVH Hash) -> TIntIntVH | [
"__init__",
"(",
"THash<",
"(",
"TInt",
"TVec<",
"(",
"TInt",
"int",
")",
">",
")",
">",
"self",
")",
"-",
">",
"TIntIntVH",
"__init__",
"(",
"THash<",
"(",
"TInt",
"TVec<",
"(",
"TInt",
"int",
")",
">",
")",
">",
"self",
"TIntIntVH",
"Hash",
")",
... | def __init__(self, *args):
"""
__init__(THash<(TInt,TVec<(TInt,int)>)> self) -> TIntIntVH
__init__(THash<(TInt,TVec<(TInt,int)>)> self, TIntIntVH Hash) -> TIntIntVH
Parameters:
Hash: THash< TInt,TVec< TInt,int > > const &
__init__(THash<(TInt,TVec<(TInt,int)>)> sel... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"_snap",
".",
"TIntIntVH_swiginit",
"(",
"self",
",",
"_snap",
".",
"new_TIntIntVH",
"(",
"*",
"args",
")",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L17638-L17663 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/data/python/ops/dataset_ops.py | python | RangeDataset.__init__ | (self, *args) | See `Dataset.range()` for details. | See `Dataset.range()` for details. | [
"See",
"Dataset",
".",
"range",
"()",
"for",
"details",
"."
] | def __init__(self, *args):
"""See `Dataset.range()` for details."""
super(RangeDataset, self).__init__()
self._parse_args(*args) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"super",
"(",
"RangeDataset",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_parse_args",
"(",
"*",
"args",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/data/python/ops/dataset_ops.py#L1274-L1277 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/git.py | python | Git.has_commit | (cls, location, rev) | Check if rev is a commit that is available in the local repository. | [] | def has_commit(cls, location, rev):
"""
Check if rev is a commit that is available in the local repository.
"""
try:
cls.run_command(
['rev-parse', '-q', '--verify', "sha^" + rev],
cwd=location,
log_failed_cmd=False,
... | [
"def",
"has_commit",
"(",
"cls",
",",
"location",
",",
"rev",
")",
":",
"try",
":",
"cls",
".",
"run_command",
"(",
"[",
"'rev-parse'",
",",
"'-q'",
",",
"'--verify'",
",",
"\"sha^\"",
"+",
"rev",
"]",
",",
"cwd",
"=",
"location",
",",
"log_failed_cmd"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/vcs/git.py#L683-L709 | |||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py | python | get_line_width | (line) | return len(line) | Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters. | Determines the width of the line in column positions. | [
"Determines",
"the",
"width",
"of",
"the",
"line",
"in",
"column",
"positions",
"."
] | def get_line_width(line):
"""Determines the width of the line in column positions.
Args:
line: A string, which may be a Unicode string.
Returns:
The width of the line in column positions, accounting for Unicode
combining characters and wide characters.
"""
if isinstance(line, uni... | [
"def",
"get_line_width",
"(",
"line",
")",
":",
"if",
"isinstance",
"(",
"line",
",",
"unicode",
")",
":",
"width",
"=",
"0",
"for",
"c",
"in",
"unicodedata",
".",
"normalize",
"(",
"'NFC'",
",",
"line",
")",
":",
"if",
"unicodedata",
".",
"east_asian_... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py#L2664-L2682 | |
lmb-freiburg/ogn | 974f72ef4bf840d6f6693d22d1843a79223e77ce | scripts/cpp_lint.py | python | CleanseComments | (line) | return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line) | Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed. | Removes //-comments and single-line C-style /* */ comments. | [
"Removes",
"//",
"-",
"comments",
"and",
"single",
"-",
"line",
"C",
"-",
"style",
"/",
"*",
"*",
"/",
"comments",
"."
] | def CleanseComments(line):
"""Removes //-comments and single-line C-style /* */ comments.
Args:
line: A line of C++ source.
Returns:
The line with single-line comments removed.
"""
commentpos = line.find('//')
if commentpos != -1 and not IsCppString(line[:commentpos]):
line = line[:commentpos]... | [
"def",
"CleanseComments",
"(",
"line",
")",
":",
"commentpos",
"=",
"line",
".",
"find",
"(",
"'//'",
")",
"if",
"commentpos",
"!=",
"-",
"1",
"and",
"not",
"IsCppString",
"(",
"line",
"[",
":",
"commentpos",
"]",
")",
":",
"line",
"=",
"line",
"[",
... | https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/scripts/cpp_lint.py#L1167-L1180 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/corrections_presenter.py | python | CorrectionsPresenter.handle_ads_clear_or_remove_workspace_event | (self, _: str = None) | Handle when there is a clear or remove workspace event in the ADS. | Handle when there is a clear or remove workspace event in the ADS. | [
"Handle",
"when",
"there",
"is",
"a",
"clear",
"or",
"remove",
"workspace",
"event",
"in",
"the",
"ADS",
"."
] | def handle_ads_clear_or_remove_workspace_event(self, _: str = None) -> None:
"""Handle when there is a clear or remove workspace event in the ADS."""
self.dead_time_presenter.handle_ads_clear_or_remove_workspace_event()
self.handle_runs_loaded() | [
"def",
"handle_ads_clear_or_remove_workspace_event",
"(",
"self",
",",
"_",
":",
"str",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"dead_time_presenter",
".",
"handle_ads_clear_or_remove_workspace_event",
"(",
")",
"self",
".",
"handle_runs_loaded",
"(",
")"
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/corrections_tab_widget/corrections_presenter.py#L64-L67 | ||
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/resolve.py | python | Resolver._check_skip_installed | (self, req_to_install) | return None | Check if req_to_install should be skipped.
This will check if the req is installed, and whether we should upgrade
or reinstall it, taking into account all the relevant user options.
After calling this req_to_install will only have satisfied_by set to
None if the req_to_install is to be... | Check if req_to_install should be skipped. | [
"Check",
"if",
"req_to_install",
"should",
"be",
"skipped",
"."
] | def _check_skip_installed(self, req_to_install):
# type: (InstallRequirement) -> Optional[str]
"""Check if req_to_install should be skipped.
This will check if the req is installed, and whether we should upgrade
or reinstall it, taking into account all the relevant user options.
... | [
"def",
"_check_skip_installed",
"(",
"self",
",",
"req_to_install",
")",
":",
"# type: (InstallRequirement) -> Optional[str]",
"if",
"self",
".",
"ignore_installed",
":",
"return",
"None",
"req_to_install",
".",
"check_if_exists",
"(",
"self",
".",
"use_user_site",
")",... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/resolve.py#L162-L213 | |
quantOS-org/DataCore | e2ef9bd2c22ee9e2845675b6435a14fa607f3551 | mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/containers.py | python | BaseContainer.__init__ | (self, message_listener) | Args:
message_listener: A MessageListener implementation.
The RepeatedScalarFieldContainer will call this object's
Modified() method when it is modified. | Args:
message_listener: A MessageListener implementation.
The RepeatedScalarFieldContainer will call this object's
Modified() method when it is modified. | [
"Args",
":",
"message_listener",
":",
"A",
"MessageListener",
"implementation",
".",
"The",
"RepeatedScalarFieldContainer",
"will",
"call",
"this",
"object",
"s",
"Modified",
"()",
"method",
"when",
"it",
"is",
"modified",
"."
] | def __init__(self, message_listener):
"""
Args:
message_listener: A MessageListener implementation.
The RepeatedScalarFieldContainer will call this object's
Modified() method when it is modified.
"""
self._message_listener = message_listener
self._values = [] | [
"def",
"__init__",
"(",
"self",
",",
"message_listener",
")",
":",
"self",
".",
"_message_listener",
"=",
"message_listener",
"self",
".",
"_values",
"=",
"[",
"]"
] | https://github.com/quantOS-org/DataCore/blob/e2ef9bd2c22ee9e2845675b6435a14fa607f3551/mdlink/deps/windows/protobuf-2.5.0/python/google/protobuf/internal/containers.py#L52-L60 | ||
gnuradio/gr-inspector | 1aa1008b257c9a915b3e29a75092021468a4fe43 | docs/doxygen/doxyxml/generated/index.py | python | DoxygenTypeSub.find_compounds_and_members | (self, details) | return results | Returns a list of all compounds and their members which match details | Returns a list of all compounds and their members which match details | [
"Returns",
"a",
"list",
"of",
"all",
"compounds",
"and",
"their",
"members",
"which",
"match",
"details"
] | def find_compounds_and_members(self, details):
"""
Returns a list of all compounds and their members which match details
"""
results = []
for compound in self.compound:
members = compound.find_members(details)
if members:
results.append([c... | [
"def",
"find_compounds_and_members",
"(",
"self",
",",
"details",
")",
":",
"results",
"=",
"[",
"]",
"for",
"compound",
"in",
"self",
".",
"compound",
":",
"members",
"=",
"compound",
".",
"find_members",
"(",
"details",
")",
"if",
"members",
":",
"result... | https://github.com/gnuradio/gr-inspector/blob/1aa1008b257c9a915b3e29a75092021468a4fe43/docs/doxygen/doxyxml/generated/index.py#L21-L35 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBValue.GetChildAtIndex | (self, *args) | return _lldb.SBValue_GetChildAtIndex(self, *args) | GetChildAtIndex(self, uint32_t idx) -> SBValue
GetChildAtIndex(self, uint32_t idx, DynamicValueType use_dynamic, bool can_create_synthetic) -> SBValue
Get a child value by index from a value.
Structs, unions, classes, arrays and pointers have child
values that can be access by ... | GetChildAtIndex(self, uint32_t idx) -> SBValue
GetChildAtIndex(self, uint32_t idx, DynamicValueType use_dynamic, bool can_create_synthetic) -> SBValue | [
"GetChildAtIndex",
"(",
"self",
"uint32_t",
"idx",
")",
"-",
">",
"SBValue",
"GetChildAtIndex",
"(",
"self",
"uint32_t",
"idx",
"DynamicValueType",
"use_dynamic",
"bool",
"can_create_synthetic",
")",
"-",
">",
"SBValue"
] | def GetChildAtIndex(self, *args):
"""
GetChildAtIndex(self, uint32_t idx) -> SBValue
GetChildAtIndex(self, uint32_t idx, DynamicValueType use_dynamic, bool can_create_synthetic) -> SBValue
Get a child value by index from a value.
Structs, unions, classes, arrays and poi... | [
"def",
"GetChildAtIndex",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBValue_GetChildAtIndex",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L11951-L12010 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextParagraphLayoutBox.MoveAnchoredObjectToParagraph | (*args, **kwargs) | return _richtext.RichTextParagraphLayoutBox_MoveAnchoredObjectToParagraph(*args, **kwargs) | MoveAnchoredObjectToParagraph(self, RichTextParagraph from, RichTextParagraph to, RichTextObject obj) | MoveAnchoredObjectToParagraph(self, RichTextParagraph from, RichTextParagraph to, RichTextObject obj) | [
"MoveAnchoredObjectToParagraph",
"(",
"self",
"RichTextParagraph",
"from",
"RichTextParagraph",
"to",
"RichTextObject",
"obj",
")"
] | def MoveAnchoredObjectToParagraph(*args, **kwargs):
"""MoveAnchoredObjectToParagraph(self, RichTextParagraph from, RichTextParagraph to, RichTextObject obj)"""
return _richtext.RichTextParagraphLayoutBox_MoveAnchoredObjectToParagraph(*args, **kwargs) | [
"def",
"MoveAnchoredObjectToParagraph",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextParagraphLayoutBox_MoveAnchoredObjectToParagraph",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1640-L1642 | |
Yelp/MOE | 5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c | moe/easy_interface/experiment.py | python | Experiment.__str__ | (self) | return pprint.pformat(self.build_json_payload) | Return a pprint formated version of the experiment dict. | Return a pprint formated version of the experiment dict. | [
"Return",
"a",
"pprint",
"formated",
"version",
"of",
"the",
"experiment",
"dict",
"."
] | def __str__(self):
"""Return a pprint formated version of the experiment dict."""
return pprint.pformat(self.build_json_payload) | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"pprint",
".",
"pformat",
"(",
"self",
".",
"build_json_payload",
")"
] | https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/easy_interface/experiment.py#L42-L44 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/samplers.py | python | SequentialSampler.parse_for_minddataset | (self) | return c_sampler | Parse the sampler for MindRecord. | Parse the sampler for MindRecord. | [
"Parse",
"the",
"sampler",
"for",
"MindRecord",
"."
] | def parse_for_minddataset(self):
"""Parse the sampler for MindRecord."""
start_index = self.start_index if self.start_index is not None else 0
num_samples = self.num_samples if self.num_samples is not None else 0
c_sampler = cde.MindrecordSequentialSampler(num_samples, start_index)
... | [
"def",
"parse_for_minddataset",
"(",
"self",
")",
":",
"start_index",
"=",
"self",
".",
"start_index",
"if",
"self",
".",
"start_index",
"is",
"not",
"None",
"else",
"0",
"num_samples",
"=",
"self",
".",
"num_samples",
"if",
"self",
".",
"num_samples",
"is",... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/samplers.py#L620-L628 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/threading.py | python | _Event.wait | (self, timeout=None) | Block until the internal flag is true.
If the internal flag is true on entry, return immediately. Otherwise,
block until another thread calls set() to set the flag to true, or until
the optional timeout occurs.
When the timeout argument is present and not None, it should be a
f... | Block until the internal flag is true. | [
"Block",
"until",
"the",
"internal",
"flag",
"is",
"true",
"."
] | def wait(self, timeout=None):
"""Block until the internal flag is true.
If the internal flag is true on entry, return immediately. Otherwise,
block until another thread calls set() to set the flag to true, or until
the optional timeout occurs.
When the timeout argument is prese... | [
"def",
"wait",
"(",
"self",
",",
"timeout",
"=",
"None",
")",
":",
"with",
"self",
".",
"__cond",
":",
"if",
"not",
"self",
".",
"__flag",
":",
"self",
".",
"__cond",
".",
"wait",
"(",
"timeout",
")",
"return",
"self",
".",
"__flag"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/threading.py#L597-L615 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/intelhex/__init__.py | python | IntelHex.addresses | (self) | return aa | Returns all used addresses in sorted order.
@return list of occupied data addresses in sorted order. | Returns all used addresses in sorted order. | [
"Returns",
"all",
"used",
"addresses",
"in",
"sorted",
"order",
"."
] | def addresses(self):
'''Returns all used addresses in sorted order.
@return list of occupied data addresses in sorted order.
'''
aa = dict_keys(self._buf)
aa.sort()
return aa | [
"def",
"addresses",
"(",
"self",
")",
":",
"aa",
"=",
"dict_keys",
"(",
"self",
".",
"_buf",
")",
"aa",
".",
"sort",
"(",
")",
"return",
"aa"
] | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/intelhex/__init__.py#L420-L426 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/pep425tags.py | python | get_supported | (
versions=None, # type: Optional[List[str]]
noarch=False, # type: bool
platform=None, # type: Optional[str]
impl=None, # type: Optional[str]
abi=None # type: Optional[str]
) | return supported | Return a list of supported tags for each version specified in
`versions`.
:param versions: a list of string versions, of the form ["33", "32"],
or None. The first version will be assumed to support our ABI.
:param platform: specify the exact platform you want valid
tags for, or None. If Non... | Return a list of supported tags for each version specified in
`versions`. | [
"Return",
"a",
"list",
"of",
"supported",
"tags",
"for",
"each",
"version",
"specified",
"in",
"versions",
"."
] | def get_supported(
versions=None, # type: Optional[List[str]]
noarch=False, # type: bool
platform=None, # type: Optional[str]
impl=None, # type: Optional[str]
abi=None # type: Optional[str]
):
# type: (...) -> List[Pep425Tag]
"""Return a list of supported tags for each version specified... | [
"def",
"get_supported",
"(",
"versions",
"=",
"None",
",",
"# type: Optional[List[str]]",
"noarch",
"=",
"False",
",",
"# type: bool",
"platform",
"=",
"None",
",",
"# type: Optional[str]",
"impl",
"=",
"None",
",",
"# type: Optional[str]",
"abi",
"=",
"None",
"# ... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/pep425tags.py#L272-L378 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBBlock.GetRangeIndexForBlockAddress | (self, *args) | return _lldb.SBBlock_GetRangeIndexForBlockAddress(self, *args) | GetRangeIndexForBlockAddress(self, SBAddress block_addr) -> uint32_t | GetRangeIndexForBlockAddress(self, SBAddress block_addr) -> uint32_t | [
"GetRangeIndexForBlockAddress",
"(",
"self",
"SBAddress",
"block_addr",
")",
"-",
">",
"uint32_t"
] | def GetRangeIndexForBlockAddress(self, *args):
"""GetRangeIndexForBlockAddress(self, SBAddress block_addr) -> uint32_t"""
return _lldb.SBBlock_GetRangeIndexForBlockAddress(self, *args) | [
"def",
"GetRangeIndexForBlockAddress",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBBlock_GetRangeIndexForBlockAddress",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L1265-L1267 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/socket.py | python | socket.makefile | (self, mode="r", buffering=None, *,
encoding=None, errors=None, newline=None) | return text | makefile(...) -> an I/O stream connected to the socket
The arguments are as for io.open() after the filename, except the only
supported mode values are 'r' (default), 'w' and 'b'. | makefile(...) -> an I/O stream connected to the socket | [
"makefile",
"(",
"...",
")",
"-",
">",
"an",
"I",
"/",
"O",
"stream",
"connected",
"to",
"the",
"socket"
] | def makefile(self, mode="r", buffering=None, *,
encoding=None, errors=None, newline=None):
"""makefile(...) -> an I/O stream connected to the socket
The arguments are as for io.open() after the filename, except the only
supported mode values are 'r' (default), 'w' and 'b'.
... | [
"def",
"makefile",
"(",
"self",
",",
"mode",
"=",
"\"r\"",
",",
"buffering",
"=",
"None",
",",
"*",
",",
"encoding",
"=",
"None",
",",
"errors",
"=",
"None",
",",
"newline",
"=",
"None",
")",
":",
"# XXX refactor to share code?",
"if",
"not",
"set",
"(... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/socket.py#L221-L261 | |
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | Indigo.getFragmentedMolecule | (self, elem, options="") | Returns fragmented molecule for the given composition element
Args:
elem (IndigoObject): composition element object
options (str): Fragmentation options. Optional, defaults to "".
Returns:
IndigoObject: fragmented structure object | Returns fragmented molecule for the given composition element | [
"Returns",
"fragmented",
"molecule",
"for",
"the",
"given",
"composition",
"element"
] | def getFragmentedMolecule(self, elem, options=""):
"""Returns fragmented molecule for the given composition element
Args:
elem (IndigoObject): composition element object
options (str): Fragmentation options. Optional, defaults to "".
Returns:
IndigoObject: f... | [
"def",
"getFragmentedMolecule",
"(",
"self",
",",
"elem",
",",
"options",
"=",
"\"\"",
")",
":",
"if",
"options",
"is",
"None",
":",
"options",
"=",
"\"\"",
"self",
".",
"_setSessionId",
"(",
")",
"newobj",
"=",
"self",
".",
"_checkResult",
"(",
"Indigo"... | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L6283-L6304 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/FSIApplication/python_scripts/fsi_coupling_interface.py | python | FSICouplingInterface.SetConvergenceAccelerator | (self, convergence_accelerator) | Set the provided convergence accelerator to the current FSI coupling interface
This function sets the convergence accelerator of the current FSI coupling interface
This auxiliary method is understood to set the convergence accelerator in those situations
in which its constructor requires the FS... | Set the provided convergence accelerator to the current FSI coupling interface | [
"Set",
"the",
"provided",
"convergence",
"accelerator",
"to",
"the",
"current",
"FSI",
"coupling",
"interface"
] | def SetConvergenceAccelerator(self, convergence_accelerator):
"""Set the provided convergence accelerator to the current FSI coupling interface
This function sets the convergence accelerator of the current FSI coupling interface
This auxiliary method is understood to set the convergence acceler... | [
"def",
"SetConvergenceAccelerator",
"(",
"self",
",",
"convergence_accelerator",
")",
":",
"self",
".",
"convergence_accelerator",
"=",
"convergence_accelerator"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/FSIApplication/python_scripts/fsi_coupling_interface.py#L81-L88 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/validators.py | python | check_rgb_to_bgr | (method) | return new_method | Wrapper method to check the parameters of rgb_to_bgr. | Wrapper method to check the parameters of rgb_to_bgr. | [
"Wrapper",
"method",
"to",
"check",
"the",
"parameters",
"of",
"rgb_to_bgr",
"."
] | def check_rgb_to_bgr(method):
"""Wrapper method to check the parameters of rgb_to_bgr."""
@wraps(method)
def new_method(self, *args, **kwargs):
[is_hwc], _ = parse_user_args(method, *args, **kwargs)
type_check(is_hwc, (bool,), "is_hwc")
return method(self, *args, **kwargs)
retu... | [
"def",
"check_rgb_to_bgr",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"[",
"is_hwc",
"]",
",",
"_",
"=",
"parse_user_args",
"(",
"method",
",",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/validators.py#L621-L630 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | ParserElement.transformString | (self, instring) | Extension to :class:`scanString`, to modify matching text with modified tokens that may
be returned from a parse action. To use ``transformString``, define a grammar and
attach a parse action to it that modifies the returned token list.
Invoking ``transformString()`` on a target string will the... | Extension to :class:`scanString`, to modify matching text with modified tokens that may
be returned from a parse action. To use ``transformString``, define a grammar and
attach a parse action to it that modifies the returned token list.
Invoking ``transformString()`` on a target string will the... | [
"Extension",
"to",
":",
"class",
":",
"scanString",
"to",
"modify",
"matching",
"text",
"with",
"modified",
"tokens",
"that",
"may",
"be",
"returned",
"from",
"a",
"parse",
"action",
".",
"To",
"use",
"transformString",
"define",
"a",
"grammar",
"and",
"atta... | def transformString(self, instring):
"""
Extension to :class:`scanString`, to modify matching text with modified tokens that may
be returned from a parse action. To use ``transformString``, define a grammar and
attach a parse action to it that modifies the returned token list.
I... | [
"def",
"transformString",
"(",
"self",
",",
"instring",
")",
":",
"out",
"=",
"[",
"]",
"lastE",
"=",
"0",
"# force preservation of <TAB>s, to minimize unwanted transformation of string, and to",
"# keep string locs straight between transformString and scanString",
"self",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L2033-L2079 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PowderILLEfficiency.py | python | PowderILLEfficiency._process_global | (self) | Performs the global derivation for D2B following the logic:
1. SumOverlappingTubes with 2D option to obtain the reference
2. Loop over tubes, make ratios wrt reference, obtain constants
3. Apply the constants, and iterate over if requested | Performs the global derivation for D2B following the logic:
1. SumOverlappingTubes with 2D option to obtain the reference
2. Loop over tubes, make ratios wrt reference, obtain constants
3. Apply the constants, and iterate over if requested | [
"Performs",
"the",
"global",
"derivation",
"for",
"D2B",
"following",
"the",
"logic",
":",
"1",
".",
"SumOverlappingTubes",
"with",
"2D",
"option",
"to",
"obtain",
"the",
"reference",
"2",
".",
"Loop",
"over",
"tubes",
"make",
"ratios",
"wrt",
"reference",
"... | def _process_global(self):
"""
Performs the global derivation for D2B following the logic:
1. SumOverlappingTubes with 2D option to obtain the reference
2. Loop over tubes, make ratios wrt reference, obtain constants
3. Apply the constants, and iterate over if req... | [
"def",
"_process_global",
"(",
"self",
")",
":",
"data_type",
"=",
"'Raw'",
"if",
"self",
".",
"getProperty",
"(",
"'UseCalibratedData'",
")",
".",
"value",
":",
"data_type",
"=",
"'Calibrated'",
"constants_ws",
"=",
"self",
".",
"_hide",
"(",
"'constants'",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PowderILLEfficiency.py#L636-L720 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextBuffer.SetBulletRightMargin | (*args, **kwargs) | return _richtext.RichTextBuffer_SetBulletRightMargin(*args, **kwargs) | SetBulletRightMargin(int margin) | SetBulletRightMargin(int margin) | [
"SetBulletRightMargin",
"(",
"int",
"margin",
")"
] | def SetBulletRightMargin(*args, **kwargs):
"""SetBulletRightMargin(int margin)"""
return _richtext.RichTextBuffer_SetBulletRightMargin(*args, **kwargs) | [
"def",
"SetBulletRightMargin",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_SetBulletRightMargin",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2620-L2622 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/charset.py | python | Charset.get_body_encoding | (self) | Return the content-transfer-encoding used for body encoding.
This is either the string `quoted-printable' or `base64' depending on
the encoding used, or it is a function in which case you should call
the function with a single argument, the Message object being
encoded. The function sh... | Return the content-transfer-encoding used for body encoding. | [
"Return",
"the",
"content",
"-",
"transfer",
"-",
"encoding",
"used",
"for",
"body",
"encoding",
"."
] | def get_body_encoding(self):
"""Return the content-transfer-encoding used for body encoding.
This is either the string `quoted-printable' or `base64' depending on
the encoding used, or it is a function in which case you should call
the function with a single argument, the Message object... | [
"def",
"get_body_encoding",
"(",
"self",
")",
":",
"assert",
"self",
".",
"body_encoding",
"!=",
"SHORTEST",
"if",
"self",
".",
"body_encoding",
"==",
"QP",
":",
"return",
"'quoted-printable'",
"elif",
"self",
".",
"body_encoding",
"==",
"BASE64",
":",
"return... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/charset.py#L252-L271 | ||
sccn/lsl_archived | 2ff44b7a5172b02fe845b1fc72b9ab5578a489ed | LSL/liblsl-Python/pylsl/pylsl.py | python | resolve_bypred | (predicate, minimum=1, timeout=FOREVER) | return [StreamInfo(handle=buffer[k]) for k in range(num_found)] | Resolve all streams that match a given predicate.
Advanced query that allows to impose more conditions on the retrieved
streams; the given string is an XPath 1.0 predicate for the <description>
node (omitting the surrounding []'s), see also
http://en.wikipedia.org/w/index.php?title=XPath_1.0&oldid=474... | Resolve all streams that match a given predicate. | [
"Resolve",
"all",
"streams",
"that",
"match",
"a",
"given",
"predicate",
"."
] | def resolve_bypred(predicate, minimum=1, timeout=FOREVER):
"""Resolve all streams that match a given predicate.
Advanced query that allows to impose more conditions on the retrieved
streams; the given string is an XPath 1.0 predicate for the <description>
node (omitting the surrounding []'s), see also... | [
"def",
"resolve_bypred",
"(",
"predicate",
",",
"minimum",
"=",
"1",
",",
"timeout",
"=",
"FOREVER",
")",
":",
"# noinspection PyCallingNonCallable",
"buffer",
"=",
"(",
"c_void_p",
"*",
"1024",
")",
"(",
")",
"num_found",
"=",
"lib",
".",
"lsl_resolve_bypred"... | https://github.com/sccn/lsl_archived/blob/2ff44b7a5172b02fe845b1fc72b9ab5578a489ed/LSL/liblsl-Python/pylsl/pylsl.py#L570-L597 | |
widelands/widelands | e9f047d46a23d81312237d52eabf7d74e8de52d6 | doc/sphinx/documentation_enhancements.py | python | add_child_of | (rst_data, outfile) | return rst_data | Adds the String 'Child of: …, …' to rst_data. | Adds the String 'Child of: …, …' to rst_data. | [
"Adds",
"the",
"String",
"Child",
"of",
":",
"…",
"…",
"to",
"rst_data",
"."
] | def add_child_of(rst_data, outfile):
"""Adds the String 'Child of: …, …' to rst_data."""
found_classes = RSTDATA_CLS_RE.findall(rst_data)
for c_name in found_classes:
cls_inst = classes.get_instance(c_name, outfile)
parents = classes.get_parent_tree(cls_inst)
if parents:
... | [
"def",
"add_child_of",
"(",
"rst_data",
",",
"outfile",
")",
":",
"found_classes",
"=",
"RSTDATA_CLS_RE",
".",
"findall",
"(",
"rst_data",
")",
"for",
"c_name",
"in",
"found_classes",
":",
"cls_inst",
"=",
"classes",
".",
"get_instance",
"(",
"c_name",
",",
... | https://github.com/widelands/widelands/blob/e9f047d46a23d81312237d52eabf7d74e8de52d6/doc/sphinx/documentation_enhancements.py#L238-L264 | |
DaFuCoding/MTCNN_Caffe | 09c30c3ff391bd9cb6b249c1910afaf147767ab3 | scripts/cpp_lint.py | python | _SetFilters | (filters) | Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Sets the module's error-message filters. | [
"Sets",
"the",
"module",
"s",
"error",
"-",
"message",
"filters",
"."
] | def _SetFilters(filters):
"""Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint... | [
"def",
"_SetFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"SetFilters",
"(",
"filters",
")"
] | https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/scripts/cpp_lint.py#L797-L807 | ||
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | com/win32comext/ifilter/demo/filterDemo.py | python | FileParser._get_text | (self, body_chunks) | Gets all the text for a particular chunk. We need to keep calling get text till all the
segments for this chunk are retrieved | Gets all the text for a particular chunk. We need to keep calling get text till all the
segments for this chunk are retrieved | [
"Gets",
"all",
"the",
"text",
"for",
"a",
"particular",
"chunk",
".",
"We",
"need",
"to",
"keep",
"calling",
"get",
"text",
"till",
"all",
"the",
"segments",
"for",
"this",
"chunk",
"are",
"retrieved"
] | def _get_text(self, body_chunks):
"""
Gets all the text for a particular chunk. We need to keep calling get text till all the
segments for this chunk are retrieved
"""
while True:
try:
body_chunks.append(self.f.GetText())
except pythoncom.c... | [
"def",
"_get_text",
"(",
"self",
",",
"body_chunks",
")",
":",
"while",
"True",
":",
"try",
":",
"body_chunks",
".",
"append",
"(",
"self",
".",
"f",
".",
"GetText",
"(",
")",
")",
"except",
"pythoncom",
".",
"com_error",
"as",
"e",
":",
"if",
"e",
... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32comext/ifilter/demo/filterDemo.py#L170-L186 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/jinja2/environment.py | python | Template.from_code | (cls, environment, code, globals, uptodate=None) | return rv | Creates a template object from compiled code and the globals. This
is used by the loaders and environment to create a template object. | Creates a template object from compiled code and the globals. This
is used by the loaders and environment to create a template object. | [
"Creates",
"a",
"template",
"object",
"from",
"compiled",
"code",
"and",
"the",
"globals",
".",
"This",
"is",
"used",
"by",
"the",
"loaders",
"and",
"environment",
"to",
"create",
"a",
"template",
"object",
"."
] | def from_code(cls, environment, code, globals, uptodate=None):
"""Creates a template object from compiled code and the globals. This
is used by the loaders and environment to create a template object.
"""
namespace = {
'environment': environment,
'__file__': ... | [
"def",
"from_code",
"(",
"cls",
",",
"environment",
",",
"code",
",",
"globals",
",",
"uptodate",
"=",
"None",
")",
":",
"namespace",
"=",
"{",
"'environment'",
":",
"environment",
",",
"'__file__'",
":",
"code",
".",
"co_filename",
"}",
"exec",
"(",
"co... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/environment.py#L909-L920 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py | python | Table.ncols | (self) | return sum(len(a.values) for a in self.values_axes) | the number of total columns in the values axes | the number of total columns in the values axes | [
"the",
"number",
"of",
"total",
"columns",
"in",
"the",
"values",
"axes"
] | def ncols(self) -> int:
""" the number of total columns in the values axes """
return sum(len(a.values) for a in self.values_axes) | [
"def",
"ncols",
"(",
"self",
")",
"->",
"int",
":",
"return",
"sum",
"(",
"len",
"(",
"a",
".",
"values",
")",
"for",
"a",
"in",
"self",
".",
"values_axes",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/pytables.py#L3280-L3282 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/image/detection.py | python | DetRandomCropAug._check_satisfy_constraints | (self, label, xmin, ymin, xmax, ymax, width, height) | Check if constrains are satisfied | Check if constrains are satisfied | [
"Check",
"if",
"constrains",
"are",
"satisfied"
] | def _check_satisfy_constraints(self, label, xmin, ymin, xmax, ymax, width, height):
"""Check if constrains are satisfied"""
if (xmax - xmin) * (ymax - ymin) < 2:
return False # only 1 pixel
x1 = float(xmin) / width
y1 = float(ymin) / height
x2 = float(xmax) / width
... | [
"def",
"_check_satisfy_constraints",
"(",
"self",
",",
"label",
",",
"xmin",
",",
"ymin",
",",
"xmax",
",",
"ymax",
",",
"width",
",",
"height",
")",
":",
"if",
"(",
"xmax",
"-",
"xmin",
")",
"*",
"(",
"ymax",
"-",
"ymin",
")",
"<",
"2",
":",
"re... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/image/detection.py#L233-L249 | ||
mozilla/DeepSpeech | aa1d28530d531d0d92289bf5f11a49fe516fdc86 | data/lm/generate_lm.py | python | convert_and_filter_topk | (args) | return data_lower, vocab_str | Convert to lowercase, count word occurrences and save top-k words to a file | Convert to lowercase, count word occurrences and save top-k words to a file | [
"Convert",
"to",
"lowercase",
"count",
"word",
"occurrences",
"and",
"save",
"top",
"-",
"k",
"words",
"to",
"a",
"file"
] | def convert_and_filter_topk(args):
""" Convert to lowercase, count word occurrences and save top-k words to a file """
counter = Counter()
data_lower = os.path.join(args.output_dir, "lower.txt.gz")
print("\nConverting to lowercase and counting word occurrences ...")
with io.TextIOWrapper(
... | [
"def",
"convert_and_filter_topk",
"(",
"args",
")",
":",
"counter",
"=",
"Counter",
"(",
")",
"data_lower",
"=",
"os",
".",
"path",
".",
"join",
"(",
"args",
".",
"output_dir",
",",
"\"lower.txt.gz\"",
")",
"print",
"(",
"\"\\nConverting to lowercase and countin... | https://github.com/mozilla/DeepSpeech/blob/aa1d28530d531d0d92289bf5f11a49fe516fdc86/data/lm/generate_lm.py#L11-L74 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | ItemContainer.Insert | (*args, **kwargs) | return _core_.ItemContainer_Insert(*args, **kwargs) | Insert(self, String item, int pos, PyObject clientData=None) -> int
Insert an item into the control before the item at the ``pos`` index,
optionally associating some data object with the item. | Insert(self, String item, int pos, PyObject clientData=None) -> int | [
"Insert",
"(",
"self",
"String",
"item",
"int",
"pos",
"PyObject",
"clientData",
"=",
"None",
")",
"-",
">",
"int"
] | def Insert(*args, **kwargs):
"""
Insert(self, String item, int pos, PyObject clientData=None) -> int
Insert an item into the control before the item at the ``pos`` index,
optionally associating some data object with the item.
"""
return _core_.ItemContainer_Insert(*args,... | [
"def",
"Insert",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"ItemContainer_Insert",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L12876-L12883 | |
cinder/Cinder | e83f5bb9c01a63eec20168d02953a0879e5100f7 | docs/generateDocs.py | python | update_link | (link, in_path, out_path) | return rel_link_path | Update the given link to point to something relative to the new path
:param link: The link to change
:param in_path: the original path to the file that the link lives in
:return: | Update the given link to point to something relative to the new path
:param link: The link to change
:param in_path: the original path to the file that the link lives in
:return: | [
"Update",
"the",
"given",
"link",
"to",
"point",
"to",
"something",
"relative",
"to",
"the",
"new",
"path",
":",
"param",
"link",
":",
"The",
"link",
"to",
"change",
":",
"param",
"in_path",
":",
"the",
"original",
"path",
"to",
"the",
"file",
"that",
... | def update_link(link, in_path, out_path):
"""
Update the given link to point to something relative to the new path
:param link: The link to change
:param in_path: the original path to the file that the link lives in
:return:
"""
if link.startswith("http") or link.startswith("javascript:") o... | [
"def",
"update_link",
"(",
"link",
",",
"in_path",
",",
"out_path",
")",
":",
"if",
"link",
".",
"startswith",
"(",
"\"http\"",
")",
"or",
"link",
".",
"startswith",
"(",
"\"javascript:\"",
")",
"or",
"link",
".",
"startswith",
"(",
"\"#\"",
")",
":",
... | https://github.com/cinder/Cinder/blob/e83f5bb9c01a63eec20168d02953a0879e5100f7/docs/generateDocs.py#L3046-L3081 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/tensorboard/lib/python/json_util.py | python | WrapSpecialFloats | (obj) | Replaces all instances of Infinity/-Infinity/NaN with strings. | Replaces all instances of Infinity/-Infinity/NaN with strings. | [
"Replaces",
"all",
"instances",
"of",
"Infinity",
"/",
"-",
"Infinity",
"/",
"NaN",
"with",
"strings",
"."
] | def WrapSpecialFloats(obj):
"""Replaces all instances of Infinity/-Infinity/NaN with strings."""
if obj == float('inf'):
return 'Infinity'
elif obj == float('-inf'):
return '-Infinity'
elif isinstance(obj, float) and math.isnan(obj):
return 'NaN'
elif isinstance(obj, list) or isinstance(obj, tuple... | [
"def",
"WrapSpecialFloats",
"(",
"obj",
")",
":",
"if",
"obj",
"==",
"float",
"(",
"'inf'",
")",
":",
"return",
"'Infinity'",
"elif",
"obj",
"==",
"float",
"(",
"'-inf'",
")",
":",
"return",
"'-Infinity'",
"elif",
"isinstance",
"(",
"obj",
",",
"float",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/tensorboard/lib/python/json_util.py#L33-L49 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Node/FS.py | python | File.get_contents_sig | (self) | return result | A helper method for get_cachedir_bsig.
It computes and returns the signature for this
node's contents. | A helper method for get_cachedir_bsig. | [
"A",
"helper",
"method",
"for",
"get_cachedir_bsig",
"."
] | def get_contents_sig(self):
"""
A helper method for get_cachedir_bsig.
It computes and returns the signature for this
node's contents.
"""
try:
return self.contentsig
except AttributeError:
pass
executor = self.get_executor()
... | [
"def",
"get_contents_sig",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"contentsig",
"except",
"AttributeError",
":",
"pass",
"executor",
"=",
"self",
".",
"get_executor",
"(",
")",
"result",
"=",
"self",
".",
"contentsig",
"=",
"MD5signature",... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/FS.py#L3620-L3636 | |
TheLegendAli/DeepLab-Context | fb04e9e2fc2682490ad9f60533b9d6c4c0e0479c | scripts/cpp_lint.py | python | CheckLanguage | (filename, clean_lines, linenum, file_extension,
include_state, nesting_state, error) | Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum:... | Checks rules from the 'C++ language rules' section of cppguide.html. | [
"Checks",
"rules",
"from",
"the",
"C",
"++",
"language",
"rules",
"section",
"of",
"cppguide",
".",
"html",
"."
] | def CheckLanguage(filename, clean_lines, linenum, file_extension,
include_state, nesting_state, error):
"""Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
uint32 inappropriately), but we do the best we can.
... | [
"def",
"CheckLanguage",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"file_extension",
",",
"include_state",
",",
"nesting_state",
",",
"error",
")",
":",
"# If the line is empty or consists of entirely a comment, no need to",
"# check it.",
"line",
"=",
"cle... | https://github.com/TheLegendAli/DeepLab-Context/blob/fb04e9e2fc2682490ad9f60533b9d6c4c0e0479c/scripts/cpp_lint.py#L3834-L4132 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ipaddress.py | python | IPv6Address.sixtofour | (self) | return IPv4Address((self._ip >> 80) & 0xFFFFFFFF) | Return the IPv4 6to4 embedded address.
Returns:
The IPv4 6to4-embedded address if present or None if the
address doesn't appear to contain a 6to4 embedded address. | Return the IPv4 6to4 embedded address. | [
"Return",
"the",
"IPv4",
"6to4",
"embedded",
"address",
"."
] | def sixtofour(self):
"""Return the IPv4 6to4 embedded address.
Returns:
The IPv4 6to4-embedded address if present or None if the
address doesn't appear to contain a 6to4 embedded address.
"""
if (self._ip >> 112) != 0x2002:
return None
return... | [
"def",
"sixtofour",
"(",
"self",
")",
":",
"if",
"(",
"self",
".",
"_ip",
">>",
"112",
")",
"!=",
"0x2002",
":",
"return",
"None",
"return",
"IPv4Address",
"(",
"(",
"self",
".",
"_ip",
">>",
"80",
")",
"&",
"0xFFFFFFFF",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ipaddress.py#L2038-L2048 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/xml/sax/xmlreader.py | python | AttributesNSImpl.__init__ | (self, attrs, qnames) | NS-aware implementation.
attrs should be of the form {(ns_uri, lname): value, ...}.
qnames of the form {(ns_uri, lname): qname, ...}. | NS-aware implementation. | [
"NS",
"-",
"aware",
"implementation",
"."
] | def __init__(self, attrs, qnames):
"""NS-aware implementation.
attrs should be of the form {(ns_uri, lname): value, ...}.
qnames of the form {(ns_uri, lname): qname, ...}."""
self._attrs = attrs
self._qnames = qnames | [
"def",
"__init__",
"(",
"self",
",",
"attrs",
",",
"qnames",
")",
":",
"self",
".",
"_attrs",
"=",
"attrs",
"self",
".",
"_qnames",
"=",
"qnames"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/sax/xmlreader.py#L342-L348 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | PseudoDC.DrawRoundedRectangle | (*args, **kwargs) | return _gdi_.PseudoDC_DrawRoundedRectangle(*args, **kwargs) | DrawRoundedRectangle(self, int x, int y, int width, int height, double radius)
Draws a rectangle with the given top left corner, and with the given
size. The corners are quarter-circles using the given radius. The
current pen is used for the outline and the current brush for filling
the... | DrawRoundedRectangle(self, int x, int y, int width, int height, double radius) | [
"DrawRoundedRectangle",
"(",
"self",
"int",
"x",
"int",
"y",
"int",
"width",
"int",
"height",
"double",
"radius",
")"
] | def DrawRoundedRectangle(*args, **kwargs):
"""
DrawRoundedRectangle(self, int x, int y, int width, int height, double radius)
Draws a rectangle with the given top left corner, and with the given
size. The corners are quarter-circles using the given radius. The
current pen is use... | [
"def",
"DrawRoundedRectangle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_DrawRoundedRectangle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L7942-L7958 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Source/bindings/scripts/idl_reader.py | python | validate_blink_idl_definitions | (idl_filename, idl_file_basename,
definitions) | Validate file contents with filename convention.
The Blink IDL conventions are:
- If an IDL file defines an interface, a dictionary, or an exception,
the IDL file must contain exactly one definition. The definition
name must agree with the file's basename, unless it is a partial
... | Validate file contents with filename convention. | [
"Validate",
"file",
"contents",
"with",
"filename",
"convention",
"."
] | def validate_blink_idl_definitions(idl_filename, idl_file_basename,
definitions):
"""Validate file contents with filename convention.
The Blink IDL conventions are:
- If an IDL file defines an interface, a dictionary, or an exception,
the IDL file must cont... | [
"def",
"validate_blink_idl_definitions",
"(",
"idl_filename",
",",
"idl_file_basename",
",",
"definitions",
")",
":",
"targets",
"=",
"(",
"definitions",
".",
"interfaces",
".",
"values",
"(",
")",
"+",
"definitions",
".",
"dictionaries",
".",
"values",
"(",
")"... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/idl_reader.py#L45-L74 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ListCtrl.SetItemTextColour | (*args, **kwargs) | return _controls_.ListCtrl_SetItemTextColour(*args, **kwargs) | SetItemTextColour(self, long item, Colour col) | SetItemTextColour(self, long item, Colour col) | [
"SetItemTextColour",
"(",
"self",
"long",
"item",
"Colour",
"col",
")"
] | def SetItemTextColour(*args, **kwargs):
"""SetItemTextColour(self, long item, Colour col)"""
return _controls_.ListCtrl_SetItemTextColour(*args, **kwargs) | [
"def",
"SetItemTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_SetItemTextColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L4736-L4738 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/cluster/hierarchy.py | python | ClusterNode.get_left | (self) | return self.left | Return a reference to the left child tree object.
Returns
-------
left : ClusterNode
The left child of the target node. If the node is a leaf,
None is returned. | Return a reference to the left child tree object. | [
"Return",
"a",
"reference",
"to",
"the",
"left",
"child",
"tree",
"object",
"."
] | def get_left(self):
"""
Return a reference to the left child tree object.
Returns
-------
left : ClusterNode
The left child of the target node. If the node is a leaf,
None is returned.
"""
return self.left | [
"def",
"get_left",
"(",
"self",
")",
":",
"return",
"self",
".",
"left"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/cluster/hierarchy.py#L771-L782 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pytree.py | python | LeafPattern.__init__ | (self, type=None, content=None, name=None) | Initializer. Takes optional type, content, and name.
The type, if given must be a token type (< 256). If not given,
this matches any *leaf* node; the content may still be required.
The content, if given, must be a string.
If a name is given, the matching node is stored in the result... | Initializer. Takes optional type, content, and name. | [
"Initializer",
".",
"Takes",
"optional",
"type",
"content",
"and",
"name",
"."
] | def __init__(self, type=None, content=None, name=None):
"""
Initializer. Takes optional type, content, and name.
The type, if given must be a token type (< 256). If not given,
this matches any *leaf* node; the content may still be required.
The content, if given, must be a st... | [
"def",
"__init__",
"(",
"self",
",",
"type",
"=",
"None",
",",
"content",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"type",
"is",
"not",
"None",
":",
"assert",
"0",
"<=",
"type",
"<",
"256",
",",
"type",
"if",
"content",
"is",
"not",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/lib2to3/pytree.py#L502-L520 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview.py | python | Qt4MplCanvas.add_1d_plot_right | (self, x, y, color=None, label="", x_label=None, ylabel=None, marker=None, linestyle=None,
linewidth=1) | return line_key | Add a line (1-d plot) at right axis | Add a line (1-d plot) at right axis | [
"Add",
"a",
"line",
"(",
"1",
"-",
"d",
"plot",
")",
"at",
"right",
"axis"
] | def add_1d_plot_right(self, x, y, color=None, label="", x_label=None, ylabel=None, marker=None, linestyle=None,
linewidth=1):
""" Add a line (1-d plot) at right axis
"""
if self.axes2 is None:
self.axes2 = self.axes.twinx()
# Hold previous data
... | [
"def",
"add_1d_plot_right",
"(",
"self",
",",
"x",
",",
"y",
",",
"color",
"=",
"None",
",",
"label",
"=",
"\"\"",
",",
"x_label",
"=",
"None",
",",
"ylabel",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"linestyle",
"=",
"None",
",",
"linewidth",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview.py#L1194-L1245 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showbase/ShowBase.py | python | ShowBase.textureOff | (self) | Disables texturing on the entire 3D scene graph. | Disables texturing on the entire 3D scene graph. | [
"Disables",
"texturing",
"on",
"the",
"entire",
"3D",
"scene",
"graph",
"."
] | def textureOff(self):
"""
Disables texturing on the entire 3D scene graph.
"""
self.render.setTextureOff(100)
self.textureEnabled = 0 | [
"def",
"textureOff",
"(",
"self",
")",
":",
"self",
".",
"render",
".",
"setTextureOff",
"(",
"100",
")",
"self",
".",
"textureEnabled",
"=",
"0"
] | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/ShowBase.py#L2347-L2352 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | Parser.p_AbsoluteScopedName | (self, p) | AbsoluteScopedName : SCOPE IDENTIFIER ScopedNameParts | AbsoluteScopedName : SCOPE IDENTIFIER ScopedNameParts | [
"AbsoluteScopedName",
":",
"SCOPE",
"IDENTIFIER",
"ScopedNameParts"
] | def p_AbsoluteScopedName(self, p):
"""
AbsoluteScopedName : SCOPE IDENTIFIER ScopedNameParts
"""
assert False
pass | [
"def",
"p_AbsoluteScopedName",
"(",
"self",
",",
"p",
")",
":",
"assert",
"False",
"pass"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L5483-L5488 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/bigtable/python/ops/bigtable_api.py | python | BigtableTable.write | (self, dataset, column_families, columns, timestamp=None) | return gen_bigtable_ops.dataset_to_bigtable(
self._resource,
dataset._variant_tensor, # pylint: disable=protected-access
column_families,
columns,
timestamp) | Writes a dataset to the table.
Args:
dataset: A `tf.data.Dataset` to be written to this table. It must produce
a list of number-of-columns+1 elements, all of which must be strings.
The first value will be used as the row key, and subsequent values will
be used as cell values for the c... | Writes a dataset to the table. | [
"Writes",
"a",
"dataset",
"to",
"the",
"table",
"."
] | def write(self, dataset, column_families, columns, timestamp=None):
"""Writes a dataset to the table.
Args:
dataset: A `tf.data.Dataset` to be written to this table. It must produce
a list of number-of-columns+1 elements, all of which must be strings.
The first value will be used as the r... | [
"def",
"write",
"(",
"self",
",",
"dataset",
",",
"column_families",
",",
"columns",
",",
"timestamp",
"=",
"None",
")",
":",
"if",
"timestamp",
"is",
"None",
":",
"timestamp",
"=",
"-",
"1",
"# Bigtable server provided timestamp.",
"for",
"tensor_type",
"in",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/bigtable/python/ops/bigtable_api.py#L448-L493 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/compiler/xla/python_api/xla_literal.py | python | ConvertLiteralToNumpyArray | (literal) | Converts a XLA literal to a Numpy array. | Converts a XLA literal to a Numpy array. | [
"Converts",
"a",
"XLA",
"literal",
"to",
"a",
"Numpy",
"array",
"."
] | def ConvertLiteralToNumpyArray(literal):
"""Converts a XLA literal to a Numpy array."""
element_type = literal.shape.element_type
if element_type == xla_data_pb2.TUPLE:
return tuple(
ConvertLiteralToNumpyArray(subliteral)
for subliteral in literal.tuple_literals)
type_record = types.MAP_XLA... | [
"def",
"ConvertLiteralToNumpyArray",
"(",
"literal",
")",
":",
"element_type",
"=",
"literal",
".",
"shape",
".",
"element_type",
"if",
"element_type",
"==",
"xla_data_pb2",
".",
"TUPLE",
":",
"return",
"tuple",
"(",
"ConvertLiteralToNumpyArray",
"(",
"subliteral",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/compiler/xla/python_api/xla_literal.py#L24-L57 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | canonicPath | (path) | return ret | Constructs a canonic path from the specified path. | Constructs a canonic path from the specified path. | [
"Constructs",
"a",
"canonic",
"path",
"from",
"the",
"specified",
"path",
"."
] | def canonicPath(path):
"""Constructs a canonic path from the specified path. """
ret = libxml2mod.xmlCanonicPath(path)
return ret | [
"def",
"canonicPath",
"(",
"path",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlCanonicPath",
"(",
"path",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L1792-L1795 | |
Evolving-AI-Lab/fooling | 66f097dd6bd2eb6794ade3e187a7adfdf1887688 | caffe/scripts/cpp_lint.py | python | CheckForBadCharacters | (filename, lines, error) | Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that it's possible for this to throw off line
numbering if... | Logs an error for each line containing bad characters. | [
"Logs",
"an",
"error",
"for",
"each",
"line",
"containing",
"bad",
"characters",
"."
] | def CheckForBadCharacters(filename, lines, error):
"""Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that... | [
"def",
"CheckForBadCharacters",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"for",
"linenum",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"if",
"u'\\ufffd'",
"in",
"line",
":",
"error",
"(",
"filename",
",",
"linenum",
",",
"'reada... | https://github.com/Evolving-AI-Lab/fooling/blob/66f097dd6bd2eb6794ade3e187a7adfdf1887688/caffe/scripts/cpp_lint.py#L1483-L1505 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimelike.py | python | DatetimeLikeArrayMixin.mean | (self, skipna=True) | return self._box_func(result) | Return the mean value of the Array.
.. versionadded:: 0.25.0
Parameters
----------
skipna : bool, default True
Whether to ignore any NaT elements.
Returns
-------
scalar
Timestamp or Timedelta.
See Also
--------
... | Return the mean value of the Array. | [
"Return",
"the",
"mean",
"value",
"of",
"the",
"Array",
"."
] | def mean(self, skipna=True):
"""
Return the mean value of the Array.
.. versionadded:: 0.25.0
Parameters
----------
skipna : bool, default True
Whether to ignore any NaT elements.
Returns
-------
scalar
Timestamp or Timed... | [
"def",
"mean",
"(",
"self",
",",
"skipna",
"=",
"True",
")",
":",
"if",
"is_period_dtype",
"(",
"self",
")",
":",
"# See discussion in GH#24757",
"raise",
"TypeError",
"(",
"f\"mean is not implemented for {type(self).__name__} since the \"",
"\"meaning is ambiguous. An alt... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/arrays/datetimelike.py#L1540-L1587 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py | python | PostTrainingQuantization._set_activation_persistable | (self) | Set activation variables to be persistable, so can obtain
the tensor data in sample_data | Set activation variables to be persistable, so can obtain
the tensor data in sample_data | [
"Set",
"activation",
"variables",
"to",
"be",
"persistable",
"so",
"can",
"obtain",
"the",
"tensor",
"data",
"in",
"sample_data"
] | def _set_activation_persistable(self):
'''
Set activation variables to be persistable, so can obtain
the tensor data in sample_data
'''
for var in self._program.list_vars():
if var.name in self._quantized_act_var_name:
var.persistable = True | [
"def",
"_set_activation_persistable",
"(",
"self",
")",
":",
"for",
"var",
"in",
"self",
".",
"_program",
".",
"list_vars",
"(",
")",
":",
"if",
"var",
".",
"name",
"in",
"self",
".",
"_quantized_act_var_name",
":",
"var",
".",
"persistable",
"=",
"True"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/slim/quantization/post_training_quantization.py#L553-L560 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/history.py | python | HistorySavingThread.stop | (self) | This can be called from the main thread to safely stop this thread.
Note that it does not attempt to write out remaining history before
exiting. That should be done by calling the HistoryManager's
end_session method. | This can be called from the main thread to safely stop this thread. | [
"This",
"can",
"be",
"called",
"from",
"the",
"main",
"thread",
"to",
"safely",
"stop",
"this",
"thread",
"."
] | def stop(self):
"""This can be called from the main thread to safely stop this thread.
Note that it does not attempt to write out remaining history before
exiting. That should be done by calling the HistoryManager's
end_session method."""
self.stop_now = True
self.histor... | [
"def",
"stop",
"(",
"self",
")",
":",
"self",
".",
"stop_now",
"=",
"True",
"self",
".",
"history_manager",
".",
"save_flag",
".",
"set",
"(",
")",
"self",
".",
"join",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/history.py#L839-L847 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/lookup/lookup_ops.py | python | MutableHashTable.size | (self, name=None) | Compute the number of elements in this table.
Args:
name: A name for the operation (optional).
Returns:
A scalar tensor containing the number of elements in this table. | Compute the number of elements in this table. | [
"Compute",
"the",
"number",
"of",
"elements",
"in",
"this",
"table",
"."
] | def size(self, name=None):
"""Compute the number of elements in this table.
Args:
name: A name for the operation (optional).
Returns:
A scalar tensor containing the number of elements in this table.
"""
with ops.op_scope([self._table_ref], name, "%s_Size" % self._name) as name:
#... | [
"def",
"size",
"(",
"self",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"self",
".",
"_table_ref",
"]",
",",
"name",
",",
"\"%s_Size\"",
"%",
"self",
".",
"_name",
")",
"as",
"name",
":",
"# pylint: disable=protected-a... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/lookup/lookup_ops.py#L754-L765 | ||
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/build/virtual_target.py | python | Action.actualize_source_type | (self, sources, prop_set) | return result | Helper for 'actualize_sources'.
For each passed source, actualizes it with the appropriate scanner.
Returns the actualized virtual targets. | Helper for 'actualize_sources'.
For each passed source, actualizes it with the appropriate scanner.
Returns the actualized virtual targets. | [
"Helper",
"for",
"actualize_sources",
".",
"For",
"each",
"passed",
"source",
"actualizes",
"it",
"with",
"the",
"appropriate",
"scanner",
".",
"Returns",
"the",
"actualized",
"virtual",
"targets",
"."
] | def actualize_source_type (self, sources, prop_set):
""" Helper for 'actualize_sources'.
For each passed source, actualizes it with the appropriate scanner.
Returns the actualized virtual targets.
"""
result = []
for i in sources:
scanner = None
# FIX... | [
"def",
"actualize_source_type",
"(",
"self",
",",
"sources",
",",
"prop_set",
")",
":",
"result",
"=",
"[",
"]",
"for",
"i",
"in",
"sources",
":",
"scanner",
"=",
"None",
"# FIXME: what's this?",
"# if isinstance (i, str):",
"# i = self.manag... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/virtual_target.py#L835-L854 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/shortcuteditor.py | python | ShortcutEditor.PreShow | (self) | Does some more common initialization before showing :class:`ShortcutEditor`. | Does some more common initialization before showing :class:`ShortcutEditor`. | [
"Does",
"some",
"more",
"common",
"initialization",
"before",
"showing",
":",
"class",
":",
"ShortcutEditor",
"."
] | def PreShow(self):
""" Does some more common initialization before showing :class:`ShortcutEditor`. """
self.listShortcut.MakeImageList()
self.listShortcut.RecreateTree()
self.SetColumnWidths() | [
"def",
"PreShow",
"(",
"self",
")",
":",
"self",
".",
"listShortcut",
".",
"MakeImageList",
"(",
")",
"self",
".",
"listShortcut",
".",
"RecreateTree",
"(",
")",
"self",
".",
"SetColumnWidths",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/shortcuteditor.py#L2578-L2584 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlTextReader.RelaxNGSetSchema | (self, schema) | return ret | Use RelaxNG to validate the document as it is processed.
Activation is only possible before the first Read(). if
@schema is None, then RelaxNG validation is desactivated. @
The @schema should not be freed until the reader is
deallocated or its use has been deactivated. | Use RelaxNG to validate the document as it is processed.
Activation is only possible before the first Read(). if | [
"Use",
"RelaxNG",
"to",
"validate",
"the",
"document",
"as",
"it",
"is",
"processed",
".",
"Activation",
"is",
"only",
"possible",
"before",
"the",
"first",
"Read",
"()",
".",
"if"
] | def RelaxNGSetSchema(self, schema):
"""Use RelaxNG to validate the document as it is processed.
Activation is only possible before the first Read(). if
@schema is None, then RelaxNG validation is desactivated. @
The @schema should not be freed until the reader is
dealloc... | [
"def",
"RelaxNGSetSchema",
"(",
"self",
",",
"schema",
")",
":",
"if",
"schema",
"is",
"None",
":",
"schema__o",
"=",
"None",
"else",
":",
"schema__o",
"=",
"schema",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlTextReaderRelaxNGSetSchema",
"(",
"self",
"... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L6860-L6869 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/closure_linter/closure_linter/statetracker.py | python | StateTracker.InObjectLiteralDescendant | (self) | return self.OBJECT_LITERAL in self._block_types | Returns true if the current token has an object literal ancestor.
Returns:
True if the current token has an object literal ancestor. | Returns true if the current token has an object literal ancestor. | [
"Returns",
"true",
"if",
"the",
"current",
"token",
"has",
"an",
"object",
"literal",
"ancestor",
"."
] | def InObjectLiteralDescendant(self):
"""Returns true if the current token has an object literal ancestor.
Returns:
True if the current token has an object literal ancestor.
"""
return self.OBJECT_LITERAL in self._block_types | [
"def",
"InObjectLiteralDescendant",
"(",
"self",
")",
":",
"return",
"self",
".",
"OBJECT_LITERAL",
"in",
"self",
".",
"_block_types"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/statetracker.py#L685-L691 | |
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/NERO/environment.py | python | NeroEnvironment.get_agent_info | (self, agent) | return OpenNero.AgentInitInfo(sbound, abound, rbound) | return a blueprint for a new agent | return a blueprint for a new agent | [
"return",
"a",
"blueprint",
"for",
"a",
"new",
"agent"
] | def get_agent_info(self, agent):
"""
return a blueprint for a new agent
"""
for a in constants.WALL_RAY_SENSORS:
agent.add_sensor(OpenNero.RaySensor(
math.cos(math.radians(a)), math.sin(math.radians(a)), 0,
constants.WALL_SENSOR_RADIUS,... | [
"def",
"get_agent_info",
"(",
"self",
",",
"agent",
")",
":",
"for",
"a",
"in",
"constants",
".",
"WALL_RAY_SENSORS",
":",
"agent",
".",
"add_sensor",
"(",
"OpenNero",
".",
"RaySensor",
"(",
"math",
".",
"cos",
"(",
"math",
".",
"radians",
"(",
"a",
")... | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/NERO/environment.py#L275-L320 | |
ablab/quast | 5f6709528129a6ad266a6b24ef3f40b88f0fe04b | quast_libs/busco/pipebricks/PipeLogger.py | python | PipeLogger.warning | (self, msg, *args, **kwargs) | This function overrides the _logger class warning
:param msg: the message to log
:type msg: str | This function overrides the _logger class warning
:param msg: the message to log
:type msg: str | [
"This",
"function",
"overrides",
"the",
"_logger",
"class",
"warning",
":",
"param",
"msg",
":",
"the",
"message",
"to",
"log",
":",
"type",
"msg",
":",
"str"
] | def warning(self, msg, *args, **kwargs):
"""
This function overrides the _logger class warning
:param msg: the message to log
:type msg: str
"""
PipeLogger._has_warning = True
super(PipeLogger, self).warning(msg, *args, **kwargs) | [
"def",
"warning",
"(",
"self",
",",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"PipeLogger",
".",
"_has_warning",
"=",
"True",
"super",
"(",
"PipeLogger",
",",
"self",
")",
".",
"warning",
"(",
"msg",
",",
"*",
"args",
",",
"*",
... | https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/busco/pipebricks/PipeLogger.py#L111-L118 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | mlir/utils/gdb-scripts/prettyprinters.py | python | StorageTypeMap._init_map | (self) | Lazy initialization of self.map. | Lazy initialization of self.map. | [
"Lazy",
"initialization",
"of",
"self",
".",
"map",
"."
] | def _init_map(self):
"""Lazy initialization of self.map."""
if self.map:
return
self.map = {}
for type_name in self.type_names:
concrete_type = gdb.lookup_type(type_name)
try:
storage = gdb.parse_and_eval(
"&'mlir::detail::TypeIDExported::get<%s>()::instance'" % ty... | [
"def",
"_init_map",
"(",
"self",
")",
":",
"if",
"self",
".",
"map",
":",
"return",
"self",
".",
"map",
"=",
"{",
"}",
"for",
"type_name",
"in",
"self",
".",
"type_names",
":",
"concrete_type",
"=",
"gdb",
".",
"lookup_type",
"(",
"type_name",
")",
"... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/mlir/utils/gdb-scripts/prettyprinters.py#L99-L113 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py | python | IRBuilder.if_then | (self, pred, likely=None) | A context manager which sets up a conditional basic block based
on the given predicate (a i1 value). If the conditional block
is not explicitly terminated, a branch will be added to the next
block.
If *likely* is given, its boolean value indicates whether the
predicate is likely... | A context manager which sets up a conditional basic block based
on the given predicate (a i1 value). If the conditional block
is not explicitly terminated, a branch will be added to the next
block.
If *likely* is given, its boolean value indicates whether the
predicate is likely... | [
"A",
"context",
"manager",
"which",
"sets",
"up",
"a",
"conditional",
"basic",
"block",
"based",
"on",
"the",
"given",
"predicate",
"(",
"a",
"i1",
"value",
")",
".",
"If",
"the",
"conditional",
"block",
"is",
"not",
"explicitly",
"terminated",
"a",
"branc... | def if_then(self, pred, likely=None):
"""
A context manager which sets up a conditional basic block based
on the given predicate (a i1 value). If the conditional block
is not explicitly terminated, a branch will be added to the next
block.
If *likely* is given, its boole... | [
"def",
"if_then",
"(",
"self",
",",
"pred",
",",
"likely",
"=",
"None",
")",
":",
"bb",
"=",
"self",
".",
"basic_block",
"bbif",
"=",
"self",
".",
"append_basic_block",
"(",
"name",
"=",
"_label_suffix",
"(",
"bb",
".",
"name",
",",
"'.if'",
")",
")"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py#L269-L289 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/hermite_e.py | python | hermepow | (c, pow, maxpower=16) | Raise a Hermite series to a power.
Returns the Hermite series `c` raised to the power `pow`. The
argument `c` is a sequence of coefficients ordered from low to high.
i.e., [1,2,3] is the series ``P_0 + 2*P_1 + 3*P_2.``
Parameters
----------
c : array_like
1-D array of Hermite series c... | Raise a Hermite series to a power. | [
"Raise",
"a",
"Hermite",
"series",
"to",
"a",
"power",
"."
] | def hermepow(c, pow, maxpower=16) :
"""Raise a Hermite series to a power.
Returns the Hermite series `c` raised to the power `pow`. The
argument `c` is a sequence of coefficients ordered from low to high.
i.e., [1,2,3] is the series ``P_0 + 2*P_1 + 3*P_2.``
Parameters
----------
c : array... | [
"def",
"hermepow",
"(",
"c",
",",
"pow",
",",
"maxpower",
"=",
"16",
")",
":",
"# c is a trimmed copy",
"[",
"c",
"]",
"=",
"pu",
".",
"as_series",
"(",
"[",
"c",
"]",
")",
"power",
"=",
"int",
"(",
"pow",
")",
"if",
"power",
"!=",
"pow",
"or",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/hermite_e.py#L580-L631 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/libmintspointgrp.py | python | CharacterTable.nirrep | (self) | return self.PYnirrep | Returns the number of irreps. | Returns the number of irreps. | [
"Returns",
"the",
"number",
"of",
"irreps",
"."
] | def nirrep(self):
"""Returns the number of irreps."""
return self.PYnirrep | [
"def",
"nirrep",
"(",
"self",
")",
":",
"return",
"self",
".",
"PYnirrep"
] | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintspointgrp.py#L963-L965 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Source/bindings/scripts/blink_idl_parser.py | python | BlinkIDLParser.p_StringLiteralList | (self, p) | StringLiteralList : StringLiteral ',' StringLiteralList
| StringLiteral | StringLiteralList : StringLiteral ',' StringLiteralList
| StringLiteral | [
"StringLiteralList",
":",
"StringLiteral",
"StringLiteralList",
"|",
"StringLiteral"
] | def p_StringLiteralList(self, p):
"""StringLiteralList : StringLiteral ',' StringLiteralList
| StringLiteral"""
def unwrap_string(ls):
"""Reach in and grab the string literal's "NAME"."""
return ls[1].value
if len(p) > 3:
p[0] = L... | [
"def",
"p_StringLiteralList",
"(",
"self",
",",
"p",
")",
":",
"def",
"unwrap_string",
"(",
"ls",
")",
":",
"\"\"\"Reach in and grab the string literal's \"NAME\".\"\"\"",
"return",
"ls",
"[",
"1",
"]",
".",
"value",
"if",
"len",
"(",
"p",
")",
">",
"3",
":"... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/blink_idl_parser.py#L367-L377 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/fourcircle_utility.py | python | get_det_xml_file_url | (server_url, instrument_name, exp_number, scan_number, pt_number) | return file_url | Get the URL to download the detector counts file in XML format
:param server_url:
:param instrument_name:
:param exp_number:
:param scan_number:
:param pt_number:
:return: | Get the URL to download the detector counts file in XML format
:param server_url:
:param instrument_name:
:param exp_number:
:param scan_number:
:param pt_number:
:return: | [
"Get",
"the",
"URL",
"to",
"download",
"the",
"detector",
"counts",
"file",
"in",
"XML",
"format",
":",
"param",
"server_url",
":",
":",
"param",
"instrument_name",
":",
":",
"param",
"exp_number",
":",
":",
"param",
"scan_number",
":",
":",
"param",
"pt_n... | def get_det_xml_file_url(server_url, instrument_name, exp_number, scan_number, pt_number):
""" Get the URL to download the detector counts file in XML format
:param server_url:
:param instrument_name:
:param exp_number:
:param scan_number:
:param pt_number:
:return:
"""
assert isinst... | [
"def",
"get_det_xml_file_url",
"(",
"server_url",
",",
"instrument_name",
",",
"exp_number",
",",
"scan_number",
",",
"pt_number",
")",
":",
"assert",
"isinstance",
"(",
"server_url",
",",
"str",
")",
"and",
"isinstance",
"(",
"instrument_name",
",",
"str",
")",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/fourcircle_utility.py#L393-L408 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/tkFileDialog.py | python | askopenfilename | (**options) | return Open(**options).show() | Ask for a filename to open | Ask for a filename to open | [
"Ask",
"for",
"a",
"filename",
"to",
"open"
] | def askopenfilename(**options):
"Ask for a filename to open"
return Open(**options).show() | [
"def",
"askopenfilename",
"(",
"*",
"*",
"options",
")",
":",
"return",
"Open",
"(",
"*",
"*",
"options",
")",
".",
"show",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/tkFileDialog.py#L122-L125 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | PseudoDC.DrawEllipseRect | (*args, **kwargs) | return _gdi_.PseudoDC_DrawEllipseRect(*args, **kwargs) | DrawEllipseRect(self, Rect rect)
Draws an ellipse contained in the specified rectangle. The current pen
is used for the outline and the current brush for filling the shape. | DrawEllipseRect(self, Rect rect) | [
"DrawEllipseRect",
"(",
"self",
"Rect",
"rect",
")"
] | def DrawEllipseRect(*args, **kwargs):
"""
DrawEllipseRect(self, Rect rect)
Draws an ellipse contained in the specified rectangle. The current pen
is used for the outline and the current brush for filling the shape.
"""
return _gdi_.PseudoDC_DrawEllipseRect(*args, **kwarg... | [
"def",
"DrawEllipseRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"PseudoDC_DrawEllipseRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L8025-L8032 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/ldc2.py | python | find_ldc2 | (conf) | Find the program *ldc2* and set the variable *D* | Find the program *ldc2* and set the variable *D* | [
"Find",
"the",
"program",
"*",
"ldc2",
"*",
"and",
"set",
"the",
"variable",
"*",
"D",
"*"
] | def find_ldc2(conf):
"""
Find the program *ldc2* and set the variable *D*
"""
conf.find_program(['ldc2'], var='D')
out = conf.cmd_and_log([conf.env.D, '-version'])
if out.find("based on DMD v2.") == -1:
conf.fatal("detected compiler is not ldc2") | [
"def",
"find_ldc2",
"(",
"conf",
")",
":",
"conf",
".",
"find_program",
"(",
"[",
"'ldc2'",
"]",
",",
"var",
"=",
"'D'",
")",
"out",
"=",
"conf",
".",
"cmd_and_log",
"(",
"[",
"conf",
".",
"env",
".",
"D",
",",
"'-version'",
"]",
")",
"if",
"out"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/ldc2.py#L10-L19 | ||
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | veles/external/freetype/__init__.py | python | Stroker.end_subpath | (self) | Close the current sub-path in the stroker.
**Note**:
You should call this function after 'begin_subpath'. If the subpath
was not 'opened', this function 'draws' a single line segment to the
start position when needed. | Close the current sub-path in the stroker. | [
"Close",
"the",
"current",
"sub",
"-",
"path",
"in",
"the",
"stroker",
"."
] | def end_subpath(self):
'''
Close the current sub-path in the stroker.
**Note**:
You should call this function after 'begin_subpath'. If the subpath
was not 'opened', this function 'draws' a single line segment to the
start position when needed.
'''
... | [
"def",
"end_subpath",
"(",
"self",
")",
":",
"error",
"=",
"FT_Stroker_EndSubPath",
"(",
"self",
".",
"_FT_Stroker",
")",
"if",
"error",
":",
"raise",
"FT_Exception",
"(",
"error",
")"
] | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/freetype/__init__.py#L1800-L1811 | ||
grpc/grpc | 27bc6fe7797e43298dc931b96dc57322d0852a9f | tools/distrib/python/grpcio_tools/grpc_tools/protoc.py | python | main | (command_arguments) | return _protoc_compiler.run_main(command_arguments) | Run the protocol buffer compiler with the given command-line arguments.
Args:
command_arguments: a list of strings representing command line arguments to
`protoc`. | Run the protocol buffer compiler with the given command-line arguments. | [
"Run",
"the",
"protocol",
"buffer",
"compiler",
"with",
"the",
"given",
"command",
"-",
"line",
"arguments",
"."
] | def main(command_arguments):
"""Run the protocol buffer compiler with the given command-line arguments.
Args:
command_arguments: a list of strings representing command line arguments to
`protoc`.
"""
command_arguments = [argument.encode() for argument in command_arguments]
return _protoc_co... | [
"def",
"main",
"(",
"command_arguments",
")",
":",
"command_arguments",
"=",
"[",
"argument",
".",
"encode",
"(",
")",
"for",
"argument",
"in",
"command_arguments",
"]",
"return",
"_protoc_compiler",
".",
"run_main",
"(",
"command_arguments",
")"
] | https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/tools/distrib/python/grpcio_tools/grpc_tools/protoc.py#L29-L37 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | PhotoImage.get | (self, x, y) | return self.tk.call(self.name, 'get', x, y) | Return the color (red, green, blue) of the pixel at X,Y. | Return the color (red, green, blue) of the pixel at X,Y. | [
"Return",
"the",
"color",
"(",
"red",
"green",
"blue",
")",
"of",
"the",
"pixel",
"at",
"X",
"Y",
"."
] | def get(self, x, y):
"""Return the color (red, green, blue) of the pixel at X,Y."""
return self.tk.call(self.name, 'get', x, y) | [
"def",
"get",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"name",
",",
"'get'",
",",
"x",
",",
"y",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L3579-L3581 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib-tk/tkFileDialog.py | python | asksaveasfilename | (**options) | return SaveAs(**options).show() | Ask for a filename to save as | Ask for a filename to save as | [
"Ask",
"for",
"a",
"filename",
"to",
"save",
"as"
] | def asksaveasfilename(**options):
"Ask for a filename to save as"
return SaveAs(**options).show() | [
"def",
"asksaveasfilename",
"(",
"*",
"*",
"options",
")",
":",
"return",
"SaveAs",
"(",
"*",
"*",
"options",
")",
".",
"show",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/tkFileDialog.py#L127-L130 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | FWCore/ParameterSet/python/SequenceTypes.py | python | _Sequenceable.isOperation | (self) | return False | Returns True if the object is an operator (e.g. *,+ or !) type | Returns True if the object is an operator (e.g. *,+ or !) type | [
"Returns",
"True",
"if",
"the",
"object",
"is",
"an",
"operator",
"(",
"e",
".",
"g",
".",
"*",
"+",
"or",
"!",
")",
"type"
] | def isOperation(self):
"""Returns True if the object is an operator (e.g. *,+ or !) type"""
return False | [
"def",
"isOperation",
"(",
"self",
")",
":",
"return",
"False"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/SequenceTypes.py#L35-L37 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py | python | SimpleParser.parseTagOpCopyTests | (self, sTag, aasSections, iTagLine, iEndLine) | return True | Tag: \@opcopytests
Value: <opstat | function> [..]
Example: \@opcopytests add_Eb_Gb
Trick to avoid duplicating tests for different encodings of the same
operation. | Tag: \@opcopytests
Value: <opstat | function> [..]
Example: \@opcopytests add_Eb_Gb | [
"Tag",
":",
"\\",
"@opcopytests",
"Value",
":",
"<opstat",
"|",
"function",
">",
"[",
"..",
"]",
"Example",
":",
"\\",
"@opcopytests",
"add_Eb_Gb"
] | def parseTagOpCopyTests(self, sTag, aasSections, iTagLine, iEndLine):
"""
Tag: \@opcopytests
Value: <opstat | function> [..]
Example: \@opcopytests add_Eb_Gb
Trick to avoid duplicating tests for different encodings of the same
operation.
"""
... | [
"def",
"parseTagOpCopyTests",
"(",
"self",
",",
"sTag",
",",
"aasSections",
",",
"iTagLine",
",",
"iEndLine",
")",
":",
"oInstr",
"=",
"self",
".",
"ensureInstructionForOpTag",
"(",
"iTagLine",
")",
"# Flatten, validate and append the copy job to the instruction. We exec... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py#L2640-L2667 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/classifier/logistic_classifier.py | python | LogisticClassifier.predict_topk | (
self, dataset, output_type="probability", k=3, missing_value_action="auto"
) | return self.__proxy__.predict_topk(
dataset, missing_value_action, output_type, k
) | Return top-k predictions for the ``dataset``, using the trained model.
Predictions are returned as an SFrame with three columns: `id`,
`class`, and `probability`, `margin`, or `rank`, depending on the ``output_type``
parameter. Input dataset size must be the same as for training of the model.
... | Return top-k predictions for the ``dataset``, using the trained model.
Predictions are returned as an SFrame with three columns: `id`,
`class`, and `probability`, `margin`, or `rank`, depending on the ``output_type``
parameter. Input dataset size must be the same as for training of the model. | [
"Return",
"top",
"-",
"k",
"predictions",
"for",
"the",
"dataset",
"using",
"the",
"trained",
"model",
".",
"Predictions",
"are",
"returned",
"as",
"an",
"SFrame",
"with",
"three",
"columns",
":",
"id",
"class",
"and",
"probability",
"margin",
"or",
"rank",
... | def predict_topk(
self, dataset, output_type="probability", k=3, missing_value_action="auto"
):
"""
Return top-k predictions for the ``dataset``, using the trained model.
Predictions are returned as an SFrame with three columns: `id`,
`class`, and `probability`, `margin`, or... | [
"def",
"predict_topk",
"(",
"self",
",",
"dataset",
",",
"output_type",
"=",
"\"probability\"",
",",
"k",
"=",
"3",
",",
"missing_value_action",
"=",
"\"auto\"",
")",
":",
"_check_categorical_option_type",
"(",
"\"output_type\"",
",",
"output_type",
",",
"[",
"\... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/classifier/logistic_classifier.py#L696-L790 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TreeCtrl.IsSelected | (*args, **kwargs) | return _controls_.TreeCtrl_IsSelected(*args, **kwargs) | IsSelected(self, TreeItemId item) -> bool | IsSelected(self, TreeItemId item) -> bool | [
"IsSelected",
"(",
"self",
"TreeItemId",
"item",
")",
"-",
">",
"bool"
] | def IsSelected(*args, **kwargs):
"""IsSelected(self, TreeItemId item) -> bool"""
return _controls_.TreeCtrl_IsSelected(*args, **kwargs) | [
"def",
"IsSelected",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TreeCtrl_IsSelected",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L5350-L5352 | |
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | python-threatexchange/threatexchange/hashing/pdq_utils.py | python | simple_distance_binary | (bin_a, bin_b) | return sum(bin_a[i] != bin_b[i] for i in range(BITS_IN_PDQ)) | Returns the hamming distance of two binary strings. | Returns the hamming distance of two binary strings. | [
"Returns",
"the",
"hamming",
"distance",
"of",
"two",
"binary",
"strings",
"."
] | def simple_distance_binary(bin_a, bin_b):
"""
Returns the hamming distance of two binary strings.
"""
assert len(bin_a) == BITS_IN_PDQ
assert len(bin_b) == BITS_IN_PDQ
return sum(bin_a[i] != bin_b[i] for i in range(BITS_IN_PDQ)) | [
"def",
"simple_distance_binary",
"(",
"bin_a",
",",
"bin_b",
")",
":",
"assert",
"len",
"(",
"bin_a",
")",
"==",
"BITS_IN_PDQ",
"assert",
"len",
"(",
"bin_b",
")",
"==",
"BITS_IN_PDQ",
"return",
"sum",
"(",
"bin_a",
"[",
"i",
"]",
"!=",
"bin_b",
"[",
"... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/python-threatexchange/threatexchange/hashing/pdq_utils.py#L7-L13 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | contrib/gizmos/osx_cocoa/gizmos.py | python | TreeListColumnInfo.SetSelectedImage | (*args, **kwargs) | return _gizmos.TreeListColumnInfo_SetSelectedImage(*args, **kwargs) | SetSelectedImage(self, int image) | SetSelectedImage(self, int image) | [
"SetSelectedImage",
"(",
"self",
"int",
"image",
")"
] | def SetSelectedImage(*args, **kwargs):
"""SetSelectedImage(self, int image)"""
return _gizmos.TreeListColumnInfo_SetSelectedImage(*args, **kwargs) | [
"def",
"SetSelectedImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gizmos",
".",
"TreeListColumnInfo_SetSelectedImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L444-L446 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/turtle.py | python | TPen.resizemode | (self, rmode=None) | Set resizemode to one of the values: "auto", "user", "noresize".
(Optional) Argument:
rmode -- one of the strings "auto", "user", "noresize"
Different resizemodes have the following effects:
- "auto" adapts the appearance of the turtle
corresponding to the value of... | Set resizemode to one of the values: "auto", "user", "noresize". | [
"Set",
"resizemode",
"to",
"one",
"of",
"the",
"values",
":",
"auto",
"user",
"noresize",
"."
] | def resizemode(self, rmode=None):
"""Set resizemode to one of the values: "auto", "user", "noresize".
(Optional) Argument:
rmode -- one of the strings "auto", "user", "noresize"
Different resizemodes have the following effects:
- "auto" adapts the appearance of the turtle
... | [
"def",
"resizemode",
"(",
"self",
",",
"rmode",
"=",
"None",
")",
":",
"if",
"rmode",
"is",
"None",
":",
"return",
"self",
".",
"_resizemode",
"rmode",
"=",
"rmode",
".",
"lower",
"(",
")",
"if",
"rmode",
"in",
"[",
"\"auto\"",
",",
"\"user\"",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/turtle.py#L2045-L2071 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | uCSIsMathematicalOperators | (code) | return ret | Check whether the character is part of
MathematicalOperators UCS Block | Check whether the character is part of
MathematicalOperators UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"MathematicalOperators",
"UCS",
"Block"
] | def uCSIsMathematicalOperators(code):
"""Check whether the character is part of
MathematicalOperators UCS Block """
ret = libxml2mod.xmlUCSIsMathematicalOperators(code)
return ret | [
"def",
"uCSIsMathematicalOperators",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsMathematicalOperators",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2684-L2688 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_core.py | python | PyApp.SetPrintMode | (*args, **kwargs) | return _core_.PyApp_SetPrintMode(*args, **kwargs) | SetPrintMode(self, int mode) | SetPrintMode(self, int mode) | [
"SetPrintMode",
"(",
"self",
"int",
"mode",
")"
] | def SetPrintMode(*args, **kwargs):
"""SetPrintMode(self, int mode)"""
return _core_.PyApp_SetPrintMode(*args, **kwargs) | [
"def",
"SetPrintMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_SetPrintMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L8107-L8109 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiToolBarEvent.SetDropDownClicked | (*args, **kwargs) | return _aui.AuiToolBarEvent_SetDropDownClicked(*args, **kwargs) | SetDropDownClicked(self, bool c) | SetDropDownClicked(self, bool c) | [
"SetDropDownClicked",
"(",
"self",
"bool",
"c",
")"
] | def SetDropDownClicked(*args, **kwargs):
"""SetDropDownClicked(self, bool c)"""
return _aui.AuiToolBarEvent_SetDropDownClicked(*args, **kwargs) | [
"def",
"SetDropDownClicked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiToolBarEvent_SetDropDownClicked",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L1685-L1687 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/resource_variable_ops.py | python | ResourceVariable.sparse_read | (self, indices, name=None) | return array_ops.identity(value) | Reads the value of this variable sparsely, using `gather`. | Reads the value of this variable sparsely, using `gather`. | [
"Reads",
"the",
"value",
"of",
"this",
"variable",
"sparsely",
"using",
"gather",
"."
] | def sparse_read(self, indices, name=None):
"""Reads the value of this variable sparsely, using `gather`."""
with ops.name_scope("Gather" if name is None else name) as name:
if self._trainable:
tape.watch_variable(self)
value = gen_resource_variable_ops.resource_gather(
self._handle... | [
"def",
"sparse_read",
"(",
"self",
",",
"indices",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"\"Gather\"",
"if",
"name",
"is",
"None",
"else",
"name",
")",
"as",
"name",
":",
"if",
"self",
".",
"_trainable",
":",
"tap... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/resource_variable_ops.py#L618-L625 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py | python | IMetadataProvider.has_metadata | (name) | Does the package's distribution contain the named metadata? | Does the package's distribution contain the named metadata? | [
"Does",
"the",
"package",
"s",
"distribution",
"contain",
"the",
"named",
"metadata?"
] | def has_metadata(name):
"""Does the package's distribution contain the named metadata?""" | [
"def",
"has_metadata",
"(",
"name",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/__init__.py#L586-L587 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/models/rnn/translate/translate.py | python | create_model | (session, forward_only) | return model | Create translation model and initialize or load parameters in session. | Create translation model and initialize or load parameters in session. | [
"Create",
"translation",
"model",
"and",
"initialize",
"or",
"load",
"parameters",
"in",
"session",
"."
] | def create_model(session, forward_only):
"""Create translation model and initialize or load parameters in session."""
model = seq2seq_model.Seq2SeqModel(
FLAGS.en_vocab_size, FLAGS.fr_vocab_size, _buckets,
FLAGS.size, FLAGS.num_layers, FLAGS.max_gradient_norm, FLAGS.batch_size,
FLAGS.learning_rate... | [
"def",
"create_model",
"(",
"session",
",",
"forward_only",
")",
":",
"model",
"=",
"seq2seq_model",
".",
"Seq2SeqModel",
"(",
"FLAGS",
".",
"en_vocab_size",
",",
"FLAGS",
".",
"fr_vocab_size",
",",
"_buckets",
",",
"FLAGS",
".",
"size",
",",
"FLAGS",
".",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/models/rnn/translate/translate.py#L115-L129 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/json_schema_compiler/model.py | python | Property.__init__ | (self, parent, name, json, namespace, origin) | Creates a Property from JSON. | Creates a Property from JSON. | [
"Creates",
"a",
"Property",
"from",
"JSON",
"."
] | def __init__(self, parent, name, json, namespace, origin):
"""Creates a Property from JSON.
"""
self.parent = parent
self.name = name
self._unix_name = UnixName(self.name)
self._unix_name_used = False
self.origin = origin
self.simple_name = _StripNamespace(self.name, namespace)
self.... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"name",
",",
"json",
",",
"namespace",
",",
"origin",
")",
":",
"self",
".",
"parent",
"=",
"parent",
"self",
".",
"name",
"=",
"name",
"self",
".",
"_unix_name",
"=",
"UnixName",
"(",
"self",
".",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_schema_compiler/model.py#L338-L374 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/ciconfig/evergreen.py | python | Task.tags | (self) | return self._tags | Get a set of tags this task has been marked with. | Get a set of tags this task has been marked with. | [
"Get",
"a",
"set",
"of",
"tags",
"this",
"task",
"has",
"been",
"marked",
"with",
"."
] | def tags(self):
"""Get a set of tags this task has been marked with."""
if self._tags is None:
self._tags = set(self.raw.get("tags", []))
return self._tags | [
"def",
"tags",
"(",
"self",
")",
":",
"if",
"self",
".",
"_tags",
"is",
"None",
":",
"self",
".",
"_tags",
"=",
"set",
"(",
"self",
".",
"raw",
".",
"get",
"(",
"\"tags\"",
",",
"[",
"]",
")",
")",
"return",
"self",
".",
"_tags"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/ciconfig/evergreen.py#L205-L209 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/collective.py | python | reduce | (tensor, dst, op=ReduceOp.SUM, group=None, use_calc_stream=True) | Reduce a tensor to the destination from all others. As shown below, 4 GPUs each start 4 processes and the data on each GPU is respresnted
by the GPU number. The destination of the reduce operator is GPU0 and the process is sum. Through reduce operator,
the GPU0 will owns the sum of all data from all GPUs.
... | [] | def reduce(tensor, dst, op=ReduceOp.SUM, group=None, use_calc_stream=True):
"""
Reduce a tensor to the destination from all others. As shown below, 4 GPUs each start 4 processes and the data on each GPU is respresnted
by the GPU number. The destination of the reduce operator is GPU0 and the process is sum.... | [
"def",
"reduce",
"(",
"tensor",
",",
"dst",
",",
"op",
"=",
"ReduceOp",
".",
"SUM",
",",
"group",
"=",
"None",
",",
"use_calc_stream",
"=",
"True",
")",
":",
"if",
"group",
"is",
"not",
"None",
"and",
"not",
"group",
".",
"is_member",
"(",
")",
":"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/collective.py#L516-L615 | |||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/math_ops.py | python | dot | (a, b) | return res | Returns the dot product of two arrays.
Specifically,
If both `a` and `b` are 1-D arrays, it is inner product of vectors
(without complex conjugation).
If both `a` and `b` are 2-D arrays, it is matrix multiplication.
If either `a` or `b` is 0-D (scalar), it is equivalent to multiply.
If `a` is a... | Returns the dot product of two arrays. | [
"Returns",
"the",
"dot",
"product",
"of",
"two",
"arrays",
"."
] | def dot(a, b):
"""
Returns the dot product of two arrays.
Specifically,
If both `a` and `b` are 1-D arrays, it is inner product of vectors
(without complex conjugation).
If both `a` and `b` are 2-D arrays, it is matrix multiplication.
If either `a` or `b` is 0-D (scalar), it is equivalent t... | [
"def",
"dot",
"(",
"a",
",",
"b",
")",
":",
"ndim_a",
",",
"ndim_b",
"=",
"F",
".",
"rank",
"(",
"a",
")",
",",
"F",
".",
"rank",
"(",
"b",
")",
"if",
"ndim_a",
"==",
"0",
"or",
"ndim_b",
"==",
"0",
":",
"return",
"F",
".",
"tensor_mul",
"(... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/math_ops.py#L693-L754 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | StockGDI.GetFont | (*args, **kwargs) | return _gdi_.StockGDI_GetFont(*args, **kwargs) | GetFont(self, int item) -> Font | GetFont(self, int item) -> Font | [
"GetFont",
"(",
"self",
"int",
"item",
")",
"-",
">",
"Font"
] | def GetFont(*args, **kwargs):
"""GetFont(self, int item) -> Font"""
return _gdi_.StockGDI_GetFont(*args, **kwargs) | [
"def",
"GetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"StockGDI_GetFont",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L6887-L6889 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py | python | ParserElement.__rxor__ | (self, other ) | return other ^ self | Implementation of ^ operator when left operand is not a C{L{ParserElement}} | Implementation of ^ operator when left operand is not a C{L{ParserElement}} | [
"Implementation",
"of",
"^",
"operator",
"when",
"left",
"operand",
"is",
"not",
"a",
"C",
"{",
"L",
"{",
"ParserElement",
"}}"
] | def __rxor__(self, other ):
"""
Implementation of ^ operator when left operand is not a C{L{ParserElement}}
"""
if isinstance( other, basestring ):
other = ParserElement._literalStringClass( other )
if not isinstance( other, ParserElement ):
warnings.warn(... | [
"def",
"__rxor__",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"basestring",
")",
":",
"other",
"=",
"ParserElement",
".",
"_literalStringClass",
"(",
"other",
")",
"if",
"not",
"isinstance",
"(",
"other",
",",
"ParserElemen... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py#L1985-L1995 | |
zhaoweicai/mscnn | 534bcac5710a579d60827f192035f7eef6d8c585 | python/caffe/pycaffe.py | python | _Net_forward_backward_all | (self, blobs=None, diffs=None, **kwargs) | return all_outs, all_diffs | Run net forward + backward in batches.
Parameters
----------
blobs: list of blobs to extract as in forward()
diffs: list of diffs to extract as in backward()
kwargs: Keys are input (for forward) and output (for backward) blob names
and values are ndarrays. Refer to forward() and backwar... | Run net forward + backward in batches. | [
"Run",
"net",
"forward",
"+",
"backward",
"in",
"batches",
"."
] | def _Net_forward_backward_all(self, blobs=None, diffs=None, **kwargs):
"""
Run net forward + backward in batches.
Parameters
----------
blobs: list of blobs to extract as in forward()
diffs: list of diffs to extract as in backward()
kwargs: Keys are input (for forward) and output (for backw... | [
"def",
"_Net_forward_backward_all",
"(",
"self",
",",
"blobs",
"=",
"None",
",",
"diffs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# Batch blobs and diffs.",
"all_outs",
"=",
"{",
"out",
":",
"[",
"]",
"for",
"out",
"in",
"set",
"(",
"self",
".... | https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/python/caffe/pycaffe.py#L206-L248 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/mavlink_px4.py | python | MAVLink.send | (self, mavmsg) | send a MAVLink message | send a MAVLink message | [
"send",
"a",
"MAVLink",
"message"
] | def send(self, mavmsg):
'''send a MAVLink message'''
buf = mavmsg.pack(self)
self.file.write(buf)
self.seq = (self.seq + 1) % 255
self.total_packets_sent += 1
self.total_bytes_sent += len(buf) | [
"def",
"send",
"(",
"self",
",",
"mavmsg",
")",
":",
"buf",
"=",
"mavmsg",
".",
"pack",
"(",
"self",
")",
"self",
".",
"file",
".",
"write",
"(",
"buf",
")",
"self",
".",
"seq",
"=",
"(",
"self",
".",
"seq",
"+",
"1",
")",
"%",
"255",
"self",... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/mavlink_px4.py#L2259-L2265 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typing/context.py | python | CallStack.match | (self, py_func, args) | Returns first function that matches *py_func* and the arguments types in
*args*; or, None if no match. | Returns first function that matches *py_func* and the arguments types in
*args*; or, None if no match. | [
"Returns",
"first",
"function",
"that",
"matches",
"*",
"py_func",
"*",
"and",
"the",
"arguments",
"types",
"in",
"*",
"args",
"*",
";",
"or",
"None",
"if",
"no",
"match",
"."
] | def match(self, py_func, args):
"""
Returns first function that matches *py_func* and the arguments types in
*args*; or, None if no match.
"""
for frame in self.finditer(py_func):
if frame.args == args:
return frame | [
"def",
"match",
"(",
"self",
",",
"py_func",
",",
"args",
")",
":",
"for",
"frame",
"in",
"self",
".",
"finditer",
"(",
"py_func",
")",
":",
"if",
"frame",
".",
"args",
"==",
"args",
":",
"return",
"frame"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typing/context.py#L95-L102 | ||
RegrowthStudios/SoACode-Public | c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe | utils/git-hooks/cpplint/cpplint.py | python | _FunctionState.Check | (self, error, filename, linenum) | Report if too many lines in function body.
Args:
error: The function to call with any errors found.
filename: The name of the current file.
linenum: The number of the line to check. | Report if too many lines in function body. | [
"Report",
"if",
"too",
"many",
"lines",
"in",
"function",
"body",
"."
] | def Check(self, error, filename, linenum):
"""Report if too many lines in function body.
Args:
error: The function to call with any errors found.
filename: The name of the current file.
linenum: The number of the line to check.
"""
if Match(r'T(EST|est)', self.current_function):
... | [
"def",
"Check",
"(",
"self",
",",
"error",
",",
"filename",
",",
"linenum",
")",
":",
"if",
"Match",
"(",
"r'T(EST|est)'",
",",
"self",
".",
"current_function",
")",
":",
"base_trigger",
"=",
"self",
".",
"_TEST_TRIGGER",
"else",
":",
"base_trigger",
"=",
... | https://github.com/RegrowthStudios/SoACode-Public/blob/c3ddd69355b534d5e70e2e6d0c489b4e93ab1ffe/utils/git-hooks/cpplint/cpplint.py#L660-L683 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.