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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlDoc.copyDoc | (self, recursive) | return __tmp | Do a copy of the document info. If recursive, the content
tree will be copied too as well as DTD, namespaces and
entities. | Do a copy of the document info. If recursive, the content
tree will be copied too as well as DTD, namespaces and
entities. | [
"Do",
"a",
"copy",
"of",
"the",
"document",
"info",
".",
"If",
"recursive",
"the",
"content",
"tree",
"will",
"be",
"copied",
"too",
"as",
"well",
"as",
"DTD",
"namespaces",
"and",
"entities",
"."
] | def copyDoc(self, recursive):
"""Do a copy of the document info. If recursive, the content
tree will be copied too as well as DTD, namespaces and
entities. """
ret = libxml2mod.xmlCopyDoc(self._o, recursive)
if ret is None:raise treeError('xmlCopyDoc() failed')
__tmp... | [
"def",
"copyDoc",
"(",
"self",
",",
"recursive",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlCopyDoc",
"(",
"self",
".",
"_o",
",",
"recursive",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'xmlCopyDoc() failed'",
")",
"__tmp",
"=",
... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L4227-L4234 | |
mhammond/pywin32 | 44afd86ba8485194df93234639243252deeb40d5 | win32/Lib/regutil.py | python | UnregisterModule | (modName) | Unregister an explicit module in the registry.
modName -- The name of the module, as used by import. | Unregister an explicit module in the registry. | [
"Unregister",
"an",
"explicit",
"module",
"in",
"the",
"registry",
"."
] | def UnregisterModule(modName):
"""Unregister an explicit module in the registry.
modName -- The name of the module, as used by import.
"""
try:
win32api.RegDeleteKey(
GetRootKey(), BuildDefaultPythonKey() + "\\Modules\\%s" % modName
)
except win32api.error as exc:
... | [
"def",
"UnregisterModule",
"(",
"modName",
")",
":",
"try",
":",
"win32api",
".",
"RegDeleteKey",
"(",
"GetRootKey",
"(",
")",
",",
"BuildDefaultPythonKey",
"(",
")",
"+",
"\"\\\\Modules\\\\%s\"",
"%",
"modName",
")",
"except",
"win32api",
".",
"error",
"as",
... | https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/win32/Lib/regutil.py#L163-L176 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/internal/_parameterized.py | python | TestCase.id | (self) | return '%s.%s%s' % (_StrClass(self.__class__),
self._OriginalName(),
self._id_suffix.get(self._testMethodName, '')) | Returns the descriptive ID of the test.
This is used internally by the unittesting framework to get a name
for the test to be used in reports.
Returns:
The test id. | Returns the descriptive ID of the test. | [
"Returns",
"the",
"descriptive",
"ID",
"of",
"the",
"test",
"."
] | def id(self): # pylint: disable=invalid-name
"""Returns the descriptive ID of the test.
This is used internally by the unittesting framework to get a name
for the test to be used in reports.
Returns:
The test id.
"""
return '%s.%s%s' % (_StrClass(self.__class__),
... | [
"def",
"id",
"(",
"self",
")",
":",
"# pylint: disable=invalid-name",
"return",
"'%s.%s%s'",
"%",
"(",
"_StrClass",
"(",
"self",
".",
"__class__",
")",
",",
"self",
".",
"_OriginalName",
"(",
")",
",",
"self",
".",
"_id_suffix",
".",
"get",
"(",
"self",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/_parameterized.py#L404-L415 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/actor/Actor.py | python | Actor.getPartBundle | (self, partName, lodName="lodRoot") | return None | Find the named part in the optional named lod and return its
associated PartBundle, or return None if not present | Find the named part in the optional named lod and return its
associated PartBundle, or return None if not present | [
"Find",
"the",
"named",
"part",
"in",
"the",
"optional",
"named",
"lod",
"and",
"return",
"its",
"associated",
"PartBundle",
"or",
"return",
"None",
"if",
"not",
"present"
] | def getPartBundle(self, partName, lodName="lodRoot"):
"""
Find the named part in the optional named lod and return its
associated PartBundle, or return None if not present
"""
partBundleDict = self.__partBundleDict.get(lodName)
if not partBundleDict:
Actor.not... | [
"def",
"getPartBundle",
"(",
"self",
",",
"partName",
",",
"lodName",
"=",
"\"lodRoot\"",
")",
":",
"partBundleDict",
"=",
"self",
".",
"__partBundleDict",
".",
"get",
"(",
"lodName",
")",
"if",
"not",
"partBundleDict",
":",
"Actor",
".",
"notify",
".",
"w... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/actor/Actor.py#L983-L996 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py | python | Decimal.__hash__ | (self) | return hash((self._sign,
self._exp+len(self._int),
self._int.rstrip('0'))) | x.__hash__() <==> hash(x) | x.__hash__() <==> hash(x) | [
"x",
".",
"__hash__",
"()",
"<",
"==",
">",
"hash",
"(",
"x",
")"
] | def __hash__(self):
"""x.__hash__() <==> hash(x)"""
# Decimal integers must hash the same as the ints
#
# The hash of a nonspecial noninteger Decimal must depend only
# on the value of that Decimal, and not on its representation.
# For example: hash(Decimal('100E-1')) == ... | [
"def",
"__hash__",
"(",
"self",
")",
":",
"# Decimal integers must hash the same as the ints",
"#",
"# The hash of a nonspecial noninteger Decimal must depend only",
"# on the value of that Decimal, and not on its representation.",
"# For example: hash(Decimal('100E-1')) == hash(Decimal('10'))."... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/decimal.py#L935-L985 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/command.py | python | main | (args, env, cwd, cb) | Start a single makefile execution, given a command line, working directory, and environment.
@param cb a callback to notify with an exit code when make execution is finished. | Start a single makefile execution, given a command line, working directory, and environment. | [
"Start",
"a",
"single",
"makefile",
"execution",
"given",
"a",
"command",
"line",
"working",
"directory",
"and",
"environment",
"."
] | def main(args, env, cwd, cb):
"""
Start a single makefile execution, given a command line, working directory, and environment.
@param cb a callback to notify with an exit code when make execution is finished.
"""
try:
makelevel = int(env.get('MAKELEVEL', '0'))
op = OptionParser()
... | [
"def",
"main",
"(",
"args",
",",
"env",
",",
"cwd",
",",
"cb",
")",
":",
"try",
":",
"makelevel",
"=",
"int",
"(",
"env",
".",
"get",
"(",
"'MAKELEVEL'",
",",
"'0'",
")",
")",
"op",
"=",
"OptionParser",
"(",
")",
"op",
".",
"add_option",
"(",
"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/command.py#L164-L278 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/executor_manager.py | python | DataParallelExecutorGroup.backward | (self) | Perform a backward pass on each executor. | Perform a backward pass on each executor. | [
"Perform",
"a",
"backward",
"pass",
"on",
"each",
"executor",
"."
] | def backward(self):
"""Perform a backward pass on each executor."""
for texec in self.train_execs:
texec.backward() | [
"def",
"backward",
"(",
"self",
")",
":",
"for",
"texec",
"in",
"self",
".",
"train_execs",
":",
"texec",
".",
"backward",
"(",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/executor_manager.py#L284-L287 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/graph_editor/select.py | python | filter_ts | (ops, positive_filter) | return ts | Get all the tensors which are input or output of an op in ops.
Args:
ops: an object convertible to a list of `tf.Operation`.
positive_filter: a function deciding whether to keep a tensor or not.
If `True`, all the tensors are returned.
Returns:
A list of `tf.Tensor`.
Raises:
TypeError: if o... | Get all the tensors which are input or output of an op in ops. | [
"Get",
"all",
"the",
"tensors",
"which",
"are",
"input",
"or",
"output",
"of",
"an",
"op",
"in",
"ops",
"."
] | def filter_ts(ops, positive_filter):
"""Get all the tensors which are input or output of an op in ops.
Args:
ops: an object convertible to a list of `tf.Operation`.
positive_filter: a function deciding whether to keep a tensor or not.
If `True`, all the tensors are returned.
Returns:
A list of ... | [
"def",
"filter_ts",
"(",
"ops",
",",
"positive_filter",
")",
":",
"ops",
"=",
"util",
".",
"make_list_of_op",
"(",
"ops",
")",
"ts",
"=",
"_get_input_ts",
"(",
"ops",
")",
"util",
".",
"concatenate_unique",
"(",
"ts",
",",
"_get_output_ts",
"(",
"ops",
"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/graph_editor/select.py#L114-L131 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | FileSystem_FileNameToURL | (*args, **kwargs) | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | FileSystem_FileNameToURL(String filename) -> String | FileSystem_FileNameToURL(String filename) -> String | [
"FileSystem_FileNameToURL",
"(",
"String",
"filename",
")",
"-",
">",
"String"
] | def FileSystem_FileNameToURL(*args, **kwargs):
"""FileSystem_FileNameToURL(String filename) -> String"""
return _core_.FileSystem_FileNameToURL(*args, **kwargs) | [
"def",
"FileSystem_FileNameToURL",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"FileSystem_FileNameToURL",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2476-L2478 | |
JaDogg/expressPython | 960854d7f7ddfec959371cd32064c80095fb4448 | ep_runner.py | python | quit | (*args, **kwargs) | Pseudo quit function | Pseudo quit function | [
"Pseudo",
"quit",
"function"
] | def quit(*args, **kwargs):
"""
Pseudo quit function
"""
pass | [
"def",
"quit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"pass"
] | https://github.com/JaDogg/expressPython/blob/960854d7f7ddfec959371cd32064c80095fb4448/ep_runner.py#L61-L65 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/_lib/_threadsafety.py | python | non_reentrant | (err_msg=None) | return decorator | Decorate a function with a threading lock and prevent reentrant calls. | Decorate a function with a threading lock and prevent reentrant calls. | [
"Decorate",
"a",
"function",
"with",
"a",
"threading",
"lock",
"and",
"prevent",
"reentrant",
"calls",
"."
] | def non_reentrant(err_msg=None):
"""
Decorate a function with a threading lock and prevent reentrant calls.
"""
def decorator(func):
msg = err_msg
if msg is None:
msg = "%s is not re-entrant" % func.__name__
lock = ReentrancyLock(msg)
return lock.decorate(func... | [
"def",
"non_reentrant",
"(",
"err_msg",
"=",
"None",
")",
":",
"def",
"decorator",
"(",
"func",
")",
":",
"msg",
"=",
"err_msg",
"if",
"msg",
"is",
"None",
":",
"msg",
"=",
"\"%s is not re-entrant\"",
"%",
"func",
".",
"__name__",
"lock",
"=",
"Reentranc... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/_lib/_threadsafety.py#L50-L60 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/cookies.py | python | RequestsCookieJar.get | (self, name, default=None, domain=None, path=None) | Dict-like get() that also supports optional domain and path args in
order to resolve naming collisions from using one cookie jar over
multiple domains.
.. warning:: operation is O(n), not O(1). | Dict-like get() that also supports optional domain and path args in
order to resolve naming collisions from using one cookie jar over
multiple domains. | [
"Dict",
"-",
"like",
"get",
"()",
"that",
"also",
"supports",
"optional",
"domain",
"and",
"path",
"args",
"in",
"order",
"to",
"resolve",
"naming",
"collisions",
"from",
"using",
"one",
"cookie",
"jar",
"over",
"multiple",
"domains",
"."
] | def get(self, name, default=None, domain=None, path=None):
"""Dict-like get() that also supports optional domain and path args in
order to resolve naming collisions from using one cookie jar over
multiple domains.
.. warning:: operation is O(n), not O(1)."""
try:
ret... | [
"def",
"get",
"(",
"self",
",",
"name",
",",
"default",
"=",
"None",
",",
"domain",
"=",
"None",
",",
"path",
"=",
"None",
")",
":",
"try",
":",
"return",
"self",
".",
"_find_no_duplicates",
"(",
"name",
",",
"domain",
",",
"path",
")",
"except",
"... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/cookies.py#L177-L186 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/operator.py | python | isub | (a, b) | return a | Same as a -= b. | Same as a -= b. | [
"Same",
"as",
"a",
"-",
"=",
"b",
"."
] | def isub(a, b):
"Same as a -= b."
a -= b
return a | [
"def",
"isub",
"(",
"a",
",",
"b",
")",
":",
"a",
"-=",
"b",
"return",
"a"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/operator.py#L395-L398 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | Grid.GetCellSize | (*args, **kwargs) | return _grid.Grid_GetCellSize(*args, **kwargs) | GetCellSize(int row, int col) -> (num_rows, num_cols) | GetCellSize(int row, int col) -> (num_rows, num_cols) | [
"GetCellSize",
"(",
"int",
"row",
"int",
"col",
")",
"-",
">",
"(",
"num_rows",
"num_cols",
")"
] | def GetCellSize(*args, **kwargs):
"""GetCellSize(int row, int col) -> (num_rows, num_cols)"""
return _grid.Grid_GetCellSize(*args, **kwargs) | [
"def",
"GetCellSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_GetCellSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1810-L1812 | |
rsocket/rsocket-cpp | 45ed594ebd6701f40795c31ec922d784ec7fc921 | build/fbcode_builder/getdeps.py | python | CachedProject.is_cacheable | (self) | return self.cache and self.m.shipit_project is None | We only cache third party projects | We only cache third party projects | [
"We",
"only",
"cache",
"third",
"party",
"projects"
] | def is_cacheable(self):
"""We only cache third party projects"""
return self.cache and self.m.shipit_project is None | [
"def",
"is_cacheable",
"(",
"self",
")",
":",
"return",
"self",
".",
"cache",
"and",
"self",
".",
"m",
".",
"shipit_project",
"is",
"None"
] | https://github.com/rsocket/rsocket-cpp/blob/45ed594ebd6701f40795c31ec922d784ec7fc921/build/fbcode_builder/getdeps.py#L237-L239 | |
lmb-freiburg/ogn | 974f72ef4bf840d6f6693d22d1843a79223e77ce | scripts/cpp_lint.py | python | CloseExpression | (clean_lines, linenum, pos) | return (line, clean_lines.NumLines(), -1) | If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to... | If input points to ( or { or [ or <, finds the position that closes it. | [
"If",
"input",
"points",
"to",
"(",
"or",
"{",
"or",
"[",
"or",
"<",
"finds",
"the",
"position",
"that",
"closes",
"it",
"."
] | def CloseExpression(clean_lines, linenum, pos):
"""If input points to ( or { or [ or <, finds the position that closes it.
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance contai... | [
"def",
"CloseExpression",
"(",
"clean_lines",
",",
"linenum",
",",
"pos",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"startchar",
"=",
"line",
"[",
"pos",
"]",
"if",
"startchar",
"not",
"in",
"'({[<'",
":",
"return",
"(",
... | https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/scripts/cpp_lint.py#L1254-L1297 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-digital/python/digital/qam_constellations.py | python | sd_qam_16_0x1_0_1_2_3 | (x, Es=1) | return [b3, b2, b1, b0] | | Soft bit LUT generator for constellation:
|
| 0011 0111 | 1111 1011
|
| 0010 0110 | 1110 1010
| -----------------------
| 0000 0100 | 1100 1000
|
| 0001 0101 | 1101 1001 | | Soft bit LUT generator for constellation:
|
| 0011 0111 | 1111 1011
|
| 0010 0110 | 1110 1010
| -----------------------
| 0000 0100 | 1100 1000
|
| 0001 0101 | 1101 1001 | [
"|",
"Soft",
"bit",
"LUT",
"generator",
"for",
"constellation",
":",
"|",
"|",
"0011",
"0111",
"|",
"1111",
"1011",
"|",
"|",
"0010",
"0110",
"|",
"1110",
"1010",
"|",
"-----------------------",
"|",
"0000",
"0100",
"|",
"1100",
"1000",
"|",
"|",
"0001... | def sd_qam_16_0x1_0_1_2_3(x, Es=1):
'''
| Soft bit LUT generator for constellation:
|
| 0011 0111 | 1111 1011
|
| 0010 0110 | 1110 1010
| -----------------------
| 0000 0100 | 1100 1000
|
| 0001 0101 | 1101 1001
'''
x_re = 3 * x.real
x_im = 3 * x.imag
if ... | [
"def",
"sd_qam_16_0x1_0_1_2_3",
"(",
"x",
",",
"Es",
"=",
"1",
")",
":",
"x_re",
"=",
"3",
"*",
"x",
".",
"real",
"x_im",
"=",
"3",
"*",
"x",
".",
"imag",
"if",
"x_re",
"<",
"-",
"2",
":",
"b3",
"=",
"2",
"*",
"(",
"x_re",
"+",
"1",
")",
... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qam_constellations.py#L291-L323 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/vision/py_transforms_util.py | python | to_pil | (img) | return img | Convert the input image to PIL format.
Args:
img: Image to be converted.
Returns:
img (PIL image), Converted image. | Convert the input image to PIL format. | [
"Convert",
"the",
"input",
"image",
"to",
"PIL",
"format",
"."
] | def to_pil(img):
"""
Convert the input image to PIL format.
Args:
img: Image to be converted.
Returns:
img (PIL image), Converted image.
"""
if not is_pil(img):
if not isinstance(img, np.ndarray):
raise TypeError("The input of ToPIL should be ndarray. Got {}... | [
"def",
"to_pil",
"(",
"img",
")",
":",
"if",
"not",
"is_pil",
"(",
"img",
")",
":",
"if",
"not",
"isinstance",
"(",
"img",
",",
"np",
".",
"ndarray",
")",
":",
"raise",
"TypeError",
"(",
"\"The input of ToPIL should be ndarray. Got {}\"",
".",
"format",
"(... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/vision/py_transforms_util.py#L158-L172 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/ircbot.py | python | SingleServerIRCBot.disconnect | (self, msg="I'll be back!") | Disconnect the bot.
The bot will try to reconnect after a while.
Arguments:
msg -- Quit message. | Disconnect the bot. | [
"Disconnect",
"the",
"bot",
"."
] | def disconnect(self, msg="I'll be back!"):
"""Disconnect the bot.
The bot will try to reconnect after a while.
Arguments:
msg -- Quit message.
"""
self.connection.disconnect(msg) | [
"def",
"disconnect",
"(",
"self",
",",
"msg",
"=",
"\"I'll be back!\"",
")",
":",
"self",
".",
"connection",
".",
"disconnect",
"(",
"msg",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/irc/ircbot.py#L195-L204 | ||
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/tools/sancov/coverage-report-server.py | python | SymcovData.compute_filecoverage | (self) | return result | Build a filename->pct coverage. | Build a filename->pct coverage. | [
"Build",
"a",
"filename",
"-",
">",
"pct",
"coverage",
"."
] | def compute_filecoverage(self):
"""Build a filename->pct coverage."""
result = dict()
for filename, fns in self.point_symbol_info.items():
file_points = []
for fn, points in fns.items():
file_points.extend(points.keys())
covered_points = self.c... | [
"def",
"compute_filecoverage",
"(",
"self",
")",
":",
"result",
"=",
"dict",
"(",
")",
"for",
"filename",
",",
"fns",
"in",
"self",
".",
"point_symbol_info",
".",
"items",
"(",
")",
":",
"file_points",
"=",
"[",
"]",
"for",
"fn",
",",
"points",
"in",
... | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/tools/sancov/coverage-report-server.py#L107-L117 | |
esa/pagmo | 80281d549c8f1b470e1489a5d37c8f06b2e429c0 | PyGMO/problem/__init__.py | python | _sch_ctor | (self) | Constructs a Schaffer's study problem (Box-Constrained Continuous Multi-Objective)
NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002
USAGE: problem.sch() | Constructs a Schaffer's study problem (Box-Constrained Continuous Multi-Objective) | [
"Constructs",
"a",
"Schaffer",
"s",
"study",
"problem",
"(",
"Box",
"-",
"Constrained",
"Continuous",
"Multi",
"-",
"Objective",
")"
] | def _sch_ctor(self):
"""
Constructs a Schaffer's study problem (Box-Constrained Continuous Multi-Objective)
NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002
USAGE: problem.sch()
"""
arg_list = []
self._orig_init(*arg... | [
"def",
"_sch_ctor",
"(",
"self",
")",
":",
"arg_list",
"=",
"[",
"]",
"self",
".",
"_orig_init",
"(",
"*",
"arg_list",
")"
] | https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/problem/__init__.py#L345-L354 | ||
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/reductions/canonicalization.py | python | Canonicalization.apply | (self, problem) | return new_problem, inverse_data | Recursively canonicalize the objective and every constraint. | Recursively canonicalize the objective and every constraint. | [
"Recursively",
"canonicalize",
"the",
"objective",
"and",
"every",
"constraint",
"."
] | def apply(self, problem):
"""Recursively canonicalize the objective and every constraint."""
inverse_data = InverseData(problem)
canon_objective, canon_constraints = self.canonicalize_tree(
problem.objective)
for constraint in problem.constraints:
# canon_constr... | [
"def",
"apply",
"(",
"self",
",",
"problem",
")",
":",
"inverse_data",
"=",
"InverseData",
"(",
"problem",
")",
"canon_objective",
",",
"canon_constraints",
"=",
"self",
".",
"canonicalize_tree",
"(",
"problem",
".",
"objective",
")",
"for",
"constraint",
"in"... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/reductions/canonicalization.py#L55-L74 | |
gv22ga/dlib-face-recognition-android | 42d6305cbd85833f2b85bb79b70ab9ab004153c9 | tools/lint/cpplint.py | python | NestingState.InNamespaceBody | (self) | return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise. | Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise. | [
"Check",
"if",
"we",
"are",
"currently",
"one",
"level",
"inside",
"a",
"namespace",
"body",
".",
"Returns",
":",
"True",
"if",
"top",
"of",
"the",
"stack",
"is",
"a",
"namespace",
"block",
"False",
"otherwise",
"."
] | def InNamespaceBody(self):
"""Check if we are currently one level inside a namespace body.
Returns:
True if top of the stack is a namespace block, False otherwise.
"""
return self.stack and isinstance(self.stack[-1], _NamespaceInfo) | [
"def",
"InNamespaceBody",
"(",
"self",
")",
":",
"return",
"self",
".",
"stack",
"and",
"isinstance",
"(",
"self",
".",
"stack",
"[",
"-",
"1",
"]",
",",
"_NamespaceInfo",
")"
] | https://github.com/gv22ga/dlib-face-recognition-android/blob/42d6305cbd85833f2b85bb79b70ab9ab004153c9/tools/lint/cpplint.py#L2222-L2227 | |
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/pystache/init.py | python | render | (template, context=None, name=None, **kwargs) | return renderer.render(parsed_template, context, **kwargs) | Return the given template string rendered using the given context. | Return the given template string rendered using the given context. | [
"Return",
"the",
"given",
"template",
"string",
"rendered",
"using",
"the",
"given",
"context",
"."
] | def render(template, context=None, name=None, **kwargs):
"""
Return the given template string rendered using the given context.
"""
renderer = Renderer()
parsed_template = parse(template, name=name)
return renderer.render(parsed_template, context, **kwargs) | [
"def",
"render",
"(",
"template",
",",
"context",
"=",
"None",
",",
"name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"renderer",
"=",
"Renderer",
"(",
")",
"parsed_template",
"=",
"parse",
"(",
"template",
",",
"name",
"=",
"name",
")",
"retur... | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/pystache/init.py#L13-L20 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/sort-array-by-increasing-frequency.py | python | Solution.frequencySort | (self, nums) | return sorted(nums, key=lambda x: (count[x], -x)) | :type nums: List[int]
:rtype: List[int] | :type nums: List[int]
:rtype: List[int] | [
":",
"type",
"nums",
":",
"List",
"[",
"int",
"]",
":",
"rtype",
":",
"List",
"[",
"int",
"]"
] | def frequencySort(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
count = collections.Counter(nums)
return sorted(nums, key=lambda x: (count[x], -x)) | [
"def",
"frequencySort",
"(",
"self",
",",
"nums",
")",
":",
"count",
"=",
"collections",
".",
"Counter",
"(",
"nums",
")",
"return",
"sorted",
"(",
"nums",
",",
"key",
"=",
"lambda",
"x",
":",
"(",
"count",
"[",
"x",
"]",
",",
"-",
"x",
")",
")"
... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/sort-array-by-increasing-frequency.py#L8-L14 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/pyroot/cppyy/cppyy-backend/cling/python/cppyy_backend/_cppyy_generator.py | python | CppyyGenerator.create_file_mapping | (self, h_file) | return info | Generate a dict describing the given source header file. This is the
main entry point for this class.
:param h_file: The source header file of interest.
:returns: A dict corresponding to the h_file. | Generate a dict describing the given source header file. This is the
main entry point for this class. | [
"Generate",
"a",
"dict",
"describing",
"the",
"given",
"source",
"header",
"file",
".",
"This",
"is",
"the",
"main",
"entry",
"point",
"for",
"this",
"class",
"."
] | def create_file_mapping(self, h_file):
"""
Generate a dict describing the given source header file. This is the
main entry point for this class.
:param h_file: The source header file of interest.
:returns: A dict corresponding to the h_file.
"""
#
... | [
"def",
"create_file_mapping",
"(",
"self",
",",
"h_file",
")",
":",
"#",
"# Use Clang to parse the source and return its AST.",
"#",
"self",
".",
"tu",
"=",
"self",
".",
"source_processor",
".",
"compile",
"(",
"h_file",
")",
"m",
"=",
"(",
"logging",
".",
"ER... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/cppyy/cppyy-backend/cling/python/cppyy_backend/_cppyy_generator.py#L219-L254 | |
apple/swift | 469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893 | utils/jobstats/jobstats.py | python | JobStats.driver_jobs_total | (self) | return self.driver_jobs_ran() + self.driver_jobs_skipped() | Return the total count of a driver job's ran + skipped sub-jobs | Return the total count of a driver job's ran + skipped sub-jobs | [
"Return",
"the",
"total",
"count",
"of",
"a",
"driver",
"job",
"s",
"ran",
"+",
"skipped",
"sub",
"-",
"jobs"
] | def driver_jobs_total(self):
"""Return the total count of a driver job's ran + skipped sub-jobs"""
assert(self.is_driver_job())
return self.driver_jobs_ran() + self.driver_jobs_skipped() | [
"def",
"driver_jobs_total",
"(",
"self",
")",
":",
"assert",
"(",
"self",
".",
"is_driver_job",
"(",
")",
")",
"return",
"self",
".",
"driver_jobs_ran",
"(",
")",
"+",
"self",
".",
"driver_jobs_skipped",
"(",
")"
] | https://github.com/apple/swift/blob/469f72fdae2ea828b3b6c0d7d62d7e4cf98c4893/utils/jobstats/jobstats.py#L77-L80 | |
Dobiasd/frugally-deep | 99d9378c6ef537a209bcb2a102e953899a6ab0e3 | keras_export/convert_model.py | python | are_embedding_layer_positions_ok_for_testing | (model) | return embedding_layer_names(model) == embedding_layer_names_at_input_nodes(model) | Test data can only be generated if all embeddings layers
are positioned directly behind the input nodes | Test data can only be generated if all embeddings layers
are positioned directly behind the input nodes | [
"Test",
"data",
"can",
"only",
"be",
"generated",
"if",
"all",
"embeddings",
"layers",
"are",
"positioned",
"directly",
"behind",
"the",
"input",
"nodes"
] | def are_embedding_layer_positions_ok_for_testing(model):
"""
Test data can only be generated if all embeddings layers
are positioned directly behind the input nodes
"""
def embedding_layer_names(model):
layers = model.layers
result = set()
for layer in layers:
if... | [
"def",
"are_embedding_layer_positions_ok_for_testing",
"(",
"model",
")",
":",
"def",
"embedding_layer_names",
"(",
"model",
")",
":",
"layers",
"=",
"model",
".",
"layers",
"result",
"=",
"set",
"(",
")",
"for",
"layer",
"in",
"layers",
":",
"if",
"isinstance... | https://github.com/Dobiasd/frugally-deep/blob/99d9378c6ef537a209bcb2a102e953899a6ab0e3/keras_export/convert_model.py#L116-L141 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/cmd.py | python | Command.finalize_options | (self) | Set final values for all the options that this command supports.
This is always called as late as possible, ie. after any option
assignments from the command-line or from other commands have been
done. Thus, this is the place to code option dependencies: if
'foo' depends on 'bar', then... | Set final values for all the options that this command supports.
This is always called as late as possible, ie. after any option
assignments from the command-line or from other commands have been
done. Thus, this is the place to code option dependencies: if
'foo' depends on 'bar', then... | [
"Set",
"final",
"values",
"for",
"all",
"the",
"options",
"that",
"this",
"command",
"supports",
".",
"This",
"is",
"always",
"called",
"as",
"late",
"as",
"possible",
"ie",
".",
"after",
"any",
"option",
"assignments",
"from",
"the",
"command",
"-",
"line... | def finalize_options(self):
"""Set final values for all the options that this command supports.
This is always called as late as possible, ie. after any option
assignments from the command-line or from other commands have been
done. Thus, this is the place to code option dependencies: ... | [
"def",
"finalize_options",
"(",
"self",
")",
":",
"raise",
"RuntimeError",
",",
"\"abstract method -- subclass %s must override\"",
"%",
"self",
".",
"__class__"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/cmd.py#L138-L150 | ||
OpenMined/PyDP | a88ee73053aa2bdc1be327a77109dd5907ab41d6 | examples/Tutorial_2-restaurant_demo/restaurant.py | python | RestaurantStatistics.get_private_counts_per_day | (self, epsilon: float = None) | return day_counts | Compute an anonymized (within a given threshold of epsilon) version of the number of visits per day.
Return a dictionary mapping days to number of visits | Compute an anonymized (within a given threshold of epsilon) version of the number of visits per day. | [
"Compute",
"an",
"anonymized",
"(",
"within",
"a",
"given",
"threshold",
"of",
"epsilon",
")",
"version",
"of",
"the",
"number",
"of",
"visits",
"per",
"day",
"."
] | def get_private_counts_per_day(self, epsilon: float = None) -> dict:
"""Compute an anonymized (within a given threshold of epsilon) version of the number of visits per day.
Return a dictionary mapping days to number of visits
"""
# Pre-process the data set: limit the number of days cont... | [
"def",
"get_private_counts_per_day",
"(",
"self",
",",
"epsilon",
":",
"float",
"=",
"None",
")",
"->",
"dict",
":",
"# Pre-process the data set: limit the number of days contributed by a visitor to COUNT_MAX_CONTRIBUTED_DAYS",
"day_visits",
"=",
"bound_visits_per_week",
"(",
"... | https://github.com/OpenMined/PyDP/blob/a88ee73053aa2bdc1be327a77109dd5907ab41d6/examples/Tutorial_2-restaurant_demo/restaurant.py#L181-L209 | |
esa/pagmo | 80281d549c8f1b470e1489a5d37c8f06b2e429c0 | PyGMO/problem/__init__.py | python | _con2uncon_ctor | (self, problem=cec2006(4), method='optimality') | Implements a meta-problem class that wraps constrained problems,
resulting in an unconstrained problem. Two methods
are available for definig the objective function of the meta-problem: 'optimality' and 'feasibility'.
The 'optimality' uses as objective function the original objective function, it basically ... | Implements a meta-problem class that wraps constrained problems,
resulting in an unconstrained problem. Two methods
are available for definig the objective function of the meta-problem: 'optimality' and 'feasibility'.
The 'optimality' uses as objective function the original objective function, it basically ... | [
"Implements",
"a",
"meta",
"-",
"problem",
"class",
"that",
"wraps",
"constrained",
"problems",
"resulting",
"in",
"an",
"unconstrained",
"problem",
".",
"Two",
"methods",
"are",
"available",
"for",
"definig",
"the",
"objective",
"function",
"of",
"the",
"meta",... | def _con2uncon_ctor(self, problem=cec2006(4), method='optimality'):
"""
Implements a meta-problem class that wraps constrained problems,
resulting in an unconstrained problem. Two methods
are available for definig the objective function of the meta-problem: 'optimality' and 'feasibility'.
The 'optim... | [
"def",
"_con2uncon_ctor",
"(",
"self",
",",
"problem",
"=",
"cec2006",
"(",
"4",
")",
",",
"method",
"=",
"'optimality'",
")",
":",
"# We construct the arg list for the original constructor exposed by",
"# boost_python",
"METHOD_TYPE",
"=",
"{",
"'optimality'",
":",
"... | https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/problem/__init__.py#L873-L900 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/bisect_utils.py | python | RunRepo | (params) | return SubprocessCall(cmd) | Runs cros repo command with specified parameters.
Args:
params: A list of parameters to pass to gclient.
Returns:
The return code of the call. | Runs cros repo command with specified parameters. | [
"Runs",
"cros",
"repo",
"command",
"with",
"specified",
"parameters",
"."
] | def RunRepo(params):
"""Runs cros repo command with specified parameters.
Args:
params: A list of parameters to pass to gclient.
Returns:
The return code of the call.
"""
cmd = ['repo'] + params
return SubprocessCall(cmd) | [
"def",
"RunRepo",
"(",
"params",
")",
":",
"cmd",
"=",
"[",
"'repo'",
"]",
"+",
"params",
"return",
"SubprocessCall",
"(",
"cmd",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/bisect_utils.py#L181-L192 | |
larroy/clearskies_core | 3574ddf0edc8555454c7044126e786a6c29444dc | tools/gyp/pylib/gyp/win_tool.py | python | WinTool.ExecLinkWithManifests | (self, arch, embed_manifest, out, ldcmd, resname,
mt, rc, intermediate_manifest, *manifests) | A wrapper for handling creating a manifest resource and then executing
a link command. | A wrapper for handling creating a manifest resource and then executing
a link command. | [
"A",
"wrapper",
"for",
"handling",
"creating",
"a",
"manifest",
"resource",
"and",
"then",
"executing",
"a",
"link",
"command",
"."
] | def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname,
mt, rc, intermediate_manifest, *manifests):
"""A wrapper for handling creating a manifest resource and then executing
a link command."""
# The 'normal' way to do manifests is to have link generate a manife... | [
"def",
"ExecLinkWithManifests",
"(",
"self",
",",
"arch",
",",
"embed_manifest",
",",
"out",
",",
"ldcmd",
",",
"resname",
",",
"mt",
",",
"rc",
",",
"intermediate_manifest",
",",
"*",
"manifests",
")",
":",
"# The 'normal' way to do manifests is to have link genera... | https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/win_tool.py#L119-L193 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/transformer/loss.py | python | CrossEntropyLoss._check_input | (self, logits, label, input_mask) | return True | r"""Check the input tensor shape and type | r"""Check the input tensor shape and type | [
"r",
"Check",
"the",
"input",
"tensor",
"shape",
"and",
"type"
] | def _check_input(self, logits, label, input_mask):
r"""Check the input tensor shape and type"""
_check_is_tensor('logits', logits, self.cls_name)
_check_is_tensor('label', label, self.cls_name)
_check_is_tensor('input_mask', input_mask, self.cls_name)
_check_input_dtype(F.dtype(l... | [
"def",
"_check_input",
"(",
"self",
",",
"logits",
",",
"label",
",",
"input_mask",
")",
":",
"_check_is_tensor",
"(",
"'logits'",
",",
"logits",
",",
"self",
".",
"cls_name",
")",
"_check_is_tensor",
"(",
"'label'",
",",
"label",
",",
"self",
".",
"cls_na... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/transformer/loss.py#L128-L139 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/HFIRSANSReduction.py | python | HFIRSANSReduction._save_output | (self, iq_output, iqxy_output, output_dir, property_manager) | return output_msg | Save the I(Q) and I(QxQy) output to file.
@param iq_output: name of the I(Q) workspace
@param iqxy_output: name of the I(QxQy) workspace
@param output_dir: output director path
@param property_manager: property manager object | Save the I(Q) and I(QxQy) output to file. | [
"Save",
"the",
"I",
"(",
"Q",
")",
"and",
"I",
"(",
"QxQy",
")",
"output",
"to",
"file",
"."
] | def _save_output(self, iq_output, iqxy_output, output_dir, property_manager):
"""
Save the I(Q) and I(QxQy) output to file.
@param iq_output: name of the I(Q) workspace
@param iqxy_output: name of the I(QxQy) workspace
@param output_dir: output director path
... | [
"def",
"_save_output",
"(",
"self",
",",
"iq_output",
",",
"iqxy_output",
",",
"output_dir",
",",
"property_manager",
")",
":",
"output_msg",
"=",
"\"\"",
"def",
"_save_ws",
"(",
"iq_ws",
")",
":",
"if",
"AnalysisDataService",
".",
"doesExist",
"(",
"iq_ws",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/HFIRSANSReduction.py#L399-L479 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_gdi.py | python | ImageList.GetImageCount | (*args, **kwargs) | return _gdi_.ImageList_GetImageCount(*args, **kwargs) | GetImageCount(self) -> int | GetImageCount(self) -> int | [
"GetImageCount",
"(",
"self",
")",
"-",
">",
"int"
] | def GetImageCount(*args, **kwargs):
"""GetImageCount(self) -> int"""
return _gdi_.ImageList_GetImageCount(*args, **kwargs) | [
"def",
"GetImageCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"ImageList_GetImageCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L6950-L6952 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/six.py | python | add_move | (move) | Add an item to six.moves. | Add an item to six.moves. | [
"Add",
"an",
"item",
"to",
"six",
".",
"moves",
"."
] | def add_move(move):
"""Add an item to six.moves."""
setattr(_MovedItems, move.name, move) | [
"def",
"add_move",
"(",
"move",
")",
":",
"setattr",
"(",
"_MovedItems",
",",
"move",
".",
"name",
",",
"move",
")"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/_vendor/six.py#L486-L488 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/dashboard/dashboard/__init__.py | python | _CatapultThirdPartyLibraryPaths | () | return paths | Returns a list of required third-party libraries in catapult. | Returns a list of required third-party libraries in catapult. | [
"Returns",
"a",
"list",
"of",
"required",
"third",
"-",
"party",
"libraries",
"in",
"catapult",
"."
] | def _CatapultThirdPartyLibraryPaths():
"""Returns a list of required third-party libraries in catapult."""
paths = []
for library in THIRD_PARTY_LIBRARIES:
paths.append(os.path.join(_CATAPULT_PATH, 'third_party', library))
return paths | [
"def",
"_CatapultThirdPartyLibraryPaths",
"(",
")",
":",
"paths",
"=",
"[",
"]",
"for",
"library",
"in",
"THIRD_PARTY_LIBRARIES",
":",
"paths",
".",
"append",
"(",
"os",
".",
"path",
".",
"join",
"(",
"_CATAPULT_PATH",
",",
"'third_party'",
",",
"library",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/__init__.py#L86-L91 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchNesting.py | python | Nester.clear | (self) | clear(): Removes all objects and shape from the nester | clear(): Removes all objects and shape from the nester | [
"clear",
"()",
":",
"Removes",
"all",
"objects",
"and",
"shape",
"from",
"the",
"nester"
] | def clear(self):
"""clear(): Removes all objects and shape from the nester"""
self.objects = None
self.shapes = None | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"objects",
"=",
"None",
"self",
".",
"shapes",
"=",
"None"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchNesting.py#L95-L100 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Wm.wm_grid | (self,
baseWidth=None, baseHeight=None,
widthInc=None, heightInc=None) | return self._getints(self.tk.call(
'wm', 'grid', self._w,
baseWidth, baseHeight, widthInc, heightInc)) | Instruct the window manager that this widget shall only be
resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and
height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the
number of grid units requested in Tk_GeometryRequest. | Instruct the window manager that this widget shall only be
resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and
height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the
number of grid units requested in Tk_GeometryRequest. | [
"Instruct",
"the",
"window",
"manager",
"that",
"this",
"widget",
"shall",
"only",
"be",
"resized",
"on",
"grid",
"boundaries",
".",
"WIDTHINC",
"and",
"HEIGHTINC",
"are",
"the",
"width",
"and",
"height",
"of",
"a",
"grid",
"unit",
"in",
"pixels",
".",
"BA... | def wm_grid(self,
baseWidth=None, baseHeight=None,
widthInc=None, heightInc=None):
"""Instruct the window manager that this widget shall only be
resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and
height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are th... | [
"def",
"wm_grid",
"(",
"self",
",",
"baseWidth",
"=",
"None",
",",
"baseHeight",
"=",
"None",
",",
"widthInc",
"=",
"None",
",",
"heightInc",
"=",
"None",
")",
":",
"return",
"self",
".",
"_getints",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'wm'",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L1843-L1852 | |
RLBot/RLBot | 34332b12cf158b3ef8dbf174ae67c53683368a9d | src/main/python/rlbot/base_extension.py | python | BaseExtension.onGoalScored | (self, team) | Called when a goal has been scored.
:param team: Which team scored the goal. | Called when a goal has been scored.
:param team: Which team scored the goal. | [
"Called",
"when",
"a",
"goal",
"has",
"been",
"scored",
".",
":",
"param",
"team",
":",
"Which",
"team",
"scored",
"the",
"goal",
"."
] | def onGoalScored(self, team):
"""
Called when a goal has been scored.
:param team: Which team scored the goal.
""" | [
"def",
"onGoalScored",
"(",
"self",
",",
"team",
")",
":"
] | https://github.com/RLBot/RLBot/blob/34332b12cf158b3ef8dbf174ae67c53683368a9d/src/main/python/rlbot/base_extension.py#L20-L24 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Jinja2/py3/jinja2/runtime.py | python | LoopContext.__call__ | (self, iterable: t.Iterable[V]) | return self._recurse(iterable, self._recurse, depth=self.depth) | When iterating over nested data, render the body of the loop
recursively with the given inner iterable data.
The loop must have the ``recursive`` marker for this to work. | When iterating over nested data, render the body of the loop
recursively with the given inner iterable data. | [
"When",
"iterating",
"over",
"nested",
"data",
"render",
"the",
"body",
"of",
"the",
"loop",
"recursively",
"with",
"the",
"given",
"inner",
"iterable",
"data",
"."
] | def __call__(self, iterable: t.Iterable[V]) -> str:
"""When iterating over nested data, render the body of the loop
recursively with the given inner iterable data.
The loop must have the ``recursive`` marker for this to work.
"""
if self._recurse is None:
raise TypeE... | [
"def",
"__call__",
"(",
"self",
",",
"iterable",
":",
"t",
".",
"Iterable",
"[",
"V",
"]",
")",
"->",
"str",
":",
"if",
"self",
".",
"_recurse",
"is",
"None",
":",
"raise",
"TypeError",
"(",
"\"The loop must have the 'recursive' marker to be called recursively.\... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Jinja2/py3/jinja2/runtime.py#L618-L629 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typing/templates.py | python | _OverloadFunctionTemplate._get_impl | (self, args, kws) | return impl, args | Get implementation given the argument types.
Returning a Dispatcher object. The Dispatcher object is cached
internally in `self._impl_cache`. | Get implementation given the argument types. | [
"Get",
"implementation",
"given",
"the",
"argument",
"types",
"."
] | def _get_impl(self, args, kws):
"""Get implementation given the argument types.
Returning a Dispatcher object. The Dispatcher object is cached
internally in `self._impl_cache`.
"""
cache_key = self.context, tuple(args), tuple(kws.items())
try:
impl, args = s... | [
"def",
"_get_impl",
"(",
"self",
",",
"args",
",",
"kws",
")",
":",
"cache_key",
"=",
"self",
".",
"context",
",",
"tuple",
"(",
"args",
")",
",",
"tuple",
"(",
"kws",
".",
"items",
"(",
")",
")",
"try",
":",
"impl",
",",
"args",
"=",
"self",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/typing/templates.py#L498-L509 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/text.py | python | ByteProcessor.reverse | (self, x) | Reverses output of transform back to text.
Args:
x: iterator or matrix of integers. Document representation in bytes.
Yields:
Iterators of utf-8 strings. | Reverses output of transform back to text. | [
"Reverses",
"output",
"of",
"transform",
"back",
"to",
"text",
"."
] | def reverse(self, x):
"""Reverses output of transform back to text.
Args:
x: iterator or matrix of integers. Document representation in bytes.
Yields:
Iterators of utf-8 strings.
"""
for data in x:
document = np.trim_zeros(data.astype(np.int8), trim='b').tostring()
try:
... | [
"def",
"reverse",
"(",
"self",
",",
"x",
")",
":",
"for",
"data",
"in",
"x",
":",
"document",
"=",
"np",
".",
"trim_zeros",
"(",
"data",
".",
"astype",
"(",
"np",
".",
"int8",
")",
",",
"trim",
"=",
"'b'",
")",
".",
"tostring",
"(",
")",
"try",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/text.py#L69-L83 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py | python | nestedExpr | (opener="(", closer=")", content=None, ignoreExpr=quotedString.copy()) | return ret | Helper method for defining nested lists enclosed in opening and closing
delimiters ("(" and ")" are the default).
Parameters:
- opener - opening character for a nested list (default=C{"("}); can also be a pyparsing expression
- closer - closing character for a nested list (default=C{")"}); can also b... | Helper method for defining nested lists enclosed in opening and closing
delimiters ("(" and ")" are the default). | [
"Helper",
"method",
"for",
"defining",
"nested",
"lists",
"enclosed",
"in",
"opening",
"and",
"closing",
"delimiters",
"(",
"(",
"and",
")",
"are",
"the",
"default",
")",
"."
] | def nestedExpr(opener="(", closer=")", content=None, ignoreExpr=quotedString.copy()):
"""
Helper method for defining nested lists enclosed in opening and closing
delimiters ("(" and ")" are the default).
Parameters:
- opener - opening character for a nested list (default=C{"("}); can also be a pyp... | [
"def",
"nestedExpr",
"(",
"opener",
"=",
"\"(\"",
",",
"closer",
"=",
"\")\"",
",",
"content",
"=",
"None",
",",
"ignoreExpr",
"=",
"quotedString",
".",
"copy",
"(",
")",
")",
":",
"if",
"opener",
"==",
"closer",
":",
"raise",
"ValueError",
"(",
"\"ope... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/pyparsing.py#L5157-L5245 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/util/protobuf/compare.py | python | NormalizeNumberFields | (pb) | return pb | Normalizes types and precisions of number fields in a protocol buffer.
Due to subtleties in the python protocol buffer implementation, it is possible
for values to have different types and precision depending on whether they
were set and retrieved directly or deserialized from a protobuf. This function
normali... | Normalizes types and precisions of number fields in a protocol buffer. | [
"Normalizes",
"types",
"and",
"precisions",
"of",
"number",
"fields",
"in",
"a",
"protocol",
"buffer",
"."
] | def NormalizeNumberFields(pb):
"""Normalizes types and precisions of number fields in a protocol buffer.
Due to subtleties in the python protocol buffer implementation, it is possible
for values to have different types and precision depending on whether they
were set and retrieved directly or deserialized from... | [
"def",
"NormalizeNumberFields",
"(",
"pb",
")",
":",
"for",
"desc",
",",
"values",
"in",
"pb",
".",
"ListFields",
"(",
")",
":",
"is_repeated",
"=",
"True",
"if",
"desc",
".",
"label",
"is",
"not",
"descriptor",
".",
"FieldDescriptor",
".",
"LABEL_REPEATED... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/util/protobuf/compare.py#L107-L172 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/foldpanelbar.py | python | CaptionBarStyle.__init__ | (self) | Default constructor for this class. | Default constructor for this class. | [
"Default",
"constructor",
"for",
"this",
"class",
"."
] | def __init__(self):
""" Default constructor for this class. """
self.ResetDefaults() | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"ResetDefaults",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/foldpanelbar.py#L310-L313 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/pdb.py | python | Pdb.do_display | (self, arg) | display [expression]
Display the value of the expression if it changed, each time execution
stops in the current frame.
Without expression, list all display expressions for the current frame. | display [expression] | [
"display",
"[",
"expression",
"]"
] | def do_display(self, arg):
"""display [expression]
Display the value of the expression if it changed, each time execution
stops in the current frame.
Without expression, list all display expressions for the current frame.
"""
if not arg:
self.message('Curren... | [
"def",
"do_display",
"(",
"self",
",",
"arg",
")",
":",
"if",
"not",
"arg",
":",
"self",
".",
"message",
"(",
"'Currently displaying:'",
")",
"for",
"item",
"in",
"self",
".",
"displaying",
".",
"get",
"(",
"self",
".",
"curframe",
",",
"{",
"}",
")"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pdb.py#L1334-L1349 | ||
ycm-core/ycmd | fc0fb7e5e15176cc5a2a30c80956335988c6b59a | ycmd/completers/language_server/language_server_protocol.py | python | CodepointsToUTF16CodeUnits | ( line_value, codepoint_offset ) | return len( value_as_utf16 ) // 2 | Return the 1-based UTF-16 code unit offset equivalent to the 1-based
unicode codepoint offset |codepoint_offset| in the Unicode string
|line_value| | Return the 1-based UTF-16 code unit offset equivalent to the 1-based
unicode codepoint offset |codepoint_offset| in the Unicode string
|line_value| | [
"Return",
"the",
"1",
"-",
"based",
"UTF",
"-",
"16",
"code",
"unit",
"offset",
"equivalent",
"to",
"the",
"1",
"-",
"based",
"unicode",
"codepoint",
"offset",
"|codepoint_offset|",
"in",
"the",
"Unicode",
"string",
"|line_value|"
] | def CodepointsToUTF16CodeUnits( line_value, codepoint_offset ):
"""Return the 1-based UTF-16 code unit offset equivalent to the 1-based
unicode codepoint offset |codepoint_offset| in the Unicode string
|line_value|"""
# Language server protocol requires offsets to be in utf16 code _units_.
# Each code unit is... | [
"def",
"CodepointsToUTF16CodeUnits",
"(",
"line_value",
",",
"codepoint_offset",
")",
":",
"# Language server protocol requires offsets to be in utf16 code _units_.",
"# Each code unit is 2 bytes.",
"# So we re-encode the line as utf-16 and divide the length in bytes by 2.",
"#",
"# Of cours... | https://github.com/ycm-core/ycmd/blob/fc0fb7e5e15176cc5a2a30c80956335988c6b59a/ycmd/completers/language_server/language_server_protocol.py#L691-L707 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/learn/python/learn/dataframe/dataframe.py | python | DataFrame.exclude_columns | (self, exclude_keys) | return result | Returns a new DataFrame with all columns not excluded via exclude_keys.
Args:
exclude_keys: A list of strings. Each should be the name of a column in
the DataFrame. These columns will be excluded from the result.
Returns:
A new DataFrame containing all columns except those specified. | Returns a new DataFrame with all columns not excluded via exclude_keys. | [
"Returns",
"a",
"new",
"DataFrame",
"with",
"all",
"columns",
"not",
"excluded",
"via",
"exclude_keys",
"."
] | def exclude_columns(self, exclude_keys):
"""Returns a new DataFrame with all columns not excluded via exclude_keys.
Args:
exclude_keys: A list of strings. Each should be the name of a column in
the DataFrame. These columns will be excluded from the result.
Returns:
A new DataFrame cont... | [
"def",
"exclude_columns",
"(",
"self",
",",
"exclude_keys",
")",
":",
"result",
"=",
"type",
"(",
"self",
")",
"(",
")",
"for",
"key",
",",
"value",
"in",
"self",
".",
"_columns",
".",
"items",
"(",
")",
":",
"if",
"key",
"not",
"in",
"exclude_keys",... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/learn/python/learn/dataframe/dataframe.py#L90-L103 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/rnn/python/ops/rnn_cell.py | python | HighwayWrapper.__init__ | (self, cell,
couple_carry_transform_gates=True,
carry_bias_init=1.0) | Constructs a `HighwayWrapper` for `cell`.
Args:
cell: An instance of `RNNCell`.
couple_carry_transform_gates: boolean, should the Carry and Transform gate
be coupled.
carry_bias_init: float, carry gates bias initialization. | Constructs a `HighwayWrapper` for `cell`. | [
"Constructs",
"a",
"HighwayWrapper",
"for",
"cell",
"."
] | def __init__(self, cell,
couple_carry_transform_gates=True,
carry_bias_init=1.0):
"""Constructs a `HighwayWrapper` for `cell`.
Args:
cell: An instance of `RNNCell`.
couple_carry_transform_gates: boolean, should the Carry and Transform gate
be coupled.
car... | [
"def",
"__init__",
"(",
"self",
",",
"cell",
",",
"couple_carry_transform_gates",
"=",
"True",
",",
"carry_bias_init",
"=",
"1.0",
")",
":",
"self",
".",
"_cell",
"=",
"cell",
"self",
".",
"_couple_carry_transform_gates",
"=",
"couple_carry_transform_gates",
"self... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/rnn/python/ops/rnn_cell.py#L1173-L1186 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_distutils/archive_util.py | python | _get_uid | (name) | return None | Returns an uid, given a user name. | Returns an uid, given a user name. | [
"Returns",
"an",
"uid",
"given",
"a",
"user",
"name",
"."
] | def _get_uid(name):
"""Returns an uid, given a user name."""
if getpwnam is None or name is None:
return None
try:
result = getpwnam(name)
except KeyError:
result = None
if result is not None:
return result[2]
return None | [
"def",
"_get_uid",
"(",
"name",
")",
":",
"if",
"getpwnam",
"is",
"None",
"or",
"name",
"is",
"None",
":",
"return",
"None",
"try",
":",
"result",
"=",
"getpwnam",
"(",
"name",
")",
"except",
"KeyError",
":",
"result",
"=",
"None",
"if",
"result",
"i... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/archive_util.py#L43-L53 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/DiamondAttenuationCorrection/FitTransReadUB.py | python | pkintread | (hkl, loc) | return pkint | %reads calculated Fcalc and converts to
%Fobs using Buras-Gerard Eqn.
%inputs are hkl(nref,3) and
% loc(nref,3), which contains, lambda, d-spacing and ttheta for
% each of the nref reflections.
% get Fcalcs for diamond, generated by GSAS (using lattice parameter 3.5668
% and Uiso(C) = 0.0038
... | %reads calculated Fcalc and converts to
%Fobs using Buras-Gerard Eqn.
%inputs are hkl(nref,3) and
% loc(nref,3), which contains, lambda, d-spacing and ttheta for
% each of the nref reflections. | [
"%reads",
"calculated",
"Fcalc",
"and",
"converts",
"to",
"%Fobs",
"using",
"Buras",
"-",
"Gerard",
"Eqn",
".",
"%inputs",
"are",
"hkl",
"(",
"nref",
"3",
")",
"and",
"%",
"loc",
"(",
"nref",
"3",
")",
"which",
"contains",
"lambda",
"d",
"-",
"spacing"... | def pkintread(hkl, loc):
'''
%reads calculated Fcalc and converts to
%Fobs using Buras-Gerard Eqn.
%inputs are hkl(nref,3) and
% loc(nref,3), which contains, lambda, d-spacing and ttheta for
% each of the nref reflections.
% get Fcalcs for diamond, generated by GSAS (using lattice parameter... | [
"def",
"pkintread",
"(",
"hkl",
",",
"loc",
")",
":",
"# A = np.genfromtxt('diamond_reflist.csv', delimiter=',', skip_header=True)",
"# print A",
"A",
"=",
"np",
".",
"array",
"(",
"[",
"[",
"1.00000000e+00",
",",
"1.00000000e+00",
",",
"1.00000000e+00",
",",
"8.00000... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/DiamondAttenuationCorrection/FitTransReadUB.py#L255-L394 | |
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/ansic/cparse.py | python | p_empty | (t) | empty : | empty : | [
"empty",
":"
] | def p_empty(t):
'empty : '
pass | [
"def",
"p_empty",
"(",
"t",
")",
":",
"pass"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L847-L849 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cc.py | python | add_common_cc_variables | (env) | Add underlying common "C compiler" variables that
are used by multiple tools (specifically, c++). | Add underlying common "C compiler" variables that
are used by multiple tools (specifically, c++). | [
"Add",
"underlying",
"common",
"C",
"compiler",
"variables",
"that",
"are",
"used",
"by",
"multiple",
"tools",
"(",
"specifically",
"c",
"++",
")",
"."
] | def add_common_cc_variables(env):
"""
Add underlying common "C compiler" variables that
are used by multiple tools (specifically, c++).
"""
if '_CCCOMCOM' not in env:
env['_CCCOMCOM'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS'
# It's a hack to test for darwin here, but the alternative... | [
"def",
"add_common_cc_variables",
"(",
"env",
")",
":",
"if",
"'_CCCOMCOM'",
"not",
"in",
"env",
":",
"env",
"[",
"'_CCCOMCOM'",
"]",
"=",
"'$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS'",
"# It's a hack to test for darwin here, but the alternative",
"# of creating an applecc.py to co... | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/cc.py#L43-L63 | ||
eomahony/Numberjack | 53fa9e994a36f881ffd320d8d04158097190aad8 | Numberjack/__init__.py | python | Domain.__init__ | (self, arg1, arg2=None) | \internal
This class is used to wrap the domain of variables
in order to print them and/or iterate over values
Initialised from a list of values, or a lower and an upper bound | \internal
This class is used to wrap the domain of variables
in order to print them and/or iterate over values | [
"\\",
"internal",
"This",
"class",
"is",
"used",
"to",
"wrap",
"the",
"domain",
"of",
"variables",
"in",
"order",
"to",
"print",
"them",
"and",
"/",
"or",
"iterate",
"over",
"values"
] | def __init__(self, arg1, arg2=None):
"""
\internal
This class is used to wrap the domain of variables
in order to print them and/or iterate over values
Initialised from a list of values, or a lower and an upper bound
"""
if arg2 is None:
list.__init__... | [
"def",
"__init__",
"(",
"self",
",",
"arg1",
",",
"arg2",
"=",
"None",
")",
":",
"if",
"arg2",
"is",
"None",
":",
"list",
".",
"__init__",
"(",
"self",
",",
"arg1",
")",
"self",
".",
"sort",
"(",
")",
"self",
".",
"is_bound",
"=",
"False",
"else"... | https://github.com/eomahony/Numberjack/blob/53fa9e994a36f881ffd320d8d04158097190aad8/Numberjack/__init__.py#L146-L161 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/lib2to3/pytree.py | python | WildcardPattern._bare_name_matches | (self, nodes) | return count, r | Special optimized matcher for bare_name. | Special optimized matcher for bare_name. | [
"Special",
"optimized",
"matcher",
"for",
"bare_name",
"."
] | def _bare_name_matches(self, nodes):
"""Special optimized matcher for bare_name."""
count = 0
r = {}
done = False
max = len(nodes)
while not done and count < max:
done = True
for leaf in self.content:
if leaf[0].match(nodes[count], ... | [
"def",
"_bare_name_matches",
"(",
"self",
",",
"nodes",
")",
":",
"count",
"=",
"0",
"r",
"=",
"{",
"}",
"done",
"=",
"False",
"max",
"=",
"len",
"(",
"nodes",
")",
"while",
"not",
"done",
"and",
"count",
"<",
"max",
":",
"done",
"=",
"True",
"fo... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/lib2to3/pytree.py#L770-L784 | |
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/utilities/pythonPlugins/src/imageConverter.py | python | main | (argv) | return list(resized) | This is a plugin for the debugCompiler tool. It expects a list of string arguments as input and it returns the
image preprocessed and prepared for input to an ELL test model. The result has to be a list of floats. | This is a plugin for the debugCompiler tool. It expects a list of string arguments as input and it returns the
image preprocessed and prepared for input to an ELL test model. The result has to be a list of floats. | [
"This",
"is",
"a",
"plugin",
"for",
"the",
"debugCompiler",
"tool",
".",
"It",
"expects",
"a",
"list",
"of",
"string",
"arguments",
"as",
"input",
"and",
"it",
"returns",
"the",
"image",
"preprocessed",
"and",
"prepared",
"for",
"input",
"to",
"an",
"ELL",... | def main(argv):
"""
This is a plugin for the debugCompiler tool. It expects a list of string arguments as input and it returns the
image preprocessed and prepared for input to an ELL test model. The result has to be a list of floats.
"""
arg_parser = argparse.ArgumentParser("imageConverter takes a... | [
"def",
"main",
"(",
"argv",
")",
":",
"arg_parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"\"imageConverter takes an image as input and converts it to an array of \\\nfloating point numbers\"",
")",
"arg_parser",
".",
"add_argument",
"(",
"\"--bgr\"",
",",
"default",
... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/utilities/pythonPlugins/src/imageConverter.py#L55-L84 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/ops.py | python | get_from_proto_function | (collection_name) | Returns the from_proto function for collection_name. | Returns the from_proto function for collection_name. | [
"Returns",
"the",
"from_proto",
"function",
"for",
"collection_name",
"."
] | def get_from_proto_function(collection_name):
"""Returns the from_proto function for collection_name."""
try:
return _proto_function_registry.lookup(collection_name)[2]
except LookupError:
return None | [
"def",
"get_from_proto_function",
"(",
"collection_name",
")",
":",
"try",
":",
"return",
"_proto_function_registry",
".",
"lookup",
"(",
"collection_name",
")",
"[",
"2",
"]",
"except",
"LookupError",
":",
"return",
"None"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/ops.py#L6568-L6573 | ||
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/MakefileWriter.py | python | EscapeMakeVariableExpansion | (s) | return s.replace('$', '$$') | Make has its own variable expansion syntax using $. We must escape it for string to be interpreted literally. | Make has its own variable expansion syntax using $. We must escape it for string to be interpreted literally. | [
"Make",
"has",
"its",
"own",
"variable",
"expansion",
"syntax",
"using",
"$",
".",
"We",
"must",
"escape",
"it",
"for",
"string",
"to",
"be",
"interpreted",
"literally",
"."
] | def EscapeMakeVariableExpansion(s):
"""Make has its own variable expansion syntax using $. We must escape it for string to be interpreted literally."""
return s.replace('$', '$$') | [
"def",
"EscapeMakeVariableExpansion",
"(",
"s",
")",
":",
"return",
"s",
".",
"replace",
"(",
"'$'",
",",
"'$$'",
")"
] | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/MakefileWriter.py#L110-L112 | |
ros-perception/image_pipeline | cd4aa7ab38726d88e8e0144aa0d45ad2f236535a | camera_calibration/src/camera_calibration/calibrator.py | python | StereoCalibrator.cal | (self, limages, rimages) | :param limages: source left images containing chessboards
:type limages: list of :class:`cvMat`
:param rimages: source right images containing chessboards
:type rimages: list of :class:`cvMat`
Find chessboards in images, and runs the OpenCV calibration solver. | :param limages: source left images containing chessboards
:type limages: list of :class:`cvMat`
:param rimages: source right images containing chessboards
:type rimages: list of :class:`cvMat` | [
":",
"param",
"limages",
":",
"source",
"left",
"images",
"containing",
"chessboards",
":",
"type",
"limages",
":",
"list",
"of",
":",
"class",
":",
"cvMat",
":",
"param",
"rimages",
":",
"source",
"right",
"images",
"containing",
"chessboards",
":",
"type",... | def cal(self, limages, rimages):
"""
:param limages: source left images containing chessboards
:type limages: list of :class:`cvMat`
:param rimages: source right images containing chessboards
:type rimages: list of :class:`cvMat`
Find chessboards in images, and runs the ... | [
"def",
"cal",
"(",
"self",
",",
"limages",
",",
"rimages",
")",
":",
"goodcorners",
"=",
"self",
".",
"collect_corners",
"(",
"limages",
",",
"rimages",
")",
"self",
".",
"size",
"=",
"(",
"limages",
"[",
"0",
"]",
".",
"shape",
"[",
"1",
"]",
",",... | https://github.com/ros-perception/image_pipeline/blob/cd4aa7ab38726d88e8e0144aa0d45ad2f236535a/camera_calibration/src/camera_calibration/calibrator.py#L1072-L1086 | ||
SIPp/sipp | f44d0cf5dec0013eff8fd7b4da885d455aa82e0e | cpplint.py | python | _SetFilters | (filters) | Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Sets the module's error-message filters. | [
"Sets",
"the",
"module",
"s",
"error",
"-",
"message",
"filters",
"."
] | def _SetFilters(filters):
"""Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint... | [
"def",
"_SetFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"SetFilters",
"(",
"filters",
")"
] | https://github.com/SIPp/sipp/blob/f44d0cf5dec0013eff8fd7b4da885d455aa82e0e/cpplint.py#L661-L671 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Tools/CryVersionSelector/backup_project_gui.py | python | configure_backup | (export_path) | return path | Opens a GUI in which the user can select where the backup is saved. | Opens a GUI in which the user can select where the backup is saved. | [
"Opens",
"a",
"GUI",
"in",
"which",
"the",
"user",
"can",
"select",
"where",
"the",
"backup",
"is",
"saved",
"."
] | def configure_backup(export_path):
"""
Opens a GUI in which the user can select where the backup is saved.
"""
# Return the default export_path if no GUI can be made.
if not HAS_TK:
return export_path
iconfile = "editor_icon16.ico"
if not hasattr(sys, "frozen"):
iconfile = o... | [
"def",
"configure_backup",
"(",
"export_path",
")",
":",
"# Return the default export_path if no GUI can be made.",
"if",
"not",
"HAS_TK",
":",
"return",
"export_path",
"iconfile",
"=",
"\"editor_icon16.ico\"",
"if",
"not",
"hasattr",
"(",
"sys",
",",
"\"frozen\"",
")",... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Tools/CryVersionSelector/backup_project_gui.py#L20-L41 | |
kevinlin311tw/caffe-cvprw15 | 45c2a1bf0368569c54e0be4edf8d34285cf79e70 | scripts/cpp_lint.py | python | ProcessLine | (filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]) | Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
clean_lines: An array of strings, each representing a line of the file,
with comments stripped.
line: Number of line being ... | Processes a single line in the file. | [
"Processes",
"a",
"single",
"line",
"in",
"the",
"file",
"."
] | def ProcessLine(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]):
"""Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (d... | [
"def",
"ProcessLine",
"(",
"filename",
",",
"file_extension",
",",
"clean_lines",
",",
"line",
",",
"include_state",
",",
"function_state",
",",
"nesting_state",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"raw_lines",
"=",
"clean_lines"... | https://github.com/kevinlin311tw/caffe-cvprw15/blob/45c2a1bf0368569c54e0be4edf8d34285cf79e70/scripts/cpp_lint.py#L4600-L4642 | ||
google/certificate-transparency | 2588562fd306a447958471b6f06c1069619c1641 | python/ct/client/db/sqlite_temp_db.py | python | SQLiteTempDBFactory.__init__ | (self, connection_manager, database_dir) | Initialize the database factory.
Args:
connection_manager: an SQLiteConnectionManager object
database_dir: the directory where the database files reside. | Initialize the database factory.
Args:
connection_manager: an SQLiteConnectionManager object
database_dir: the directory where the database files reside. | [
"Initialize",
"the",
"database",
"factory",
".",
"Args",
":",
"connection_manager",
":",
"an",
"SQLiteConnectionManager",
"object",
"database_dir",
":",
"the",
"directory",
"where",
"the",
"database",
"files",
"reside",
"."
] | def __init__(self, connection_manager, database_dir):
"""Initialize the database factory.
Args:
connection_manager: an SQLiteConnectionManager object
database_dir: the directory where the database files reside.
"""
self.__mgr = connection_manager
self.__da... | [
"def",
"__init__",
"(",
"self",
",",
"connection_manager",
",",
"database_dir",
")",
":",
"self",
".",
"__mgr",
"=",
"connection_manager",
"self",
".",
"__database_dir",
"=",
"database_dir",
"# This is the meta-table mapping database IDs to server names.",
"with",
"self",... | https://github.com/google/certificate-transparency/blob/2588562fd306a447958471b6f06c1069619c1641/python/ct/client/db/sqlite_temp_db.py#L12-L24 | ||
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/engine/outputs.py | python | PropertyOutput.open_stream | (self) | Opens the output stream. | Opens the output stream. | [
"Opens",
"the",
"output",
"stream",
"."
] | def open_stream(self):
"""Opens the output stream."""
try:
self.out = open(self.filename, "a")
except:
raise ValueError("Could not open file " + self.filename + " for output")
# print nice header if information is available on the properties
if (self.simul.step == 0) :
... | [
"def",
"open_stream",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"out",
"=",
"open",
"(",
"self",
".",
"filename",
",",
"\"a\"",
")",
"except",
":",
"raise",
"ValueError",
"(",
"\"Could not open file \"",
"+",
"self",
".",
"filename",
"+",
"\" for o... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/engine/outputs.py#L97-L122 | ||
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/setuptools/_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/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/_vendor/pyparsing.py#L4811-L4823 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBBreakpointName.GetCommandLineCommands | (self, commands) | return _lldb.SBBreakpointName_GetCommandLineCommands(self, commands) | GetCommandLineCommands(SBBreakpointName self, SBStringList commands) -> bool | GetCommandLineCommands(SBBreakpointName self, SBStringList commands) -> bool | [
"GetCommandLineCommands",
"(",
"SBBreakpointName",
"self",
"SBStringList",
"commands",
")",
"-",
">",
"bool"
] | def GetCommandLineCommands(self, commands):
"""GetCommandLineCommands(SBBreakpointName self, SBStringList commands) -> bool"""
return _lldb.SBBreakpointName_GetCommandLineCommands(self, commands) | [
"def",
"GetCommandLineCommands",
"(",
"self",
",",
"commands",
")",
":",
"return",
"_lldb",
".",
"SBBreakpointName_GetCommandLineCommands",
"(",
"self",
",",
"commands",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L2309-L2311 | |
ideawu/ssdb | f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4 | deps/cpy/antlr3/dfa.py | python | DFA.unpack | (cls, string) | return ret | @brief Unpack the runlength encoded table data.
Terence implemented packed table initializers, because Java has a
size restriction on .class files and the lookup tables can grow
pretty large. The generated JavaLexer.java of the Java.g example
would be about 15MB with uncompressed array ... | @brief Unpack the runlength encoded table data. | [
"@brief",
"Unpack",
"the",
"runlength",
"encoded",
"table",
"data",
"."
] | def unpack(cls, string):
"""@brief Unpack the runlength encoded table data.
Terence implemented packed table initializers, because Java has a
size restriction on .class files and the lookup tables can grow
pretty large. The generated JavaLexer.java of the Java.g example
would be... | [
"def",
"unpack",
"(",
"cls",
",",
"string",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"string",
")",
"/",
"2",
")",
":",
"(",
"n",
",",
"v",
")",
"=",
"ord",
"(",
"string",
"[",
"i",
"*",
"2",
"]",
")",
... | https://github.com/ideawu/ssdb/blob/f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4/deps/cpy/antlr3/dfa.py#L184-L211 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/common_transformers/anf.py | python | AnfTransformer._ensure_node_in_anf | (self, parent, field, node) | Puts `node` in A-normal form, by replacing it with a variable if needed.
The exact definition of A-normal form is given by the configuration. The
parent and the incoming field name are only needed because the configuration
may be context-dependent.
Args:
parent: An AST node, the parent of `node... | Puts `node` in A-normal form, by replacing it with a variable if needed. | [
"Puts",
"node",
"in",
"A",
"-",
"normal",
"form",
"by",
"replacing",
"it",
"with",
"a",
"variable",
"if",
"needed",
"."
] | def _ensure_node_in_anf(self, parent, field, node):
"""Puts `node` in A-normal form, by replacing it with a variable if needed.
The exact definition of A-normal form is given by the configuration. The
parent and the incoming field name are only needed because the configuration
may be context-dependent... | [
"def",
"_ensure_node_in_anf",
"(",
"self",
",",
"parent",
",",
"field",
",",
"node",
")",
":",
"if",
"node",
"is",
"None",
":",
"return",
"node",
"if",
"(",
"isinstance",
"(",
"node",
",",
"self",
".",
"_trivial_nodes",
")",
"and",
"not",
"_is_py2_name_c... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/autograph/pyct/common_transformers/anf.py#L184-L220 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py | python | Notebook.tabs | (self) | return self.tk.splitlist(self.tk.call(self._w, "tabs") or ()) | Returns a list of windows managed by the notebook. | Returns a list of windows managed by the notebook. | [
"Returns",
"a",
"list",
"of",
"windows",
"managed",
"by",
"the",
"notebook",
"."
] | def tabs(self):
"""Returns a list of windows managed by the notebook."""
return self.tk.splitlist(self.tk.call(self._w, "tabs") or ()) | [
"def",
"tabs",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"splitlist",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"tabs\"",
")",
"or",
"(",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py#L906-L908 | |
alibaba/weex_js_engine | 2bdf4b6f020c1fc99c63f649718f6faf7e27fdde | jni/v8core/v8/build/gyp/pylib/gyp/mac_tool.py | python | MacTool._CopyStringsFile | (self, source, dest) | Copies a .strings file using iconv to reconvert the input into UTF-16. | Copies a .strings file using iconv to reconvert the input into UTF-16. | [
"Copies",
"a",
".",
"strings",
"file",
"using",
"iconv",
"to",
"reconvert",
"the",
"input",
"into",
"UTF",
"-",
"16",
"."
] | def _CopyStringsFile(self, source, dest):
"""Copies a .strings file using iconv to reconvert the input into UTF-16."""
input_code = self._DetectInputEncoding(source) or "UTF-8"
fp = open(dest, 'w')
args = ['/usr/bin/iconv', '--from-code', input_code, '--to-code',
'UTF-16', source]
subprocess... | [
"def",
"_CopyStringsFile",
"(",
"self",
",",
"source",
",",
"dest",
")",
":",
"input_code",
"=",
"self",
".",
"_DetectInputEncoding",
"(",
"source",
")",
"or",
"\"UTF-8\"",
"fp",
"=",
"open",
"(",
"dest",
",",
"'w'",
")",
"args",
"=",
"[",
"'/usr/bin/ico... | https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/build/gyp/pylib/gyp/mac_tool.py#L80-L87 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | DateTime.SetYear | (*args, **kwargs) | return _misc_.DateTime_SetYear(*args, **kwargs) | SetYear(self, int year) -> DateTime | SetYear(self, int year) -> DateTime | [
"SetYear",
"(",
"self",
"int",
"year",
")",
"-",
">",
"DateTime"
] | def SetYear(*args, **kwargs):
"""SetYear(self, int year) -> DateTime"""
return _misc_.DateTime_SetYear(*args, **kwargs) | [
"def",
"SetYear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DateTime_SetYear",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L3817-L3819 | |
DGtal-team/DGtal | b403217bae9a55638a0a8baac69cc7e8d6362af5 | wrap/__init__.py | python | SPreCell | (dim=(), point=(), positive=True) | Factory helper function for DGtal::PreCell
Parameters
----------
dim: Int
Dimension of the space (2D or 3D)
point: dgtal.Point of the same dimension
If empty (default) returns a default constructed PreCell
positive: Bool [True by default]
Sign of the cell.
Example:
... | Factory helper function for DGtal::PreCell | [
"Factory",
"helper",
"function",
"for",
"DGtal",
"::",
"PreCell"
] | def SPreCell(dim=(), point=(), positive=True):
"""
Factory helper function for DGtal::PreCell
Parameters
----------
dim: Int
Dimension of the space (2D or 3D)
point: dgtal.Point of the same dimension
If empty (default) returns a default constructed PreCell
positive: Bool [Tr... | [
"def",
"SPreCell",
"(",
"dim",
"=",
"(",
")",
",",
"point",
"=",
"(",
")",
",",
"positive",
"=",
"True",
")",
":",
"if",
"not",
"dim",
"and",
"not",
"point",
":",
"raise",
"ValueError",
"(",
"\"Provide at least one of the following parameters: dim or point\"",... | https://github.com/DGtal-team/DGtal/blob/b403217bae9a55638a0a8baac69cc7e8d6362af5/wrap/__init__.py#L190-L230 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/tensor_shape.py | python | matrix | (rows, cols) | return TensorShape([rows, cols]) | Returns a shape representing a matrix.
Args:
rows: The number of rows in the matrix, which may be None if unknown.
cols: The number of columns in the matrix, which may be None if unknown.
Returns:
A TensorShape representing a matrix of the given size. | Returns a shape representing a matrix. | [
"Returns",
"a",
"shape",
"representing",
"a",
"matrix",
"."
] | def matrix(rows, cols):
"""Returns a shape representing a matrix.
Args:
rows: The number of rows in the matrix, which may be None if unknown.
cols: The number of columns in the matrix, which may be None if unknown.
Returns:
A TensorShape representing a matrix of the given size.
"""
return Tensor... | [
"def",
"matrix",
"(",
"rows",
",",
"cols",
")",
":",
"return",
"TensorShape",
"(",
"[",
"rows",
",",
"cols",
"]",
")"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/tensor_shape.py#L836-L846 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ast.py | python | iter_child_nodes | (node) | Yield all direct child nodes of *node*, that is, all fields that are nodes
and all items of fields that are lists of nodes. | Yield all direct child nodes of *node*, that is, all fields that are nodes
and all items of fields that are lists of nodes. | [
"Yield",
"all",
"direct",
"child",
"nodes",
"of",
"*",
"node",
"*",
"that",
"is",
"all",
"fields",
"that",
"are",
"nodes",
"and",
"all",
"items",
"of",
"fields",
"that",
"are",
"lists",
"of",
"nodes",
"."
] | def iter_child_nodes(node):
"""
Yield all direct child nodes of *node*, that is, all fields that are nodes
and all items of fields that are lists of nodes.
"""
for name, field in iter_fields(node):
if isinstance(field, AST):
yield field
elif isinstance(field, list):
... | [
"def",
"iter_child_nodes",
"(",
"node",
")",
":",
"for",
"name",
",",
"field",
"in",
"iter_fields",
"(",
"node",
")",
":",
"if",
"isinstance",
"(",
"field",
",",
"AST",
")",
":",
"yield",
"field",
"elif",
"isinstance",
"(",
"field",
",",
"list",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ast.py#L193-L204 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py | python | FetchLayoutsData | (client) | return ret | Fetches the keyboard glyph data from the spreadsheet. | Fetches the keyboard glyph data from the spreadsheet. | [
"Fetches",
"the",
"keyboard",
"glyph",
"data",
"from",
"the",
"spreadsheet",
"."
] | def FetchLayoutsData(client):
"""Fetches the keyboard glyph data from the spreadsheet."""
layout_names = ['U_layout', 'J_layout', 'E_layout', 'B_layout']
cols = ['scancode', 'x', 'y', 'w', 'h']
layouts = FetchSpreadsheetFeeds(client, KEYBOARD_GLYPH_SPREADSHEET_KEY,
layout_names... | [
"def",
"FetchLayoutsData",
"(",
"client",
")",
":",
"layout_names",
"=",
"[",
"'U_layout'",
",",
"'J_layout'",
",",
"'E_layout'",
",",
"'B_layout'",
"]",
"cols",
"=",
"[",
"'scancode'",
",",
"'x'",
",",
"'y'",
",",
"'w'",
",",
"'h'",
"]",
"layouts",
"=",... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py#L366-L386 | |
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/interfaces/covariance_interface.py | python | CovarianceInterface.get_hyperparameters | (self) | Get the hyperparameters (array of float64 with shape (num_hyperparameters)) of this covariance. | Get the hyperparameters (array of float64 with shape (num_hyperparameters)) of this covariance. | [
"Get",
"the",
"hyperparameters",
"(",
"array",
"of",
"float64",
"with",
"shape",
"(",
"num_hyperparameters",
"))",
"of",
"this",
"covariance",
"."
] | def get_hyperparameters(self):
"""Get the hyperparameters (array of float64 with shape (num_hyperparameters)) of this covariance."""
pass | [
"def",
"get_hyperparameters",
"(",
"self",
")",
":",
"pass"
] | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/interfaces/covariance_interface.py#L58-L60 | ||
mandiant/flare-wmi | b0a5a094ff9ca7d7a1c4fc711dc00c74dec4b6b1 | python-cim/cim/objects.py | python | ClassLayout.property_default_values | (self) | return default_values | :rtype: PropertyDefaultValues | :rtype: PropertyDefaultValues | [
":",
"rtype",
":",
"PropertyDefaultValues"
] | def property_default_values(self):
""" :rtype: PropertyDefaultValues """
props = self.properties.values()
props = sorted(props, key=lambda p: p.index)
default_values = PropertyDefaultValues(props)
d = self.class_definition.property_default_values_data
default_values.vsPar... | [
"def",
"property_default_values",
"(",
"self",
")",
":",
"props",
"=",
"self",
".",
"properties",
".",
"values",
"(",
")",
"props",
"=",
"sorted",
"(",
"props",
",",
"key",
"=",
"lambda",
"p",
":",
"p",
".",
"index",
")",
"default_values",
"=",
"Proper... | https://github.com/mandiant/flare-wmi/blob/b0a5a094ff9ca7d7a1c4fc711dc00c74dec4b6b1/python-cim/cim/objects.py#L1085-L1092 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/tpu/tensor_tracer.py | python | TensorTracer._get_op_control_flow_context | (self, op) | return op_control_flow_context | Returns the control flow of the given op.
Args:
op: tf.Operation for which the control flow context is requested.
Returns:
op_control_flow_context: which the is control flow context of the given
op. If the operation type is LoopExit, returns the outer control flow
context. | Returns the control flow of the given op. | [
"Returns",
"the",
"control",
"flow",
"of",
"the",
"given",
"op",
"."
] | def _get_op_control_flow_context(self, op):
"""Returns the control flow of the given op.
Args:
op: tf.Operation for which the control flow context is requested.
Returns:
op_control_flow_context: which the is control flow context of the given
op. If the operation type is LoopExit, returns ... | [
"def",
"_get_op_control_flow_context",
"(",
"self",
",",
"op",
")",
":",
"# pylint: disable=protected-access",
"op_control_flow_context",
"=",
"op",
".",
"_control_flow_context",
"# pylint: enable=protected-access",
"if",
"control_flow_util",
".",
"IsLoopExit",
"(",
"op",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tensor_tracer.py#L1641-L1656 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py | python | ParserElement.setParseAction | ( self, *fns, **kwargs ) | return self | Define one or more actions to perform when successfully matching parse element definition.
Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)},
C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where:
- s = the original string being parsed (see note below)
... | [] | def setParseAction( self, *fns, **kwargs ):
"""
Define one or more actions to perform when successfully matching parse element definition.
Parse action fn is a callable method with 0-3 arguments, called as C{fn(s,loc,toks)},
C{fn(loc,toks)}, C{fn(toks)}, or just C{fn()}, where:
... | [
"def",
"setParseAction",
"(",
"self",
",",
"*",
"fns",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"parseAction",
"=",
"list",
"(",
"map",
"(",
"_trim_arity",
",",
"list",
"(",
"fns",
")",
")",
")",
"self",
".",
"callDuringTry",
"=",
"kwargs",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py#L2499-L2571 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/hmac.py | python | HMAC.update | (self, msg) | Update this hashing object with the string msg. | Update this hashing object with the string msg. | [
"Update",
"this",
"hashing",
"object",
"with",
"the",
"string",
"msg",
"."
] | def update(self, msg):
"""Update this hashing object with the string msg.
"""
self.inner.update(msg) | [
"def",
"update",
"(",
"self",
",",
"msg",
")",
":",
"self",
".",
"inner",
".",
"update",
"(",
"msg",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/hmac.py#L80-L83 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | SimBody.getTransform | (self) | return _robotsim.SimBody_getTransform(self) | getTransform(SimBody self)
Gets the body's transformation at the current simulation time step (in center-
of-mass centered coordinates). | getTransform(SimBody self) | [
"getTransform",
"(",
"SimBody",
"self",
")"
] | def getTransform(self):
"""
getTransform(SimBody self)
Gets the body's transformation at the current simulation time step (in center-
of-mass centered coordinates).
"""
return _robotsim.SimBody_getTransform(self) | [
"def",
"getTransform",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"SimBody_getTransform",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L7956-L7966 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | BooleanVar.get | (self) | Return the value of the variable as a bool. | Return the value of the variable as a bool. | [
"Return",
"the",
"value",
"of",
"the",
"variable",
"as",
"a",
"bool",
"."
] | def get(self):
"""Return the value of the variable as a bool."""
try:
return self._tk.getboolean(self._tk.globalgetvar(self._name))
except TclError:
raise ValueError("invalid literal for getboolean()") | [
"def",
"get",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_tk",
".",
"getboolean",
"(",
"self",
".",
"_tk",
".",
"globalgetvar",
"(",
"self",
".",
"_name",
")",
")",
"except",
"TclError",
":",
"raise",
"ValueError",
"(",
"\"invalid liter... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L551-L556 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.WriteActions | (self, actions, extra_sources, extra_outputs) | Write Makefile code for any 'actions' from the gyp input.
extra_sources: a list that will be filled in with newly generated source
files, if any
extra_outputs: a list that will be filled in with any outputs of these
actions (used to make other pieces dependent on these
... | Write Makefile code for any 'actions' from the gyp input. | [
"Write",
"Makefile",
"code",
"for",
"any",
"actions",
"from",
"the",
"gyp",
"input",
"."
] | def WriteActions(self, actions, extra_sources, extra_outputs):
"""Write Makefile code for any 'actions' from the gyp input.
extra_sources: a list that will be filled in with newly generated source
files, if any
extra_outputs: a list that will be filled in with any outputs of these
... | [
"def",
"WriteActions",
"(",
"self",
",",
"actions",
",",
"extra_sources",
",",
"extra_outputs",
")",
":",
"for",
"action",
"in",
"actions",
":",
"name",
"=",
"make",
".",
"StringToMakefileVariable",
"(",
"'%s_%s'",
"%",
"(",
"self",
".",
"relative_target",
"... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py#L232-L323 | ||
liulei01/DRBox | b5c76e033c555c9009590ab384e1f7bd3c66c237 | scripts/cpp_lint.py | python | _SetFilters | (filters) | Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Sets the module's error-message filters. | [
"Sets",
"the",
"module",
"s",
"error",
"-",
"message",
"filters",
"."
] | def _SetFilters(filters):
"""Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint... | [
"def",
"_SetFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"SetFilters",
"(",
"filters",
")"
] | https://github.com/liulei01/DRBox/blob/b5c76e033c555c9009590ab384e1f7bd3c66c237/scripts/cpp_lint.py#L797-L807 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/resource_variable_ops.py | python | BaseResourceVariable.sparse_read | (self, indices, name=None) | return array_ops.identity(value) | Reads the value of this variable sparsely, using `gather`. | Reads the value of this variable sparsely, using `gather`. | [
"Reads",
"the",
"value",
"of",
"this",
"variable",
"sparsely",
"using",
"gather",
"."
] | def sparse_read(self, indices, name=None):
"""Reads the value of this variable sparsely, using `gather`."""
with ops.name_scope("Gather" if name is None else name) as name:
variable_accessed(self)
value = gen_resource_variable_ops.resource_gather(
self.handle, indices, dtype=self._dtype, n... | [
"def",
"sparse_read",
"(",
"self",
",",
"indices",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"\"Gather\"",
"if",
"name",
"is",
"None",
"else",
"name",
")",
"as",
"name",
":",
"variable_accessed",
"(",
"self",
")",
"valu... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/resource_variable_ops.py#L745-L761 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | PrintDialogData.SetMaxPage | (*args, **kwargs) | return _windows_.PrintDialogData_SetMaxPage(*args, **kwargs) | SetMaxPage(self, int v) | SetMaxPage(self, int v) | [
"SetMaxPage",
"(",
"self",
"int",
"v",
")"
] | def SetMaxPage(*args, **kwargs):
"""SetMaxPage(self, int v)"""
return _windows_.PrintDialogData_SetMaxPage(*args, **kwargs) | [
"def",
"SetMaxPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintDialogData_SetMaxPage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L5090-L5092 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | tools/otci/otci/otci.py | python | OTCI.coap_start | (self) | Starts the application coap service. | Starts the application coap service. | [
"Starts",
"the",
"application",
"coap",
"service",
"."
] | def coap_start(self):
"""Starts the application coap service."""
self.execute_command('coap start') | [
"def",
"coap_start",
"(",
"self",
")",
":",
"self",
".",
"execute_command",
"(",
"'coap start'",
")"
] | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/otci/otci/otci.py#L2273-L2275 | ||
KDE/krita | 10ea63984e00366865769c193ab298de73a59c5c | plugins/python/scripter/uicontroller.py | python | UIController._readSettings | (self) | It's similar to _writeSettings, but reading the settings when the ScripterDialog is closed. | It's similar to _writeSettings, but reading the settings when the ScripterDialog is closed. | [
"It",
"s",
"similar",
"to",
"_writeSettings",
"but",
"reading",
"the",
"settings",
"when",
"the",
"ScripterDialog",
"is",
"closed",
"."
] | def _readSettings(self):
""" It's similar to _writeSettings, but reading the settings when the ScripterDialog is closed. """
self.scripter.settings.beginGroup('scripter')
activeDocumentPath = self.scripter.settings.value('activeDocumentPath', '')
if activeDocumentPath:
if ... | [
"def",
"_readSettings",
"(",
"self",
")",
":",
"self",
".",
"scripter",
".",
"settings",
".",
"beginGroup",
"(",
"'scripter'",
")",
"activeDocumentPath",
"=",
"self",
".",
"scripter",
".",
"settings",
".",
"value",
"(",
"'activeDocumentPath'",
",",
"''",
")"... | https://github.com/KDE/krita/blob/10ea63984e00366865769c193ab298de73a59c5c/plugins/python/scripter/uicontroller.py#L227-L252 | ||
ucsb-seclab/dr_checker | fe3f1cda247a10a4952e372f1e240709fe4be462 | helper_scripts/runner_scripts/components/llvm_build.py | python | _get_llvm_build_str | (src_root_dir, gcc_build_string, output_folder, target_arch, clang_path, build_output_dir=None) | return ' '.join(modified_build_args) | Get LLVM build string from gcc build string
:param src_root_dir: Directory containing all sources.
:param gcc_build_string: GCC build string.
:param output_folder: folder where llvm bitcode should be placed.
:param target_arch: [1/2] depending on whether the arch is 32 or 64 bit.
:param build_output... | Get LLVM build string from gcc build string
:param src_root_dir: Directory containing all sources.
:param gcc_build_string: GCC build string.
:param output_folder: folder where llvm bitcode should be placed.
:param target_arch: [1/2] depending on whether the arch is 32 or 64 bit.
:param build_output... | [
"Get",
"LLVM",
"build",
"string",
"from",
"gcc",
"build",
"string",
":",
"param",
"src_root_dir",
":",
"Directory",
"containing",
"all",
"sources",
".",
":",
"param",
"gcc_build_string",
":",
"GCC",
"build",
"string",
".",
":",
"param",
"output_folder",
":",
... | def _get_llvm_build_str(src_root_dir, gcc_build_string, output_folder, target_arch, clang_path, build_output_dir=None):
"""
Get LLVM build string from gcc build string
:param src_root_dir: Directory containing all sources.
:param gcc_build_string: GCC build string.
:param output_folder: folder w... | [
"def",
"_get_llvm_build_str",
"(",
"src_root_dir",
",",
"gcc_build_string",
",",
"output_folder",
",",
"target_arch",
",",
"clang_path",
",",
"build_output_dir",
"=",
"None",
")",
":",
"orig_build_args",
"=",
"gcc_build_string",
".",
"strip",
"(",
")",
".",
"split... | https://github.com/ucsb-seclab/dr_checker/blob/fe3f1cda247a10a4952e372f1e240709fe4be462/helper_scripts/runner_scripts/components/llvm_build.py#L144-L208 | |
openvinotoolkit/openvino | dedcbeafa8b84cccdc55ca64b8da516682b381c7 | src/bindings/python/src/compatibility/ngraph/utils/node_factory.py | python | NodeFactory.__init__ | (self, opset_version: str = DEFAULT_OPSET) | Create the NodeFactory object.
@param opset_version: The opset version the factory will use to produce ops from. | Create the NodeFactory object. | [
"Create",
"the",
"NodeFactory",
"object",
"."
] | def __init__(self, opset_version: str = DEFAULT_OPSET) -> None:
"""Create the NodeFactory object.
@param opset_version: The opset version the factory will use to produce ops from.
"""
self.factory = _NodeFactory(opset_version) | [
"def",
"__init__",
"(",
"self",
",",
"opset_version",
":",
"str",
"=",
"DEFAULT_OPSET",
")",
"->",
"None",
":",
"self",
".",
"factory",
"=",
"_NodeFactory",
"(",
"opset_version",
")"
] | https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/utils/node_factory.py#L21-L26 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/browser.py | python | ChildBrowserTreeItem.GetIconName | (self) | Return the name of the icon to display. | Return the name of the icon to display. | [
"Return",
"the",
"name",
"of",
"the",
"icon",
"to",
"display",
"."
] | def GetIconName(self):
"Return the name of the icon to display."
if self.isfunction:
return "python"
else:
return "folder" | [
"def",
"GetIconName",
"(",
"self",
")",
":",
"if",
"self",
".",
"isfunction",
":",
"return",
"\"python\"",
"else",
":",
"return",
"\"folder\""
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/browser.py#L207-L212 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/importlib/_common.py | python | as_file | (path) | Given a Traversable object, return that object as a
path on the local file system in a context manager. | Given a Traversable object, return that object as a
path on the local file system in a context manager. | [
"Given",
"a",
"Traversable",
"object",
"return",
"that",
"object",
"as",
"a",
"path",
"on",
"the",
"local",
"file",
"system",
"in",
"a",
"context",
"manager",
"."
] | def as_file(path):
"""
Given a Traversable object, return that object as a
path on the local file system in a context manager.
"""
with _tempfile(path.read_bytes, suffix=path.name) as local:
yield local | [
"def",
"as_file",
"(",
"path",
")",
":",
"with",
"_tempfile",
"(",
"path",
".",
"read_bytes",
",",
"suffix",
"=",
"path",
".",
"name",
")",
"as",
"local",
":",
"yield",
"local"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/_common.py#L47-L53 | ||
google/flatbuffers | b3006913369e0a7550795e477011ac5bebb93497 | python/flatbuffers/builder.py | python | Builder.PrependInt32 | (self, x) | Prepend an `int32` to the Builder buffer.
Note: aligns and checks for space. | Prepend an `int32` to the Builder buffer. | [
"Prepend",
"an",
"int32",
"to",
"the",
"Builder",
"buffer",
"."
] | def PrependInt32(self, x):
"""Prepend an `int32` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Int32Flags, x) | [
"def",
"PrependInt32",
"(",
"self",
",",
"x",
")",
":",
"self",
".",
"Prepend",
"(",
"N",
".",
"Int32Flags",
",",
"x",
")"
] | https://github.com/google/flatbuffers/blob/b3006913369e0a7550795e477011ac5bebb93497/python/flatbuffers/builder.py#L678-L683 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/codedeploy/layer1.py | python | CodeDeployConnection.delete_deployment_config | (self, deployment_config_name) | return self.make_request(action='DeleteDeploymentConfig',
body=json.dumps(params)) | Deletes a deployment configuration.
A deployment configuration cannot be deleted if it is
currently in use. Also, predefined configurations cannot be
deleted.
:type deployment_config_name: string
:param deployment_config_name: The name of an existing deployment
conf... | Deletes a deployment configuration. | [
"Deletes",
"a",
"deployment",
"configuration",
"."
] | def delete_deployment_config(self, deployment_config_name):
"""
Deletes a deployment configuration.
A deployment configuration cannot be deleted if it is
currently in use. Also, predefined configurations cannot be
deleted.
:type deployment_config_name: string
:p... | [
"def",
"delete_deployment_config",
"(",
"self",
",",
"deployment_config_name",
")",
":",
"params",
"=",
"{",
"'deploymentConfigName'",
":",
"deployment_config_name",
",",
"}",
"return",
"self",
".",
"make_request",
"(",
"action",
"=",
"'DeleteDeploymentConfig'",
",",
... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/codedeploy/layer1.py#L396-L411 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | chrome/common/extensions/docs/server2/api_categorizer.py | python | APICategorizer.GetCategory | (self, platform, api_name) | return 'chrome' | Return the type of api.'Chrome' means the public apis,
private means the api only used by chrome, and experimental means
the apis with "experimental" prefix. | Return the type of api.'Chrome' means the public apis,
private means the api only used by chrome, and experimental means
the apis with "experimental" prefix. | [
"Return",
"the",
"type",
"of",
"api",
".",
"Chrome",
"means",
"the",
"public",
"apis",
"private",
"means",
"the",
"api",
"only",
"used",
"by",
"chrome",
"and",
"experimental",
"means",
"the",
"apis",
"with",
"experimental",
"prefix",
"."
] | def GetCategory(self, platform, api_name):
'''Return the type of api.'Chrome' means the public apis,
private means the api only used by chrome, and experimental means
the apis with "experimental" prefix.
'''
documented_apis = self._GenerateAPICategories(platform)
if (api_name.endswith('Private')... | [
"def",
"GetCategory",
"(",
"self",
",",
"platform",
",",
"api_name",
")",
":",
"documented_apis",
"=",
"self",
".",
"_GenerateAPICategories",
"(",
"platform",
")",
"if",
"(",
"api_name",
".",
"endswith",
"(",
"'Private'",
")",
"or",
"api_name",
"not",
"in",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/common/extensions/docs/server2/api_categorizer.py#L35-L46 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py3/setuptools/_vendor/more_itertools/more.py | python | stagger | (iterable, offsets=(-1, 0, 1), longest=False, fillvalue=None) | return zip_offset(
*children, offsets=offsets, longest=longest, fillvalue=fillvalue
) | Yield tuples whose elements are offset from *iterable*.
The amount by which the `i`-th item in each tuple is offset is given by
the `i`-th item in *offsets*.
>>> list(stagger([0, 1, 2, 3]))
[(None, 0, 1), (0, 1, 2), (1, 2, 3)]
>>> list(stagger(range(8), offsets=(0, 2, 4)))
[(0, ... | Yield tuples whose elements are offset from *iterable*.
The amount by which the `i`-th item in each tuple is offset is given by
the `i`-th item in *offsets*. | [
"Yield",
"tuples",
"whose",
"elements",
"are",
"offset",
"from",
"*",
"iterable",
"*",
".",
"The",
"amount",
"by",
"which",
"the",
"i",
"-",
"th",
"item",
"in",
"each",
"tuple",
"is",
"offset",
"is",
"given",
"by",
"the",
"i",
"-",
"th",
"item",
"in"... | def stagger(iterable, offsets=(-1, 0, 1), longest=False, fillvalue=None):
"""Yield tuples whose elements are offset from *iterable*.
The amount by which the `i`-th item in each tuple is offset is given by
the `i`-th item in *offsets*.
>>> list(stagger([0, 1, 2, 3]))
[(None, 0, 1), (0, 1, 2)... | [
"def",
"stagger",
"(",
"iterable",
",",
"offsets",
"=",
"(",
"-",
"1",
",",
"0",
",",
"1",
")",
",",
"longest",
"=",
"False",
",",
"fillvalue",
"=",
"None",
")",
":",
"children",
"=",
"tee",
"(",
"iterable",
",",
"len",
"(",
"offsets",
")",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_vendor/more_itertools/more.py#L1454-L1479 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/subprocess.py | python | getoutput | (cmd) | return getstatusoutput(cmd)[1] | Return output (stdout or stderr) of executing cmd in a shell.
Like getstatusoutput(), except the exit status is ignored and the return
value is a string containing the command's output. Example:
>>> import subprocess
>>> subprocess.getoutput('ls /bin/ls')
'/bin/ls' | Return output (stdout or stderr) of executing cmd in a shell. | [
"Return",
"output",
"(",
"stdout",
"or",
"stderr",
")",
"of",
"executing",
"cmd",
"in",
"a",
"shell",
"."
] | def getoutput(cmd):
"""Return output (stdout or stderr) of executing cmd in a shell.
Like getstatusoutput(), except the exit status is ignored and the return
value is a string containing the command's output. Example:
>>> import subprocess
>>> subprocess.getoutput('ls /bin/ls')
'/bin/ls'
... | [
"def",
"getoutput",
"(",
"cmd",
")",
":",
"return",
"getstatusoutput",
"(",
"cmd",
")",
"[",
"1",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/subprocess.py#L620-L630 | |
openthread/openthread | 9fcdbed9c526c70f1556d1ed84099c1535c7cd32 | third_party/mbedtls/repo/scripts/assemble_changelog.py | python | ChangeLog.add_categories_from_text | (self, filename, line_offset,
text, allow_unknown_category) | Parse a version section or entry file. | Parse a version section or entry file. | [
"Parse",
"a",
"version",
"section",
"or",
"entry",
"file",
"."
] | def add_categories_from_text(self, filename, line_offset,
text, allow_unknown_category):
"""Parse a version section or entry file."""
try:
categories = self.format.split_categories(text)
except CategoryParseError as e:
raise InputFormatErr... | [
"def",
"add_categories_from_text",
"(",
"self",
",",
"filename",
",",
"line_offset",
",",
"text",
",",
"allow_unknown_category",
")",
":",
"try",
":",
"categories",
"=",
"self",
".",
"format",
".",
"split_categories",
"(",
"text",
")",
"except",
"CategoryParseEr... | https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/third_party/mbedtls/repo/scripts/assemble_changelog.py#L202-L217 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.