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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/request.py | python | RequestMethods.request_encode_body | (
self,
method,
url,
fields=None,
headers=None,
encode_multipart=True,
multipart_boundary=None,
**urlopen_kw
) | return self.urlopen(method, url, **extra_kw) | Make a request using :meth:`urlopen` with the ``fields`` encoded in
the body. This is useful for request methods like POST, PUT, PATCH, etc.
When ``encode_multipart=True`` (default), then
:meth:`urllib3.filepost.encode_multipart_formdata` is used to encode
the payload with the appropria... | Make a request using :meth:`urlopen` with the ``fields`` encoded in
the body. This is useful for request methods like POST, PUT, PATCH, etc. | [
"Make",
"a",
"request",
"using",
":",
"meth",
":",
"urlopen",
"with",
"the",
"fields",
"encoded",
"in",
"the",
"body",
".",
"This",
"is",
"useful",
"for",
"request",
"methods",
"like",
"POST",
"PUT",
"PATCH",
"etc",
"."
] | def request_encode_body(
self,
method,
url,
fields=None,
headers=None,
encode_multipart=True,
multipart_boundary=None,
**urlopen_kw
):
"""
Make a request using :meth:`urlopen` with the ``fields`` encoded in
the body. This is use... | [
"def",
"request_encode_body",
"(",
"self",
",",
"method",
",",
"url",
",",
"fields",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"encode_multipart",
"=",
"True",
",",
"multipart_boundary",
"=",
"None",
",",
"*",
"*",
"urlopen_kw",
")",
":",
"if",
"hea... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/request.py#L99-L171 | |
zhaoweicai/cascade-rcnn | 2252f46158ea6555868ca6fa5c221ea71d9b5e6c | scripts/cpp_lint.py | python | CheckCheck | (filename, clean_lines, linenum, error) | Checks the use of CHECK and EXPECT macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found. | Checks the use of CHECK and EXPECT macros. | [
"Checks",
"the",
"use",
"of",
"CHECK",
"and",
"EXPECT",
"macros",
"."
] | def CheckCheck(filename, clean_lines, linenum, error):
"""Checks the use of CHECK and EXPECT macros.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to call with any errors found.
... | [
"def",
"CheckCheck",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Decide the set of replacement macros that should be suggested",
"lines",
"=",
"clean_lines",
".",
"elided",
"check_macro",
"=",
"None",
"start_pos",
"=",
"-",
"1",
"... | https://github.com/zhaoweicai/cascade-rcnn/blob/2252f46158ea6555868ca6fa5c221ea71d9b5e6c/scripts/cpp_lint.py#L3282-L3406 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/optimize/_dual_annealing.py | python | dual_annealing | (func, bounds, args=(), maxiter=1000,
local_search_options={}, initial_temp=5230.,
restart_temp_ratio=2.e-5, visit=2.62, accept=-5.0,
maxfun=1e7, seed=None, no_local_search=False,
callback=None, x0=None) | return res | Find the global minimum of a function using Dual Annealing.
Parameters
----------
func : callable
The objective function to be minimized. Must be in the form
``f(x, *args)``, where ``x`` is the argument in the form of a 1-D array
and ``args`` is a tuple of any additional fixed par... | Find the global minimum of a function using Dual Annealing. | [
"Find",
"the",
"global",
"minimum",
"of",
"a",
"function",
"using",
"Dual",
"Annealing",
"."
] | def dual_annealing(func, bounds, args=(), maxiter=1000,
local_search_options={}, initial_temp=5230.,
restart_temp_ratio=2.e-5, visit=2.62, accept=-5.0,
maxfun=1e7, seed=None, no_local_search=False,
callback=None, x0=None):
"""
Find the ... | [
"def",
"dual_annealing",
"(",
"func",
",",
"bounds",
",",
"args",
"=",
"(",
")",
",",
"maxiter",
"=",
"1000",
",",
"local_search_options",
"=",
"{",
"}",
",",
"initial_temp",
"=",
"5230.",
",",
"restart_temp_ratio",
"=",
"2.e-5",
",",
"visit",
"=",
"2.62... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/_dual_annealing.py#L417-L672 | |
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/53.maximum-subarray.py | python | Solution2.maxSubArray | (self, nums) | return largest | :type nums: List[int]
:rtype: int | :type nums: List[int]
:rtype: int | [
":",
"type",
"nums",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"int"
] | def maxSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
# suppose sumTo[i] = a[0] + a[1] + ... [i - 1], sumTo(0) = 0
# the subarray a[i:j] = sumTo[j] - sumTo[i]
largest = float('-inf')
smallest = 0
sumTo = 0
for num in nums... | [
"def",
"maxSubArray",
"(",
"self",
",",
"nums",
")",
":",
"# suppose sumTo[i] = a[0] + a[1] + ... [i - 1], sumTo(0) = 0",
"# the subarray a[i:j] = sumTo[j] - sumTo[i]",
"largest",
"=",
"float",
"(",
"'-inf'",
")",
"smallest",
"=",
"0",
"sumTo",
"=",
"0",
"for",
"num",
... | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/53.maximum-subarray.py#L23-L40 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/ccompiler.py | python | get_default_compiler | (osname=None, platform=None) | return 'unix' | Determine the default compiler to use for the given platform.
osname should be one of the standard Python OS names (i.e. the
ones returned by os.name) and platform the common value
returned by sys.platform for the platform in question.
The default values are os.name and sys.platform in... | Determine the default compiler to use for the given platform. | [
"Determine",
"the",
"default",
"compiler",
"to",
"use",
"for",
"the",
"given",
"platform",
"."
] | def get_default_compiler(osname=None, platform=None):
""" Determine the default compiler to use for the given platform.
osname should be one of the standard Python OS names (i.e. the
ones returned by os.name) and platform the common value
returned by sys.platform for the platform in questio... | [
"def",
"get_default_compiler",
"(",
"osname",
"=",
"None",
",",
"platform",
"=",
"None",
")",
":",
"if",
"osname",
"is",
"None",
":",
"osname",
"=",
"os",
".",
"name",
"if",
"platform",
"is",
"None",
":",
"platform",
"=",
"sys",
".",
"platform",
"if",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/ccompiler.py#L906-L928 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Text.edit | (self, *args) | return self.tk.call(self._w, 'edit', *args) | Internal method
This method controls the undo mechanism and
the modified flag. The exact behavior of the
command depends on the option argument that
follows the edit argument. The following forms
of the command are currently supported:
edit_modified, edit_redo, edit_res... | Internal method | [
"Internal",
"method"
] | def edit(self, *args):
"""Internal method
This method controls the undo mechanism and
the modified flag. The exact behavior of the
command depends on the option argument that
follows the edit argument. The following forms
of the command are currently supported:
... | [
"def",
"edit",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'edit'",
",",
"*",
"args",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2961-L2974 | |
qgis/QGIS | 15a77662d4bb712184f6aa60d0bd663010a76a75 | python/plugins/MetaSearch/pavement.py | python | test_default_csw_connections | () | test that the default CSW connections work | test that the default CSW connections work | [
"test",
"that",
"the",
"default",
"CSW",
"connections",
"work"
] | def test_default_csw_connections():
"""test that the default CSW connections work"""
relpath = 'resources%sconnections-default.xml' % os.sep
csw_connections_xml = options.base.plugin / relpath
conns = etree.parse(csw_connections_xml)
for conn in conns.findall('csw'):
try:
csw ... | [
"def",
"test_default_csw_connections",
"(",
")",
":",
"relpath",
"=",
"'resources%sconnections-default.xml'",
"%",
"os",
".",
"sep",
"csw_connections_xml",
"=",
"options",
".",
"base",
".",
"plugin",
"/",
"relpath",
"conns",
"=",
"etree",
".",
"parse",
"(",
"csw... | https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/MetaSearch/pavement.py#L177-L191 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/nntplib.py | python | NNTP.newgroups | (self, date, time, file=None) | return self.longcmd('NEWGROUPS ' + date + ' ' + time, file) | Process a NEWGROUPS command. Arguments:
- date: string 'yymmdd' indicating the date
- time: string 'hhmmss' indicating the time
Return:
- resp: server response if successful
- list: list of newsgroup names | Process a NEWGROUPS command. Arguments:
- date: string 'yymmdd' indicating the date
- time: string 'hhmmss' indicating the time
Return:
- resp: server response if successful
- list: list of newsgroup names | [
"Process",
"a",
"NEWGROUPS",
"command",
".",
"Arguments",
":",
"-",
"date",
":",
"string",
"yymmdd",
"indicating",
"the",
"date",
"-",
"time",
":",
"string",
"hhmmss",
"indicating",
"the",
"time",
"Return",
":",
"-",
"resp",
":",
"server",
"response",
"if"... | def newgroups(self, date, time, file=None):
"""Process a NEWGROUPS command. Arguments:
- date: string 'yymmdd' indicating the date
- time: string 'hhmmss' indicating the time
Return:
- resp: server response if successful
- list: list of newsgroup names"""
return... | [
"def",
"newgroups",
"(",
"self",
",",
"date",
",",
"time",
",",
"file",
"=",
"None",
")",
":",
"return",
"self",
".",
"longcmd",
"(",
"'NEWGROUPS '",
"+",
"date",
"+",
"' '",
"+",
"time",
",",
"file",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/nntplib.py#L266-L274 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TChA.ChangeCh | (self, *args) | return _snap.TChA_ChangeCh(self, *args) | ChangeCh(TChA self, char const & SrcCh, char const & DstCh)
Parameters:
SrcCh: char const &
DstCh: char const & | ChangeCh(TChA self, char const & SrcCh, char const & DstCh) | [
"ChangeCh",
"(",
"TChA",
"self",
"char",
"const",
"&",
"SrcCh",
"char",
"const",
"&",
"DstCh",
")"
] | def ChangeCh(self, *args):
"""
ChangeCh(TChA self, char const & SrcCh, char const & DstCh)
Parameters:
SrcCh: char const &
DstCh: char const &
"""
return _snap.TChA_ChangeCh(self, *args) | [
"def",
"ChangeCh",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TChA_ChangeCh",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L8973-L8982 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/fft/_pocketfft.py | python | ihfft | (a, n=None, axis=-1, norm=None) | return output * (1 / (sqrt(n) if unitary else n)) | Compute the inverse FFT of a signal that has Hermitian symmetry.
Parameters
----------
a : array_like
Input array.
n : int, optional
Length of the inverse FFT, the number of points along
transformation axis in the input to use. If `n` is smaller than
the length of the i... | Compute the inverse FFT of a signal that has Hermitian symmetry. | [
"Compute",
"the",
"inverse",
"FFT",
"of",
"a",
"signal",
"that",
"has",
"Hermitian",
"symmetry",
"."
] | def ihfft(a, n=None, axis=-1, norm=None):
"""
Compute the inverse FFT of a signal that has Hermitian symmetry.
Parameters
----------
a : array_like
Input array.
n : int, optional
Length of the inverse FFT, the number of points along
transformation axis in the input to us... | [
"def",
"ihfft",
"(",
"a",
",",
"n",
"=",
"None",
",",
"axis",
"=",
"-",
"1",
",",
"norm",
"=",
"None",
")",
":",
"a",
"=",
"asarray",
"(",
"a",
")",
"if",
"n",
"is",
"None",
":",
"n",
"=",
"a",
".",
"shape",
"[",
"axis",
"]",
"unitary",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/fft/_pocketfft.py#L570-L627 | |
vslavik/poedit | f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a | deps/boost/tools/litre/cplusplus.py | python | _caller | (up=0) | return ('', 0, '', None) | Get file name, line number, function name and
source text of the caller's caller as 4-tuple:
(file, line, func, text).
The optional argument 'up' allows retrieval of
a caller further back up into the call stack.
Note, the source text may be None and function
name may be '?' ... | Get file name, line number, function name and
source text of the caller's caller as 4-tuple:
(file, line, func, text). | [
"Get",
"file",
"name",
"line",
"number",
"function",
"name",
"and",
"source",
"text",
"of",
"the",
"caller",
"s",
"caller",
"as",
"4",
"-",
"tuple",
":",
"(",
"file",
"line",
"func",
"text",
")",
"."
] | def _caller(up=0):
'''Get file name, line number, function name and
source text of the caller's caller as 4-tuple:
(file, line, func, text).
The optional argument 'up' allows retrieval of
a caller further back up into the call stack.
Note, the source text may be None and functi... | [
"def",
"_caller",
"(",
"up",
"=",
"0",
")",
":",
"try",
":",
"# just get a few frames'",
"f",
"=",
"traceback",
".",
"extract_stack",
"(",
"limit",
"=",
"up",
"+",
"2",
")",
"if",
"f",
":",
"return",
"f",
"[",
"0",
"]",
"except",
":",
"pass",
"# ru... | https://github.com/vslavik/poedit/blob/f7a9daa0a10037e090aa0a86f5ce0f24ececdf6a/deps/boost/tools/litre/cplusplus.py#L15-L35 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/lite/python/op_hint.py | python | _LiteOperand.aggregate_and_return_name_for_input | (self, out_graphdef) | This adds the node(s) to out_graphdef and returns the input node name.
Args:
out_graphdef: A graphdef that is ready to have this input added.
Returns:
The output that the stub should use as an input for this operand.
Raises:
RuntimeError: if the method is not implemented. | This adds the node(s) to out_graphdef and returns the input node name. | [
"This",
"adds",
"the",
"node",
"(",
"s",
")",
"to",
"out_graphdef",
"and",
"returns",
"the",
"input",
"node",
"name",
"."
] | def aggregate_and_return_name_for_input(self, out_graphdef):
"""This adds the node(s) to out_graphdef and returns the input node name.
Args:
out_graphdef: A graphdef that is ready to have this input added.
Returns:
The output that the stub should use as an input for this operand.
Raises:
... | [
"def",
"aggregate_and_return_name_for_input",
"(",
"self",
",",
"out_graphdef",
")",
":",
"del",
"out_graphdef",
"raise",
"RuntimeError",
"(",
"\"Unimplemented abstract method.\"",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/python/op_hint.py#L480-L493 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | Display.GetFromPoint | (*args, **kwargs) | return _misc_.Display_GetFromPoint(*args, **kwargs) | GetFromPoint(Point pt) -> int
Find the display where the given point lies, return wx.NOT_FOUND if it
doesn't belong to any display | GetFromPoint(Point pt) -> int | [
"GetFromPoint",
"(",
"Point",
"pt",
")",
"-",
">",
"int"
] | def GetFromPoint(*args, **kwargs):
"""
GetFromPoint(Point pt) -> int
Find the display where the given point lies, return wx.NOT_FOUND if it
doesn't belong to any display
"""
return _misc_.Display_GetFromPoint(*args, **kwargs) | [
"def",
"GetFromPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Display_GetFromPoint",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L6101-L6108 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/ISISDisk.py | python | ISISDisk.getMultiWidths | (self, Ei_in=None, frequency=None) | return {"Eis":Eis, "Moderator":tmod, "Chopper":tchp, "Energy":res_el} | Returns the time widths contributing to the calculated energy width for all reps | Returns the time widths contributing to the calculated energy width for all reps | [
"Returns",
"the",
"time",
"widths",
"contributing",
"to",
"the",
"calculated",
"energy",
"width",
"for",
"all",
"reps"
] | def getMultiWidths(self, Ei_in=None, frequency=None):
"""
Returns the time widths contributing to the calculated energy width for all reps
"""
Ei = self.Ei if Ei_in is None else Ei_in
if not Ei:
raise ValueError('Incident energy has not been specified')
if fre... | [
"def",
"getMultiWidths",
"(",
"self",
",",
"Ei_in",
"=",
"None",
",",
"frequency",
"=",
"None",
")",
":",
"Ei",
"=",
"self",
".",
"Ei",
"if",
"Ei_in",
"is",
"None",
"else",
"Ei_in",
"if",
"not",
"Ei",
":",
"raise",
"ValueError",
"(",
"'Incident energy ... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/PyChop/ISISDisk.py#L300-L325 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/sdist.py | python | sdist.read_manifest | (self) | Read the manifest file (named by 'self.manifest') and use it to
fill in 'self.filelist', the list of files to include in the source
distribution. | Read the manifest file (named by 'self.manifest') and use it to
fill in 'self.filelist', the list of files to include in the source
distribution. | [
"Read",
"the",
"manifest",
"file",
"(",
"named",
"by",
"self",
".",
"manifest",
")",
"and",
"use",
"it",
"to",
"fill",
"in",
"self",
".",
"filelist",
"the",
"list",
"of",
"files",
"to",
"include",
"in",
"the",
"source",
"distribution",
"."
] | def read_manifest(self):
"""Read the manifest file (named by 'self.manifest') and use it to
fill in 'self.filelist', the list of files to include in the source
distribution.
"""
log.info("reading manifest file '%s'", self.manifest)
manifest = open(self.manifest)
f... | [
"def",
"read_manifest",
"(",
"self",
")",
":",
"log",
".",
"info",
"(",
"\"reading manifest file '%s'\"",
",",
"self",
".",
"manifest",
")",
"manifest",
"=",
"open",
"(",
"self",
".",
"manifest",
")",
"for",
"line",
"in",
"manifest",
":",
"# ignore comments ... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/distutils/command/sdist.py#L386-L399 | ||
zeakey/DeepSkeleton | dc70170f8fd2ec8ca1157484ce66129981104486 | scripts/cpp_lint.py | python | _NestingState.InnermostClass | (self) | return None | Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise. | Get class info on the top of the stack. | [
"Get",
"class",
"info",
"on",
"the",
"top",
"of",
"the",
"stack",
"."
] | def InnermostClass(self):
"""Get class info on the top of the stack.
Returns:
A _ClassInfo object if we are inside a class, or None otherwise.
"""
for i in range(len(self.stack), 0, -1):
classinfo = self.stack[i - 1]
if isinstance(classinfo, _ClassInfo):
return classinfo
r... | [
"def",
"InnermostClass",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"stack",
")",
",",
"0",
",",
"-",
"1",
")",
":",
"classinfo",
"=",
"self",
".",
"stack",
"[",
"i",
"-",
"1",
"]",
"if",
"isinstance",
"(",
... | https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/scripts/cpp_lint.py#L2160-L2170 | |
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | dali/python/nvidia/dali/pipeline.py | python | Pipeline.share_outputs | (self) | Returns the outputs of the pipeline.
Main difference to :meth:`outputs`
is that share_outputs doesn't release returned buffers, release_outputs
need to be called for that. If the pipeline is executed asynchronously,
this function blocks until the results become available. It provides
... | Returns the outputs of the pipeline. | [
"Returns",
"the",
"outputs",
"of",
"the",
"pipeline",
"."
] | def share_outputs(self):
"""Returns the outputs of the pipeline.
Main difference to :meth:`outputs`
is that share_outputs doesn't release returned buffers, release_outputs
need to be called for that. If the pipeline is executed asynchronously,
this function blocks until the resu... | [
"def",
"share_outputs",
"(",
"self",
")",
":",
"with",
"self",
".",
"_check_api_type_scope",
"(",
"types",
".",
"PipelineAPIType",
".",
"SCHEDULED",
")",
":",
"if",
"self",
".",
"_batches_to_consume",
"==",
"0",
"or",
"self",
".",
"_gpu_batches_to_consume",
"=... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/dali/python/nvidia/dali/pipeline.py#L857-L879 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/labeled_tensor/python/ops/core.py | python | _find_consistent_ordering | (a, b) | return ordering | Find the left-most consistent ordering between two lists of unique items.
A consistent ordering combines all elements in both a and b while keeping all
elements in their original order in both inputs. The left-most consistent
ordering orders elements from `a` not found in `b` before elements in `b` not
found i... | Find the left-most consistent ordering between two lists of unique items. | [
"Find",
"the",
"left",
"-",
"most",
"consistent",
"ordering",
"between",
"two",
"lists",
"of",
"unique",
"items",
"."
] | def _find_consistent_ordering(a, b):
"""Find the left-most consistent ordering between two lists of unique items.
A consistent ordering combines all elements in both a and b while keeping all
elements in their original order in both inputs. The left-most consistent
ordering orders elements from `a` not found i... | [
"def",
"_find_consistent_ordering",
"(",
"a",
",",
"b",
")",
":",
"a_set",
"=",
"set",
"(",
"a",
")",
"b_set",
"=",
"set",
"(",
"b",
")",
"i",
"=",
"0",
"j",
"=",
"0",
"ordering",
"=",
"[",
"]",
"while",
"i",
"<",
"len",
"(",
"a",
")",
"and",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/labeled_tensor/python/ops/core.py#L916-L960 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/reinforcement-learning/a3c/launcher.py | python | submit | (args) | Submit function of local jobs. | Submit function of local jobs. | [
"Submit",
"function",
"of",
"local",
"jobs",
"."
] | def submit(args):
gpus = args.gpus.strip().split(',')
"""Submit function of local jobs."""
def mthread_submit(nworker, nserver, envs):
"""
customized submit script, that submit nslave jobs, each must contain args as parameter
note this can be a lambda function containing additional p... | [
"def",
"submit",
"(",
"args",
")",
":",
"gpus",
"=",
"args",
".",
"gpus",
".",
"strip",
"(",
")",
".",
"split",
"(",
"','",
")",
"def",
"mthread_submit",
"(",
"nworker",
",",
"nserver",
",",
"envs",
")",
":",
"\"\"\"\n customized submit script, that... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/reinforcement-learning/a3c/launcher.py#L79-L106 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/internal/well_known_types.py | python | Timestamp.ToMilliseconds | (self) | return (self.seconds * _MILLIS_PER_SECOND +
self.nanos // _NANOS_PER_MILLISECOND) | Converts Timestamp to milliseconds since epoch. | Converts Timestamp to milliseconds since epoch. | [
"Converts",
"Timestamp",
"to",
"milliseconds",
"since",
"epoch",
"."
] | def ToMilliseconds(self):
"""Converts Timestamp to milliseconds since epoch."""
return (self.seconds * _MILLIS_PER_SECOND +
self.nanos // _NANOS_PER_MILLISECOND) | [
"def",
"ToMilliseconds",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"seconds",
"*",
"_MILLIS_PER_SECOND",
"+",
"self",
".",
"nanos",
"//",
"_NANOS_PER_MILLISECOND",
")"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/well_known_types.py#L197-L200 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewCtrl.SetExpanderColumn | (*args, **kwargs) | return _dataview.DataViewCtrl_SetExpanderColumn(*args, **kwargs) | SetExpanderColumn(self, DataViewColumn col) | SetExpanderColumn(self, DataViewColumn col) | [
"SetExpanderColumn",
"(",
"self",
"DataViewColumn",
"col",
")"
] | def SetExpanderColumn(*args, **kwargs):
"""SetExpanderColumn(self, DataViewColumn col)"""
return _dataview.DataViewCtrl_SetExpanderColumn(*args, **kwargs) | [
"def",
"SetExpanderColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewCtrl_SetExpanderColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L1723-L1725 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | net/tools/dafsa/make_dafsa.py | python | reverse | (dafsa) | return sink | Generates a new DAFSA that is reversed, so that the old sink node becomes
the new source node. | Generates a new DAFSA that is reversed, so that the old sink node becomes
the new source node. | [
"Generates",
"a",
"new",
"DAFSA",
"that",
"is",
"reversed",
"so",
"that",
"the",
"old",
"sink",
"node",
"becomes",
"the",
"new",
"source",
"node",
"."
] | def reverse(dafsa):
"""Generates a new DAFSA that is reversed, so that the old sink node becomes
the new source node.
"""
sink = []
nodemap = {}
def dfs(node, parent):
"""Creates reverse nodes.
A new reverse node will be created for each old node. The new node will
get a reversed label and the... | [
"def",
"reverse",
"(",
"dafsa",
")",
":",
"sink",
"=",
"[",
"]",
"nodemap",
"=",
"{",
"}",
"def",
"dfs",
"(",
"node",
",",
"parent",
")",
":",
"\"\"\"Creates reverse nodes.\n\n A new reverse node will be created for each old node. The new node will\n get a reversed ... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/net/tools/dafsa/make_dafsa.py#L226-L250 | |
physercoe/starquant | c00cad64d1de2da05081b3dc320ef264c6295e08 | cppsrc/log4cplus-2.0.4/catch/.conan/build.py | python | BuilderSettings.channel | (self) | return os.getenv("CONAN_CHANNEL", "testing") | Default Conan package channel when not stable | Default Conan package channel when not stable | [
"Default",
"Conan",
"package",
"channel",
"when",
"not",
"stable"
] | def channel(self):
""" Default Conan package channel when not stable
"""
return os.getenv("CONAN_CHANNEL", "testing") | [
"def",
"channel",
"(",
"self",
")",
":",
"return",
"os",
".",
"getenv",
"(",
"\"CONAN_CHANNEL\"",
",",
"\"testing\"",
")"
] | https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/cppsrc/log4cplus-2.0.4/catch/.conan/build.py#L55-L58 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/_polybase.py | python | ABCPolyBase.integ | (self, m=1, k=[], lbnd=None) | return self.__class__(coef, self.domain, self.window) | Integrate.
Return a series instance that is the definite integral of the
current series.
Parameters
----------
m : non-negative int
The number of integrations to perform.
k : array_like
Integration constants. The first constant is applied to the
... | Integrate. | [
"Integrate",
"."
] | def integ(self, m=1, k=[], lbnd=None):
"""Integrate.
Return a series instance that is the definite integral of the
current series.
Parameters
----------
m : non-negative int
The number of integrations to perform.
k : array_like
Integratio... | [
"def",
"integ",
"(",
"self",
",",
"m",
"=",
"1",
",",
"k",
"=",
"[",
"]",
",",
"lbnd",
"=",
"None",
")",
":",
"off",
",",
"scl",
"=",
"self",
".",
"mapparms",
"(",
")",
"if",
"lbnd",
"is",
"None",
":",
"lbnd",
"=",
"0",
"else",
":",
"lbnd",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/_polybase.py#L708-L739 | |
xiaohaoChen/rrc_detection | 4f2b110cd122da7f55e8533275a9b4809a88785a | python/caffe/io.py | python | Transformer.set_transpose | (self, in_, order) | Set the input channel order for e.g. RGB to BGR conversion
as needed for the reference ImageNet model.
Parameters
----------
in_ : which input to assign this channel order
order : the order to transpose the dimensions | Set the input channel order for e.g. RGB to BGR conversion
as needed for the reference ImageNet model. | [
"Set",
"the",
"input",
"channel",
"order",
"for",
"e",
".",
"g",
".",
"RGB",
"to",
"BGR",
"conversion",
"as",
"needed",
"for",
"the",
"reference",
"ImageNet",
"model",
"."
] | def set_transpose(self, in_, order):
"""
Set the input channel order for e.g. RGB to BGR conversion
as needed for the reference ImageNet model.
Parameters
----------
in_ : which input to assign this channel order
order : the order to transpose the dimensions
... | [
"def",
"set_transpose",
"(",
"self",
",",
"in_",
",",
"order",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"if",
"len",
"(",
"order",
")",
"!=",
"len",
"(",
"self",
".",
"inputs",
"[",
"in_",
"]",
")",
"-",
"1",
":",
"raise",
"Except... | https://github.com/xiaohaoChen/rrc_detection/blob/4f2b110cd122da7f55e8533275a9b4809a88785a/python/caffe/io.py#L187-L201 | ||
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.MergeFrom | (self, other) | Appends the contents of another repeated field of the same type to this
one, copying each individual message. | Appends the contents of another repeated field of the same type to this
one, copying each individual message. | [
"Appends",
"the",
"contents",
"of",
"another",
"repeated",
"field",
"of",
"the",
"same",
"type",
"to",
"this",
"one",
"copying",
"each",
"individual",
"message",
"."
] | def MergeFrom(self, other):
"""Appends the contents of another repeated field of the same type to this
one, copying each individual message.
"""
self.extend(other._values) | [
"def",
"MergeFrom",
"(",
"self",
",",
"other",
")",
":",
"self",
".",
"extend",
"(",
"other",
".",
"_values",
")"
] | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/containers.py#L232-L236 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/control_flow_ops.py | python | group | (*inputs, **kwargs) | Create an op that groups multiple operations.
When this op finishes, all ops in `inputs` have finished. This op has no
output.
See also @{tf.tuple$tuple} and
@{tf.control_dependencies$control_dependencies}.
Args:
*inputs: Zero or more tensors to group.
name: A name for this operation (optional).
... | Create an op that groups multiple operations. | [
"Create",
"an",
"op",
"that",
"groups",
"multiple",
"operations",
"."
] | def group(*inputs, **kwargs):
"""Create an op that groups multiple operations.
When this op finishes, all ops in `inputs` have finished. This op has no
output.
See also @{tf.tuple$tuple} and
@{tf.control_dependencies$control_dependencies}.
Args:
*inputs: Zero or more tensors to group.
name: A nam... | [
"def",
"group",
"(",
"*",
"inputs",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"context",
".",
"in_eager_mode",
"(",
")",
":",
"return",
"None",
"name",
"=",
"kwargs",
".",
"pop",
"(",
"\"name\"",
",",
"None",
")",
"if",
"kwargs",
":",
"raise",
"Valu... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/control_flow_ops.py#L2910-L2972 | ||
cmu-db/peloton | 484d76df9344cb5c153a2c361c5d5018912d4cf4 | script/formatting/formatter.py | python | format_dir | (dir_path, update_header, clang_format_code) | Formats all the files in the dir passed as argument. | Formats all the files in the dir passed as argument. | [
"Formats",
"all",
"the",
"files",
"in",
"the",
"dir",
"passed",
"as",
"argument",
"."
] | def format_dir(dir_path, update_header, clang_format_code):
"""Formats all the files in the dir passed as argument."""
for subdir, _, files in os.walk(dir_path): # _ is for directories.
for file in files:
#print os.path.join(subdir, file)
file_path = subdir + os.path.sep + file
... | [
"def",
"format_dir",
"(",
"dir_path",
",",
"update_header",
",",
"clang_format_code",
")",
":",
"for",
"subdir",
",",
"_",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"dir_path",
")",
":",
"# _ is for directories.",
"for",
"file",
"in",
"files",
":",
"#pri... | https://github.com/cmu-db/peloton/blob/484d76df9344cb5c153a2c361c5d5018912d4cf4/script/formatting/formatter.py#L113-L121 | ||
cmu-db/noisepage | 79276e68fe83322f1249e8a8be96bd63c583ae56 | build-support/cpplint.py | python | ParseArguments | (args) | return filenames | Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint. | Parses the command line arguments. | [
"Parses",
"the",
"command",
"line",
"arguments",
"."
] | def ParseArguments(args):
"""Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint.
"""
try:
(opts, filenames) = getopt.getopt(args, '', ['help', 'output=', ... | [
"def",
"ParseArguments",
"(",
"args",
")",
":",
"try",
":",
"(",
"opts",
",",
"filenames",
")",
"=",
"getopt",
".",
"getopt",
"(",
"args",
",",
"''",
",",
"[",
"'help'",
",",
"'output='",
",",
"'verbose='",
",",
"'v='",
",",
"'version'",
",",
"'count... | https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L6441-L6537 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/NTableWidget.py | python | NTableWidget.get_cell_value | (self, row_index, col_index) | return return_value | Purpose: Get cell value
Requirements: row index and column index are integer and within range.
Guarantees: the cell value with correct type is returned
:param row_index:
:param col_index:
:return: | Purpose: Get cell value
Requirements: row index and column index are integer and within range.
Guarantees: the cell value with correct type is returned
:param row_index:
:param col_index:
:return: | [
"Purpose",
":",
"Get",
"cell",
"value",
"Requirements",
":",
"row",
"index",
"and",
"column",
"index",
"are",
"integer",
"and",
"within",
"range",
".",
"Guarantees",
":",
"the",
"cell",
"value",
"with",
"correct",
"type",
"is",
"returned",
":",
"param",
"r... | def get_cell_value(self, row_index, col_index):
"""
Purpose: Get cell value
Requirements: row index and column index are integer and within range.
Guarantees: the cell value with correct type is returned
:param row_index:
:param col_index:
:return:
"""
... | [
"def",
"get_cell_value",
"(",
"self",
",",
"row_index",
",",
"col_index",
")",
":",
"# check",
"assert",
"isinstance",
"(",
"row_index",
",",
"int",
")",
",",
"'Row index {0} must be an integer'",
".",
"format",
"(",
"row_index",
")",
"assert",
"isinstance",
"("... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/NTableWidget.py#L151-L214 | |
yuxng/PoseCNN | 9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04 | lib/datasets/sym.py | python | sym._load_sym_annotation | (self, index) | return {'image': image_path,
'depth': depth_path,
'label': label_path,
'meta_data': metadata_path,
'class_colors': self._class_colors,
'class_weights': self._class_weights,
'cls_index': -1,
'flipped': False} | Load class name and meta data | Load class name and meta data | [
"Load",
"class",
"name",
"and",
"meta",
"data"
] | def _load_sym_annotation(self, index):
"""
Load class name and meta data
"""
# image path
image_path = self.image_path_from_index(index)
# depth path
depth_path = self.depth_path_from_index(index)
# label path
label_path = self.label_path_from_in... | [
"def",
"_load_sym_annotation",
"(",
"self",
",",
"index",
")",
":",
"# image path",
"image_path",
"=",
"self",
".",
"image_path_from_index",
"(",
"index",
")",
"# depth path",
"depth_path",
"=",
"self",
".",
"depth_path_from_index",
"(",
"index",
")",
"# label pat... | https://github.com/yuxng/PoseCNN/blob/9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04/lib/datasets/sym.py#L208-L231 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pdb.py | python | Pdb.do_undisplay | (self, arg) | undisplay [expression]
Do not display the expression any more in the current frame.
Without expression, clear all display expressions for the current frame. | undisplay [expression] | [
"undisplay",
"[",
"expression",
"]"
] | def do_undisplay(self, arg):
"""undisplay [expression]
Do not display the expression any more in the current frame.
Without expression, clear all display expressions for the current frame.
"""
if arg:
try:
del self.displaying.get(self.curframe, {})[a... | [
"def",
"do_undisplay",
"(",
"self",
",",
"arg",
")",
":",
"if",
"arg",
":",
"try",
":",
"del",
"self",
".",
"displaying",
".",
"get",
"(",
"self",
".",
"curframe",
",",
"{",
"}",
")",
"[",
"arg",
"]",
"except",
"KeyError",
":",
"self",
".",
"erro... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/pdb.py#L1353-L1366 | ||
rdiankov/openrave | d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7 | python/ikfast_sympy0_6.py | python | IKFastSolver.GetSolvers | () | return {'transform6d':IKFastSolver.solveFullIK_6D,
'rotation3d':IKFastSolver.solveFullIK_Rotation3D,
'translation3d':IKFastSolver.solveFullIK_Translation3D,
'direction3d':IKFastSolver.solveFullIK_Direction3D,
'ray4d':IKFastSolver.solveFullIK_Ray4D,
... | Returns a dictionary of all the supported solvers and their official identifier names | Returns a dictionary of all the supported solvers and their official identifier names | [
"Returns",
"a",
"dictionary",
"of",
"all",
"the",
"supported",
"solvers",
"and",
"their",
"official",
"identifier",
"names"
] | def GetSolvers():
"""Returns a dictionary of all the supported solvers and their official identifier names"""
return {'transform6d':IKFastSolver.solveFullIK_6D,
'rotation3d':IKFastSolver.solveFullIK_Rotation3D,
'translation3d':IKFastSolver.solveFullIK_Translation3D,
... | [
"def",
"GetSolvers",
"(",
")",
":",
"return",
"{",
"'transform6d'",
":",
"IKFastSolver",
".",
"solveFullIK_6D",
",",
"'rotation3d'",
":",
"IKFastSolver",
".",
"solveFullIK_Rotation3D",
",",
"'translation3d'",
":",
"IKFastSolver",
".",
"solveFullIK_Translation3D",
",",... | https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/ikfast_sympy0_6.py#L5732-L5749 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/gather/policy_json.py | python | PolicyJson._AddMessages | (self) | Processed and adds the 'messages' section to the output. | Processed and adds the 'messages' section to the output. | [
"Processed",
"and",
"adds",
"the",
"messages",
"section",
"to",
"the",
"output",
"."
] | def _AddMessages(self):
'''Processed and adds the 'messages' section to the output.'''
self._AddNontranslateableChunk(" 'messages': {\n")
for name, message in self.data['messages'].iteritems():
self._AddNontranslateableChunk(" '%s': {\n" % name)
self._AddNontranslateableChunk(" 'tex... | [
"def",
"_AddMessages",
"(",
"self",
")",
":",
"self",
".",
"_AddNontranslateableChunk",
"(",
"\" 'messages': {\\n\"",
")",
"for",
"name",
",",
"message",
"in",
"self",
".",
"data",
"[",
"'messages'",
"]",
".",
"iteritems",
"(",
")",
":",
"self",
".",
"_Ad... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/gather/policy_json.py#L215-L224 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/bindings/python/clang/cindex.py | python | SourceRange.end | (self) | return conf.lib.clang_getRangeEnd(self) | Return a SourceLocation representing the last character within a
source range. | Return a SourceLocation representing the last character within a
source range. | [
"Return",
"a",
"SourceLocation",
"representing",
"the",
"last",
"character",
"within",
"a",
"source",
"range",
"."
] | def end(self):
"""
Return a SourceLocation representing the last character within a
source range.
"""
return conf.lib.clang_getRangeEnd(self) | [
"def",
"end",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getRangeEnd",
"(",
"self",
")"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L328-L333 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.get_eidcache | (self) | return cache | Get the EID-to-RLOC cache entries. | Get the EID-to-RLOC cache entries. | [
"Get",
"the",
"EID",
"-",
"to",
"-",
"RLOC",
"cache",
"entries",
"."
] | def get_eidcache(self) -> Dict[Ip6Addr, Rloc16]:
"""Get the EID-to-RLOC cache entries."""
output = self.execute_command('eidcache')
cache = {}
for line in output:
ip, rloc16, _ = line.split(" ", 2)
cache[Ip6Addr(ip)] = Rloc16(rloc16, 16)
return cache | [
"def",
"get_eidcache",
"(",
"self",
")",
"->",
"Dict",
"[",
"Ip6Addr",
",",
"Rloc16",
"]",
":",
"output",
"=",
"self",
".",
"execute_command",
"(",
"'eidcache'",
")",
"cache",
"=",
"{",
"}",
"for",
"line",
"in",
"output",
":",
"ip",
",",
"rloc16",
",... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L2160-L2170 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/httplib2/upload-diffs.py | python | GetSubversionPropertyChanges | (filename) | return None | Return a Subversion's 'Property changes on ...' string, which is used in
the patch file.
Args:
filename: filename whose property might be set by [auto-props] config.
Returns:
A string like 'Property changes on |filename| ...' if given |filename|
matches any entries in [auto-props] section. None, o... | Return a Subversion's 'Property changes on ...' string, which is used in
the patch file. | [
"Return",
"a",
"Subversion",
"s",
"Property",
"changes",
"on",
"...",
"string",
"which",
"is",
"used",
"in",
"the",
"patch",
"file",
"."
] | def GetSubversionPropertyChanges(filename):
"""Return a Subversion's 'Property changes on ...' string, which is used in
the patch file.
Args:
filename: filename whose property might be set by [auto-props] config.
Returns:
A string like 'Property changes on |filename| ...' if given |filename|
mat... | [
"def",
"GetSubversionPropertyChanges",
"(",
"filename",
")",
":",
"global",
"svn_auto_props_map",
"if",
"svn_auto_props_map",
"is",
"None",
":",
"svn_auto_props_map",
"=",
"LoadSubversionAutoProperties",
"(",
")",
"all_props",
"=",
"[",
"]",
"for",
"file_pattern",
","... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/httplib2/upload-diffs.py#L2143-L2164 | |
PyMesh/PyMesh | 384ba882b7558ba6e8653ed263c419226c22bddf | python/pymesh/predicates.py | python | orient_2D | (p1, p2, p3) | return PyMesh.orient2d(p1, p2, p3) | Determine the orientation 2D points p1, p2, p3
Args:
p1,p2,p3: 2D points.
Returns:
positive if (p1, p2, p3) is in counterclockwise order.
negative if (p1, p2, p3) is in clockwise order.
0.0 if they are collinear. | Determine the orientation 2D points p1, p2, p3 | [
"Determine",
"the",
"orientation",
"2D",
"points",
"p1",
"p2",
"p3"
] | def orient_2D(p1, p2, p3):
""" Determine the orientation 2D points p1, p2, p3
Args:
p1,p2,p3: 2D points.
Returns:
positive if (p1, p2, p3) is in counterclockwise order.
negative if (p1, p2, p3) is in clockwise order.
0.0 if they are collinear.
"""
return PyMesh.orie... | [
"def",
"orient_2D",
"(",
"p1",
",",
"p2",
",",
"p3",
")",
":",
"return",
"PyMesh",
".",
"orient2d",
"(",
"p1",
",",
"p2",
",",
"p3",
")"
] | https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/predicates.py#L10-L21 | |
freeorion/freeorion | c266a40eccd3a99a17de8fe57c36ef6ba3771665 | default/python/AI/MilitaryAI.py | python | Allocator._jump2_threat | (self) | return get_system_jump2_threat(self.sys_id) | Military rating of enemies present 2 jumps away from the system. | Military rating of enemies present 2 jumps away from the system. | [
"Military",
"rating",
"of",
"enemies",
"present",
"2",
"jumps",
"away",
"from",
"the",
"system",
"."
] | def _jump2_threat(self):
"""Military rating of enemies present 2 jumps away from the system."""
return get_system_jump2_threat(self.sys_id) | [
"def",
"_jump2_threat",
"(",
"self",
")",
":",
"return",
"get_system_jump2_threat",
"(",
"self",
".",
"sys_id",
")"
] | https://github.com/freeorion/freeorion/blob/c266a40eccd3a99a17de8fe57c36ef6ba3771665/default/python/AI/MilitaryAI.py#L406-L408 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | DC.DrawRectanglePointSize | (*args, **kwargs) | return _gdi_.DC_DrawRectanglePointSize(*args, **kwargs) | DrawRectanglePointSize(self, Point pt, Size sz)
Draws a rectangle with the given top left corner, and with the given
size. The current pen is used for the outline and the current brush
for filling the shape. | DrawRectanglePointSize(self, Point pt, Size sz) | [
"DrawRectanglePointSize",
"(",
"self",
"Point",
"pt",
"Size",
"sz",
")"
] | def DrawRectanglePointSize(*args, **kwargs):
"""
DrawRectanglePointSize(self, Point pt, Size sz)
Draws a rectangle with the given top left corner, and with the given
size. The current pen is used for the outline and the current brush
for filling the shape.
"""
re... | [
"def",
"DrawRectanglePointSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_DrawRectanglePointSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L3558-L3566 | |
Studio3T/robomongo | 2411cd032e2e69b968dadda13ac91ca4ef3483b0 | src/third-party/qscintilla-2.8.4/sources/Python/configure.py | python | ModuleConfiguration.inform_user | (self, target_configuration) | Inform the user about module specific configuration information.
target_configuration is the target configuration. | Inform the user about module specific configuration information.
target_configuration is the target configuration. | [
"Inform",
"the",
"user",
"about",
"module",
"specific",
"configuration",
"information",
".",
"target_configuration",
"is",
"the",
"target",
"configuration",
"."
] | def inform_user(self, target_configuration):
""" Inform the user about module specific configuration information.
target_configuration is the target configuration.
"""
inform("QScintilla %s is being used." %
target_configuration.qsci_version)
if target_configura... | [
"def",
"inform_user",
"(",
"self",
",",
"target_configuration",
")",
":",
"inform",
"(",
"\"QScintilla %s is being used.\"",
"%",
"target_configuration",
".",
"qsci_version",
")",
"if",
"target_configuration",
".",
"qsci_sip_dir",
"!=",
"''",
":",
"inform",
"(",
"\"... | https://github.com/Studio3T/robomongo/blob/2411cd032e2e69b968dadda13ac91ca4ef3483b0/src/third-party/qscintilla-2.8.4/sources/Python/configure.py#L235-L245 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | FilePickerCtrl.GetTextCtrlValue | (*args, **kwargs) | return _controls_.FilePickerCtrl_GetTextCtrlValue(*args, **kwargs) | GetTextCtrlValue(self) -> String | GetTextCtrlValue(self) -> String | [
"GetTextCtrlValue",
"(",
"self",
")",
"-",
">",
"String"
] | def GetTextCtrlValue(*args, **kwargs):
"""GetTextCtrlValue(self) -> String"""
return _controls_.FilePickerCtrl_GetTextCtrlValue(*args, **kwargs) | [
"def",
"GetTextCtrlValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"FilePickerCtrl_GetTextCtrlValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L7128-L7130 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py | python | DebugTensorDatum.debug_op | (self) | return self._debug_op | Name of the debug op.
Returns:
(`str`) debug op name (e.g., `DebugIdentity`). | Name of the debug op. | [
"Name",
"of",
"the",
"debug",
"op",
"."
] | def debug_op(self):
"""Name of the debug op.
Returns:
(`str`) debug op name (e.g., `DebugIdentity`).
"""
return self._debug_op | [
"def",
"debug_op",
"(",
"self",
")",
":",
"return",
"self",
".",
"_debug_op"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_data.py#L378-L385 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/rexec.py | python | RExec.r_reload | (self, m) | return self.importer.reload(m) | Reload the module object, re-parsing and re-initializing it.
This method is implicitly called by code executing in the
restricted environment. Overriding this method in a subclass is
used to change the policies enforced by a restricted environment. | Reload the module object, re-parsing and re-initializing it. | [
"Reload",
"the",
"module",
"object",
"re",
"-",
"parsing",
"and",
"re",
"-",
"initializing",
"it",
"."
] | def r_reload(self, m):
"""Reload the module object, re-parsing and re-initializing it.
This method is implicitly called by code executing in the
restricted environment. Overriding this method in a subclass is
used to change the policies enforced by a restricted environment.
""... | [
"def",
"r_reload",
"(",
"self",
",",
"m",
")",
":",
"return",
"self",
".",
"importer",
".",
"reload",
"(",
"m",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/rexec.py#L349-L357 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudsearch/layer1.py | python | Layer1.describe_domains | (self, domain_names=None) | return self.get_response(doc_path, 'DescribeDomains',
params, verb='POST',
list_marker='DomainStatusList') | Describes the domains (optionally limited to one or more
domains by name) owned by this account.
:type domain_names: list
:param domain_names: Limits the response to the specified domains.
:raises: BaseException, InternalException | Describes the domains (optionally limited to one or more
domains by name) owned by this account. | [
"Describes",
"the",
"domains",
"(",
"optionally",
"limited",
"to",
"one",
"or",
"more",
"domains",
"by",
"name",
")",
"owned",
"by",
"this",
"account",
"."
] | def describe_domains(self, domain_names=None):
"""
Describes the domains (optionally limited to one or more
domains by name) owned by this account.
:type domain_names: list
:param domain_names: Limits the response to the specified domains.
:raises: BaseException, Intern... | [
"def",
"describe_domains",
"(",
"self",
",",
"domain_names",
"=",
"None",
")",
":",
"doc_path",
"=",
"(",
"'describe_domains_response'",
",",
"'describe_domains_result'",
",",
"'domain_status_list'",
")",
"params",
"=",
"{",
"}",
"if",
"domain_names",
":",
"for",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudsearch/layer1.py#L398-L417 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/kvstore.py | python | KVStore.load_optimizer_states | (self, fname) | Loads the optimizer (updater) state from the file.
Parameters
----------
fname : str
Path to input states file. | Loads the optimizer (updater) state from the file. | [
"Loads",
"the",
"optimizer",
"(",
"updater",
")",
"state",
"from",
"the",
"file",
"."
] | def load_optimizer_states(self, fname):
"""Loads the optimizer (updater) state from the file.
Parameters
----------
fname : str
Path to input states file.
"""
assert self._updater is not None, "Cannot load states for distributed training"
self._update... | [
"def",
"load_optimizer_states",
"(",
"self",
",",
"fname",
")",
":",
"assert",
"self",
".",
"_updater",
"is",
"not",
"None",
",",
"\"Cannot load states for distributed training\"",
"self",
".",
"_updater",
".",
"set_states",
"(",
"open",
"(",
"fname",
",",
"'rb'... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/kvstore.py#L554-L563 | ||
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/treegen/cnf_train.py | python | evaluate | (hparams) | Evaluate a model under training repeatedly. | Evaluate a model under training repeatedly. | [
"Evaluate",
"a",
"model",
"under",
"training",
"repeatedly",
"."
] | def evaluate(hparams):
"""Evaluate a model under training repeatedly."""
data_iterator, clause_metadata = load_data(random_start=False)
if FLAGS.model_type == 'tree':
m = cnf_model.CNFTreeModel(data_iterator, hparams, clause_metadata)
else:
m = cnf_model.CNFSequenceModel(data_iterator, hparams, clause_... | [
"def",
"evaluate",
"(",
"hparams",
")",
":",
"data_iterator",
",",
"clause_metadata",
"=",
"load_data",
"(",
"random_start",
"=",
"False",
")",
"if",
"FLAGS",
".",
"model_type",
"==",
"'tree'",
":",
"m",
"=",
"cnf_model",
".",
"CNFTreeModel",
"(",
"data_iter... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/treegen/cnf_train.py#L210-L240 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/ctrlbox.py | python | SegmentBar.GetSegmentLabel | (self, index) | return self._buttons[index].Label | Get the label of the given segment
@param index: segment index
@return: string | Get the label of the given segment
@param index: segment index
@return: string | [
"Get",
"the",
"label",
"of",
"the",
"given",
"segment",
"@param",
"index",
":",
"segment",
"index",
"@return",
":",
"string"
] | def GetSegmentLabel(self, index):
"""Get the label of the given segment
@param index: segment index
@return: string
"""
return self._buttons[index].Label | [
"def",
"GetSegmentLabel",
"(",
"self",
",",
"index",
")",
":",
"return",
"self",
".",
"_buttons",
"[",
"index",
"]",
".",
"Label"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/ctrlbox.py#L920-L926 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/graph_editor/select.py | python | filter_ts_from_regex | (ops, regex) | return filter_ts(ops, positive_filter=lambda op: regex_obj.search(op.name)) | r"""Get all the tensors linked to ops that match the given regex.
Args:
ops: an object convertible to a list of tf.Operation.
regex: a regular expression matching the tensors' name.
For example, "^foo(/.*)?:\d+$" will match all the tensors in the "foo"
scope.
Returns:
A list of tf.Tensor.
... | r"""Get all the tensors linked to ops that match the given regex. | [
"r",
"Get",
"all",
"the",
"tensors",
"linked",
"to",
"ops",
"that",
"match",
"the",
"given",
"regex",
"."
] | def filter_ts_from_regex(ops, regex):
r"""Get all the tensors linked to ops that match the given regex.
Args:
ops: an object convertible to a list of tf.Operation.
regex: a regular expression matching the tensors' name.
For example, "^foo(/.*)?:\d+$" will match all the tensors in the "foo"
scop... | [
"def",
"filter_ts_from_regex",
"(",
"ops",
",",
"regex",
")",
":",
"ops",
"=",
"util",
".",
"make_list_of_op",
"(",
"ops",
")",
"regex_obj",
"=",
"make_regex",
"(",
"regex",
")",
"return",
"filter_ts",
"(",
"ops",
",",
"positive_filter",
"=",
"lambda",
"op... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/graph_editor/select.py#L135-L150 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-utils/modtool/core/info.py | python | ModToolInfo._get_base_dir | (self, start_dir) | return None | Figure out the base dir (where the top-level cmake file is) | Figure out the base dir (where the top-level cmake file is) | [
"Figure",
"out",
"the",
"base",
"dir",
"(",
"where",
"the",
"top",
"-",
"level",
"cmake",
"file",
"is",
")"
] | def _get_base_dir(self, start_dir):
""" Figure out the base dir (where the top-level cmake file is) """
base_dir = os.path.abspath(start_dir)
if self._check_directory(base_dir):
return base_dir
else:
(up_dir, this_dir) = os.path.split(base_dir)
if os.p... | [
"def",
"_get_base_dir",
"(",
"self",
",",
"start_dir",
")",
":",
"base_dir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"start_dir",
")",
"if",
"self",
".",
"_check_directory",
"(",
"base_dir",
")",
":",
"return",
"base_dir",
"else",
":",
"(",
"up_dir"... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/modtool/core/info.py#L71-L82 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/_parseaddr.py | python | mktime_tz | (data) | Turn a 10-tuple as returned by parsedate_tz() into a POSIX timestamp. | Turn a 10-tuple as returned by parsedate_tz() into a POSIX timestamp. | [
"Turn",
"a",
"10",
"-",
"tuple",
"as",
"returned",
"by",
"parsedate_tz",
"()",
"into",
"a",
"POSIX",
"timestamp",
"."
] | def mktime_tz(data):
"""Turn a 10-tuple as returned by parsedate_tz() into a POSIX timestamp."""
if data[9] is None:
# No zone info, so localtime is better assumption than GMT
return time.mktime(data[:8] + (-1,))
else:
t = calendar.timegm(data)
return t - data[9] | [
"def",
"mktime_tz",
"(",
"data",
")",
":",
"if",
"data",
"[",
"9",
"]",
"is",
"None",
":",
"# No zone info, so localtime is better assumption than GMT",
"return",
"time",
".",
"mktime",
"(",
"data",
"[",
":",
"8",
"]",
"+",
"(",
"-",
"1",
",",
")",
")",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/email/_parseaddr.py#L152-L159 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/psutil/psutil/__init__.py | python | Process.get_threads | (self) | return self._platform_impl.get_process_threads() | Return threads opened by process as a list of namedtuples
including thread id and thread CPU times (user/system). | Return threads opened by process as a list of namedtuples
including thread id and thread CPU times (user/system). | [
"Return",
"threads",
"opened",
"by",
"process",
"as",
"a",
"list",
"of",
"namedtuples",
"including",
"thread",
"id",
"and",
"thread",
"CPU",
"times",
"(",
"user",
"/",
"system",
")",
"."
] | def get_threads(self):
"""Return threads opened by process as a list of namedtuples
including thread id and thread CPU times (user/system).
"""
return self._platform_impl.get_process_threads() | [
"def",
"get_threads",
"(",
"self",
")",
":",
"return",
"self",
".",
"_platform_impl",
".",
"get_process_threads",
"(",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/psutil/psutil/__init__.py#L490-L494 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py | python | _makeTags | (tagStr, xml) | return openTag, closeTag | Internal helper to construct opening and closing tag expressions, given a tag name | Internal helper to construct opening and closing tag expressions, given a tag name | [
"Internal",
"helper",
"to",
"construct",
"opening",
"and",
"closing",
"tag",
"expressions",
"given",
"a",
"tag",
"name"
] | def _makeTags(tagStr, xml):
"""Internal helper to construct opening and closing tag expressions, given a tag name"""
if isinstance(tagStr,basestring):
resname = tagStr
tagStr = Keyword(tagStr, caseless=not xml)
else:
resname = tagStr.name
tagAttrName = Word(alphas,alphanums+"_-:... | [
"def",
"_makeTags",
"(",
"tagStr",
",",
"xml",
")",
":",
"if",
"isinstance",
"(",
"tagStr",
",",
"basestring",
")",
":",
"resname",
"=",
"tagStr",
"tagStr",
"=",
"Keyword",
"(",
"tagStr",
",",
"caseless",
"=",
"not",
"xml",
")",
"else",
":",
"resname",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L4875-L4902 | |
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/YouCompleteMe/python/ycm/extra_conf_store.py | python | _RandomName | () | return ''.join( random.choice( string.ascii_lowercase ) for x in range( 15 ) ) | Generates a random module name. | Generates a random module name. | [
"Generates",
"a",
"random",
"module",
"name",
"."
] | def _RandomName():
"""Generates a random module name."""
return ''.join( random.choice( string.ascii_lowercase ) for x in range( 15 ) ) | [
"def",
"_RandomName",
"(",
")",
":",
"return",
"''",
".",
"join",
"(",
"random",
".",
"choice",
"(",
"string",
".",
"ascii_lowercase",
")",
"for",
"x",
"in",
"range",
"(",
"15",
")",
")"
] | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/YouCompleteMe/python/ycm/extra_conf_store.py#L210-L212 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | xpathParserContext.xpathPopBoolean | (self) | return ret | Pops a boolean from the stack, handling conversion if
needed. Check error with #xmlXPathCheckError. | Pops a boolean from the stack, handling conversion if
needed. Check error with #xmlXPathCheckError. | [
"Pops",
"a",
"boolean",
"from",
"the",
"stack",
"handling",
"conversion",
"if",
"needed",
".",
"Check",
"error",
"with",
"#xmlXPathCheckError",
"."
] | def xpathPopBoolean(self):
"""Pops a boolean from the stack, handling conversion if
needed. Check error with #xmlXPathCheckError. """
ret = libxml2mod.xmlXPathPopBoolean(self._o)
return ret | [
"def",
"xpathPopBoolean",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlXPathPopBoolean",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L7743-L7747 | |
mysql/mysql-workbench | 2f35f9034f015cbcd22139a60e1baa2e3e8e795c | res/scripts/python/grt_python_debugger.py | python | PyDebugger.do_clear | (self, bp_number) | Handle how a breakpoint must be removed when it is a temporary one. | Handle how a breakpoint must be removed when it is a temporary one. | [
"Handle",
"how",
"a",
"breakpoint",
"must",
"be",
"removed",
"when",
"it",
"is",
"a",
"temporary",
"one",
"."
] | def do_clear(self, bp_number):
"""Handle how a breakpoint must be removed when it is a temporary one."""
#self.ui_print("user_clear: %s\n" % arg)
pass | [
"def",
"do_clear",
"(",
"self",
",",
"bp_number",
")",
":",
"#self.ui_print(\"user_clear: %s\\n\" % arg)",
"pass"
] | https://github.com/mysql/mysql-workbench/blob/2f35f9034f015cbcd22139a60e1baa2e3e8e795c/res/scripts/python/grt_python_debugger.py#L450-L453 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/environment.py | python | Template.get_corresponding_lineno | (self, lineno) | return 1 | Return the source line number of a line number in the
generated bytecode as they are not in sync. | Return the source line number of a line number in the
generated bytecode as they are not in sync. | [
"Return",
"the",
"source",
"line",
"number",
"of",
"a",
"line",
"number",
"in",
"the",
"generated",
"bytecode",
"as",
"they",
"are",
"not",
"in",
"sync",
"."
] | def get_corresponding_lineno(self, lineno):
"""Return the source line number of a line number in the
generated bytecode as they are not in sync.
"""
for template_line, code_line in reversed(self.debug_info):
if code_line <= lineno:
return template_line
... | [
"def",
"get_corresponding_lineno",
"(",
"self",
",",
"lineno",
")",
":",
"for",
"template_line",
",",
"code_line",
"in",
"reversed",
"(",
"self",
".",
"debug_info",
")",
":",
"if",
"code_line",
"<=",
"lineno",
":",
"return",
"template_line",
"return",
"1"
] | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/environment.py#L1108-L1115 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/training/python/training/evaluation.py | python | evaluate_repeatedly | (checkpoint_dir,
master='',
scaffold=None,
eval_ops=None,
feed_dict=None,
final_ops=None,
final_ops_feed_dict=None,
eval_interval_secs=60,
... | return final_ops_hook.final_ops_values | Repeatedly searches for a checkpoint in `checkpoint_dir` and evaluates it.
During a single evaluation, the `eval_ops` is run until the session is
interrupted or requested to finish. This is typically requested via a
`tf.contrib.training.StopAfterNEvalsHook` which results in `eval_ops` running
the requested num... | Repeatedly searches for a checkpoint in `checkpoint_dir` and evaluates it. | [
"Repeatedly",
"searches",
"for",
"a",
"checkpoint",
"in",
"checkpoint_dir",
"and",
"evaluates",
"it",
"."
] | def evaluate_repeatedly(checkpoint_dir,
master='',
scaffold=None,
eval_ops=None,
feed_dict=None,
final_ops=None,
final_ops_feed_dict=None,
eval_interval... | [
"def",
"evaluate_repeatedly",
"(",
"checkpoint_dir",
",",
"master",
"=",
"''",
",",
"scaffold",
"=",
"None",
",",
"eval_ops",
"=",
"None",
",",
"feed_dict",
"=",
"None",
",",
"final_ops",
"=",
"None",
",",
"final_ops_feed_dict",
"=",
"None",
",",
"eval_inter... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/training/python/training/evaluation.py#L345-L462 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/core/fromnumeric.py | python | argsort | (a, axis=-1, kind='quicksort', order=None) | return argsort(axis, kind, order) | Returns the indices that would sort an array.
Perform an indirect sort along the given axis using the algorithm specified
by the `kind` keyword. It returns an array of indices of the same shape as
`a` that index data along the given axis in sorted order.
Parameters
----------
a : array_like
... | Returns the indices that would sort an array. | [
"Returns",
"the",
"indices",
"that",
"would",
"sort",
"an",
"array",
"."
] | def argsort(a, axis=-1, kind='quicksort', order=None):
"""
Returns the indices that would sort an array.
Perform an indirect sort along the given axis using the algorithm specified
by the `kind` keyword. It returns an array of indices of the same shape as
`a` that index data along the given axis in... | [
"def",
"argsort",
"(",
"a",
",",
"axis",
"=",
"-",
"1",
",",
"kind",
"=",
"'quicksort'",
",",
"order",
"=",
"None",
")",
":",
"try",
":",
"argsort",
"=",
"a",
".",
"argsort",
"except",
"AttributeError",
":",
"return",
"_wrapit",
"(",
"a",
",",
"'ar... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/fromnumeric.py#L598-L680 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/misc_util.py | python | Configuration.add_library | (self,name,sources,**build_info) | Add library to configuration.
Parameters
----------
name : str
Name of the extension.
sources : sequence
List of the sources. The list of sources may contain functions
(called source generators) which must take an extension instance
and a ... | Add library to configuration. | [
"Add",
"library",
"to",
"configuration",
"."
] | def add_library(self,name,sources,**build_info):
"""
Add library to configuration.
Parameters
----------
name : str
Name of the extension.
sources : sequence
List of the sources. The list of sources may contain functions
(called source... | [
"def",
"add_library",
"(",
"self",
",",
"name",
",",
"sources",
",",
"*",
"*",
"build_info",
")",
":",
"self",
".",
"_add_library",
"(",
"name",
",",
"sources",
",",
"None",
",",
"build_info",
")",
"dist",
"=",
"self",
".",
"get_distribution",
"(",
")"... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/misc_util.py#L1461-L1495 | ||
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/mfg/games/crowd_modelling.py | python | MFGCrowdModellingState.__init__ | (self, game) | Constructor; should only be called by Game.new_initial_state. | Constructor; should only be called by Game.new_initial_state. | [
"Constructor",
";",
"should",
"only",
"be",
"called",
"by",
"Game",
".",
"new_initial_state",
"."
] | def __init__(self, game):
"""Constructor; should only be called by Game.new_initial_state."""
super().__init__(game)
self._is_chance_init = True # is true for the first state of the game.
self._player_id = pyspiel.PlayerId.CHANCE
self._x = None
self._t = 0
# We initialize last_action to the... | [
"def",
"__init__",
"(",
"self",
",",
"game",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"game",
")",
"self",
".",
"_is_chance_init",
"=",
"True",
"# is true for the first state of the game.",
"self",
".",
"_player_id",
"=",
"pyspiel",
".",
"PlayerId",
... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/mfg/games/crowd_modelling.py#L105-L121 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | Examples/Image/Detection/FastRCNN/BrainScript/cntk_helpers.py | python | computeAveragePrecision | (recalls, precisions, use_07_metric=False) | return ap | ap = voc_ap(recalls, precisions, [use_07_metric])
Compute VOC AP given precision and recall.
If use_07_metric is true, uses the
VOC 07 11 point method (default:False). | ap = voc_ap(recalls, precisions, [use_07_metric])
Compute VOC AP given precision and recall.
If use_07_metric is true, uses the
VOC 07 11 point method (default:False). | [
"ap",
"=",
"voc_ap",
"(",
"recalls",
"precisions",
"[",
"use_07_metric",
"]",
")",
"Compute",
"VOC",
"AP",
"given",
"precision",
"and",
"recall",
".",
"If",
"use_07_metric",
"is",
"true",
"uses",
"the",
"VOC",
"07",
"11",
"point",
"method",
"(",
"default",... | def computeAveragePrecision(recalls, precisions, use_07_metric=False):
""" ap = voc_ap(recalls, precisions, [use_07_metric])
Compute VOC AP given precision and recall.
If use_07_metric is true, uses the
VOC 07 11 point method (default:False).
"""
if use_07_metric:
# 11 point metric
... | [
"def",
"computeAveragePrecision",
"(",
"recalls",
",",
"precisions",
",",
"use_07_metric",
"=",
"False",
")",
":",
"if",
"use_07_metric",
":",
"# 11 point metric",
"ap",
"=",
"0.",
"for",
"t",
"in",
"np",
".",
"arange",
"(",
"0.",
",",
"1.1",
",",
"0.1",
... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/Examples/Image/Detection/FastRCNN/BrainScript/cntk_helpers.py#L922-L953 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/functions/Examples/ExamplePeakFunction.py | python | ExamplePeakFunction.setActiveParameter | (self, index, value) | Called by the fitting framework when a parameter value is updated.
Only required if the fitting is done over a different parameter
set than that declared | Called by the fitting framework when a parameter value is updated.
Only required if the fitting is done over a different parameter
set than that declared | [
"Called",
"by",
"the",
"fitting",
"framework",
"when",
"a",
"parameter",
"value",
"is",
"updated",
".",
"Only",
"required",
"if",
"the",
"fitting",
"is",
"done",
"over",
"a",
"different",
"parameter",
"set",
"than",
"that",
"declared"
] | def setActiveParameter(self, index, value):
"""
Called by the fitting framework when a parameter value is updated.
Only required if the fitting is done over a different parameter
set than that declared
"""
param_value = value
if index == 2:
param_value... | [
"def",
"setActiveParameter",
"(",
"self",
",",
"index",
",",
"value",
")",
":",
"param_value",
"=",
"value",
"if",
"index",
"==",
"2",
":",
"param_value",
"=",
"math",
".",
"sqrt",
"(",
"math",
".",
"fabs",
"(",
"1.0",
"/",
"value",
")",
")",
"else",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/functions/Examples/ExamplePeakFunction.py#L121-L139 | ||
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/v8/third_party/jinja2/filters.py | python | do_map | (*args, **kwargs) | Applies a filter on a sequence of objects or looks up an attribute.
This is useful when dealing with lists of objects but you are really
only interested in a certain value of it.
The basic usage is mapping on an attribute. Imagine you have a list
of users but you are only interested in a list of usern... | Applies a filter on a sequence of objects or looks up an attribute.
This is useful when dealing with lists of objects but you are really
only interested in a certain value of it. | [
"Applies",
"a",
"filter",
"on",
"a",
"sequence",
"of",
"objects",
"or",
"looks",
"up",
"an",
"attribute",
".",
"This",
"is",
"useful",
"when",
"dealing",
"with",
"lists",
"of",
"objects",
"but",
"you",
"are",
"really",
"only",
"interested",
"in",
"a",
"c... | def do_map(*args, **kwargs):
"""Applies a filter on a sequence of objects or looks up an attribute.
This is useful when dealing with lists of objects but you are really
only interested in a certain value of it.
The basic usage is mapping on an attribute. Imagine you have a list
of users but you ar... | [
"def",
"do_map",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"context",
"=",
"args",
"[",
"0",
"]",
"seq",
"=",
"args",
"[",
"1",
"]",
"if",
"len",
"(",
"args",
")",
"==",
"2",
"and",
"'attribute'",
"in",
"kwargs",
":",
"attribute",
"=... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/filters.py#L808-L850 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py | python | pyparsing_common.stripHTMLTags | (s, l, tokens) | return pyparsing_common._html_stripper.transformString(tokens[0]) | Parse action to remove HTML tags from web page HTML source
Example::
# strip HTML links from normal text
text = '<td>More info at the <a href="http://pyparsing.wikispaces.com">pyparsing</a> wiki page</td>'
td,td_end = makeHTMLTags("TD")
table_text = td + SkipTo(... | Parse action to remove HTML tags from web page HTML source | [
"Parse",
"action",
"to",
"remove",
"HTML",
"tags",
"from",
"web",
"page",
"HTML",
"source"
] | def stripHTMLTags(s, l, tokens):
"""
Parse action to remove HTML tags from web page HTML source
Example::
# strip HTML links from normal text
text = '<td>More info at the <a href="http://pyparsing.wikispaces.com">pyparsing</a> wiki page</td>'
td,td_end = mak... | [
"def",
"stripHTMLTags",
"(",
"s",
",",
"l",
",",
"tokens",
")",
":",
"return",
"pyparsing_common",
".",
"_html_stripper",
".",
"transformString",
"(",
"tokens",
"[",
"0",
"]",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py#L5601-L5613 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | ColourData.SetCustomColour | (*args, **kwargs) | return _windows_.ColourData_SetCustomColour(*args, **kwargs) | SetCustomColour(self, int i, Colour colour)
Sets the i'th custom colour for the colour dialog. i should be an
integer between 0 and 15. The default custom colours are all invalid colours. | SetCustomColour(self, int i, Colour colour) | [
"SetCustomColour",
"(",
"self",
"int",
"i",
"Colour",
"colour",
")"
] | def SetCustomColour(*args, **kwargs):
"""
SetCustomColour(self, int i, Colour colour)
Sets the i'th custom colour for the colour dialog. i should be an
integer between 0 and 15. The default custom colours are all invalid colours.
"""
return _windows_.ColourData_SetCustom... | [
"def",
"SetCustomColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"ColourData_SetCustomColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2978-L2985 | |
koth/kcws | 88efbd36a7022de4e6e90f5a1fb880cf87cfae9f | third_party/setuptools/pkg_resources.py | python | safe_name | (name) | return re.sub('[^A-Za-z0-9.]+', '-', name) | Convert an arbitrary string to a standard distribution name
Any runs of non-alphanumeric/. characters are replaced with a single '-'. | Convert an arbitrary string to a standard distribution name | [
"Convert",
"an",
"arbitrary",
"string",
"to",
"a",
"standard",
"distribution",
"name"
] | def safe_name(name):
"""Convert an arbitrary string to a standard distribution name
Any runs of non-alphanumeric/. characters are replaced with a single '-'.
"""
return re.sub('[^A-Za-z0-9.]+', '-', name) | [
"def",
"safe_name",
"(",
"name",
")",
":",
"return",
"re",
".",
"sub",
"(",
"'[^A-Za-z0-9.]+'",
",",
"'-'",
",",
"name",
")"
] | https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/setuptools/pkg_resources.py#L1150-L1155 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/clique.py | python | CustomType.ValidateAndModify | (self, lang, translation) | Returns true if the translation (a tclib.Translation object) is valid,
otherwise false. The language is also passed in. This method may modify
the translation that is passed in, if it so wishes. | Returns true if the translation (a tclib.Translation object) is valid,
otherwise false. The language is also passed in. This method may modify
the translation that is passed in, if it so wishes. | [
"Returns",
"true",
"if",
"the",
"translation",
"(",
"a",
"tclib",
".",
"Translation",
"object",
")",
"is",
"valid",
"otherwise",
"false",
".",
"The",
"language",
"is",
"also",
"passed",
"in",
".",
"This",
"method",
"may",
"modify",
"the",
"translation",
"t... | def ValidateAndModify(self, lang, translation):
'''Returns true if the translation (a tclib.Translation object) is valid,
otherwise false. The language is also passed in. This method may modify
the translation that is passed in, if it so wishes.
'''
raise NotImplementedError() | [
"def",
"ValidateAndModify",
"(",
"self",
",",
"lang",
",",
"translation",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/clique.py#L250-L255 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/tensor_shape.py | python | TensorShape.assert_is_fully_defined | (self) | Raises an exception if `self` is not fully defined in every dimension.
Raises:
ValueError: If `self` does not have a known value for every dimension. | Raises an exception if `self` is not fully defined in every dimension. | [
"Raises",
"an",
"exception",
"if",
"self",
"is",
"not",
"fully",
"defined",
"in",
"every",
"dimension",
"."
] | def assert_is_fully_defined(self):
"""Raises an exception if `self` is not fully defined in every dimension.
Raises:
ValueError: If `self` does not have a known value for every dimension.
"""
if not self.is_fully_defined():
raise ValueError("Shape %s is not fully defined" % self) | [
"def",
"assert_is_fully_defined",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_fully_defined",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"Shape %s is not fully defined\"",
"%",
"self",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/tensor_shape.py#L748-L755 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/tools/stats-viewer.py | python | Counter.__init__ | (self, data, offset) | Create a new instance.
Args:
data: the shared data access object containing the counter
offset: the byte offset of the start of this counter | Create a new instance. | [
"Create",
"a",
"new",
"instance",
"."
] | def __init__(self, data, offset):
"""Create a new instance.
Args:
data: the shared data access object containing the counter
offset: the byte offset of the start of this counter
"""
self.data = data
self.offset = offset | [
"def",
"__init__",
"(",
"self",
",",
"data",
",",
"offset",
")",
":",
"self",
".",
"data",
"=",
"data",
"self",
".",
"offset",
"=",
"offset"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/tools/stats-viewer.py#L333-L341 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | uCSIsBopomofo | (code) | return ret | Check whether the character is part of Bopomofo UCS Block | Check whether the character is part of Bopomofo UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Bopomofo",
"UCS",
"Block"
] | def uCSIsBopomofo(code):
"""Check whether the character is part of Bopomofo UCS Block """
ret = libxml2mod.xmlUCSIsBopomofo(code)
return ret | [
"def",
"uCSIsBopomofo",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsBopomofo",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L1366-L1369 | |
kclyu/rpi-webrtc-streamer | e109e418aa9023009b3b59c95eec2de4721125be | tools/telegramBot.py | python | load_config | (config_filename) | If a config file is specified, load the config file.
Even though the config file is not specified, we actually use
the contents of default config for the _PROG_CONFIG global variable. | If a config file is specified, load the config file. | [
"If",
"a",
"config",
"file",
"is",
"specified",
"load",
"the",
"config",
"file",
"."
] | def load_config(config_filename):
""" If a config file is specified, load the config file.
Even though the config file is not specified, we actually use
the contents of default config for the _PROG_CONFIG global variable.
"""
global _PROG_CONFIG, _LOADED_NOTI_SCHEDULE_DAY, _LOADED_NOTI_SCHEDULE_HO... | [
"def",
"load_config",
"(",
"config_filename",
")",
":",
"global",
"_PROG_CONFIG",
",",
"_LOADED_NOTI_SCHEDULE_DAY",
",",
"_LOADED_NOTI_SCHEDULE_HOUR",
"with",
"open",
"(",
"config_filename",
")",
"as",
"fp",
":",
"loaded_config",
"=",
"yaml",
".",
"load",
"(",
"fp... | https://github.com/kclyu/rpi-webrtc-streamer/blob/e109e418aa9023009b3b59c95eec2de4721125be/tools/telegramBot.py#L262-L283 | ||
calamares/calamares | 9f6f82405b3074af7c99dc26487d2e46e4ece3e5 | src/modules/initcpiocfg/main.py | python | get_host_initcpio | () | return mklins | Reads the host system mkinitcpio.conf and returns all
the lines from that file, or an empty list if it does
not exist. | Reads the host system mkinitcpio.conf and returns all
the lines from that file, or an empty list if it does
not exist. | [
"Reads",
"the",
"host",
"system",
"mkinitcpio",
".",
"conf",
"and",
"returns",
"all",
"the",
"lines",
"from",
"that",
"file",
"or",
"an",
"empty",
"list",
"if",
"it",
"does",
"not",
"exist",
"."
] | def get_host_initcpio():
"""
Reads the host system mkinitcpio.conf and returns all
the lines from that file, or an empty list if it does
not exist.
"""
hostfile = "/etc/mkinitcpio.conf"
try:
with open(hostfile, "r") as mkinitcpio_file:
mklins = [x.strip() for x in mkinitc... | [
"def",
"get_host_initcpio",
"(",
")",
":",
"hostfile",
"=",
"\"/etc/mkinitcpio.conf\"",
"try",
":",
"with",
"open",
"(",
"hostfile",
",",
"\"r\"",
")",
"as",
"mkinitcpio_file",
":",
"mklins",
"=",
"[",
"x",
".",
"strip",
"(",
")",
"for",
"x",
"in",
"mkin... | https://github.com/calamares/calamares/blob/9f6f82405b3074af7c99dc26487d2e46e4ece3e5/src/modules/initcpiocfg/main.py#L94-L108 | |
OpenMined/PyDP | a88ee73053aa2bdc1be327a77109dd5907ab41d6 | src/pydp/ml/mechanisms/laplace.py | python | Laplace.check_inputs | (self, value) | return True | Checks that all parameters of the mechanism have been initialised correctly, and that the mechanism is ready
to be used.
Parameters
----------
value : float
The value to be checked
Returns
-------
True if the mechanism is ready to be used.
Rais... | Checks that all parameters of the mechanism have been initialised correctly, and that the mechanism is ready
to be used.
Parameters
----------
value : float
The value to be checked
Returns
-------
True if the mechanism is ready to be used.
Rais... | [
"Checks",
"that",
"all",
"parameters",
"of",
"the",
"mechanism",
"have",
"been",
"initialised",
"correctly",
"and",
"that",
"the",
"mechanism",
"is",
"ready",
"to",
"be",
"used",
".",
"Parameters",
"----------",
"value",
":",
"float",
"The",
"value",
"to",
"... | def check_inputs(self, value):
"""Checks that all parameters of the mechanism have been initialised correctly, and that the mechanism is ready
to be used.
Parameters
----------
value : float
The value to be checked
Returns
-------
True if the m... | [
"def",
"check_inputs",
"(",
"self",
",",
"value",
")",
":",
"super",
"(",
")",
".",
"check_inputs",
"(",
"value",
")",
"if",
"not",
"isinstance",
"(",
"value",
",",
"Real",
")",
":",
"raise",
"TypeError",
"(",
"\"Value to be randomised must be a number\"",
"... | https://github.com/OpenMined/PyDP/blob/a88ee73053aa2bdc1be327a77109dd5907ab41d6/src/pydp/ml/mechanisms/laplace.py#L80-L103 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/pymcuprog/nvmserialupdi.py | python | NvmAccessProviderSerial.read | (self, memory_info, offset, numbytes, max_read_chunk=None) | return data | Read the memory in chunks
:param memory_info: dictionary for the memory as provided by the DeviceMemoryInfo class
:param offset: relative offset in the memory type
:param numbytes: number of bytes to read
:param max_read_chunk: memory is read im chunks of up to 512b at a time. The -rc p... | Read the memory in chunks | [
"Read",
"the",
"memory",
"in",
"chunks"
] | def read(self, memory_info, offset, numbytes, max_read_chunk=None):
"""
Read the memory in chunks
:param memory_info: dictionary for the memory as provided by the DeviceMemoryInfo class
:param offset: relative offset in the memory type
:param numbytes: number of bytes to read
... | [
"def",
"read",
"(",
"self",
",",
"memory_info",
",",
"offset",
",",
"numbytes",
",",
"max_read_chunk",
"=",
"None",
")",
":",
"offset",
"+=",
"memory_info",
"[",
"DeviceMemoryInfoKeys",
".",
"ADDRESS",
"]",
"# if reading from flash, we want to read words if it would r... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pymcuprog/nvmserialupdi.py#L180-L226 | |
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | dev/archery/archery/utils/source.py | python | ArrowSources.archive | (self, path, dereference=False, compressor=None, revision=None) | Saves a git archive at path. | Saves a git archive at path. | [
"Saves",
"a",
"git",
"archive",
"at",
"path",
"."
] | def archive(self, path, dereference=False, compressor=None, revision=None):
""" Saves a git archive at path. """
if not self.git_backed:
raise ValueError("{} is not backed by git".format(self))
rev = revision if revision else "HEAD"
archive = git.archive("--prefix=apache-arr... | [
"def",
"archive",
"(",
"self",
",",
"path",
",",
"dereference",
"=",
"False",
",",
"compressor",
"=",
"None",
",",
"revision",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"git_backed",
":",
"raise",
"ValueError",
"(",
"\"{} is not backed by git\"",
".... | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/dev/archery/archery/utils/source.py#L101-L116 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/sns/connection.py | python | SNSConnection.unsubscribe | (self, subscription) | return self._make_request('Unsubscribe', params) | Allows endpoint owner to delete subscription.
Confirmation message will be delivered.
:type subscription: string
:param subscription: The ARN of the subscription to be deleted. | Allows endpoint owner to delete subscription.
Confirmation message will be delivered. | [
"Allows",
"endpoint",
"owner",
"to",
"delete",
"subscription",
".",
"Confirmation",
"message",
"will",
"be",
"delivered",
"."
] | def unsubscribe(self, subscription):
"""
Allows endpoint owner to delete subscription.
Confirmation message will be delivered.
:type subscription: string
:param subscription: The ARN of the subscription to be deleted.
"""
params = {'SubscriptionArn': subscriptio... | [
"def",
"unsubscribe",
"(",
"self",
",",
"subscription",
")",
":",
"params",
"=",
"{",
"'SubscriptionArn'",
":",
"subscription",
"}",
"return",
"self",
".",
"_make_request",
"(",
"'Unsubscribe'",
",",
"params",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/sns/connection.py#L398-L408 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/context.py | python | _Context.set_env_config_path | (self, env_config_path) | Check and set env_config_path. | Check and set env_config_path. | [
"Check",
"and",
"set",
"env_config_path",
"."
] | def set_env_config_path(self, env_config_path):
"""Check and set env_config_path."""
if not self._context_handle.enable_dump_ir():
raise ValueError("For 'context.set_context', the argument 'env_config_path' is not supported, please "
"enable ENABLE_DUMP_IR with '... | [
"def",
"set_env_config_path",
"(",
"self",
",",
"env_config_path",
")",
":",
"if",
"not",
"self",
".",
"_context_handle",
".",
"enable_dump_ir",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"For 'context.set_context', the argument 'env_config_path' is not supported, please ... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/context.py#L303-L319 | ||
paranoidninja/Pandoras-Box | 91316052a337c3a91da0c6e69f3ba0076436a037 | mingw/share/gcc-6.3.0/python/libstdcxx/v6/printers.py | python | SingleObjContainerPrinter._recognize | (self, type) | return gdb.types.apply_type_recognizers(gdb.types.get_type_recognizers(),
type) or str(type) | Return TYPE as a string after applying type printers | Return TYPE as a string after applying type printers | [
"Return",
"TYPE",
"as",
"a",
"string",
"after",
"applying",
"type",
"printers"
] | def _recognize(self, type):
"""Return TYPE as a string after applying type printers"""
global _use_type_printing
if not _use_type_printing:
return str(type)
return gdb.types.apply_type_recognizers(gdb.types.get_type_recognizers(),
... | [
"def",
"_recognize",
"(",
"self",
",",
"type",
")",
":",
"global",
"_use_type_printing",
"if",
"not",
"_use_type_printing",
":",
"return",
"str",
"(",
"type",
")",
"return",
"gdb",
".",
"types",
".",
"apply_type_recognizers",
"(",
"gdb",
".",
"types",
".",
... | https://github.com/paranoidninja/Pandoras-Box/blob/91316052a337c3a91da0c6e69f3ba0076436a037/mingw/share/gcc-6.3.0/python/libstdcxx/v6/printers.py#L886-L892 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/abseil-cpp-master/abseil-cpp/absl/abseil.podspec.gen.py | python | write_podspec_map | (f, cur_map, depth) | Writes podspec from rule map recursively. | Writes podspec from rule map recursively. | [
"Writes",
"podspec",
"from",
"rule",
"map",
"recursively",
"."
] | def write_podspec_map(f, cur_map, depth):
"""Writes podspec from rule map recursively."""
for key, value in sorted(cur_map.items()):
indent = " " * (depth + 1)
f.write("{indent}{var0}.subspec '{key}' do |{var1}|\n".format(
indent=indent,
key=key,
var0=get_spec_var(depth),
va... | [
"def",
"write_podspec_map",
"(",
"f",
",",
"cur_map",
",",
"depth",
")",
":",
"for",
"key",
",",
"value",
"in",
"sorted",
"(",
"cur_map",
".",
"items",
"(",
")",
")",
":",
"indent",
"=",
"\" \"",
"*",
"(",
"depth",
"+",
"1",
")",
"f",
".",
"writ... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/abseil-cpp-master/abseil-cpp/absl/abseil.podspec.gen.py#L158-L171 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/profiler/parser/integrator.py | python | AscendTimelineGenerator._get_merged_time_list | (self, time_list, get_interval_time=False, display_name="computation_op") | return merged_res_list, interval_display_list, merged_display_list | Get merged time segment list.
The process of merge is, for example, there is a list [[1,5], [2,6], [7,8]],
each items in this list contains a start_time and end_time,
the merged result is [[1,6], [7,8]]. | Get merged time segment list. | [
"Get",
"merged",
"time",
"segment",
"list",
"."
] | def _get_merged_time_list(self, time_list, get_interval_time=False, display_name="computation_op"):
"""
Get merged time segment list.
The process of merge is, for example, there is a list [[1,5], [2,6], [7,8]],
each items in this list contains a start_time and end_time,
the merg... | [
"def",
"_get_merged_time_list",
"(",
"self",
",",
"time_list",
",",
"get_interval_time",
"=",
"False",
",",
"display_name",
"=",
"\"computation_op\"",
")",
":",
"time_merged_segment_list",
"=",
"[",
"]",
"tid",
"=",
"self",
".",
"_tid_dict",
"[",
"display_name",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/profiler/parser/integrator.py#L1459-L1505 | |
LisaAnne/lisa-caffe-public | 49b8643ddef23a4f6120017968de30c45e693f59 | tools/extra/parse_log.py | python | get_line_type | (line) | return line_type | Return either 'test' or 'train' depending on line type | Return either 'test' or 'train' depending on line type | [
"Return",
"either",
"test",
"or",
"train",
"depending",
"on",
"line",
"type"
] | def get_line_type(line):
"""Return either 'test' or 'train' depending on line type
"""
line_type = None
if line.find('Train') != -1:
line_type = 'train'
elif line.find('Test') != -1:
line_type = 'test'
return line_type | [
"def",
"get_line_type",
"(",
"line",
")",
":",
"line_type",
"=",
"None",
"if",
"line",
".",
"find",
"(",
"'Train'",
")",
"!=",
"-",
"1",
":",
"line_type",
"=",
"'train'",
"elif",
"line",
".",
"find",
"(",
"'Test'",
")",
"!=",
"-",
"1",
":",
"line_t... | https://github.com/LisaAnne/lisa-caffe-public/blob/49b8643ddef23a4f6120017968de30c45e693f59/tools/extra/parse_log.py#L16-L25 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.GetViewWhiteSpace | (*args, **kwargs) | return _stc.StyledTextCtrl_GetViewWhiteSpace(*args, **kwargs) | GetViewWhiteSpace(self) -> int
Are white space characters currently visible?
Returns one of SCWS_* constants. | GetViewWhiteSpace(self) -> int | [
"GetViewWhiteSpace",
"(",
"self",
")",
"-",
">",
"int"
] | def GetViewWhiteSpace(*args, **kwargs):
"""
GetViewWhiteSpace(self) -> int
Are white space characters currently visible?
Returns one of SCWS_* constants.
"""
return _stc.StyledTextCtrl_GetViewWhiteSpace(*args, **kwargs) | [
"def",
"GetViewWhiteSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetViewWhiteSpace",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L2169-L2176 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | build/android/android_commands.py | python | AndroidCommands.RunShellCommand | (self, command, timeout_time=20, log_result=True) | return result | Send a command to the adb shell and return the result.
Args:
command: String containing the shell command to send. Must not include
the single quotes as we use them to escape the whole command.
timeout_time: Number of seconds to wait for command to respond before
retrying, used b... | Send a command to the adb shell and return the result. | [
"Send",
"a",
"command",
"to",
"the",
"adb",
"shell",
"and",
"return",
"the",
"result",
"."
] | def RunShellCommand(self, command, timeout_time=20, log_result=True):
"""Send a command to the adb shell and return the result.
Args:
command: String containing the shell command to send. Must not include
the single quotes as we use them to escape the whole command.
timeout_time: Num... | [
"def",
"RunShellCommand",
"(",
"self",
",",
"command",
",",
"timeout_time",
"=",
"20",
",",
"log_result",
"=",
"True",
")",
":",
"logging",
".",
"info",
"(",
"'>>> $'",
"+",
"command",
")",
"if",
"\"'\"",
"in",
"command",
":",
"logging",
".",
"warning",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/build/android/android_commands.py#L305-L325 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/bijectors/affine_linear_operator.py | python | AffineLinearOperator.__init__ | (self,
shift=None,
scale=None,
validate_args=False,
name="affine_linear_operator") | Instantiates the `AffineLinearOperator` bijector.
Args:
shift: Floating-point `Tensor`.
scale: Subclass of `LinearOperator`. Represents the (batch) positive
definite matrix `M` in `R^{k x k}`.
validate_args: Python `bool` indicating whether arguments should be
checked for correct... | Instantiates the `AffineLinearOperator` bijector. | [
"Instantiates",
"the",
"AffineLinearOperator",
"bijector",
"."
] | def __init__(self,
shift=None,
scale=None,
validate_args=False,
name="affine_linear_operator"):
"""Instantiates the `AffineLinearOperator` bijector.
Args:
shift: Floating-point `Tensor`.
scale: Subclass of `LinearOperator`. Represents the... | [
"def",
"__init__",
"(",
"self",
",",
"shift",
"=",
"None",
",",
"scale",
"=",
"None",
",",
"validate_args",
"=",
"False",
",",
"name",
"=",
"\"affine_linear_operator\"",
")",
":",
"self",
".",
"_graph_parents",
"=",
"[",
"]",
"self",
".",
"_name",
"=",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/distributions/python/ops/bijectors/affine_linear_operator.py#L100-L165 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py | python | sparse_column_with_hash_bucket | (column_name,
hash_bucket_size,
combiner="sum") | return _SparseColumnHashed(column_name, hash_bucket_size, combiner) | Creates a _SparseColumn with hashed bucket configuration.
Use this when your sparse features are in string format, but you don't have a
vocab file that maps each string to an integer ID.
output_id = Hash(input_feature_string) % bucket_size
Args:
column_name: A string defining sparse column name.
hash_... | Creates a _SparseColumn with hashed bucket configuration. | [
"Creates",
"a",
"_SparseColumn",
"with",
"hashed",
"bucket",
"configuration",
"."
] | def sparse_column_with_hash_bucket(column_name,
hash_bucket_size,
combiner="sum"):
"""Creates a _SparseColumn with hashed bucket configuration.
Use this when your sparse features are in string format, but you don't have a
vocab file that maps ... | [
"def",
"sparse_column_with_hash_bucket",
"(",
"column_name",
",",
"hash_bucket_size",
",",
"combiner",
"=",
"\"sum\"",
")",
":",
"return",
"_SparseColumnHashed",
"(",
"column_name",
",",
"hash_bucket_size",
",",
"combiner",
")"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column.py#L373-L399 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/internal/python_message.py | python | _AddPropertiesForField | (field, cls) | Adds a public property for a protocol message field.
Clients can use this property to get and (in the case
of non-repeated scalar fields) directly set the value
of a protocol message field.
Args:
field: A FieldDescriptor for this field.
cls: The class we're constructing. | Adds a public property for a protocol message field.
Clients can use this property to get and (in the case
of non-repeated scalar fields) directly set the value
of a protocol message field. | [
"Adds",
"a",
"public",
"property",
"for",
"a",
"protocol",
"message",
"field",
".",
"Clients",
"can",
"use",
"this",
"property",
"to",
"get",
"and",
"(",
"in",
"the",
"case",
"of",
"non",
"-",
"repeated",
"scalar",
"fields",
")",
"directly",
"set",
"the"... | def _AddPropertiesForField(field, cls):
"""Adds a public property for a protocol message field.
Clients can use this property to get and (in the case
of non-repeated scalar fields) directly set the value
of a protocol message field.
Args:
field: A FieldDescriptor for this field.
cls: The class we're ... | [
"def",
"_AddPropertiesForField",
"(",
"field",
",",
"cls",
")",
":",
"# Catch it if we add other types that we should",
"# handle specially here.",
"assert",
"_FieldDescriptor",
".",
"MAX_CPPTYPE",
"==",
"10",
"constant_name",
"=",
"field",
".",
"name",
".",
"upper",
"(... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/python_message.py#L605-L627 | ||
amd/OpenCL-caffe | 638543108517265366c18ae5821f3096cf5cf34a | scripts/cpp_lint.py | python | ParseNolintSuppressions | (filename, raw_line, linenum, error) | Updates the global list of error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, the name of the input file.
raw_line: str, the line of input text, with comments.
... | Updates the global list of error-suppressions. | [
"Updates",
"the",
"global",
"list",
"of",
"error",
"-",
"suppressions",
"."
] | def ParseNolintSuppressions(filename, raw_line, linenum, error):
"""Updates the global list of error-suppressions.
Parses any NOLINT comments on the current line, updating the global
error_suppressions store. Reports an error if the NOLINT comment
was malformed.
Args:
filename: str, the name of the inp... | [
"def",
"ParseNolintSuppressions",
"(",
"filename",
",",
"raw_line",
",",
"linenum",
",",
"error",
")",
":",
"# FIXME(adonovan): \"NOLINT(\" is misparsed as NOLINT(*).",
"matched",
"=",
"_RE_SUPPRESSION",
".",
"search",
"(",
"raw_line",
")",
"if",
"matched",
":",
"if",... | https://github.com/amd/OpenCL-caffe/blob/638543108517265366c18ae5821f3096cf5cf34a/scripts/cpp_lint.py#L464-L492 | ||
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | _CppLintState.ResetErrorCounts | (self) | Sets the module's error statistic back to zero. | Sets the module's error statistic back to zero. | [
"Sets",
"the",
"module",
"s",
"error",
"statistic",
"back",
"to",
"zero",
"."
] | def ResetErrorCounts(self):
"""Sets the module's error statistic back to zero."""
self.error_count = 0
self.errors_by_category = {} | [
"def",
"ResetErrorCounts",
"(",
"self",
")",
":",
"self",
".",
"error_count",
"=",
"0",
"self",
".",
"errors_by_category",
"=",
"{",
"}"
] | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L606-L609 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py | python | OptionMenu.__init__ | (self, master, variable, default=None, *values, **kwargs) | Construct a themed OptionMenu widget with master as the parent,
the resource textvariable set to variable, the initially selected
value specified by the default parameter, the menu values given by
*values and additional keywords.
WIDGET-SPECIFIC OPTIONS
style: stylename
... | Construct a themed OptionMenu widget with master as the parent,
the resource textvariable set to variable, the initially selected
value specified by the default parameter, the menu values given by
*values and additional keywords. | [
"Construct",
"a",
"themed",
"OptionMenu",
"widget",
"with",
"master",
"as",
"the",
"parent",
"the",
"resource",
"textvariable",
"set",
"to",
"variable",
"the",
"initially",
"selected",
"value",
"specified",
"by",
"the",
"default",
"parameter",
"the",
"menu",
"va... | def __init__(self, master, variable, default=None, *values, **kwargs):
"""Construct a themed OptionMenu widget with master as the parent,
the resource textvariable set to variable, the initially selected
value specified by the default parameter, the menu values given by
*values and addit... | [
"def",
"__init__",
"(",
"self",
",",
"master",
",",
"variable",
",",
"default",
"=",
"None",
",",
"*",
"values",
",",
"*",
"*",
"kwargs",
")",
":",
"kw",
"=",
"{",
"'textvariable'",
":",
"variable",
",",
"'style'",
":",
"kwargs",
".",
"pop",
"(",
"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/ttk.py#L1557-L1583 | ||
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | bindings/python/cntk/losses/__init__.py | python | fmeasure | (output, target, beta=1) | return 1 - (1 + beta ** 2) * precision * recall / (beta ** 2 * precision + recall) | This operation computes the f-measure between the output and target. If beta is set as one,
its called the f1-scorce or dice similarity coefficient. f1-scorce is monotonic in jaccard distance.
f-measure = (1 + beta ** 2) * precision * recall / (beta ** 2 * precision + recall)
This loss function is frequen... | This operation computes the f-measure between the output and target. If beta is set as one,
its called the f1-scorce or dice similarity coefficient. f1-scorce is monotonic in jaccard distance. | [
"This",
"operation",
"computes",
"the",
"f",
"-",
"measure",
"between",
"the",
"output",
"and",
"target",
".",
"If",
"beta",
"is",
"set",
"as",
"one",
"its",
"called",
"the",
"f1",
"-",
"scorce",
"or",
"dice",
"similarity",
"coefficient",
".",
"f1",
"-",... | def fmeasure(output, target, beta=1):
"""
This operation computes the f-measure between the output and target. If beta is set as one,
its called the f1-scorce or dice similarity coefficient. f1-scorce is monotonic in jaccard distance.
f-measure = (1 + beta ** 2) * precision * recall / (beta ** 2 * prec... | [
"def",
"fmeasure",
"(",
"output",
",",
"target",
",",
"beta",
"=",
"1",
")",
":",
"assert",
"len",
"(",
"target",
".",
"shape",
")",
"==",
"len",
"(",
"output",
".",
"shape",
")",
"if",
"len",
"(",
"output",
".",
"shape",
")",
"==",
"3",
":",
"... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/losses/__init__.py#L424-L456 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | TextAttr.Apply | (*args, **kwargs) | return _controls_.TextAttr_Apply(*args, **kwargs) | Apply(self, TextAttr style, TextAttr compareWith=None) -> bool | Apply(self, TextAttr style, TextAttr compareWith=None) -> bool | [
"Apply",
"(",
"self",
"TextAttr",
"style",
"TextAttr",
"compareWith",
"=",
"None",
")",
"-",
">",
"bool"
] | def Apply(*args, **kwargs):
"""Apply(self, TextAttr style, TextAttr compareWith=None) -> bool"""
return _controls_.TextAttr_Apply(*args, **kwargs) | [
"def",
"Apply",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_Apply",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L1912-L1914 | |
etodd/lasercrabs | 91484d9ac3a47ac38b8f40ec3ff35194714dad8e | assets/script/etodd_blender_fbx/fbx_utils.py | python | elem_props_template_init | (templates, template_type) | return ret | Init a writing template of given type, for *one* element's properties. | Init a writing template of given type, for *one* element's properties. | [
"Init",
"a",
"writing",
"template",
"of",
"given",
"type",
"for",
"*",
"one",
"*",
"element",
"s",
"properties",
"."
] | def elem_props_template_init(templates, template_type):
"""
Init a writing template of given type, for *one* element's properties.
"""
ret = OrderedDict()
tmpl = templates.get(template_type)
if tmpl is not None:
written = tmpl.written[0]
props = tmpl.properties
ret = Orde... | [
"def",
"elem_props_template_init",
"(",
"templates",
",",
"template_type",
")",
":",
"ret",
"=",
"OrderedDict",
"(",
")",
"tmpl",
"=",
"templates",
".",
"get",
"(",
"template_type",
")",
"if",
"tmpl",
"is",
"not",
"None",
":",
"written",
"=",
"tmpl",
".",
... | https://github.com/etodd/lasercrabs/blob/91484d9ac3a47ac38b8f40ec3ff35194714dad8e/assets/script/etodd_blender_fbx/fbx_utils.py#L613-L623 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/gensuitemodule.py | python | processfile | (fullname, output=None, basepkgname=None,
edit_modnames=None, creatorsignature=None, dump=None,
verbose=None) | Ask an application for its terminology and process that | Ask an application for its terminology and process that | [
"Ask",
"an",
"application",
"for",
"its",
"terminology",
"and",
"process",
"that"
] | def processfile(fullname, output=None, basepkgname=None,
edit_modnames=None, creatorsignature=None, dump=None,
verbose=None):
"""Ask an application for its terminology and process that"""
if not is_scriptable(fullname) and verbose:
print >>verbose, "Warning: app does not seem scriptable:... | [
"def",
"processfile",
"(",
"fullname",
",",
"output",
"=",
"None",
",",
"basepkgname",
"=",
"None",
",",
"edit_modnames",
"=",
"None",
",",
"creatorsignature",
"=",
"None",
",",
"dump",
"=",
"None",
",",
"verbose",
"=",
"None",
")",
":",
"if",
"not",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/gensuitemodule.py#L186-L225 | ||
tiny-dnn/tiny-dnn | c0f576f5cb7b35893f62127cb7aec18f77a3bcc5 | third_party/cpplint.py | python | FilesBelongToSameModule | (filename_cc, filename_h) | return files_belong_to_same_module, common_path | Check if these two filenames belong to the same module.
The concept of a 'module' here is a as follows:
foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
same 'module' if they are in the same directory.
some/path/public/xyzzy and some/path/internal/xyzzy are also considered
to belong to... | Check if these two filenames belong to the same module. | [
"Check",
"if",
"these",
"two",
"filenames",
"belong",
"to",
"the",
"same",
"module",
"."
] | def FilesBelongToSameModule(filename_cc, filename_h):
"""Check if these two filenames belong to the same module.
The concept of a 'module' here is a as follows:
foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
same 'module' if they are in the same directory.
some/path/public/xyzzy and ... | [
"def",
"FilesBelongToSameModule",
"(",
"filename_cc",
",",
"filename_h",
")",
":",
"fileinfo_cc",
"=",
"FileInfo",
"(",
"filename_cc",
")",
"if",
"not",
"fileinfo_cc",
".",
"Extension",
"(",
")",
".",
"lstrip",
"(",
"'.'",
")",
"in",
"GetNonHeaderExtensions",
... | https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/cpplint.py#L5571-L5626 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/symbol/symbol.py | python | Symbol.expm1 | (self, *args, **kwargs) | return op.expm1(self, *args, **kwargs) | Convenience fluent method for :py:func:`expm1`.
The arguments are the same as for :py:func:`expm1`, with
this array as data. | Convenience fluent method for :py:func:`expm1`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"expm1",
"."
] | def expm1(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`expm1`.
The arguments are the same as for :py:func:`expm1`, with
this array as data.
"""
return op.expm1(self, *args, **kwargs) | [
"def",
"expm1",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"expm1",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/symbol.py#L2485-L2491 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/fx/operator_schemas.py | python | normalize_module | (
root: torch.nn.Module, target: str, args: Tuple[Any], kwargs : Optional[Dict[str, Any]] = None,
normalize_to_only_use_kwargs : bool = False) | return None | Returns normalized arguments to PyTorch modules. This means that
`args/kwargs` will be matched up to the functional's
signature and return exclusively kwargs in positional order if
`normalize_to_only_use_kwargs` is True.
Also populates default values. Does not support positional-only
parameters or v... | Returns normalized arguments to PyTorch modules. This means that
`args/kwargs` will be matched up to the functional's
signature and return exclusively kwargs in positional order if
`normalize_to_only_use_kwargs` is True.
Also populates default values. Does not support positional-only
parameters or v... | [
"Returns",
"normalized",
"arguments",
"to",
"PyTorch",
"modules",
".",
"This",
"means",
"that",
"args",
"/",
"kwargs",
"will",
"be",
"matched",
"up",
"to",
"the",
"functional",
"s",
"signature",
"and",
"return",
"exclusively",
"kwargs",
"in",
"positional",
"or... | def normalize_module(
root: torch.nn.Module, target: str, args: Tuple[Any], kwargs : Optional[Dict[str, Any]] = None,
normalize_to_only_use_kwargs : bool = False) -> Optional[ArgsKwargsPair]:
"""
Returns normalized arguments to PyTorch modules. This means that
`args/kwargs` will be matched u... | [
"def",
"normalize_module",
"(",
"root",
":",
"torch",
".",
"nn",
".",
"Module",
",",
"target",
":",
"str",
",",
"args",
":",
"Tuple",
"[",
"Any",
"]",
",",
"kwargs",
":",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"Any",
"]",
"]",
"=",
"None",
","... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/operator_schemas.py#L327-L363 | |
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/inputs/normalmodes.py | python | InputNormalModes.__init__ | (self, help=None, dimension=None, default=None, dtype=None) | Initializes InputNormalModes.
Just calls the parent initialization function with appropriate arguments. | Initializes InputNormalModes. | [
"Initializes",
"InputNormalModes",
"."
] | def __init__(self, help=None, dimension=None, default=None, dtype=None):
""" Initializes InputNormalModes.
Just calls the parent initialization function with appropriate arguments.
"""
super(InputNormalModes,self).__init__(help=help, default=default, dtype=float, dimension="frequency") | [
"def",
"__init__",
"(",
"self",
",",
"help",
"=",
"None",
",",
"dimension",
"=",
"None",
",",
"default",
"=",
"None",
",",
"dtype",
"=",
"None",
")",
":",
"super",
"(",
"InputNormalModes",
",",
"self",
")",
".",
"__init__",
"(",
"help",
"=",
"help",
... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/inputs/normalmodes.py#L56-L62 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/terminal/ipapp.py | python | TerminalIPythonApp._classes_default | (self) | return [
InteractiveShellApp, # ShellApp comes before TerminalApp, because
self.__class__, # it will also affect subclasses (e.g. QtConsole)
TerminalInteractiveShell,
HistoryManager,
ProfileDir,
PlainTextFormatter,
IPCompleter,
... | This has to be in a method, for TerminalIPythonApp to be available. | This has to be in a method, for TerminalIPythonApp to be available. | [
"This",
"has",
"to",
"be",
"in",
"a",
"method",
"for",
"TerminalIPythonApp",
"to",
"be",
"available",
"."
] | def _classes_default(self):
"""This has to be in a method, for TerminalIPythonApp to be available."""
return [
InteractiveShellApp, # ShellApp comes before TerminalApp, because
self.__class__, # it will also affect subclasses (e.g. QtConsole)
TerminalInteractiveS... | [
"def",
"_classes_default",
"(",
"self",
")",
":",
"return",
"[",
"InteractiveShellApp",
",",
"# ShellApp comes before TerminalApp, because",
"self",
".",
"__class__",
",",
"# it will also affect subclasses (e.g. QtConsole)",
"TerminalInteractiveShell",
",",
"HistoryManager",
",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/terminal/ipapp.py#L196-L209 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/util/connection.py | python | is_connection_dropped | (conn) | Returns True if the connection is dropped and should be closed.
:param conn:
:class:`http.client.HTTPConnection` object.
Note: For platforms like AppEngine, this will always return ``False`` to
let the platform handle connection recycling transparently for us. | Returns True if the connection is dropped and should be closed. | [
"Returns",
"True",
"if",
"the",
"connection",
"is",
"dropped",
"and",
"should",
"be",
"closed",
"."
] | def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connection is dropped and should be closed.
:param conn:
:class:`http.client.HTTPConnection` object.
Note: For platforms like AppEngine, this will always return ``False`` to
let the platform handle connection rec... | [
"def",
"is_connection_dropped",
"(",
"conn",
")",
":",
"# Platform-specific",
"sock",
"=",
"getattr",
"(",
"conn",
",",
"\"sock\"",
",",
"False",
")",
"if",
"sock",
"is",
"False",
":",
"# Platform-specific: AppEngine",
"return",
"False",
"if",
"sock",
"is",
"N... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/util/connection.py#L12-L31 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.