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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/optimize/zeros.py | python | brenth | (f, a, b, args=(),
xtol=_xtol, rtol=_rtol, maxiter=_iter,
full_output=False, disp=True) | return results_c(full_output, r) | Find root of f in [a,b].
A variation on the classic Brent routine to find a zero of the function f
between the arguments a and b that uses hyperbolic extrapolation instead of
inverse quadratic extrapolation. There was a paper back in the 1980's ...
f(a) and f(b) cannot have the same signs. Generally on... | Find root of f in [a,b]. | [
"Find",
"root",
"of",
"f",
"in",
"[",
"a",
"b",
"]",
"."
] | def brenth(f, a, b, args=(),
xtol=_xtol, rtol=_rtol, maxiter=_iter,
full_output=False, disp=True):
"""Find root of f in [a,b].
A variation on the classic Brent routine to find a zero of the function f
between the arguments a and b that uses hyperbolic extrapolation instead of
inve... | [
"def",
"brenth",
"(",
"f",
",",
"a",
",",
"b",
",",
"args",
"=",
"(",
")",
",",
"xtol",
"=",
"_xtol",
",",
"rtol",
"=",
"_rtol",
",",
"maxiter",
"=",
"_iter",
",",
"full_output",
"=",
"False",
",",
"disp",
"=",
"True",
")",
":",
"if",
"not",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/zeros.py#L446-L529 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/xcode_emulation.py | python | XcodeSettings.GetProductName | (self) | return self.spec.get('product_name', self.spec['target_name']) | Returns PRODUCT_NAME. | Returns PRODUCT_NAME. | [
"Returns",
"PRODUCT_NAME",
"."
] | def GetProductName(self):
"""Returns PRODUCT_NAME."""
return self.spec.get('product_name', self.spec['target_name']) | [
"def",
"GetProductName",
"(",
"self",
")",
":",
"return",
"self",
".",
"spec",
".",
"get",
"(",
"'product_name'",
",",
"self",
".",
"spec",
"[",
"'target_name'",
"]",
")"
] | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/xcode_emulation.py#L84-L86 | |
kevin-ssy/Optical-Flow-Guided-Feature | 07d4501a29002ee7821c38c1820e4a64c1acf6e8 | lib/caffe-action/scripts/cpp_lint.py | python | ProcessLine | (filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]) | Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
clean_lines: An array of strings, each representing a line of the file,
with comments stripped.
line: Number of line being ... | Processes a single line in the file. | [
"Processes",
"a",
"single",
"line",
"in",
"the",
"file",
"."
] | def ProcessLine(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]):
"""Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (d... | [
"def",
"ProcessLine",
"(",
"filename",
",",
"file_extension",
",",
"clean_lines",
",",
"line",
",",
"include_state",
",",
"function_state",
",",
"nesting_state",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"raw_lines",
"=",
"clean_lines"... | https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/scripts/cpp_lint.py#L4600-L4642 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/MimeWriter.py | python | MimeWriter.startmultipartbody | (self, subtype, boundary=None, plist=[], prefix=1) | return self.startbody("multipart/" + subtype,
[("boundary", self._boundary)] + plist,
prefix=prefix) | Returns a file-like object for writing the body of the message.
Additionally, this method initializes the multi-part code, where the
subtype parameter provides the multipart subtype, the boundary
parameter may provide a user-defined boundary specification, and the
plist parameter provid... | Returns a file-like object for writing the body of the message. | [
"Returns",
"a",
"file",
"-",
"like",
"object",
"for",
"writing",
"the",
"body",
"of",
"the",
"message",
"."
] | def startmultipartbody(self, subtype, boundary=None, plist=[], prefix=1):
"""Returns a file-like object for writing the body of the message.
Additionally, this method initializes the multi-part code, where the
subtype parameter provides the multipart subtype, the boundary
parameter may ... | [
"def",
"startmultipartbody",
"(",
"self",
",",
"subtype",
",",
"boundary",
"=",
"None",
",",
"plist",
"=",
"[",
"]",
",",
"prefix",
"=",
"1",
")",
":",
"self",
".",
"_boundary",
"=",
"boundary",
"or",
"mimetools",
".",
"choose_boundary",
"(",
")",
"ret... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/MimeWriter.py#L145-L161 | |
bryanyzhu/Hidden-Two-Stream | f7f684adbdacb6df6b1cf196c3a476cd23484a0f | scripts/cpp_lint.py | python | RemoveMultiLineComments | (filename, lines, error) | Removes multiline (c-style) comments from lines. | Removes multiline (c-style) comments from lines. | [
"Removes",
"multiline",
"(",
"c",
"-",
"style",
")",
"comments",
"from",
"lines",
"."
] | def RemoveMultiLineComments(filename, lines, error):
"""Removes multiline (c-style) comments from lines."""
lineix = 0
while lineix < len(lines):
lineix_begin = FindNextMultiLineCommentStart(lines, lineix)
if lineix_begin >= len(lines):
return
lineix_end = FindNextMultiLineCommentEnd(lines, line... | [
"def",
"RemoveMultiLineComments",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"lineix",
"=",
"0",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"lineix_begin",
"=",
"FindNextMultiLineCommentStart",
"(",
"lines",
",",
"lineix",
")",
"if",
... | https://github.com/bryanyzhu/Hidden-Two-Stream/blob/f7f684adbdacb6df6b1cf196c3a476cd23484a0f/scripts/cpp_lint.py#L1151-L1164 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/difflib.py | python | _format_range_context | (start, stop) | return '{},{}'.format(beginning, beginning + length - 1) | Convert range to the "ed" format | Convert range to the "ed" format | [
"Convert",
"range",
"to",
"the",
"ed",
"format"
] | def _format_range_context(start, stop):
'Convert range to the "ed" format'
# Per the diff spec at http://www.unix.org/single_unix_specification/
beginning = start + 1 # lines start numbering with one
length = stop - start
if not length:
beginning -= 1 # empty ranges begin at line ... | [
"def",
"_format_range_context",
"(",
"start",
",",
"stop",
")",
":",
"# Per the diff spec at http://www.unix.org/single_unix_specification/",
"beginning",
"=",
"start",
"+",
"1",
"# lines start numbering with one",
"length",
"=",
"stop",
"-",
"start",
"if",
"not",
"length... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/difflib.py#L1230-L1239 | |
ucsb-seclab/dr_checker | fe3f1cda247a10a4952e372f1e240709fe4be462 | visualizer/server/utils.py | python | isContextAnalysisPresent | (config, analysis_name) | return False | Check if the analysys specified in analysis_name
has produced some result for CONTEXT
:param config: configuration of the flask app
:param analysis_name: name of the analysis we want to check | Check if the analysys specified in analysis_name
has produced some result for CONTEXT
:param config: configuration of the flask app
:param analysis_name: name of the analysis we want to check | [
"Check",
"if",
"the",
"analysys",
"specified",
"in",
"analysis_name",
"has",
"produced",
"some",
"result",
"for",
"CONTEXT",
":",
"param",
"config",
":",
"configuration",
"of",
"the",
"flask",
"app",
":",
"param",
"analysis_name",
":",
"name",
"of",
"the",
"... | def isContextAnalysisPresent(config, analysis_name):
"""
Check if the analysys specified in analysis_name
has produced some result for CONTEXT
:param config: configuration of the flask app
:param analysis_name: name of the analysis we want to check
"""
analysis_by_context_file_path = os.path... | [
"def",
"isContextAnalysisPresent",
"(",
"config",
",",
"analysis_name",
")",
":",
"analysis_by_context_file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"config",
"[",
"\"RESULTS_DIR\"",
"]",
",",
"analysis_name",
")",
"if",
"os",
".",
"path",
".",
"exists... | https://github.com/ucsb-seclab/dr_checker/blob/fe3f1cda247a10a4952e372f1e240709fe4be462/visualizer/server/utils.py#L7-L28 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBBreakpoint.__ne__ | (self, rhs) | return _lldb.SBBreakpoint___ne__(self, rhs) | __ne__(SBBreakpoint self, SBBreakpoint rhs) -> bool | __ne__(SBBreakpoint self, SBBreakpoint rhs) -> bool | [
"__ne__",
"(",
"SBBreakpoint",
"self",
"SBBreakpoint",
"rhs",
")",
"-",
">",
"bool"
] | def __ne__(self, rhs):
"""__ne__(SBBreakpoint self, SBBreakpoint rhs) -> bool"""
return _lldb.SBBreakpoint___ne__(self, rhs) | [
"def",
"__ne__",
"(",
"self",
",",
"rhs",
")",
":",
"return",
"_lldb",
".",
"SBBreakpoint___ne__",
"(",
"self",
",",
"rhs",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L1520-L1522 | |
9miao/CrossApp | 1f5375e061bf69841eb19728598f5ae3f508d620 | tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | Cursor.enum_value | (self) | return self._enum_value | Return the value of an enum constant. | Return the value of an enum constant. | [
"Return",
"the",
"value",
"of",
"an",
"enum",
"constant",
"."
] | def enum_value(self):
"""Return the value of an enum constant."""
if not hasattr(self, '_enum_value'):
assert self.kind == CursorKind.ENUM_CONSTANT_DECL
# Figure out the underlying type of the enum to know if it
# is a signed or unsigned quantity.
underlyi... | [
"def",
"enum_value",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_enum_value'",
")",
":",
"assert",
"self",
".",
"kind",
"==",
"CursorKind",
".",
"ENUM_CONSTANT_DECL",
"# Figure out the underlying type of the enum to know if it",
"# is a signed ... | https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L1210-L1232 | |
OpenGenus/quark | 225ad96efdfcc66cb6584a756c17eb3871e6eb62 | code/code/compression/src/lossless_compression/lempel-ziv-welch/lzw.py | python | compress | (input_string) | return result | Compresses the given input string | Compresses the given input string | [
"Compresses",
"the",
"given",
"input",
"string"
] | def compress(input_string):
"""Compresses the given input string"""
#Build the dictionary
dict_size = 256 #All ASCII characters
dictionary = {chr(i): i for i in range(dict_size)}
buffer = ""
result = []
for ch in input_string:
tmp = buffer + ch
if tmp in dictionary:
... | [
"def",
"compress",
"(",
"input_string",
")",
":",
"#Build the dictionary",
"dict_size",
"=",
"256",
"#All ASCII characters",
"dictionary",
"=",
"{",
"chr",
"(",
"i",
")",
":",
"i",
"for",
"i",
"in",
"range",
"(",
"dict_size",
")",
"}",
"buffer",
"=",
"\"\"... | https://github.com/OpenGenus/quark/blob/225ad96efdfcc66cb6584a756c17eb3871e6eb62/code/code/compression/src/lossless_compression/lempel-ziv-welch/lzw.py#L3-L23 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py | python | X509.get_notAfter | (self) | return self._get_boundary_time(_lib.X509_get_notAfter) | Get the timestamp at which the certificate stops being valid.
The timestamp is formatted as an ASN.1 TIME::
YYYYMMDDhhmmssZ
:return: A timestamp string, or ``None`` if there is none.
:rtype: bytes or NoneType | Get the timestamp at which the certificate stops being valid. | [
"Get",
"the",
"timestamp",
"at",
"which",
"the",
"certificate",
"stops",
"being",
"valid",
"."
] | def get_notAfter(self):
"""
Get the timestamp at which the certificate stops being valid.
The timestamp is formatted as an ASN.1 TIME::
YYYYMMDDhhmmssZ
:return: A timestamp string, or ``None`` if there is none.
:rtype: bytes or NoneType
"""
return s... | [
"def",
"get_notAfter",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_boundary_time",
"(",
"_lib",
".",
"X509_get_notAfter",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/crypto.py#L1367-L1378 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/mapreduce/mapreduce/tools/gcs_file_seg_reader.py | python | _GCSFileSegReader.__init__ | (self, seg_prefix, last_seg_index) | Init.
Instances are pickle safe.
Args:
seg_prefix: filename prefix for all segs. It is expected
seg_prefix + index = seg filename.
last_seg_index: the last index of all segs. int. | Init. | [
"Init",
"."
] | def __init__(self, seg_prefix, last_seg_index):
"""Init.
Instances are pickle safe.
Args:
seg_prefix: filename prefix for all segs. It is expected
seg_prefix + index = seg filename.
last_seg_index: the last index of all segs. int.
"""
self._EOF = False
self._offset = 0
... | [
"def",
"__init__",
"(",
"self",
",",
"seg_prefix",
",",
"last_seg_index",
")",
":",
"self",
".",
"_EOF",
"=",
"False",
"self",
".",
"_offset",
"=",
"0",
"# fields related to seg.",
"self",
".",
"_seg_prefix",
"=",
"seg_prefix",
"self",
".",
"_last_seg_index",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/mapreduce/mapreduce/tools/gcs_file_seg_reader.py#L28-L47 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_options_view.py | python | GeneralFittingOptionsView.simultaneous_fitting_mode | (self) | return self.simul_fit_checkbox.isChecked() | Returns true if in simultaneous mode. | Returns true if in simultaneous mode. | [
"Returns",
"true",
"if",
"in",
"simultaneous",
"mode",
"."
] | def simultaneous_fitting_mode(self) -> bool:
"""Returns true if in simultaneous mode."""
return self.simul_fit_checkbox.isChecked() | [
"def",
"simultaneous_fitting_mode",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"simul_fit_checkbox",
".",
"isChecked",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_options_view.py#L77-L79 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/codecs.py | python | StreamWriter.reset | (self) | Flushes and resets the codec buffers used for keeping state.
Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recover state. | Flushes and resets the codec buffers used for keeping state. | [
"Flushes",
"and",
"resets",
"the",
"codec",
"buffers",
"used",
"for",
"keeping",
"state",
"."
] | def reset(self):
""" Flushes and resets the codec buffers used for keeping state.
Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recove... | [
"def",
"reset",
"(",
"self",
")",
":",
"pass"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/codecs.py#L361-L371 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/cluster/ClusterServer.py | python | ClusterServer.handleSelectedMovement | (self, dgi) | Update cameraJig position to reflect latest position | Update cameraJig position to reflect latest position | [
"Update",
"cameraJig",
"position",
"to",
"reflect",
"latest",
"position"
] | def handleSelectedMovement(self, dgi):
""" Update cameraJig position to reflect latest position """
(x, y, z, h, p, r, sx, sy, sz) = self.msgHandler.parseSelectedMovementDatagram(
dgi)
if last:
last.setPosHprScale(x, y, z, h, p, r, sx, sy, sz) | [
"def",
"handleSelectedMovement",
"(",
"self",
",",
"dgi",
")",
":",
"(",
"x",
",",
"y",
",",
"z",
",",
"h",
",",
"p",
",",
"r",
",",
"sx",
",",
"sy",
",",
"sz",
")",
"=",
"self",
".",
"msgHandler",
".",
"parseSelectedMovementDatagram",
"(",
"dgi",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/cluster/ClusterServer.py#L327-L332 | ||
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/se2.py | python | Se2.__mul__ | (self, right) | left-multiplication
either rotation concatenation or point-transform | left-multiplication
either rotation concatenation or point-transform | [
"left",
"-",
"multiplication",
"either",
"rotation",
"concatenation",
"or",
"point",
"-",
"transform"
] | def __mul__(self, right):
""" left-multiplication
either rotation concatenation or point-transform """
if isinstance(right, sympy.Matrix):
assert right.shape == (2, 1), right.shape
return self.so2 * right + self.t
elif isinstance(right, Se2):
retur... | [
"def",
"__mul__",
"(",
"self",
",",
"right",
")",
":",
"if",
"isinstance",
"(",
"right",
",",
"sympy",
".",
"Matrix",
")",
":",
"assert",
"right",
".",
"shape",
"==",
"(",
"2",
",",
"1",
")",
",",
"right",
".",
"shape",
"return",
"self",
".",
"so... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/se2.py#L56-L65 | ||
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/vimeo/vimeo_api.py | python | Videos._initLogger | (self) | return logger | Setups a logger using the logging module, returns a log object | Setups a logger using the logging module, returns a log object | [
"Setups",
"a",
"logger",
"using",
"the",
"logging",
"module",
"returns",
"a",
"log",
"object"
] | def _initLogger(self):
"""Setups a logger using the logging module, returns a log object
"""
logger = logging.getLogger(self.log_name)
formatter = logging.Formatter('%(asctime)s) %(levelname)s %(message)s')
hdlr = logging.StreamHandler(sys.stdout)
hdlr.setFormatter(form... | [
"def",
"_initLogger",
"(",
"self",
")",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"self",
".",
"log_name",
")",
"formatter",
"=",
"logging",
".",
"Formatter",
"(",
"'%(asctime)s) %(levelname)s %(message)s'",
")",
"hdlr",
"=",
"logging",
".",
"Strea... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/vimeo/vimeo_api.py#L804-L819 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPML_TAGGED_PCR_PROPERTY.GetUnionSelector | (self) | return TPM_CAP.PCR_PROPERTIES | TpmUnion method | TpmUnion method | [
"TpmUnion",
"method"
] | def GetUnionSelector(self): # TPM_CAP
""" TpmUnion method """
return TPM_CAP.PCR_PROPERTIES | [
"def",
"GetUnionSelector",
"(",
"self",
")",
":",
"# TPM_CAP",
"return",
"TPM_CAP",
".",
"PCR_PROPERTIES"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4783-L4785 | |
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py | python | IgnoreArg.equals | (self, unused_rhs) | return True | Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True | Ignores arguments and returns True. | [
"Ignores",
"arguments",
"and",
"returns",
"True",
"."
] | def equals(self, unused_rhs):
"""Ignores arguments and returns True.
Args:
unused_rhs: any python object
Returns:
always returns True
"""
return True | [
"def",
"equals",
"(",
"self",
",",
"unused_rhs",
")",
":",
"return",
"True"
] | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/mox.py#L1166-L1176 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/tools/build/src/build/targets.py | python | TargetRegistry.create_typed_target | (self, type, project, name, sources, requirements, default_build, usage_requirements) | return self.main_target_alternative (TypedTarget (name, project, type,
self.main_target_sources (sources, name),
self.main_target_requirements (requirements, project),
self.main_target_default_build (default_build, project),
self.main_target_usage_requirements (usage_requ... | Creates a TypedTarget with the specified properties.
The 'name', 'sources', 'requirements', 'default_build' and
'usage_requirements' are assumed to be in the form specified
by the user in Jamfile corresponding to 'project'. | Creates a TypedTarget with the specified properties.
The 'name', 'sources', 'requirements', 'default_build' and
'usage_requirements' are assumed to be in the form specified
by the user in Jamfile corresponding to 'project'. | [
"Creates",
"a",
"TypedTarget",
"with",
"the",
"specified",
"properties",
".",
"The",
"name",
"sources",
"requirements",
"default_build",
"and",
"usage_requirements",
"are",
"assumed",
"to",
"be",
"in",
"the",
"form",
"specified",
"by",
"the",
"user",
"in",
"Jamf... | def create_typed_target (self, type, project, name, sources, requirements, default_build, usage_requirements):
""" Creates a TypedTarget with the specified properties.
The 'name', 'sources', 'requirements', 'default_build' and
'usage_requirements' are assumed to be in the form specified
... | [
"def",
"create_typed_target",
"(",
"self",
",",
"type",
",",
"project",
",",
"name",
",",
"sources",
",",
"requirements",
",",
"default_build",
",",
"usage_requirements",
")",
":",
"assert",
"isinstance",
"(",
"type",
",",
"basestring",
")",
"assert",
"isinsta... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/build/targets.py#L222-L237 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/extensions/autolink.py | python | RenderLinkBase._createOptionalContent | (self, parent, token, page) | Renders text without link for optional link. | Renders text without link for optional link. | [
"Renders",
"text",
"without",
"link",
"for",
"optional",
"link",
"."
] | def _createOptionalContent(self, parent, token, page):
"""Renders text without link for optional link."""
tok = tokens.Token(None)
token.copyToToken(tok)
if len(tok) == 0: # Use filename if no children exist
tokens.String(tok, content=token['page'])
self.renderer.rend... | [
"def",
"_createOptionalContent",
"(",
"self",
",",
"parent",
",",
"token",
",",
"page",
")",
":",
"tok",
"=",
"tokens",
".",
"Token",
"(",
"None",
")",
"token",
".",
"copyToToken",
"(",
"tok",
")",
"if",
"len",
"(",
"tok",
")",
"==",
"0",
":",
"# U... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/extensions/autolink.py#L175-L181 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/array_ops.py | python | quantize_and_dequantize_v2 | (
input, # pylint: disable=redefined-builtin
input_min,
input_max,
signed_input=True,
num_bits=8,
range_given=False,
round_mode="HALF_TO_EVEN",
name=None,
narrow_range=False,
axis=None) | return gen_array_ops.quantize_and_dequantize_v4(
input,
input_min=input_min,
input_max=input_max,
signed_input=signed_input,
num_bits=num_bits,
range_given=range_given,
round_mode=round_mode,
narrow_range=narrow_range,
axis=axis,
name=name) | Quantizes then dequantizes a tensor.
Updates the gradient definition for quantization that is outside the range to
be 0.To simulate the V1 the behavior of
tf.quantization.quantize_and_dequantize(...) use
tf.grad_pass_through(tf.quantization.quantize_and_dequantize_v2)(...).
Example usage:
```python
def... | Quantizes then dequantizes a tensor. | [
"Quantizes",
"then",
"dequantizes",
"a",
"tensor",
"."
] | def quantize_and_dequantize_v2(
input, # pylint: disable=redefined-builtin
input_min,
input_max,
signed_input=True,
num_bits=8,
range_given=False,
round_mode="HALF_TO_EVEN",
name=None,
narrow_range=False,
axis=None):
"""Quantizes then dequantizes a tensor.
Updates the gradi... | [
"def",
"quantize_and_dequantize_v2",
"(",
"input",
",",
"# pylint: disable=redefined-builtin",
"input_min",
",",
"input_max",
",",
"signed_input",
"=",
"True",
",",
"num_bits",
"=",
"8",
",",
"range_given",
"=",
"False",
",",
"round_mode",
"=",
"\"HALF_TO_EVEN\"",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/array_ops.py#L6270-L6352 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags_validators.py | python | Validator.__init__ | (self, checker, message) | Constructor to create all validators.
Args:
checker: function to verify the constraint.
Input of this method varies, see SimpleValidator and
DictionaryValidator for a detailed description.
message: string, error message to be shown to the user | Constructor to create all validators. | [
"Constructor",
"to",
"create",
"all",
"validators",
"."
] | def __init__(self, checker, message):
"""Constructor to create all validators.
Args:
checker: function to verify the constraint.
Input of this method varies, see SimpleValidator and
DictionaryValidator for a detailed description.
message: string, error message to be shown to the u... | [
"def",
"__init__",
"(",
"self",
",",
"checker",
",",
"message",
")",
":",
"self",
".",
"checker",
"=",
"checker",
"self",
".",
"message",
"=",
"message",
"Validator",
".",
"validators_count",
"+=",
"1",
"# Used to assert validators in the order they were registered ... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags_validators.py#L55-L68 | ||
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/configuration/configuration.py | python | Configuration.namespaceObjects | (self) | return self.namespaceObjects_ | Return the namespace of classes inherited from
ObjectHandler::Object. | Return the namespace of classes inherited from
ObjectHandler::Object. | [
"Return",
"the",
"namespace",
"of",
"classes",
"inherited",
"from",
"ObjectHandler",
"::",
"Object",
"."
] | def namespaceObjects(self):
"""Return the namespace of classes inherited from
ObjectHandler::Object."""
return self.namespaceObjects_ | [
"def",
"namespaceObjects",
"(",
"self",
")",
":",
"return",
"self",
".",
"namespaceObjects_"
] | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/configuration/configuration.py#L36-L39 | |
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | PUTSTRHandler.WriteGLES2Implementation | (self, func, f) | Overrriden from TypeHandler. | Overrriden from TypeHandler. | [
"Overrriden",
"from",
"TypeHandler",
"."
] | def WriteGLES2Implementation(self, func, f):
"""Overrriden from TypeHandler."""
f.write("%s GLES2Implementation::%s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
f.write(" GPU_CLIENT_SINGLE_THREAD_CHECK();\n")
func.WriteDestinatio... | [
"def",
"WriteGLES2Implementation",
"(",
"self",
",",
"func",
",",
"f",
")",
":",
"f",
".",
"write",
"(",
"\"%s GLES2Implementation::%s(%s) {\\n\"",
"%",
"(",
"func",
".",
"return_type",
",",
"func",
".",
"original_name",
",",
"func",
".",
"MakeTypedOriginalArgSt... | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L7607-L7668 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/mindrecord/tools/tfrecord_to_mr.py | python | TFRecordToMR._check_input | (self, source, destination, feature_dict) | Validation check for inputs of init method | Validation check for inputs of init method | [
"Validation",
"check",
"for",
"inputs",
"of",
"init",
"method"
] | def _check_input(self, source, destination, feature_dict):
"""Validation check for inputs of init method"""
if not isinstance(source, str):
raise ValueError("Parameter source must be string.")
check_filename(source, "source")
if not isinstance(destination, str):
... | [
"def",
"_check_input",
"(",
"self",
",",
"source",
",",
"destination",
",",
"feature_dict",
")",
":",
"if",
"not",
"isinstance",
"(",
"source",
",",
"str",
")",
":",
"raise",
"ValueError",
"(",
"\"Parameter source must be string.\"",
")",
"check_filename",
"(",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/mindrecord/tools/tfrecord_to_mr.py#L127-L142 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/gestures.py | python | MouseGestures.SetAuto | (self, auto) | Warning: Once auto is set, it stays set, unless you manually use UnBind | Warning: Once auto is set, it stays set, unless you manually use UnBind | [
"Warning",
":",
"Once",
"auto",
"is",
"set",
"it",
"stays",
"set",
"unless",
"you",
"manually",
"use",
"UnBind"
] | def SetAuto(self, auto):
'''Warning: Once auto is set, it stays set, unless you manually use UnBind'''
if auto:
self.parent.Bind(wx.EVT_MOUSE_EVENTS, self.OnMouseEvent)
self.parent.Bind(wx.EVT_MOTION, self.OnMotion) | [
"def",
"SetAuto",
"(",
"self",
",",
"auto",
")",
":",
"if",
"auto",
":",
"self",
".",
"parent",
".",
"Bind",
"(",
"wx",
".",
"EVT_MOUSE_EVENTS",
",",
"self",
".",
"OnMouseEvent",
")",
"self",
".",
"parent",
".",
"Bind",
"(",
"wx",
".",
"EVT_MOTION",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/gestures.py#L271-L275 | ||
p4lang/p4c | 3272e79369f20813cc1a555a5eb26f44432f84a4 | tools/cpplint.py | python | FileInfo.RepositoryName | (self) | return fullname | r"""FullName after removing the local path to the repository.
If we have a real absolute path name here we can try to do something smart:
detecting the root of the checkout and truncating /path/to/checkout from
the name so that we get header guards that don't include things like
"C:\\Documents and Sett... | r"""FullName after removing the local path to the repository. | [
"r",
"FullName",
"after",
"removing",
"the",
"local",
"path",
"to",
"the",
"repository",
"."
] | def RepositoryName(self):
r"""FullName after removing the local path to the repository.
If we have a real absolute path name here we can try to do something smart:
detecting the root of the checkout and truncating /path/to/checkout from
the name so that we get header guards that don't include things li... | [
"def",
"RepositoryName",
"(",
"self",
")",
":",
"fullname",
"=",
"self",
".",
"FullName",
"(",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"fullname",
")",
":",
"project_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"fullname",
")",
"# If ... | https://github.com/p4lang/p4c/blob/3272e79369f20813cc1a555a5eb26f44432f84a4/tools/cpplint.py#L1567-L1625 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | python/blessings/blessings/__init__.py | python | FormattingString.__call__ | (self, text) | return self + text + self._normal | Return a new string that is ``text`` formatted with my contents.
At the beginning of the string, I prepend the formatting that is my
contents. At the end, I append the "normal" sequence to set everything
back to defaults. The return value is always a Unicode. | Return a new string that is ``text`` formatted with my contents. | [
"Return",
"a",
"new",
"string",
"that",
"is",
"text",
"formatted",
"with",
"my",
"contents",
"."
] | def __call__(self, text):
"""Return a new string that is ``text`` formatted with my contents.
At the beginning of the string, I prepend the formatting that is my
contents. At the end, I append the "normal" sequence to set everything
back to defaults. The return value is always a Unicode... | [
"def",
"__call__",
"(",
"self",
",",
"text",
")",
":",
"return",
"self",
"+",
"text",
"+",
"self",
".",
"_normal"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/blessings/blessings/__init__.py#L385-L393 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py | python | BaseEventLoop.run_until_complete | (self, future) | return future.result() | Run until the Future is done.
If the argument is a coroutine, it is wrapped in a Task.
WARNING: It would be disastrous to call run_until_complete()
with the same coroutine twice -- it would wrap it in two
different Tasks and that can't be good.
Return the Future's result, or r... | Run until the Future is done. | [
"Run",
"until",
"the",
"Future",
"is",
"done",
"."
] | def run_until_complete(self, future):
"""Run until the Future is done.
If the argument is a coroutine, it is wrapped in a Task.
WARNING: It would be disastrous to call run_until_complete()
with the same coroutine twice -- it would wrap it in two
different Tasks and that can't b... | [
"def",
"run_until_complete",
"(",
"self",
",",
"future",
")",
":",
"self",
".",
"_check_closed",
"(",
")",
"self",
".",
"_check_runnung",
"(",
")",
"new_task",
"=",
"not",
"futures",
".",
"isfuture",
"(",
"future",
")",
"future",
"=",
"tasks",
".",
"ensu... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py#L551-L587 | |
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/Tpm.py | python | Tpm.PCR_Reset | (self, pcrHandle) | return self.processResponse(respBuf) | If the attribute of a PCR allows the PCR to be reset and proper
authorization is provided, then this command may be used to set the PCR
in all banks to zero. The attributes of the PCR may restrict the
locality that can perform the reset operation.
Args:
pcrHandle (TPM_HANDLE... | If the attribute of a PCR allows the PCR to be reset and proper
authorization is provided, then this command may be used to set the PCR
in all banks to zero. The attributes of the PCR may restrict the
locality that can perform the reset operation. | [
"If",
"the",
"attribute",
"of",
"a",
"PCR",
"allows",
"the",
"PCR",
"to",
"be",
"reset",
"and",
"proper",
"authorization",
"is",
"provided",
"then",
"this",
"command",
"may",
"be",
"used",
"to",
"set",
"the",
"PCR",
"in",
"all",
"banks",
"to",
"zero",
... | def PCR_Reset(self, pcrHandle):
""" If the attribute of a PCR allows the PCR to be reset and proper
authorization is provided, then this command may be used to set the PCR
in all banks to zero. The attributes of the PCR may restrict the
locality that can perform the reset operation.
... | [
"def",
"PCR_Reset",
"(",
"self",
",",
"pcrHandle",
")",
":",
"req",
"=",
"TPM2_PCR_Reset_REQUEST",
"(",
"pcrHandle",
")",
"respBuf",
"=",
"self",
".",
"dispatchCommand",
"(",
"TPM_CC",
".",
"PCR_Reset",
",",
"req",
")",
"return",
"self",
".",
"processRespons... | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/Tpm.py#L1381-L1394 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/dataframe/transform.py | python | Transform.name | (self) | Name of the transform. | Name of the transform. | [
"Name",
"of",
"the",
"transform",
"."
] | def name(self):
"""Name of the transform."""
raise NotImplementedError() | [
"def",
"name",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/dataframe/transform.py#L124-L126 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/six.py | python | _import_module | (name) | return sys.modules[name] | Import module, returning the module after the last dot. | Import module, returning the module after the last dot. | [
"Import",
"module",
"returning",
"the",
"module",
"after",
"the",
"last",
"dot",
"."
] | def _import_module(name):
"""Import module, returning the module after the last dot."""
__import__(name)
return sys.modules[name] | [
"def",
"_import_module",
"(",
"name",
")",
":",
"__import__",
"(",
"name",
")",
"return",
"sys",
".",
"modules",
"[",
"name",
"]"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/six.py#L80-L83 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/apps/emailsettings/service.py | python | EmailSettingsService.UpdateVacation | (self, username, enable, subject=None, message=None,
contacts_only=None) | return self._PutProperties(uri, properties) | Update vacation settings.
Args:
username: User to update vacation settings for.
enable: Boolean whether to enable vacation responses.
subject: Vacation message subject.
message: Vacation message body.
contacts_only: Boolean whether to send message only to contacts.
Returns:
... | Update vacation settings. | [
"Update",
"vacation",
"settings",
"."
] | def UpdateVacation(self, username, enable, subject=None, message=None,
contacts_only=None):
"""Update vacation settings.
Args:
username: User to update vacation settings for.
enable: Boolean whether to enable vacation responses.
subject: Vacation message subject.
me... | [
"def",
"UpdateVacation",
"(",
"self",
",",
"username",
",",
"enable",
",",
"subject",
"=",
"None",
",",
"message",
"=",
"None",
",",
"contacts_only",
"=",
"None",
")",
":",
"uri",
"=",
"self",
".",
"_serviceUrl",
"(",
"'vacation'",
",",
"username",
")",
... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/apps/emailsettings/service.py#L191-L212 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/core/setup_common.py | python | get_api_versions | (apiversion, codegen_dir) | return curapi_hash, apis_hash[apiversion] | Return current C API checksum and the recorded checksum.
Return current C API checksum and the recorded checksum for the given
version of the C API version. | Return current C API checksum and the recorded checksum. | [
"Return",
"current",
"C",
"API",
"checksum",
"and",
"the",
"recorded",
"checksum",
"."
] | def get_api_versions(apiversion, codegen_dir):
"""
Return current C API checksum and the recorded checksum.
Return current C API checksum and the recorded checksum for the given
version of the C API version.
"""
# Compute the hash of the current API as defined in the .txt files in
# code_g... | [
"def",
"get_api_versions",
"(",
"apiversion",
",",
"codegen_dir",
")",
":",
"# Compute the hash of the current API as defined in the .txt files in",
"# code_generators",
"sys",
".",
"path",
".",
"insert",
"(",
"0",
",",
"codegen_dir",
")",
"try",
":",
"m",
"=",
"__imp... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/setup_common.py#L63-L82 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/parameters/InputParameters.py | python | InputParameters.set | (self, *args) | Set the value of a parameter or update contents of a sub-parameters.
If the associated parameter is an InputParameters object and the value is a dict, update
the parameters via InputParameters.update
Use:
params.set('foo', 42) # foo is an 'int'
params.set('bar'... | Set the value of a parameter or update contents of a sub-parameters. | [
"Set",
"the",
"value",
"of",
"a",
"parameter",
"or",
"update",
"contents",
"of",
"a",
"sub",
"-",
"parameters",
"."
] | def set(self, *args):
"""
Set the value of a parameter or update contents of a sub-parameters.
If the associated parameter is an InputParameters object and the value is a dict, update
the parameters via InputParameters.update
Use:
params.set('foo', 42) # f... | [
"def",
"set",
"(",
"self",
",",
"*",
"args",
")",
":",
"param",
"=",
"self",
".",
"_getParameter",
"(",
"*",
"args",
"[",
":",
"-",
"1",
"]",
")",
"if",
"(",
"param",
"is",
"not",
"None",
")",
"and",
"isinstance",
"(",
"param",
".",
"value",
",... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/parameters/InputParameters.py#L175-L196 | ||
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | lib/pycocotools/coco.py | python | COCO.loadRes | (self, resFile) | return res | Load result file and return a result api object.
:param resFile (str) : file name of result file
:return: res (obj) : result api object | Load result file and return a result api object.
:param resFile (str) : file name of result file
:return: res (obj) : result api object | [
"Load",
"result",
"file",
"and",
"return",
"a",
"result",
"api",
"object",
".",
":",
"param",
"resFile",
"(",
"str",
")",
":",
"file",
"name",
"of",
"result",
"file",
":",
"return",
":",
"res",
"(",
"obj",
")",
":",
"result",
"api",
"object"
] | def loadRes(self, resFile):
"""
Load result file and return a result api object.
:param resFile (str) : file name of result file
:return: res (obj) : result api object
"""
res = COCO()
res.dataset['images'] = [img for img in self.dataset['images']]
... | [
"def",
"loadRes",
"(",
"self",
",",
"resFile",
")",
":",
"res",
"=",
"COCO",
"(",
")",
"res",
".",
"dataset",
"[",
"'images'",
"]",
"=",
"[",
"img",
"for",
"img",
"in",
"self",
".",
"dataset",
"[",
"'images'",
"]",
"]",
"# res.dataset['info'] = copy.de... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/lib/pycocotools/coco.py#L281-L327 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/debug/lib/debug_data.py | python | DebugDumpDir.node_attributes | (self, node_name, device_name=None) | return self._debug_graphs[device_name].node_attributes[node_name] | Get the attributes of a node.
Args:
node_name: Name of the node in question.
device_name: (`str`) name of the device. If there is only one device or if
node_name exists on only one device, this argument is optional.
Returns:
Attributes of the node.
Raises:
LookupError: If ... | Get the attributes of a node. | [
"Get",
"the",
"attributes",
"of",
"a",
"node",
"."
] | def node_attributes(self, node_name, device_name=None):
"""Get the attributes of a node.
Args:
node_name: Name of the node in question.
device_name: (`str`) name of the device. If there is only one device or if
node_name exists on only one device, this argument is optional.
Returns:
... | [
"def",
"node_attributes",
"(",
"self",
",",
"node_name",
",",
"device_name",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"_debug_graphs",
":",
"raise",
"LookupError",
"(",
"\"No partition graphs have been loaded.\"",
")",
"device_name",
"=",
"self",
".",
"_... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/debug_data.py#L1044-L1062 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/control-examples/klampt_catkin/src/klampt/scripts/controller.py | python | launch | (fn,robot) | return maker(robot) | Launches a controller given by the given python module for the
given robot using the module's default make(robot) routine. | Launches a controller given by the given python module for the
given robot using the module's default make(robot) routine. | [
"Launches",
"a",
"controller",
"given",
"by",
"the",
"given",
"python",
"module",
"for",
"the",
"given",
"robot",
"using",
"the",
"module",
"s",
"default",
"make",
"(",
"robot",
")",
"routine",
"."
] | def launch(fn,robot):
"""Launches a controller given by the given python module for the
given robot using the module's default make(robot) routine."""
import os
import importlib
path,base = os.path.split(fn)
mod_name,file_ext = os.path.splitext(base)
mod = importlib.import_module(path+"."+mo... | [
"def",
"launch",
"(",
"fn",
",",
"robot",
")",
":",
"import",
"os",
"import",
"importlib",
"path",
",",
"base",
"=",
"os",
".",
"path",
".",
"split",
"(",
"fn",
")",
"mod_name",
",",
"file_ext",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"base",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/control-examples/klampt_catkin/src/klampt/scripts/controller.py#L319-L332 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/models.py | python | Request.prepare | (self) | return p | Constructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it. | Constructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it. | [
"Constructs",
"a",
":",
"class",
":",
"PreparedRequest",
"<PreparedRequest",
">",
"for",
"transmission",
"and",
"returns",
"it",
"."
] | def prepare(self):
"""Constructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it."""
p = PreparedRequest()
p.prepare(
method=self.method,
url=self.url,
headers=self.headers,
files=self.files,
data=self.data,... | [
"def",
"prepare",
"(",
"self",
")",
":",
"p",
"=",
"PreparedRequest",
"(",
")",
"p",
".",
"prepare",
"(",
"method",
"=",
"self",
".",
"method",
",",
"url",
"=",
"self",
".",
"url",
",",
"headers",
"=",
"self",
".",
"headers",
",",
"files",
"=",
"... | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/requests/models.py#L254-L269 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | ParserElement.runTests | (self, tests, parseAll=True, comment='#',
fullDump=True, printResults=True, failureTests=False, postParse=None,
file=None) | return success, allResults | Execute the parse expression on a series of test strings, showing each
test, the parsed results or where the parse failed. Quick and easy way to
run a parse expression against a list of sample strings.
Parameters:
- tests - a list of separate test strings, or a multiline string of... | [] | def runTests(self, tests, parseAll=True, comment='#',
fullDump=True, printResults=True, failureTests=False, postParse=None,
file=None):
"""
Execute the parse expression on a series of test strings, showing each
test, the parsed results or where the parse fa... | [
"def",
"runTests",
"(",
"self",
",",
"tests",
",",
"parseAll",
"=",
"True",
",",
"comment",
"=",
"'#'",
",",
"fullDump",
"=",
"True",
",",
"printResults",
"=",
"True",
",",
"failureTests",
"=",
"False",
",",
"postParse",
"=",
"None",
",",
"file",
"=",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L5255-L5575 | ||
facebook/mysql-5.6 | 65a650660ec7b4d627d1b738f397252ff4706207 | arcanist/lint/cpp_linter/cpplint.py | python | PrintCategories | () | Prints a list of all the error-categories used by error messages.
These are the categories used to filter messages via --filter. | Prints a list of all the error-categories used by error messages. | [
"Prints",
"a",
"list",
"of",
"all",
"the",
"error",
"-",
"categories",
"used",
"by",
"error",
"messages",
"."
] | def PrintCategories():
"""Prints a list of all the error-categories used by error messages.
These are the categories used to filter messages via --filter.
"""
sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES))
sys.exit(0) | [
"def",
"PrintCategories",
"(",
")",
":",
"sys",
".",
"stderr",
".",
"write",
"(",
"''",
".",
"join",
"(",
"' %s\\n'",
"%",
"cat",
"for",
"cat",
"in",
"_ERROR_CATEGORIES",
")",
")",
"sys",
".",
"exit",
"(",
"0",
")"
] | https://github.com/facebook/mysql-5.6/blob/65a650660ec7b4d627d1b738f397252ff4706207/arcanist/lint/cpp_linter/cpplint.py#L4672-L4678 | ||
NREL/EnergyPlus | fadc5973b85c70e8cc923efb69c144e808a26078 | third_party/re2/re2/make_unicode_casefold.py | python | _Delta | (a, b) | return b - a | Compute the delta for b - a. Even/odd and odd/even
are handled specially, as described above. | Compute the delta for b - a. Even/odd and odd/even
are handled specially, as described above. | [
"Compute",
"the",
"delta",
"for",
"b",
"-",
"a",
".",
"Even",
"/",
"odd",
"and",
"odd",
"/",
"even",
"are",
"handled",
"specially",
"as",
"described",
"above",
"."
] | def _Delta(a, b):
"""Compute the delta for b - a. Even/odd and odd/even
are handled specially, as described above."""
if a+1 == b:
if a%2 == 0:
return 'EvenOdd'
else:
return 'OddEven'
if a == b+1:
if a%2 == 0:
return 'OddEven'
else:
return 'EvenOdd'
return b - a | [
"def",
"_Delta",
"(",
"a",
",",
"b",
")",
":",
"if",
"a",
"+",
"1",
"==",
"b",
":",
"if",
"a",
"%",
"2",
"==",
"0",
":",
"return",
"'EvenOdd'",
"else",
":",
"return",
"'OddEven'",
"if",
"a",
"==",
"b",
"+",
"1",
":",
"if",
"a",
"%",
"2",
... | https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/third_party/re2/re2/make_unicode_casefold.py#L35-L48 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-blocks/python/blocks/qa_rotator_cc.py | python | qa_rotator_cc.test_phase_inc_update_out_of_range | (self) | Test phase increment update sent for an out-of-range offset | Test phase increment update sent for an out-of-range offset | [
"Test",
"phase",
"increment",
"update",
"sent",
"for",
"an",
"out",
"-",
"of",
"-",
"range",
"offset"
] | def test_phase_inc_update_out_of_range(self):
"""Test phase increment update sent for an out-of-range offset"""
self._setUp(n_samples=2**16)
n_half_samples = int(self.n_samples / 2)
# Schedule a phase increment update whose offset is initially
# out-of-range due to being in the ... | [
"def",
"test_phase_inc_update_out_of_range",
"(",
"self",
")",
":",
"self",
".",
"_setUp",
"(",
"n_samples",
"=",
"2",
"**",
"16",
")",
"n_half_samples",
"=",
"int",
"(",
"self",
".",
"n_samples",
"/",
"2",
")",
"# Schedule a phase increment update whose offset is... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-blocks/python/blocks/qa_rotator_cc.py#L286-L318 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py | python | ParserElement.addCondition | (self, *fns, **kwargs) | return self | Add a boolean predicate function to expression's list of parse actions. See
L{I{setParseAction}<setParseAction>} for function call signatures. Unlike C{setParseAction},
functions passed to C{addCondition} need to return boolean success/fail of the condition.
Optional keyword arguments:
... | Add a boolean predicate function to expression's list of parse actions. See
L{I{setParseAction}<setParseAction>} for function call signatures. Unlike C{setParseAction},
functions passed to C{addCondition} need to return boolean success/fail of the condition. | [
"Add",
"a",
"boolean",
"predicate",
"function",
"to",
"expression",
"s",
"list",
"of",
"parse",
"actions",
".",
"See",
"L",
"{",
"I",
"{",
"setParseAction",
"}",
"<setParseAction",
">",
"}",
"for",
"function",
"call",
"signatures",
".",
"Unlike",
"C",
"{",... | def addCondition(self, *fns, **kwargs):
"""Add a boolean predicate function to expression's list of parse actions. See
L{I{setParseAction}<setParseAction>} for function call signatures. Unlike C{setParseAction},
functions passed to C{addCondition} need to return boolean success/fail of the con... | [
"def",
"addCondition",
"(",
"self",
",",
"*",
"fns",
",",
"*",
"*",
"kwargs",
")",
":",
"msg",
"=",
"kwargs",
".",
"get",
"(",
"\"message\"",
",",
"\"failed user-defined condition\"",
")",
"exc_type",
"=",
"ParseFatalException",
"if",
"kwargs",
".",
"get",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/pyparsing.py#L1298-L1323 | |
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | python-threatexchange/threatexchange/descriptor.py | python | SimpleDescriptorRollup.as_row | (self) | return self.first_descriptor_id, self.added_on, " ".join(self.labels) | Simple conversion to CSV row | Simple conversion to CSV row | [
"Simple",
"conversion",
"to",
"CSV",
"row"
] | def as_row(self) -> t.Tuple[int, str, str]:
"""Simple conversion to CSV row"""
return self.first_descriptor_id, self.added_on, " ".join(self.labels) | [
"def",
"as_row",
"(",
"self",
")",
"->",
"t",
".",
"Tuple",
"[",
"int",
",",
"str",
",",
"str",
"]",
":",
"return",
"self",
".",
"first_descriptor_id",
",",
"self",
".",
"added_on",
",",
"\" \"",
".",
"join",
"(",
"self",
".",
"labels",
")"
] | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/python-threatexchange/threatexchange/descriptor.py#L177-L179 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/blackduck_hub.py | python | TableWriter.__init__ | (self, headers: List[str]) | Init writer. | Init writer. | [
"Init",
"writer",
"."
] | def __init__(self, headers: List[str]):
"""Init writer."""
self._headers = headers
self._rows = [] | [
"def",
"__init__",
"(",
"self",
",",
"headers",
":",
"List",
"[",
"str",
"]",
")",
":",
"self",
".",
"_headers",
"=",
"headers",
"self",
".",
"_rows",
"=",
"[",
"]"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/blackduck_hub.py#L716-L719 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | xpathParserContext.xpathContainsFunction | (self, nargs) | Implement the contains() XPath function boolean
contains(string, string) The contains function returns true
if the first argument string contains the second argument
string, and otherwise returns false. | Implement the contains() XPath function boolean
contains(string, string) The contains function returns true
if the first argument string contains the second argument
string, and otherwise returns false. | [
"Implement",
"the",
"contains",
"()",
"XPath",
"function",
"boolean",
"contains",
"(",
"string",
"string",
")",
"The",
"contains",
"function",
"returns",
"true",
"if",
"the",
"first",
"argument",
"string",
"contains",
"the",
"second",
"argument",
"string",
"and"... | def xpathContainsFunction(self, nargs):
"""Implement the contains() XPath function boolean
contains(string, string) The contains function returns true
if the first argument string contains the second argument
string, and otherwise returns false. """
libxml2mod.xmlXPathCont... | [
"def",
"xpathContainsFunction",
"(",
"self",
",",
"nargs",
")",
":",
"libxml2mod",
".",
"xmlXPathContainsFunction",
"(",
"self",
".",
"_o",
",",
"nargs",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6692-L6697 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/ceph-volume/ceph_volume/util/disk.py | python | udevadm_property | (device, properties=[]) | return ret | Query udevadm for information about device properties.
Optionally pass a list of properties to return. A requested property might
not be returned if not present.
Expected output format::
# udevadm info --query=property --name=/dev/sda :(
DEVNAME=/dev/sda
... | Query udevadm for information about device properties.
Optionally pass a list of properties to return. A requested property might
not be returned if not present. | [
"Query",
"udevadm",
"for",
"information",
"about",
"device",
"properties",
".",
"Optionally",
"pass",
"a",
"list",
"of",
"properties",
"to",
"return",
".",
"A",
"requested",
"property",
"might",
"not",
"be",
"returned",
"if",
"not",
"present",
"."
] | def udevadm_property(device, properties=[]):
"""
Query udevadm for information about device properties.
Optionally pass a list of properties to return. A requested property might
not be returned if not present.
Expected output format::
# udevadm info --query=property --name=/dev/sda ... | [
"def",
"udevadm_property",
"(",
"device",
",",
"properties",
"=",
"[",
"]",
")",
":",
"out",
"=",
"_udevadm_info",
"(",
"device",
")",
"ret",
"=",
"{",
"}",
"for",
"line",
"in",
"out",
":",
"p",
",",
"v",
"=",
"line",
".",
"split",
"(",
"'='",
",... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/ceph-volume/ceph_volume/util/disk.py#L190-L219 | |
BVLC/caffe | 9b891540183ddc834a02b2bd81b31afae71b2153 | python/caffe/draw.py | python | draw_net | (caffe_net, rankdir, ext='png', phase=None, display_lrm=False) | return get_pydot_graph(caffe_net, rankdir, phase=phase,
display_lrm=display_lrm).create(format=ext) | Draws a caffe net and returns the image string encoded using the given
extension.
Parameters
----------
caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer.
ext : string, optional
The image extension (the default is 'png').
phase : {caffe_pb2.Phase.TRAIN, caffe_pb2.Phase.TE... | Draws a caffe net and returns the image string encoded using the given
extension. | [
"Draws",
"a",
"caffe",
"net",
"and",
"returns",
"the",
"image",
"string",
"encoded",
"using",
"the",
"given",
"extension",
"."
] | def draw_net(caffe_net, rankdir, ext='png', phase=None, display_lrm=False):
"""Draws a caffe net and returns the image string encoded using the given
extension.
Parameters
----------
caffe_net : a caffe.proto.caffe_pb2.NetParameter protocol buffer.
ext : string, optional
The image exten... | [
"def",
"draw_net",
"(",
"caffe_net",
",",
"rankdir",
",",
"ext",
"=",
"'png'",
",",
"phase",
"=",
"None",
",",
"display_lrm",
"=",
"False",
")",
":",
"return",
"get_pydot_graph",
"(",
"caffe_net",
",",
"rankdir",
",",
"phase",
"=",
"phase",
",",
"display... | https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/python/caffe/draw.py#L268-L290 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/protobuf/python/google/protobuf/internal/python_message.py | python | _AddEqualsMethod | (message_descriptor, cls) | Helper for _AddMessageMethods(). | Helper for _AddMessageMethods(). | [
"Helper",
"for",
"_AddMessageMethods",
"()",
"."
] | def _AddEqualsMethod(message_descriptor, cls):
"""Helper for _AddMessageMethods()."""
def __eq__(self, other):
if (not isinstance(other, message_mod.Message) or
other.DESCRIPTOR != self.DESCRIPTOR):
return False
if self is other:
return True
return self.ListFields() == other.ListFi... | [
"def",
"_AddEqualsMethod",
"(",
"message_descriptor",
",",
"cls",
")",
":",
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"(",
"not",
"isinstance",
"(",
"other",
",",
"message_mod",
".",
"Message",
")",
"or",
"other",
".",
"DESCRIPTOR",
"!=... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/google/protobuf/internal/python_message.py#L642-L654 | ||
tum-vision/fusenet | a1451be2971b348a01b0f525c2a3a7a0e215a591 | scripts/cpp_lint.py | python | _SetVerboseLevel | (level) | return _cpplint_state.SetVerboseLevel(level) | Sets the module's verbosity, and returns the previous setting. | Sets the module's verbosity, and returns the previous setting. | [
"Sets",
"the",
"module",
"s",
"verbosity",
"and",
"returns",
"the",
"previous",
"setting",
"."
] | def _SetVerboseLevel(level):
"""Sets the module's verbosity, and returns the previous setting."""
return _cpplint_state.SetVerboseLevel(level) | [
"def",
"_SetVerboseLevel",
"(",
"level",
")",
":",
"return",
"_cpplint_state",
".",
"SetVerboseLevel",
"(",
"level",
")"
] | https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/scripts/cpp_lint.py#L782-L784 | |
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/ctml2yaml.py | python | Phase.ideal_molal_solution | (
self, activity_coeffs: etree.Element
) | return cutoff | Process the cutoff data in an ``IdealMolalSolution`` phase-thermo type.
:param activity_coeffs:
XML ``activityCoefficients`` node. For the ``IdealMolalSolution`` thermo
type, this node contains information about cutoff limits for the
thermodynamic properties.
Return... | Process the cutoff data in an ``IdealMolalSolution`` phase-thermo type. | [
"Process",
"the",
"cutoff",
"data",
"in",
"an",
"IdealMolalSolution",
"phase",
"-",
"thermo",
"type",
"."
] | def ideal_molal_solution(
self, activity_coeffs: etree.Element
) -> Dict[str, Union[str, "QUANTITY"]]:
"""Process the cutoff data in an ``IdealMolalSolution`` phase-thermo type.
:param activity_coeffs:
XML ``activityCoefficients`` node. For the ``IdealMolalSolution`` thermo
... | [
"def",
"ideal_molal_solution",
"(",
"self",
",",
"activity_coeffs",
":",
"etree",
".",
"Element",
")",
"->",
"Dict",
"[",
"str",
",",
"Union",
"[",
"str",
",",
"\"QUANTITY\"",
"]",
"]",
":",
"cutoff",
"=",
"{",
"}",
"# type: Dict[str, Union[str, QUANTITY]]",
... | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/ctml2yaml.py#L654-L678 | |
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/context.py | python | Context.disable_direct | (self, enum: int) | Gives direct access to ``glDisable`` so unsupported capabilities in ModernGL can be disabled.
Do not use this to set already supported context flags.
Example::
# Enum value from the opengl registry
GL_CONSERVATIVE_RASTERIZATION_NV = 0x9346
ctx.disable_direct(GL_CONS... | Gives direct access to ``glDisable`` so unsupported capabilities in ModernGL can be disabled.
Do not use this to set already supported context flags. | [
"Gives",
"direct",
"access",
"to",
"glDisable",
"so",
"unsupported",
"capabilities",
"in",
"ModernGL",
"can",
"be",
"disabled",
".",
"Do",
"not",
"use",
"this",
"to",
"set",
"already",
"supported",
"context",
"flags",
"."
] | def disable_direct(self, enum: int):
"""
Gives direct access to ``glDisable`` so unsupported capabilities in ModernGL can be disabled.
Do not use this to set already supported context flags.
Example::
# Enum value from the opengl registry
GL_CONSERVATIVE_RASTERI... | [
"def",
"disable_direct",
"(",
"self",
",",
"enum",
":",
"int",
")",
":",
"self",
".",
"mglo",
".",
"disable_direct",
"(",
"enum",
")"
] | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/context.py#L1013-L1024 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/protorpc/demos/quotas/backend/quotas/services.py | python | QuotaService.check_quota | (self, request) | return response | Perform a quota check for a user. | Perform a quota check for a user. | [
"Perform",
"a",
"quota",
"check",
"for",
"a",
"user",
"."
] | def check_quota(self, request):
"""Perform a quota check for a user."""
state = self.__get_state(request.user)
response = QuotaResponse(all_status=CheckResult.Status.OK)
response.denied = False
state.begin_transaction()
try:
for quota in request.quotas:
if quota.mode in (QuotaChe... | [
"def",
"check_quota",
"(",
"self",
",",
"request",
")",
":",
"state",
"=",
"self",
".",
"__get_state",
"(",
"request",
".",
"user",
")",
"response",
"=",
"QuotaResponse",
"(",
"all_status",
"=",
"CheckResult",
".",
"Status",
".",
"OK",
")",
"response",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/protorpc/demos/quotas/backend/quotas/services.py#L378-L423 | |
bareos/bareos | 56a10bb368b0a81e977bb51304033fe49d59efb0 | core/src/plugins/filed/python/vmware/BareosFdPluginVMware.py | python | BareosVADPWrapper.vmomi_WaitForTasks | (self, tasks) | Given the service instance si and tasks, it returns after all the
tasks are complete | Given the service instance si and tasks, it returns after all the
tasks are complete | [
"Given",
"the",
"service",
"instance",
"si",
"and",
"tasks",
"it",
"returns",
"after",
"all",
"the",
"tasks",
"are",
"complete"
] | def vmomi_WaitForTasks(self, tasks):
"""
Given the service instance si and tasks, it returns after all the
tasks are complete
"""
si = self.si
pc = si.content.propertyCollector
taskList = [str(task) for task in tasks]
# Create filter
objSpecs = ... | [
"def",
"vmomi_WaitForTasks",
"(",
"self",
",",
"tasks",
")",
":",
"si",
"=",
"self",
".",
"si",
"pc",
"=",
"si",
".",
"content",
".",
"propertyCollector",
"taskList",
"=",
"[",
"str",
"(",
"task",
")",
"for",
"task",
"in",
"tasks",
"]",
"# Create filte... | https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/core/src/plugins/filed/python/vmware/BareosFdPluginVMware.py#L1414-L1467 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/lib2to3/fixer_base.py | python | BaseFix.finish_tree | (self, tree, filename) | Some fixers need to maintain tree-wide state.
This method is called once, at the conclusion of tree fix-up.
tree - the root node of the tree to be processed.
filename - the name of the file the tree came from. | Some fixers need to maintain tree-wide state.
This method is called once, at the conclusion of tree fix-up. | [
"Some",
"fixers",
"need",
"to",
"maintain",
"tree",
"-",
"wide",
"state",
".",
"This",
"method",
"is",
"called",
"once",
"at",
"the",
"conclusion",
"of",
"tree",
"fix",
"-",
"up",
"."
] | def finish_tree(self, tree, filename):
"""Some fixers need to maintain tree-wide state.
This method is called once, at the conclusion of tree fix-up.
tree - the root node of the tree to be processed.
filename - the name of the file the tree came from.
"""
pass | [
"def",
"finish_tree",
"(",
"self",
",",
"tree",
",",
"filename",
")",
":",
"pass"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib2to3/fixer_base.py#L160-L167 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/laguerre.py | python | lagweight | (x) | return w | Weight function of the Laguerre polynomials.
The weight function is :math:`exp(-x)` and the interval of integration
is :math:`[0, \\inf]`. The Laguerre polynomials are orthogonal, but not
normalized, with respect to this weight function.
Parameters
----------
x : array_like
Values at wh... | Weight function of the Laguerre polynomials. | [
"Weight",
"function",
"of",
"the",
"Laguerre",
"polynomials",
"."
] | def lagweight(x):
"""Weight function of the Laguerre polynomials.
The weight function is :math:`exp(-x)` and the interval of integration
is :math:`[0, \\inf]`. The Laguerre polynomials are orthogonal, but not
normalized, with respect to this weight function.
Parameters
----------
x : array... | [
"def",
"lagweight",
"(",
"x",
")",
":",
"w",
"=",
"np",
".",
"exp",
"(",
"-",
"x",
")",
"return",
"w"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/polynomial/laguerre.py#L1548-L1572 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/ffmpeg/ffmpeg_ops.py | python | decode_audio | (contents, file_format=None, samples_per_second=None,
channel_count=None) | return gen_decode_audio_op_py.decode_audio_v2(
contents, file_format=file_format, samples_per_second=samples_per_second,
channel_count=channel_count) | Create an op that decodes the contents of an audio file.
Note that ffmpeg is free to select the "best" audio track from an mp4.
https://trac.ffmpeg.org/wiki/Map
Args:
contents: The binary contents of the audio file to decode. This is a
scalar.
file_format: A string or scalar string tensor specif... | Create an op that decodes the contents of an audio file. | [
"Create",
"an",
"op",
"that",
"decodes",
"the",
"contents",
"of",
"an",
"audio",
"file",
"."
] | def decode_audio(contents, file_format=None, samples_per_second=None,
channel_count=None):
"""Create an op that decodes the contents of an audio file.
Note that ffmpeg is free to select the "best" audio track from an mp4.
https://trac.ffmpeg.org/wiki/Map
Args:
contents: The binary content... | [
"def",
"decode_audio",
"(",
"contents",
",",
"file_format",
"=",
"None",
",",
"samples_per_second",
"=",
"None",
",",
"channel_count",
"=",
"None",
")",
":",
"return",
"gen_decode_audio_op_py",
".",
"decode_audio_v2",
"(",
"contents",
",",
"file_format",
"=",
"f... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/ffmpeg/ffmpeg_ops.py#L31-L62 | |
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/functions/function.py | python | Function.calcInWizard | (self) | return self.supportedPlatforms_.has_key('Excel') \
and self.supportedPlatforms_['Excel'].calcInWizard() | Determine whether to calc this function under the Excel Function Wizard. | Determine whether to calc this function under the Excel Function Wizard. | [
"Determine",
"whether",
"to",
"calc",
"this",
"function",
"under",
"the",
"Excel",
"Function",
"Wizard",
"."
] | def calcInWizard(self):
"""Determine whether to calc this function under the Excel Function Wizard."""
return self.supportedPlatforms_.has_key('Excel') \
and self.supportedPlatforms_['Excel'].calcInWizard() | [
"def",
"calcInWizard",
"(",
"self",
")",
":",
"return",
"self",
".",
"supportedPlatforms_",
".",
"has_key",
"(",
"'Excel'",
")",
"and",
"self",
".",
"supportedPlatforms_",
"[",
"'Excel'",
"]",
".",
"calcInWizard",
"(",
")"
] | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/functions/function.py#L62-L65 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/tools/clang/bindings/python/clang/cindex.py | python | Cursor.is_move_constructor | (self) | return conf.lib.clang_CXXConstructor_isMoveConstructor(self) | Returns True if the cursor refers to a C++ move constructor. | Returns True if the cursor refers to a C++ move constructor. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"move",
"constructor",
"."
] | def is_move_constructor(self):
"""Returns True if the cursor refers to a C++ move constructor.
"""
return conf.lib.clang_CXXConstructor_isMoveConstructor(self) | [
"def",
"is_move_constructor",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXConstructor_isMoveConstructor",
"(",
"self",
")"
] | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/clang/bindings/python/clang/cindex.py#L1462-L1465 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pexpect/pexpect/run.py | python | run | (command, timeout=30, withexitstatus=False, events=None,
extra_args=None, logfile=None, cwd=None, env=None, **kwargs) | This function runs the given command; waits for it to finish; then
returns all output as a string. STDERR is included in output. If the full
path to the command is not given then the path is searched.
Note that lines are terminated by CR/LF (\\r\\n) combination even on
UNIX-like systems because this is... | This function runs the given command; waits for it to finish; then
returns all output as a string. STDERR is included in output. If the full
path to the command is not given then the path is searched. | [
"This",
"function",
"runs",
"the",
"given",
"command",
";",
"waits",
"for",
"it",
"to",
"finish",
";",
"then",
"returns",
"all",
"output",
"as",
"a",
"string",
".",
"STDERR",
"is",
"included",
"in",
"output",
".",
"If",
"the",
"full",
"path",
"to",
"th... | def run(command, timeout=30, withexitstatus=False, events=None,
extra_args=None, logfile=None, cwd=None, env=None, **kwargs):
'''
This function runs the given command; waits for it to finish; then
returns all output as a string. STDERR is included in output. If the full
path to the command is n... | [
"def",
"run",
"(",
"command",
",",
"timeout",
"=",
"30",
",",
"withexitstatus",
"=",
"False",
",",
"events",
"=",
"None",
",",
"extra_args",
"=",
"None",
",",
"logfile",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"env",
"=",
"None",
",",
"*",
"*",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pexpect/pexpect/run.py#L7-L148 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py | python | TurtleScreenBase._onscreenclick | (self, fun, num=1, add=None) | Bind fun to mouse-click event on canvas.
fun must be a function with two arguments, the coordinates
of the clicked point on the canvas.
num, the number of the mouse-button defaults to 1
If a turtle is clicked, first _onclick-event will be performed,
then _onscreensclick-event. | Bind fun to mouse-click event on canvas.
fun must be a function with two arguments, the coordinates
of the clicked point on the canvas.
num, the number of the mouse-button defaults to 1 | [
"Bind",
"fun",
"to",
"mouse",
"-",
"click",
"event",
"on",
"canvas",
".",
"fun",
"must",
"be",
"a",
"function",
"with",
"two",
"arguments",
"the",
"coordinates",
"of",
"the",
"clicked",
"point",
"on",
"the",
"canvas",
".",
"num",
"the",
"number",
"of",
... | def _onscreenclick(self, fun, num=1, add=None):
"""Bind fun to mouse-click event on canvas.
fun must be a function with two arguments, the coordinates
of the clicked point on the canvas.
num, the number of the mouse-button defaults to 1
If a turtle is clicked, first _onclick-eve... | [
"def",
"_onscreenclick",
"(",
"self",
",",
"fun",
",",
"num",
"=",
"1",
",",
"add",
"=",
"None",
")",
":",
"if",
"fun",
"is",
"None",
":",
"self",
".",
"cv",
".",
"unbind",
"(",
"\"<Button-%s>\"",
"%",
"num",
")",
"else",
":",
"def",
"eventfun",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py#L684-L700 | ||
OpenGenus/cosmos | 1a94e8880068e51d571543be179c323936bd0936 | code/artificial_intelligence/src/principal_component_analysis/pca.py | python | generate_data | () | return data | Combine two 3x20 datasets ignoring their labels.
This is the data which will be analyzed by the PCA algorithm | Combine two 3x20 datasets ignoring their labels.
This is the data which will be analyzed by the PCA algorithm | [
"Combine",
"two",
"3x20",
"datasets",
"ignoring",
"their",
"labels",
".",
"This",
"is",
"the",
"data",
"which",
"will",
"be",
"analyzed",
"by",
"the",
"PCA",
"algorithm"
] | def generate_data():
"""
Combine two 3x20 datasets ignoring their labels.
This is the data which will be analyzed by the PCA algorithm
"""
# generate a mean 0 data
class1_sample = normalized_distributed_data(0)
# generate a mean 1 data
class2_sample = normalized_distributed_data(... | [
"def",
"generate_data",
"(",
")",
":",
"# generate a mean 0 data",
"class1_sample",
"=",
"normalized_distributed_data",
"(",
"0",
")",
"# generate a mean 1 data",
"class2_sample",
"=",
"normalized_distributed_data",
"(",
"1",
")",
"# visualize data",
"visualize_data",
"(",
... | https://github.com/OpenGenus/cosmos/blob/1a94e8880068e51d571543be179c323936bd0936/code/artificial_intelligence/src/principal_component_analysis/pca.py#L154-L168 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/grid.py | python | Grid.IsCellEditControlShown | (*args, **kwargs) | return _grid.Grid_IsCellEditControlShown(*args, **kwargs) | IsCellEditControlShown(self) -> bool | IsCellEditControlShown(self) -> bool | [
"IsCellEditControlShown",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsCellEditControlShown(*args, **kwargs):
"""IsCellEditControlShown(self) -> bool"""
return _grid.Grid_IsCellEditControlShown(*args, **kwargs) | [
"def",
"IsCellEditControlShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_IsCellEditControlShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1362-L1364 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/common/utils.py | python | UrlOpener.Open | (self, url) | return response | Opens the URL url.
Args:
url: the URL to open.
Returns:
data read from response.
Raises:
urllib2.URLError | Opens the URL url. | [
"Opens",
"the",
"URL",
"url",
"."
] | def Open(self, url):
"""Opens the URL url.
Args:
url: the URL to open.
Returns:
data read from response.
Raises:
urllib2.URLError
"""
fp = self._opener.open(url)
response = fp.read()
fp.close()
return response | [
"def",
"Open",
"(",
"self",
",",
"url",
")",
":",
"fp",
"=",
"self",
".",
"_opener",
".",
"open",
"(",
"url",
")",
"response",
"=",
"fp",
".",
"read",
"(",
")",
"fp",
".",
"close",
"(",
")",
"return",
"response"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/common/utils.py#L46-L59 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/neural_network/_multilayer_perceptron.py | python | BaseMultilayerPerceptron._compute_loss_grad | (self, layer, n_samples, activations, deltas,
coef_grads, intercept_grads) | return coef_grads, intercept_grads | Compute the gradient of loss with respect to coefs and intercept for
specified layer.
This function does backpropagation for the specified one layer. | Compute the gradient of loss with respect to coefs and intercept for
specified layer. | [
"Compute",
"the",
"gradient",
"of",
"loss",
"with",
"respect",
"to",
"coefs",
"and",
"intercept",
"for",
"specified",
"layer",
"."
] | def _compute_loss_grad(self, layer, n_samples, activations, deltas,
coef_grads, intercept_grads):
"""Compute the gradient of loss with respect to coefs and intercept for
specified layer.
This function does backpropagation for the specified one layer.
"""
... | [
"def",
"_compute_loss_grad",
"(",
"self",
",",
"layer",
",",
"n_samples",
",",
"activations",
",",
"deltas",
",",
"coef_grads",
",",
"intercept_grads",
")",
":",
"coef_grads",
"[",
"layer",
"]",
"=",
"safe_sparse_dot",
"(",
"activations",
"[",
"layer",
"]",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/neural_network/_multilayer_perceptron.py#L117-L131 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | Viewport.getRigidTransform | (self) | return _robotsim.Viewport_getRigidTransform(self) | getRigidTransform(Viewport self) | getRigidTransform(Viewport self) | [
"getRigidTransform",
"(",
"Viewport",
"self",
")"
] | def getRigidTransform(self):
"""
getRigidTransform(Viewport self)
"""
return _robotsim.Viewport_getRigidTransform(self) | [
"def",
"getRigidTransform",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"Viewport_getRigidTransform",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L2899-L2906 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | deprecated/algorithms/sfm/OpenSfM/opensfm/dense.py | python | clean_depthmap | (arguments) | Clean depthmap by checking consistency with neighbors. | Clean depthmap by checking consistency with neighbors. | [
"Clean",
"depthmap",
"by",
"checking",
"consistency",
"with",
"neighbors",
"."
] | def clean_depthmap(arguments):
"""Clean depthmap by checking consistency with neighbors."""
log.setup()
data, neighbors, shot = arguments
if data.clean_depthmap_exists(shot.id):
logger.info("Using precomputed clean depthmap {}".format(shot.id))
return
logger.info("Cleaning depthmap... | [
"def",
"clean_depthmap",
"(",
"arguments",
")",
":",
"log",
".",
"setup",
"(",
")",
"data",
",",
"neighbors",
",",
"shot",
"=",
"arguments",
"if",
"data",
".",
"clean_depthmap_exists",
"(",
"shot",
".",
"id",
")",
":",
"logger",
".",
"info",
"(",
"\"Us... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/dense.py#L148-L186 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Variables/PackageVariable.py | python | PackageVariable | (key, help, default, searchfunc=None) | return (key, help, default,
lambda k, v, e: _validator(k,v,e,searchfunc),
_converter) | The input parameters describe a 'package list' option, thus they
are returned with the correct converter and validator appended. The
result is usable for input to opts.Add() .
A 'package list' option may either be 'all', 'none' or a list of
package names (separated by space). | The input parameters describe a 'package list' option, thus they
are returned with the correct converter and validator appended. The
result is usable for input to opts.Add() . | [
"The",
"input",
"parameters",
"describe",
"a",
"package",
"list",
"option",
"thus",
"they",
"are",
"returned",
"with",
"the",
"correct",
"converter",
"and",
"validator",
"appended",
".",
"The",
"result",
"is",
"usable",
"for",
"input",
"to",
"opts",
".",
"Ad... | def PackageVariable(key, help, default, searchfunc=None):
# NB: searchfunc is currently undocumented and unsupported
"""
The input parameters describe a 'package list' option, thus they
are returned with the correct converter and validator appended. The
result is usable for input to opts.Add() .
... | [
"def",
"PackageVariable",
"(",
"key",
",",
"help",
",",
"default",
",",
"searchfunc",
"=",
"None",
")",
":",
"# NB: searchfunc is currently undocumented and unsupported",
"help",
"=",
"'\\n '",
".",
"join",
"(",
"(",
"help",
",",
"'( yes | no | /path/to/%s )'",
"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Variables/PackageVariable.py#L86-L100 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/onnx/utils.py | python | _graph_op | (g, opname, *raw_args, **kwargs) | return tuple(o for o in n.outputs()) | r"""
Create an ONNX operator "opname", taking "args" as inputs and attributes
"kwargs"; returning the node representing the single output of this operator
(see the `outputs` keyword argument for multi-return nodes).
The set of operators and the inputs/attributes they take
is documented at https://g... | r"""
Create an ONNX operator "opname", taking "args" as inputs and attributes
"kwargs"; returning the node representing the single output of this operator
(see the `outputs` keyword argument for multi-return nodes). | [
"r",
"Create",
"an",
"ONNX",
"operator",
"opname",
"taking",
"args",
"as",
"inputs",
"and",
"attributes",
"kwargs",
";",
"returning",
"the",
"node",
"representing",
"the",
"single",
"output",
"of",
"this",
"operator",
"(",
"see",
"the",
"outputs",
"keyword",
... | def _graph_op(g, opname, *raw_args, **kwargs):
r"""
Create an ONNX operator "opname", taking "args" as inputs and attributes
"kwargs"; returning the node representing the single output of this operator
(see the `outputs` keyword argument for multi-return nodes).
The set of operators and the inputs/... | [
"def",
"_graph_op",
"(",
"g",
",",
"opname",
",",
"*",
"raw_args",
",",
"*",
"*",
"kwargs",
")",
":",
"outputs",
"=",
"kwargs",
".",
"pop",
"(",
"\"outputs\"",
",",
"1",
")",
"# Filter out None attributes, this can be convenient client side because",
"# now they c... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/onnx/utils.py#L909-L961 | |
vtraag/louvain-igraph | 124ea1be49ee74eec2eaca8006599d7fc5560db6 | src/louvain/VertexPartition.py | python | MutableVertexPartition.from_coarse_partition | (self, partition, coarse_node=None) | Update current partition according to coarser partition.
Parameters
----------
partition : :class:`~VertexPartition.MutableVertexPartition`
The coarser partition used to update the current partition.
coarse_node : list of int
The coarser node which represent the current node in the partiti... | Update current partition according to coarser partition. | [
"Update",
"current",
"partition",
"according",
"to",
"coarser",
"partition",
"."
] | def from_coarse_partition(self, partition, coarse_node=None):
""" Update current partition according to coarser partition.
Parameters
----------
partition : :class:`~VertexPartition.MutableVertexPartition`
The coarser partition used to update the current partition.
coarse_node : list of int
... | [
"def",
"from_coarse_partition",
"(",
"self",
",",
"partition",
",",
"coarse_node",
"=",
"None",
")",
":",
"# Read the coarser partition",
"_c_louvain",
".",
"_MutableVertexPartition_from_coarse_partition",
"(",
"self",
".",
"_partition",
",",
"partition",
".",
"membersh... | https://github.com/vtraag/louvain-igraph/blob/124ea1be49ee74eec2eaca8006599d7fc5560db6/src/louvain/VertexPartition.py#L203-L254 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/distutils/command/install_egg_info.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/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/command/install_egg_info.py#L54-L59 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ogl/_basic.py | python | Shape.SetTextColour | (self, the_colour, regionId = 0) | Set the colour for the specified text region. | Set the colour for the specified text region. | [
"Set",
"the",
"colour",
"for",
"the",
"specified",
"text",
"region",
"."
] | def SetTextColour(self, the_colour, regionId = 0):
"""Set the colour for the specified text region."""
self._textColour = wx.TheColourDatabase.Find(the_colour)
self._textColourName = the_colour
if regionId < len(self._regions):
self._regions[regionId].SetColour(the_colour) | [
"def",
"SetTextColour",
"(",
"self",
",",
"the_colour",
",",
"regionId",
"=",
"0",
")",
":",
"self",
".",
"_textColour",
"=",
"wx",
".",
"TheColourDatabase",
".",
"Find",
"(",
"the_colour",
")",
"self",
".",
"_textColourName",
"=",
"the_colour",
"if",
"reg... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_basic.py#L640-L646 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/requests/utils.py | python | to_key_val_list | (value) | return list(value) | Take an object and test to see if it can be represented as a
dictionary. If it can be, return a list of tuples, e.g.,
::
>>> to_key_val_list([('key', 'val')])
[('key', 'val')]
>>> to_key_val_list({'key': 'val'})
[('key', 'val')]
>>> to_key_val_list('string')
Tra... | Take an object and test to see if it can be represented as a
dictionary. If it can be, return a list of tuples, e.g., | [
"Take",
"an",
"object",
"and",
"test",
"to",
"see",
"if",
"it",
"can",
"be",
"represented",
"as",
"a",
"dictionary",
".",
"If",
"it",
"can",
"be",
"return",
"a",
"list",
"of",
"tuples",
"e",
".",
"g",
"."
] | def to_key_val_list(value):
"""Take an object and test to see if it can be represented as a
dictionary. If it can be, return a list of tuples, e.g.,
::
>>> to_key_val_list([('key', 'val')])
[('key', 'val')]
>>> to_key_val_list({'key': 'val'})
[('key', 'val')]
>>> to... | [
"def",
"to_key_val_list",
"(",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"return",
"None",
"if",
"isinstance",
"(",
"value",
",",
"(",
"str",
",",
"bytes",
",",
"bool",
",",
"int",
")",
")",
":",
"raise",
"ValueError",
"(",
"'cannot encode o... | 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/requests/utils.py#L293-L319 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewItemAttr.IsDefault | (*args, **kwargs) | return _dataview.DataViewItemAttr_IsDefault(*args, **kwargs) | IsDefault(self) -> bool | IsDefault(self) -> bool | [
"IsDefault",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsDefault(*args, **kwargs):
"""IsDefault(self) -> bool"""
return _dataview.DataViewItemAttr_IsDefault(*args, **kwargs) | [
"def",
"IsDefault",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewItemAttr_IsDefault",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L377-L379 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/framework/ops.py | python | enable_eager_execution_internal | (config=None,
device_policy=None,
execution_mode=None,
server_def=None) | Enables eager execution for the lifetime of this program.
Most of the doc string for enable_eager_execution is relevant here as well.
Args:
config: See enable_eager_execution doc string
device_policy: See enable_eager_execution doc string
execution_mode: See enable_eager_execution doc string
serve... | Enables eager execution for the lifetime of this program. | [
"Enables",
"eager",
"execution",
"for",
"the",
"lifetime",
"of",
"this",
"program",
"."
] | def enable_eager_execution_internal(config=None,
device_policy=None,
execution_mode=None,
server_def=None):
"""Enables eager execution for the lifetime of this program.
Most of the doc string for enable_eage... | [
"def",
"enable_eager_execution_internal",
"(",
"config",
"=",
"None",
",",
"device_policy",
"=",
"None",
",",
"execution_mode",
"=",
"None",
",",
"server_def",
"=",
"None",
")",
":",
"if",
"config",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"conf... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/framework/ops.py#L6157-L6227 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel.add_faces_to_side_set | (self, side_set_id, new_side_set_members) | Add the given faces to the side set.
The parameter 'new_side_set_members' should be a list of tuples of the
form:
* '(element_block_id, local_element_index, element_side_index)'
Example:
>>> model.add_faces_to_side_set(1, [(2, 0, 3), (3, 0, 4)]) | Add the given faces to the side set. | [
"Add",
"the",
"given",
"faces",
"to",
"the",
"side",
"set",
"."
] | def add_faces_to_side_set(self, side_set_id, new_side_set_members):
"""
Add the given faces to the side set.
The parameter 'new_side_set_members' should be a list of tuples of the
form:
* '(element_block_id, local_element_index, element_side_index)'
Example:
>>>... | [
"def",
"add_faces_to_side_set",
"(",
"self",
",",
"side_set_id",
",",
"new_side_set_members",
")",
":",
"if",
"not",
"self",
".",
"side_set_exists",
"(",
"side_set_id",
")",
":",
"self",
".",
"_warning",
"(",
"'Side set does not exist.'",
"'The specified side set \"%s... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L4474-L4510 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/func_graph.py | python | dismantle_func_graph | (func_graph) | Removes reference cycles in `func_graph` FuncGraph.
Helpful for making sure the garbage collector doesn't need to run when
the FuncGraph goes out of scope, e.g. in tests using defun with
@test_util.run_in_graph_and_eager_modes(assert_no_eager_garbage=True).
Args:
func_graph: A `FuncGraph` object to destro... | Removes reference cycles in `func_graph` FuncGraph. | [
"Removes",
"reference",
"cycles",
"in",
"func_graph",
"FuncGraph",
"."
] | def dismantle_func_graph(func_graph):
"""Removes reference cycles in `func_graph` FuncGraph.
Helpful for making sure the garbage collector doesn't need to run when
the FuncGraph goes out of scope, e.g. in tests using defun with
@test_util.run_in_graph_and_eager_modes(assert_no_eager_garbage=True).
Args:
... | [
"def",
"dismantle_func_graph",
"(",
"func_graph",
")",
":",
"func_graph",
".",
"clear_captures",
"(",
")",
"ops",
".",
"dismantle_graph",
"(",
"func_graph",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/func_graph.py#L1174-L1186 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/composite_tensor_ops.py | python | composite_tensor_to_variants | (value, type_spec=None, name=None) | return gen_composite_tensor_ops.CompositeTensorVariantFromComponents(
components=nest.flatten(value, expand_composites=True),
metadata=metadata.SerializeToString(),
name=name) | Encodes `value` as a scalar variant tensor.
Args:
value: The `ExtensionType` value to encode.
type_spec: Information about the value's type that should be included in the
encoding.
name: Optional name for the operation.
Returns:
A Tensor with shape=`()` and dtype=`tf.variant`.
Raises:
... | Encodes `value` as a scalar variant tensor. | [
"Encodes",
"value",
"as",
"a",
"scalar",
"variant",
"tensor",
"."
] | def composite_tensor_to_variants(value, type_spec=None, name=None):
"""Encodes `value` as a scalar variant tensor.
Args:
value: The `ExtensionType` value to encode.
type_spec: Information about the value's type that should be included in the
encoding.
name: Optional name for the operation.
Ret... | [
"def",
"composite_tensor_to_variants",
"(",
"value",
",",
"type_spec",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"composite_tensor",
".",
"CompositeTensor",
")",
":",
"raise",
"TypeError",
"(",
"\"Expected `... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/composite_tensor_ops.py#L26-L57 | |
pl8787/textnet-release | c85a4162c55b4cfe22eab6f8f0c8b615854f9b8f | python/draw_net.py | python | choose_color_by_layertype | (layertype) | return color | Define colors for nodes based on the layer type | Define colors for nodes based on the layer type | [
"Define",
"colors",
"for",
"nodes",
"based",
"on",
"the",
"layer",
"type"
] | def choose_color_by_layertype(layertype):
"""Define colors for nodes based on the layer type
"""
color = '#6495ED' # Default
if layertype == 'Conv':
color = '#FF5050'
elif layertype == 'Embedding':
color = '#FF9900'
elif layertype == 'FullConnect':
color = '#CC33FF'
elif layertype == 'M... | [
"def",
"choose_color_by_layertype",
"(",
"layertype",
")",
":",
"color",
"=",
"'#6495ED'",
"# Default",
"if",
"layertype",
"==",
"'Conv'",
":",
"color",
"=",
"'#FF5050'",
"elif",
"layertype",
"==",
"'Embedding'",
":",
"color",
"=",
"'#FF9900'",
"elif",
"layertyp... | https://github.com/pl8787/textnet-release/blob/c85a4162c55b4cfe22eab6f8f0c8b615854f9b8f/python/draw_net.py#L178-L192 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/optparse.py | python | OptionParser.destroy | (self) | Declare that you are done with this OptionParser. This cleans up
reference cycles so the OptionParser (and all objects referenced by
it) can be garbage-collected promptly. After calling destroy(), the
OptionParser is unusable. | Declare that you are done with this OptionParser. This cleans up
reference cycles so the OptionParser (and all objects referenced by
it) can be garbage-collected promptly. After calling destroy(), the
OptionParser is unusable. | [
"Declare",
"that",
"you",
"are",
"done",
"with",
"this",
"OptionParser",
".",
"This",
"cleans",
"up",
"reference",
"cycles",
"so",
"the",
"OptionParser",
"(",
"and",
"all",
"objects",
"referenced",
"by",
"it",
")",
"can",
"be",
"garbage",
"-",
"collected",
... | def destroy(self):
"""
Declare that you are done with this OptionParser. This cleans up
reference cycles so the OptionParser (and all objects referenced by
it) can be garbage-collected promptly. After calling destroy(), the
OptionParser is unusable.
"""
OptionCo... | [
"def",
"destroy",
"(",
"self",
")",
":",
"OptionContainer",
".",
"destroy",
"(",
"self",
")",
"for",
"group",
"in",
"self",
".",
"option_groups",
":",
"group",
".",
"destroy",
"(",
")",
"del",
"self",
".",
"option_list",
"del",
"self",
".",
"option_group... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/optparse.py#L1212-L1224 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/prison-cells-after-n-days.py | python | Solution2.prisonAfterNDays | (self, cells, N) | return list(cells) | :type cells: List[int]
:type N: int
:rtype: List[int] | :type cells: List[int]
:type N: int
:rtype: List[int] | [
":",
"type",
"cells",
":",
"List",
"[",
"int",
"]",
":",
"type",
"N",
":",
"int",
":",
"rtype",
":",
"List",
"[",
"int",
"]"
] | def prisonAfterNDays(self, cells, N):
"""
:type cells: List[int]
:type N: int
:rtype: List[int]
"""
cells = tuple(cells)
lookup = {}
while N:
lookup[cells] = N
N -= 1
cells = tuple([0] + [cells[i - 1] ^ cells[i + 1] ^ 1 ... | [
"def",
"prisonAfterNDays",
"(",
"self",
",",
"cells",
",",
"N",
")",
":",
"cells",
"=",
"tuple",
"(",
"cells",
")",
"lookup",
"=",
"{",
"}",
"while",
"N",
":",
"lookup",
"[",
"cells",
"]",
"=",
"N",
"N",
"-=",
"1",
"cells",
"=",
"tuple",
"(",
"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/prison-cells-after-n-days.py#L20-L40 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/training/supervisor.py | python | Supervisor._write_graph | (self) | Writes graph_def to `logdir` and adds it to summary if applicable. | Writes graph_def to `logdir` and adds it to summary if applicable. | [
"Writes",
"graph_def",
"to",
"logdir",
"and",
"adds",
"it",
"to",
"summary",
"if",
"applicable",
"."
] | def _write_graph(self):
"""Writes graph_def to `logdir` and adds it to summary if applicable."""
assert self._is_chief
if self._logdir:
training_util.write_graph(self._graph.as_graph_def(add_shapes=True),
self._logdir, "graph.pbtxt")
if self._summary_writer and not ... | [
"def",
"_write_graph",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_is_chief",
"if",
"self",
".",
"_logdir",
":",
"training_util",
".",
"write_graph",
"(",
"self",
".",
"_graph",
".",
"as_graph_def",
"(",
"add_shapes",
"=",
"True",
")",
",",
"self",
"... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/supervisor.py#L577-L585 | ||
gnina/gnina | b9ae032f52fc7a8153987bde09c0efa3620d8bb6 | caffe/examples/pycaffe/tools.py | python | SimpleTransformer.set_mean | (self, mean) | Set the mean to subtract for centering the data. | Set the mean to subtract for centering the data. | [
"Set",
"the",
"mean",
"to",
"subtract",
"for",
"centering",
"the",
"data",
"."
] | def set_mean(self, mean):
"""
Set the mean to subtract for centering the data.
"""
self.mean = mean | [
"def",
"set_mean",
"(",
"self",
",",
"mean",
")",
":",
"self",
".",
"mean",
"=",
"mean"
] | https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/examples/pycaffe/tools.py#L15-L19 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/iam/connection.py | python | IAMConnection.delete_account_password_policy | (self) | return self.get_response('DeleteAccountPasswordPolicy', params) | Delete the password policy currently set for the AWS account. | Delete the password policy currently set for the AWS account. | [
"Delete",
"the",
"password",
"policy",
"currently",
"set",
"for",
"the",
"AWS",
"account",
"."
] | def delete_account_password_policy(self):
"""
Delete the password policy currently set for the AWS account.
"""
params = {}
return self.get_response('DeleteAccountPasswordPolicy', params) | [
"def",
"delete_account_password_policy",
"(",
"self",
")",
":",
"params",
"=",
"{",
"}",
"return",
"self",
".",
"get_response",
"(",
"'DeleteAccountPasswordPolicy'",
",",
"params",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/iam/connection.py#L1559-L1564 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/socket.py | python | _intenum_converter | (value, enum_klass) | Convert a numeric family value to an IntEnum member.
If it's not a known member, return the numeric value itself. | Convert a numeric family value to an IntEnum member. | [
"Convert",
"a",
"numeric",
"family",
"value",
"to",
"an",
"IntEnum",
"member",
"."
] | def _intenum_converter(value, enum_klass):
"""Convert a numeric family value to an IntEnum member.
If it's not a known member, return the numeric value itself.
"""
try:
return enum_klass(value)
except ValueError:
return value | [
"def",
"_intenum_converter",
"(",
"value",
",",
"enum_klass",
")",
":",
"try",
":",
"return",
"enum_klass",
"(",
"value",
")",
"except",
"ValueError",
":",
"return",
"value"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/socket.py#L97-L105 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/modes/notemacs.py | python | NotEmacsMode.end_of_history | (self, e) | Move to the end of the input history, i.e., the line currently
being entered. | Move to the end of the input history, i.e., the line currently
being entered. | [
"Move",
"to",
"the",
"end",
"of",
"the",
"input",
"history",
"i",
".",
"e",
".",
"the",
"line",
"currently",
"being",
"entered",
"."
] | def end_of_history(self, e): # (M->)
'''Move to the end of the input history, i.e., the line currently
being entered.'''
self._history.end_of_history(self.l_buffer) | [
"def",
"end_of_history",
"(",
"self",
",",
"e",
")",
":",
"# (M->)",
"self",
".",
"_history",
".",
"end_of_history",
"(",
"self",
".",
"l_buffer",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/notemacs.py#L148-L151 | ||
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-utils/modtool/cli/base.py | python | run | (module) | Call the run function of the core modules. | Call the run function of the core modules. | [
"Call",
"the",
"run",
"function",
"of",
"the",
"core",
"modules",
"."
] | def run(module):
"""Call the run function of the core modules."""
try:
module.run()
except ModToolException as err:
click.echo(err, file=sys.stderr)
exit(1) | [
"def",
"run",
"(",
"module",
")",
":",
"try",
":",
"module",
".",
"run",
"(",
")",
"except",
"ModToolException",
"as",
"err",
":",
"click",
".",
"echo",
"(",
"err",
",",
"file",
"=",
"sys",
".",
"stderr",
")",
"exit",
"(",
"1",
")"
] | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-utils/modtool/cli/base.py#L152-L158 | ||
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/draw/drawplot/matplotlib_draw.py | python | create_three_axes_figure | (figsize=(10, 8)) | return ax1, ax2, ax3 | 生成一个含有3个坐标轴的figure,并返回坐标轴列表
:param figsize: (宽, 高)
:return: (ax1, ax2, ax3) | 生成一个含有3个坐标轴的figure,并返回坐标轴列表
:param figsize: (宽, 高)
:return: (ax1, ax2, ax3) | [
"生成一个含有3个坐标轴的figure,并返回坐标轴列表",
":",
"param",
"figsize",
":",
"(",
"宽",
"高",
")",
":",
"return",
":",
"(",
"ax1",
"ax2",
"ax3",
")"
] | def create_three_axes_figure(figsize=(10, 8)):
"""生成一个含有3个坐标轴的figure,并返回坐标轴列表
:param figsize: (宽, 高)
:return: (ax1, ax2, ax3)
"""
rect1 = [0.05, 0.45, 0.9, 0.50]
rect2 = [0.05, 0.25, 0.9, 0.20]
rect3 = [0.05, 0.05, 0.9, 0.20]
fg = figure(figsize=figsize)
ax1 = fg.add_axes(rect1... | [
"def",
"create_three_axes_figure",
"(",
"figsize",
"=",
"(",
"10",
",",
"8",
")",
")",
":",
"rect1",
"=",
"[",
"0.05",
",",
"0.45",
",",
"0.9",
",",
"0.50",
"]",
"rect2",
"=",
"[",
"0.05",
",",
"0.25",
",",
"0.9",
",",
"0.20",
"]",
"rect3",
"=",
... | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/draw/drawplot/matplotlib_draw.py#L47-L62 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py | python | setup_predict_data_feeder | (x, batch_size=None) | return [x] | Returns an iterable for feeding into predict step.
Args:
x: numpy, pandas, Dask array or dictionary of aforementioned. Also supports
iterable.
batch_size: Size of batches to split data into. If `None`, returns one
batch of full size.
Returns:
List or iterator (or dictionary thereof) of par... | Returns an iterable for feeding into predict step. | [
"Returns",
"an",
"iterable",
"for",
"feeding",
"into",
"predict",
"step",
"."
] | def setup_predict_data_feeder(x, batch_size=None):
"""Returns an iterable for feeding into predict step.
Args:
x: numpy, pandas, Dask array or dictionary of aforementioned. Also supports
iterable.
batch_size: Size of batches to split data into. If `None`, returns one
batch of full size.
Retu... | [
"def",
"setup_predict_data_feeder",
"(",
"x",
",",
"batch_size",
"=",
"None",
")",
":",
"if",
"HAS_DASK",
":",
"x",
"=",
"extract_dask_data",
"(",
"x",
")",
"if",
"HAS_PANDAS",
":",
"x",
"=",
"extract_pandas_data",
"(",
"x",
")",
"if",
"_is_iterable",
"(",... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py#L190-L218 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/mws/connection.py | python | MWSConnection.iter_response | (self, response) | Pass a call's response as the initial argument and a
generator is returned for the initial response and any
continuation call responses made using the NextToken. | Pass a call's response as the initial argument and a
generator is returned for the initial response and any
continuation call responses made using the NextToken. | [
"Pass",
"a",
"call",
"s",
"response",
"as",
"the",
"initial",
"argument",
"and",
"a",
"generator",
"is",
"returned",
"for",
"the",
"initial",
"response",
"and",
"any",
"continuation",
"call",
"responses",
"made",
"using",
"the",
"NextToken",
"."
] | def iter_response(self, response):
"""Pass a call's response as the initial argument and a
generator is returned for the initial response and any
continuation call responses made using the NextToken.
"""
yield response
more = self.method_for(response._action + 'ByNe... | [
"def",
"iter_response",
"(",
"self",
",",
"response",
")",
":",
"yield",
"response",
"more",
"=",
"self",
".",
"method_for",
"(",
"response",
".",
"_action",
"+",
"'ByNextToken'",
")",
"while",
"more",
"and",
"response",
".",
"_result",
".",
"HasNext",
"==... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/mws/connection.py#L356-L365 | ||
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/ScreenCapture/ScreenCapture.py | python | ScreenCaptureWidget.addLog | (self, text) | Append text to log window | Append text to log window | [
"Append",
"text",
"to",
"log",
"window"
] | def addLog(self, text):
"""Append text to log window
"""
self.statusLabel.appendPlainText(text)
self.statusLabel.ensureCursorVisible()
slicer.app.processEvents() | [
"def",
"addLog",
"(",
"self",
",",
"text",
")",
":",
"self",
".",
"statusLabel",
".",
"appendPlainText",
"(",
"text",
")",
"self",
".",
"statusLabel",
".",
"ensureCursorVisible",
"(",
")",
"slicer",
".",
"app",
".",
"processEvents",
"(",
")"
] | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/ScreenCapture/ScreenCapture.py#L459-L464 | ||
tuttleofx/TuttleOFX | 36fc4cae15092a84ea8c29b9c6658c7cabfadb6e | applications/sam/sam_do.py | python | Sam_do._setTimeRanges | (self, computeOptions, ranges) | Set time ranges of the given compute options. | Set time ranges of the given compute options. | [
"Set",
"time",
"ranges",
"of",
"the",
"given",
"compute",
"options",
"."
] | def _setTimeRanges(self, computeOptions, ranges):
"""
Set time ranges of the given compute options.
"""
def grouper(iterable, n, fillValue=None):
"""
Collect data into fixed-length chunks or blocks.
"""
args = [iter(iterable)] * n
... | [
"def",
"_setTimeRanges",
"(",
"self",
",",
"computeOptions",
",",
"ranges",
")",
":",
"def",
"grouper",
"(",
"iterable",
",",
"n",
",",
"fillValue",
"=",
"None",
")",
":",
"\"\"\"\n Collect data into fixed-length chunks or blocks.\n \"\"\"",
"args"... | https://github.com/tuttleofx/TuttleOFX/blob/36fc4cae15092a84ea8c29b9c6658c7cabfadb6e/applications/sam/sam_do.py#L139-L153 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/externals/joblib/memory.py | python | MemorizedFunc.__reduce__ | (self) | return (self.__class__, (self.func, self.cachedir, self.ignore,
self.mmap_mode, self.compress, self._verbose)) | We don't store the timestamp when pickling, to avoid the hash
depending from it.
In addition, when unpickling, we run the __init__ | We don't store the timestamp when pickling, to avoid the hash
depending from it.
In addition, when unpickling, we run the __init__ | [
"We",
"don",
"t",
"store",
"the",
"timestamp",
"when",
"pickling",
"to",
"avoid",
"the",
"hash",
"depending",
"from",
"it",
".",
"In",
"addition",
"when",
"unpickling",
"we",
"run",
"the",
"__init__"
] | def __reduce__(self):
""" We don't store the timestamp when pickling, to avoid the hash
depending from it.
In addition, when unpickling, we run the __init__
"""
return (self.__class__, (self.func, self.cachedir, self.ignore,
self.mmap_mode, self.compress, ... | [
"def",
"__reduce__",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"__class__",
",",
"(",
"self",
".",
"func",
",",
"self",
".",
"cachedir",
",",
"self",
".",
"ignore",
",",
"self",
".",
"mmap_mode",
",",
"self",
".",
"compress",
",",
"self",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/externals/joblib/memory.py#L485-L491 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/jinja2/utils.py | python | object_type_repr | (obj) | return '%s object' % name | Returns the name of the object's type. For some recognized
singletons the name of the object is returned instead. (For
example for `None` and `Ellipsis`). | Returns the name of the object's type. For some recognized
singletons the name of the object is returned instead. (For
example for `None` and `Ellipsis`). | [
"Returns",
"the",
"name",
"of",
"the",
"object",
"s",
"type",
".",
"For",
"some",
"recognized",
"singletons",
"the",
"name",
"of",
"the",
"object",
"is",
"returned",
"instead",
".",
"(",
"For",
"example",
"for",
"None",
"and",
"Ellipsis",
")",
"."
] | def object_type_repr(obj):
"""Returns the name of the object's type. For some recognized
singletons the name of the object is returned instead. (For
example for `None` and `Ellipsis`).
"""
if obj is None:
return 'None'
elif obj is Ellipsis:
return 'Ellipsis'
# __builtin__ in... | [
"def",
"object_type_repr",
"(",
"obj",
")",
":",
"if",
"obj",
"is",
"None",
":",
"return",
"'None'",
"elif",
"obj",
"is",
"Ellipsis",
":",
"return",
"'Ellipsis'",
"# __builtin__ in 2.x, builtins in 3.x",
"if",
"obj",
".",
"__class__",
".",
"__module__",
"in",
... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/utils.py#L160-L174 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard_modules.py | python | get_target | (ctx, kw) | return target | Get the required target from the input keywords. 'target' is required so if it doesnt exist, an exception will be
raised.
:param ctx: Current context
:param kw: Keyword dictionary to search for 'target'
:return: The 'target' keyword value | Get the required target from the input keywords. 'target' is required so if it doesnt exist, an exception will be
raised. | [
"Get",
"the",
"required",
"target",
"from",
"the",
"input",
"keywords",
".",
"target",
"is",
"required",
"so",
"if",
"it",
"doesnt",
"exist",
"an",
"exception",
"will",
"be",
"raised",
"."
] | def get_target(ctx, kw):
"""
Get the required target from the input keywords. 'target' is required so if it doesnt exist, an exception will be
raised.
:param ctx: Current context
:param kw: Keyword dictionary to search for 'target'
:return: The 'target' keyword value
"""
# 'target' is ... | [
"def",
"get_target",
"(",
"ctx",
",",
"kw",
")",
":",
"# 'target' is required for all modules, validate it is in the dictionary",
"target",
"=",
"kw",
".",
"get",
"(",
"'target'",
",",
"None",
")",
"if",
"not",
"target",
":",
"raise",
"Errors",
".",
"WafError",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard_modules.py#L254-L267 | |
facebookincubator/katran | 192eb988c398afc673620254097defb7035d669e | build/fbcode_builder/getdeps/cargo.py | python | CargoBuilder._resolve_config | (self) | return "\n".join(config) | Returns a configuration to be put inside root Cargo.toml file which
patches the dependencies git code with local getdeps versions.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section | Returns a configuration to be put inside root Cargo.toml file which
patches the dependencies git code with local getdeps versions.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section | [
"Returns",
"a",
"configuration",
"to",
"be",
"put",
"inside",
"root",
"Cargo",
".",
"toml",
"file",
"which",
"patches",
"the",
"dependencies",
"git",
"code",
"with",
"local",
"getdeps",
"versions",
".",
"See",
"https",
":",
"//",
"doc",
".",
"rust",
"-",
... | def _resolve_config(self):
"""
Returns a configuration to be put inside root Cargo.toml file which
patches the dependencies git code with local getdeps versions.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-patch-section
"""
dep_to_git = self._resolve_d... | [
"def",
"_resolve_config",
"(",
"self",
")",
":",
"dep_to_git",
"=",
"self",
".",
"_resolve_dep_to_git",
"(",
")",
"dep_to_crates",
"=",
"CargoBuilder",
".",
"_resolve_dep_to_crates",
"(",
"self",
".",
"build_source_dir",
"(",
")",
",",
"dep_to_git",
")",
"config... | https://github.com/facebookincubator/katran/blob/192eb988c398afc673620254097defb7035d669e/build/fbcode_builder/getdeps/cargo.py#L187-L218 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py | python | sin | (x) | return math_ops.sin(x) | Computes sin of x element-wise.
Arguments:
x: Tensor or variable.
Returns:
A tensor. | Computes sin of x element-wise. | [
"Computes",
"sin",
"of",
"x",
"element",
"-",
"wise",
"."
] | def sin(x):
"""Computes sin of x element-wise.
Arguments:
x: Tensor or variable.
Returns:
A tensor.
"""
return math_ops.sin(x) | [
"def",
"sin",
"(",
"x",
")",
":",
"return",
"math_ops",
".",
"sin",
"(",
"x",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py#L2343-L2352 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | GridBagSizer.__init__ | (self, *args, **kwargs) | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
Constructor, with optional parameters to specify the gap between the
rows and columns. | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | [
"__init__",
"(",
"self",
"int",
"vgap",
"=",
"0",
"int",
"hgap",
"=",
"0",
")",
"-",
">",
"GridBagSizer"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, int vgap=0, int hgap=0) -> GridBagSizer
Constructor, with optional parameters to specify the gap between the
rows and columns.
"""
_core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_core_",
".",
"GridBagSizer_swiginit",
"(",
"self",
",",
"_core_",
".",
"new_GridBagSizer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
".",
"_setO... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L15916-L15924 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.