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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/symbol/numpy/_symbol.py | python | repeat | (a, repeats, axis=None) | return _npi.repeats(a, repeats=repeats, axis=axis) | Repeat elements of an array.
Parameters
----------
a : array_like
Input array.
repeats : int
The number of repetitions for each element.
axis : int, optional
The axis along which to repeat values. By default, use the
flattened input array, and return a flat output a... | Repeat elements of an array. | [
"Repeat",
"elements",
"of",
"an",
"array",
"."
] | def repeat(a, repeats, axis=None):
"""
Repeat elements of an array.
Parameters
----------
a : array_like
Input array.
repeats : int
The number of repetitions for each element.
axis : int, optional
The axis along which to repeat values. By default, use the
fl... | [
"def",
"repeat",
"(",
"a",
",",
"repeats",
",",
"axis",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"repeats",
",",
"numeric_types",
")",
":",
"repeats",
"=",
"[",
"repeats",
"]",
"if",
"axis",
"is",
"not",
"None",
":",
"tmp",
"=",
"swapaxes",
... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/symbol/numpy/_symbol.py#L2533-L2578 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | distrib/mac/buildpkg.py | python | PackageMaker._addInfo | (self) | Write .info file containing installing options. | Write .info file containing installing options. | [
"Write",
".",
"info",
"file",
"containing",
"installing",
"options",
"."
] | def _addInfo(self):
"Write .info file containing installing options."
# Not sure if options in PKG_INFO_FIELDS are complete...
info = ""
for f in string.split(PKG_INFO_FIELDS, "\n"):
if self.packageInfo.has_key(f):
info = info + "%s %%(%s)s\n" % (f, f)
... | [
"def",
"_addInfo",
"(",
"self",
")",
":",
"# Not sure if options in PKG_INFO_FIELDS are complete...",
"info",
"=",
"\"\"",
"for",
"f",
"in",
"string",
".",
"split",
"(",
"PKG_INFO_FIELDS",
",",
"\"\\n\"",
")",
":",
"if",
"self",
".",
"packageInfo",
".",
"has_key... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/distrib/mac/buildpkg.py#L227-L240 | ||
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStr_PutFBase | (*args) | return _snap.TStr_PutFBase(*args) | TStr_PutFBase(TStr FNm, TStr FBase) -> TStr
Parameters:
FNm: TStr const &
FBase: TStr const & | TStr_PutFBase(TStr FNm, TStr FBase) -> TStr | [
"TStr_PutFBase",
"(",
"TStr",
"FNm",
"TStr",
"FBase",
")",
"-",
">",
"TStr"
] | def TStr_PutFBase(*args):
"""
TStr_PutFBase(TStr FNm, TStr FBase) -> TStr
Parameters:
FNm: TStr const &
FBase: TStr const &
"""
return _snap.TStr_PutFBase(*args) | [
"def",
"TStr_PutFBase",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStr_PutFBase",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L11235-L11244 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/GardenSnake/GardenSnake.py | python | p_stmts | (p) | stmts : stmts stmt
| stmt | stmts : stmts stmt
| stmt | [
"stmts",
":",
"stmts",
"stmt",
"|",
"stmt"
] | def p_stmts(p):
"""stmts : stmts stmt
| stmt"""
if len(p) == 3:
p[0] = p[1] + p[2]
else:
p[0] = p[1] | [
"def",
"p_stmts",
"(",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"3",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"+",
"p",
"[",
"2",
"]",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/GardenSnake/GardenSnake.py#L479-L485 | ||
google/fhir | d77f57706c1a168529b0b87ca7ccb1c0113e83c2 | py/google/fhir/json_format/_json_printer.py | python | JsonPrinter.print | (self, msg: message.Message) | return self.generator.dump() | Returns the contents of message as a FHIR JSON string. | Returns the contents of message as a FHIR JSON string. | [
"Returns",
"the",
"contents",
"of",
"message",
"as",
"a",
"FHIR",
"JSON",
"string",
"."
] | def print(self, msg: message.Message) -> str:
"""Returns the contents of message as a FHIR JSON string."""
self.generator.clear()
# If provided a primitive message, simply wrap and return the JSON value
if annotation_utils.is_primitive_type(msg):
wrapper = self.primitive_handler.primitive_wrapper... | [
"def",
"print",
"(",
"self",
",",
"msg",
":",
"message",
".",
"Message",
")",
"->",
"str",
":",
"self",
".",
"generator",
".",
"clear",
"(",
")",
"# If provided a primitive message, simply wrap and return the JSON value",
"if",
"annotation_utils",
".",
"is_primitive... | https://github.com/google/fhir/blob/d77f57706c1a168529b0b87ca7ccb1c0113e83c2/py/google/fhir/json_format/_json_printer.py#L419-L429 | |
infinit/elle | a8154593c42743f45b9df09daf62b44630c24a02 | drake/src/drake/__init__.py | python | path_root | () | return Path(_OS.getcwd()) | The directory containing the root drakefile. | The directory containing the root drakefile. | [
"The",
"directory",
"containing",
"the",
"root",
"drakefile",
"."
] | def path_root():
"""The directory containing the root drakefile."""
return Path(_OS.getcwd()) | [
"def",
"path_root",
"(",
")",
":",
"return",
"Path",
"(",
"_OS",
".",
"getcwd",
"(",
")",
")"
] | https://github.com/infinit/elle/blob/a8154593c42743f45b9df09daf62b44630c24a02/drake/src/drake/__init__.py#L1323-L1325 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/dist.py | python | Distribution._finalize_license_files | (self) | Compute names of all license files which should be included. | Compute names of all license files which should be included. | [
"Compute",
"names",
"of",
"all",
"license",
"files",
"which",
"should",
"be",
"included",
"."
] | def _finalize_license_files(self):
"""Compute names of all license files which should be included."""
license_files: Optional[List[str]] = self.metadata.license_files
patterns: List[str] = license_files if license_files else []
license_file: Optional[str] = self.metadata.license_file
... | [
"def",
"_finalize_license_files",
"(",
"self",
")",
":",
"license_files",
":",
"Optional",
"[",
"List",
"[",
"str",
"]",
"]",
"=",
"self",
".",
"metadata",
".",
"license_files",
"patterns",
":",
"List",
"[",
"str",
"]",
"=",
"license_files",
"if",
"license... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/dist.py#L592-L609 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/py/py/_path/svnwc.py | python | SvnWCCommandPath.lock | (self) | set a lock (exclusive) on the resource | set a lock (exclusive) on the resource | [
"set",
"a",
"lock",
"(",
"exclusive",
")",
"on",
"the",
"resource"
] | def lock(self):
""" set a lock (exclusive) on the resource """
out = self._authsvn('lock').strip()
if not out:
# warning or error, raise exception
raise ValueError("unknown error in svn lock command") | [
"def",
"lock",
"(",
"self",
")",
":",
"out",
"=",
"self",
".",
"_authsvn",
"(",
"'lock'",
")",
".",
"strip",
"(",
")",
"if",
"not",
"out",
":",
"# warning or error, raise exception",
"raise",
"ValueError",
"(",
"\"unknown error in svn lock command\"",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_path/svnwc.py#L594-L599 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/email/_header_value_parser.py | python | parse_content_transfer_encoding_header | (value) | return cte_header | mechanism | mechanism | [
"mechanism"
] | def parse_content_transfer_encoding_header(value):
""" mechanism
"""
# We should probably validate the values, since the list is fixed.
cte_header = ContentTransferEncoding()
if not value:
cte_header.defects.append(errors.HeaderMissingRequiredValue(
"Missing content transfer enc... | [
"def",
"parse_content_transfer_encoding_header",
"(",
"value",
")",
":",
"# We should probably validate the values, since the list is fixed.",
"cte_header",
"=",
"ContentTransferEncoding",
"(",
")",
"if",
"not",
"value",
":",
"cte_header",
".",
"defects",
".",
"append",
"("... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/_header_value_parser.py#L2708-L2737 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SCD_Reduction/ICCFitTools.py | python | getInitialGuess | (tofWS, paramNames, energy, flightPath, padeCoefficients) | return x0 | Returns initial parameters for fitting based on a few quickly derived TOF
profile parameters. tofWS is a worskapce containng the TOF profile,
paramNames is the list of parameter names
energy is the energy of the peak (units: eV)
flightPath is L = L1 + L2 (units: m) | Returns initial parameters for fitting based on a few quickly derived TOF
profile parameters. tofWS is a worskapce containng the TOF profile,
paramNames is the list of parameter names
energy is the energy of the peak (units: eV)
flightPath is L = L1 + L2 (units: m) | [
"Returns",
"initial",
"parameters",
"for",
"fitting",
"based",
"on",
"a",
"few",
"quickly",
"derived",
"TOF",
"profile",
"parameters",
".",
"tofWS",
"is",
"a",
"worskapce",
"containng",
"the",
"TOF",
"profile",
"paramNames",
"is",
"the",
"list",
"of",
"paramet... | def getInitialGuess(tofWS, paramNames, energy, flightPath, padeCoefficients):
"""
Returns initial parameters for fitting based on a few quickly derived TOF
profile parameters. tofWS is a worskapce containng the TOF profile,
paramNames is the list of parameter names
energy is the energy of the pe... | [
"def",
"getInitialGuess",
"(",
"tofWS",
",",
"paramNames",
",",
"energy",
",",
"flightPath",
",",
"padeCoefficients",
")",
":",
"x0",
"=",
"np",
".",
"zeros",
"(",
"len",
"(",
"paramNames",
")",
")",
"x",
"=",
"tofWS",
".",
"readX",
"(",
"0",
")",
"y... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SCD_Reduction/ICCFitTools.py#L698-L724 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | main/python/cmdLineUtils.py | python | manyOccurenceRemove | (pathSplitList,fileName) | Search for double occurence of the same pathSplit and remove them | Search for double occurence of the same pathSplit and remove them | [
"Search",
"for",
"double",
"occurence",
"of",
"the",
"same",
"pathSplit",
"and",
"remove",
"them"
] | def manyOccurenceRemove(pathSplitList,fileName):
"""
Search for double occurence of the same pathSplit and remove them
"""
if len(pathSplitList) > 1:
for n in pathSplitList:
if pathSplitList.count(n) != 1:
logging.warning(MANY_OCCURENCE_WARNING.format(joinPathSplit(n)... | [
"def",
"manyOccurenceRemove",
"(",
"pathSplitList",
",",
"fileName",
")",
":",
"if",
"len",
"(",
"pathSplitList",
")",
">",
"1",
":",
"for",
"n",
"in",
"pathSplitList",
":",
"if",
"pathSplitList",
".",
"count",
"(",
"n",
")",
"!=",
"1",
":",
"logging",
... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/main/python/cmdLineUtils.py#L309-L317 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py | python | removeQuotes | (s,l,t) | return t[0][1:-1] | Helper parse action for removing quotation marks from parsed quoted strings.
Example::
# by default, quotation marks are included in parsed results
quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"]
# use removeQuotes to strip q... | Helper parse action for removing quotation marks from parsed quoted strings. | [
"Helper",
"parse",
"action",
"for",
"removing",
"quotation",
"marks",
"from",
"parsed",
"quoted",
"strings",
"."
] | def removeQuotes(s,l,t):
"""
Helper parse action for removing quotation marks from parsed quoted strings.
Example::
# by default, quotation marks are included in parsed results
quotedString.parseString("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"]
... | [
"def",
"removeQuotes",
"(",
"s",
",",
"l",
",",
"t",
")",
":",
"return",
"t",
"[",
"0",
"]",
"[",
"1",
":",
"-",
"1",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/pkg_resources/_vendor/pyparsing.py#L4770-L4782 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/bindings/python/clang/cindex.py | python | TranslationUnit.get_file | (self, filename) | return File.from_name(self, filename) | Obtain a File from this translation unit. | Obtain a File from this translation unit. | [
"Obtain",
"a",
"File",
"from",
"this",
"translation",
"unit",
"."
] | def get_file(self, filename):
"""Obtain a File from this translation unit."""
return File.from_name(self, filename) | [
"def",
"get_file",
"(",
"self",
",",
"filename",
")",
":",
"return",
"File",
".",
"from_name",
"(",
"self",
",",
"filename",
")"
] | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/bindings/python/clang/cindex.py#L2907-L2910 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | RigidObjectModel.getID | (self) | return _robotsim.RigidObjectModel_getID(self) | getID(RigidObjectModel self) -> int
Returns the ID of the rigid object in its world.
Note: The world ID is not the same as the rigid object index. | getID(RigidObjectModel self) -> int | [
"getID",
"(",
"RigidObjectModel",
"self",
")",
"-",
">",
"int"
] | def getID(self):
"""
getID(RigidObjectModel self) -> int
Returns the ID of the rigid object in its world.
Note: The world ID is not the same as the rigid object index.
"""
return _robotsim.RigidObjectModel_getID(self) | [
"def",
"getID",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"RigidObjectModel_getID",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L5343-L5354 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/extern/aui/framemanager.py | python | AuiDockingGuideWindow.IsValid | (self) | return self._valid | Returns whether the docking direction is valid. | Returns whether the docking direction is valid. | [
"Returns",
"whether",
"the",
"docking",
"direction",
"is",
"valid",
"."
] | def IsValid(self):
""" Returns whether the docking direction is valid. """
return self._valid | [
"def",
"IsValid",
"(",
"self",
")",
":",
"return",
"self",
".",
"_valid"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/framemanager.py#L1965-L1968 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/timeseries/python/timeseries/math_utils.py | python | make_toeplitz_matrix | (inputs, name=None) | return array_ops.identity(output, name=name) | Make a symmetric Toeplitz matrix from input array of values.
Args:
inputs: a 3-D tensor of shape [num_blocks, block_size, block_size].
name: the name of the operation.
Returns:
a symmetric Toeplitz matrix of shape
[num_blocks*block_size, num_blocks*block_size]. | Make a symmetric Toeplitz matrix from input array of values. | [
"Make",
"a",
"symmetric",
"Toeplitz",
"matrix",
"from",
"input",
"array",
"of",
"values",
"."
] | def make_toeplitz_matrix(inputs, name=None):
"""Make a symmetric Toeplitz matrix from input array of values.
Args:
inputs: a 3-D tensor of shape [num_blocks, block_size, block_size].
name: the name of the operation.
Returns:
a symmetric Toeplitz matrix of shape
[num_blocks*block_size, num_bloc... | [
"def",
"make_toeplitz_matrix",
"(",
"inputs",
",",
"name",
"=",
"None",
")",
":",
"num_blocks",
"=",
"array_ops",
".",
"shape",
"(",
"inputs",
")",
"[",
"0",
"]",
"block_size",
"=",
"array_ops",
".",
"shape",
"(",
"inputs",
")",
"[",
"1",
"]",
"output_... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/math_utils.py#L294-L313 | |
tuttleofx/TuttleOFX | 36fc4cae15092a84ea8c29b9c6658c7cabfadb6e | applications/sam/common/samDoUtils.py | python | samDoCompleter | (prefix, parsed_args, **kwargs) | return pluginsStr | Custom Completer to manage auto competion when looking for openFX nodes.
@warning The autocompletion works only for TuttleOFX plugins. | Custom Completer to manage auto competion when looking for openFX nodes. | [
"Custom",
"Completer",
"to",
"manage",
"auto",
"competion",
"when",
"looking",
"for",
"openFX",
"nodes",
"."
] | def samDoCompleter(prefix, parsed_args, **kwargs):
"""
Custom Completer to manage auto competion when looking for openFX nodes.
@warning The autocompletion works only for TuttleOFX plugins.
"""
# preload OFX plugins (to have auto completion of plugins name, their parameters...)
tuttle.core().pre... | [
"def",
"samDoCompleter",
"(",
"prefix",
",",
"parsed_args",
",",
"*",
"*",
"kwargs",
")",
":",
"# preload OFX plugins (to have auto completion of plugins name, their parameters...)",
"tuttle",
".",
"core",
"(",
")",
".",
"preload",
"(",
"True",
")",
"# get plugins",
"... | https://github.com/tuttleofx/TuttleOFX/blob/36fc4cae15092a84ea8c29b9c6658c7cabfadb6e/applications/sam/common/samDoUtils.py#L376-L419 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/build/lib.linux-x86_64-2.7/mxnet/kvstore.py | python | KVStore.set_optimizer | (self, optimizer) | Register an optimizer to the store
If there are multiple machines, this process (should be a worker node)
will pack this optimizer and send it to all servers. It returns after
this action is done.
Parameters
----------
optimizer : Optimizer
the optimizer | Register an optimizer to the store | [
"Register",
"an",
"optimizer",
"to",
"the",
"store"
] | def set_optimizer(self, optimizer):
"""Register an optimizer to the store
If there are multiple machines, this process (should be a worker node)
will pack this optimizer and send it to all servers. It returns after
this action is done.
Parameters
----------
opti... | [
"def",
"set_optimizer",
"(",
"self",
",",
"optimizer",
")",
":",
"is_worker",
"=",
"ctypes",
".",
"c_int",
"(",
")",
"check_call",
"(",
"_LIB",
".",
"MXKVStoreIsWorkerNode",
"(",
"ctypes",
".",
"byref",
"(",
"is_worker",
")",
")",
")",
"# pylint: disable=inv... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/kvstore.py#L231-L256 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/gyp/create_unwind_table.py | python | GenerateUnwinds | (function_cfis: Iterable[FunctionCfi],
parsers: Tuple[UnwindInstructionsParser, ...]
) | Generates parsed function unwind states from breakpad CFI data.
This function parses `FunctionCfi`s to `FunctionUnwind`s using
`UnwindInstructionParser`.
Args:
function_cfis: An iterable of function CFI data.
parsers: Available parsers to try on CFI address data.
Returns:
An iterable of parsed fu... | Generates parsed function unwind states from breakpad CFI data. | [
"Generates",
"parsed",
"function",
"unwind",
"states",
"from",
"breakpad",
"CFI",
"data",
"."
] | def GenerateUnwinds(function_cfis: Iterable[FunctionCfi],
parsers: Tuple[UnwindInstructionsParser, ...]
) -> Iterable[FunctionUnwind]:
"""Generates parsed function unwind states from breakpad CFI data.
This function parses `FunctionCfi`s to `FunctionUnwind`s using
`UnwindI... | [
"def",
"GenerateUnwinds",
"(",
"function_cfis",
":",
"Iterable",
"[",
"FunctionCfi",
"]",
",",
"parsers",
":",
"Tuple",
"[",
"UnwindInstructionsParser",
",",
"...",
"]",
")",
"->",
"Iterable",
"[",
"FunctionUnwind",
"]",
":",
"functions",
"=",
"0",
"addresses"... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/create_unwind_table.py#L843-L899 | ||
google/nucleus | 68d3947fafba1337f294c0668a6e1c7f3f1273e3 | nucleus/util/cigar.py | python | parse_cigar_string | (cigar_str) | return [to_cigar_unit(part.group(1)) for part in parts] | Parse a cigar string into a list of cigar units.
For example, if cigar_str is 150M2S, this function will return:
[
CigarUnit(operation=ALIGNMENT_MATCH, operation_length=150),
CigarUnit(operation=SOFT_CLIP, operation_length=2)
]
Args:
cigar_str: str containing a valid cigar.
Returns:
list[c... | Parse a cigar string into a list of cigar units. | [
"Parse",
"a",
"cigar",
"string",
"into",
"a",
"list",
"of",
"cigar",
"units",
"."
] | def parse_cigar_string(cigar_str):
"""Parse a cigar string into a list of cigar units.
For example, if cigar_str is 150M2S, this function will return:
[
CigarUnit(operation=ALIGNMENT_MATCH, operation_length=150),
CigarUnit(operation=SOFT_CLIP, operation_length=2)
]
Args:
cigar_str: str containi... | [
"def",
"parse_cigar_string",
"(",
"cigar_str",
")",
":",
"if",
"not",
"cigar_str",
":",
"raise",
"ValueError",
"(",
"'cigar_str cannot be empty'",
")",
"if",
"not",
"VALID_CIGAR_RE",
".",
"match",
"(",
"cigar_str",
")",
":",
"raise",
"ValueError",
"(",
"'Malform... | https://github.com/google/nucleus/blob/68d3947fafba1337f294c0668a6e1c7f3f1273e3/nucleus/util/cigar.py#L95-L119 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/dictobject.py | python | _dict_length | (typingctx, d) | return sig, codegen | Wrap numba_dict_length
Returns the length of the dictionary. | Wrap numba_dict_length | [
"Wrap",
"numba_dict_length"
] | def _dict_length(typingctx, d):
"""Wrap numba_dict_length
Returns the length of the dictionary.
"""
resty = types.intp
sig = resty(d)
def codegen(context, builder, sig, args):
fnty = ir.FunctionType(
ll_ssize_t,
[ll_dict_type],
)
fn = builder.mod... | [
"def",
"_dict_length",
"(",
"typingctx",
",",
"d",
")",
":",
"resty",
"=",
"types",
".",
"intp",
"sig",
"=",
"resty",
"(",
"d",
")",
"def",
"codegen",
"(",
"context",
",",
"builder",
",",
"sig",
",",
"args",
")",
":",
"fnty",
"=",
"ir",
".",
"Fun... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/dictobject.py#L370-L391 | |
bigartm/bigartm | 47e37f982de87aa67bfd475ff1f39da696b181b3 | 3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor_pool.py | python | DescriptorPool.FindExtensionByName | (self, full_name) | return scope.extensions_by_name[extension_name] | Loads the named extension descriptor from the pool.
Args:
full_name: The full name of the extension descriptor to load.
Returns:
A FieldDescriptor, describing the named extension. | Loads the named extension descriptor from the pool. | [
"Loads",
"the",
"named",
"extension",
"descriptor",
"from",
"the",
"pool",
"."
] | def FindExtensionByName(self, full_name):
"""Loads the named extension descriptor from the pool.
Args:
full_name: The full name of the extension descriptor to load.
Returns:
A FieldDescriptor, describing the named extension.
"""
full_name = _NormalizeFullyQualifiedName(full_name)
m... | [
"def",
"FindExtensionByName",
"(",
"self",
",",
"full_name",
")",
":",
"full_name",
"=",
"_NormalizeFullyQualifiedName",
"(",
"full_name",
")",
"message_name",
",",
"_",
",",
"extension_name",
"=",
"full_name",
".",
"rpartition",
"(",
"'.'",
")",
"try",
":",
"... | https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/descriptor_pool.py#L287-L304 | |
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | site_scons/buildutils.py | python | Option.to_rest | (self, dev: bool = False, indent: int = 3) | return out | Convert description of option to restructured text (reST) | Convert description of option to restructured text (reST) | [
"Convert",
"description",
"of",
"option",
"to",
"restructured",
"text",
"(",
"reST",
")"
] | def to_rest(self, dev: bool = False, indent: int = 3) -> str:
"""Convert description of option to restructured text (reST)"""
# assemble output
tag = self.name.replace("_", "-").lower()
if dev:
tag += "-dev"
out = f".. _{tag}:\n\n"
out += f"{self._build_title(... | [
"def",
"to_rest",
"(",
"self",
",",
"dev",
":",
"bool",
"=",
"False",
",",
"indent",
":",
"int",
"=",
"3",
")",
"->",
"str",
":",
"# assemble output",
"tag",
"=",
"self",
".",
"name",
".",
"replace",
"(",
"\"_\"",
",",
"\"-\"",
")",
".",
"lower",
... | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/site_scons/buildutils.py#L241-L252 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/slim/python/slim/data/tfexample_decoder.py | python | TFExampleDecoder.__init__ | (self, keys_to_features, items_to_handlers) | Constructs the decoder.
Args:
keys_to_features: a dictionary from TF-Example keys to either
tf.VarLenFeature or tf.FixedLenFeature instances. See tensorflow's
parsing_ops.py.
items_to_handlers: a dictionary from items (strings) to ItemHandler
instances. Note that the ItemHandler... | Constructs the decoder. | [
"Constructs",
"the",
"decoder",
"."
] | def __init__(self, keys_to_features, items_to_handlers):
"""Constructs the decoder.
Args:
keys_to_features: a dictionary from TF-Example keys to either
tf.VarLenFeature or tf.FixedLenFeature instances. See tensorflow's
parsing_ops.py.
items_to_handlers: a dictionary from items (stri... | [
"def",
"__init__",
"(",
"self",
",",
"keys_to_features",
",",
"items_to_handlers",
")",
":",
"self",
".",
"_keys_to_features",
"=",
"keys_to_features",
"self",
".",
"_items_to_handlers",
"=",
"items_to_handlers"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/slim/python/slim/data/tfexample_decoder.py#L299-L311 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/session.py | python | Session.profile_name | (self) | return self._session.profile or 'default' | The **read-only** profile name. | The **read-only** profile name. | [
"The",
"**",
"read",
"-",
"only",
"**",
"profile",
"name",
"."
] | def profile_name(self):
"""
The **read-only** profile name.
"""
return self._session.profile or 'default' | [
"def",
"profile_name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_session",
".",
"profile",
"or",
"'default'"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/boto3/session.py#L89-L93 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/framework/python/framework/checkpoint_utils.py | python | init_from_checkpoint | (checkpoint_dir, assignment_map) | Using assingment map initializes current variables with loaded tensors.
Note: This overrides default initialization ops of specified variables and
redefines dtype.
Assignment map supports following syntax:
`'checkpoint_scope_name/': 'scope_name/'` - will load all variables in
current `scope_name` from... | Using assingment map initializes current variables with loaded tensors. | [
"Using",
"assingment",
"map",
"initializes",
"current",
"variables",
"with",
"loaded",
"tensors",
"."
] | def init_from_checkpoint(checkpoint_dir, assignment_map):
"""Using assingment map initializes current variables with loaded tensors.
Note: This overrides default initialization ops of specified variables and
redefines dtype.
Assignment map supports following syntax:
`'checkpoint_scope_name/': 'scope_name/... | [
"def",
"init_from_checkpoint",
"(",
"checkpoint_dir",
",",
"assignment_map",
")",
":",
"filepattern",
"=",
"_get_checkpoint_filename",
"(",
"checkpoint_dir",
")",
"reader",
"=",
"load_checkpoint",
"(",
"checkpoint_dir",
")",
"variable_map",
"=",
"reader",
".",
"get_va... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/framework/python/framework/checkpoint_utils.py#L146-L287 | ||
fatih/subvim | 241b6d170597857105da219c9b7d36059e9f11fb | vim/base/ultisnips/utils/convert_snipmate_snippets.py | python | convert_snippet | (source) | return 'snippet %s "%s"' % (name, name) + "\n" + \
convert_snippet_contents(open(source).read()) + \
"\nendsnippet\n" | One file per snippet | One file per snippet | [
"One",
"file",
"per",
"snippet"
] | def convert_snippet(source):
" One file per snippet "
name = os.path.basename(source)[:-8]
return 'snippet %s "%s"' % (name, name) + "\n" + \
convert_snippet_contents(open(source).read()) + \
"\nendsnippet\n" | [
"def",
"convert_snippet",
"(",
"source",
")",
":",
"name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"source",
")",
"[",
":",
"-",
"8",
"]",
"return",
"'snippet %s \"%s\"'",
"%",
"(",
"name",
",",
"name",
")",
"+",
"\"\\n\"",
"+",
"convert_snippet_... | https://github.com/fatih/subvim/blob/241b6d170597857105da219c9b7d36059e9f11fb/vim/base/ultisnips/utils/convert_snipmate_snippets.py#L72-L77 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_model.py | python | GeneralFittingModel._update_simultaneous_fit_function_after_sequential | (self, workspaces: list, functions: list) | Updates the single fit functions after a sequential fit has been run on the Sequential fitting tab. | Updates the single fit functions after a sequential fit has been run on the Sequential fitting tab. | [
"Updates",
"the",
"single",
"fit",
"functions",
"after",
"a",
"sequential",
"fit",
"has",
"been",
"run",
"on",
"the",
"Sequential",
"fitting",
"tab",
"."
] | def _update_simultaneous_fit_function_after_sequential(self, workspaces: list, functions: list) -> None:
"""Updates the single fit functions after a sequential fit has been run on the Sequential fitting tab."""
for fit_index, workspace_names in enumerate(workspaces):
if self._are_same_worksp... | [
"def",
"_update_simultaneous_fit_function_after_sequential",
"(",
"self",
",",
"workspaces",
":",
"list",
",",
"functions",
":",
"list",
")",
"->",
"None",
":",
"for",
"fit_index",
",",
"workspace_names",
"in",
"enumerate",
"(",
"workspaces",
")",
":",
"if",
"se... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_model.py#L545-L550 | ||
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | ctpn_crnn_ocr/CTPN/caffe/python/caffe/io.py | python | Transformer.set_input_scale | (self, in_, scale) | Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE.
Parameters
----------
in_ : which input to assign this scale factor
scale : scale coefficient | Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE. | [
"Set",
"the",
"scale",
"of",
"preprocessed",
"inputs",
"s",
".",
"t",
".",
"the",
"blob",
"=",
"blob",
"*",
"scale",
".",
"N",
".",
"B",
".",
"input_scale",
"is",
"done",
"AFTER",
"mean",
"subtraction",
"and",
"other",
"preprocessing",
"while",
"raw_scal... | def set_input_scale(self, in_, scale):
"""
Set the scale of preprocessed inputs s.t. the blob = blob * scale.
N.B. input_scale is done AFTER mean subtraction and other preprocessing
while raw_scale is done BEFORE.
Parameters
----------
in_ : which input to assign... | [
"def",
"set_input_scale",
"(",
"self",
",",
"in_",
",",
"scale",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"self",
".",
"input_scale",
"[",
"in_",
"]",
"=",
"scale"
] | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/ctpn_crnn_ocr/CTPN/caffe/python/caffe/io.py#L258-L270 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_vehicle.py | python | VehicleDomain.getCOEmission | (self, vehID) | return self._getUniversal(tc.VAR_COEMISSION, vehID) | getCOEmission(string) -> double
Returns the CO emission in mg/s for the last time step.
Multiply by the step length to get the value for one step. | getCOEmission(string) -> double | [
"getCOEmission",
"(",
"string",
")",
"-",
">",
"double"
] | def getCOEmission(self, vehID):
"""getCOEmission(string) -> double
Returns the CO emission in mg/s for the last time step.
Multiply by the step length to get the value for one step.
"""
return self._getUniversal(tc.VAR_COEMISSION, vehID) | [
"def",
"getCOEmission",
"(",
"self",
",",
"vehID",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"VAR_COEMISSION",
",",
"vehID",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_vehicle.py#L366-L372 | |
chanyn/3Dpose_ssl | 585696676279683a279b1ecca136c0e0d02aef2a | caffe-3dssl/python/caffe/io.py | python | blobproto_to_array | (blob, return_diff=False) | Convert a blob proto to an array. In default, we will just return the data,
unless return_diff is True, in which case we will return the diff. | Convert a blob proto to an array. In default, we will just return the data,
unless return_diff is True, in which case we will return the diff. | [
"Convert",
"a",
"blob",
"proto",
"to",
"an",
"array",
".",
"In",
"default",
"we",
"will",
"just",
"return",
"the",
"data",
"unless",
"return_diff",
"is",
"True",
"in",
"which",
"case",
"we",
"will",
"return",
"the",
"diff",
"."
] | def blobproto_to_array(blob, return_diff=False):
"""
Convert a blob proto to an array. In default, we will just return the data,
unless return_diff is True, in which case we will return the diff.
"""
# Read the data into an array
if return_diff:
data = np.array(blob.diff)
else:
... | [
"def",
"blobproto_to_array",
"(",
"blob",
",",
"return_diff",
"=",
"False",
")",
":",
"# Read the data into an array",
"if",
"return_diff",
":",
"data",
"=",
"np",
".",
"array",
"(",
"blob",
".",
"diff",
")",
"else",
":",
"data",
"=",
"np",
".",
"array",
... | https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/python/caffe/io.py#L18-L34 | ||
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/logic_util.py | python | used_constants | (*terms) | Returns a frozenset of constants used in given terms. | Returns a frozenset of constants used in given terms. | [
"Returns",
"a",
"frozenset",
"of",
"constants",
"used",
"in",
"given",
"terms",
"."
] | def used_constants(*terms):
"""
Returns a frozenset of constants used in given terms.
"""
t = terms[0] if len(terms) == 1 else terms
if type(t) is Const:
return frozenset((t,))
elif type(t) in (tuple, Var, Apply, Eq, Ite, Not, And, Or,
Implies, Iff, ForAll, Exists... | [
"def",
"used_constants",
"(",
"*",
"terms",
")",
":",
"t",
"=",
"terms",
"[",
"0",
"]",
"if",
"len",
"(",
"terms",
")",
"==",
"1",
"else",
"terms",
"if",
"type",
"(",
"t",
")",
"is",
"Const",
":",
"return",
"frozenset",
"(",
"(",
"t",
",",
")",... | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/logic_util.py#L108-L126 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | TaskBarIcon._setCallbackInfo | (*args, **kwargs) | return _windows_.TaskBarIcon__setCallbackInfo(*args, **kwargs) | _setCallbackInfo(self, PyObject self, PyObject _class, int incref=0) | _setCallbackInfo(self, PyObject self, PyObject _class, int incref=0) | [
"_setCallbackInfo",
"(",
"self",
"PyObject",
"self",
"PyObject",
"_class",
"int",
"incref",
"=",
"0",
")"
] | def _setCallbackInfo(*args, **kwargs):
"""_setCallbackInfo(self, PyObject self, PyObject _class, int incref=0)"""
return _windows_.TaskBarIcon__setCallbackInfo(*args, **kwargs) | [
"def",
"_setCallbackInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"TaskBarIcon__setCallbackInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L2817-L2819 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/well_known_types.py | python | Timestamp.ToJsonString | (self) | return result + '.%09dZ' % nanos | Converts Timestamp to RFC 3339 date string format.
Returns:
A string converted from timestamp. The string is always Z-normalized
and uses 3, 6 or 9 fractional digits as required to represent the
exact time. Example of the return format: '1972-01-01T10:00:20.021Z' | Converts Timestamp to RFC 3339 date string format. | [
"Converts",
"Timestamp",
"to",
"RFC",
"3339",
"date",
"string",
"format",
"."
] | def ToJsonString(self):
"""Converts Timestamp to RFC 3339 date string format.
Returns:
A string converted from timestamp. The string is always Z-normalized
and uses 3, 6 or 9 fractional digits as required to represent the
exact time. Example of the return format: '1972-01-01T10:00:20.021Z'
... | [
"def",
"ToJsonString",
"(",
"self",
")",
":",
"nanos",
"=",
"self",
".",
"nanos",
"%",
"_NANOS_PER_SECOND",
"total_sec",
"=",
"self",
".",
"seconds",
"+",
"(",
"self",
".",
"nanos",
"-",
"nanos",
")",
"//",
"_NANOS_PER_SECOND",
"seconds",
"=",
"total_sec",... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/internal/well_known_types.py#L99-L125 | |
jeog/TDAmeritradeAPI | 91c738afd7d57b54f6231170bd64c2550fafd34d | python/tdma_api/get.py | python | HistoricalPeriodGetter.get_period_type | (self) | return clib.get_val(self._abi('GetPeriodType'), c_int, self._obj) | Returns PERIOD_TYPE_[] constant being used. | Returns PERIOD_TYPE_[] constant being used. | [
"Returns",
"PERIOD_TYPE_",
"[]",
"constant",
"being",
"used",
"."
] | def get_period_type(self):
"""Returns PERIOD_TYPE_[] constant being used."""
return clib.get_val(self._abi('GetPeriodType'), c_int, self._obj) | [
"def",
"get_period_type",
"(",
"self",
")",
":",
"return",
"clib",
".",
"get_val",
"(",
"self",
".",
"_abi",
"(",
"'GetPeriodType'",
")",
",",
"c_int",
",",
"self",
".",
"_obj",
")"
] | https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/get.py#L516-L518 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mimify.py | python | mimify | (infile, outfile) | Convert 8bit parts of a MIME mail message to quoted-printable. | Convert 8bit parts of a MIME mail message to quoted-printable. | [
"Convert",
"8bit",
"parts",
"of",
"a",
"MIME",
"mail",
"message",
"to",
"quoted",
"-",
"printable",
"."
] | def mimify(infile, outfile):
"""Convert 8bit parts of a MIME mail message to quoted-printable."""
if type(infile) == type(''):
ifile = open(infile)
if type(outfile) == type('') and infile == outfile:
import os
d, f = os.path.split(infile)
os.rename(infile, os.... | [
"def",
"mimify",
"(",
"infile",
",",
"outfile",
")",
":",
"if",
"type",
"(",
"infile",
")",
"==",
"type",
"(",
"''",
")",
":",
"ifile",
"=",
"open",
"(",
"infile",
")",
"if",
"type",
"(",
"outfile",
")",
"==",
"type",
"(",
"''",
")",
"and",
"in... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mimify.py#L415-L431 | ||
SOUI2/soui | 774e5566b2d3254a94f4b3efd55b982e7c665434 | third-part/jsoncpp/devtools/licenseupdater.py | python | update_license | (path, dry_run, show_diff) | return False | Update the license statement in the specified file.
Parameters:
path: path of the C++ source file to update.
dry_run: if True, just print the path of the file that would be updated,
but don't change it.
show_diff: if True, print the path of the file that would be modified,
... | Update the license statement in the specified file.
Parameters:
path: path of the C++ source file to update.
dry_run: if True, just print the path of the file that would be updated,
but don't change it.
show_diff: if True, print the path of the file that would be modified,
... | [
"Update",
"the",
"license",
"statement",
"in",
"the",
"specified",
"file",
".",
"Parameters",
":",
"path",
":",
"path",
"of",
"the",
"C",
"++",
"source",
"file",
"to",
"update",
".",
"dry_run",
":",
"if",
"True",
"just",
"print",
"the",
"path",
"of",
"... | def update_license(path, dry_run, show_diff):
"""Update the license statement in the specified file.
Parameters:
path: path of the C++ source file to update.
dry_run: if True, just print the path of the file that would be updated,
but don't change it.
show_diff: if True, print t... | [
"def",
"update_license",
"(",
"path",
",",
"dry_run",
",",
"show_diff",
")",
":",
"with",
"open",
"(",
"path",
",",
"'rt'",
")",
"as",
"fin",
":",
"original_text",
"=",
"fin",
".",
"read",
"(",
")",
".",
"replace",
"(",
"'\\r\\n'",
",",
"'\\n'",
")",... | https://github.com/SOUI2/soui/blob/774e5566b2d3254a94f4b3efd55b982e7c665434/third-part/jsoncpp/devtools/licenseupdater.py#L16-L44 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | _VerboseLevel | () | return _cpplint_state.verbose_level | Returns the module's verbosity setting. | Returns the module's verbosity setting. | [
"Returns",
"the",
"module",
"s",
"verbosity",
"setting",
"."
] | def _VerboseLevel():
"""Returns the module's verbosity setting."""
return _cpplint_state.verbose_level | [
"def",
"_VerboseLevel",
"(",
")",
":",
"return",
"_cpplint_state",
".",
"verbose_level"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L641-L643 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/crf/python/ops/crf.py | python | crf_log_likelihood | (inputs,
tag_indices,
sequence_lengths,
transition_params=None) | return log_likelihood, transition_params | Computes the log-likelihood of tag sequences in a CRF.
Args:
inputs: A [batch_size, max_seq_len, num_tags] tensor of unary potentials
to use as input to the CRF layer.
tag_indices: A [batch_size, max_seq_len] matrix of tag indices for which we
compute the log-likelihood.
sequence_lengths:... | Computes the log-likelihood of tag sequences in a CRF. | [
"Computes",
"the",
"log",
"-",
"likelihood",
"of",
"tag",
"sequences",
"in",
"a",
"CRF",
"."
] | def crf_log_likelihood(inputs,
tag_indices,
sequence_lengths,
transition_params=None):
"""Computes the log-likelihood of tag sequences in a CRF.
Args:
inputs: A [batch_size, max_seq_len, num_tags] tensor of unary potentials
to use as ... | [
"def",
"crf_log_likelihood",
"(",
"inputs",
",",
"tag_indices",
",",
"sequence_lengths",
",",
"transition_params",
"=",
"None",
")",
":",
"# Get shape information.",
"num_tags",
"=",
"inputs",
".",
"get_shape",
"(",
")",
"[",
"2",
"]",
".",
"value",
"# Get the t... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/crf/python/ops/crf.py#L142-L174 | |
PyMesh/PyMesh | 384ba882b7558ba6e8653ed263c419226c22bddf | python/pymesh/Mesh.py | python | Mesh.has_attribute | (self, name) | return self.__mesh.has_attribute(name) | Check if an attribute exists. | Check if an attribute exists. | [
"Check",
"if",
"an",
"attribute",
"exists",
"."
] | def has_attribute(self, name):
""" Check if an attribute exists.
"""
return self.__mesh.has_attribute(name) | [
"def",
"has_attribute",
"(",
"self",
",",
"name",
")",
":",
"return",
"self",
".",
"__mesh",
".",
"has_attribute",
"(",
"name",
")"
] | https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/Mesh.py#L68-L71 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Material/MaterialEditor.py | python | MaterialEditor.expandKey | (self, key) | return nk | adds spaces before caps in a KeyName | adds spaces before caps in a KeyName | [
"adds",
"spaces",
"before",
"caps",
"in",
"a",
"KeyName"
] | def expandKey(self, key):
"adds spaces before caps in a KeyName"
nk = ""
for ln in key:
if ln.isupper():
if nk:
# this allows for series of caps, such as ProductURL
if not nk[-1].isupper():
nk += " "
... | [
"def",
"expandKey",
"(",
"self",
",",
"key",
")",
":",
"nk",
"=",
"\"\"",
"for",
"ln",
"in",
"key",
":",
"if",
"ln",
".",
"isupper",
"(",
")",
":",
"if",
"nk",
":",
"# this allows for series of caps, such as ProductURL",
"if",
"not",
"nk",
"[",
"-",
"1... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Material/MaterialEditor.py#L305-L315 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/valgrind/memcheck_analyze.py | python | MemcheckAnalyzer.Report | (self, files, testcase, check_sanity=False) | return 0 | Reads in a set of files and prints Memcheck report.
Args:
files: A list of filenames.
check_sanity: if true, search for SANITY_TEST_SUPPRESSIONS | Reads in a set of files and prints Memcheck report. | [
"Reads",
"in",
"a",
"set",
"of",
"files",
"and",
"prints",
"Memcheck",
"report",
"."
] | def Report(self, files, testcase, check_sanity=False):
'''Reads in a set of files and prints Memcheck report.
Args:
files: A list of filenames.
check_sanity: if true, search for SANITY_TEST_SUPPRESSIONS
'''
# Beyond the detailed errors parsed by ValgrindError above,
# the xml file conta... | [
"def",
"Report",
"(",
"self",
",",
"files",
",",
"testcase",
",",
"check_sanity",
"=",
"False",
")",
":",
"# Beyond the detailed errors parsed by ValgrindError above,",
"# the xml file contain records describing suppressions that were used:",
"# <suppcounts>",
"# <pair>",
"# ... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/valgrind/memcheck_analyze.py#L424-L614 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/misc_util.py | python | get_shared_lib_extension | (is_python_ext=False) | return so_ext | Return the correct file extension for shared libraries.
Parameters
----------
is_python_ext : bool, optional
Whether the shared library is a Python extension. Default is False.
Returns
-------
so_ext : str
The shared library extension.
Notes
-----
For Python share... | Return the correct file extension for shared libraries. | [
"Return",
"the",
"correct",
"file",
"extension",
"for",
"shared",
"libraries",
"."
] | def get_shared_lib_extension(is_python_ext=False):
"""Return the correct file extension for shared libraries.
Parameters
----------
is_python_ext : bool, optional
Whether the shared library is a Python extension. Default is False.
Returns
-------
so_ext : str
The shared li... | [
"def",
"get_shared_lib_extension",
"(",
"is_python_ext",
"=",
"False",
")",
":",
"confvars",
"=",
"distutils",
".",
"sysconfig",
".",
"get_config_vars",
"(",
")",
"# SO is deprecated in 3.3.1, use EXT_SUFFIX instead",
"so_ext",
"=",
"confvars",
".",
"get",
"(",
"'EXT_... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/misc_util.py#L648-L693 | |
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/tools/list_ports_common.py | python | numsplit | (text) | return result | \
Convert string into a list of texts and numbers in order to support a
natural sorting. | \
Convert string into a list of texts and numbers in order to support a
natural sorting. | [
"\\",
"Convert",
"string",
"into",
"a",
"list",
"of",
"texts",
"and",
"numbers",
"in",
"order",
"to",
"support",
"a",
"natural",
"sorting",
"."
] | def numsplit(text):
"""\
Convert string into a list of texts and numbers in order to support a
natural sorting.
"""
result = []
for group in re.split(r'(\d+)', text):
if group:
try:
group = int(group)
except ValueError:
pass
... | [
"def",
"numsplit",
"(",
"text",
")",
":",
"result",
"=",
"[",
"]",
"for",
"group",
"in",
"re",
".",
"split",
"(",
"r'(\\d+)'",
",",
"text",
")",
":",
"if",
"group",
":",
"try",
":",
"group",
"=",
"int",
"(",
"group",
")",
"except",
"ValueError",
... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/tools/list_ports_common.py#L15-L28 | |
notepadqq/notepadqq | d8000f256a516aa958d50bfcc19605dc296fbeb2 | .travis/tools/macdeployqtfix/macdeployqtfix.py | python | normalize_brew_name | (filename) | return brewlib, abspath, rpath | input: a path to a brew library, as returned by otool, that can have this form :
- an absolute path /usr/local/lib/yyy
output:
a tuple (brewlib, abspath, rpath) where:
- brewlib is the name of the brew lib
- abspath is the absolute path of the qt lib inside the app bundle... | input: a path to a brew library, as returned by otool, that can have this form :
- an absolute path /usr/local/lib/yyy
output:
a tuple (brewlib, abspath, rpath) where:
- brewlib is the name of the brew lib
- abspath is the absolute path of the qt lib inside the app bundle... | [
"input",
":",
"a",
"path",
"to",
"a",
"brew",
"library",
"as",
"returned",
"by",
"otool",
"that",
"can",
"have",
"this",
"form",
":",
"-",
"an",
"absolute",
"path",
"/",
"usr",
"/",
"local",
"/",
"lib",
"/",
"yyy",
"output",
":",
"a",
"tuple",
"(",... | def normalize_brew_name(filename):
"""
input: a path to a brew library, as returned by otool, that can have this form :
- an absolute path /usr/local/lib/yyy
output:
a tuple (brewlib, abspath, rpath) where:
- brewlib is the name of the brew lib
- abspath is the ab... | [
"def",
"normalize_brew_name",
"(",
"filename",
")",
":",
"GlobalConfig",
".",
"logger",
".",
"debug",
"(",
"'normalize_brew_name({0})'",
".",
"format",
"(",
"filename",
")",
")",
"brewlib_name_rgx",
"=",
"re",
".",
"compile",
"(",
"BREWLIB_REGEX",
")",
"rgxret",... | https://github.com/notepadqq/notepadqq/blob/d8000f256a516aa958d50bfcc19605dc296fbeb2/.travis/tools/macdeployqtfix/macdeployqtfix.py#L183-L218 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/dtypes.py | python | is_list_dtype | (obj) | return (
type(obj) is cudf.core.dtypes.ListDtype
or obj is cudf.core.dtypes.ListDtype
or type(obj) is cudf.core.column.ListColumn
or obj is cudf.core.column.ListColumn
or (isinstance(obj, str) and obj == cudf.core.dtypes.ListDtype.name)
or (hasattr(obj, "dtype") and is_li... | Check whether an array-like or dtype is of the list dtype.
Parameters
----------
obj : array-like or dtype
The array-like or dtype to check.
Returns
-------
bool
Whether or not the array-like or dtype is of the list dtype. | Check whether an array-like or dtype is of the list dtype. | [
"Check",
"whether",
"an",
"array",
"-",
"like",
"or",
"dtype",
"is",
"of",
"the",
"list",
"dtype",
"."
] | def is_list_dtype(obj):
"""Check whether an array-like or dtype is of the list dtype.
Parameters
----------
obj : array-like or dtype
The array-like or dtype to check.
Returns
-------
bool
Whether or not the array-like or dtype is of the list dtype.
"""
return (
... | [
"def",
"is_list_dtype",
"(",
"obj",
")",
":",
"return",
"(",
"type",
"(",
"obj",
")",
"is",
"cudf",
".",
"core",
".",
"dtypes",
".",
"ListDtype",
"or",
"obj",
"is",
"cudf",
".",
"core",
".",
"dtypes",
".",
"ListDtype",
"or",
"type",
"(",
"obj",
")"... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/dtypes.py#L596-L616 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | Grid.AutoSizeColumns | (*args, **kwargs) | return _grid.Grid_AutoSizeColumns(*args, **kwargs) | AutoSizeColumns(self, bool setAsMin=True) | AutoSizeColumns(self, bool setAsMin=True) | [
"AutoSizeColumns",
"(",
"self",
"bool",
"setAsMin",
"=",
"True",
")"
] | def AutoSizeColumns(*args, **kwargs):
"""AutoSizeColumns(self, bool setAsMin=True)"""
return _grid.Grid_AutoSizeColumns(*args, **kwargs) | [
"def",
"AutoSizeColumns",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_AutoSizeColumns",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L1890-L1892 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridRangeSelectEvent.CmdDown | (*args, **kwargs) | return _grid.GridRangeSelectEvent_CmdDown(*args, **kwargs) | CmdDown(self) -> bool | CmdDown(self) -> bool | [
"CmdDown",
"(",
"self",
")",
"-",
">",
"bool"
] | def CmdDown(*args, **kwargs):
"""CmdDown(self) -> bool"""
return _grid.GridRangeSelectEvent_CmdDown(*args, **kwargs) | [
"def",
"CmdDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridRangeSelectEvent_CmdDown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L2445-L2447 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/xcode_ninja.py | python | _TargetFromSpec | (old_spec, params) | return ninja_target | Create fake target for xcode-ninja wrapper. | Create fake target for xcode-ninja wrapper. | [
"Create",
"fake",
"target",
"for",
"xcode",
"-",
"ninja",
"wrapper",
"."
] | def _TargetFromSpec(old_spec, params):
""" Create fake target for xcode-ninja wrapper. """
# Determine ninja top level build dir (e.g. /path/to/out).
ninja_toplevel = None
jobs = 0
if params:
options = params['options']
ninja_toplevel = \
os.path.join(options.toplevel_dir,
... | [
"def",
"_TargetFromSpec",
"(",
"old_spec",
",",
"params",
")",
":",
"# Determine ninja top level build dir (e.g. /path/to/out).",
"ninja_toplevel",
"=",
"None",
"jobs",
"=",
"0",
"if",
"params",
":",
"options",
"=",
"params",
"[",
"'options'",
"]",
"ninja_toplevel",
... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/xcode_ninja.py#L56-L129 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/xrc.py | python | XmlResourceHandler.GetCurFileSystem | (*args, **kwargs) | return _xrc.XmlResourceHandler_GetCurFileSystem(*args, **kwargs) | GetCurFileSystem(self) -> FileSystem | GetCurFileSystem(self) -> FileSystem | [
"GetCurFileSystem",
"(",
"self",
")",
"-",
">",
"FileSystem"
] | def GetCurFileSystem(*args, **kwargs):
"""GetCurFileSystem(self) -> FileSystem"""
return _xrc.XmlResourceHandler_GetCurFileSystem(*args, **kwargs) | [
"def",
"GetCurFileSystem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResourceHandler_GetCurFileSystem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L733-L735 | |
HyeonwooNoh/caffe | d9e8494a2832d67b25dee37194c7bcb9d52d0e42 | scripts/cpp_lint.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",
"(",
"'test.cc'",
",",
"'regtest.cc'",
",",
"'unittest.cc'",
",",
"'inl.h'",
",",
"'impl.h'",
",",
"'internal.h'",
")",
":",
"if",
"(",
"filename",
".",
"endswith",
"(",
"suffix"... | https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/scripts/cpp_lint.py#L3576-L3600 | |
facebookarchive/LogDevice | ce7726050edc49a1e15d9160e81c890736b779e2 | logdevice/ops/ldshell/logdevice_plugin.py | python | LogDevicePlugin.create_usage_logger | (self, context) | return None | Override this and return you own usage logger.
Must be a subtype of UsageLoggerInterface. | Override this and return you own usage logger.
Must be a subtype of UsageLoggerInterface. | [
"Override",
"this",
"and",
"return",
"you",
"own",
"usage",
"logger",
".",
"Must",
"be",
"a",
"subtype",
"of",
"UsageLoggerInterface",
"."
] | def create_usage_logger(self, context):
"""
Override this and return you own usage logger.
Must be a subtype of UsageLoggerInterface.
"""
return None | [
"def",
"create_usage_logger",
"(",
"self",
",",
"context",
")",
":",
"return",
"None"
] | https://github.com/facebookarchive/LogDevice/blob/ce7726050edc49a1e15d9160e81c890736b779e2/logdevice/ops/ldshell/logdevice_plugin.py#L125-L130 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/aliaspass.py | python | _GetAliasForIdentifier | (identifier, alias_map) | Returns the aliased_symbol name for an identifier.
Example usage:
>>> alias_map = {'MyClass': 'goog.foo.MyClass'}
>>> _GetAliasForIdentifier('MyClass.prototype.action', alias_map)
'goog.foo.MyClass.prototype.action'
>>> _GetAliasForIdentifier('MyClass.prototype.action', {})
None
Args:
ide... | Returns the aliased_symbol name for an identifier. | [
"Returns",
"the",
"aliased_symbol",
"name",
"for",
"an",
"identifier",
"."
] | def _GetAliasForIdentifier(identifier, alias_map):
"""Returns the aliased_symbol name for an identifier.
Example usage:
>>> alias_map = {'MyClass': 'goog.foo.MyClass'}
>>> _GetAliasForIdentifier('MyClass.prototype.action', alias_map)
'goog.foo.MyClass.prototype.action'
>>> _GetAliasForIdentifier('... | [
"def",
"_GetAliasForIdentifier",
"(",
"identifier",
",",
"alias_map",
")",
":",
"ns",
"=",
"identifier",
".",
"split",
"(",
"'.'",
",",
"1",
")",
"[",
"0",
"]",
"aliased_symbol",
"=",
"alias_map",
".",
"get",
"(",
"ns",
")",
"if",
"aliased_symbol",
":",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/aliaspass.py#L35-L56 | ||
carla-simulator/carla | 8854804f4d7748e14d937ec763a2912823a7e5f5 | PythonAPI/examples/rss/rss_visualization.py | python | RssBoundingBoxVisualizer.get_bounding_box | (vehicle, camera_transform, calibration) | return camera_bbox | Returns 3D bounding box for a vehicle based on camera view. | Returns 3D bounding box for a vehicle based on camera view. | [
"Returns",
"3D",
"bounding",
"box",
"for",
"a",
"vehicle",
"based",
"on",
"camera",
"view",
"."
] | def get_bounding_box(vehicle, camera_transform, calibration):
"""
Returns 3D bounding box for a vehicle based on camera view.
"""
bb_cords = RssBoundingBoxVisualizer._create_bb_points(vehicle)
cords_x_y_z = RssBoundingBoxVisualizer._vehicle_to_sensor(bb_cords, vehicle, camera_tr... | [
"def",
"get_bounding_box",
"(",
"vehicle",
",",
"camera_transform",
",",
"calibration",
")",
":",
"bb_cords",
"=",
"RssBoundingBoxVisualizer",
".",
"_create_bb_points",
"(",
"vehicle",
")",
"cords_x_y_z",
"=",
"RssBoundingBoxVisualizer",
".",
"_vehicle_to_sensor",
"(",
... | https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/examples/rss/rss_visualization.py#L520-L530 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_gui/reduction/scripter.py | python | BaseReductionScripter.apply | (self) | Apply the reduction process to a Mantid SANSReducer | Apply the reduction process to a Mantid SANSReducer | [
"Apply",
"the",
"reduction",
"process",
"to",
"a",
"Mantid",
"SANSReducer"
] | def apply(self):
"""
Apply the reduction process to a Mantid SANSReducer
"""
if HAS_MANTID:
script = self.to_script(None)
try:
self.execute_script(script)
# Update scripter
for item in self._observers:
... | [
"def",
"apply",
"(",
"self",
")",
":",
"if",
"HAS_MANTID",
":",
"script",
"=",
"self",
".",
"to_script",
"(",
"None",
")",
"try",
":",
"self",
".",
"execute_script",
"(",
"script",
")",
"# Update scripter",
"for",
"item",
"in",
"self",
".",
"_observers",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/scripter.py#L569-L592 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenuBar.PopupMoreMenu | (self) | Pops up the 'more' menu. | Pops up the 'more' menu. | [
"Pops",
"up",
"the",
"more",
"menu",
"."
] | def PopupMoreMenu(self):
""" Pops up the 'more' menu. """
if (not self._showCustomize) and self.GetInvisibleMenuItemCount() + self.GetInvisibleToolbarItemCount() < 1:
return
self.CreateMoreMenu()
pt = self._dropDownButtonArea.GetTopLeft()
pt = self.ClientTo... | [
"def",
"PopupMoreMenu",
"(",
"self",
")",
":",
"if",
"(",
"not",
"self",
".",
"_showCustomize",
")",
"and",
"self",
".",
"GetInvisibleMenuItemCount",
"(",
")",
"+",
"self",
".",
"GetInvisibleToolbarItemCount",
"(",
")",
"<",
"1",
":",
"return",
"self",
"."... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L3621-L3632 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py | python | Mozilla_suite_Events.Read_help_file | (self, _object, _attributes={}, **_arguments) | Read help file: Reads in the help file (file should be in the help file format)
Required argument: undocumented, typecode 'alis'
Keyword argument with_index: Index to the help file. Defaults to \xd4DEFAULT\xd5)
Keyword argument search_text: Optional text to search for
Keyword argument _... | Read help file: Reads in the help file (file should be in the help file format)
Required argument: undocumented, typecode 'alis'
Keyword argument with_index: Index to the help file. Defaults to \xd4DEFAULT\xd5)
Keyword argument search_text: Optional text to search for
Keyword argument _... | [
"Read",
"help",
"file",
":",
"Reads",
"in",
"the",
"help",
"file",
"(",
"file",
"should",
"be",
"in",
"the",
"help",
"file",
"format",
")",
"Required",
"argument",
":",
"undocumented",
"typecode",
"alis",
"Keyword",
"argument",
"with_index",
":",
"Index",
... | def Read_help_file(self, _object, _attributes={}, **_arguments):
"""Read help file: Reads in the help file (file should be in the help file format)
Required argument: undocumented, typecode 'alis'
Keyword argument with_index: Index to the help file. Defaults to \xd4DEFAULT\xd5)
Keyword ... | [
"def",
"Read_help_file",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'MOSS'",
"_subcode",
"=",
"'help'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_R... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/Netscape/Mozilla_suite.py#L204-L224 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | ext/ply/example/ansic/cparse.py | python | p_selection_statement_2 | (t) | selection_statement : IF LPAREN expression RPAREN statement ELSE statement | selection_statement : IF LPAREN expression RPAREN statement ELSE statement | [
"selection_statement",
":",
"IF",
"LPAREN",
"expression",
"RPAREN",
"statement",
"ELSE",
"statement"
] | def p_selection_statement_2(t):
'selection_statement : IF LPAREN expression RPAREN statement ELSE statement '
pass | [
"def",
"p_selection_statement_2",
"(",
"t",
")",
":",
"pass"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/ext/ply/example/ansic/cparse.py#L517-L519 | ||
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/serverui/sdhashsrv/sdhashsrv.py | python | Iface.createResultID | (self, user) | Parameters:
- user | Parameters:
- user | [
"Parameters",
":",
"-",
"user"
] | def createResultID(self, user):
"""
Parameters:
- user
"""
pass | [
"def",
"createResultID",
"(",
"self",
",",
"user",
")",
":",
"pass"
] | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/serverui/sdhashsrv/sdhashsrv.py#L123-L128 | ||
wpilibsuite/allwpilib | 3411eee20ff3126172585fc9fcbcaa04d56a4cc5 | upstream_utils/upstream_utils.py | python | copy_to | (files, root) | return dest_files | Copies list of files to root by appending the relative paths of the files
to root.
The leading directories of root will be created if they don't yet exist.
Keyword arguments:
files -- list of files to copy
root -- destination
Returns:
The list of files in their destination. | Copies list of files to root by appending the relative paths of the files
to root. | [
"Copies",
"list",
"of",
"files",
"to",
"root",
"by",
"appending",
"the",
"relative",
"paths",
"of",
"the",
"files",
"to",
"root",
"."
] | def copy_to(files, root):
"""Copies list of files to root by appending the relative paths of the files
to root.
The leading directories of root will be created if they don't yet exist.
Keyword arguments:
files -- list of files to copy
root -- destination
Returns:
The list of files in ... | [
"def",
"copy_to",
"(",
"files",
",",
"root",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"root",
")",
":",
"os",
".",
"makedirs",
"(",
"root",
")",
"dest_files",
"=",
"[",
"]",
"for",
"f",
"in",
"files",
":",
"dest_file",
"=",
... | https://github.com/wpilibsuite/allwpilib/blob/3411eee20ff3126172585fc9fcbcaa04d56a4cc5/upstream_utils/upstream_utils.py#L98-L129 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/pydoc.py | python | pager | (text) | The first time this is called, determine what kind of pager to use. | The first time this is called, determine what kind of pager to use. | [
"The",
"first",
"time",
"this",
"is",
"called",
"determine",
"what",
"kind",
"of",
"pager",
"to",
"use",
"."
] | def pager(text):
"""The first time this is called, determine what kind of pager to use."""
global pager
pager = getpager()
pager(text) | [
"def",
"pager",
"(",
"text",
")",
":",
"global",
"pager",
"pager",
"=",
"getpager",
"(",
")",
"pager",
"(",
"text",
")"
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/pydoc.py#L1310-L1314 | ||
SpaceNetChallenge/BuildingDetectors | 3def3c44b5847c744cd2f3356182892d92496579 | qinhaifang/src/lib/mnc_config.py | python | get_output_dir | (imdb, net) | Return the directory where experimental artifacts are placed.
A canonical path is built using the name from an imdb and a network
(if not None). | Return the directory where experimental artifacts are placed.
A canonical path is built using the name from an imdb and a network
(if not None). | [
"Return",
"the",
"directory",
"where",
"experimental",
"artifacts",
"are",
"placed",
".",
"A",
"canonical",
"path",
"is",
"built",
"using",
"the",
"name",
"from",
"an",
"imdb",
"and",
"a",
"network",
"(",
"if",
"not",
"None",
")",
"."
] | def get_output_dir(imdb, net):
""" Return the directory where experimental artifacts are placed.
A canonical path is built using the name from an imdb and a network
(if not None).
"""
path = os.path.abspath(os.path.join(__C.ROOT_DIR, 'output', __C.EXP_DIR, imdb.name))
if net is None:
... | [
"def",
"get_output_dir",
"(",
"imdb",
",",
"net",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"__C",
".",
"ROOT_DIR",
",",
"'output'",
",",
"__C",
".",
"EXP_DIR",
",",
"imdb",
".",
"name",
"... | https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/lib/mnc_config.py#L159-L168 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/arrayprint.py | python | _recursive_guard | (fillvalue='...') | return decorating_function | Like the python 3.2 reprlib.recursive_repr, but forwards *args and **kwargs
Decorates a function such that if it calls itself with the same first
argument, it returns `fillvalue` instead of recursing.
Largely copied from reprlib.recursive_repr | Like the python 3.2 reprlib.recursive_repr, but forwards *args and **kwargs | [
"Like",
"the",
"python",
"3",
".",
"2",
"reprlib",
".",
"recursive_repr",
"but",
"forwards",
"*",
"args",
"and",
"**",
"kwargs"
] | def _recursive_guard(fillvalue='...'):
"""
Like the python 3.2 reprlib.recursive_repr, but forwards *args and **kwargs
Decorates a function such that if it calls itself with the same first
argument, it returns `fillvalue` instead of recursing.
Largely copied from reprlib.recursive_repr
"""
... | [
"def",
"_recursive_guard",
"(",
"fillvalue",
"=",
"'...'",
")",
":",
"def",
"decorating_function",
"(",
"f",
")",
":",
"repr_running",
"=",
"set",
"(",
")",
"@",
"functools",
".",
"wraps",
"(",
"f",
")",
"def",
"wrapper",
"(",
"self",
",",
"*",
"args",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/arrayprint.py#L464-L490 | |
google/tink | 59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14 | python/tink/core/_primitive_set.py | python | PrimitiveSet.primitive | (self, key: tink_pb2.Keyset.Key) | return self.primitive_from_identifier(_crypto_format.output_prefix(key)) | Returns a copy of the list of entries for a given key. | Returns a copy of the list of entries for a given key. | [
"Returns",
"a",
"copy",
"of",
"the",
"list",
"of",
"entries",
"for",
"a",
"given",
"key",
"."
] | def primitive(self, key: tink_pb2.Keyset.Key) -> List[Entry]:
"""Returns a copy of the list of entries for a given key."""
return self.primitive_from_identifier(_crypto_format.output_prefix(key)) | [
"def",
"primitive",
"(",
"self",
",",
"key",
":",
"tink_pb2",
".",
"Keyset",
".",
"Key",
")",
"->",
"List",
"[",
"Entry",
"]",
":",
"return",
"self",
".",
"primitive_from_identifier",
"(",
"_crypto_format",
".",
"output_prefix",
"(",
"key",
")",
")"
] | https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/core/_primitive_set.py#L64-L66 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | tools/mo/openvino/tools/mo/ops/einsum.py | python | Einsum.normalize_equation | (node_name: str, equation: str) | return ','.join(input_subscripts_list) + "->" + output_subscript | Recover explicit mode of equation.
:param node_name: Einsum node name for which to recover explicit mode
:param equation: Einsum equation to recover explicit mode
:return: Recovered equation in explicit mode | Recover explicit mode of equation. | [
"Recover",
"explicit",
"mode",
"of",
"equation",
"."
] | def normalize_equation(node_name: str, equation: str) -> str:
"""
Recover explicit mode of equation.
:param node_name: Einsum node name for which to recover explicit mode
:param equation: Einsum equation to recover explicit mode
:return: Recovered equation in explicit mode
... | [
"def",
"normalize_equation",
"(",
"node_name",
":",
"str",
",",
"equation",
":",
"str",
")",
"->",
"str",
":",
"input_subscripts_list",
",",
"output_subscript",
"=",
"Einsum",
".",
"parse_equation",
"(",
"node_name",
",",
"equation",
")",
"return",
"','",
".",... | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/ops/einsum.py#L105-L114 | |
chuckcho/video-caffe | fc232b3e3a90ea22dd041b9fc5c542f170581f20 | python/caffe/pycaffe.py | python | _Net_set_input_arrays | (self, data, labels) | return self._set_input_arrays(data, labels) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.) | [
"Set",
"input",
"arrays",
"of",
"the",
"in",
"-",
"memory",
"MemoryDataLayer",
".",
"(",
"Note",
":",
"this",
"is",
"only",
"for",
"networks",
"declared",
"with",
"the",
"memory",
"data",
"layer",
".",
")"
] | def _Net_set_input_arrays(self, data, labels):
"""
Set input arrays of the in-memory MemoryDataLayer.
(Note: this is only for networks declared with the memory data layer.)
"""
if labels.ndim == 1:
labels = np.ascontiguousarray(labels[:, np.newaxis, np.newaxis,
... | [
"def",
"_Net_set_input_arrays",
"(",
"self",
",",
"data",
",",
"labels",
")",
":",
"if",
"labels",
".",
"ndim",
"==",
"1",
":",
"labels",
"=",
"np",
".",
"ascontiguousarray",
"(",
"labels",
"[",
":",
",",
"np",
".",
"newaxis",
",",
"np",
".",
"newaxi... | https://github.com/chuckcho/video-caffe/blob/fc232b3e3a90ea22dd041b9fc5c542f170581f20/python/caffe/pycaffe.py#L261-L269 | |
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/cti2yaml.py | python | dataset | (nm) | Set the dataset name. Invoke this to change the name of the YAML file. | Set the dataset name. Invoke this to change the name of the YAML file. | [
"Set",
"the",
"dataset",
"name",
".",
"Invoke",
"this",
"to",
"change",
"the",
"name",
"of",
"the",
"YAML",
"file",
"."
] | def dataset(nm):
"Set the dataset name. Invoke this to change the name of the YAML file."
global _name
_name = nm | [
"def",
"dataset",
"(",
"nm",
")",
":",
"global",
"_name",
"_name",
"=",
"nm"
] | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/cti2yaml.py#L169-L172 | ||
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | clang/utils/check_cfc/check_cfc.py | python | is_output_specified | (args) | return get_output_file(args) is not None | Return true is output file is specified in args. | Return true is output file is specified in args. | [
"Return",
"true",
"is",
"output",
"file",
"is",
"specified",
"in",
"args",
"."
] | def is_output_specified(args):
"""Return true is output file is specified in args."""
return get_output_file(args) is not None | [
"def",
"is_output_specified",
"(",
"args",
")",
":",
"return",
"get_output_file",
"(",
"args",
")",
"is",
"not",
"None"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/clang/utils/check_cfc/check_cfc.py#L147-L149 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/aicpu/cast.py | python | _cast_aicpu | () | return | Cast AiCPU register | Cast AiCPU register | [
"Cast",
"AiCPU",
"register"
] | def _cast_aicpu():
"""Cast AiCPU register"""
return | [
"def",
"_cast_aicpu",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/aicpu/cast.py#L171-L173 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/quantized/modules/embedding_ops.py | python | Embedding.from_float | (cls, mod) | return qembedding | r"""Create a quantized embedding module from a float module
Args:
mod (Module): a float module, either produced by torch.ao.quantization
utilities or provided by user | r"""Create a quantized embedding module from a float module | [
"r",
"Create",
"a",
"quantized",
"embedding",
"module",
"from",
"a",
"float",
"module"
] | def from_float(cls, mod):
r"""Create a quantized embedding module from a float module
Args:
mod (Module): a float module, either produced by torch.ao.quantization
utilities or provided by user
"""
if hasattr(mod, 'weight_fake_quant'):
as... | [
"def",
"from_float",
"(",
"cls",
",",
"mod",
")",
":",
"if",
"hasattr",
"(",
"mod",
",",
"'weight_fake_quant'",
")",
":",
"assert",
"type",
"(",
"mod",
")",
"==",
"nn",
".",
"qat",
".",
"Embedding",
",",
"'nnq.'",
"+",
"cls",
".",
"__name__",
"+",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/quantized/modules/embedding_ops.py#L138-L175 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py | python | MainWindow.do_switch_tab_peak_int | (self) | Switch to tab 'Peak Integration' to set up and learn how to do peak integration
:return: | Switch to tab 'Peak Integration' to set up and learn how to do peak integration
:return: | [
"Switch",
"to",
"tab",
"Peak",
"Integration",
"to",
"set",
"up",
"and",
"learn",
"how",
"to",
"do",
"peak",
"integration",
":",
"return",
":"
] | def do_switch_tab_peak_int(self):
""" Switch to tab 'Peak Integration' to set up and learn how to do peak integration
:return:
"""
# switch tab
self.ui.tabWidget.setCurrentIndex(MainWindow.TabPage['Peak Integration'])
# set up value
selected_scans = self.ui.table... | [
"def",
"do_switch_tab_peak_int",
"(",
"self",
")",
":",
"# switch tab",
"self",
".",
"ui",
".",
"tabWidget",
".",
"setCurrentIndex",
"(",
"MainWindow",
".",
"TabPage",
"[",
"'Peak Integration'",
"]",
")",
"# set up value",
"selected_scans",
"=",
"self",
".",
"ui... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L3039-L3050 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py | python | SocketHandler.send | (self, s) | Send a pickled string to the socket.
This function allows for partial sends which can happen when the
network is busy. | Send a pickled string to the socket. | [
"Send",
"a",
"pickled",
"string",
"to",
"the",
"socket",
"."
] | def send(self, s):
"""
Send a pickled string to the socket.
This function allows for partial sends which can happen when the
network is busy.
"""
if self.sock is None:
self.createSocket()
#self.sock can be None either because we haven't reached the re... | [
"def",
"send",
"(",
"self",
",",
"s",
")",
":",
"if",
"self",
".",
"sock",
"is",
"None",
":",
"self",
".",
"createSocket",
"(",
")",
"#self.sock can be None either because we haven't reached the retry",
"#time yet, or because we have reached the retry time and retried,",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/handlers.py#L566-L583 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/core/display.py | python | display_svg | (*objs, **kwargs) | Display the SVG representation of an object.
Parameters
----------
*objs : object
The Python objects to display, or if raw=True raw svg data to
display.
raw : bool
Are the data objects raw data or Python objects that need to be
formatted before display? [default: False]
... | Display the SVG representation of an object. | [
"Display",
"the",
"SVG",
"representation",
"of",
"an",
"object",
"."
] | def display_svg(*objs, **kwargs):
"""Display the SVG representation of an object.
Parameters
----------
*objs : object
The Python objects to display, or if raw=True raw svg data to
display.
raw : bool
Are the data objects raw data or Python objects that need to be
fo... | [
"def",
"display_svg",
"(",
"*",
"objs",
",",
"*",
"*",
"kwargs",
")",
":",
"_display_mimetype",
"(",
"'image/svg+xml'",
",",
"objs",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/display.py#L458-L472 | ||
Xilinx/XRT | dd071c90309df61d3ecdd92dca39f43804915c99 | src/python/xrt_binding.py | python | xclMapBO | (handle, boHandle, write) | return ptr | Memory map BO into user's address space
:param handle: (xclDeviceHandle) device handle
:param boHandle: (unsigned int) BO handle
:param write: (boolean) READ only or READ/WRITE mapping
:return: (pointer) Memory mapped buffer
Map the contents of the buffer object into host memory
To unmap the b... | Memory map BO into user's address space | [
"Memory",
"map",
"BO",
"into",
"user",
"s",
"address",
"space"
] | def xclMapBO(handle, boHandle, write):
"""
Memory map BO into user's address space
:param handle: (xclDeviceHandle) device handle
:param boHandle: (unsigned int) BO handle
:param write: (boolean) READ only or READ/WRITE mapping
:return: (pointer) Memory mapped buffer
Map the contents of th... | [
"def",
"xclMapBO",
"(",
"handle",
",",
"boHandle",
",",
"write",
")",
":",
"_xclDeprecation",
"(",
"sys",
".",
"_getframe",
"(",
")",
".",
"f_code",
".",
"co_name",
")",
"libcore",
".",
"xclMapBO",
".",
"restype",
"=",
"ctypes",
".",
"POINTER",
"(",
"c... | https://github.com/Xilinx/XRT/blob/dd071c90309df61d3ecdd92dca39f43804915c99/src/python/xrt_binding.py#L462-L481 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2.py | python | xmlNode.setContent | (self, content) | Replace the content of a node. NOTE: @content is supposed
to be a piece of XML CDATA, so it allows entity references,
but XML special chars need to be escaped first by using
xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). | Replace the content of a node. NOTE: | [
"Replace",
"the",
"content",
"of",
"a",
"node",
".",
"NOTE",
":"
] | def setContent(self, content):
"""Replace the content of a node. NOTE: @content is supposed
to be a piece of XML CDATA, so it allows entity references,
but XML special chars need to be escaped first by using
xmlEncodeEntitiesReentrant() resp. xmlEncodeSpecialChars(). """
l... | [
"def",
"setContent",
"(",
"self",
",",
"content",
")",
":",
"libxml2mod",
".",
"xmlNodeSetContent",
"(",
"self",
".",
"_o",
",",
"content",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L3533-L3538 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/distributed/fleet/base/distributed_strategy.py | python | DistributedStrategy.lars_configs | (self) | return get_msg_dict(self.strategy.lars_configs) | Set Lars training configurations.
**Notes**:
**lars_coeff (float)**: trust ratio in lars formula.
**lars_weight_decay** (float): weight decay coefficient in lars formula.
**epsilon (float)**: argument is used to avoid potential devision-by-zero
when compute the local lr;
... | Set Lars training configurations. | [
"Set",
"Lars",
"training",
"configurations",
"."
] | def lars_configs(self):
"""
Set Lars training configurations.
**Notes**:
**lars_coeff (float)**: trust ratio in lars formula.
**lars_weight_decay** (float): weight decay coefficient in lars formula.
**epsilon (float)**: argument is used to avoid potential devision-by-zer... | [
"def",
"lars_configs",
"(",
"self",
")",
":",
"return",
"get_msg_dict",
"(",
"self",
".",
"strategy",
".",
"lars_configs",
")"
] | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/fleet/base/distributed_strategy.py#L1571-L1597 | |
nest/nest-simulator | f2623eb78518cdbd55e77e0ed486bf1111bcb62f | pynest/nest/lib/hl_api_simulation.py | python | Install | (module_name) | return sr("(%s) Install" % module_name) | Load a dynamically linked NEST module.
Parameters
----------
module_name : str
Name of the dynamically linked module
Returns
-------
handle
NEST module identifier, required for unloading
Notes
-----
Dynamically linked modules are searched in the NEST library
di... | Load a dynamically linked NEST module. | [
"Load",
"a",
"dynamically",
"linked",
"NEST",
"module",
"."
] | def Install(module_name):
"""Load a dynamically linked NEST module.
Parameters
----------
module_name : str
Name of the dynamically linked module
Returns
-------
handle
NEST module identifier, required for unloading
Notes
-----
Dynamically linked modules are se... | [
"def",
"Install",
"(",
"module_name",
")",
":",
"return",
"sr",
"(",
"\"(%s) Install\"",
"%",
"module_name",
")"
] | https://github.com/nest/nest-simulator/blob/f2623eb78518cdbd55e77e0ed486bf1111bcb62f/pynest/nest/lib/hl_api_simulation.py#L296-L322 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exodus2.in.py | python | exodus.put_global_variable_name | (self, name, index) | return True | status = exo.put_global_variable_name(gvar_name, gvar_index)
-> add the name and index of a new global variable to the model;
global variable indexing goes from 1 to
exo.get_global_variable_number()
input value(s):
<string> gvar_name name of new global variab... | status = exo.put_global_variable_name(gvar_name, gvar_index) | [
"status",
"=",
"exo",
".",
"put_global_variable_name",
"(",
"gvar_name",
"gvar_index",
")"
] | def put_global_variable_name(self, name, index):
"""
status = exo.put_global_variable_name(gvar_name, gvar_index)
-> add the name and index of a new global variable to the model;
global variable indexing goes from 1 to
exo.get_global_variable_number()
input ... | [
"def",
"put_global_variable_name",
"(",
"self",
",",
"name",
",",
"index",
")",
":",
"gbType",
"=",
"ex_entity_type",
"(",
"\"EX_GLOBAL\"",
")",
"GlobVarNames",
"=",
"self",
".",
"get_global_variable_names",
"(",
")",
"if",
"name",
"in",
"GlobVarNames",
":",
"... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L3138-L3169 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/fft/fftpack.py | python | irfft | (a, n=None, axis=-1, norm=None) | return output * (1 / (sqrt(n) if unitary else n)) | Compute the inverse of the n-point DFT for real input.
This function computes the inverse of the one-dimensional *n*-point
discrete Fourier Transform of real input computed by `rfft`.
In other words, ``irfft(rfft(a), len(a)) == a`` to within numerical
accuracy. (See Notes below for why ``len(a)`` is ne... | Compute the inverse of the n-point DFT for real input. | [
"Compute",
"the",
"inverse",
"of",
"the",
"n",
"-",
"point",
"DFT",
"for",
"real",
"input",
"."
] | def irfft(a, n=None, axis=-1, norm=None):
"""
Compute the inverse of the n-point DFT for real input.
This function computes the inverse of the one-dimensional *n*-point
discrete Fourier Transform of real input computed by `rfft`.
In other words, ``irfft(rfft(a), len(a)) == a`` to within numerical
... | [
"def",
"irfft",
"(",
"a",
",",
"n",
"=",
"None",
",",
"axis",
"=",
"-",
"1",
",",
"norm",
"=",
"None",
")",
":",
"# The copy may be required for multithreading.",
"a",
"=",
"array",
"(",
"a",
",",
"copy",
"=",
"True",
",",
"dtype",
"=",
"complex",
")... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/fft/fftpack.py#L398-L485 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib2.py | python | HTTPRedirectHandler.redirect_request | (self, req, fp, code, msg, headers, newurl) | Return a Request or None in response to a redirect.
This is called by the http_error_30x methods when a
redirection response is received. If a redirection should
take place, return a new Request to allow http_error_30x to
perform the redirect. Otherwise, raise HTTPError if no-one
... | Return a Request or None in response to a redirect. | [
"Return",
"a",
"Request",
"or",
"None",
"in",
"response",
"to",
"a",
"redirect",
"."
] | def redirect_request(self, req, fp, code, msg, headers, newurl):
"""Return a Request or None in response to a redirect.
This is called by the http_error_30x methods when a
redirection response is received. If a redirection should
take place, return a new Request to allow http_error_30x... | [
"def",
"redirect_request",
"(",
"self",
",",
"req",
",",
"fp",
",",
"code",
",",
"msg",
",",
"headers",
",",
"newurl",
")",
":",
"m",
"=",
"req",
".",
"get_method",
"(",
")",
"if",
"(",
"code",
"in",
"(",
"301",
",",
"302",
",",
"303",
",",
"30... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib2.py#L541-L569 | ||
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/mox.py | python | MockMethod.__init__ | (self, method_name, call_queue, replay_mode) | Construct a new mock method.
Args:
# method_name: the name of the method
# call_queue: deque of calls, verify this call against the head, or add
# this call to the queue.
# replay_mode: False if we are recording, True if we are verifying calls
# against the call queue.
m... | Construct a new mock method. | [
"Construct",
"a",
"new",
"mock",
"method",
"."
] | def __init__(self, method_name, call_queue, replay_mode):
"""Construct a new mock method.
Args:
# method_name: the name of the method
# call_queue: deque of calls, verify this call against the head, or add
# this call to the queue.
# replay_mode: False if we are recording, True if w... | [
"def",
"__init__",
"(",
"self",
",",
"method_name",
",",
"call_queue",
",",
"replay_mode",
")",
":",
"self",
".",
"_name",
"=",
"method_name",
"self",
".",
"_call_queue",
"=",
"call_queue",
"if",
"not",
"isinstance",
"(",
"call_queue",
",",
"deque",
")",
"... | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/mox.py#L519-L543 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/training/basic_loops.py | python | basic_train_loop | (supervisor, train_step_fn, args=None,
kwargs=None, master="") | Basic loop to train a model.
Calls `train_step_fn` in a loop to train a model. The function is called as:
```python
train_step_fn(session, *args, **kwargs)
```
It is passed a `tf.Session` in addition to `args` and `kwargs`. The function
typically runs one training step in the session.
Args:
supe... | Basic loop to train a model. | [
"Basic",
"loop",
"to",
"train",
"a",
"model",
"."
] | def basic_train_loop(supervisor, train_step_fn, args=None,
kwargs=None, master=""):
"""Basic loop to train a model.
Calls `train_step_fn` in a loop to train a model. The function is called as:
```python
train_step_fn(session, *args, **kwargs)
```
It is passed a `tf.Session` in addit... | [
"def",
"basic_train_loop",
"(",
"supervisor",
",",
"train_step_fn",
",",
"args",
"=",
"None",
",",
"kwargs",
"=",
"None",
",",
"master",
"=",
"\"\"",
")",
":",
"if",
"args",
"is",
"None",
":",
"args",
"=",
"[",
"]",
"if",
"kwargs",
"is",
"None",
":",... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/basic_loops.py#L23-L59 | ||
ComputationalRadiationPhysics/picongpu | 59e9b53605f9a5c1bf271eeb055bc74370a99052 | lib/python/picongpu/plugins/data/radiation.py | python | RadiationData.get_Polarization_Z | (self) | return np.abs(self.get_Amplitude_z())**2 | Returns real spectra for z-polarization in [Js]. | Returns real spectra for z-polarization in [Js]. | [
"Returns",
"real",
"spectra",
"for",
"z",
"-",
"polarization",
"in",
"[",
"Js",
"]",
"."
] | def get_Polarization_Z(self):
"""Returns real spectra for z-polarization in [Js]."""
return np.abs(self.get_Amplitude_z())**2 | [
"def",
"get_Polarization_Z",
"(",
"self",
")",
":",
"return",
"np",
".",
"abs",
"(",
"self",
".",
"get_Amplitude_z",
"(",
")",
")",
"**",
"2"
] | https://github.com/ComputationalRadiationPhysics/picongpu/blob/59e9b53605f9a5c1bf271eeb055bc74370a99052/lib/python/picongpu/plugins/data/radiation.py#L99-L101 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.GetTextLength | (*args, **kwargs) | return _stc.StyledTextCtrl_GetTextLength(*args, **kwargs) | GetTextLength(self) -> int
Retrieve the number of characters in the document. | GetTextLength(self) -> int | [
"GetTextLength",
"(",
"self",
")",
"-",
">",
"int"
] | def GetTextLength(*args, **kwargs):
"""
GetTextLength(self) -> int
Retrieve the number of characters in the document.
"""
return _stc.StyledTextCtrl_GetTextLength(*args, **kwargs) | [
"def",
"GetTextLength",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetTextLength",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L3673-L3679 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py | python | _GenerateMSVSProject | (project, options, version, generator_flags) | return missing_sources | Generates a .vcproj file. It may create .rules and .user files too.
Arguments:
project: The project object we will generate the file for.
options: Global options passed to the generator.
version: The VisualStudioVersion object.
generator_flags: dict of generator-specific flags. | Generates a .vcproj file. It may create .rules and .user files too. | [
"Generates",
"a",
".",
"vcproj",
"file",
".",
"It",
"may",
"create",
".",
"rules",
"and",
".",
"user",
"files",
"too",
"."
] | def _GenerateMSVSProject(project, options, version, generator_flags):
"""Generates a .vcproj file. It may create .rules and .user files too.
Arguments:
project: The project object we will generate the file for.
options: Global options passed to the generator.
version: The VisualStudioVersion object.
... | [
"def",
"_GenerateMSVSProject",
"(",
"project",
",",
"options",
",",
"version",
",",
"generator_flags",
")",
":",
"spec",
"=",
"project",
".",
"spec",
"vcproj_dir",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"project",
".",
"path",
")",
"if",
"vcproj_dir"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/msvs.py#L883-L946 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/combotreebox.py | python | BaseComboTreeBox.FindClientData | (self, clientData, parent=None) | return child | Finds the *first* item in the tree with client data equal to the
given clientData. If no such item exists, an invalid item is
returned.
:param PyObject `clientData`: the client data to find
:keyword TreeItemId `parent`: :class:`TreeItemId` parent or None
:return: :class... | Finds the *first* item in the tree with client data equal to the
given clientData. If no such item exists, an invalid item is
returned.
:param PyObject `clientData`: the client data to find
:keyword TreeItemId `parent`: :class:`TreeItemId` parent or None
:return: :class... | [
"Finds",
"the",
"*",
"first",
"*",
"item",
"in",
"the",
"tree",
"with",
"client",
"data",
"equal",
"to",
"the",
"given",
"clientData",
".",
"If",
"no",
"such",
"item",
"exists",
"an",
"invalid",
"item",
"is",
"returned",
".",
":",
"param",
"PyObject",
... | def FindClientData(self, clientData, parent=None):
"""
Finds the *first* item in the tree with client data equal to the
given clientData. If no such item exists, an invalid item is
returned.
:param PyObject `clientData`: the client data to find
:keyword TreeIte... | [
"def",
"FindClientData",
"(",
"self",
",",
"clientData",
",",
"parent",
"=",
"None",
")",
":",
"parent",
"=",
"parent",
"or",
"self",
".",
"_tree",
".",
"GetRootItem",
"(",
")",
"child",
",",
"cookie",
"=",
"self",
".",
"_tree",
".",
"GetFirstChild",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/combotreebox.py#L464-L486 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/cluster/hierarchy.py | python | is_valid_linkage | (Z, warning=False, throw=False, name=None) | return valid | Check the validity of a linkage matrix.
A linkage matrix is valid if it is a two dimensional array (type double)
with :math:`n` rows and 4 columns. The first two columns must contain
indices between 0 and :math:`2n-1`. For a given row ``i``, the following
two expressions have to hold:
.. math::
... | Check the validity of a linkage matrix. | [
"Check",
"the",
"validity",
"of",
"a",
"linkage",
"matrix",
"."
] | def is_valid_linkage(Z, warning=False, throw=False, name=None):
"""
Check the validity of a linkage matrix.
A linkage matrix is valid if it is a two dimensional array (type double)
with :math:`n` rows and 4 columns. The first two columns must contain
indices between 0 and :math:`2n-1`. For a given... | [
"def",
"is_valid_linkage",
"(",
"Z",
",",
"warning",
"=",
"False",
",",
"throw",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"Z",
"=",
"np",
".",
"asarray",
"(",
"Z",
",",
"order",
"=",
"'c'",
")",
"valid",
"=",
"True",
"name_str",
"=",
"\"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/cluster/hierarchy.py#L2216-L2338 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | build/checksums.py | python | process_files | (files, output_filename, digests, strip) | This function takes a list of file names, 'files'. It will then
compute the checksum for each of the files by opening the files.
Once each file is read and its checksum is computed, this function
will write the information to the file specified by 'output_filename'.
The path written in the output file ... | This function takes a list of file names, 'files'. It will then
compute the checksum for each of the files by opening the files.
Once each file is read and its checksum is computed, this function
will write the information to the file specified by 'output_filename'.
The path written in the output file ... | [
"This",
"function",
"takes",
"a",
"list",
"of",
"file",
"names",
"files",
".",
"It",
"will",
"then",
"compute",
"the",
"checksum",
"for",
"each",
"of",
"the",
"files",
"by",
"opening",
"the",
"files",
".",
"Once",
"each",
"file",
"is",
"read",
"and",
"... | def process_files(files, output_filename, digests, strip):
'''This function takes a list of file names, 'files'. It will then
compute the checksum for each of the files by opening the files.
Once each file is read and its checksum is computed, this function
will write the information to the file specif... | [
"def",
"process_files",
"(",
"files",
",",
"output_filename",
",",
"digests",
",",
"strip",
")",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"'checksums.py'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"output_filename",
")",
":",
"logger"... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/checksums.py#L46-L86 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/mem/slicc/parser.py | python | SLICC.p_param__default_bool | (self, p) | param : type ident ASSIGN LIT_BOOL | param : type ident ASSIGN LIT_BOOL | [
"param",
":",
"type",
"ident",
"ASSIGN",
"LIT_BOOL"
] | def p_param__default_bool(self, p):
"param : type ident ASSIGN LIT_BOOL"
p[0] = ast.FormalParamAST(self, p[1], p[2], p[4]) | [
"def",
"p_param__default_bool",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"FormalParamAST",
"(",
"self",
",",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"2",
"]",
",",
"p",
"[",
"4",
"]",
")"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/mem/slicc/parser.py#L470-L472 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py | python | Series.cov | (self, other, min_periods=None) | return nanops.nancov(this.values, other.values, min_periods=min_periods) | Compute covariance with Series, excluding missing values.
Parameters
----------
other : Series
Series with which to compute the covariance.
min_periods : int, optional
Minimum number of observations needed to have a valid result.
Returns
-------
... | Compute covariance with Series, excluding missing values. | [
"Compute",
"covariance",
"with",
"Series",
"excluding",
"missing",
"values",
"."
] | def cov(self, other, min_periods=None):
"""
Compute covariance with Series, excluding missing values.
Parameters
----------
other : Series
Series with which to compute the covariance.
min_periods : int, optional
Minimum number of observations need... | [
"def",
"cov",
"(",
"self",
",",
"other",
",",
"min_periods",
"=",
"None",
")",
":",
"this",
",",
"other",
"=",
"self",
".",
"align",
"(",
"other",
",",
"join",
"=",
"\"inner\"",
",",
"copy",
"=",
"False",
")",
"if",
"len",
"(",
"this",
")",
"==",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py#L2263-L2290 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py | python | Timestamp.FromJsonString | (self, value) | Parse a RFC 3339 date string format to Timestamp.
Args:
value: A date string. Any fractional digits (or none) and any offset are
accepted as long as they fit into nano-seconds precision.
Example of accepted format: '1972-01-01T10:00:20.021-05:00'
Raises:
ValueError: On parsing ... | Parse a RFC 3339 date string format to Timestamp. | [
"Parse",
"a",
"RFC",
"3339",
"date",
"string",
"format",
"to",
"Timestamp",
"."
] | def FromJsonString(self, value):
"""Parse a RFC 3339 date string format to Timestamp.
Args:
value: A date string. Any fractional digits (or none) and any offset are
accepted as long as they fit into nano-seconds precision.
Example of accepted format: '1972-01-01T10:00:20.021-05:00'
... | [
"def",
"FromJsonString",
"(",
"self",
",",
"value",
")",
":",
"timezone_offset",
"=",
"value",
".",
"find",
"(",
"'Z'",
")",
"if",
"timezone_offset",
"==",
"-",
"1",
":",
"timezone_offset",
"=",
"value",
".",
"find",
"(",
"'+'",
")",
"if",
"timezone_offs... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/internal/well_known_types.py#L135-L195 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/atoms/affine/wraps.py | python | Wrap.numeric | (self, values) | return values[0] | Returns input. | Returns input. | [
"Returns",
"input",
"."
] | def numeric(self, values):
""" Returns input.
"""
return values[0] | [
"def",
"numeric",
"(",
"self",
",",
"values",
")",
":",
"return",
"values",
"[",
"0",
"]"
] | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/atoms/affine/wraps.py#L35-L38 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/foldpanelbar.py | python | FoldPanelBar.RedisplayFoldPanelItems | (self) | Resizes the fold panels so they match the width. | Resizes the fold panels so they match the width. | [
"Resizes",
"the",
"fold",
"panels",
"so",
"they",
"match",
"the",
"width",
"."
] | def RedisplayFoldPanelItems(self):
""" Resizes the fold panels so they match the width. """
# resize them all. No need to reposition
for panels in self._panels:
panels.ResizePanel()
panels.Refresh() | [
"def",
"RedisplayFoldPanelItems",
"(",
"self",
")",
":",
"# resize them all. No need to reposition",
"for",
"panels",
"in",
"self",
".",
"_panels",
":",
"panels",
".",
"ResizePanel",
"(",
")",
"panels",
".",
"Refresh",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/foldpanelbar.py#L1491-L1497 | ||
Smorodov/Multitarget-tracker | bee300e8bfd660c86cbeb6892c65a5b7195c9381 | thirdparty/pybind11/tools/clang/cindex.py | python | SourceLocation.file | (self) | return self._get_instantiation()[0] | Get the file represented by this source location. | Get the file represented by this source location. | [
"Get",
"the",
"file",
"represented",
"by",
"this",
"source",
"location",
"."
] | def file(self):
"""Get the file represented by this source location."""
return self._get_instantiation()[0] | [
"def",
"file",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_instantiation",
"(",
")",
"[",
"0",
"]"
] | https://github.com/Smorodov/Multitarget-tracker/blob/bee300e8bfd660c86cbeb6892c65a5b7195c9381/thirdparty/pybind11/tools/clang/cindex.py#L198-L200 | |
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/bindings/python/clang/cindex.py | python | Token.spelling | (self) | return conf.lib.clang_getTokenSpelling(self._tu, self) | The spelling of this token.
This is the textual representation of the token in source. | The spelling of this token. | [
"The",
"spelling",
"of",
"this",
"token",
"."
] | def spelling(self):
"""The spelling of this token.
This is the textual representation of the token in source.
"""
return conf.lib.clang_getTokenSpelling(self._tu, self) | [
"def",
"spelling",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTokenSpelling",
"(",
"self",
".",
"_tu",
",",
"self",
")"
] | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/bindings/python/clang/cindex.py#L3287-L3292 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/manifold/_spectral_embedding.py | python | _set_diag | (laplacian, value, norm_laplacian) | return laplacian | Set the diagonal of the laplacian matrix and convert it to a
sparse format well suited for eigenvalue decomposition
Parameters
----------
laplacian : array or sparse matrix
The graph laplacian
value : float
The value of the diagonal
norm_laplacian : bool
Whether the valu... | Set the diagonal of the laplacian matrix and convert it to a
sparse format well suited for eigenvalue decomposition | [
"Set",
"the",
"diagonal",
"of",
"the",
"laplacian",
"matrix",
"and",
"convert",
"it",
"to",
"a",
"sparse",
"format",
"well",
"suited",
"for",
"eigenvalue",
"decomposition"
] | def _set_diag(laplacian, value, norm_laplacian):
"""Set the diagonal of the laplacian matrix and convert it to a
sparse format well suited for eigenvalue decomposition
Parameters
----------
laplacian : array or sparse matrix
The graph laplacian
value : float
The value of the dia... | [
"def",
"_set_diag",
"(",
"laplacian",
",",
"value",
",",
"norm_laplacian",
")",
":",
"n_nodes",
"=",
"laplacian",
".",
"shape",
"[",
"0",
"]",
"# We need all entries in the diagonal to values",
"if",
"not",
"sparse",
".",
"isspmatrix",
"(",
"laplacian",
")",
":"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/manifold/_spectral_embedding.py#L91-L132 | |
pytorch/xla | 93174035e8149d5d03cee446486de861f56493e1 | torch_xla/utils/gcsfs.py | python | read | (path) | return _slurp_file(path) | Reads the whole content of a GCS blob.
Args:
path (string): The GCS path of the file. Must be "gs://BUCKET_NAME/PATH"
where ``BUCKET_NAME`` is the name of the GCS bucket, and ``PATH`` is a `/`
delimited path.
Returns:
The bytes stored within the GCS blob. | Reads the whole content of a GCS blob. | [
"Reads",
"the",
"whole",
"content",
"of",
"a",
"GCS",
"blob",
"."
] | def read(path):
"""Reads the whole content of a GCS blob.
Args:
path (string): The GCS path of the file. Must be "gs://BUCKET_NAME/PATH"
where ``BUCKET_NAME`` is the name of the GCS bucket, and ``PATH`` is a `/`
delimited path.
Returns:
The bytes stored within the GCS blob.
"""
return _s... | [
"def",
"read",
"(",
"path",
")",
":",
"return",
"_slurp_file",
"(",
"path",
")"
] | https://github.com/pytorch/xla/blob/93174035e8149d5d03cee446486de861f56493e1/torch_xla/utils/gcsfs.py#L224-L235 | |
Slicer/Slicer | ba9fadf332cb0303515b68d8d06a344c82e3e3e5 | Utilities/Scripts/SlicerWizard/ExtensionDescription.py | python | ExtensionDescription.__init__ | (self, repo=None, filepath=None, sourcedir=None, cmakefile="CMakeLists.txt") | :param repo:
Extension repository from which to create the description.
:type repo:
:class:`git.Repo <git:git.repo.base.Repo>`,
:class:`.Subversion.Repository` or ``None``.
:param filepath:
Path to an existing ``.s4ext`` to read.
:type filepath:
:class:`str` or ``None``.
:p... | :param repo:
Extension repository from which to create the description.
:type repo:
:class:`git.Repo <git:git.repo.base.Repo>`,
:class:`.Subversion.Repository` or ``None``.
:param filepath:
Path to an existing ``.s4ext`` to read.
:type filepath:
:class:`str` or ``None``.
:p... | [
":",
"param",
"repo",
":",
"Extension",
"repository",
"from",
"which",
"to",
"create",
"the",
"description",
".",
":",
"type",
"repo",
":",
":",
"class",
":",
"git",
".",
"Repo",
"<git",
":",
"git",
".",
"repo",
".",
"base",
".",
"Repo",
">",
":",
... | def __init__(self, repo=None, filepath=None, sourcedir=None, cmakefile="CMakeLists.txt"):
"""
:param repo:
Extension repository from which to create the description.
:type repo:
:class:`git.Repo <git:git.repo.base.Repo>`,
:class:`.Subversion.Repository` or ``None``.
:param filepath:
... | [
"def",
"__init__",
"(",
"self",
",",
"repo",
"=",
"None",
",",
"filepath",
"=",
"None",
",",
"sourcedir",
"=",
"None",
",",
"cmakefile",
"=",
"\"CMakeLists.txt\"",
")",
":",
"args",
"=",
"(",
"repo",
",",
"filepath",
",",
"sourcedir",
")",
"if",
"args"... | https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Utilities/Scripts/SlicerWizard/ExtensionDescription.py#L25-L156 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Menu.GetMenuItems | (*args, **kwargs) | return _core_.Menu_GetMenuItems(*args, **kwargs) | GetMenuItems(self) -> MenuItemList | GetMenuItems(self) -> MenuItemList | [
"GetMenuItems",
"(",
"self",
")",
"-",
">",
"MenuItemList"
] | def GetMenuItems(*args, **kwargs):
"""GetMenuItems(self) -> MenuItemList"""
return _core_.Menu_GetMenuItems(*args, **kwargs) | [
"def",
"GetMenuItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Menu_GetMenuItems",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L12134-L12136 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqt/mantidqt/project/workspacesaver.py | python | WorkspaceSaver.__init__ | (self, directory) | :param directory: | [] | def __init__(self, directory):
"""
:param directory:
"""
self.directory = directory
self.output_list = [] | [
"def",
"__init__",
"(",
"self",
",",
"directory",
")",
":",
"self",
".",
"directory",
"=",
"directory",
"self",
".",
"output_list",
"=",
"[",
"]"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/project/workspacesaver.py#L17-L23 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.