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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/tools/grokdump.py | python | InspectionPadawan.__getattr__ | (self, name) | return getattr(self.heap, name) | An InspectionPadawan can be used instead of V8Heap, even though
it does not inherit from V8Heap (aka. mixin). | An InspectionPadawan can be used instead of V8Heap, even though
it does not inherit from V8Heap (aka. mixin). | [
"An",
"InspectionPadawan",
"can",
"be",
"used",
"instead",
"of",
"V8Heap",
"even",
"though",
"it",
"does",
"not",
"inherit",
"from",
"V8Heap",
"(",
"aka",
".",
"mixin",
")",
"."
] | def __getattr__(self, name):
"""An InspectionPadawan can be used instead of V8Heap, even though
it does not inherit from V8Heap (aka. mixin)."""
return getattr(self.heap, name) | [
"def",
"__getattr__",
"(",
"self",
",",
"name",
")",
":",
"return",
"getattr",
"(",
"self",
".",
"heap",
",",
"name",
")"
] | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/tools/grokdump.py#L1934-L1937 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/telemetry/core/platform/posix_platform_backend.py | python | PosixPlatformBackend.GetChildPids | (self, pid) | return ps_util.GetChildPids(processes, pid) | Returns a list of child pids of |pid|. | Returns a list of child pids of |pid|. | [
"Returns",
"a",
"list",
"of",
"child",
"pids",
"of",
"|pid|",
"."
] | def GetChildPids(self, pid):
"""Returns a list of child pids of |pid|."""
ps_output = self._GetPsOutput(['pid', 'ppid', 'state'])
ps_line_re = re.compile(
'\s*(?P<pid>\d+)\s*(?P<ppid>\d+)\s*(?P<state>\S*)\s*')
processes = []
for pid_ppid_state in ps_output:
m = ps_line_re.match(pid_ppi... | [
"def",
"GetChildPids",
"(",
"self",
",",
"pid",
")",
":",
"ps_output",
"=",
"self",
".",
"_GetPsOutput",
"(",
"[",
"'pid'",
",",
"'ppid'",
",",
"'state'",
"]",
")",
"ps_line_re",
"=",
"re",
".",
"compile",
"(",
"'\\s*(?P<pid>\\d+)\\s*(?P<ppid>\\d+)\\s*(?P<stat... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/platform/posix_platform_backend.py#L43-L53 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/feature_extraction/text.py | python | CountVectorizer.transform | (self, raw_documents) | return X | Transform documents to document-term matrix.
Extract token counts out of raw text documents using the vocabulary
fitted with fit or the one provided to the constructor.
Parameters
----------
raw_documents : iterable
An iterable which yields either str, unicode or fi... | Transform documents to document-term matrix. | [
"Transform",
"documents",
"to",
"document",
"-",
"term",
"matrix",
"."
] | def transform(self, raw_documents):
"""Transform documents to document-term matrix.
Extract token counts out of raw text documents using the vocabulary
fitted with fit or the one provided to the constructor.
Parameters
----------
raw_documents : iterable
An ... | [
"def",
"transform",
"(",
"self",
",",
"raw_documents",
")",
":",
"if",
"isinstance",
"(",
"raw_documents",
",",
"str",
")",
":",
"raise",
"ValueError",
"(",
"\"Iterable over raw text documents expected, \"",
"\"string object received.\"",
")",
"self",
".",
"_check_voc... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/feature_extraction/text.py#L1247-L1273 | |
D-X-Y/caffe-faster-rcnn | eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb | scripts/cpp_lint.py | python | CleanseRawStrings | (raw_lines) | return lines_without_raw_strings | Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Returns:
list of lines with C++11 raw str... | Removes C++11 raw strings from lines. | [
"Removes",
"C",
"++",
"11",
"raw",
"strings",
"from",
"lines",
"."
] | def CleanseRawStrings(raw_lines):
"""Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Return... | [
"def",
"CleanseRawStrings",
"(",
"raw_lines",
")",
":",
"delimiter",
"=",
"None",
"lines_without_raw_strings",
"=",
"[",
"]",
"for",
"line",
"in",
"raw_lines",
":",
"if",
"delimiter",
":",
"# Inside a raw string, look for the end",
"end",
"=",
"line",
".",
"find",... | https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/scripts/cpp_lint.py#L1066-L1124 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/javascripttokenizer.py | python | JavaScriptTokenizer.__init__ | (self, parse_js_doc=True) | Create a tokenizer object.
Args:
parse_js_doc: Whether to do detailed parsing of javascript doc comments,
or simply treat them as normal comments. Defaults to parsing JsDoc. | Create a tokenizer object. | [
"Create",
"a",
"tokenizer",
"object",
"."
] | def __init__(self, parse_js_doc=True):
"""Create a tokenizer object.
Args:
parse_js_doc: Whether to do detailed parsing of javascript doc comments,
or simply treat them as normal comments. Defaults to parsing JsDoc.
"""
matchers = self.BuildMatchers()
if not parse_js_doc:
# M... | [
"def",
"__init__",
"(",
"self",
",",
"parse_js_doc",
"=",
"True",
")",
":",
"matchers",
"=",
"self",
".",
"BuildMatchers",
"(",
")",
"if",
"not",
"parse_js_doc",
":",
"# Make a copy so the original doesn't get modified.",
"matchers",
"=",
"copy",
".",
"deepcopy",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/javascripttokenizer.py#L435-L450 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/usb_gadget/gadget.py | python | Gadget.ClassControlWrite | (self, recipient, request, value, index, data) | return None | Handle class-specific control transfers.
This function should be overridden by a subclass implementing a particular
device class.
Args:
recipient: Request recipient (device, interface, endpoint, etc.)
request: bRequest field of the setup packet.
value: wValue field of the setup packet.
... | Handle class-specific control transfers. | [
"Handle",
"class",
"-",
"specific",
"control",
"transfers",
"."
] | def ClassControlWrite(self, recipient, request, value, index, data):
"""Handle class-specific control transfers.
This function should be overridden by a subclass implementing a particular
device class.
Args:
recipient: Request recipient (device, interface, endpoint, etc.)
request: bRequest... | [
"def",
"ClassControlWrite",
"(",
"self",
",",
"recipient",
",",
"request",
",",
"value",
",",
"index",
",",
"data",
")",
":",
"_",
"=",
"recipient",
",",
"request",
",",
"value",
",",
"index",
",",
"data",
"return",
"None"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/usb_gadget/gadget.py#L368-L385 | |
facebook/proxygen | a9ca025af207787815cb01eee1971cd572c7a81e | build/fbcode_builder/getdeps/fetcher.py | python | get_fbsource_repo_data | (build_options) | return cached_data | Returns the commit metadata for the fbsource repo.
Since we may have multiple first party projects to
hash, and because we don't mutate the repo, we cache
this hash in a global. | Returns the commit metadata for the fbsource repo.
Since we may have multiple first party projects to
hash, and because we don't mutate the repo, we cache
this hash in a global. | [
"Returns",
"the",
"commit",
"metadata",
"for",
"the",
"fbsource",
"repo",
".",
"Since",
"we",
"may",
"have",
"multiple",
"first",
"party",
"projects",
"to",
"hash",
"and",
"because",
"we",
"don",
"t",
"mutate",
"the",
"repo",
"we",
"cache",
"this",
"hash",... | def get_fbsource_repo_data(build_options):
"""Returns the commit metadata for the fbsource repo.
Since we may have multiple first party projects to
hash, and because we don't mutate the repo, we cache
this hash in a global."""
cached_data = FBSOURCE_REPO_DATA.get(build_options.fbsource_dir)
if c... | [
"def",
"get_fbsource_repo_data",
"(",
"build_options",
")",
":",
"cached_data",
"=",
"FBSOURCE_REPO_DATA",
".",
"get",
"(",
"build_options",
".",
"fbsource_dir",
")",
"if",
"cached_data",
":",
"return",
"cached_data",
"cmd",
"=",
"[",
"\"hg\"",
",",
"\"log\"",
"... | https://github.com/facebook/proxygen/blob/a9ca025af207787815cb01eee1971cd572c7a81e/build/fbcode_builder/getdeps/fetcher.py#L532-L558 | |
networkit/networkit | 695b7a786a894a303fa8587597d5ef916e797729 | networkit/gephi/streaming.py | python | GephiStreamingClient.exportNodeValues | (self, graph, values, attribute_name) | This method exports node values (e.g. community information, betwenness centrality values)
to gephi using the Gephi Streaming Plugin. Use exportGraph(Graph) first to export
the graph itself.
Parameters:
-----------
values: python list or Partition object that contains the values... | This method exports node values (e.g. community information, betwenness centrality values)
to gephi using the Gephi Streaming Plugin. Use exportGraph(Graph) first to export
the graph itself. | [
"This",
"method",
"exports",
"node",
"values",
"(",
"e",
".",
"g",
".",
"community",
"information",
"betwenness",
"centrality",
"values",
")",
"to",
"gephi",
"using",
"the",
"Gephi",
"Streaming",
"Plugin",
".",
"Use",
"exportGraph",
"(",
"Graph",
")",
"first... | def exportNodeValues(self, graph, values, attribute_name):
"""
This method exports node values (e.g. community information, betwenness centrality values)
to gephi using the Gephi Streaming Plugin. Use exportGraph(Graph) first to export
the graph itself.
Parameters:
-----... | [
"def",
"exportNodeValues",
"(",
"self",
",",
"graph",
",",
"values",
",",
"attribute_name",
")",
":",
"try",
":",
"if",
"len",
"(",
"values",
")",
"!=",
"graph",
".",
"numberOfNodes",
"(",
")",
":",
"print",
"(",
"\"Warning: #Nodes (\"",
",",
"graph",
".... | https://github.com/networkit/networkit/blob/695b7a786a894a303fa8587597d5ef916e797729/networkit/gephi/streaming.py#L135-L157 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/outwin.py | python | OutputWindow.goto_file_line | (self, event=None) | Handle request to open file/line.
If the selected or previous line in the output window
contains a file name and line number, then open that file
name in a new window and position on the line number.
Otherwise, display an error messagebox. | Handle request to open file/line. | [
"Handle",
"request",
"to",
"open",
"file",
"/",
"line",
"."
] | def goto_file_line(self, event=None):
"""Handle request to open file/line.
If the selected or previous line in the output window
contains a file name and line number, then open that file
name in a new window and position on the line number.
Otherwise, display an error messagebo... | [
"def",
"goto_file_line",
"(",
"self",
",",
"event",
"=",
"None",
")",
":",
"line",
"=",
"self",
".",
"text",
".",
"get",
"(",
"\"insert linestart\"",
",",
"\"insert lineend\"",
")",
"result",
"=",
"file_line_helper",
"(",
"line",
")",
"if",
"not",
"result"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/outwin.py#L132-L157 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBDebugger.GetDefaultCategory | (self) | return _lldb.SBDebugger_GetDefaultCategory(self) | GetDefaultCategory(SBDebugger self) -> SBTypeCategory | GetDefaultCategory(SBDebugger self) -> SBTypeCategory | [
"GetDefaultCategory",
"(",
"SBDebugger",
"self",
")",
"-",
">",
"SBTypeCategory"
] | def GetDefaultCategory(self):
"""GetDefaultCategory(SBDebugger self) -> SBTypeCategory"""
return _lldb.SBDebugger_GetDefaultCategory(self) | [
"def",
"GetDefaultCategory",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBDebugger_GetDefaultCategory",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L4262-L4264 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/special/basic.py | python | pbdv_seq | (v, x) | return dv[:n1+1], dp[:n1+1] | Parabolic cylinder functions Dv(x) and derivatives.
Parameters
----------
v : float
Order of the parabolic cylinder function
x : float
Value at which to evaluate the function and derivatives
Returns
-------
dv : ndarray
Values of D_vi(x), for vi=v-int(v), vi=1+v-int... | Parabolic cylinder functions Dv(x) and derivatives. | [
"Parabolic",
"cylinder",
"functions",
"Dv",
"(",
"x",
")",
"and",
"derivatives",
"."
] | def pbdv_seq(v, x):
"""Parabolic cylinder functions Dv(x) and derivatives.
Parameters
----------
v : float
Order of the parabolic cylinder function
x : float
Value at which to evaluate the function and derivatives
Returns
-------
dv : ndarray
Values of D_vi(x), ... | [
"def",
"pbdv_seq",
"(",
"v",
",",
"x",
")",
":",
"if",
"not",
"(",
"isscalar",
"(",
"v",
")",
"and",
"isscalar",
"(",
"x",
")",
")",
":",
"raise",
"ValueError",
"(",
"\"arguments must be scalars.\"",
")",
"n",
"=",
"int",
"(",
"v",
")",
"v0",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/special/basic.py#L1774-L1808 | |
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/sdk.py | python | SDKDefinition.find_sdk_dir | (self) | return sdk_dir | Try to find the MS SDK from the registry.
Return None if failed or the directory does not exist. | Try to find the MS SDK from the registry. | [
"Try",
"to",
"find",
"the",
"MS",
"SDK",
"from",
"the",
"registry",
"."
] | def find_sdk_dir(self):
"""Try to find the MS SDK from the registry.
Return None if failed or the directory does not exist.
"""
if not SCons.Util.can_read_reg:
debug('find_sdk_dir(): can not read registry')
return None
hkey = self.HKEY_FMT % self.hkey_da... | [
"def",
"find_sdk_dir",
"(",
"self",
")",
":",
"if",
"not",
"SCons",
".",
"Util",
".",
"can_read_reg",
":",
"debug",
"(",
"'find_sdk_dir(): can not read registry'",
")",
"return",
"None",
"hkey",
"=",
"self",
".",
"HKEY_FMT",
"%",
"self",
".",
"hkey_data",
"d... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/MSCommon/sdk.py#L69-L98 | |
tpfister/caffe-heatmap | 4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e | scripts/cpp_lint.py | python | RemoveMultiLineCommentsFromRange | (lines, begin, end) | Clears a range of lines for multi-line comments. | Clears a range of lines for multi-line comments. | [
"Clears",
"a",
"range",
"of",
"lines",
"for",
"multi",
"-",
"line",
"comments",
"."
] | def RemoveMultiLineCommentsFromRange(lines, begin, end):
"""Clears a range of lines for multi-line comments."""
# Having // dummy comments makes the lines non-empty, so we will not get
# unnecessary blank line warnings later in the code.
for i in range(begin, end):
lines[i] = '// dummy' | [
"def",
"RemoveMultiLineCommentsFromRange",
"(",
"lines",
",",
"begin",
",",
"end",
")",
":",
"# Having // dummy comments makes the lines non-empty, so we will not get",
"# unnecessary blank line warnings later in the code.",
"for",
"i",
"in",
"range",
"(",
"begin",
",",
"end",
... | https://github.com/tpfister/caffe-heatmap/blob/4db69ef53e6b8a0b3b4ebb29328b0ab3dbf67c4e/scripts/cpp_lint.py#L1143-L1148 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleControl.py | python | CWSCDReductionControl.has_peak_info | (self, exp_number, scan_number, pt_number=None) | return p_key in self._myPeakInfoDict | Check whether there is a peak found...
:param exp_number:
:param scan_number:
:param pt_number:
:return: | Check whether there is a peak found...
:param exp_number:
:param scan_number:
:param pt_number:
:return: | [
"Check",
"whether",
"there",
"is",
"a",
"peak",
"found",
"...",
":",
"param",
"exp_number",
":",
":",
"param",
"scan_number",
":",
":",
"param",
"pt_number",
":",
":",
"return",
":"
] | def has_peak_info(self, exp_number, scan_number, pt_number=None):
""" Check whether there is a peak found...
:param exp_number:
:param scan_number:
:param pt_number:
:return:
"""
# Check for type
assert isinstance(exp_number, int)
assert isinstance... | [
"def",
"has_peak_info",
"(",
"self",
",",
"exp_number",
",",
"scan_number",
",",
"pt_number",
"=",
"None",
")",
":",
"# Check for type",
"assert",
"isinstance",
"(",
"exp_number",
",",
"int",
")",
"assert",
"isinstance",
"(",
"scan_number",
",",
"int",
")",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleControl.py#L1626-L1644 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/adidas_utils/games/gamut.py | python | GAMUT.__init__ | (self, config_list, java_path='', seed=None) | Ctor. Inits payoff tensor (players x actions x ... np.array).
Args:
config_list: a list or strings alternating between gamut flags and values
see http://gamut.stanford.edu/userdoc.pdf for more information
e.g., config_list = ['-g', 'CovariantGame', '-players', '6',
... | Ctor. Inits payoff tensor (players x actions x ... np.array). | [
"Ctor",
".",
"Inits",
"payoff",
"tensor",
"(",
"players",
"x",
"actions",
"x",
"...",
"np",
".",
"array",
")",
"."
] | def __init__(self, config_list, java_path='', seed=None):
"""Ctor. Inits payoff tensor (players x actions x ... np.array).
Args:
config_list: a list or strings alternating between gamut flags and values
see http://gamut.stanford.edu/userdoc.pdf for more information
e.g., config_list = ['-... | [
"def",
"__init__",
"(",
"self",
",",
"config_list",
",",
"java_path",
"=",
"''",
",",
"seed",
"=",
"None",
")",
":",
"self",
".",
"pt",
"=",
"None",
"self",
".",
"config_list",
"=",
"config_list",
"self",
".",
"seed",
"=",
"seed",
"self",
".",
"rando... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/adidas_utils/games/gamut.py#L33-L73 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/stc.py | python | StyledTextCtrl.AutoCompGetSeparator | (*args, **kwargs) | return _stc.StyledTextCtrl_AutoCompGetSeparator(*args, **kwargs) | AutoCompGetSeparator(self) -> int
Retrieve the auto-completion list separator character. | AutoCompGetSeparator(self) -> int | [
"AutoCompGetSeparator",
"(",
"self",
")",
"-",
">",
"int"
] | def AutoCompGetSeparator(*args, **kwargs):
"""
AutoCompGetSeparator(self) -> int
Retrieve the auto-completion list separator character.
"""
return _stc.StyledTextCtrl_AutoCompGetSeparator(*args, **kwargs) | [
"def",
"AutoCompGetSeparator",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_AutoCompGetSeparator",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L3087-L3093 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/lib/sessions.py | python | FileSession.__len__ | (self) | return len([fname for fname in os.listdir(self.storage_path)
if (fname.startswith(self.SESSION_PREFIX)
and not fname.endswith(self.LOCK_SUFFIX))]) | Return the number of active sessions. | Return the number of active sessions. | [
"Return",
"the",
"number",
"of",
"active",
"sessions",
"."
] | def __len__(self):
"""Return the number of active sessions."""
return len([fname for fname in os.listdir(self.storage_path)
if (fname.startswith(self.SESSION_PREFIX)
and not fname.endswith(self.LOCK_SUFFIX))]) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"[",
"fname",
"for",
"fname",
"in",
"os",
".",
"listdir",
"(",
"self",
".",
"storage_path",
")",
"if",
"(",
"fname",
".",
"startswith",
"(",
"self",
".",
"SESSION_PREFIX",
")",
"and",
"no... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/sessions.py#L504-L508 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLIntegrateVanadium.py | python | DirectILLIntegrateVanadium.name | (self) | return 'DirectILLIntegrateVanadium' | Return the algorithm's name. | Return the algorithm's name. | [
"Return",
"the",
"algorithm",
"s",
"name",
"."
] | def name(self):
"""Return the algorithm's name."""
return 'DirectILLIntegrateVanadium' | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"'DirectILLIntegrateVanadium'"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLIntegrateVanadium.py#L31-L33 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | uCSIsBuhid | (code) | return ret | Check whether the character is part of Buhid UCS Block | Check whether the character is part of Buhid UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Buhid",
"UCS",
"Block"
] | def uCSIsBuhid(code):
"""Check whether the character is part of Buhid UCS Block """
ret = libxml2mod.xmlUCSIsBuhid(code)
return ret | [
"def",
"uCSIsBuhid",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsBuhid",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2176-L2179 | |
larroy/clearskies_core | 3574ddf0edc8555454c7044126e786a6c29444dc | tools/gyp/pylib/gyp/xcodeproj_file.py | python | XCConfigurationList.HasBuildSetting | (self, key) | return 1 | Determines the state of a build setting in all XCBuildConfiguration
child objects.
If all child objects have key in their build settings, and the value is the
same in all child objects, returns 1.
If no child objects have the key in their build settings, returns 0.
If some, but not all, child obj... | Determines the state of a build setting in all XCBuildConfiguration
child objects. | [
"Determines",
"the",
"state",
"of",
"a",
"build",
"setting",
"in",
"all",
"XCBuildConfiguration",
"child",
"objects",
"."
] | def HasBuildSetting(self, key):
"""Determines the state of a build setting in all XCBuildConfiguration
child objects.
If all child objects have key in their build settings, and the value is the
same in all child objects, returns 1.
If no child objects have the key in their build settings, returns ... | [
"def",
"HasBuildSetting",
"(",
"self",
",",
"key",
")",
":",
"has",
"=",
"None",
"value",
"=",
"None",
"for",
"configuration",
"in",
"self",
".",
"_properties",
"[",
"'buildConfigurations'",
"]",
":",
"configuration_has",
"=",
"configuration",
".",
"HasBuildSe... | https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/xcodeproj_file.py#L1615-L1647 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/idlelib/iomenu.py | python | IOBinding._decode | (self, two_lines, bytes) | return None, False | Create a Unicode string. | Create a Unicode string. | [
"Create",
"a",
"Unicode",
"string",
"."
] | def _decode(self, two_lines, bytes):
"Create a Unicode string."
chars = None
# Check presence of a UTF-8 signature first
if bytes.startswith(BOM_UTF8):
try:
chars = bytes[3:].decode("utf-8")
except UnicodeDecodeError:
# has UTF-8 si... | [
"def",
"_decode",
"(",
"self",
",",
"two_lines",
",",
"bytes",
")",
":",
"chars",
"=",
"None",
"# Check presence of a UTF-8 signature first",
"if",
"bytes",
".",
"startswith",
"(",
"BOM_UTF8",
")",
":",
"try",
":",
"chars",
"=",
"bytes",
"[",
"3",
":",
"]"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/iomenu.py#L248-L314 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/lib2to3/pytree.py | python | Base.clone | (self) | Return a cloned (deep) copy of self.
This must be implemented by the concrete subclass. | Return a cloned (deep) copy of self. | [
"Return",
"a",
"cloned",
"(",
"deep",
")",
"copy",
"of",
"self",
"."
] | def clone(self):
"""
Return a cloned (deep) copy of self.
This must be implemented by the concrete subclass.
"""
raise NotImplementedError | [
"def",
"clone",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/lib2to3/pytree.py#L89-L95 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/xml/dom/minidom.py | python | ElementInfo.isId | (self, aname) | return False | Returns true iff the named attribte is a DTD-style ID. | Returns true iff the named attribte is a DTD-style ID. | [
"Returns",
"true",
"iff",
"the",
"named",
"attribte",
"is",
"a",
"DTD",
"-",
"style",
"ID",
"."
] | def isId(self, aname):
"""Returns true iff the named attribte is a DTD-style ID."""
return False | [
"def",
"isId",
"(",
"self",
",",
"aname",
")",
":",
"return",
"False"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/xml/dom/minidom.py#L1452-L1454 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py | python | captureWarnings | (capture) | If capture is true, redirect all warnings to the logging package.
If capture is False, ensure that warnings are not redirected to logging
but to their original destinations. | If capture is true, redirect all warnings to the logging package.
If capture is False, ensure that warnings are not redirected to logging
but to their original destinations. | [
"If",
"capture",
"is",
"true",
"redirect",
"all",
"warnings",
"to",
"the",
"logging",
"package",
".",
"If",
"capture",
"is",
"False",
"ensure",
"that",
"warnings",
"are",
"not",
"redirected",
"to",
"logging",
"but",
"to",
"their",
"original",
"destinations",
... | def captureWarnings(capture):
"""
If capture is true, redirect all warnings to the logging package.
If capture is False, ensure that warnings are not redirected to logging
but to their original destinations.
"""
global _warnings_showwarning
if capture:
if _warnings_showwarning is Non... | [
"def",
"captureWarnings",
"(",
"capture",
")",
":",
"global",
"_warnings_showwarning",
"if",
"capture",
":",
"if",
"_warnings_showwarning",
"is",
"None",
":",
"_warnings_showwarning",
"=",
"warnings",
".",
"showwarning",
"warnings",
".",
"showwarning",
"=",
"_showwa... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/logging/__init__.py#L2098-L2112 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/importIFClegacy.py | python | makeSpace | (entity,shape=None,name="Space") | makes a space in the freecad document | makes a space in the freecad document | [
"makes",
"a",
"space",
"in",
"the",
"freecad",
"document"
] | def makeSpace(entity,shape=None,name="Space"):
"makes a space in the freecad document"
try:
if shape:
# use ifcopenshell
if isinstance(shape,Part.Shape):
space = Arch.makeSpace(name=name)
space.Label = name
body = FreeCAD.ActiveDocu... | [
"def",
"makeSpace",
"(",
"entity",
",",
"shape",
"=",
"None",
",",
"name",
"=",
"\"Space\"",
")",
":",
"try",
":",
"if",
"shape",
":",
"# use ifcopenshell",
"if",
"isinstance",
"(",
"shape",
",",
"Part",
".",
"Shape",
")",
":",
"space",
"=",
"Arch",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/importIFClegacy.py#L600-L615 | ||
projectchrono/chrono | 92015a8a6f84ef63ac8206a74e54a676251dcc89 | src/demos/python/chrono-tensorflow/PPO/train_serial.py | python | log_batch_stats | (observes, actions, advantages, disc_sum_rew, logger, episode) | Log various batch statistics | Log various batch statistics | [
"Log",
"various",
"batch",
"statistics"
] | def log_batch_stats(observes, actions, advantages, disc_sum_rew, logger, episode):
""" Log various batch statistics """
logger.log({'_mean_obs': np.mean(observes),
'_min_obs': np.min(observes),
'_max_obs': np.max(observes),
'_std_obs': np.mean(np.var(observes, axi... | [
"def",
"log_batch_stats",
"(",
"observes",
",",
"actions",
",",
"advantages",
",",
"disc_sum_rew",
",",
"logger",
",",
"episode",
")",
":",
"logger",
".",
"log",
"(",
"{",
"'_mean_obs'",
":",
"np",
".",
"mean",
"(",
"observes",
")",
",",
"'_min_obs'",
":... | https://github.com/projectchrono/chrono/blob/92015a8a6f84ef63ac8206a74e54a676251dcc89/src/demos/python/chrono-tensorflow/PPO/train_serial.py#L225-L244 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/optparse.py | python | OptionParser.disable_interspersed_args | (self) | Set parsing to stop on the first non-option. Use this if
you have a command processor which runs another command that
has options of its own and you want to make sure these options
don't get confused. | Set parsing to stop on the first non-option. Use this if
you have a command processor which runs another command that
has options of its own and you want to make sure these options
don't get confused. | [
"Set",
"parsing",
"to",
"stop",
"on",
"the",
"first",
"non",
"-",
"option",
".",
"Use",
"this",
"if",
"you",
"have",
"a",
"command",
"processor",
"which",
"runs",
"another",
"command",
"that",
"has",
"options",
"of",
"its",
"own",
"and",
"you",
"want",
... | def disable_interspersed_args(self):
"""Set parsing to stop on the first non-option. Use this if
you have a command processor which runs another command that
has options of its own and you want to make sure these options
don't get confused.
"""
self.allow_interspersed_arg... | [
"def",
"disable_interspersed_args",
"(",
"self",
")",
":",
"self",
".",
"allow_interspersed_args",
"=",
"False"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/optparse.py#L1290-L1296 | ||
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Wrapping/Python/vtkmodules/qt/QVTKRenderWindowInteractor.py | python | QVTKRenderWidgetConeExample | () | A simple example that uses the QVTKRenderWindowInteractor class. | A simple example that uses the QVTKRenderWindowInteractor class. | [
"A",
"simple",
"example",
"that",
"uses",
"the",
"QVTKRenderWindowInteractor",
"class",
"."
] | def QVTKRenderWidgetConeExample():
"""A simple example that uses the QVTKRenderWindowInteractor class."""
from vtkmodules.vtkFiltersSources import vtkConeSource
from vtkmodules.vtkRenderingCore import vtkActor, vtkPolyDataMapper, vtkRenderer
# load implementations for rendering and interaction factory ... | [
"def",
"QVTKRenderWidgetConeExample",
"(",
")",
":",
"from",
"vtkmodules",
".",
"vtkFiltersSources",
"import",
"vtkConeSource",
"from",
"vtkmodules",
".",
"vtkRenderingCore",
"import",
"vtkActor",
",",
"vtkPolyDataMapper",
",",
"vtkRenderer",
"# load implementations for ren... | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Wrapping/Python/vtkmodules/qt/QVTKRenderWindowInteractor.py#L584-L631 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/fcompiler/gnu.py | python | GnuFCompiler.gnu_version_match | (self, version_string) | Handle the different versions of GNU fortran compilers | Handle the different versions of GNU fortran compilers | [
"Handle",
"the",
"different",
"versions",
"of",
"GNU",
"fortran",
"compilers"
] | def gnu_version_match(self, version_string):
"""Handle the different versions of GNU fortran compilers"""
# Strip warning(s) that may be emitted by gfortran
while version_string.startswith('gfortran: warning'):
version_string = version_string[version_string.find('\n') + 1:]
... | [
"def",
"gnu_version_match",
"(",
"self",
",",
"version_string",
")",
":",
"# Strip warning(s) that may be emitted by gfortran",
"while",
"version_string",
".",
"startswith",
"(",
"'gfortran: warning'",
")",
":",
"version_string",
"=",
"version_string",
"[",
"version_string"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/fcompiler/gnu.py#L41-L83 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/core/numeric.py | python | asanyarray | (a, dtype=None, order=None) | return array(a, dtype, copy=False, order=order, subok=True) | Convert the input to an ndarray, but pass ndarray subclasses through.
Parameters
----------
a : array_like
Input data, in any form that can be converted to an array. This
includes scalars, lists, lists of tuples, tuples, tuples of tuples,
tuples of lists, and ndarrays.
dtype : ... | Convert the input to an ndarray, but pass ndarray subclasses through. | [
"Convert",
"the",
"input",
"to",
"an",
"ndarray",
"but",
"pass",
"ndarray",
"subclasses",
"through",
"."
] | def asanyarray(a, dtype=None, order=None):
"""
Convert the input to an ndarray, but pass ndarray subclasses through.
Parameters
----------
a : array_like
Input data, in any form that can be converted to an array. This
includes scalars, lists, lists of tuples, tuples, tuples of tupl... | [
"def",
"asanyarray",
"(",
"a",
",",
"dtype",
"=",
"None",
",",
"order",
"=",
"None",
")",
":",
"return",
"array",
"(",
"a",
",",
"dtype",
",",
"copy",
"=",
"False",
",",
"order",
"=",
"order",
",",
"subok",
"=",
"True",
")"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/numeric.py#L237-L287 | |
yun-liu/RCF | 91bfb054ad04187dbbe21e539e165ad9bd3ff00b | scripts/cpp_lint.py | python | _NestingState.UpdatePreprocessor | (self, line) | Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the following assumptions (good enough for most... | Update preprocessor stack. | [
"Update",
"preprocessor",
"stack",
"."
] | def UpdatePreprocessor(self, line):
"""Update preprocessor stack.
We need to handle preprocessors due to classes like this:
#ifdef SWIG
struct ResultDetailsPageElementExtensionPoint {
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
We make the ... | [
"def",
"UpdatePreprocessor",
"(",
"self",
",",
"line",
")",
":",
"if",
"Match",
"(",
"r'^\\s*#\\s*(if|ifdef|ifndef)\\b'",
",",
"line",
")",
":",
"# Beginning of #if block, save the nesting stack here. The saved",
"# stack will allow us to restore the parsing state in the #else cas... | https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L1948-L2002 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPMS_SIG_SCHEME_ECDSA.fromBytes | (buffer) | return TpmBuffer(buffer).createObj(TPMS_SIG_SCHEME_ECDSA) | Returns new TPMS_SIG_SCHEME_ECDSA object constructed from its
marshaled representation in the given byte buffer | Returns new TPMS_SIG_SCHEME_ECDSA object constructed from its
marshaled representation in the given byte buffer | [
"Returns",
"new",
"TPMS_SIG_SCHEME_ECDSA",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"byte",
"buffer"
] | def fromBytes(buffer):
""" Returns new TPMS_SIG_SCHEME_ECDSA object constructed from its
marshaled representation in the given byte buffer
"""
return TpmBuffer(buffer).createObj(TPMS_SIG_SCHEME_ECDSA) | [
"def",
"fromBytes",
"(",
"buffer",
")",
":",
"return",
"TpmBuffer",
"(",
"buffer",
")",
".",
"createObj",
"(",
"TPMS_SIG_SCHEME_ECDSA",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6482-L6486 | |
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Web/Python/paraview/web/protocols.py | python | ParaViewWebProxyManager.list | (self, viewId=None) | return proxyObj | Returns the current proxy list, specifying for each proxy it's
name, id, and parent (input) proxy id. A 'parent' of '0' means
the proxy has no input. | Returns the current proxy list, specifying for each proxy it's
name, id, and parent (input) proxy id. A 'parent' of '0' means
the proxy has no input. | [
"Returns",
"the",
"current",
"proxy",
"list",
"specifying",
"for",
"each",
"proxy",
"it",
"s",
"name",
"id",
"and",
"parent",
"(",
"input",
")",
"proxy",
"id",
".",
"A",
"parent",
"of",
"0",
"means",
"the",
"proxy",
"has",
"no",
"input",
"."
] | def list(self, viewId=None):
"""Returns the current proxy list, specifying for each proxy it's
name, id, and parent (input) proxy id. A 'parent' of '0' means
the proxy has no input.
"""
proxies = servermanager.ProxyManager().GetProxiesInGroup("sources")
viewProxy = self.... | [
"def",
"list",
"(",
"self",
",",
"viewId",
"=",
"None",
")",
":",
"proxies",
"=",
"servermanager",
".",
"ProxyManager",
"(",
")",
".",
"GetProxiesInGroup",
"(",
"\"sources\"",
")",
"viewProxy",
"=",
"self",
".",
"getView",
"(",
"viewId",
")",
"proxyObj",
... | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Web/Python/paraview/web/protocols.py#L3368-L3407 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/estimator/canned/dnn.py | python | DNNClassifier.__init__ | (self,
hidden_units,
feature_columns,
model_dir=None,
n_classes=2,
weight_column=None,
label_vocabulary=None,
optimizer='Adagrad',
activation_fn=nn.relu,
dropout=None,
in... | Initializes a `DNNClassifier` instance.
Args:
hidden_units: Iterable of number hidden units per layer. All layers are
fully connected. Ex. `[64, 32]` means first layer has 64 nodes and
second one has 32.
feature_columns: An iterable containing all the feature columns used by
the... | Initializes a `DNNClassifier` instance. | [
"Initializes",
"a",
"DNNClassifier",
"instance",
"."
] | def __init__(self,
hidden_units,
feature_columns,
model_dir=None,
n_classes=2,
weight_column=None,
label_vocabulary=None,
optimizer='Adagrad',
activation_fn=nn.relu,
dropout=None,
... | [
"def",
"__init__",
"(",
"self",
",",
"hidden_units",
",",
"feature_columns",
",",
"model_dir",
"=",
"None",
",",
"n_classes",
"=",
"2",
",",
"weight_column",
"=",
"None",
",",
"label_vocabulary",
"=",
"None",
",",
"optimizer",
"=",
"'Adagrad'",
",",
"activat... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/estimator/canned/dnn.py#L201-L273 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py | python | ParseException.explain | (exc, depth=16) | return '\n'.join(ret) | Method to take an exception and translate the Python internal traceback into a list
of the pyparsing expressions that caused the exception to be raised.
Parameters:
- exc - exception raised during parsing (need not be a ParseException, in support
of Python exceptions that might be ... | Method to take an exception and translate the Python internal traceback into a list
of the pyparsing expressions that caused the exception to be raised. | [
"Method",
"to",
"take",
"an",
"exception",
"and",
"translate",
"the",
"Python",
"internal",
"traceback",
"into",
"a",
"list",
"of",
"the",
"pyparsing",
"expressions",
"that",
"caused",
"the",
"exception",
"to",
"be",
"raised",
"."
] | def explain(exc, depth=16):
"""
Method to take an exception and translate the Python internal traceback into a list
of the pyparsing expressions that caused the exception to be raised.
Parameters:
- exc - exception raised during parsing (need not be a ParseException, in suppor... | [
"def",
"explain",
"(",
"exc",
",",
"depth",
"=",
"16",
")",
":",
"import",
"inspect",
"if",
"depth",
"is",
"None",
":",
"depth",
"=",
"sys",
".",
"getrecursionlimit",
"(",
")",
"ret",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"exc",
",",
"ParseBaseExce... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/pyparsing.py#L387-L453 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/minimum-time-to-collect-all-apples-in-a-tree.py | python | Solution.minTime | (self, n, edges, hasApple) | return 2*result[0] | :type n: int
:type edges: List[List[int]]
:type hasApple: List[bool]
:rtype: int | :type n: int
:type edges: List[List[int]]
:type hasApple: List[bool]
:rtype: int | [
":",
"type",
"n",
":",
"int",
":",
"type",
"edges",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"type",
"hasApple",
":",
"List",
"[",
"bool",
"]",
":",
"rtype",
":",
"int"
] | def minTime(self, n, edges, hasApple):
"""
:type n: int
:type edges: List[List[int]]
:type hasApple: List[bool]
:rtype: int
"""
graph = collections.defaultdict(list)
for u, v in edges:
graph[u].append(v)
graph[v].append(u)
... | [
"def",
"minTime",
"(",
"self",
",",
"n",
",",
"edges",
",",
"hasApple",
")",
":",
"graph",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"for",
"u",
",",
"v",
"in",
"edges",
":",
"graph",
"[",
"u",
"]",
".",
"append",
"(",
"v",
")",
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/minimum-time-to-collect-all-apples-in-a-tree.py#L8-L37 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextEvent.SetFoldLevelPrev | (*args, **kwargs) | return _stc.StyledTextEvent_SetFoldLevelPrev(*args, **kwargs) | SetFoldLevelPrev(self, int val) | SetFoldLevelPrev(self, int val) | [
"SetFoldLevelPrev",
"(",
"self",
"int",
"val",
")"
] | def SetFoldLevelPrev(*args, **kwargs):
"""SetFoldLevelPrev(self, int val)"""
return _stc.StyledTextEvent_SetFoldLevelPrev(*args, **kwargs) | [
"def",
"SetFoldLevelPrev",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextEvent_SetFoldLevelPrev",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L7062-L7064 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/entity_object/export/formats/modpack_info.py | python | ModpackInfo.add_author_group | (self, name, authors, description=None) | Adds an author with optional contact info.
:param name: Group or team name.
:type name: str
:param authors: List of author identifiers. These must match up
with subtable keys in the self.authors.
:type authors: list
:param description: Path to a file with... | Adds an author with optional contact info. | [
"Adds",
"an",
"author",
"with",
"optional",
"contact",
"info",
"."
] | def add_author_group(self, name, authors, description=None):
"""
Adds an author with optional contact info.
:param name: Group or team name.
:type name: str
:param authors: List of author identifiers. These must match up
with subtable keys in the self.aut... | [
"def",
"add_author_group",
"(",
"self",
",",
"name",
",",
"authors",
",",
"description",
"=",
"None",
")",
":",
"author_group",
"=",
"{",
"}",
"author_group",
"[",
"\"name\"",
"]",
"=",
"name",
"author_group",
"[",
"\"authors\"",
"]",
"=",
"authors",
"if",... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/export/formats/modpack_info.py#L83-L101 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/offline_debug/mi_validators.py | python | check_parameter_init | (method) | return new_method | Wrapper method to check the parameters of DbgServices Parameter init. | Wrapper method to check the parameters of DbgServices Parameter init. | [
"Wrapper",
"method",
"to",
"check",
"the",
"parameters",
"of",
"DbgServices",
"Parameter",
"init",
"."
] | def check_parameter_init(method):
"""Wrapper method to check the parameters of DbgServices Parameter init."""
@wraps(method)
def new_method(self, *args, **kwargs):
[name, disabled, value, hit, actual_value], _ = parse_user_args(method, *args, **kwargs)
type_check(name, (str,), "name")
... | [
"def",
"check_parameter_init",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"[",
"name",
",",
"disabled",
",",
"value",
",",
"hit",
",",
"actual_valu... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/offline_debug/mi_validators.py#L257-L272 | |
CoolProp/CoolProp | 381c8535e5dec3eec27ad430ebbfff8bc9dfc008 | dev/TTSE/TTSE_ranges.py | python | get_Z | (X_in, Y_in, fluid) | return False | Just a wrapper to call CoolProp | Just a wrapper to call CoolProp | [
"Just",
"a",
"wrapper",
"to",
"call",
"CoolProp"
] | def get_Z(X_in, Y_in, fluid):
'''
Just a wrapper to call CoolProp
'''
return False | [
"def",
"get_Z",
"(",
"X_in",
",",
"Y_in",
",",
"fluid",
")",
":",
"return",
"False"
] | https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/dev/TTSE/TTSE_ranges.py#L26-L30 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | armoryd.py | python | Armory_Json_Rpc_Server.jsonrpc_getnewaddress | (self) | return addr.getAddrStr() | DESCRIPTION:
Get a new Base58 address from the currently loaded wallet.
PARAMETERS:
None
RETURN:
The wallet's next unused public address in Base58 form. | DESCRIPTION:
Get a new Base58 address from the currently loaded wallet.
PARAMETERS:
None
RETURN:
The wallet's next unused public address in Base58 form. | [
"DESCRIPTION",
":",
"Get",
"a",
"new",
"Base58",
"address",
"from",
"the",
"currently",
"loaded",
"wallet",
".",
"PARAMETERS",
":",
"None",
"RETURN",
":",
"The",
"wallet",
"s",
"next",
"unused",
"public",
"address",
"in",
"Base58",
"form",
"."
] | def jsonrpc_getnewaddress(self):
"""
DESCRIPTION:
Get a new Base58 address from the currently loaded wallet.
PARAMETERS:
None
RETURN:
The wallet's next unused public address in Base58 form.
"""
addr = self.curWlt.getNextUnusedAddress()
return addr.getAddrStr(... | [
"def",
"jsonrpc_getnewaddress",
"(",
"self",
")",
":",
"addr",
"=",
"self",
".",
"curWlt",
".",
"getNextUnusedAddress",
"(",
")",
"return",
"addr",
".",
"getAddrStr",
"(",
")"
] | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryd.py#L859-L870 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/format.py | python | _write_array_header | (fp, d, version=None) | Write the header for an array and returns the version used
Parameters
----------
fp : filelike object
d : dict
This has the appropriate entries for writing its string representation
to the header of the file.
version: tuple or None
None means use oldest that works
ex... | Write the header for an array and returns the version used | [
"Write",
"the",
"header",
"for",
"an",
"array",
"and",
"returns",
"the",
"version",
"used"
] | def _write_array_header(fp, d, version=None):
""" Write the header for an array and returns the version used
Parameters
----------
fp : filelike object
d : dict
This has the appropriate entries for writing its string representation
to the header of the file.
version: tuple or No... | [
"def",
"_write_array_header",
"(",
"fp",
",",
"d",
",",
"version",
"=",
"None",
")",
":",
"header",
"=",
"[",
"\"{\"",
"]",
"for",
"key",
",",
"value",
"in",
"sorted",
"(",
"d",
".",
"items",
"(",
")",
")",
":",
"# Need to use repr here, since we eval th... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/format.py#L409-L434 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Wrapping/Python/paraview/simple.py | python | GetLookupTableForArray | (arrayname, num_components, **params) | return GetColorTransferFunction(arrayname, **params) | Used to get an existing lookuptable for a array or to create one if none
exists. Keyword arguments can be passed in to initialize the LUT if a new
one is created.
*** DEPRECATED ***: Use GetColorTransferFunction instead | Used to get an existing lookuptable for a array or to create one if none
exists. Keyword arguments can be passed in to initialize the LUT if a new
one is created.
*** DEPRECATED ***: Use GetColorTransferFunction instead | [
"Used",
"to",
"get",
"an",
"existing",
"lookuptable",
"for",
"a",
"array",
"or",
"to",
"create",
"one",
"if",
"none",
"exists",
".",
"Keyword",
"arguments",
"can",
"be",
"passed",
"in",
"to",
"initialize",
"the",
"LUT",
"if",
"a",
"new",
"one",
"is",
"... | def GetLookupTableForArray(arrayname, num_components, **params):
"""Used to get an existing lookuptable for a array or to create one if none
exists. Keyword arguments can be passed in to initialize the LUT if a new
one is created.
*** DEPRECATED ***: Use GetColorTransferFunction instead"""
return Ge... | [
"def",
"GetLookupTableForArray",
"(",
"arrayname",
",",
"num_components",
",",
"*",
"*",
"params",
")",
":",
"return",
"GetColorTransferFunction",
"(",
"arrayname",
",",
"*",
"*",
"params",
")"
] | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/simple.py#L1896-L1901 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/processing/modeler/ProjectProvider.py | python | ProjectProvider.clear | (self) | Remove all algorithms from the provider | Remove all algorithms from the provider | [
"Remove",
"all",
"algorithms",
"from",
"the",
"provider"
] | def clear(self):
"""
Remove all algorithms from the provider
"""
self.model_definitions = {}
self.refreshAlgorithms() | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"model_definitions",
"=",
"{",
"}",
"self",
".",
"refreshAlgorithms",
"(",
")"
] | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/processing/modeler/ProjectProvider.py#L65-L70 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/meta_optimizers/sharding/gradient_clip_helper.py | python | GradientClipHelper.prune_gradient_clip | (self, block, shard, ring_ids) | return | prune gradient_clip related ops for params that not belong to cur shard
prune: square, reduce_sum, elementwise_mul
keep: sum, sqrt, elementwise_max, elementwise_div | prune gradient_clip related ops for params that not belong to cur shard
prune: square, reduce_sum, elementwise_mul
keep: sum, sqrt, elementwise_max, elementwise_div | [
"prune",
"gradient_clip",
"related",
"ops",
"for",
"params",
"that",
"not",
"belong",
"to",
"cur",
"shard",
"prune",
":",
"square",
"reduce_sum",
"elementwise_mul",
"keep",
":",
"sum",
"sqrt",
"elementwise_max",
"elementwise_div"
] | def prune_gradient_clip(self, block, shard, ring_ids):
"""
prune gradient_clip related ops for params that not belong to cur shard
prune: square, reduce_sum, elementwise_mul
keep: sum, sqrt, elementwise_max, elementwise_div
"""
deperated_vars = set()
deperate_op_i... | [
"def",
"prune_gradient_clip",
"(",
"self",
",",
"block",
",",
"shard",
",",
"ring_ids",
")",
":",
"deperated_vars",
"=",
"set",
"(",
")",
"deperate_op_idx",
"=",
"set",
"(",
")",
"reversed_x_paramname",
"=",
"[",
"]",
"global_norm_sum_op_idx",
"=",
"-",
"1",... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/meta_optimizers/sharding/gradient_clip_helper.py#L28-L142 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | scripts/cpp_lint.py | python | _CppLintState.PrintErrorCounts | (self) | Print a summary of errors by category, and the total. | Print a summary of errors by category, and the total. | [
"Print",
"a",
"summary",
"of",
"errors",
"by",
"category",
"and",
"the",
"total",
"."
] | def PrintErrorCounts(self):
"""Print a summary of errors by category, and the total."""
for category, count in self.errors_by_category.iteritems():
sys.stderr.write('Category \'%s\' errors found: %d\n' %
(category, count))
sys.stderr.write('Total errors found: %d\n' % self.error... | [
"def",
"PrintErrorCounts",
"(",
"self",
")",
":",
"for",
"category",
",",
"count",
"in",
"self",
".",
"errors_by_category",
".",
"iteritems",
"(",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"'Category \\'%s\\' errors found: %d\\n'",
"%",
"(",
"category... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/scripts/cpp_lint.py#L757-L762 | ||
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/xcode_emulation.py | python | MacPrefixHeader.GetPchBuildCommands | (self, arch=None) | return [
(self._Gch('c', arch), '-x c-header', 'c', self.header),
(self._Gch('cc', arch), '-x c++-header', 'cc', self.header),
(self._Gch('m', arch), '-x objective-c-header', 'm', self.header),
(self._Gch('mm', arch), '-x objective-c++-header', 'mm', self.header),
] | Returns [(path_to_gch, language_flag, language, header)].
|path_to_gch| and |header| are relative to the build directory. | Returns [(path_to_gch, language_flag, language, header)].
|path_to_gch| and |header| are relative to the build directory. | [
"Returns",
"[",
"(",
"path_to_gch",
"language_flag",
"language",
"header",
")",
"]",
".",
"|path_to_gch|",
"and",
"|header|",
"are",
"relative",
"to",
"the",
"build",
"directory",
"."
] | def GetPchBuildCommands(self, arch=None):
"""Returns [(path_to_gch, language_flag, language, header)].
|path_to_gch| and |header| are relative to the build directory.
"""
if not self.header or not self.compile_headers:
return []
return [
(self._Gch('c', arch), '-x c-header', 'c', self.he... | [
"def",
"GetPchBuildCommands",
"(",
"self",
",",
"arch",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"header",
"or",
"not",
"self",
".",
"compile_headers",
":",
"return",
"[",
"]",
"return",
"[",
"(",
"self",
".",
"_Gch",
"(",
"'c'",
",",
"arch",... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/xcode_emulation.py#L1260-L1271 | |
yun-liu/RCF | 91bfb054ad04187dbbe21e539e165ad9bd3ff00b | scripts/cpp_lint.py | python | IsCppString | (line) | return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 | Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string constant. | Does line terminate so, that the next symbol is in string constant. | [
"Does",
"line",
"terminate",
"so",
"that",
"the",
"next",
"symbol",
"is",
"in",
"string",
"constant",
"."
] | def IsCppString(line):
"""Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string c... | [
"def",
"IsCppString",
"(",
"line",
")",
":",
"line",
"=",
"line",
".",
"replace",
"(",
"r'\\\\'",
",",
"'XX'",
")",
"# after this, \\\\\" does not match to \\\"",
"return",
"(",
"(",
"line",
".",
"count",
"(",
"'\"'",
")",
"-",
"line",
".",
"count",
"(",
... | https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L1045-L1059 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/rcnn/rcnn/cython/setup.py | python | find_in_path | (name, path) | return None | Find a file in a search path | Find a file in a search path | [
"Find",
"a",
"file",
"in",
"a",
"search",
"path"
] | def find_in_path(name, path):
"Find a file in a search path"
# Adapted fom
# http://code.activestate.com/recipes/52224-find-a-file-given-a-search-path/
for dir in path.split(os.pathsep):
binpath = pjoin(dir, name)
if os.path.exists(binpath):
return os.path.abspath(binpath)
... | [
"def",
"find_in_path",
"(",
"name",
",",
"path",
")",
":",
"# Adapted fom",
"# http://code.activestate.com/recipes/52224-find-a-file-given-a-search-path/",
"for",
"dir",
"in",
"path",
".",
"split",
"(",
"os",
".",
"pathsep",
")",
":",
"binpath",
"=",
"pjoin",
"(",
... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/rcnn/rcnn/cython/setup.py#L33-L41 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/datetime.py | python | time.minute | (self) | return self._minute | minute (0-59) | minute (0-59) | [
"minute",
"(",
"0",
"-",
"59",
")"
] | def minute(self):
"""minute (0-59)"""
return self._minute | [
"def",
"minute",
"(",
"self",
")",
":",
"return",
"self",
".",
"_minute"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/datetime.py#L1233-L1235 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/poplib.py | python | POP3.pass_ | (self, pswd) | return self._shortcmd('PASS %s' % pswd) | Send password, return response
(response includes message count, mailbox size).
NB: mailbox is locked by server from here to 'quit()' | Send password, return response | [
"Send",
"password",
"return",
"response"
] | def pass_(self, pswd):
"""Send password, return response
(response includes message count, mailbox size).
NB: mailbox is locked by server from here to 'quit()'
"""
return self._shortcmd('PASS %s' % pswd) | [
"def",
"pass_",
"(",
"self",
",",
"pswd",
")",
":",
"return",
"self",
".",
"_shortcmd",
"(",
"'PASS %s'",
"%",
"pswd",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/poplib.py#L182-L189 | |
xiaohaoChen/rrc_detection | 4f2b110cd122da7f55e8533275a9b4809a88785a | python/caffe/coord_map.py | python | crop_params | (fn) | return (axis, offset) | Extract the crop layer parameters with defaults. | Extract the crop layer parameters with defaults. | [
"Extract",
"the",
"crop",
"layer",
"parameters",
"with",
"defaults",
"."
] | def crop_params(fn):
"""
Extract the crop layer parameters with defaults.
"""
params = fn.params.get('crop_param', fn.params)
axis = params.get('axis', 2) # default to spatial crop for N, C, H, W
offset = np.array(params.get('offset', 0), ndmin=1)
return (axis, offset) | [
"def",
"crop_params",
"(",
"fn",
")",
":",
"params",
"=",
"fn",
".",
"params",
".",
"get",
"(",
"'crop_param'",
",",
"fn",
".",
"params",
")",
"axis",
"=",
"params",
".",
"get",
"(",
"'axis'",
",",
"2",
")",
"# default to spatial crop for N, C, H, W",
"o... | https://github.com/xiaohaoChen/rrc_detection/blob/4f2b110cd122da7f55e8533275a9b4809a88785a/python/caffe/coord_map.py#L40-L47 | |
cksystemsgroup/scalloc | 049857919b5fa1d539c9e4206e353daca2e87394 | tools/cpplint.py | python | _Filters | () | return _cpplint_state.filters | Returns the module's list of output filters, as a list. | Returns the module's list of output filters, as a list. | [
"Returns",
"the",
"module",
"s",
"list",
"of",
"output",
"filters",
"as",
"a",
"list",
"."
] | def _Filters():
"""Returns the module's list of output filters, as a list."""
return _cpplint_state.filters | [
"def",
"_Filters",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"filters"
] | https://github.com/cksystemsgroup/scalloc/blob/049857919b5fa1d539c9e4206e353daca2e87394/tools/cpplint.py#L780-L782 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | htmlIsBooleanAttr | (name) | return ret | Determine if a given attribute is a boolean attribute. | Determine if a given attribute is a boolean attribute. | [
"Determine",
"if",
"a",
"given",
"attribute",
"is",
"a",
"boolean",
"attribute",
"."
] | def htmlIsBooleanAttr(name):
"""Determine if a given attribute is a boolean attribute. """
ret = libxml2mod.htmlIsBooleanAttr(name)
return ret | [
"def",
"htmlIsBooleanAttr",
"(",
"name",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"htmlIsBooleanAttr",
"(",
"name",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L858-L861 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/tool/update_resource_ids/assigner.py | python | BaseCoarseIdAssigner.GenStartIds | (self) | Visits |_item_list| and yields (|item|, new |start_id|).
Visit follows dependency order: If item B succeeds item A, then A is visited
before B. Caller must call FeedWeight() to assign ID allotment. | Visits |_item_list| and yields (|item|, new |start_id|). | [
"Visits",
"|_item_list|",
"and",
"yields",
"(",
"|item|",
"new",
"|start_id|",
")",
"."
] | def GenStartIds(self):
"""Visits |_item_list| and yields (|item|, new |start_id|).
Visit follows dependency order: If item B succeeds item A, then A is visited
before B. Caller must call FeedWeight() to assign ID allotment.
"""
raise NotImplementedError() | [
"def",
"GenStartIds",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/tool/update_resource_ids/assigner.py#L65-L71 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGrid.SetUnspecifiedCommonValue | (*args, **kwargs) | return _propgrid.PropertyGrid_SetUnspecifiedCommonValue(*args, **kwargs) | SetUnspecifiedCommonValue(self, int index) | SetUnspecifiedCommonValue(self, int index) | [
"SetUnspecifiedCommonValue",
"(",
"self",
"int",
"index",
")"
] | def SetUnspecifiedCommonValue(*args, **kwargs):
"""SetUnspecifiedCommonValue(self, int index)"""
return _propgrid.PropertyGrid_SetUnspecifiedCommonValue(*args, **kwargs) | [
"def",
"SetUnspecifiedCommonValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_SetUnspecifiedCommonValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2336-L2338 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Runner.py | python | Parallel.refill_task_list | (self) | Put the next group of tasks to execute in :py:attr:`waflib.Runner.Parallel.outstanding`. | Put the next group of tasks to execute in :py:attr:`waflib.Runner.Parallel.outstanding`. | [
"Put",
"the",
"next",
"group",
"of",
"tasks",
"to",
"execute",
"in",
":",
"py",
":",
"attr",
":",
"waflib",
".",
"Runner",
".",
"Parallel",
".",
"outstanding",
"."
] | def refill_task_list(self):
"""
Put the next group of tasks to execute in :py:attr:`waflib.Runner.Parallel.outstanding`.
"""
while self.count > self.numjobs * GAP:
self.get_out()
while not self.outstanding:
if self.count:
self.get_out()
elif self.frozen:
try:
cond = self.deadlock == sel... | [
"def",
"refill_task_list",
"(",
"self",
")",
":",
"while",
"self",
".",
"count",
">",
"self",
".",
"numjobs",
"*",
"GAP",
":",
"self",
".",
"get_out",
"(",
")",
"while",
"not",
"self",
".",
"outstanding",
":",
"if",
"self",
".",
"count",
":",
"self",... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Runner.py#L166-L200 | ||
vesoft-inc/nebula | 25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35 | .linters/cpp/cpplint.py | python | CleansedLines._CollapseStrings | (elided) | return collapsed | Collapses strings and chars on a line to simple "" or '' blocks.
We nix strings first so we're not fooled by text like '"http://"'
Args:
elided: The line being processed.
Returns:
The line with collapsed strings. | Collapses strings and chars on a line to simple "" or '' blocks. | [
"Collapses",
"strings",
"and",
"chars",
"on",
"a",
"line",
"to",
"simple",
"or",
"blocks",
"."
] | def _CollapseStrings(elided):
"""Collapses strings and chars on a line to simple "" or '' blocks.
We nix strings first so we're not fooled by text like '"http://"'
Args:
elided: The line being processed.
Returns:
The line with collapsed strings.
"""
if _RE_PATTERN_INCLUDE.match(el... | [
"def",
"_CollapseStrings",
"(",
"elided",
")",
":",
"if",
"_RE_PATTERN_INCLUDE",
".",
"match",
"(",
"elided",
")",
":",
"return",
"elided",
"# Remove escaped characters first to make quote/single quote collapsing",
"# basic. Things that look like escaped characters shouldn't occur... | https://github.com/vesoft-inc/nebula/blob/25a06217ebaf169e1f0e5ff6a797ba6f0c41fc35/.linters/cpp/cpplint.py#L1677-L1741 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/third_party/requests/requests/cookies.py | python | RequestsCookieJar.keys | (self) | return keys | Dict-like keys() that returns a list of names of cookies from the jar.
See values() and items(). | Dict-like keys() that returns a list of names of cookies from the jar.
See values() and items(). | [
"Dict",
"-",
"like",
"keys",
"()",
"that",
"returns",
"a",
"list",
"of",
"names",
"of",
"cookies",
"from",
"the",
"jar",
".",
"See",
"values",
"()",
"and",
"items",
"()",
"."
] | def keys(self):
"""Dict-like keys() that returns a list of names of cookies from the jar.
See values() and items()."""
keys = []
for cookie in iter(self):
keys.append(cookie.name)
return keys | [
"def",
"keys",
"(",
"self",
")",
":",
"keys",
"=",
"[",
"]",
"for",
"cookie",
"in",
"iter",
"(",
"self",
")",
":",
"keys",
".",
"append",
"(",
"cookie",
".",
"name",
")",
"return",
"keys"
] | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/third_party/requests/requests/cookies.py#L190-L196 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/closure_linter/closure_linter/javascriptlintrules.py | python | JavaScriptLintRules.__ContainsRecordType | (self, token) | return (
token and token.type == Type.DOC_FLAG and
token.attached_object.type is not None and
token.attached_object.type.find('{') != token.string.rfind('{')) | Check whether the given token contains a record type.
Args:
token: The token being checked
Returns:
True if the token contains a record type, False otherwise. | Check whether the given token contains a record type. | [
"Check",
"whether",
"the",
"given",
"token",
"contains",
"a",
"record",
"type",
"."
] | def __ContainsRecordType(self, token):
"""Check whether the given token contains a record type.
Args:
token: The token being checked
Returns:
True if the token contains a record type, False otherwise.
"""
# If we see more than one left-brace in the string of an annotation token,
# ... | [
"def",
"__ContainsRecordType",
"(",
"self",
",",
"token",
")",
":",
"# If we see more than one left-brace in the string of an annotation token,",
"# then there's a record type in there.",
"return",
"(",
"token",
"and",
"token",
".",
"type",
"==",
"Type",
".",
"DOC_FLAG",
"a... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/javascriptlintrules.py#L62-L76 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/cubecolourdialog.py | python | CustomPanel.PaintHighlight | (self, dc, draw=True) | Highlight the current custom colour selection (if any).
:param `dc`: an instance of :class:`DC`;
:param `draw`: whether to draw a thin black border around the selected custom
colour or not. | Highlight the current custom colour selection (if any). | [
"Highlight",
"the",
"current",
"custom",
"colour",
"selection",
"(",
"if",
"any",
")",
"."
] | def PaintHighlight(self, dc, draw=True):
"""
Highlight the current custom colour selection (if any).
:param `dc`: an instance of :class:`DC`;
:param `draw`: whether to draw a thin black border around the selected custom
colour or not.
"""
if self._colourSelecti... | [
"def",
"PaintHighlight",
"(",
"self",
",",
"dc",
",",
"draw",
"=",
"True",
")",
":",
"if",
"self",
".",
"_colourSelection",
"<",
"0",
":",
"return",
"# Number of pixels bigger than the standard rectangle size",
"# for drawing a highlight",
"deltaX",
"=",
"deltaY",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L2771-L2800 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/image_ops_impl.py | python | resize_image_with_crop_or_pad | (image, target_height, target_width) | Crops and/or pads an image to a target width and height.
Resizes an image to a target width and height by either centrally
cropping the image or padding it evenly with zeros.
If `width` or `height` is greater than the specified `target_width` or
`target_height` respectively, this op centrally crops along that... | Crops and/or pads an image to a target width and height. | [
"Crops",
"and",
"/",
"or",
"pads",
"an",
"image",
"to",
"a",
"target",
"width",
"and",
"height",
"."
] | def resize_image_with_crop_or_pad(image, target_height, target_width):
"""Crops and/or pads an image to a target width and height.
Resizes an image to a target width and height by either centrally
cropping the image or padding it evenly with zeros.
If `width` or `height` is greater than the specified `target_... | [
"def",
"resize_image_with_crop_or_pad",
"(",
"image",
",",
"target_height",
",",
"target_width",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"None",
",",
"'resize_image_with_crop_or_pad'",
",",
"[",
"image",
"]",
")",
":",
"image",
"=",
"ops",
".",
"conve... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/image_ops_impl.py#L892-L1005 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/route53/record.py | python | Record.set_alias | (self, alias_hosted_zone_id, alias_dns_name,
alias_evaluate_target_health=False) | Make this an alias resource record set | Make this an alias resource record set | [
"Make",
"this",
"an",
"alias",
"resource",
"record",
"set"
] | def set_alias(self, alias_hosted_zone_id, alias_dns_name,
alias_evaluate_target_health=False):
"""Make this an alias resource record set"""
self.alias_hosted_zone_id = alias_hosted_zone_id
self.alias_dns_name = alias_dns_name
self.alias_evaluate_target_health = alias_ev... | [
"def",
"set_alias",
"(",
"self",
",",
"alias_hosted_zone_id",
",",
"alias_dns_name",
",",
"alias_evaluate_target_health",
"=",
"False",
")",
":",
"self",
".",
"alias_hosted_zone_id",
"=",
"alias_hosted_zone_id",
"self",
".",
"alias_dns_name",
"=",
"alias_dns_name",
"s... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/route53/record.py#L271-L276 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | build/automationutils.py | python | dumpLeakLog | (leakLogFile, filter = False) | Process the leak log, without parsing it.
Use this function if you want the raw log only.
Use it preferably with the |XPCOM_MEM_LEAK_LOG| environment variable. | Process the leak log, without parsing it. | [
"Process",
"the",
"leak",
"log",
"without",
"parsing",
"it",
"."
] | def dumpLeakLog(leakLogFile, filter = False):
"""Process the leak log, without parsing it.
Use this function if you want the raw log only.
Use it preferably with the |XPCOM_MEM_LEAK_LOG| environment variable.
"""
# Don't warn (nor "info") if the log file is not there.
if not os.path.exists(leakLogFile):
... | [
"def",
"dumpLeakLog",
"(",
"leakLogFile",
",",
"filter",
"=",
"False",
")",
":",
"# Don't warn (nor \"info\") if the log file is not there.",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"leakLogFile",
")",
":",
"return",
"with",
"open",
"(",
"leakLogFile",... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/automationutils.py#L177-L197 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | TextAttr_CombineBitlists | (*args, **kwargs) | return _controls_.TextAttr_CombineBitlists(*args, **kwargs) | TextAttr_CombineBitlists(int valueA, int valueB, int flagsA, int flagsB) -> bool | TextAttr_CombineBitlists(int valueA, int valueB, int flagsA, int flagsB) -> bool | [
"TextAttr_CombineBitlists",
"(",
"int",
"valueA",
"int",
"valueB",
"int",
"flagsA",
"int",
"flagsB",
")",
"-",
">",
"bool"
] | def TextAttr_CombineBitlists(*args, **kwargs):
"""TextAttr_CombineBitlists(int valueA, int valueB, int flagsA, int flagsB) -> bool"""
return _controls_.TextAttr_CombineBitlists(*args, **kwargs) | [
"def",
"TextAttr_CombineBitlists",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_CombineBitlists",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1996-L1998 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column.py | python | _LazyBuilder._get_raw_feature_as_tensor | (self, key) | Gets the raw_feature (keyed by `key`) as `tensor`.
The raw feature is converted to (sparse) tensor and maybe expand dim.
For both `Tensor` and `SparseTensor`, the rank will be expanded (to 2) if
the rank is 1. This supports dynamic rank also. For rank 0 raw feature, will
error out as it is not support... | Gets the raw_feature (keyed by `key`) as `tensor`. | [
"Gets",
"the",
"raw_feature",
"(",
"keyed",
"by",
"key",
")",
"as",
"tensor",
"."
] | def _get_raw_feature_as_tensor(self, key):
"""Gets the raw_feature (keyed by `key`) as `tensor`.
The raw feature is converted to (sparse) tensor and maybe expand dim.
For both `Tensor` and `SparseTensor`, the rank will be expanded (to 2) if
the rank is 1. This supports dynamic rank also. For rank 0 ra... | [
"def",
"_get_raw_feature_as_tensor",
"(",
"self",
",",
"key",
")",
":",
"raw_feature",
"=",
"self",
".",
"_features",
"[",
"key",
"]",
"feature_tensor",
"=",
"sparse_tensor_lib",
".",
"convert_to_tensor_or_sparse_tensor",
"(",
"raw_feature",
")",
"def",
"expand_dims... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column.py#L2164-L2211 | ||
moflow/moflow | 2dfb27c799c90c6caf1477508eca3eec616ef7d2 | bap/libtracewrap/libtrace/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool._ExtractMessages | (self, desc_protos) | Pulls out all the message protos from descriptos.
Args:
desc_protos: The protos to extract symbols from.
Yields:
Descriptor protos. | Pulls out all the message protos from descriptos. | [
"Pulls",
"out",
"all",
"the",
"message",
"protos",
"from",
"descriptos",
"."
] | def _ExtractMessages(self, desc_protos):
"""Pulls out all the message protos from descriptos.
Args:
desc_protos: The protos to extract symbols from.
Yields:
Descriptor protos.
"""
for desc_proto in desc_protos:
yield desc_proto
for message in self._ExtractMessages(desc_pro... | [
"def",
"_ExtractMessages",
"(",
"self",
",",
"desc_protos",
")",
":",
"for",
"desc_proto",
"in",
"desc_protos",
":",
"yield",
"desc_proto",
"for",
"message",
"in",
"self",
".",
"_ExtractMessages",
"(",
"desc_proto",
".",
"nested_type",
")",
":",
"yield",
"mess... | https://github.com/moflow/moflow/blob/2dfb27c799c90c6caf1477508eca3eec616ef7d2/bap/libtracewrap/libtrace/protobuf/python/google/protobuf/descriptor_pool.py#L496-L509 | ||
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | cmake/developer_package/cpplint/cpplint.py | python | _IncludeState.IsInAlphabeticalOrder | (self, clean_lines, linenum, header_path) | return True | Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be checked.
Returns:
Returns true if the header is in alphabetical order. | Check if a header is in alphabetical order with the previous header. | [
"Check",
"if",
"a",
"header",
"is",
"in",
"alphabetical",
"order",
"with",
"the",
"previous",
"header",
"."
] | def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
"""Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be ch... | [
"def",
"IsInAlphabeticalOrder",
"(",
"self",
",",
"clean_lines",
",",
"linenum",
",",
"header_path",
")",
":",
"# If previous section is different from current section, _last_header will",
"# be reset to empty string, so it's always less than current header.",
"#",
"# If previous line ... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/cmake/developer_package/cpplint/cpplint.py#L929-L948 | |
weichengkuo/DeepBox | c4f8c065b6a51cf296540cc453a44f0519aaacc9 | caffe-fast-rcnn/scripts/cpp_lint.py | python | _NamespaceInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Check end of namespace comments. | Check end of namespace comments. | [
"Check",
"end",
"of",
"namespace",
"comments",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Check end of namespace comments."""
line = clean_lines.raw_lines[linenum]
# Check how many lines is enclosed in this namespace. Don't issue
# warning for missing namespace comments if there aren't enough
# lines. However, do apply chec... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"raw_lines",
"[",
"linenum",
"]",
"# Check how many lines is enclosed in this namespace. Don't issue",
"# warning for missing n... | https://github.com/weichengkuo/DeepBox/blob/c4f8c065b6a51cf296540cc453a44f0519aaacc9/caffe-fast-rcnn/scripts/cpp_lint.py#L1856-L1899 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/signal/signaltools.py | python | cmplx_sort | (p) | return take(p, indx, 0), indx | Sort roots based on magnitude.
Parameters
----------
p : array_like
The roots to sort, as a 1-D array.
Returns
-------
p_sorted : ndarray
Sorted roots.
indx : ndarray
Array of indices needed to sort the input `p`.
Examples
--------
>>> from scipy import... | Sort roots based on magnitude. | [
"Sort",
"roots",
"based",
"on",
"magnitude",
"."
] | def cmplx_sort(p):
"""Sort roots based on magnitude.
Parameters
----------
p : array_like
The roots to sort, as a 1-D array.
Returns
-------
p_sorted : ndarray
Sorted roots.
indx : ndarray
Array of indices needed to sort the input `p`.
Examples
--------... | [
"def",
"cmplx_sort",
"(",
"p",
")",
":",
"p",
"=",
"asarray",
"(",
"p",
")",
"if",
"iscomplexobj",
"(",
"p",
")",
":",
"indx",
"=",
"argsort",
"(",
"abs",
"(",
"p",
")",
")",
"else",
":",
"indx",
"=",
"argsort",
"(",
"p",
")",
"return",
"take",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/signaltools.py#L1684-L1715 | |
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/rj_gameplay/tactic/nmark_tactic.py | python | NMarkTactic.get_requests | (self, world_state: rc.WorldState, props) | return role_requests | :return: role request for n markers | :return: role request for n markers | [
":",
"return",
":",
"role",
"request",
"for",
"n",
"markers"
] | def get_requests(self, world_state: rc.WorldState, props) -> Any:
"""
:return: role request for n markers
"""
if world_state is not None and world_state.ball.visible:
# assign n closest enemies to respective skill and role costFn
closest_enemies = get_closest_ene... | [
"def",
"get_requests",
"(",
"self",
",",
"world_state",
":",
"rc",
".",
"WorldState",
",",
"props",
")",
"->",
"Any",
":",
"if",
"world_state",
"is",
"not",
"None",
"and",
"world_state",
".",
"ball",
".",
"visible",
":",
"# assign n closest enemies to respecti... | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/rj_gameplay/tactic/nmark_tactic.py#L107-L127 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/resolver.py | python | Resolver.get_installation_order | (self, req_set) | return [ireq for _, ireq in sorted_items] | Get order for installation of requirements in RequirementSet.
The returned list contains a requirement before another that depends on
it. This helps ensure that the environment is kept consistent as they
get installed one-by-one.
The current implementation creates a topological o... | Get order for installation of requirements in RequirementSet. | [
"Get",
"order",
"for",
"installation",
"of",
"requirements",
"in",
"RequirementSet",
"."
] | def get_installation_order(self, req_set):
# type: (RequirementSet) -> List[InstallRequirement]
"""Get order for installation of requirements in RequirementSet.
The returned list contains a requirement before another that depends on
it. This helps ensure that the environment is kep... | [
"def",
"get_installation_order",
"(",
"self",
",",
"req_set",
")",
":",
"# type: (RequirementSet) -> List[InstallRequirement]",
"assert",
"self",
".",
"_result",
"is",
"not",
"None",
",",
"\"must call resolve() first\"",
"graph",
"=",
"self",
".",
"_result",
".",
"gra... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/resolver.py#L417-L469 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/platform.py | python | mac_ver | (release='',versioninfo=('','',''),machine='') | return release,versioninfo,machine | Get MacOS version information and return it as tuple (release,
versioninfo, machine) with versioninfo being a tuple (version,
dev_stage, non_release_version).
Entries which cannot be determined are set to the parameter values
which default to ''. All tuple entries are strings. | Get MacOS version information and return it as tuple (release,
versioninfo, machine) with versioninfo being a tuple (version,
dev_stage, non_release_version). | [
"Get",
"MacOS",
"version",
"information",
"and",
"return",
"it",
"as",
"tuple",
"(",
"release",
"versioninfo",
"machine",
")",
"with",
"versioninfo",
"being",
"a",
"tuple",
"(",
"version",
"dev_stage",
"non_release_version",
")",
"."
] | def mac_ver(release='',versioninfo=('','',''),machine=''):
""" Get MacOS version information and return it as tuple (release,
versioninfo, machine) with versioninfo being a tuple (version,
dev_stage, non_release_version).
Entries which cannot be determined are set to the parameter values
... | [
"def",
"mac_ver",
"(",
"release",
"=",
"''",
",",
"versioninfo",
"=",
"(",
"''",
",",
"''",
",",
"''",
")",
",",
"machine",
"=",
"''",
")",
":",
"# First try reading the information from an XML file which should",
"# always be present",
"info",
"=",
"_mac_ver_xml"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/platform.py#L808-L831 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/processor/conversion/swgbcc/processor.py | python | SWGBCCProcessor._post_processor | (cls, full_data_set) | return SWGBCCModpackSubprocessor.get_modpacks(full_data_set) | Convert API-like Python objects to nyan.
:param full_data_set: GenieObjectContainer instance that
contains all relevant data for the conversion
process.
:type full_data_set: ...dataformat.aoc.genie_object_container.GenieObjectContainer | Convert API-like Python objects to nyan. | [
"Convert",
"API",
"-",
"like",
"Python",
"objects",
"to",
"nyan",
"."
] | def _post_processor(cls, full_data_set):
"""
Convert API-like Python objects to nyan.
:param full_data_set: GenieObjectContainer instance that
contains all relevant data for the conversion
process.
:type full_data_set: ...dataf... | [
"def",
"_post_processor",
"(",
"cls",
",",
"full_data_set",
")",
":",
"info",
"(",
"\"Creating nyan objects...\"",
")",
"SWGBCCNyanSubprocessor",
".",
"convert",
"(",
"full_data_set",
")",
"info",
"(",
"\"Creating requests for media export...\"",
")",
"AoCMediaSubprocesso... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/processor/conversion/swgbcc/processor.py#L152-L170 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/wizard.py | python | PyWizardPage.DoGetBestSize | (*args, **kwargs) | return _wizard.PyWizardPage_DoGetBestSize(*args, **kwargs) | DoGetBestSize(self) -> Size | DoGetBestSize(self) -> Size | [
"DoGetBestSize",
"(",
"self",
")",
"-",
">",
"Size"
] | def DoGetBestSize(*args, **kwargs):
"""DoGetBestSize(self) -> Size"""
return _wizard.PyWizardPage_DoGetBestSize(*args, **kwargs) | [
"def",
"DoGetBestSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_wizard",
".",
"PyWizardPage_DoGetBestSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/wizard.py#L183-L185 | |
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | orttraining/orttraining/python/training/ortmodule/_gradient_accumulation_manager.py | python | GradientAccumulationManager.extract_outputs_and_maybe_update_cache | (self, forward_outputs, device) | return tuple(_utils._ortvalue_to_torch_tensor(forward_outputs[i], device) for i in range(self._cache_start)) | Extract the user outputs from the forward outputs as torch tensor and update cache, if needed
Args:
forward_outputs (OrtValueVector): List of outputs returned by forward function | Extract the user outputs from the forward outputs as torch tensor and update cache, if needed | [
"Extract",
"the",
"user",
"outputs",
"from",
"the",
"forward",
"outputs",
"as",
"torch",
"tensor",
"and",
"update",
"cache",
"if",
"needed"
] | def extract_outputs_and_maybe_update_cache(self, forward_outputs, device):
"""Extract the user outputs from the forward outputs as torch tensor and update cache, if needed
Args:
forward_outputs (OrtValueVector): List of outputs returned by forward function
"""
if not self.en... | [
"def",
"extract_outputs_and_maybe_update_cache",
"(",
"self",
",",
"forward_outputs",
",",
"device",
")",
":",
"if",
"not",
"self",
".",
"enabled",
":",
"return",
"tuple",
"(",
"_utils",
".",
"_ortvalue_to_torch_tensor",
"(",
"forward_outputs",
"[",
"i",
"]",
",... | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/ortmodule/_gradient_accumulation_manager.py#L51-L64 | |
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | demo/HuggingFace/NNDF/interface.py | python | OnnxRTCommand.args_to_network_models | (self, args) | Converts argparse arguments into a list of valid NetworkModel fpaths. Specifically for ONNX.
Invokes conversion scripts if not.
Return:
List[NetworkModel]: List of network model names. | Converts argparse arguments into a list of valid NetworkModel fpaths. Specifically for ONNX.
Invokes conversion scripts if not.
Return:
List[NetworkModel]: List of network model names. | [
"Converts",
"argparse",
"arguments",
"into",
"a",
"list",
"of",
"valid",
"NetworkModel",
"fpaths",
".",
"Specifically",
"for",
"ONNX",
".",
"Invokes",
"conversion",
"scripts",
"if",
"not",
".",
"Return",
":",
"List",
"[",
"NetworkModel",
"]",
":",
"List",
"o... | def args_to_network_models(self, args) -> Tuple[NetworkModel]:
"""
Converts argparse arguments into a list of valid NetworkModel fpaths. Specifically for ONNX.
Invokes conversion scripts if not.
Return:
List[NetworkModel]: List of network model names.
""" | [
"def",
"args_to_network_models",
"(",
"self",
",",
"args",
")",
"->",
"Tuple",
"[",
"NetworkModel",
"]",
":"
] | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/HuggingFace/NNDF/interface.py#L346-L352 | ||
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | docs/examples/use_cases/mxnet/resnetn/symbols/resnext.py | python | resnext | (units, num_stages, filter_list, num_classes, num_group, image_shape, bottle_neck=True, bn_mom=0.9, workspace=256, dtype='float32', memonger=False) | return mx.sym.SoftmaxOutput(data=fc1, name='softmax') | Return ResNeXt symbol of
Parameters
----------
units : list
Number of units in each stage
num_stages : int
Number of stage
filter_list : list
Channel size of each stage
num_classes : int
Ouput size of symbol
num_groupes: int
Number of conv groups
datas... | Return ResNeXt symbol of
Parameters
----------
units : list
Number of units in each stage
num_stages : int
Number of stage
filter_list : list
Channel size of each stage
num_classes : int
Ouput size of symbol
num_groupes: int
Number of conv groups
datas... | [
"Return",
"ResNeXt",
"symbol",
"of",
"Parameters",
"----------",
"units",
":",
"list",
"Number",
"of",
"units",
"in",
"each",
"stage",
"num_stages",
":",
"int",
"Number",
"of",
"stage",
"filter_list",
":",
"list",
"Channel",
"size",
"of",
"each",
"stage",
"n... | def resnext(units, num_stages, filter_list, num_classes, num_group, image_shape, bottle_neck=True, bn_mom=0.9, workspace=256, dtype='float32', memonger=False):
"""Return ResNeXt symbol of
Parameters
----------
units : list
Number of units in each stage
num_stages : int
Number of stag... | [
"def",
"resnext",
"(",
"units",
",",
"num_stages",
",",
"filter_list",
",",
"num_classes",
",",
"num_group",
",",
"image_shape",
",",
"bottle_neck",
"=",
"True",
",",
"bn_mom",
"=",
"0.9",
",",
"workspace",
"=",
"256",
",",
"dtype",
"=",
"'float32'",
",",
... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/docs/examples/use_cases/mxnet/resnetn/symbols/resnext.py#L101-L155 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Base/Python/slicer/ScriptedLoadableModule.py | python | ScriptedLoadableModuleLogic.takeScreenshot | (self,name,description,type=-1) | Take a screenshot of the selected viewport and store as and
annotation snapshot node. Convenience method for automated testing.
If self.enableScreenshots is False then only a message is displayed but screenshot
is not stored. Screenshots are scaled by self.screenshotScaleFactor.
:param name: snapshot ... | Take a screenshot of the selected viewport and store as and
annotation snapshot node. Convenience method for automated testing. | [
"Take",
"a",
"screenshot",
"of",
"the",
"selected",
"viewport",
"and",
"store",
"as",
"and",
"annotation",
"snapshot",
"node",
".",
"Convenience",
"method",
"for",
"automated",
"testing",
"."
] | def takeScreenshot(self,name,description,type=-1):
""" Take a screenshot of the selected viewport and store as and
annotation snapshot node. Convenience method for automated testing.
If self.enableScreenshots is False then only a message is displayed but screenshot
is not stored. Screenshots are scaled... | [
"def",
"takeScreenshot",
"(",
"self",
",",
"name",
",",
"description",
",",
"type",
"=",
"-",
"1",
")",
":",
"# show the message even if not taking a screen shot",
"slicer",
".",
"util",
".",
"delayDisplay",
"(",
"description",
")",
"if",
"not",
"self",
".",
"... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Base/Python/slicer/ScriptedLoadableModule.py#L297-L348 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | ToolBarBase.AddCheckTool | (self, id, bitmap,
bmpDisabled = wx.NullBitmap,
shortHelp = '', longHelp = '',
clientData = None) | return self.DoAddTool(id, '', bitmap, bmpDisabled, wx.ITEM_CHECK,
shortHelp, longHelp, clientData) | Add a check tool, i.e. a tool which can be toggled | Add a check tool, i.e. a tool which can be toggled | [
"Add",
"a",
"check",
"tool",
"i",
".",
"e",
".",
"a",
"tool",
"which",
"can",
"be",
"toggled"
] | def AddCheckTool(self, id, bitmap,
bmpDisabled = wx.NullBitmap,
shortHelp = '', longHelp = '',
clientData = None):
'''Add a check tool, i.e. a tool which can be toggled'''
return self.DoAddTool(id, '', bitmap, bmpDisabled, wx.ITEM_CHECK,
... | [
"def",
"AddCheckTool",
"(",
"self",
",",
"id",
",",
"bitmap",
",",
"bmpDisabled",
"=",
"wx",
".",
"NullBitmap",
",",
"shortHelp",
"=",
"''",
",",
"longHelp",
"=",
"''",
",",
"clientData",
"=",
"None",
")",
":",
"return",
"self",
".",
"DoAddTool",
"(",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L3716-L3722 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/bindings/python/clang/cindex.py | python | Diagnostic.category_name | (self) | return conf.lib.clang_getDiagnosticCategoryText(self) | The string name of the category for this diagnostic. | The string name of the category for this diagnostic. | [
"The",
"string",
"name",
"of",
"the",
"category",
"for",
"this",
"diagnostic",
"."
] | def category_name(self):
"""The string name of the category for this diagnostic."""
return conf.lib.clang_getDiagnosticCategoryText(self) | [
"def",
"category_name",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getDiagnosticCategoryText",
"(",
"self",
")"
] | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/bindings/python/clang/cindex.py#L465-L467 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py | python | Environment.__iadd__ | (self, other) | return self | In-place addition of a distribution or environment | In-place addition of a distribution or environment | [
"In",
"-",
"place",
"addition",
"of",
"a",
"distribution",
"or",
"environment"
] | def __iadd__(self, other):
"""In-place addition of a distribution or environment"""
if isinstance(other, Distribution):
self.add(other)
elif isinstance(other, Environment):
for project in other:
for dist in other[project]:
self.add(dist... | [
"def",
"__iadd__",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"Distribution",
")",
":",
"self",
".",
"add",
"(",
"other",
")",
"elif",
"isinstance",
"(",
"other",
",",
"Environment",
")",
":",
"for",
"project",
"in",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py#L1086-L1096 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBCommunication.SetCloseOnEOF | (self, b) | return _lldb.SBCommunication_SetCloseOnEOF(self, b) | SetCloseOnEOF(SBCommunication self, bool b) | SetCloseOnEOF(SBCommunication self, bool b) | [
"SetCloseOnEOF",
"(",
"SBCommunication",
"self",
"bool",
"b",
")"
] | def SetCloseOnEOF(self, b):
"""SetCloseOnEOF(SBCommunication self, bool b)"""
return _lldb.SBCommunication_SetCloseOnEOF(self, b) | [
"def",
"SetCloseOnEOF",
"(",
"self",
",",
"b",
")",
":",
"return",
"_lldb",
".",
"SBCommunication_SetCloseOnEOF",
"(",
"self",
",",
"b",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3057-L3059 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_EmptyDeployment.py | python | handler | (event, context) | return custom_resource_response.success_response(data, physical_resource_id) | Entry point for the Custom::EmptyDeployment resource handler. | Entry point for the Custom::EmptyDeployment resource handler. | [
"Entry",
"point",
"for",
"the",
"Custom",
"::",
"EmptyDeployment",
"resource",
"handler",
"."
] | def handler(event, context):
"""Entry point for the Custom::EmptyDeployment resource handler."""
# This resource does nothing. It exists so that deployment stacks can be created
# before any resource groups have been defined. In such cases the Resources list
# would be empty, which CloudFormation does... | [
"def",
"handler",
"(",
"event",
",",
"context",
")",
":",
"# This resource does nothing. It exists so that deployment stacks can be created",
"# before any resource groups have been defined. In such cases the Resources list ",
"# would be empty, which CloudFormation doesn't allow, so the lmbr_aw... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/lambda-code/ServiceLambda/resource_types/Custom_EmptyDeployment.py#L21-L36 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py | python | transpose | (a, axes=None) | Permute the dimensions of an array.
This function is exactly equivalent to `numpy.transpose`.
See Also
--------
numpy.transpose : Equivalent function in top-level NumPy module.
Examples
--------
>>> import numpy.ma as ma
>>> x = ma.arange(4).reshape((2,2))
>>> x[1, 1] = ma.masked
... | Permute the dimensions of an array. | [
"Permute",
"the",
"dimensions",
"of",
"an",
"array",
"."
] | def transpose(a, axes=None):
"""
Permute the dimensions of an array.
This function is exactly equivalent to `numpy.transpose`.
See Also
--------
numpy.transpose : Equivalent function in top-level NumPy module.
Examples
--------
>>> import numpy.ma as ma
>>> x = ma.arange(4).re... | [
"def",
"transpose",
"(",
"a",
",",
"axes",
"=",
"None",
")",
":",
"# We can't use 'frommethod', as 'transpose' doesn't take keywords",
"try",
":",
"return",
"a",
".",
"transpose",
"(",
"axes",
")",
"except",
"AttributeError",
":",
"return",
"narray",
"(",
"a",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L7005-L7040 | ||
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Config.set_library_path | (path) | Set the path in which to search for libclang | Set the path in which to search for libclang | [
"Set",
"the",
"path",
"in",
"which",
"to",
"search",
"for",
"libclang"
] | def set_library_path(path):
"""Set the path in which to search for libclang"""
if Config.loaded:
raise Exception("library path must be set before before using " \
"any other functionalities in libclang.")
Config.library_path = path | [
"def",
"set_library_path",
"(",
"path",
")",
":",
"if",
"Config",
".",
"loaded",
":",
"raise",
"Exception",
"(",
"\"library path must be set before before using \"",
"\"any other functionalities in libclang.\"",
")",
"Config",
".",
"library_path",
"=",
"path"
] | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L3326-L3332 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/vector_diffeomixture.py | python | VectorDiffeomixture.endpoint_affine | (self) | return self._endpoint_affine | Affine transformation for each of `K` components. | Affine transformation for each of `K` components. | [
"Affine",
"transformation",
"for",
"each",
"of",
"K",
"components",
"."
] | def endpoint_affine(self):
"""Affine transformation for each of `K` components."""
return self._endpoint_affine | [
"def",
"endpoint_affine",
"(",
"self",
")",
":",
"return",
"self",
".",
"_endpoint_affine"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/vector_diffeomixture.py#L547-L549 | |
lhmouse/asteria | b145482abebd58a750cfcc9b09ca7e1986e5f5c6 | ci/appveyor_irc-notify.py | python | appveyor_vars | () | return vars | Return a dict of key value carfted from appveyor environment variables. | Return a dict of key value carfted from appveyor environment variables. | [
"Return",
"a",
"dict",
"of",
"key",
"value",
"carfted",
"from",
"appveyor",
"environment",
"variables",
"."
] | def appveyor_vars():
"""
Return a dict of key value carfted from appveyor environment variables.
"""
from os import environ
appveyor_url = environ.get('APPVEYOR_URL')
message_extended = environ.get('APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED')
configuration_name = environ.get('CONFIGURATION')
... | [
"def",
"appveyor_vars",
"(",
")",
":",
"from",
"os",
"import",
"environ",
"appveyor_url",
"=",
"environ",
".",
"get",
"(",
"'APPVEYOR_URL'",
")",
"message_extended",
"=",
"environ",
".",
"get",
"(",
"'APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED'",
")",
"configuration_name... | https://github.com/lhmouse/asteria/blob/b145482abebd58a750cfcc9b09ca7e1986e5f5c6/ci/appveyor_irc-notify.py#L66-L126 | |
raspberrypi/tools | 13474ee775d0c5ec8a7da4fb0a9fa84187abfc87 | arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/prompt.py | python | _prompt_bs | (attr) | return '\\' | A backslash. | A backslash. | [
"A",
"backslash",
"."
] | def _prompt_bs(attr):
"A backslash."
return '\\' | [
"def",
"_prompt_bs",
"(",
"attr",
")",
":",
"return",
"'\\\\'"
] | https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/share/gdb/python/gdb/prompt.py#L58-L60 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/_feature_engineering/_feature_engineering.py | python | Transformer._list_fields | (self) | return self.__proxy__.list_fields() | List of fields stored in the model. Each of these fields can be queried
using the ``get(field)`` function or ``m[field]``.
Returns
-------
out : list[str]
A list of fields that can be queried using the ``get`` method.
See Also
---------
get | List of fields stored in the model. Each of these fields can be queried
using the ``get(field)`` function or ``m[field]``. | [
"List",
"of",
"fields",
"stored",
"in",
"the",
"model",
".",
"Each",
"of",
"these",
"fields",
"can",
"be",
"queried",
"using",
"the",
"get",
"(",
"field",
")",
"function",
"or",
"m",
"[",
"field",
"]",
"."
] | def _list_fields(self):
"""
List of fields stored in the model. Each of these fields can be queried
using the ``get(field)`` function or ``m[field]``.
Returns
-------
out : list[str]
A list of fields that can be queried using the ``get`` method.
See ... | [
"def",
"_list_fields",
"(",
"self",
")",
":",
"return",
"self",
".",
"__proxy__",
".",
"list_fields",
"(",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/_feature_engineering/_feature_engineering.py#L322-L336 | |
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/tools/gcc.py | python | init | (version = None, command = None, options = None) | Initializes the gcc toolset for the given version. If necessary, command may
be used to specify where the compiler is located. The parameter 'options' is a
space-delimited list of options, each one specified as
<option-name>option-value. Valid option names are: cxxflags, linkflags and
li... | Initializes the gcc toolset for the given version. If necessary, command may
be used to specify where the compiler is located. The parameter 'options' is a
space-delimited list of options, each one specified as
<option-name>option-value. Valid option names are: cxxflags, linkflags and
li... | [
"Initializes",
"the",
"gcc",
"toolset",
"for",
"the",
"given",
"version",
".",
"If",
"necessary",
"command",
"may",
"be",
"used",
"to",
"specify",
"where",
"the",
"compiler",
"is",
"located",
".",
"The",
"parameter",
"options",
"is",
"a",
"space",
"-",
"de... | def init(version = None, command = None, options = None):
"""
Initializes the gcc toolset for the given version. If necessary, command may
be used to specify where the compiler is located. The parameter 'options' is a
space-delimited list of options, each one specified as
<option-nam... | [
"def",
"init",
"(",
"version",
"=",
"None",
",",
"command",
"=",
"None",
",",
"options",
"=",
"None",
")",
":",
"options",
"=",
"to_seq",
"(",
"options",
")",
"command",
"=",
"to_seq",
"(",
"command",
")",
"# Information about the gcc command...",
"# The c... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/tools/gcc.py#L84-L191 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/numeric.py | python | zeros_like | (a, dtype=None, order='K', subok=True) | return res | Return an array of zeros with the same shape and type as a given array.
Parameters
----------
a : array_like
The shape and data-type of `a` define these same attributes of
the returned array.
dtype : data-type, optional
.. versionadded:: 1.6.0
Overrides the data type of ... | Return an array of zeros with the same shape and type as a given array. | [
"Return",
"an",
"array",
"of",
"zeros",
"with",
"the",
"same",
"shape",
"and",
"type",
"as",
"a",
"given",
"array",
"."
] | def zeros_like(a, dtype=None, order='K', subok=True):
"""
Return an array of zeros with the same shape and type as a given array.
Parameters
----------
a : array_like
The shape and data-type of `a` define these same attributes of
the returned array.
dtype : data-type, optional
... | [
"def",
"zeros_like",
"(",
"a",
",",
"dtype",
"=",
"None",
",",
"order",
"=",
"'K'",
",",
"subok",
"=",
"True",
")",
":",
"res",
"=",
"empty_like",
"(",
"a",
",",
"dtype",
"=",
"dtype",
",",
"order",
"=",
"order",
",",
"subok",
"=",
"subok",
")",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/numeric.py#L78-L134 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/builtin_trap.py | python | BuiltinTrap.add_builtin | (self, key, value) | Add a builtin and save the original. | Add a builtin and save the original. | [
"Add",
"a",
"builtin",
"and",
"save",
"the",
"original",
"."
] | def add_builtin(self, key, value):
"""Add a builtin and save the original."""
bdict = builtin_mod.__dict__
orig = bdict.get(key, BuiltinUndefined)
if value is HideBuiltin:
if orig is not BuiltinUndefined: #same as 'key in bdict'
self._orig_builtins[key] = orig... | [
"def",
"add_builtin",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"bdict",
"=",
"builtin_mod",
".",
"__dict__",
"orig",
"=",
"bdict",
".",
"get",
"(",
"key",
",",
"BuiltinUndefined",
")",
"if",
"value",
"is",
"HideBuiltin",
":",
"if",
"orig",
"is"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/builtin_trap.py#L53-L63 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/re2/lib/codereview/codereview.py | python | pq | (ui, repo, *pats, **opts) | return pending(ui, repo, *pats, **opts) | alias for hg p --quick | alias for hg p --quick | [
"alias",
"for",
"hg",
"p",
"--",
"quick"
] | def pq(ui, repo, *pats, **opts):
"""alias for hg p --quick
"""
opts['quick'] = True
return pending(ui, repo, *pats, **opts) | [
"def",
"pq",
"(",
"ui",
",",
"repo",
",",
"*",
"pats",
",",
"*",
"*",
"opts",
")",
":",
"opts",
"[",
"'quick'",
"]",
"=",
"True",
"return",
"pending",
"(",
"ui",
",",
"repo",
",",
"*",
"pats",
",",
"*",
"*",
"opts",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/re2/lib/codereview/codereview.py#L1843-L1847 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridTableBase.CanHaveAttributes | (*args, **kwargs) | return _grid.GridTableBase_CanHaveAttributes(*args, **kwargs) | CanHaveAttributes(self) -> bool | CanHaveAttributes(self) -> bool | [
"CanHaveAttributes",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanHaveAttributes(*args, **kwargs):
"""CanHaveAttributes(self) -> bool"""
return _grid.GridTableBase_CanHaveAttributes(*args, **kwargs) | [
"def",
"CanHaveAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableBase_CanHaveAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L902-L904 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/pkg_resources/__init__.py | python | EntryPoint.load | (self, require=True, *args, **kwargs) | return self.resolve() | Require packages for this EntryPoint, then resolve it. | Require packages for this EntryPoint, then resolve it. | [
"Require",
"packages",
"for",
"this",
"EntryPoint",
"then",
"resolve",
"it",
"."
] | def load(self, require=True, *args, **kwargs):
"""
Require packages for this EntryPoint, then resolve it.
"""
if not require or args or kwargs:
warnings.warn(
"Parameters to load are deprecated. Call .resolve and "
".require separately.",
... | [
"def",
"load",
"(",
"self",
",",
"require",
"=",
"True",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"require",
"or",
"args",
"or",
"kwargs",
":",
"warnings",
".",
"warn",
"(",
"\"Parameters to load are deprecated. Call .resolve and \"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/__init__.py#L2430-L2443 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/package/package_exporter.py | python | PackageExporter._write_source_string | (
self,
module_name: str,
src: str,
is_package: bool = False,
) | Write ``src`` as the source code for ``module_name`` in the zip archive.
Arguments are otherwise the same as for :meth:`save_source_string`. | Write ``src`` as the source code for ``module_name`` in the zip archive. | [
"Write",
"src",
"as",
"the",
"source",
"code",
"for",
"module_name",
"in",
"the",
"zip",
"archive",
"."
] | def _write_source_string(
self,
module_name: str,
src: str,
is_package: bool = False,
):
"""Write ``src`` as the source code for ``module_name`` in the zip archive.
Arguments are otherwise the same as for :meth:`save_source_string`.
"""
extension = "/... | [
"def",
"_write_source_string",
"(",
"self",
",",
"module_name",
":",
"str",
",",
"src",
":",
"str",
",",
"is_package",
":",
"bool",
"=",
"False",
",",
")",
":",
"extension",
"=",
"\"/__init__.py\"",
"if",
"is_package",
"else",
"\".py\"",
"filename",
"=",
"... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/package/package_exporter.py#L375-L388 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus2.in.py | python | getExodusVersion | () | return 0 | Parse the exodusII.h header file and return the version number or 0 if not
found. | Parse the exodusII.h header file and return the version number or 0 if not
found. | [
"Parse",
"the",
"exodusII",
".",
"h",
"header",
"file",
"and",
"return",
"the",
"version",
"number",
"or",
"0",
"if",
"not",
"found",
"."
] | def getExodusVersion():
"""
Parse the exodusII.h header file and return the version number or 0 if not
found.
"""
version_major = 0
version_minor = 0
ACCESS = os.getenv('ACCESS', '@ACCESSDIR@')
for line in open(ACCESS + "/include/exodusII.h"):
fields = line.split()
if (le... | [
"def",
"getExodusVersion",
"(",
")",
":",
"version_major",
"=",
"0",
"version_minor",
"=",
"0",
"ACCESS",
"=",
"os",
".",
"getenv",
"(",
"'ACCESS'",
",",
"'@ACCESSDIR@'",
")",
"for",
"line",
"in",
"open",
"(",
"ACCESS",
"+",
"\"/include/exodusII.h\"",
")",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L55-L75 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | Appearance.drawGL | (self, *args) | return _robotsim.Appearance_drawGL(self, *args) | r"""
Draws the given geometry with this appearance. NOTE: for best performance, an
appearance should only be drawn with a single geometry. Otherwise, the OpenGL
display lists will be completely recreated.
drawGL ()
drawGL (geom)
Args:
geom (:class:`~klam... | r"""
Draws the given geometry with this appearance. NOTE: for best performance, an
appearance should only be drawn with a single geometry. Otherwise, the OpenGL
display lists will be completely recreated. | [
"r",
"Draws",
"the",
"given",
"geometry",
"with",
"this",
"appearance",
".",
"NOTE",
":",
"for",
"best",
"performance",
"an",
"appearance",
"should",
"only",
"be",
"drawn",
"with",
"a",
"single",
"geometry",
".",
"Otherwise",
"the",
"OpenGL",
"display",
"lis... | def drawGL(self, *args) ->None:
r"""
Draws the given geometry with this appearance. NOTE: for best performance, an
appearance should only be drawn with a single geometry. Otherwise, the OpenGL
display lists will be completely recreated.
drawGL ()
drawGL (geom)
... | [
"def",
"drawGL",
"(",
"self",
",",
"*",
"args",
")",
"->",
"None",
":",
"return",
"_robotsim",
".",
"Appearance_drawGL",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L3101-L3119 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/tensor_tracer.py | python | TensorTracer._inside_op_range | (self, idx) | return (self._parameters.op_range[1] < 0 or
idx <= self._parameters.op_range[1]) | Return True if the given index is inside the selected range. | Return True if the given index is inside the selected range. | [
"Return",
"True",
"if",
"the",
"given",
"index",
"is",
"inside",
"the",
"selected",
"range",
"."
] | def _inside_op_range(self, idx):
"""Return True if the given index is inside the selected range."""
if idx < self._parameters.op_range[0]:
return False
return (self._parameters.op_range[1] < 0 or
idx <= self._parameters.op_range[1]) | [
"def",
"_inside_op_range",
"(",
"self",
",",
"idx",
")",
":",
"if",
"idx",
"<",
"self",
".",
"_parameters",
".",
"op_range",
"[",
"0",
"]",
":",
"return",
"False",
"return",
"(",
"self",
".",
"_parameters",
".",
"op_range",
"[",
"1",
"]",
"<",
"0",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tpu/tensor_tracer.py#L393-L399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.