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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/estimators/rnn_common.py | python | _get_single_cell | (cell_type, num_units) | return cell_type(num_units=num_units) | Constructs and return a single `RNNCell`.
Args:
cell_type: Either a string identifying the `RNNCell` type or a subclass of
`RNNCell`.
num_units: The number of units in the `RNNCell`.
Returns:
An initialized `RNNCell`.
Raises:
ValueError: `cell_type` is an invalid `RNNCell` name.
TypeErr... | Constructs and return a single `RNNCell`. | [
"Constructs",
"and",
"return",
"a",
"single",
"RNNCell",
"."
] | def _get_single_cell(cell_type, num_units):
"""Constructs and return a single `RNNCell`.
Args:
cell_type: Either a string identifying the `RNNCell` type or a subclass of
`RNNCell`.
num_units: The number of units in the `RNNCell`.
Returns:
An initialized `RNNCell`.
Raises:
ValueError: `cel... | [
"def",
"_get_single_cell",
"(",
"cell_type",
",",
"num_units",
")",
":",
"cell_type",
"=",
"_CELL_TYPES",
".",
"get",
"(",
"cell_type",
",",
"cell_type",
")",
"if",
"not",
"cell_type",
"or",
"not",
"issubclass",
"(",
"cell_type",
",",
"contrib_rnn",
".",
"RN... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/estimators/rnn_common.py#L56-L73 | |
twhui/LiteFlowNet | 00925aebf2db9ac50f4b1666f718688b10dd10d1 | tools/extra/parse_log.py | python | save_csv_files | (logfile_path, output_dir, train_dict_list, test_dict_list,
delimiter=',', verbose=False) | Save CSV files to output_dir
If the input log file is, e.g., caffe.INFO, the names will be
caffe.INFO.train and caffe.INFO.test | Save CSV files to output_dir | [
"Save",
"CSV",
"files",
"to",
"output_dir"
] | def save_csv_files(logfile_path, output_dir, train_dict_list, test_dict_list,
delimiter=',', verbose=False):
"""Save CSV files to output_dir
If the input log file is, e.g., caffe.INFO, the names will be
caffe.INFO.train and caffe.INFO.test
"""
log_basename = os.path.basename(log... | [
"def",
"save_csv_files",
"(",
"logfile_path",
",",
"output_dir",
",",
"train_dict_list",
",",
"test_dict_list",
",",
"delimiter",
"=",
"','",
",",
"verbose",
"=",
"False",
")",
":",
"log_basename",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"logfile_path",
... | https://github.com/twhui/LiteFlowNet/blob/00925aebf2db9ac50f4b1666f718688b10dd10d1/tools/extra/parse_log.py#L132-L145 | ||
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | tools/ci_build/github/linux/ort_minimal/readelf_utils.py | python | diff_sections_total_size | (base_binary_path, binary_path, readelf_path='readelf') | return results | Diff the sections entries for two binaries.
:param base_binary_path: Path to base binary for diff.
:param binary_path: Path to binary to diff using.
:param readelf_path: Path to 'readelf' binary. Defaults to 'readelf'
:return: Ordered dictionary containing size of diff for all sections with a diff, the ... | Diff the sections entries for two binaries.
:param base_binary_path: Path to base binary for diff.
:param binary_path: Path to binary to diff using.
:param readelf_path: Path to 'readelf' binary. Defaults to 'readelf'
:return: Ordered dictionary containing size of diff for all sections with a diff, the ... | [
"Diff",
"the",
"sections",
"entries",
"for",
"two",
"binaries",
".",
":",
"param",
"base_binary_path",
":",
"Path",
"to",
"base",
"binary",
"for",
"diff",
".",
":",
"param",
"binary_path",
":",
"Path",
"to",
"binary",
"to",
"diff",
"using",
".",
":",
"pa... | def diff_sections_total_size(base_binary_path, binary_path, readelf_path='readelf'):
'''
Diff the sections entries for two binaries.
:param base_binary_path: Path to base binary for diff.
:param binary_path: Path to binary to diff using.
:param readelf_path: Path to 'readelf' binary. Defaults to 're... | [
"def",
"diff_sections_total_size",
"(",
"base_binary_path",
",",
"binary_path",
",",
"readelf_path",
"=",
"'readelf'",
")",
":",
"filesize",
"=",
"os",
".",
"path",
".",
"getsize",
"(",
"binary_path",
")",
"base_filesize",
"=",
"os",
".",
"path",
".",
"getsize... | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/tools/ci_build/github/linux/ort_minimal/readelf_utils.py#L47-L81 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/system_info.py | python | get_standard_file | (fname) | return filenames | Returns a list of files named 'fname' from
1) System-wide directory (directory-location of this module)
2) Users HOME directory (os.environ['HOME'])
3) Local directory | Returns a list of files named 'fname' from
1) System-wide directory (directory-location of this module)
2) Users HOME directory (os.environ['HOME'])
3) Local directory | [
"Returns",
"a",
"list",
"of",
"files",
"named",
"fname",
"from",
"1",
")",
"System",
"-",
"wide",
"directory",
"(",
"directory",
"-",
"location",
"of",
"this",
"module",
")",
"2",
")",
"Users",
"HOME",
"directory",
"(",
"os",
".",
"environ",
"[",
"HOME... | def get_standard_file(fname):
"""Returns a list of files named 'fname' from
1) System-wide directory (directory-location of this module)
2) Users HOME directory (os.environ['HOME'])
3) Local directory
"""
# System-wide file
filenames = []
try:
f = __file__
except NameError:
... | [
"def",
"get_standard_file",
"(",
"fname",
")",
":",
"# System-wide file",
"filenames",
"=",
"[",
"]",
"try",
":",
"f",
"=",
"__file__",
"except",
"NameError",
":",
"f",
"=",
"sys",
".",
"argv",
"[",
"0",
"]",
"else",
":",
"sysfile",
"=",
"os",
".",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/system_info.py#L351-L384 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/plugins/prt/prt.py | python | PrtVehicles.switch_off_control | (self, id_veh) | Direct way to switch of SUMO control of vehicles | Direct way to switch of SUMO control of vehicles | [
"Direct",
"way",
"to",
"switch",
"of",
"SUMO",
"control",
"of",
"vehicles"
] | def switch_off_control(self, id_veh):
"""Direct way to switch of SUMO control of vehicles"""
# print 'switch_off_control id_veh',id_veh
traci.vehicle.setSpeedMode(self.ids_sumo[id_veh], 6) | [
"def",
"switch_off_control",
"(",
"self",
",",
"id_veh",
")",
":",
"# print 'switch_off_control id_veh',id_veh",
"traci",
".",
"vehicle",
".",
"setSpeedMode",
"(",
"self",
".",
"ids_sumo",
"[",
"id_veh",
"]",
",",
"6",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/plugins/prt/prt.py#L4043-L4046 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBTarget.GetTargetFromEvent | (event) | return _lldb.SBTarget_GetTargetFromEvent(event) | GetTargetFromEvent(SBEvent event) -> SBTarget | GetTargetFromEvent(SBEvent event) -> SBTarget | [
"GetTargetFromEvent",
"(",
"SBEvent",
"event",
")",
"-",
">",
"SBTarget"
] | def GetTargetFromEvent(event):
"""GetTargetFromEvent(SBEvent event) -> SBTarget"""
return _lldb.SBTarget_GetTargetFromEvent(event) | [
"def",
"GetTargetFromEvent",
"(",
"event",
")",
":",
"return",
"_lldb",
".",
"SBTarget_GetTargetFromEvent",
"(",
"event",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L10307-L10309 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/data_structures/sarray.py | python | SArray.cumulative_min | (self) | return SArray(_proxy = self.__proxy__.builtin_cumulative_aggregate(agg_op)) | Return the cumulative minimum value of the elements in the SArray.
Returns an SArray where each element in the output corresponds to the
minimum value of all the elements preceding and including it. The
SArray is expected to be of numeric type (int, float).
Returns
-------
... | Return the cumulative minimum value of the elements in the SArray. | [
"Return",
"the",
"cumulative",
"minimum",
"value",
"of",
"the",
"elements",
"in",
"the",
"SArray",
"."
] | def cumulative_min(self):
"""
Return the cumulative minimum value of the elements in the SArray.
Returns an SArray where each element in the output corresponds to the
minimum value of all the elements preceding and including it. The
SArray is expected to be of numeric type (int,... | [
"def",
"cumulative_min",
"(",
"self",
")",
":",
"from",
".",
".",
"import",
"extensions",
"agg_op",
"=",
"\"__builtin__cum_min__\"",
"return",
"SArray",
"(",
"_proxy",
"=",
"self",
".",
"__proxy__",
".",
"builtin_cumulative_aggregate",
"(",
"agg_op",
")",
")"
] | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sarray.py#L4056-L4083 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/telnetlib.py | python | Telnet.sock_avail | (self) | Test whether data is available on the socket. | Test whether data is available on the socket. | [
"Test",
"whether",
"data",
"is",
"available",
"on",
"the",
"socket",
"."
] | def sock_avail(self):
"""Test whether data is available on the socket."""
with _TelnetSelector() as selector:
selector.register(self, selectors.EVENT_READ)
return bool(selector.select(0)) | [
"def",
"sock_avail",
"(",
"self",
")",
":",
"with",
"_TelnetSelector",
"(",
")",
"as",
"selector",
":",
"selector",
".",
"register",
"(",
"self",
",",
"selectors",
".",
"EVENT_READ",
")",
"return",
"bool",
"(",
"selector",
".",
"select",
"(",
"0",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/telnetlib.py#L529-L533 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/tensor_array_ops.py | python | _GraphTensorArray.grad | (self, source, flow=None, name=None) | See TensorArray. | See TensorArray. | [
"See",
"TensorArray",
"."
] | def grad(self, source, flow=None, name=None):
"""See TensorArray."""
# tensor_array_grad requires a flow input when forward
# TensorArrays are dynamically sized. This forces the creation
# of the grad TensorArray only once the final forward array's size
# is fixed.
if flow is None:
flow =... | [
"def",
"grad",
"(",
"self",
",",
"source",
",",
"flow",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"# tensor_array_grad requires a flow input when forward",
"# TensorArrays are dynamically sized. This forces the creation",
"# of the grad TensorArray only once the final for... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/tensor_array_ops.py#L224-L247 | ||
PrincetonUniversity/athena-public-version | 9c266692b9423743d8e23509b3ab266a232a92d2 | tst/style/cpplint.py | python | IsDerivedFunction | (clean_lines, linenum) | return False | Check if current line contains an inherited function.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains a function with "override"
virt-specifier. | Check if current line contains an inherited function. | [
"Check",
"if",
"current",
"line",
"contains",
"an",
"inherited",
"function",
"."
] | def IsDerivedFunction(clean_lines, linenum):
"""Check if current line contains an inherited function.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
Returns:
True if current line contains a function with "override"
virt-spe... | [
"def",
"IsDerivedFunction",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"# Scan back a few lines for start of current function",
"for",
"i",
"in",
"xrange",
"(",
"linenum",
",",
"max",
"(",
"-",
"1",
",",
"linenum",
"-",
"10",
")",
",",
"-",
"1",
")",
":",... | https://github.com/PrincetonUniversity/athena-public-version/blob/9c266692b9423743d8e23509b3ab266a232a92d2/tst/style/cpplint.py#L5210-L5229 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/sparse/lil.py | python | lil_matrix.getrowview | (self, i) | return new | Returns a view of the 'i'th row (without copying). | Returns a view of the 'i'th row (without copying). | [
"Returns",
"a",
"view",
"of",
"the",
"i",
"th",
"row",
"(",
"without",
"copying",
")",
"."
] | def getrowview(self, i):
"""Returns a view of the 'i'th row (without copying).
"""
new = lil_matrix((1, self.shape[1]), dtype=self.dtype)
new.rows[0] = self.rows[i]
new.data[0] = self.data[i]
return new | [
"def",
"getrowview",
"(",
"self",
",",
"i",
")",
":",
"new",
"=",
"lil_matrix",
"(",
"(",
"1",
",",
"self",
".",
"shape",
"[",
"1",
"]",
")",
",",
"dtype",
"=",
"self",
".",
"dtype",
")",
"new",
".",
"rows",
"[",
"0",
"]",
"=",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/sparse/lil.py#L193-L199 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/turtle.py | python | TurtleScreenBase._onkeyrelease | (self, fun, key) | Bind fun to key-release event of key.
Canvas must have focus. See method listen | Bind fun to key-release event of key.
Canvas must have focus. See method listen | [
"Bind",
"fun",
"to",
"key",
"-",
"release",
"event",
"of",
"key",
".",
"Canvas",
"must",
"have",
"focus",
".",
"See",
"method",
"listen"
] | def _onkeyrelease(self, fun, key):
"""Bind fun to key-release event of key.
Canvas must have focus. See method listen
"""
if fun is None:
self.cv.unbind("<KeyRelease-%s>" % key, None)
else:
def eventfun(event):
fun()
self.cv.bin... | [
"def",
"_onkeyrelease",
"(",
"self",
",",
"fun",
",",
"key",
")",
":",
"if",
"fun",
"is",
"None",
":",
"self",
".",
"cv",
".",
"unbind",
"(",
"\"<KeyRelease-%s>\"",
"%",
"key",
",",
"None",
")",
"else",
":",
"def",
"eventfun",
"(",
"event",
")",
":... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/turtle.py#L678-L687 | ||
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/common/Gradient.py | python | Gradient.reverse_gamma | (self, color) | return ret | Given a color, it reverses the effect of gamma as done in extract_colors()
Args:
color (common.Color.Color) : color element
Returns:
(common.Color.Color) : color element with gamma effect reversed | Given a color, it reverses the effect of gamma as done in extract_colors() | [
"Given",
"a",
"color",
"it",
"reverses",
"the",
"effect",
"of",
"gamma",
"as",
"done",
"in",
"extract_colors",
"()"
] | def reverse_gamma(self, color):
"""
Given a color, it reverses the effect of gamma as done in extract_colors()
Args:
color (common.Color.Color) : color element
Returns:
(common.Color.Color) : color element with gamma effect reversed
"""
ret = cop... | [
"def",
"reverse_gamma",
"(",
"self",
",",
"color",
")",
":",
"ret",
"=",
"copy",
".",
"deepcopy",
"(",
"color",
")",
"ret",
".",
"red",
"=",
"ret",
".",
"red",
"**",
"settings",
".",
"GAMMA",
"[",
"0",
"]",
"ret",
".",
"green",
"=",
"ret",
".",
... | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/common/Gradient.py#L46-L60 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | example/gluon/lipnet/utils/align.py | python | Align.word | (self, _id, padding=75) | return np.array(vec, dtype=np.int32) | Get words | Get words | [
"Get",
"words"
] | def word(self, _id, padding=75):
"""
Get words
"""
word = self.words[_id][2]
vec = word_to_vector(word)
vec += [-1] * (padding - len(vec))
return np.array(vec, dtype=np.int32) | [
"def",
"word",
"(",
"self",
",",
"_id",
",",
"padding",
"=",
"75",
")",
":",
"word",
"=",
"self",
".",
"words",
"[",
"_id",
"]",
"[",
"2",
"]",
"vec",
"=",
"word_to_vector",
"(",
"word",
")",
"vec",
"+=",
"[",
"-",
"1",
"]",
"*",
"(",
"paddin... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/example/gluon/lipnet/utils/align.py#L62-L69 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/generator/msvs.py | python | _EscapeEnvironmentVariableExpansion | (s) | return s | Escapes % characters.
Escapes any % characters so that Windows-style environment variable
expansions will leave them alone.
See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile
to understand why we have to do this.
Args:
s... | Escapes % characters. | [
"Escapes",
"%",
"characters",
"."
] | def _EscapeEnvironmentVariableExpansion(s):
"""Escapes % characters.
Escapes any % characters so that Windows-style environment variable
expansions will leave them alone.
See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile
to un... | [
"def",
"_EscapeEnvironmentVariableExpansion",
"(",
"s",
")",
":",
"s",
"=",
"s",
".",
"replace",
"(",
"'%'",
",",
"'%%'",
")",
"return",
"s"
] | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/msvs.py#L649-L664 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | CommandBit.parseparameter | (self, pos) | return parameter | Parse a parameter at the current position | Parse a parameter at the current position | [
"Parse",
"a",
"parameter",
"at",
"the",
"current",
"position"
] | def parseparameter(self, pos):
"Parse a parameter at the current position"
self.factory.clearskipped(pos)
if pos.finished():
return None
parameter = self.factory.parseany(pos)
self.add(parameter)
return parameter | [
"def",
"parseparameter",
"(",
"self",
",",
"pos",
")",
":",
"self",
".",
"factory",
".",
"clearskipped",
"(",
"pos",
")",
"if",
"pos",
".",
"finished",
"(",
")",
":",
"return",
"None",
"parameter",
"=",
"self",
".",
"factory",
".",
"parseany",
"(",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L4138-L4145 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/msvc.py | python | EnvironmentInfo.VSTools | (self) | return [join(self.si.VSInstallDir, path) for path in paths] | Microsoft Visual Studio Tools.
Return
------
list of str
paths | Microsoft Visual Studio Tools. | [
"Microsoft",
"Visual",
"Studio",
"Tools",
"."
] | def VSTools(self):
"""
Microsoft Visual Studio Tools.
Return
------
list of str
paths
"""
paths = [r'Common7\IDE', r'Common7\Tools']
if self.vs_ver >= 14.0:
arch_subdir = self.pi.current_dir(hidex86=True, x64=True)
pat... | [
"def",
"VSTools",
"(",
"self",
")",
":",
"paths",
"=",
"[",
"r'Common7\\IDE'",
",",
"r'Common7\\Tools'",
"]",
"if",
"self",
".",
"vs_ver",
">=",
"14.0",
":",
"arch_subdir",
"=",
"self",
".",
"pi",
".",
"current_dir",
"(",
"hidex86",
"=",
"True",
",",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/msvc.py#L1249-L1266 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/python/turicreate/toolkits/image_similarity/image_similarity.py | python | ImageSimilarityModel.__repr__ | (self) | return out | Print a string description of the model when the model name is entered
in the terminal. | Print a string description of the model when the model name is entered
in the terminal. | [
"Print",
"a",
"string",
"description",
"of",
"the",
"model",
"when",
"the",
"model",
"name",
"is",
"entered",
"in",
"the",
"terminal",
"."
] | def __repr__(self):
"""
Print a string description of the model when the model name is entered
in the terminal.
"""
width = 40
sections, section_titles = self._get_summary_struct()
out = _tkutl._toolkit_repr_print(self, sections, section_titles, width=width)
... | [
"def",
"__repr__",
"(",
"self",
")",
":",
"width",
"=",
"40",
"sections",
",",
"section_titles",
"=",
"self",
".",
"_get_summary_struct",
"(",
")",
"out",
"=",
"_tkutl",
".",
"_toolkit_repr_print",
"(",
"self",
",",
"sections",
",",
"section_titles",
",",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/image_similarity/image_similarity.py#L296-L306 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pydocview.py | python | DocApp.SetDefaultIcon | (self, icon) | Sets the application's default icon. | Sets the application's default icon. | [
"Sets",
"the",
"application",
"s",
"default",
"icon",
"."
] | def SetDefaultIcon(self, icon):
"""
Sets the application's default icon.
"""
self._defaultIcon = icon | [
"def",
"SetDefaultIcon",
"(",
"self",
",",
"icon",
")",
":",
"self",
".",
"_defaultIcon",
"=",
"icon"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pydocview.py#L2075-L2079 | ||
koth/kcws | 88efbd36a7022de4e6e90f5a1fb880cf87cfae9f | third_party/python/cpplint/cpplint.py | python | ParseArguments | (args) | return filenames | Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint. | Parses the command line arguments. | [
"Parses",
"the",
"command",
"line",
"arguments",
"."
] | def ParseArguments(args):
"""Parses the command line arguments.
This may set the output format and verbosity level as side-effects.
Args:
args: The command line arguments:
Returns:
The list of filenames to lint.
"""
try:
(opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose... | [
"def",
"ParseArguments",
"(",
"args",
")",
":",
"try",
":",
"(",
"opts",
",",
"filenames",
")",
"=",
"getopt",
".",
"getopt",
"(",
"args",
",",
"''",
",",
"[",
"'help'",
",",
"'output='",
",",
"'verbose='",
",",
"'counting='",
",",
"'filter='",
",",
... | https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/python/cpplint/cpplint.py#L6241-L6308 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/logging/__init__.py | python | Formatter.formatTime | (self, record, datefmt=None) | return s | Return the creation time of the specified LogRecord as formatted text.
This method should be called from format() by a formatter which
wants to make use of a formatted time. This method can be overridden
in formatters to provide for any specific requirement, but the
basic behaviour is a... | Return the creation time of the specified LogRecord as formatted text. | [
"Return",
"the",
"creation",
"time",
"of",
"the",
"specified",
"LogRecord",
"as",
"formatted",
"text",
"."
] | def formatTime(self, record, datefmt=None):
"""
Return the creation time of the specified LogRecord as formatted text.
This method should be called from format() by a formatter which
wants to make use of a formatted time. This method can be overridden
in formatters to provide fo... | [
"def",
"formatTime",
"(",
"self",
",",
"record",
",",
"datefmt",
"=",
"None",
")",
":",
"ct",
"=",
"self",
".",
"converter",
"(",
"record",
".",
"created",
")",
"if",
"datefmt",
":",
"s",
"=",
"time",
".",
"strftime",
"(",
"datefmt",
",",
"ct",
")"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/logging/__init__.py#L405-L429 | |
daijifeng001/caffe-rfcn | 543f8f6a4b7c88256ea1445ae951a12d1ad9cffd | scripts/cpp_lint.py | python | CheckIncludeLine | (filename, clean_lines, linenum, include_state, error) | Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage must be put here.
Args:
filename: The name of the current file.
clean_l... | Check rules that are applicable to #include lines. | [
"Check",
"rules",
"that",
"are",
"applicable",
"to",
"#include",
"lines",
"."
] | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
"""Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage m... | [
"def",
"CheckIncludeLine",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"include_state",
",",
"error",
")",
":",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"# \"include\" shoul... | https://github.com/daijifeng001/caffe-rfcn/blob/543f8f6a4b7c88256ea1445ae951a12d1ad9cffd/scripts/cpp_lint.py#L3680-L3749 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py | python | _dlog | (c, e, p) | return _div_nearest(f_log_ten + log_d, 100) | Given integers c, e and p with c > 0, compute an integer
approximation to 10**p * log(c*10**e), with an absolute error of
at most 1. Assumes that c*10**e is not exactly 1. | Given integers c, e and p with c > 0, compute an integer
approximation to 10**p * log(c*10**e), with an absolute error of
at most 1. Assumes that c*10**e is not exactly 1. | [
"Given",
"integers",
"c",
"e",
"and",
"p",
"with",
"c",
">",
"0",
"compute",
"an",
"integer",
"approximation",
"to",
"10",
"**",
"p",
"*",
"log",
"(",
"c",
"*",
"10",
"**",
"e",
")",
"with",
"an",
"absolute",
"error",
"of",
"at",
"most",
"1",
"."... | def _dlog(c, e, p):
"""Given integers c, e and p with c > 0, compute an integer
approximation to 10**p * log(c*10**e), with an absolute error of
at most 1. Assumes that c*10**e is not exactly 1."""
# Increase precision by 2. The precision increase is compensated
# for at the end with a division by... | [
"def",
"_dlog",
"(",
"c",
",",
"e",
",",
"p",
")",
":",
"# Increase precision by 2. The precision increase is compensated",
"# for at the end with a division by 100.",
"p",
"+=",
"2",
"# rewrite c*10**e as d*10**f with either f >= 0 and 1 <= d <= 10,",
"# or f <= 0 and 0.1 <= d <= 1.... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_pydecimal.py#L5808-L5850 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ensurepip/__init__.py | python | _bootstrap | (root=None, upgrade=False, user=False,
altinstall=False, default_pip=True,
verbosity=0) | Bootstrap pip into the current Python installation (or the given root
directory). Returns pip command status code.
Note that calling this function will alter both sys.path and os.environ. | Bootstrap pip into the current Python installation (or the given root
directory). Returns pip command status code. | [
"Bootstrap",
"pip",
"into",
"the",
"current",
"Python",
"installation",
"(",
"or",
"the",
"given",
"root",
"directory",
")",
".",
"Returns",
"pip",
"command",
"status",
"code",
"."
] | def _bootstrap(root=None, upgrade=False, user=False,
altinstall=False, default_pip=True,
verbosity=0):
"""
Bootstrap pip into the current Python installation (or the given root
directory). Returns pip command status code.
Note that calling this function will alter both sys... | [
"def",
"_bootstrap",
"(",
"root",
"=",
"None",
",",
"upgrade",
"=",
"False",
",",
"user",
"=",
"False",
",",
"altinstall",
"=",
"False",
",",
"default_pip",
"=",
"True",
",",
"verbosity",
"=",
"0",
")",
":",
"if",
"altinstall",
"and",
"default_pip",
":... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ensurepip/__init__.py#L69-L125 | ||
freesurfer/freesurfer | 6dbe527d43ffa611acb2cd112e9469f9bfec8e36 | cnn_sphere_register/ext/pytools-lib/pytools/patchlib.py | python | grid | (vol_size, patch_size, patch_stride=1, start_sub=0, nargout=1, grid_type='idx') | grid of patch starting points for nd volume that fit into given volume size
The index is in the given volume. If the volume gets cropped as part of the function and you
want a linear indexing into the new volume size, use
>> newidx = ind2ind(new_vol_size, vol_size, idx)
new_vol_size can be passed by th... | grid of patch starting points for nd volume that fit into given volume size | [
"grid",
"of",
"patch",
"starting",
"points",
"for",
"nd",
"volume",
"that",
"fit",
"into",
"given",
"volume",
"size"
] | def grid(vol_size, patch_size, patch_stride=1, start_sub=0, nargout=1, grid_type='idx'):
"""
grid of patch starting points for nd volume that fit into given volume size
The index is in the given volume. If the volume gets cropped as part of the function and you
want a linear indexing into the new volum... | [
"def",
"grid",
"(",
"vol_size",
",",
"patch_size",
",",
"patch_stride",
"=",
"1",
",",
"start_sub",
"=",
"0",
",",
"nargout",
"=",
"1",
",",
"grid_type",
"=",
"'idx'",
")",
":",
"# parameter checking",
"assert",
"grid_type",
"in",
"(",
"'idx'",
",",
"'su... | https://github.com/freesurfer/freesurfer/blob/6dbe527d43ffa611acb2cd112e9469f9bfec8e36/cnn_sphere_register/ext/pytools-lib/pytools/patchlib.py#L298-L377 | ||
plaidml/plaidml | f3c6681db21460e5fdc11ae651d6d7b6c27f8262 | plaidml/edsl/__init__.py | python | TensorDim.__rmul__ | (self, other) | return TensorDim(_dim_op(lib.PLAIDML_INT_OP_MUL, other, self)) | Performs a multiplication between a TensorDim and another operand in
a polynomial expression.
Example:
>>> N, M = TensorDims(2)
>>> A = Placeholder(DType.FLOAT32, [3, 3])
>>> A.bind_dims(N, M)
>>> R = Contraction().outShape(5 * N) | Performs a multiplication between a TensorDim and another operand in
a polynomial expression. | [
"Performs",
"a",
"multiplication",
"between",
"a",
"TensorDim",
"and",
"another",
"operand",
"in",
"a",
"polynomial",
"expression",
"."
] | def __rmul__(self, other):
"""Performs a multiplication between a TensorDim and another operand in
a polynomial expression.
Example:
>>> N, M = TensorDims(2)
>>> A = Placeholder(DType.FLOAT32, [3, 3])
>>> A.bind_dims(N, M)
>>> R = Contraction().ou... | [
"def",
"__rmul__",
"(",
"self",
",",
"other",
")",
":",
"return",
"TensorDim",
"(",
"_dim_op",
"(",
"lib",
".",
"PLAIDML_INT_OP_MUL",
",",
"other",
",",
"self",
")",
")"
] | https://github.com/plaidml/plaidml/blob/f3c6681db21460e5fdc11ae651d6d7b6c27f8262/plaidml/edsl/__init__.py#L115-L125 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Code/Tools/waf-1.7.13/waflib/Tools/python.py | python | check_python_module | (conf, module_name, condition='') | Check if the selected python interpreter can import the given python module::
def configure(conf):
conf.check_python_module('pygccxml')
conf.check_python_module('re', condition="ver > num(2, 0, 4) and ver <= num(3, 0, 0)")
:param module_name: module
:type module_name: string | Check if the selected python interpreter can import the given python module:: | [
"Check",
"if",
"the",
"selected",
"python",
"interpreter",
"can",
"import",
"the",
"given",
"python",
"module",
"::"
] | def check_python_module(conf, module_name, condition=''):
"""
Check if the selected python interpreter can import the given python module::
def configure(conf):
conf.check_python_module('pygccxml')
conf.check_python_module('re', condition="ver > num(2, 0, 4) and ver <= num(3, 0, 0)")
:param module_name: mo... | [
"def",
"check_python_module",
"(",
"conf",
",",
"module_name",
",",
"condition",
"=",
"''",
")",
":",
"msg",
"=",
"'Python module %s'",
"%",
"module_name",
"if",
"condition",
":",
"msg",
"=",
"'%s (%s)'",
"%",
"(",
"msg",
",",
"condition",
")",
"conf",
"."... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/python.py#L461-L502 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/ndarray/ndarray.py | python | NDArray.flatten | (self, *args, **kwargs) | return op.flatten(self, *args, **kwargs) | Convenience fluent method for :py:func:`flatten`.
The arguments are the same as for :py:func:`flatten`, with
this array as data. | Convenience fluent method for :py:func:`flatten`. | [
"Convenience",
"fluent",
"method",
"for",
":",
"py",
":",
"func",
":",
"flatten",
"."
] | def flatten(self, *args, **kwargs):
"""Convenience fluent method for :py:func:`flatten`.
The arguments are the same as for :py:func:`flatten`, with
this array as data.
"""
return op.flatten(self, *args, **kwargs) | [
"def",
"flatten",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"op",
".",
"flatten",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/ndarray/ndarray.py#L1156-L1162 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | HybridFunction.readtag | (self, pos) | return tag | Get the tag corresponding to the given index. Does parameter substitution. | Get the tag corresponding to the given index. Does parameter substitution. | [
"Get",
"the",
"tag",
"corresponding",
"to",
"the",
"given",
"index",
".",
"Does",
"parameter",
"substitution",
"."
] | def readtag(self, pos):
"Get the tag corresponding to the given index. Does parameter substitution."
if not pos.current().isdigit():
Trace.error('Function should be f0,...,f9: f' + pos.current())
return None
index = int(pos.skipcurrent())
if 2 + index > len(self.translated):
Trace.erro... | [
"def",
"readtag",
"(",
"self",
",",
"pos",
")",
":",
"if",
"not",
"pos",
".",
"current",
"(",
")",
".",
"isdigit",
"(",
")",
":",
"Trace",
".",
"error",
"(",
"'Function should be f0,...,f9: f'",
"+",
"pos",
".",
"current",
"(",
")",
")",
"return",
"N... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L5008-L5031 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/configHandler.py | python | IdleUserConfParser.RemoveFile | (self) | Removes the user config file from disk if it exists. | Removes the user config file from disk if it exists. | [
"Removes",
"the",
"user",
"config",
"file",
"from",
"disk",
"if",
"it",
"exists",
"."
] | def RemoveFile(self):
"""
Removes the user config file from disk if it exists.
"""
if os.path.exists(self.file):
os.remove(self.file) | [
"def",
"RemoveFile",
"(",
"self",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"file",
")",
":",
"os",
".",
"remove",
"(",
"self",
".",
"file",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/idlelib/configHandler.py#L127-L132 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | Grid.IsCurrentCellReadOnly | (*args, **kwargs) | return _grid.Grid_IsCurrentCellReadOnly(*args, **kwargs) | IsCurrentCellReadOnly(self) -> bool | IsCurrentCellReadOnly(self) -> bool | [
"IsCurrentCellReadOnly",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsCurrentCellReadOnly(*args, **kwargs):
"""IsCurrentCellReadOnly(self) -> bool"""
return _grid.Grid_IsCurrentCellReadOnly(*args, **kwargs) | [
"def",
"IsCurrentCellReadOnly",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_IsCurrentCellReadOnly",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1366-L1368 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/lexer.py | python | Lexer.tokenize | (
self,
source: str,
name: t.Optional[str] = None,
filename: t.Optional[str] = None,
state: t.Optional[str] = None,
) | return TokenStream(self.wrap(stream, name, filename), name, filename) | Calls tokeniter + tokenize and wraps it in a token stream. | Calls tokeniter + tokenize and wraps it in a token stream. | [
"Calls",
"tokeniter",
"+",
"tokenize",
"and",
"wraps",
"it",
"in",
"a",
"token",
"stream",
"."
] | def tokenize(
self,
source: str,
name: t.Optional[str] = None,
filename: t.Optional[str] = None,
state: t.Optional[str] = None,
) -> TokenStream:
"""Calls tokeniter + tokenize and wraps it in a token stream."""
stream = self.tokeniter(source, name, filename, s... | [
"def",
"tokenize",
"(",
"self",
",",
"source",
":",
"str",
",",
"name",
":",
"t",
".",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"filename",
":",
"t",
".",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"state",
":",
"t",
".",
"Optional",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/lexer.py#L604-L613 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGridManager.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition,
Size size=DefaultSize, long style=(0),
String name=wxPropertyGridManagerNameStr) -> PropertyGridManager | __init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition,
Size size=DefaultSize, long style=(0),
String name=wxPropertyGridManagerNameStr) -> PropertyGridManager | [
"__init__",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"ID_ANY",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"(",
"0",
")",
"String",
"name",
"=",
"wxPropertyGridManagerNameStr",
")",
"-",
">",
... | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=ID_ANY, Point pos=DefaultPosition,
Size size=DefaultSize, long style=(0),
String name=wxPropertyGridManagerNameStr) -> PropertyGridManager
"""
_propgrid.PropertyGridManager_swiginit(s... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_propgrid",
".",
"PropertyGridManager_swiginit",
"(",
"self",
",",
"_propgrid",
".",
"new_PropertyGridManager",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"se... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L3405-L3418 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/func_graph.py | python | FuncGraph.capture_distributed_variable | (self, variable, placeholder) | Add given distributed variable to captures with given placeholder. | Add given distributed variable to captures with given placeholder. | [
"Add",
"given",
"distributed",
"variable",
"to",
"captures",
"with",
"given",
"placeholder",
"."
] | def capture_distributed_variable(self, variable, placeholder):
"""Add given distributed variable to captures with given placeholder."""
self._captures[ops.tensor_id(variable)] = (variable, placeholder)
tape.record_operation("captured_value", [placeholder], [variable],
lambda x: [x]... | [
"def",
"capture_distributed_variable",
"(",
"self",
",",
"variable",
",",
"placeholder",
")",
":",
"self",
".",
"_captures",
"[",
"ops",
".",
"tensor_id",
"(",
"variable",
")",
"]",
"=",
"(",
"variable",
",",
"placeholder",
")",
"tape",
".",
"record_operatio... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/func_graph.py#L659-L663 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FMRendererVista.__init__ | (self) | Default class constructor. | Default class constructor. | [
"Default",
"class",
"constructor",
"."
] | def __init__(self):
""" Default class constructor. """
FMRendererMSOffice2007.__init__(self) | [
"def",
"__init__",
"(",
"self",
")",
":",
"FMRendererMSOffice2007",
".",
"__init__",
"(",
"self",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L1694-L1697 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/pathlib.py | python | PurePath.with_name | (self, name) | return self._from_parsed_parts(self._drv, self._root,
self._parts[:-1] + [name]) | Return a new path with the file name changed. | Return a new path with the file name changed. | [
"Return",
"a",
"new",
"path",
"with",
"the",
"file",
"name",
"changed",
"."
] | def with_name(self, name):
"""Return a new path with the file name changed."""
if not self.name:
raise ValueError("%r has an empty name" % (self,))
drv, root, parts = self._flavour.parse_parts((name,))
if (not name or name[-1] in [self._flavour.sep, self._flavour.altsep]
... | [
"def",
"with_name",
"(",
"self",
",",
"name",
")",
":",
"if",
"not",
"self",
".",
"name",
":",
"raise",
"ValueError",
"(",
"\"%r has an empty name\"",
"%",
"(",
"self",
",",
")",
")",
"drv",
",",
"root",
",",
"parts",
"=",
"self",
".",
"_flavour",
".... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pathlib.py#L876-L885 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/lib/_datasource.py | python | _FileOpeners.keys | (self) | return self._file_openers.keys() | Return the keys of currently supported file openers.
Parameters
----------
None
Returns
-------
keys : list
The keys are None for uncompressed files and the file extension
strings (i.e. ``'.gz'``, ``'.bz2'``) for supported compression
... | Return the keys of currently supported file openers. | [
"Return",
"the",
"keys",
"of",
"currently",
"supported",
"file",
"openers",
"."
] | def keys(self):
"""
Return the keys of currently supported file openers.
Parameters
----------
None
Returns
-------
keys : list
The keys are None for uncompressed files and the file extension
strings (i.e. ``'.gz'``, ``'.bz2'``) f... | [
"def",
"keys",
"(",
"self",
")",
":",
"self",
".",
"_load",
"(",
")",
"return",
"self",
".",
"_file_openers",
".",
"keys",
"(",
")"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/_datasource.py#L88-L105 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/em/hemmodelling.py | python | HEMmodelling.response | (self, par) | return pg.cat(ip, op) | Compute response vector by pasting in-phase and out-phase data. | Compute response vector by pasting in-phase and out-phase data. | [
"Compute",
"response",
"vector",
"by",
"pasting",
"in",
"-",
"phase",
"and",
"out",
"-",
"phase",
"data",
"."
] | def response(self, par):
"""Compute response vector by pasting in-phase and out-phase data."""
ip, op = self.vmd_hem(self.height,
np.asarray(par)[self.nlay-1:self.nlay*2-1],
np.asarray(par)[:self.nlay-1])
# ip, op = self.vmd_hem(self.hei... | [
"def",
"response",
"(",
"self",
",",
"par",
")",
":",
"ip",
",",
"op",
"=",
"self",
".",
"vmd_hem",
"(",
"self",
".",
"height",
",",
"np",
".",
"asarray",
"(",
"par",
")",
"[",
"self",
".",
"nlay",
"-",
"1",
":",
"self",
".",
"nlay",
"*",
"2"... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/em/hemmodelling.py#L85-L93 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/distributions/python/ops/mvn_tril.py | python | MultivariateNormalTriL.__init__ | (self,
loc=None,
scale_tril=None,
validate_args=False,
allow_nan_stats=True,
name="MultivariateNormalTriL") | Construct Multivariate Normal distribution on `R^k`.
The `batch_shape` is the broadcast shape between `loc` and `scale`
arguments.
The `event_shape` is given by last dimension of the matrix implied by
`scale`. The last dimension of `loc` (if provided) must broadcast with this.
Recall that `covari... | Construct Multivariate Normal distribution on `R^k`. | [
"Construct",
"Multivariate",
"Normal",
"distribution",
"on",
"R^k",
"."
] | def __init__(self,
loc=None,
scale_tril=None,
validate_args=False,
allow_nan_stats=True,
name="MultivariateNormalTriL"):
"""Construct Multivariate Normal distribution on `R^k`.
The `batch_shape` is the broadcast shape between `loc` and ... | [
"def",
"__init__",
"(",
"self",
",",
"loc",
"=",
"None",
",",
"scale_tril",
"=",
"None",
",",
"validate_args",
"=",
"False",
",",
"allow_nan_stats",
"=",
"True",
",",
"name",
"=",
"\"MultivariateNormalTriL\"",
")",
":",
"parameters",
"=",
"locals",
"(",
")... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/distributions/python/ops/mvn_tril.py#L128-L204 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py | python | spawn.__interact_read | (self, fd) | return os.read(fd, 1000) | This is used by the interact() method. | This is used by the interact() method. | [
"This",
"is",
"used",
"by",
"the",
"interact",
"()",
"method",
"."
] | def __interact_read(self, fd):
'''This is used by the interact() method.
'''
return os.read(fd, 1000) | [
"def",
"__interact_read",
"(",
"self",
",",
"fd",
")",
":",
"return",
"os",
".",
"read",
"(",
"fd",
",",
"1000",
")"
] | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L778-L782 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/plotting/_core.py | python | PlotAccessor.box | (self, by=None, **kwargs) | return self(kind="box", by=by, **kwargs) | r"""
Make a box plot of the DataFrame columns.
A box plot is a method for graphically depicting groups of numerical
data through their quartiles.
The box extends from the Q1 to Q3 quartile values of the data,
with a line at the median (Q2). The whiskers extend from the edges
... | r"""
Make a box plot of the DataFrame columns. | [
"r",
"Make",
"a",
"box",
"plot",
"of",
"the",
"DataFrame",
"columns",
"."
] | def box(self, by=None, **kwargs):
r"""
Make a box plot of the DataFrame columns.
A box plot is a method for graphically depicting groups of numerical
data through their quartiles.
The box extends from the Q1 to Q3 quartile values of the data,
with a line at the median (Q... | [
"def",
"box",
"(",
"self",
",",
"by",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
"(",
"kind",
"=",
"\"box\"",
",",
"by",
"=",
"by",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/plotting/_core.py#L1218-L1266 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | win32/Demos/win32netdemo.py | python | SetInfo | (userName=None) | Attempts to change the current users comment, then set it back | Attempts to change the current users comment, then set it back | [
"Attempts",
"to",
"change",
"the",
"current",
"users",
"comment",
"then",
"set",
"it",
"back"
] | def SetInfo(userName=None):
"Attempts to change the current users comment, then set it back"
if userName is None:
userName = win32api.GetUserName()
oldData = win32net.NetUserGetInfo(server, userName, 3)
try:
d = oldData.copy()
d["usr_comment"] = "Test comment"
win32net.Ne... | [
"def",
"SetInfo",
"(",
"userName",
"=",
"None",
")",
":",
"if",
"userName",
"is",
"None",
":",
"userName",
"=",
"win32api",
".",
"GetUserName",
"(",
")",
"oldData",
"=",
"win32net",
".",
"NetUserGetInfo",
"(",
"server",
",",
"userName",
",",
"3",
")",
... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/win32/Demos/win32netdemo.py#L189-L203 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/training/supervisor.py | python | Supervisor._get_first_op_from_collection | (self, key) | return None | Returns the first `Operation` from a collection.
Args:
key: A string collection key.
Returns:
The first Op found in a collection, or `None` if the collection is empty. | Returns the first `Operation` from a collection. | [
"Returns",
"the",
"first",
"Operation",
"from",
"a",
"collection",
"."
] | def _get_first_op_from_collection(self, key):
"""Returns the first `Operation` from a collection.
Args:
key: A string collection key.
Returns:
The first Op found in a collection, or `None` if the collection is empty.
"""
try:
op_list = ops.get_collection(key)
if len(op_list... | [
"def",
"_get_first_op_from_collection",
"(",
"self",
",",
"key",
")",
":",
"try",
":",
"op_list",
"=",
"ops",
".",
"get_collection",
"(",
"key",
")",
"if",
"len",
"(",
"op_list",
")",
">",
"1",
":",
"logging",
".",
"info",
"(",
"\"Found %d %s operations. R... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/training/supervisor.py#L351-L370 | |
randombit/botan | e068d80953469fc8a3ec1715d0f64756d972daba | configure.py | python | lex_me_harder | (infofile, allowed_groups, allowed_maps, name_val_pairs) | return out | Generic lexer function for info.txt and src/build-data files | Generic lexer function for info.txt and src/build-data files | [
"Generic",
"lexer",
"function",
"for",
"info",
".",
"txt",
"and",
"src",
"/",
"build",
"-",
"data",
"files"
] | def lex_me_harder(infofile, allowed_groups, allowed_maps, name_val_pairs):
"""
Generic lexer function for info.txt and src/build-data files
"""
out = LexResult()
# Format as a nameable Python variable
def py_var(group):
return group.replace(':', '_')
lexer = shlex.shlex(open(infofi... | [
"def",
"lex_me_harder",
"(",
"infofile",
",",
"allowed_groups",
",",
"allowed_maps",
",",
"name_val_pairs",
")",
":",
"out",
"=",
"LexResult",
"(",
")",
"# Format as a nameable Python variable",
"def",
"py_var",
"(",
"group",
")",
":",
"return",
"group",
".",
"r... | https://github.com/randombit/botan/blob/e068d80953469fc8a3ec1715d0f64756d972daba/configure.py#L722-L782 | |
TheImagingSource/tiscamera | baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6 | tools/tcam-capture/tcam_capture/TcamScreen.py | python | TcamScreen.remove_roi | (self, roi_widget) | Remove given roi widget from the scene | Remove given roi widget from the scene | [
"Remove",
"given",
"roi",
"widget",
"from",
"the",
"scene"
] | def remove_roi(self, roi_widget):
"""
Remove given roi widget from the scene
"""
if not roi_widget:
return
roi_widget.hide()
try:
self.roi_widgets.remove(roi_widget)
except ValueError as e:
# This means the widget is not in the... | [
"def",
"remove_roi",
"(",
"self",
",",
"roi_widget",
")",
":",
"if",
"not",
"roi_widget",
":",
"return",
"roi_widget",
".",
"hide",
"(",
")",
"try",
":",
"self",
".",
"roi_widgets",
".",
"remove",
"(",
"roi_widget",
")",
"except",
"ValueError",
"as",
"e"... | https://github.com/TheImagingSource/tiscamera/blob/baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6/tools/tcam-capture/tcam_capture/TcamScreen.py#L328-L340 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/numbers.py | python | Integral.__rrshift__ | (self, other) | other >> self | other >> self | [
"other",
">>",
"self"
] | def __rrshift__(self, other):
"""other >> self"""
raise NotImplementedError | [
"def",
"__rrshift__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/numbers.py#L336-L338 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/summary/event_file_inspector.py | python | print_dict | (d, show_missing=True) | Prints a shallow dict to console.
Args:
d: Dict to print.
show_missing: Whether to show keys with empty values. | Prints a shallow dict to console. | [
"Prints",
"a",
"shallow",
"dict",
"to",
"console",
"."
] | def print_dict(d, show_missing=True):
"""Prints a shallow dict to console.
Args:
d: Dict to print.
show_missing: Whether to show keys with empty values.
"""
for k, v in sorted(d.items()):
if (not v) and show_missing:
# No instances of the key, so print missing symbol.
print('{} -'.forma... | [
"def",
"print_dict",
"(",
"d",
",",
"show_missing",
"=",
"True",
")",
":",
"for",
"k",
",",
"v",
"in",
"sorted",
"(",
"d",
".",
"items",
"(",
")",
")",
":",
"if",
"(",
"not",
"v",
")",
"and",
"show_missing",
":",
"# No instances of the key, so print mi... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/summary/event_file_inspector.py#L231-L251 | ||
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythplugins/mytharchive/mythburn/scripts/mythburn.py | python | write | (text, progress=True) | Simple place to channel all text output through | Simple place to channel all text output through | [
"Simple",
"place",
"to",
"channel",
"all",
"text",
"output",
"through"
] | def write(text, progress=True):
"""Simple place to channel all text output through"""
if sys.version_info == 2:
sys.stdout.write((text + "\n").encode("utf-8", "replace"))
else:
sys.stdout.write(text + "\n")
sys.stdout.flush()
if progress == True and progresslog != "":
progr... | [
"def",
"write",
"(",
"text",
",",
"progress",
"=",
"True",
")",
":",
"if",
"sys",
".",
"version_info",
"==",
"2",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"(",
"text",
"+",
"\"\\n\"",
")",
".",
"encode",
"(",
"\"utf-8\"",
",",
"\"replace\"",
"... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythplugins/mytharchive/mythburn/scripts/mythburn.py#L308-L319 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/importDXF.py | python | drawLine | (line, forceShape=False) | return None | Return a Part shape (Wire or Edge) from a DXF line.
Parameters
----------
line : drawing.entities
The DXF object of type `'line'`.
forceShape : bool, optional
It defaults to `False`. If it is `True` it will produce a `Part.Edge`,
otherwise it produces a `Draft Wire`.
Retur... | Return a Part shape (Wire or Edge) from a DXF line. | [
"Return",
"a",
"Part",
"shape",
"(",
"Wire",
"or",
"Edge",
")",
"from",
"a",
"DXF",
"line",
"."
] | def drawLine(line, forceShape=False):
"""Return a Part shape (Wire or Edge) from a DXF line.
Parameters
----------
line : drawing.entities
The DXF object of type `'line'`.
forceShape : bool, optional
It defaults to `False`. If it is `True` it will produce a `Part.Edge`,
oth... | [
"def",
"drawLine",
"(",
"line",
",",
"forceShape",
"=",
"False",
")",
":",
"if",
"len",
"(",
"line",
".",
"points",
")",
">",
"1",
":",
"v1",
"=",
"vec",
"(",
"line",
".",
"points",
"[",
"0",
"]",
")",
"v2",
"=",
"vec",
"(",
"line",
".",
"poi... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/importDXF.py#L838-L879 | |
OkCupid/okws | 1c337392c676ccb4e9a4c92d11d5d2fada6427d2 | contrib/pub3-upgrade.py | python | Pub1Parser.p_binding | (self, p) | binding : bindkey equals arg | binding : bindkey equals arg | [
"binding",
":",
"bindkey",
"equals",
"arg"
] | def p_binding (self, p):
'''binding : bindkey equals arg'''
p[0] = (p[1], p[3]) | [
"def",
"p_binding",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"(",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"3",
"]",
")"
] | https://github.com/OkCupid/okws/blob/1c337392c676ccb4e9a4c92d11d5d2fada6427d2/contrib/pub3-upgrade.py#L1006-L1008 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/layers/python/layers/layers.py | python | softmax | (logits, scope=None) | Performs softmax on Nth dimension of N-dimensional logit tensor.
For two-dimensional logits this reduces to tf.nn.softmax. The N-th dimension
needs to have a specified number of elements (number of classes).
Args:
logits: N-dimensional `Tensor` with logits, where N > 1.
scope: Optional scope for variabl... | Performs softmax on Nth dimension of N-dimensional logit tensor. | [
"Performs",
"softmax",
"on",
"Nth",
"dimension",
"of",
"N",
"-",
"dimensional",
"logit",
"tensor",
"."
] | def softmax(logits, scope=None):
"""Performs softmax on Nth dimension of N-dimensional logit tensor.
For two-dimensional logits this reduces to tf.nn.softmax. The N-th dimension
needs to have a specified number of elements (number of classes).
Args:
logits: N-dimensional `Tensor` with logits, where N > 1.... | [
"def",
"softmax",
"(",
"logits",
",",
"scope",
"=",
"None",
")",
":",
"# TODO(jrru): Add axis argument which defaults to last dimension.",
"with",
"variable_scope",
".",
"variable_op_scope",
"(",
"[",
"logits",
"]",
",",
"scope",
",",
"'softmax'",
")",
":",
"num_log... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/layers/python/layers/layers.py#L1088-L1108 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/roslaunch/src/roslaunch/launch.py | python | validate_master_launch | (m, is_core, is_rostest=False) | Validate the configuration of a master we are about to launch. Ths
validation already assumes that no existing master is running at
this configuration and merely checks configuration for a new
launch. | Validate the configuration of a master we are about to launch. Ths
validation already assumes that no existing master is running at
this configuration and merely checks configuration for a new
launch. | [
"Validate",
"the",
"configuration",
"of",
"a",
"master",
"we",
"are",
"about",
"to",
"launch",
".",
"Ths",
"validation",
"already",
"assumes",
"that",
"no",
"existing",
"master",
"is",
"running",
"at",
"this",
"configuration",
"and",
"merely",
"checks",
"confi... | def validate_master_launch(m, is_core, is_rostest=False):
"""
Validate the configuration of a master we are about to launch. Ths
validation already assumes that no existing master is running at
this configuration and merely checks configuration for a new
launch.
"""
# Before starting a maste... | [
"def",
"validate_master_launch",
"(",
"m",
",",
"is_core",
",",
"is_rostest",
"=",
"False",
")",
":",
"# Before starting a master, we do some sanity check on the",
"# master configuration. There are two ways the user starts:",
"# roscore or roslaunch. If the user types roscore, we always... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/roslaunch/src/roslaunch/launch.py#L69-L118 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/httputil.py | python | split_host_and_port | (netloc: str) | return (host, port) | Returns ``(host, port)`` tuple from ``netloc``.
Returned ``port`` will be ``None`` if not present.
.. versionadded:: 4.1 | Returns ``(host, port)`` tuple from ``netloc``. | [
"Returns",
"(",
"host",
"port",
")",
"tuple",
"from",
"netloc",
"."
] | def split_host_and_port(netloc: str) -> Tuple[str, Optional[int]]:
"""Returns ``(host, port)`` tuple from ``netloc``.
Returned ``port`` will be ``None`` if not present.
.. versionadded:: 4.1
"""
match = _netloc_re.match(netloc)
if match:
host = match.group(1)
port = int(match.g... | [
"def",
"split_host_and_port",
"(",
"netloc",
":",
"str",
")",
"->",
"Tuple",
"[",
"str",
",",
"Optional",
"[",
"int",
"]",
"]",
":",
"match",
"=",
"_netloc_re",
".",
"match",
"(",
"netloc",
")",
"if",
"match",
":",
"host",
"=",
"match",
".",
"group",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/httputil.py#L1028-L1042 | |
apiaryio/drafter | 4634ebd07f6c6f257cc656598ccd535492fdfb55 | tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetRcflags | (self, config, gyp_to_ninja_path) | return rcflags | Returns the flags that need to be added to invocations of the resource
compiler. | Returns the flags that need to be added to invocations of the resource
compiler. | [
"Returns",
"the",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
"invocations",
"of",
"the",
"resource",
"compiler",
"."
] | def GetRcflags(self, config, gyp_to_ninja_path):
"""Returns the flags that need to be added to invocations of the resource
compiler."""
config = self._TargetConfig(config)
rcflags = []
rc = self._GetWrapper(self, self.msvs_settings[config],
'VCResourceCompilerTool', append=rcflags)
rc('A... | [
"def",
"GetRcflags",
"(",
"self",
",",
"config",
",",
"gyp_to_ninja_path",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"rcflags",
"=",
"[",
"]",
"rc",
"=",
"self",
".",
"_GetWrapper",
"(",
"self",
",",
"self",
".",
"msvs_... | https://github.com/apiaryio/drafter/blob/4634ebd07f6c6f257cc656598ccd535492fdfb55/tools/gyp/pylib/gyp/msvs_emulation.py#L777-L789 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/caching.py | python | CompileResultCacheImpl.check_cachable | (self, cres) | return True | Check cachability of the given compile result. | Check cachability of the given compile result. | [
"Check",
"cachability",
"of",
"the",
"given",
"compile",
"result",
"."
] | def check_cachable(self, cres):
"""
Check cachability of the given compile result.
"""
cannot_cache = None
if self._is_closure:
cannot_cache = "as it uses outer variables in a closure"
elif cres.lifted:
cannot_cache = "as it uses lifted loops"
... | [
"def",
"check_cachable",
"(",
"self",
",",
"cres",
")",
":",
"cannot_cache",
"=",
"None",
"if",
"self",
".",
"_is_closure",
":",
"cannot_cache",
"=",
"\"as it uses outer variables in a closure\"",
"elif",
"cres",
".",
"lifted",
":",
"cannot_cache",
"=",
"\"as it u... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/caching.py#L408-L426 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | QueryLayoutInfoEvent.GetSize | (*args, **kwargs) | return _windows_.QueryLayoutInfoEvent_GetSize(*args, **kwargs) | GetSize(self) -> Size | GetSize(self) -> Size | [
"GetSize",
"(",
"self",
")",
"-",
">",
"Size"
] | def GetSize(*args, **kwargs):
"""GetSize(self) -> Size"""
return _windows_.QueryLayoutInfoEvent_GetSize(*args, **kwargs) | [
"def",
"GetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"QueryLayoutInfoEvent_GetSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L1977-L1979 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/devil/devil/android/sdk/adb_wrapper.py | python | AdbWrapper.Shell | (self, command, expect_status=0, timeout=DEFAULT_TIMEOUT,
retries=DEFAULT_RETRIES) | return output | Runs a shell command on the device.
Args:
command: A string with the shell command to run.
expect_status: (optional) Check that the command's exit status matches
this value. Default is 0. If set to None the test is skipped.
timeout: (optional) Timeout per try in seconds.
retries: (o... | Runs a shell command on the device. | [
"Runs",
"a",
"shell",
"command",
"on",
"the",
"device",
"."
] | def Shell(self, command, expect_status=0, timeout=DEFAULT_TIMEOUT,
retries=DEFAULT_RETRIES):
"""Runs a shell command on the device.
Args:
command: A string with the shell command to run.
expect_status: (optional) Check that the command's exit status matches
this value. Default i... | [
"def",
"Shell",
"(",
"self",
",",
"command",
",",
"expect_status",
"=",
"0",
",",
"timeout",
"=",
"DEFAULT_TIMEOUT",
",",
"retries",
"=",
"DEFAULT_RETRIES",
")",
":",
"if",
"expect_status",
"is",
"None",
":",
"args",
"=",
"[",
"'shell'",
",",
"command",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/devil/devil/android/sdk/adb_wrapper.py#L454-L493 | |
weichengkuo/DeepBox | c4f8c065b6a51cf296540cc453a44f0519aaacc9 | caffe-fast-rcnn/scripts/cpp_lint.py | python | CheckForBadCharacters | (filename, lines, error) | Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that it's possible for this to throw off line
numbering if... | Logs an error for each line containing bad characters. | [
"Logs",
"an",
"error",
"for",
"each",
"line",
"containing",
"bad",
"characters",
"."
] | def CheckForBadCharacters(filename, lines, error):
"""Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that... | [
"def",
"CheckForBadCharacters",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"for",
"linenum",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"if",
"u'\\ufffd'",
"in",
"line",
":",
"error",
"(",
"filename",
",",
"linenum",
",",
"'reada... | https://github.com/weichengkuo/DeepBox/blob/c4f8c065b6a51cf296540cc453a44f0519aaacc9/caffe-fast-rcnn/scripts/cpp_lint.py#L1483-L1505 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_grad/grad_math_ops.py | python | get_bprop_reciprocal | (self) | return bprop | Grad definition for `Reciprocal` operation. | Grad definition for `Reciprocal` operation. | [
"Grad",
"definition",
"for",
"Reciprocal",
"operation",
"."
] | def get_bprop_reciprocal(self):
"""Grad definition for `Reciprocal` operation."""
reciprocal_grad = G.ReciprocalGrad()
def bprop(x, out, dout):
dx = reciprocal_grad(out, dout)
return (dx,)
return bprop | [
"def",
"get_bprop_reciprocal",
"(",
"self",
")",
":",
"reciprocal_grad",
"=",
"G",
".",
"ReciprocalGrad",
"(",
")",
"def",
"bprop",
"(",
"x",
",",
"out",
",",
"dout",
")",
":",
"dx",
"=",
"reciprocal_grad",
"(",
"out",
",",
"dout",
")",
"return",
"(",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_math_ops.py#L534-L542 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/gradients_impl.py | python | gradients_v2 | (ys, # pylint: disable=invalid-name
xs,
grad_ys=None,
name="gradients",
gate_gradients=False,
aggregation_method=None,
stop_gradients=None,
unconnected_gradients=UnconnectedGradients.NONE) | Constructs symbolic derivatives of sum of `ys` w.r.t. x in `xs`.
`ys` and `xs` are each a `Tensor` or a list of tensors. `grad_ys`
is a list of `Tensor`, holding the gradients received by the
`ys`. The list must be the same length as `ys`.
`gradients()` adds ops to the graph to output the derivatives of `ys`... | Constructs symbolic derivatives of sum of `ys` w.r.t. x in `xs`. | [
"Constructs",
"symbolic",
"derivatives",
"of",
"sum",
"of",
"ys",
"w",
".",
"r",
".",
"t",
".",
"x",
"in",
"xs",
"."
] | def gradients_v2(ys, # pylint: disable=invalid-name
xs,
grad_ys=None,
name="gradients",
gate_gradients=False,
aggregation_method=None,
stop_gradients=None,
unconnected_gradients=UnconnectedGradients.N... | [
"def",
"gradients_v2",
"(",
"ys",
",",
"# pylint: disable=invalid-name",
"xs",
",",
"grad_ys",
"=",
"None",
",",
"name",
"=",
"\"gradients\"",
",",
"gate_gradients",
"=",
"False",
",",
"aggregation_method",
"=",
"None",
",",
"stop_gradients",
"=",
"None",
",",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/gradients_impl.py#L163-L274 | ||
google/mozc | 7329757e1ad30e327c1ae823a8302c79482d6b9c | src/build_tools/mozc_version.py | python | MozcVersion.__init__ | (self, path) | Parses a version definition file.
Args:
path: A filename which has the version definition.
If the file is not existent, empty properties are prepared instead. | Parses a version definition file. | [
"Parses",
"a",
"version",
"definition",
"file",
"."
] | def __init__(self, path):
"""Parses a version definition file.
Args:
path: A filename which has the version definition.
If the file is not existent, empty properties are prepared instead.
"""
self._properties = {}
if not os.path.isfile(path):
return
for line in open(pat... | [
"def",
"__init__",
"(",
"self",
",",
"path",
")",
":",
"self",
".",
"_properties",
"=",
"{",
"}",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"path",
")",
":",
"return",
"for",
"line",
"in",
"open",
"(",
"path",
")",
":",
"matchobj",
"=",... | https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/build_tools/mozc_version.py#L274-L298 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/settings_manager.py | python | ConfigurationSettings.does_configuration_match | (self, match_name, check_base=True) | Test this configuration setting if it matches a configuration name.
:param match_name: The name to match
:param check_base: Flag to search the base config (if this is a derived custom config)
:return: Match result | Test this configuration setting if it matches a configuration name.
:param match_name: The name to match
:param check_base: Flag to search the base config (if this is a derived custom config)
:return: Match result | [
"Test",
"this",
"configuration",
"setting",
"if",
"it",
"matches",
"a",
"configuration",
"name",
".",
":",
"param",
"match_name",
":",
"The",
"name",
"to",
"match",
":",
"param",
"check_base",
":",
"Flag",
"to",
"search",
"the",
"base",
"config",
"(",
"if"... | def does_configuration_match(self, match_name, check_base=True):
"""
Test this configuration setting if it matches a configuration name.
:param match_name: The name to match
:param check_base: Flag to search the base config (if this is a derived custom config)
:return: Match re... | [
"def",
"does_configuration_match",
"(",
"self",
",",
"match_name",
",",
"check_base",
"=",
"True",
")",
":",
"if",
"self",
".",
"name",
"==",
"match_name",
":",
"return",
"True",
"elif",
"self",
".",
"base_config",
"and",
"check_base",
":",
"if",
"self",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/settings_manager.py#L441-L454 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | buildconfig/doxygen_to_sip.py | python | start_python_doc_section | (out, line, look_for, section_header) | return False | Modify the lines by adding a section like Args
@param out :: list of dosctring lines
@param line :: last line read, no spaces
@param look_for :: @string to look at
@param section_header :: line text
@return True if the section was added | Modify the lines by adding a section like Args | [
"Modify",
"the",
"lines",
"by",
"adding",
"a",
"section",
"like",
"Args"
] | def start_python_doc_section(out, line, look_for, section_header):
"""Modify the lines by adding a section like Args
@param out :: list of dosctring lines
@param line :: last line read, no spaces
@param look_for :: @string to look at
@param section_header :: line text
@return True if the sectio... | [
"def",
"start_python_doc_section",
"(",
"out",
",",
"line",
",",
"look_for",
",",
"section_header",
")",
":",
"# Add the 'Args:' line.",
"if",
"line",
".",
"strip",
"(",
")",
".",
"startswith",
"(",
"look_for",
")",
":",
"# Add a blank line if there isn't one",
"i... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/buildconfig/doxygen_to_sip.py#L49-L66 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/debug/lib/dumping_callback.py | python | _get_id | () | return str(uuid.uuid4()) | Get a short unique ID. | Get a short unique ID. | [
"Get",
"a",
"short",
"unique",
"ID",
"."
] | def _get_id():
"""Get a short unique ID."""
return str(uuid.uuid4()) | [
"def",
"_get_id",
"(",
")",
":",
"return",
"str",
"(",
"uuid",
".",
"uuid4",
"(",
")",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/dumping_callback.py#L70-L72 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/detection.py | python | box_coder | (prior_box,
prior_box_var,
target_box,
code_type="encode_center_size",
box_normalized=True,
name=None,
axis=0) | return output_box | r"""
**Box Coder Layer**
Encode/Decode the target bounding box with the priorbox information.
The Encoding schema described below:
.. math::
ox = (tx - px) / pw / pxv
oy = (ty - py) / ph / pyv
ow = \log(\abs(tw / pw)) / pwv
oh = \log(\abs(th / ph)) / phv
... | r""" | [
"r"
] | def box_coder(prior_box,
prior_box_var,
target_box,
code_type="encode_center_size",
box_normalized=True,
name=None,
axis=0):
r"""
**Box Coder Layer**
Encode/Decode the target bounding box with the priorbox information.
... | [
"def",
"box_coder",
"(",
"prior_box",
",",
"prior_box_var",
",",
"target_box",
",",
"code_type",
"=",
"\"encode_center_size\"",
",",
"box_normalized",
"=",
"True",
",",
"name",
"=",
"None",
",",
"axis",
"=",
"0",
")",
":",
"check_variable_and_dtype",
"(",
"pri... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/detection.py#L819-L966 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/controls.py | python | BufferControl.mouse_handler | (self, cli, mouse_event) | Mouse handler for this control. | Mouse handler for this control. | [
"Mouse",
"handler",
"for",
"this",
"control",
"."
] | def mouse_handler(self, cli, mouse_event):
"""
Mouse handler for this control.
"""
buffer = self._buffer(cli)
position = mouse_event.position
# Focus buffer when clicked.
if self.has_focus(cli):
if self._last_get_processed_line:
proces... | [
"def",
"mouse_handler",
"(",
"self",
",",
"cli",
",",
"mouse_event",
")",
":",
"buffer",
"=",
"self",
".",
"_buffer",
"(",
"cli",
")",
"position",
"=",
"mouse_event",
".",
"position",
"# Focus buffer when clicked.",
"if",
"self",
".",
"has_focus",
"(",
"cli"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/layout/controls.py#L668-L722 | ||
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | caffe/scripts/cpp_lint.py | python | CheckSpacing | (filename, clean_lines, linenum, nesting_state, error) | Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't start a block with a blank
line, don't end a function with a blank line, don't ... | Checks for the correctness of various spacing issues in the code. | [
"Checks",
"for",
"the",
"correctness",
"of",
"various",
"spacing",
"issues",
"in",
"the",
"code",
"."
] | def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
"""Checks for the correctness of various spacing issues in the code.
Things we check for: spaces around operators, spaces after
if/for/while/switch, no spaces around parens in function calls, two
spaces between code and comment, don't star... | [
"def",
"CheckSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Don't use \"elided\" lines here, otherwise we can't check commented lines.",
"# Don't want to use \"raw\" either, because we don't want to check inside C++11",
... | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/caffe/scripts/cpp_lint.py#L2647-L2992 | ||
fengbingchun/NN_Test | d6305825d5273e4569ccd1eda9ffa2a9c72e18d2 | src/tiny-dnn/third_party/cpplint.py | python | _DropCommonSuffixes | (filename) | return os.path.splitext(filename)[0] | Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/foo_unusualinternal.h')... | Drops common suffixes like _test.cc or -inl.h from filename. | [
"Drops",
"common",
"suffixes",
"like",
"_test",
".",
"cc",
"or",
"-",
"inl",
".",
"h",
"from",
"filename",
"."
] | def _DropCommonSuffixes(filename):
"""Drops common suffixes like _test.cc or -inl.h from filename.
For example:
>>> _DropCommonSuffixes('foo/foo-inl.h')
'foo/foo'
>>> _DropCommonSuffixes('foo/bar/foo.cc')
'foo/bar/foo'
>>> _DropCommonSuffixes('foo/foo_internal.h')
'foo/foo'
>>> _DropCom... | [
"def",
"_DropCommonSuffixes",
"(",
"filename",
")",
":",
"for",
"suffix",
"in",
"itertools",
".",
"chain",
"(",
"(",
"'%s.%s'",
"%",
"(",
"test_suffix",
".",
"lstrip",
"(",
"'_'",
")",
",",
"ext",
")",
"for",
"test_suffix",
",",
"ext",
"in",
"itertools",... | https://github.com/fengbingchun/NN_Test/blob/d6305825d5273e4569ccd1eda9ffa2a9c72e18d2/src/tiny-dnn/third_party/cpplint.py#L4577-L4604 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/core.py | python | IR.Play | (self, op) | Adds an op to the current IR, and update the internal states to
reflect the blobs and versions after the execution of the op. | Adds an op to the current IR, and update the internal states to
reflect the blobs and versions after the execution of the op. | [
"Adds",
"an",
"op",
"to",
"the",
"current",
"IR",
"and",
"update",
"the",
"internal",
"states",
"to",
"reflect",
"the",
"blobs",
"and",
"versions",
"after",
"the",
"execution",
"of",
"the",
"op",
"."
] | def Play(self, op):
""""Adds an op to the current IR, and update the internal states to
reflect the blobs and versions after the execution of the op.
"""
# For input, they are the current version in the dict.
in_versions = {}
for s in op.input:
in_versions[s] ... | [
"def",
"Play",
"(",
"self",
",",
"op",
")",
":",
"# For input, they are the current version in the dict.",
"in_versions",
"=",
"{",
"}",
"for",
"s",
"in",
"op",
".",
"input",
":",
"in_versions",
"[",
"s",
"]",
"=",
"self",
".",
"frontier",
"[",
"s",
"]",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/core.py#L536-L555 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py | python | Standard_Suite_Events.save | (self, _object, _attributes={}, **_arguments) | save: Save an object.
Required argument: the object for the command
Keyword argument in_: The file in which to save the object.
Keyword argument as: The file type in which to save the data.
Keyword argument _attributes: AppleEvent attribute dictionary | save: Save an object.
Required argument: the object for the command
Keyword argument in_: The file in which to save the object.
Keyword argument as: The file type in which to save the data.
Keyword argument _attributes: AppleEvent attribute dictionary | [
"save",
":",
"Save",
"an",
"object",
".",
"Required",
"argument",
":",
"the",
"object",
"for",
"the",
"command",
"Keyword",
"argument",
"in_",
":",
"The",
"file",
"in",
"which",
"to",
"save",
"the",
"object",
".",
"Keyword",
"argument",
"as",
":",
"The",... | def save(self, _object, _attributes={}, **_arguments):
"""save: Save an object.
Required argument: the object for the command
Keyword argument in_: The file in which to save the object.
Keyword argument as: The file type in which to save the data.
Keyword argument _attributes: Ap... | [
"def",
"save",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'core'",
"_subcode",
"=",
"'save'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_save",
")... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Terminal/Standard_Suite.py#L285-L305 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/pseudo_rtl.py | python | PseudoRTLMessage | (message) | return transl | Returns a pseudo-RTL (aka Fake-Bidi) translation of the provided message.
Args:
message: tclib.Message()
Return:
tclib.Translation() | Returns a pseudo-RTL (aka Fake-Bidi) translation of the provided message. | [
"Returns",
"a",
"pseudo",
"-",
"RTL",
"(",
"aka",
"Fake",
"-",
"Bidi",
")",
"translation",
"of",
"the",
"provided",
"message",
"."
] | def PseudoRTLMessage(message):
'''Returns a pseudo-RTL (aka Fake-Bidi) translation of the provided message.
Args:
message: tclib.Message()
Return:
tclib.Translation()
'''
transl = tclib.Translation()
for part in message.GetContent():
if isinstance(part, tclib.Placeholder):
transl.AppendP... | [
"def",
"PseudoRTLMessage",
"(",
"message",
")",
":",
"transl",
"=",
"tclib",
".",
"Translation",
"(",
")",
"for",
"part",
"in",
"message",
".",
"GetContent",
"(",
")",
":",
"if",
"isinstance",
"(",
"part",
",",
"tclib",
".",
"Placeholder",
")",
":",
"t... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/pseudo_rtl.py#L87-L103 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/asyncio/tasks.py | python | Task.cancel | (self, msg=None) | return True | Request that this task cancel itself.
This arranges for a CancelledError to be thrown into the
wrapped coroutine on the next cycle through the event loop.
The coroutine then has a chance to clean up or even deny
the request using try/except/finally.
Unlike Future.cancel, this d... | Request that this task cancel itself. | [
"Request",
"that",
"this",
"task",
"cancel",
"itself",
"."
] | def cancel(self, msg=None):
"""Request that this task cancel itself.
This arranges for a CancelledError to be thrown into the
wrapped coroutine on the next cycle through the event loop.
The coroutine then has a chance to clean up or even deny
the request using try/except/finally... | [
"def",
"cancel",
"(",
"self",
",",
"msg",
"=",
"None",
")",
":",
"self",
".",
"_log_traceback",
"=",
"False",
"if",
"self",
".",
"done",
"(",
")",
":",
"return",
"False",
"if",
"self",
".",
"_fut_waiter",
"is",
"not",
"None",
":",
"if",
"self",
"."... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/asyncio/tasks.py#L205-L237 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py | python | Sizegrip.__init__ | (self, master=None, **kw) | Construct a Ttk Sizegrip with parent master.
STANDARD OPTIONS
class, cursor, state, style, takefocus | Construct a Ttk Sizegrip with parent master. | [
"Construct",
"a",
"Ttk",
"Sizegrip",
"with",
"parent",
"master",
"."
] | def __init__(self, master=None, **kw):
"""Construct a Ttk Sizegrip with parent master.
STANDARD OPTIONS
class, cursor, state, style, takefocus
"""
Widget.__init__(self, master, "ttk::sizegrip", kw) | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"\"ttk::sizegrip\"",
",",
"kw",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py#L1145-L1152 | ||
TheImagingSource/tiscamera | baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6 | tools/tcam-capture/tcam_capture/TcamScreen.py | python | TcamScreen.is_scene_larger_than_image | (self) | return False | checks if the entire ViewItem is visible in the scene | checks if the entire ViewItem is visible in the scene | [
"checks",
"if",
"the",
"entire",
"ViewItem",
"is",
"visible",
"in",
"the",
"scene"
] | def is_scene_larger_than_image(self):
"""
checks if the entire ViewItem is visible in the scene
"""
port_rect = self.viewport().rect()
scene_rect = self.mapToScene(port_rect).boundingRect()
item_rect = self.pix.mapRectFromScene(scene_rect)
isec = item_rect.inters... | [
"def",
"is_scene_larger_than_image",
"(",
"self",
")",
":",
"port_rect",
"=",
"self",
".",
"viewport",
"(",
")",
".",
"rect",
"(",
")",
"scene_rect",
"=",
"self",
".",
"mapToScene",
"(",
"port_rect",
")",
".",
"boundingRect",
"(",
")",
"item_rect",
"=",
... | https://github.com/TheImagingSource/tiscamera/blob/baacb4cfaa7858c2e6cfb4f1a297b404c4e002f6/tools/tcam-capture/tcam_capture/TcamScreen.py#L222-L236 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/internal/image_processing/screen_finder.py | python | ScreenFinder._GetTransform | (self, corners, border) | return transform, transform_w, transform_h | Gets the perspective transform of the screen.
Args:
corners: The corners of the detected screen.
border: The number of pixels of border to crop along with the screen.
Returns:
A perspective transform and the width and height of the target
transform.
Raises:
ScreenNotFoundErr... | Gets the perspective transform of the screen. | [
"Gets",
"the",
"perspective",
"transform",
"of",
"the",
"screen",
"."
] | def _GetTransform(self, corners, border):
"""Gets the perspective transform of the screen.
Args:
corners: The corners of the detected screen.
border: The number of pixels of border to crop along with the screen.
Returns:
A perspective transform and the width and height of the target
... | [
"def",
"_GetTransform",
"(",
"self",
",",
"corners",
",",
"border",
")",
":",
"if",
"self",
".",
"_screen_size",
"is",
"None",
":",
"w",
"=",
"np",
".",
"sqrt",
"(",
"cv_util",
".",
"SqDistance",
"(",
"corners",
"[",
"1",
"]",
",",
"corners",
"[",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/image_processing/screen_finder.py#L772-L811 | |
infinit/memo | 3a8394d0f647efe03ccb8bfe885a7279cb8be8a6 | elle/drake/src/drake/__init__.py | python | symlink | (sources, to, strip_prefix = None) | return __copy(
sources, to, strip_prefix, builder, None, None) | Convenience function to create Symlinker builders.
See documentation of copy. | Convenience function to create Symlinker builders. | [
"Convenience",
"function",
"to",
"create",
"Symlinker",
"builders",
"."
] | def symlink(sources, to, strip_prefix = None):
"""Convenience function to create Symlinker builders.
See documentation of copy.
"""
def builder(source, path, post_process, follow_symlinks):
return drake.Symlink(path, source).builder
return __copy(
sources, to, strip_prefix, builder, None, None) | [
"def",
"symlink",
"(",
"sources",
",",
"to",
",",
"strip_prefix",
"=",
"None",
")",
":",
"def",
"builder",
"(",
"source",
",",
"path",
",",
"post_process",
",",
"follow_symlinks",
")",
":",
"return",
"drake",
".",
"Symlink",
"(",
"path",
",",
"source",
... | https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L3408-L3416 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pbr/packaging.py | python | LocalEggInfo.find_sources | (self) | Generate SOURCES.txt only if there isn't one already.
If we are in an sdist command, then we always want to update
SOURCES.txt. If we are not in an sdist command, then it doesn't
matter one flip, and is actually destructive.
However, if we're in a git context, it's always the right thin... | Generate SOURCES.txt only if there isn't one already. | [
"Generate",
"SOURCES",
".",
"txt",
"only",
"if",
"there",
"isn",
"t",
"one",
"already",
"."
] | def find_sources(self):
"""Generate SOURCES.txt only if there isn't one already.
If we are in an sdist command, then we always want to update
SOURCES.txt. If we are not in an sdist command, then it doesn't
matter one flip, and is actually destructive.
However, if we're in a git ... | [
"def",
"find_sources",
"(",
"self",
")",
":",
"manifest_filename",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"egg_info",
",",
"\"SOURCES.txt\"",
")",
"if",
"(",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"manifest_filename",
")",
"or",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pbr/packaging.py#L507-L529 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/cython/Cython/Debugger/libpython.py | python | move_in_stack | (move_up) | Move up or down the stack (for the py-up/py-down command) | Move up or down the stack (for the py-up/py-down command) | [
"Move",
"up",
"or",
"down",
"the",
"stack",
"(",
"for",
"the",
"py",
"-",
"up",
"/",
"py",
"-",
"down",
"command",
")"
] | def move_in_stack(move_up):
'''Move up or down the stack (for the py-up/py-down command)'''
frame = Frame.get_selected_python_frame()
if not frame:
print('Unable to locate python frame')
return
while frame:
if move_up:
iter_frame = frame.older()
else:
... | [
"def",
"move_in_stack",
"(",
"move_up",
")",
":",
"frame",
"=",
"Frame",
".",
"get_selected_python_frame",
"(",
")",
"if",
"not",
"frame",
":",
"print",
"(",
"'Unable to locate python frame'",
")",
"return",
"while",
"frame",
":",
"if",
"move_up",
":",
"iter_f... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Debugger/libpython.py#L1763-L1790 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/req/req_install.py | python | InstallRequirement.check_if_exists | (self) | return True | Find an installed distribution that satisfies or conflicts
with this requirement, and set self.satisfied_by or
self.conflicts_with appropriately. | Find an installed distribution that satisfies or conflicts
with this requirement, and set self.satisfied_by or
self.conflicts_with appropriately. | [
"Find",
"an",
"installed",
"distribution",
"that",
"satisfies",
"or",
"conflicts",
"with",
"this",
"requirement",
"and",
"set",
"self",
".",
"satisfied_by",
"or",
"self",
".",
"conflicts_with",
"appropriately",
"."
] | def check_if_exists(self):
"""Find an installed distribution that satisfies or conflicts
with this requirement, and set self.satisfied_by or
self.conflicts_with appropriately.
"""
if self.req is None:
return False
try:
self.satisfied_by = pkg_resou... | [
"def",
"check_if_exists",
"(",
"self",
")",
":",
"if",
"self",
".",
"req",
"is",
"None",
":",
"return",
"False",
"try",
":",
"self",
".",
"satisfied_by",
"=",
"pkg_resources",
".",
"get_distribution",
"(",
"self",
".",
"req",
")",
"except",
"pkg_resources"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/req/req_install.py#L963-L990 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/control_flow_ops.py | python | WhileContext.AddBackpropLoopCounter | (self, count, outer_grad_state) | return next_count | Add the backprop loop that controls the iterations.
This is added to the backprop loop. It is used to control the loop
termination of the backprop loop. Called in the outer context of
this grad context.
The pseudocode is:
`n = count; while (n >= 1) { n--; }`
Note that a control dependency i... | Add the backprop loop that controls the iterations. | [
"Add",
"the",
"backprop",
"loop",
"that",
"controls",
"the",
"iterations",
"."
] | def AddBackpropLoopCounter(self, count, outer_grad_state):
"""Add the backprop loop that controls the iterations.
This is added to the backprop loop. It is used to control the loop
termination of the backprop loop. Called in the outer context of
this grad context.
The pseudocode is:
`n = cou... | [
"def",
"AddBackpropLoopCounter",
"(",
"self",
",",
"count",
",",
"outer_grad_state",
")",
":",
"in_separate_functions",
"=",
"count",
".",
"graph",
"is",
"not",
"ops",
".",
"get_default_graph",
"(",
")",
"if",
"in_separate_functions",
":",
"# Brings the count into t... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/control_flow_ops.py#L1901-L1965 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | TextEntryDialog.__init__ | (self, *args, **kwargs) | __init__(self, Window parent, String message, String caption=GetTextFromUserPromptStr,
String defaultValue=EmptyString,
long style=TextEntryDialogStyle, Point pos=DefaultPosition) -> TextEntryDialog
Constructor. Use ShowModal method to show the dialog. | __init__(self, Window parent, String message, String caption=GetTextFromUserPromptStr,
String defaultValue=EmptyString,
long style=TextEntryDialogStyle, Point pos=DefaultPosition) -> TextEntryDialog | [
"__init__",
"(",
"self",
"Window",
"parent",
"String",
"message",
"String",
"caption",
"=",
"GetTextFromUserPromptStr",
"String",
"defaultValue",
"=",
"EmptyString",
"long",
"style",
"=",
"TextEntryDialogStyle",
"Point",
"pos",
"=",
"DefaultPosition",
")",
"-",
">",... | def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, String message, String caption=GetTextFromUserPromptStr,
String defaultValue=EmptyString,
long style=TextEntryDialogStyle, Point pos=DefaultPosition) -> TextEntryDialog
Constructor. Use ShowModal ... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_windows_",
".",
"TextEntryDialog_swiginit",
"(",
"self",
",",
"_windows_",
".",
"new_TextEntryDialog",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"self",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L3373-L3382 | ||
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/LUProfsSelection.py | python | ProfsNullify | () | return | Resets all of the internal variables to 0. | Resets all of the internal variables to 0. | [
"Resets",
"all",
"of",
"the",
"internal",
"variables",
"to",
"0",
"."
] | def ProfsNullify ():
"""Resets all of the internal variables to 0."""
global ProfsTable
if not ProfsTable:
ProfsTable = GemRB.LoadTable ("weapprof")
for i in range (ProfsTable.GetRowCount()-ProfsTableOffset+1): #skip bg1 profs
GemRB.SetVar ("Prof "+str(i), 0)
GemRB.SetVar ("ProfBase "+str(i), 0)
return | [
"def",
"ProfsNullify",
"(",
")",
":",
"global",
"ProfsTable",
"if",
"not",
"ProfsTable",
":",
"ProfsTable",
"=",
"GemRB",
".",
"LoadTable",
"(",
"\"weapprof\"",
")",
"for",
"i",
"in",
"range",
"(",
"ProfsTable",
".",
"GetRowCount",
"(",
")",
"-",
"ProfsTab... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/LUProfsSelection.py#L468-L477 | |
facebookincubator/BOLT | 88c70afe9d388ad430cc150cc158641701397f70 | clang/bindings/python/clang/cindex.py | python | Cursor.is_const_method | (self) | return conf.lib.clang_CXXMethod_isConst(self) | Returns True if the cursor refers to a C++ member function or member
function template that is declared 'const'. | Returns True if the cursor refers to a C++ member function or member
function template that is declared 'const'. | [
"Returns",
"True",
"if",
"the",
"cursor",
"refers",
"to",
"a",
"C",
"++",
"member",
"function",
"or",
"member",
"function",
"template",
"that",
"is",
"declared",
"const",
"."
] | def is_const_method(self):
"""Returns True if the cursor refers to a C++ member function or member
function template that is declared 'const'.
"""
return conf.lib.clang_CXXMethod_isConst(self) | [
"def",
"is_const_method",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_CXXMethod_isConst",
"(",
"self",
")"
] | https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L1444-L1448 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/lib/io/file_io.py | python | read_file_to_string | (filename) | return f.read() | Reads the entire contents of a file to a string.
Args:
filename: string, path to a file
Returns:
contents of the file as a string
Raises:
errors.OpError: Raises variety of errors that are subtypes e.g.
NotFoundError etc. | Reads the entire contents of a file to a string. | [
"Reads",
"the",
"entire",
"contents",
"of",
"a",
"file",
"to",
"a",
"string",
"."
] | def read_file_to_string(filename):
"""Reads the entire contents of a file to a string.
Args:
filename: string, path to a file
Returns:
contents of the file as a string
Raises:
errors.OpError: Raises variety of errors that are subtypes e.g.
NotFoundError etc.
"""
f = FileIO(filename, mode=... | [
"def",
"read_file_to_string",
"(",
"filename",
")",
":",
"f",
"=",
"FileIO",
"(",
"filename",
",",
"mode",
"=",
"\"r\"",
")",
"return",
"f",
".",
"read",
"(",
")"
] | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/lib/io/file_io.py#L206-L220 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/framework/ops.py | python | Operation.name | (self) | The full name of this operation. | The full name of this operation. | [
"The",
"full",
"name",
"of",
"this",
"operation",
"."
] | def name(self):
"""The full name of this operation."""
if self._c_op:
# TODO(iga): Remove this assert after converting to C API by default.
# Just being a bit paranoid here.
assert self._node_def.name == c_api.TF_OperationName(self._c_op)
return c_api.TF_OperationName(self._c_op)
els... | [
"def",
"name",
"(",
"self",
")",
":",
"if",
"self",
".",
"_c_op",
":",
"# TODO(iga): Remove this assert after converting to C API by default.",
"# Just being a bit paranoid here.",
"assert",
"self",
".",
"_node_def",
".",
"name",
"==",
"c_api",
".",
"TF_OperationName",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/ops.py#L1647-L1655 | ||
polserver/polserver | b34a9de0e14cb16f1e0d358710a797ad4e42ebdc | clean.py | python | Cleaner.findCmake | (self) | return ret | Returns list of cmake-generated files | Returns list of cmake-generated files | [
"Returns",
"list",
"of",
"cmake",
"-",
"generated",
"files"
] | def findCmake(self):
''' Returns list of cmake-generated files '''
ret = []
def readFolder(path):
r = []
for f in os.listdir(path):
fp = os.path.join(path, f)
if os.path.isdir(fp):
if f == 'CMakeFiles':
ret.append(fp)
elif f != 'testsuite':
ret.extend(readFolder(fp))
else:
... | [
"def",
"findCmake",
"(",
"self",
")",
":",
"ret",
"=",
"[",
"]",
"def",
"readFolder",
"(",
"path",
")",
":",
"r",
"=",
"[",
"]",
"for",
"f",
"in",
"os",
".",
"listdir",
"(",
"path",
")",
":",
"fp",
"=",
"os",
".",
"path",
".",
"join",
"(",
... | https://github.com/polserver/polserver/blob/b34a9de0e14cb16f1e0d358710a797ad4e42ebdc/clean.py#L53-L74 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/curses_ui.py | python | CursesUI._erase_existing_command | (self) | Erase existing text in command textpad. | Erase existing text in command textpad. | [
"Erase",
"existing",
"text",
"in",
"command",
"textpad",
"."
] | def _erase_existing_command(self):
"""Erase existing text in command textpad."""
existing_len = len(self._command_textbox.gather())
for _ in xrange(existing_len):
self._command_textbox.do_command(self.BACKSPACE_KEY) | [
"def",
"_erase_existing_command",
"(",
"self",
")",
":",
"existing_len",
"=",
"len",
"(",
"self",
".",
"_command_textbox",
".",
"gather",
"(",
")",
")",
"for",
"_",
"in",
"xrange",
"(",
"existing_len",
")",
":",
"self",
".",
"_command_textbox",
".",
"do_co... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/curses_ui.py#L964-L969 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py | python | Node.rexists | (self) | return _rexists_map[self._func_rexists](self) | Does this node exist locally or in a repositiory? | Does this node exist locally or in a repositiory? | [
"Does",
"this",
"node",
"exist",
"locally",
"or",
"in",
"a",
"repositiory?"
] | def rexists(self):
"""Does this node exist locally or in a repositiory?"""
# There are no repositories by default:
return _rexists_map[self._func_rexists](self) | [
"def",
"rexists",
"(",
"self",
")",
":",
"# There are no repositories by default:",
"return",
"_rexists_map",
"[",
"self",
".",
"_func_rexists",
"]",
"(",
"self",
")"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/__init__.py#L1220-L1223 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/MooseDocs/extensions/core.py | python | CoreExtension.extend | (self, reader, renderer) | Add the extension components. | Add the extension components. | [
"Add",
"the",
"extension",
"components",
"."
] | def extend(self, reader, renderer):
"""
Add the extension components.
"""
# Block tokenize components
reader.addBlock(CodeBlock())
reader.addBlock(QuoteBlock())
reader.addBlock(HeadingBlock())
reader.addBlock(OrderedListBlock())
reader.addBlock(Un... | [
"def",
"extend",
"(",
"self",
",",
"reader",
",",
"renderer",
")",
":",
"# Block tokenize components",
"reader",
".",
"addBlock",
"(",
"CodeBlock",
"(",
")",
")",
"reader",
".",
"addBlock",
"(",
"QuoteBlock",
"(",
")",
")",
"reader",
".",
"addBlock",
"(",
... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/extensions/core.py#L68-L134 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py | python | withAttribute | (*args,**attrDict) | return pa | Helper to create a validating parse action to be used with start tags created
with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
with a required attribute value, to avoid false matches on common tags such as
C{<TD>} or C{<DIV>}.
Call C{withAttribute} with a ser... | Helper to create a validating parse action to be used with start tags created
with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
with a required attribute value, to avoid false matches on common tags such as
C{<TD>} or C{<DIV>}. | [
"Helper",
"to",
"create",
"a",
"validating",
"parse",
"action",
"to",
"be",
"used",
"with",
"start",
"tags",
"created",
"with",
"C",
"{",
"L",
"{",
"makeXMLTags",
"}}",
"or",
"C",
"{",
"L",
"{",
"makeHTMLTags",
"}}",
".",
"Use",
"C",
"{",
"withAttribut... | def withAttribute(*args,**attrDict):
"""
Helper to create a validating parse action to be used with start tags created
with C{L{makeXMLTags}} or C{L{makeHTMLTags}}. Use C{withAttribute} to qualify a starting tag
with a required attribute value, to avoid false matches on common tags such as
C{<TD>} o... | [
"def",
"withAttribute",
"(",
"*",
"args",
",",
"*",
"*",
"attrDict",
")",
":",
"if",
"args",
":",
"attrs",
"=",
"args",
"[",
":",
"]",
"else",
":",
"attrs",
"=",
"attrDict",
".",
"items",
"(",
")",
"attrs",
"=",
"[",
"(",
"k",
",",
"v",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py#L4932-L4994 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/lib/npyio.py | python | loadtxt | (fname, dtype=float, comments='#', delimiter=None,
converters=None, skiprows=0, usecols=None, unpack=False,
ndmin=0, encoding='bytes', max_rows=None) | Load data from a text file.
Each row in the text file must have the same number of values.
Parameters
----------
fname : file, str, or pathlib.Path
File, filename, or generator to read. If the filename extension is
``.gz`` or ``.bz2``, the file is first decompressed. Note that
... | Load data from a text file. | [
"Load",
"data",
"from",
"a",
"text",
"file",
"."
] | def loadtxt(fname, dtype=float, comments='#', delimiter=None,
converters=None, skiprows=0, usecols=None, unpack=False,
ndmin=0, encoding='bytes', max_rows=None):
"""
Load data from a text file.
Each row in the text file must have the same number of values.
Parameters
------... | [
"def",
"loadtxt",
"(",
"fname",
",",
"dtype",
"=",
"float",
",",
"comments",
"=",
"'#'",
",",
"delimiter",
"=",
"None",
",",
"converters",
"=",
"None",
",",
"skiprows",
"=",
"0",
",",
"usecols",
"=",
"None",
",",
"unpack",
"=",
"False",
",",
"ndmin",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/npyio.py#L804-L1184 | ||
KhronosGroup/Vulkan-Headers | b32da5329b50e3cb96229aaecba9ded032fe29cc | registry/vkconventions.py | python | VulkanConventions.null | (self) | return '`NULL`' | Preferred spelling of NULL. | Preferred spelling of NULL. | [
"Preferred",
"spelling",
"of",
"NULL",
"."
] | def null(self):
"""Preferred spelling of NULL."""
return '`NULL`' | [
"def",
"null",
"(",
"self",
")",
":",
"return",
"'`NULL`'"
] | https://github.com/KhronosGroup/Vulkan-Headers/blob/b32da5329b50e3cb96229aaecba9ded032fe29cc/registry/vkconventions.py#L48-L50 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py2/sklearn/gaussian_process/kernels.py | python | Exponentiation.hyperparameters | (self) | return r | Returns a list of all hyperparameter. | Returns a list of all hyperparameter. | [
"Returns",
"a",
"list",
"of",
"all",
"hyperparameter",
"."
] | def hyperparameters(self):
"""Returns a list of all hyperparameter."""
r = []
for hyperparameter in self.kernel.hyperparameters:
r.append(Hyperparameter("kernel__" + hyperparameter.name,
hyperparameter.value_type,
... | [
"def",
"hyperparameters",
"(",
"self",
")",
":",
"r",
"=",
"[",
"]",
"for",
"hyperparameter",
"in",
"self",
".",
"kernel",
".",
"hyperparameters",
":",
"r",
".",
"append",
"(",
"Hyperparameter",
"(",
"\"kernel__\"",
"+",
"hyperparameter",
".",
"name",
",",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/gaussian_process/kernels.py#L825-L833 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/internals/construction.py | python | _finalize_columns_and_data | (
content: np.ndarray, # ndim == 2
columns: Index | None,
dtype: DtypeObj | None,
) | return contents, columns | Ensure we have valid columns, cast object dtypes if possible. | Ensure we have valid columns, cast object dtypes if possible. | [
"Ensure",
"we",
"have",
"valid",
"columns",
"cast",
"object",
"dtypes",
"if",
"possible",
"."
] | def _finalize_columns_and_data(
content: np.ndarray, # ndim == 2
columns: Index | None,
dtype: DtypeObj | None,
) -> tuple[list[ArrayLike], Index]:
"""
Ensure we have valid columns, cast object dtypes if possible.
"""
contents = list(content.T)
try:
columns = _validate_or_index... | [
"def",
"_finalize_columns_and_data",
"(",
"content",
":",
"np",
".",
"ndarray",
",",
"# ndim == 2",
"columns",
":",
"Index",
"|",
"None",
",",
"dtype",
":",
"DtypeObj",
"|",
"None",
",",
")",
"->",
"tuple",
"[",
"list",
"[",
"ArrayLike",
"]",
",",
"Index... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/internals/construction.py#L895-L914 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/meta_optimizers/sharding/utils.py | python | fuse_opt_broadcast_param_ops | (block,
ring_id,
shard,
op_role=OpRole.Optimize,
strategy=None) | fuse optimizer sharding broadcast param ops | fuse optimizer sharding broadcast param ops | [
"fuse",
"optimizer",
"sharding",
"broadcast",
"param",
"ops"
] | def fuse_opt_broadcast_param_ops(block,
ring_id,
shard,
op_role=OpRole.Optimize,
strategy=None):
"""
fuse optimizer sharding broadcast param ops
"""
if strategy is None or ... | [
"def",
"fuse_opt_broadcast_param_ops",
"(",
"block",
",",
"ring_id",
",",
"shard",
",",
"op_role",
"=",
"OpRole",
".",
"Optimize",
",",
"strategy",
"=",
"None",
")",
":",
"if",
"strategy",
"is",
"None",
"or",
"not",
"strategy",
".",
"fuse_all_reduce_ops",
":... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/meta_optimizers/sharding/utils.py#L660-L705 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py | python | PtyProcess.getwinsize | (self) | return struct.unpack('HHHH', x)[0:2] | Return the window size of the pseudoterminal as a tuple (rows, cols). | Return the window size of the pseudoterminal as a tuple (rows, cols). | [
"Return",
"the",
"window",
"size",
"of",
"the",
"pseudoterminal",
"as",
"a",
"tuple",
"(",
"rows",
"cols",
")",
"."
] | def getwinsize(self):
"""Return the window size of the pseudoterminal as a tuple (rows, cols).
"""
TIOCGWINSZ = getattr(termios, 'TIOCGWINSZ', 1074295912)
s = struct.pack('HHHH', 0, 0, 0, 0)
x = fcntl.ioctl(self.fd, TIOCGWINSZ, s)
return struct.unpack('HHHH', x)[0:2] | [
"def",
"getwinsize",
"(",
"self",
")",
":",
"TIOCGWINSZ",
"=",
"getattr",
"(",
"termios",
",",
"'TIOCGWINSZ'",
",",
"1074295912",
")",
"s",
"=",
"struct",
".",
"pack",
"(",
"'HHHH'",
",",
"0",
",",
"0",
",",
"0",
",",
"0",
")",
"x",
"=",
"fcntl",
... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/ptyprocess-0.6.0/ptyprocess/ptyprocess.py#L774-L780 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/_sklearn.py | python | _BaseEstimator.get_params | (self, deep=True) | return out | Get parameters for this estimator.
Args:
deep: boolean, optional
If `True`, will return the parameters for this estimator and
contained subobjects that are estimators.
Returns:
params : mapping of string to any
Parameter names mapped to their values. | Get parameters for this estimator. | [
"Get",
"parameters",
"for",
"this",
"estimator",
"."
] | def get_params(self, deep=True):
"""Get parameters for this estimator.
Args:
deep: boolean, optional
If `True`, will return the parameters for this estimator and
contained subobjects that are estimators.
Returns:
params : mapping of string to any
Parameter names mapped t... | [
"def",
"get_params",
"(",
"self",
",",
"deep",
"=",
"True",
")",
":",
"out",
"=",
"dict",
"(",
")",
"param_names",
"=",
"[",
"name",
"for",
"name",
"in",
"self",
".",
"__dict__",
"if",
"not",
"name",
".",
"startswith",
"(",
"'_'",
")",
"]",
"for",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/estimators/_sklearn.py#L40-L66 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/msvc.py | python | SystemInfo._find_latest_available_vs_ver | (self) | return sorted(vc_vers)[-1] | Find the latest VC version
Return
------
float
version | Find the latest VC version | [
"Find",
"the",
"latest",
"VC",
"version"
] | def _find_latest_available_vs_ver(self):
"""
Find the latest VC version
Return
------
float
version
"""
reg_vc_vers = self.find_reg_vs_vers()
if not (reg_vc_vers or self.known_vs_paths):
raise distutils.errors.DistutilsPlatformErr... | [
"def",
"_find_latest_available_vs_ver",
"(",
"self",
")",
":",
"reg_vc_vers",
"=",
"self",
".",
"find_reg_vs_vers",
"(",
")",
"if",
"not",
"(",
"reg_vc_vers",
"or",
"self",
".",
"known_vs_paths",
")",
":",
"raise",
"distutils",
".",
"errors",
".",
"DistutilsPl... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/msvc.py#L692-L709 | |
pybox2d/pybox2d | 09643321fd363f0850087d1bde8af3f4afd82163 | library/Box2D/examples/framework.py | python | FrameworkBase.Step | (self, settings) | The main physics step.
Takes care of physics drawing (callbacks are executed after the world.Step() )
and drawing additional information. | The main physics step. | [
"The",
"main",
"physics",
"step",
"."
] | def Step(self, settings):
"""
The main physics step.
Takes care of physics drawing (callbacks are executed after the world.Step() )
and drawing additional information.
"""
self.stepCount += 1
# Don't do anything if the setting's Hz are <= 0
if settings.h... | [
"def",
"Step",
"(",
"self",
",",
"settings",
")",
":",
"self",
".",
"stepCount",
"+=",
"1",
"# Don't do anything if the setting's Hz are <= 0",
"if",
"settings",
".",
"hz",
">",
"0.0",
":",
"timeStep",
"=",
"1.0",
"/",
"settings",
".",
"hz",
"else",
":",
"... | https://github.com/pybox2d/pybox2d/blob/09643321fd363f0850087d1bde8af3f4afd82163/library/Box2D/examples/framework.py#L139-L288 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBTypeCategory.__str__ | (self) | return _lldb.SBTypeCategory___str__(self) | __str__(self) -> PyObject | __str__(self) -> PyObject | [
"__str__",
"(",
"self",
")",
"-",
">",
"PyObject"
] | def __str__(self):
"""__str__(self) -> PyObject"""
return _lldb.SBTypeCategory___str__(self) | [
"def",
"__str__",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBTypeCategory___str__",
"(",
"self",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10976-L10978 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.