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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/data.py | python | Expansion.lstrip | (self) | Strip leading literal whitespace from this expansion. | Strip leading literal whitespace from this expansion. | [
"Strip",
"leading",
"literal",
"whitespace",
"from",
"this",
"expansion",
"."
] | def lstrip(self):
"""Strip leading literal whitespace from this expansion."""
while True:
i, isfunc = self[0]
if isfunc:
return
i = i.lstrip()
if i != '':
self[0] = i, False
return
del self[0] | [
"def",
"lstrip",
"(",
"self",
")",
":",
"while",
"True",
":",
"i",
",",
"isfunc",
"=",
"self",
"[",
"0",
"]",
"if",
"isfunc",
":",
"return",
"i",
"=",
"i",
".",
"lstrip",
"(",
")",
"if",
"i",
"!=",
"''",
":",
"self",
"[",
"0",
"]",
"=",
"i"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/data.py#L256-L268 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | OptionMenu.__init__ | (self, master, variable, value, *values, **kwargs) | Construct an optionmenu widget with the parent MASTER, with
the resource textvariable set to VARIABLE, the initially selected
value VALUE, the other menu values VALUES and an additional
keyword argument command. | Construct an optionmenu widget with the parent MASTER, with
the resource textvariable set to VARIABLE, the initially selected
value VALUE, the other menu values VALUES and an additional
keyword argument command. | [
"Construct",
"an",
"optionmenu",
"widget",
"with",
"the",
"parent",
"MASTER",
"with",
"the",
"resource",
"textvariable",
"set",
"to",
"VARIABLE",
"the",
"initially",
"selected",
"value",
"VALUE",
"the",
"other",
"menu",
"values",
"VALUES",
"and",
"an",
"addition... | def __init__(self, master, variable, value, *values, **kwargs):
"""Construct an optionmenu widget with the parent MASTER, with
the resource textvariable set to VARIABLE, the initially selected
value VALUE, the other menu values VALUES and an additional
keyword argument command."""
... | [
"def",
"__init__",
"(",
"self",
",",
"master",
",",
"variable",
",",
"value",
",",
"*",
"values",
",",
"*",
"*",
"kwargs",
")",
":",
"kw",
"=",
"{",
"\"borderwidth\"",
":",
"2",
",",
"\"textvariable\"",
":",
"variable",
",",
"\"indicatoron\"",
":",
"1"... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L3204-L3227 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_gui/reduction/sans/hfir_background_script.py | python | Background.from_xml | (self, xml_str) | Read in data from XML
@param xml_str: text to read the data from | Read in data from XML | [
"Read",
"in",
"data",
"from",
"XML"
] | def from_xml(self, xml_str):
"""
Read in data from XML
@param xml_str: text to read the data from
"""
dom = xml.dom.minidom.parseString(xml_str)
element_list = dom.getElementsByTagName("Background")
if len(element_list)>0:
instrument_dom = elem... | [
"def",
"from_xml",
"(",
"self",
",",
"xml_str",
")",
":",
"dom",
"=",
"xml",
".",
"dom",
".",
"minidom",
".",
"parseString",
"(",
"xml_str",
")",
"element_list",
"=",
"dom",
".",
"getElementsByTagName",
"(",
"\"Background\"",
")",
"if",
"len",
"(",
"elem... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/sans/hfir_background_script.py#L190-L229 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py | python | Listbox.selection_set | (self, first, last=None) | Set the selection from FIRST to LAST (not included) without
changing the currently selected elements. | Set the selection from FIRST to LAST (not included) without
changing the currently selected elements. | [
"Set",
"the",
"selection",
"from",
"FIRST",
"to",
"LAST",
"(",
"not",
"included",
")",
"without",
"changing",
"the",
"currently",
"selected",
"elements",
"."
] | def selection_set(self, first, last=None):
"""Set the selection from FIRST to LAST (not included) without
changing the currently selected elements."""
self.tk.call(self._w, 'selection', 'set', first, last) | [
"def",
"selection_set",
"(",
"self",
",",
"first",
",",
"last",
"=",
"None",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'selection'",
",",
"'set'",
",",
"first",
",",
"last",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/Tkinter.py#L2610-L2613 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/compiler/pyassem.py | python | Block.has_unconditional_transfer | (self) | return op in self._uncond_transfer | Returns True if there is an unconditional transfer to an other block
at the end of this block. This means there is no risk for the bytecode
executer to go past this block's bytecode. | Returns True if there is an unconditional transfer to an other block
at the end of this block. This means there is no risk for the bytecode
executer to go past this block's bytecode. | [
"Returns",
"True",
"if",
"there",
"is",
"an",
"unconditional",
"transfer",
"to",
"an",
"other",
"block",
"at",
"the",
"end",
"of",
"this",
"block",
".",
"This",
"means",
"there",
"is",
"no",
"risk",
"for",
"the",
"bytecode",
"executer",
"to",
"go",
"past... | def has_unconditional_transfer(self):
"""Returns True if there is an unconditional transfer to an other block
at the end of this block. This means there is no risk for the bytecode
executer to go past this block's bytecode."""
try:
op, arg = self.insts[-1]
except (Ind... | [
"def",
"has_unconditional_transfer",
"(",
"self",
")",
":",
"try",
":",
"op",
",",
"arg",
"=",
"self",
".",
"insts",
"[",
"-",
"1",
"]",
"except",
"(",
"IndexError",
",",
"ValueError",
")",
":",
"return",
"return",
"op",
"in",
"self",
".",
"_uncond_tra... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/compiler/pyassem.py#L208-L216 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_windows.py | python | MDIParentFrame.Tile | (*args, **kwargs) | return _windows_.MDIParentFrame_Tile(*args, **kwargs) | Tile(self, int orient=HORIZONTAL) | Tile(self, int orient=HORIZONTAL) | [
"Tile",
"(",
"self",
"int",
"orient",
"=",
"HORIZONTAL",
")"
] | def Tile(*args, **kwargs):
"""Tile(self, int orient=HORIZONTAL)"""
return _windows_.MDIParentFrame_Tile(*args, **kwargs) | [
"def",
"Tile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"MDIParentFrame_Tile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L4058-L4060 | |
anestisb/oatdump_plus | ba858c1596598f0d9ae79c14d08c708cecc50af3 | tools/bisection_search/bisection_search.py | python | Dex2OatWrapperTestable.__init__ | (self, base_cmd, test_env, expected_retcode=None,
output_checker=None, verbose=False) | Constructor.
Args:
base_cmd: list of strings, base command to run.
test_env: ITestEnv.
expected_retcode: RetCode, expected normalized return code.
output_checker: IOutputCheck, output checker.
verbose: bool, enable verbose output. | Constructor. | [
"Constructor",
"."
] | def __init__(self, base_cmd, test_env, expected_retcode=None,
output_checker=None, verbose=False):
"""Constructor.
Args:
base_cmd: list of strings, base command to run.
test_env: ITestEnv.
expected_retcode: RetCode, expected normalized return code.
output_checker: IOutput... | [
"def",
"__init__",
"(",
"self",
",",
"base_cmd",
",",
"test_env",
",",
"expected_retcode",
"=",
"None",
",",
"output_checker",
"=",
"None",
",",
"verbose",
"=",
"False",
")",
":",
"self",
".",
"_base_cmd",
"=",
"base_cmd",
"self",
".",
"_test_env",
"=",
... | https://github.com/anestisb/oatdump_plus/blob/ba858c1596598f0d9ae79c14d08c708cecc50af3/tools/bisection_search/bisection_search.py#L75-L97 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/connectionpool.py | python | HTTPSConnectionPool._prepare_conn | (self, conn) | return conn | Prepare the ``connection`` for :meth:`urllib3.util.ssl_wrap_socket`
and establish the tunnel if proxy is used. | Prepare the ``connection`` for :meth:`urllib3.util.ssl_wrap_socket`
and establish the tunnel if proxy is used. | [
"Prepare",
"the",
"connection",
"for",
":",
"meth",
":",
"urllib3",
".",
"util",
".",
"ssl_wrap_socket",
"and",
"establish",
"the",
"tunnel",
"if",
"proxy",
"is",
"used",
"."
] | def _prepare_conn(self, conn):
"""
Prepare the ``connection`` for :meth:`urllib3.util.ssl_wrap_socket`
and establish the tunnel if proxy is used.
"""
if isinstance(conn, VerifiedHTTPSConnection):
conn.set_cert(key_file=self.key_file,
cert_fi... | [
"def",
"_prepare_conn",
"(",
"self",
",",
"conn",
")",
":",
"if",
"isinstance",
"(",
"conn",
",",
"VerifiedHTTPSConnection",
")",
":",
"conn",
".",
"set_cert",
"(",
"key_file",
"=",
"self",
".",
"key_file",
",",
"cert_file",
"=",
"self",
".",
"cert_file",
... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/requests/requests/packages/urllib3/connectionpool.py#L661-L692 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py | python | ServerConnection.ison | (self, nicks) | Send an ISON command.
Arguments:
nicks -- List of nicks. | Send an ISON command. | [
"Send",
"an",
"ISON",
"command",
"."
] | def ison(self, nicks):
"""Send an ISON command.
Arguments:
nicks -- List of nicks.
"""
self.send_raw("ISON " + " ".join(nicks)) | [
"def",
"ison",
"(",
"self",
",",
"nicks",
")",
":",
"self",
".",
"send_raw",
"(",
"\"ISON \"",
"+",
"\" \"",
".",
"join",
"(",
"nicks",
")",
")"
] | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/irc/irclib.py#L680-L687 | ||
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/optimizer/qgt/default.py | python | default_qgt_matrix | (variational_state, solver=False, **kwargs) | Determines default metric tensor depending on variational_state and sovler | Determines default metric tensor depending on variational_state and sovler | [
"Determines",
"default",
"metric",
"tensor",
"depending",
"on",
"variational_state",
"and",
"sovler"
] | def default_qgt_matrix(variational_state, solver=False, **kwargs):
"""
Determines default metric tensor depending on variational_state and sovler
"""
from netket.vqs import ExactState
if isinstance(variational_state, ExactState):
return partial(QGTJacobianPyTree, **kwargs)
n_param_leav... | [
"def",
"default_qgt_matrix",
"(",
"variational_state",
",",
"solver",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"netket",
".",
"vqs",
"import",
"ExactState",
"if",
"isinstance",
"(",
"variational_state",
",",
"ExactState",
")",
":",
"return",
... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/optimizer/qgt/default.py#L44-L69 | ||
tomahawk-player/tomahawk-resolvers | 7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d | archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/cpp_message.py | python | RepeatedCompositeContainer.extend | (self, elem_seq) | Extends by appending the given sequence of elements of the same type
as this one, copying each individual message. | Extends by appending the given sequence of elements of the same type
as this one, copying each individual message. | [
"Extends",
"by",
"appending",
"the",
"given",
"sequence",
"of",
"elements",
"of",
"the",
"same",
"type",
"as",
"this",
"one",
"copying",
"each",
"individual",
"message",
"."
] | def extend(self, elem_seq):
"""Extends by appending the given sequence of elements of the same type
as this one, copying each individual message.
"""
for message in elem_seq:
self.add().MergeFrom(message) | [
"def",
"extend",
"(",
"self",
",",
"elem_seq",
")",
":",
"for",
"message",
"in",
"elem_seq",
":",
"self",
".",
"add",
"(",
")",
".",
"MergeFrom",
"(",
"message",
")"
] | https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/cpp_message.py#L198-L203 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/lzma.py | python | compress | (data, format=FORMAT_XZ, check=-1, preset=None, filters=None) | return comp.compress(data) + comp.flush() | Compress a block of data.
Refer to LZMACompressor's docstring for a description of the
optional arguments *format*, *check*, *preset* and *filters*.
For incremental compression, use an LZMACompressor instead. | Compress a block of data. | [
"Compress",
"a",
"block",
"of",
"data",
"."
] | def compress(data, format=FORMAT_XZ, check=-1, preset=None, filters=None):
"""Compress a block of data.
Refer to LZMACompressor's docstring for a description of the
optional arguments *format*, *check*, *preset* and *filters*.
For incremental compression, use an LZMACompressor instead.
"""
com... | [
"def",
"compress",
"(",
"data",
",",
"format",
"=",
"FORMAT_XZ",
",",
"check",
"=",
"-",
"1",
",",
"preset",
"=",
"None",
",",
"filters",
"=",
"None",
")",
":",
"comp",
"=",
"LZMACompressor",
"(",
"format",
",",
"check",
",",
"preset",
",",
"filters"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/lzma.py#L310-L319 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/validators.py | python | check_semeion_dataset | (method) | return new_method | Wrapper method to check the parameters of SemeionDataset. | Wrapper method to check the parameters of SemeionDataset. | [
"Wrapper",
"method",
"to",
"check",
"the",
"parameters",
"of",
"SemeionDataset",
"."
] | def check_semeion_dataset(method):
"""Wrapper method to check the parameters of SemeionDataset."""
@wraps(method)
def new_method(self, *args, **kwargs):
_, param_dict = parse_user_args(method, *args, **kwargs)
nreq_param_int = ['num_samples', 'num_parallel_workers', 'num_shards', 'shard_id... | [
"def",
"check_semeion_dataset",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_",
",",
"param_dict",
"=",
"parse_user_args",
"(",
"method",
",",
"*",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L2449-L2472 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/text_format.py | python | _Tokenizer.ParseErrorPreviousToken | (self, message) | return ParseError('%d:%d : %s' % (
self._previous_line + 1, self._previous_column + 1, message)) | Creates and *returns* a ParseError for the previously read token.
Args:
message: A message to set for the exception.
Returns:
A ParseError instance. | Creates and *returns* a ParseError for the previously read token. | [
"Creates",
"and",
"*",
"returns",
"*",
"a",
"ParseError",
"for",
"the",
"previously",
"read",
"token",
"."
] | def ParseErrorPreviousToken(self, message):
"""Creates and *returns* a ParseError for the previously read token.
Args:
message: A message to set for the exception.
Returns:
A ParseError instance.
"""
return ParseError('%d:%d : %s' % (
self._previous_line + 1, self._previous_col... | [
"def",
"ParseErrorPreviousToken",
"(",
"self",
",",
"message",
")",
":",
"return",
"ParseError",
"(",
"'%d:%d : %s'",
"%",
"(",
"self",
".",
"_previous_line",
"+",
"1",
",",
"self",
".",
"_previous_column",
"+",
"1",
",",
"message",
")",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/text_format.py#L549-L559 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillContextMenu.py | python | DrillContextMenu.show | (self) | Show the context menu. | Show the context menu. | [
"Show",
"the",
"context",
"menu",
"."
] | def show(self):
"""
Show the context menu.
"""
self.exec(self._position) | [
"def",
"show",
"(",
"self",
")",
":",
"self",
".",
"exec",
"(",
"self",
".",
"_position",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillContextMenu.py#L106-L110 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/email/_policybase.py | python | Policy.header_max_count | (self, name) | return None | Return the maximum allowed number of headers named 'name'.
Called when a header is added to a Message object. If the returned
value is not 0 or None, and there are already a number of headers with
the name 'name' equal to the value returned, a ValueError is raised.
Because the default... | Return the maximum allowed number of headers named 'name'. | [
"Return",
"the",
"maximum",
"allowed",
"number",
"of",
"headers",
"named",
"name",
"."
] | def header_max_count(self, name):
"""Return the maximum allowed number of headers named 'name'.
Called when a header is added to a Message object. If the returned
value is not 0 or None, and there are already a number of headers with
the name 'name' equal to the value returned, a Value... | [
"def",
"header_max_count",
"(",
"self",
",",
"name",
")",
":",
"return",
"None"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/email/_policybase.py#L201-L218 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py | python | SinglePtIntegrationTable.get_fwhm | (self, row_index) | return self.get_cell_value(row_index, self._fwhm_index) | get reference scan's FWHM
:param row_index:
:return: | get reference scan's FWHM
:param row_index:
:return: | [
"get",
"reference",
"scan",
"s",
"FWHM",
":",
"param",
"row_index",
":",
":",
"return",
":"
] | def get_fwhm(self, row_index):
""" get reference scan's FWHM
:param row_index:
:return:
"""
return self.get_cell_value(row_index, self._fwhm_index) | [
"def",
"get_fwhm",
"(",
"self",
",",
"row_index",
")",
":",
"return",
"self",
".",
"get_cell_value",
"(",
"row_index",
",",
"self",
".",
"_fwhm_index",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/hfctables.py#L1448-L1453 | |
runtimejs/runtime | 0a6e84c30823d35a4548d6634166784260ae7b74 | deps/v8/gypfiles/landmine_utils.py | python | distributor | () | Returns a string which is the distributed build engine in use (if any).
Possible values: 'goma', 'ib', '' | Returns a string which is the distributed build engine in use (if any).
Possible values: 'goma', 'ib', '' | [
"Returns",
"a",
"string",
"which",
"is",
"the",
"distributed",
"build",
"engine",
"in",
"use",
"(",
"if",
"any",
")",
".",
"Possible",
"values",
":",
"goma",
"ib"
] | def distributor():
"""
Returns a string which is the distributed build engine in use (if any).
Possible values: 'goma', 'ib', ''
"""
if 'goma' in gyp_defines():
return 'goma'
elif IsWindows():
if 'CHROME_HEADLESS' in os.environ:
return 'ib' | [
"def",
"distributor",
"(",
")",
":",
"if",
"'goma'",
"in",
"gyp_defines",
"(",
")",
":",
"return",
"'goma'",
"elif",
"IsWindows",
"(",
")",
":",
"if",
"'CHROME_HEADLESS'",
"in",
"os",
".",
"environ",
":",
"return",
"'ib'"
] | https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/gypfiles/landmine_utils.py#L64-L73 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/blogger/__init__.py | python | BlogPostEntry.AddLabel | (self, label) | Adds a label to the blog post.
The label is represented by an Atom category element, so this method
is shorthand for appending a new atom.Category object.
Args:
label: str | Adds a label to the blog post. | [
"Adds",
"a",
"label",
"to",
"the",
"blog",
"post",
"."
] | def AddLabel(self, label):
"""Adds a label to the blog post.
The label is represented by an Atom category element, so this method
is shorthand for appending a new atom.Category object.
Args:
label: str
"""
self.category.append(atom.Category(scheme=LABEL_SCHEME, term=label)) | [
"def",
"AddLabel",
"(",
"self",
",",
"label",
")",
":",
"self",
".",
"category",
".",
"append",
"(",
"atom",
".",
"Category",
"(",
"scheme",
"=",
"LABEL_SCHEME",
",",
"term",
"=",
"label",
")",
")"
] | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/blogger/__init__.py#L96-L105 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/base_events.py | python | BaseEventLoop.create_datagram_endpoint | (self, protocol_factory,
local_addr=None, remote_addr=None, *,
family=0, proto=0, flags=0,
reuse_address=_unset, reuse_port=None,
allow_broadcast=None, sock=None) | return transport, protocol | Create datagram connection. | Create datagram connection. | [
"Create",
"datagram",
"connection",
"."
] | async def create_datagram_endpoint(self, protocol_factory,
local_addr=None, remote_addr=None, *,
family=0, proto=0, flags=0,
reuse_address=_unset, reuse_port=None,
... | [
"async",
"def",
"create_datagram_endpoint",
"(",
"self",
",",
"protocol_factory",
",",
"local_addr",
"=",
"None",
",",
"remote_addr",
"=",
"None",
",",
"*",
",",
"family",
"=",
"0",
",",
"proto",
"=",
"0",
",",
"flags",
"=",
"0",
",",
"reuse_address",
"=... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/base_events.py#L1146-L1278 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/numpy_extension/_op.py | python | embedding | (data, weight, input_dim=None, output_dim=None, dtype="float32", sparse_grad=False,
**kwargs) | return _mx_nd_npx.embedding(data=data, weight=weight, input_dim=input_dim, output_dim=output_dim,
dtype=dtype, sparse_grad=sparse_grad) | r"""Maps integer indices to vector representations (embeddings).
This operator maps words to real-valued vectors in a high-dimensional space,
called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
For example, it has been noted that in the learned embedding spa... | r"""Maps integer indices to vector representations (embeddings). | [
"r",
"Maps",
"integer",
"indices",
"to",
"vector",
"representations",
"(",
"embeddings",
")",
"."
] | def embedding(data, weight, input_dim=None, output_dim=None, dtype="float32", sparse_grad=False,
**kwargs):
r"""Maps integer indices to vector representations (embeddings).
This operator maps words to real-valued vectors in a high-dimensional space,
called word embeddings. These embeddings ca... | [
"def",
"embedding",
"(",
"data",
",",
"weight",
",",
"input_dim",
"=",
"None",
",",
"output_dim",
"=",
"None",
",",
"dtype",
"=",
"\"float32\"",
",",
"sparse_grad",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_mx_nd_npx",
".",
"embedding"... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/numpy_extension/_op.py#L976-L1059 | |
junhyukoh/caffe-lstm | 598d45456fa2a1b127a644f4aa38daa8fb9fc722 | python/caffe/io.py | python | blobprotovector_str_to_arraylist | (str) | return [blobproto_to_array(blob) for blob in vec.blobs] | Converts a serialized blobprotovec to a list of arrays. | Converts a serialized blobprotovec to a list of arrays. | [
"Converts",
"a",
"serialized",
"blobprotovec",
"to",
"a",
"list",
"of",
"arrays",
"."
] | def blobprotovector_str_to_arraylist(str):
"""Converts a serialized blobprotovec to a list of arrays.
"""
vec = caffe_pb2.BlobProtoVector()
vec.ParseFromString(str)
return [blobproto_to_array(blob) for blob in vec.blobs] | [
"def",
"blobprotovector_str_to_arraylist",
"(",
"str",
")",
":",
"vec",
"=",
"caffe_pb2",
".",
"BlobProtoVector",
"(",
")",
"vec",
".",
"ParseFromString",
"(",
"str",
")",
"return",
"[",
"blobproto_to_array",
"(",
"blob",
")",
"for",
"blob",
"in",
"vec",
"."... | https://github.com/junhyukoh/caffe-lstm/blob/598d45456fa2a1b127a644f4aa38daa8fb9fc722/python/caffe/io.py#L55-L60 | |
rrwick/Unicycler | 96ffea71e3a78d63ade19d6124946773e65cf129 | unicycler/assembly_graph.py | python | get_signed_number_from_header | (header) | return number | Input: a SPAdes FASTG header line
Output: an int for the segment number (always positive) | Input: a SPAdes FASTG header line
Output: an int for the segment number (always positive) | [
"Input",
":",
"a",
"SPAdes",
"FASTG",
"header",
"line",
"Output",
":",
"an",
"int",
"for",
"the",
"segment",
"number",
"(",
"always",
"positive",
")"
] | def get_signed_number_from_header(header):
"""
Input: a SPAdes FASTG header line
Output: an int for the segment number (always positive)
"""
number = get_unsigned_number_from_header(header)
if not is_header_positive(header):
number *= -1
return number | [
"def",
"get_signed_number_from_header",
"(",
"header",
")",
":",
"number",
"=",
"get_unsigned_number_from_header",
"(",
"header",
")",
"if",
"not",
"is_header_positive",
"(",
"header",
")",
":",
"number",
"*=",
"-",
"1",
"return",
"number"
] | https://github.com/rrwick/Unicycler/blob/96ffea71e3a78d63ade19d6124946773e65cf129/unicycler/assembly_graph.py#L2411-L2419 | |
garbear/kodi-steamlink | 3f8e5970b01607cdb3c2688fbaa78e08f2d9c561 | tools/EventClients/lib/python/xbmcclient.py | python | PacketMOUSE.__init__ | (self, x, y) | Arguments:
x -- horizontal position ranging from 0 to 65535
y -- vertical position ranging from 0 to 65535
The range will be mapped to the screen width and height in XBMC | Arguments:
x -- horizontal position ranging from 0 to 65535
y -- vertical position ranging from 0 to 65535 | [
"Arguments",
":",
"x",
"--",
"horizontal",
"position",
"ranging",
"from",
"0",
"to",
"65535",
"y",
"--",
"vertical",
"position",
"ranging",
"from",
"0",
"to",
"65535"
] | def __init__(self, x, y):
"""
Arguments:
x -- horizontal position ranging from 0 to 65535
y -- vertical position ranging from 0 to 65535
The range will be mapped to the screen width and height in XBMC
"""
Packet.__init__(self)
self.packettype = PT_MOUSE
... | [
"def",
"__init__",
"(",
"self",
",",
"x",
",",
"y",
")",
":",
"Packet",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"packettype",
"=",
"PT_MOUSE",
"self",
".",
"flags",
"=",
"MS_ABSOLUTE",
"self",
".",
"append_payload",
"(",
"chr",
"(",
"self",
"... | https://github.com/garbear/kodi-steamlink/blob/3f8e5970b01607cdb3c2688fbaa78e08f2d9c561/tools/EventClients/lib/python/xbmcclient.py#L394-L407 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wxversion/wxversion.py | python | getInstalled | () | return [os.path.basename(p.pathname)[3:] for p in installed] | Returns a list of strings representing the installed wxPython
versions that are found on the system. | Returns a list of strings representing the installed wxPython
versions that are found on the system. | [
"Returns",
"a",
"list",
"of",
"strings",
"representing",
"the",
"installed",
"wxPython",
"versions",
"that",
"are",
"found",
"on",
"the",
"system",
"."
] | def getInstalled():
"""
Returns a list of strings representing the installed wxPython
versions that are found on the system.
"""
installed = _find_installed()
return [os.path.basename(p.pathname)[3:] for p in installed] | [
"def",
"getInstalled",
"(",
")",
":",
"installed",
"=",
"_find_installed",
"(",
")",
"return",
"[",
"os",
".",
"path",
".",
"basename",
"(",
"p",
".",
"pathname",
")",
"[",
"3",
":",
"]",
"for",
"p",
"in",
"installed",
"]"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wxversion/wxversion.py#L255-L261 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/py/sliceshell.py | python | SlicesShellFrame.OnAbout | (self, event) | Display an About window. | Display an About window. | [
"Display",
"an",
"About",
"window",
"."
] | def OnAbout(self, event):
"""Display an About window."""
title = 'About PySliceShell'
text = 'PySliceShell %s\n\n' % VERSION + \
'Yet another Python shell, only flakier.\n\n' + \
'Half-baked by Patrick K. O\'Brien,\n' + \
'the other half is still in t... | [
"def",
"OnAbout",
"(",
"self",
",",
"event",
")",
":",
"title",
"=",
"'About PySliceShell'",
"text",
"=",
"'PySliceShell %s\\n\\n'",
"%",
"VERSION",
"+",
"'Yet another Python shell, only flakier.\\n\\n'",
"+",
"'Half-baked by Patrick K. O\\'Brien,\\n'",
"+",
"'the other hal... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/py/sliceshell.py#L198-L214 | ||
protocolbuffers/protobuf | b5ab0b7a18b7336c60130f4ddb2d97c51792f896 | python/google/protobuf/internal/well_known_types.py | python | ListValue.add_struct | (self) | return struct_value | Appends and returns a struct value as the next value in the list. | Appends and returns a struct value as the next value in the list. | [
"Appends",
"and",
"returns",
"a",
"struct",
"value",
"as",
"the",
"next",
"value",
"in",
"the",
"list",
"."
] | def add_struct(self):
"""Appends and returns a struct value as the next value in the list."""
struct_value = self.values.add().struct_value
# Clear will mark struct_value modified which will indeed create a struct.
struct_value.Clear()
return struct_value | [
"def",
"add_struct",
"(",
"self",
")",
":",
"struct_value",
"=",
"self",
".",
"values",
".",
"add",
"(",
")",
".",
"struct_value",
"# Clear will mark struct_value modified which will indeed create a struct.",
"struct_value",
".",
"Clear",
"(",
")",
"return",
"struct_v... | https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/google/protobuf/internal/well_known_types.py#L835-L840 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/mailbox.py | python | _mboxMMDFMessage._explain_to | (self, message) | Copy mbox- or MMDF-specific state to message insofar as possible. | Copy mbox- or MMDF-specific state to message insofar as possible. | [
"Copy",
"mbox",
"-",
"or",
"MMDF",
"-",
"specific",
"state",
"to",
"message",
"insofar",
"as",
"possible",
"."
] | def _explain_to(self, message):
"""Copy mbox- or MMDF-specific state to message insofar as possible."""
if isinstance(message, MaildirMessage):
flags = set(self.get_flags())
if 'O' in flags:
message.set_subdir('cur')
if 'F' in flags:
me... | [
"def",
"_explain_to",
"(",
"self",
",",
"message",
")",
":",
"if",
"isinstance",
"(",
"message",
",",
"MaildirMessage",
")",
":",
"flags",
"=",
"set",
"(",
"self",
".",
"get_flags",
"(",
")",
")",
"if",
"'O'",
"in",
"flags",
":",
"message",
".",
"set... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L1693-L1742 | ||
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/core.py | python | CherryTree.apply_tag_superscript | (self, *args) | The Superscript Button was Pressed | The Superscript Button was Pressed | [
"The",
"Superscript",
"Button",
"was",
"Pressed"
] | def apply_tag_superscript(self, *args):
"""The Superscript Button was Pressed"""
if not self.is_curr_node_not_read_only_or_error(): return
self.apply_tag(cons.TAG_SCALE, cons.TAG_PROP_SUP) | [
"def",
"apply_tag_superscript",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"not",
"self",
".",
"is_curr_node_not_read_only_or_error",
"(",
")",
":",
"return",
"self",
".",
"apply_tag",
"(",
"cons",
".",
"TAG_SCALE",
",",
"cons",
".",
"TAG_PROP_SUP",
")"
... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L4488-L4491 | ||
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | ortools/constraint_solver/doc/routing_svg.py | python | GoogleColorPalette.__len__ | (self) | return len(self._colors) | Gets the number of colors. | Gets the number of colors. | [
"Gets",
"the",
"number",
"of",
"colors",
"."
] | def __len__(self):
"""Gets the number of colors."""
return len(self._colors) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_colors",
")"
] | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/doc/routing_svg.py#L267-L269 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/edit.py | python | detach | (sgv, control_inputs=False, control_outputs=None, control_ios=None) | return sgv, detached_inputs, detached_outputs | Detach both the inputs and the outputs of a subgraph view.
Args:
sgv: the subgraph view to be detached. This argument is converted to a
subgraph using the same rules as the function subgraph.make_view.
Note that sgv is modified in place.
control_inputs: A boolean indicating whether control inputs... | Detach both the inputs and the outputs of a subgraph view. | [
"Detach",
"both",
"the",
"inputs",
"and",
"the",
"outputs",
"of",
"a",
"subgraph",
"view",
"."
] | def detach(sgv, control_inputs=False, control_outputs=None, control_ios=None):
"""Detach both the inputs and the outputs of a subgraph view.
Args:
sgv: the subgraph view to be detached. This argument is converted to a
subgraph using the same rules as the function subgraph.make_view.
Note that sgv i... | [
"def",
"detach",
"(",
"sgv",
",",
"control_inputs",
"=",
"False",
",",
"control_outputs",
"=",
"None",
",",
"control_ios",
"=",
"None",
")",
":",
"control_inputs",
",",
"control_outputs",
"=",
"select",
".",
"check_cios",
"(",
"control_inputs",
",",
"control_o... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/edit.py#L141-L169 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/rosdistro/external/appdirs.py | python | user_data_dir | (appname=None, appauthor=None, version=None, roaming=False) | return path | r"""Return full path to the user-specific data dir for this application.
"appname" is the name of application.
If None, just the system directory is returned.
"appauthor" (only required and used on Windows) is the name of the
appauthor or distributing body for this application. ... | r"""Return full path to the user-specific data dir for this application. | [
"r",
"Return",
"full",
"path",
"to",
"the",
"user",
"-",
"specific",
"data",
"dir",
"for",
"this",
"application",
"."
] | def user_data_dir(appname=None, appauthor=None, version=None, roaming=False):
r"""Return full path to the user-specific data dir for this application.
"appname" is the name of application.
If None, just the system directory is returned.
"appauthor" (only required and used on Windows) is... | [
"def",
"user_data_dir",
"(",
"appname",
"=",
"None",
",",
"appauthor",
"=",
"None",
",",
"version",
"=",
"None",
",",
"roaming",
"=",
"False",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"\"win32\"",
":",
"if",
"appauthor",
"is",
"None",
":",
"appaut... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdistro/external/appdirs.py#L51-L99 | |
stulp/dmpbbo | ca900e3b851d25faaf59ea296650370c70ed7d0f | python/bbo/DistributionGaussian.py | python | loadDistributionGaussianFromDirectory | (directory,basename) | return DistributionGaussian(mean,covar) | Load a DistributionGaussian object from a file.
\param[in] directory The directory to load from to.
\param[in] basename Basename of the file.
\return An object of class DistributionGaussian | Load a DistributionGaussian object from a file.
\param[in] directory The directory to load from to.
\param[in] basename Basename of the file.
\return An object of class DistributionGaussian | [
"Load",
"a",
"DistributionGaussian",
"object",
"from",
"a",
"file",
".",
"\\",
"param",
"[",
"in",
"]",
"directory",
"The",
"directory",
"to",
"load",
"from",
"to",
".",
"\\",
"param",
"[",
"in",
"]",
"basename",
"Basename",
"of",
"the",
"file",
".",
"... | def loadDistributionGaussianFromDirectory(directory,basename):
""" Load a DistributionGaussian object from a file.
\param[in] directory The directory to load from to.
\param[in] basename Basename of the file.
\return An object of class DistributionGaussian
"""
mean = np.loadtxt(directory+'/'+bas... | [
"def",
"loadDistributionGaussianFromDirectory",
"(",
"directory",
",",
"basename",
")",
":",
"mean",
"=",
"np",
".",
"loadtxt",
"(",
"directory",
"+",
"'/'",
"+",
"basename",
"+",
"'_mean.txt'",
")",
"covar",
"=",
"np",
".",
"loadtxt",
"(",
"directory",
"+",... | https://github.com/stulp/dmpbbo/blob/ca900e3b851d25faaf59ea296650370c70ed7d0f/python/bbo/DistributionGaussian.py#L68-L76 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiMDIParentFrame.SetActiveChild | (*args, **kwargs) | return _aui.AuiMDIParentFrame_SetActiveChild(*args, **kwargs) | SetActiveChild(self, AuiMDIChildFrame pChildFrame) | SetActiveChild(self, AuiMDIChildFrame pChildFrame) | [
"SetActiveChild",
"(",
"self",
"AuiMDIChildFrame",
"pChildFrame",
")"
] | def SetActiveChild(*args, **kwargs):
"""SetActiveChild(self, AuiMDIChildFrame pChildFrame)"""
return _aui.AuiMDIParentFrame_SetActiveChild(*args, **kwargs) | [
"def",
"SetActiveChild",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiMDIParentFrame_SetActiveChild",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1457-L1459 | |
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/MeshingApplication/python_scripts/mmg_process.py | python | MmgProcess._CreateMetricsProcess | (self) | This method is responsible to create the metrics of the process
Keyword arguments:
self -- It signifies an instance of a class. | This method is responsible to create the metrics of the process | [
"This",
"method",
"is",
"responsible",
"to",
"create",
"the",
"metrics",
"of",
"the",
"process"
] | def _CreateMetricsProcess(self):
""" This method is responsible to create the metrics of the process
Keyword arguments:
self -- It signifies an instance of a class.
"""
self.metric_processes = []
if self.strategy == "levelset":
level_set_parameters = KratosMu... | [
"def",
"_CreateMetricsProcess",
"(",
"self",
")",
":",
"self",
".",
"metric_processes",
"=",
"[",
"]",
"if",
"self",
".",
"strategy",
"==",
"\"levelset\"",
":",
"level_set_parameters",
"=",
"KratosMultiphysics",
".",
"Parameters",
"(",
"\"\"\"{}\"\"\"",
")",
"le... | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/MeshingApplication/python_scripts/mmg_process.py#L487-L550 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/core/defchararray.py | python | count | (a, sub, start=0, end=None) | return _vec_string(a, integer, 'count', [sub, start] + _clean_args(end)) | Returns an array with the number of non-overlapping occurrences of
substring `sub` in the range [`start`, `end`].
Calls `str.count` element-wise.
Parameters
----------
a : array_like of str or unicode
sub : str or unicode
The substring to search for.
start, end : int, optional
... | Returns an array with the number of non-overlapping occurrences of
substring `sub` in the range [`start`, `end`]. | [
"Returns",
"an",
"array",
"with",
"the",
"number",
"of",
"non",
"-",
"overlapping",
"occurrences",
"of",
"substring",
"sub",
"in",
"the",
"range",
"[",
"start",
"end",
"]",
"."
] | def count(a, sub, start=0, end=None):
"""
Returns an array with the number of non-overlapping occurrences of
substring `sub` in the range [`start`, `end`].
Calls `str.count` element-wise.
Parameters
----------
a : array_like of str or unicode
sub : str or unicode
The substring ... | [
"def",
"count",
"(",
"a",
",",
"sub",
",",
"start",
"=",
"0",
",",
"end",
"=",
"None",
")",
":",
"return",
"_vec_string",
"(",
"a",
",",
"integer",
",",
"'count'",
",",
"[",
"sub",
",",
"start",
"]",
"+",
"_clean_args",
"(",
"end",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/core/defchararray.py#L470-L513 | |
NervanaSystems/he-transformer | 1da853b07e937fe213f774238d0665252b3370ed | examples/MNIST/mnist_util.py | python | avg_pool_3x3_same_size | (x) | return tf.nn.avg_pool2d(
x, ksize=[1, 3, 3, 1], strides=[1, 1, 1, 1], padding='SAME') | 3x3 avg_pool using same padding, keeping original feature map size | 3x3 avg_pool using same padding, keeping original feature map size | [
"3x3",
"avg_pool",
"using",
"same",
"padding",
"keeping",
"original",
"feature",
"map",
"size"
] | def avg_pool_3x3_same_size(x):
"""3x3 avg_pool using same padding, keeping original feature map size"""
return tf.nn.avg_pool2d(
x, ksize=[1, 3, 3, 1], strides=[1, 1, 1, 1], padding='SAME') | [
"def",
"avg_pool_3x3_same_size",
"(",
"x",
")",
":",
"return",
"tf",
".",
"nn",
".",
"avg_pool2d",
"(",
"x",
",",
"ksize",
"=",
"[",
"1",
",",
"3",
",",
"3",
",",
"1",
"]",
",",
"strides",
"=",
"[",
"1",
",",
"1",
",",
"1",
",",
"1",
"]",
"... | https://github.com/NervanaSystems/he-transformer/blob/1da853b07e937fe213f774238d0665252b3370ed/examples/MNIST/mnist_util.py#L65-L68 | |
physercoe/starquant | c00cad64d1de2da05081b3dc320ef264c6295e08 | source/data/data_board.py | python | ArrayManager.atr | (self, n, array=False) | return result[-1] | Average True Range (ATR). | Average True Range (ATR). | [
"Average",
"True",
"Range",
"(",
"ATR",
")",
"."
] | def atr(self, n, array=False):
"""
Average True Range (ATR).
"""
result = talib.ATR(self.high, self.low, self.close, n)
if array:
return result
return result[-1] | [
"def",
"atr",
"(",
"self",
",",
"n",
",",
"array",
"=",
"False",
")",
":",
"result",
"=",
"talib",
".",
"ATR",
"(",
"self",
".",
"high",
",",
"self",
".",
"low",
",",
"self",
".",
"close",
",",
"n",
")",
"if",
"array",
":",
"return",
"result",
... | https://github.com/physercoe/starquant/blob/c00cad64d1de2da05081b3dc320ef264c6295e08/source/data/data_board.py#L272-L279 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/distribution_util.py | python | assert_close | (
x, y, data=None, summarize=None, message=None, name="assert_close") | Assert that that x and y are within machine epsilon of each other.
Args:
x: Numeric `Tensor`
y: Numeric `Tensor`
data: The tensors to print out if the condition is `False`. Defaults to
error message and first few entries of `x` and `y`.
summarize: Print this many entries of each tensor.
mes... | Assert that that x and y are within machine epsilon of each other. | [
"Assert",
"that",
"that",
"x",
"and",
"y",
"are",
"within",
"machine",
"epsilon",
"of",
"each",
"other",
"."
] | def assert_close(
x, y, data=None, summarize=None, message=None, name="assert_close"):
"""Assert that that x and y are within machine epsilon of each other.
Args:
x: Numeric `Tensor`
y: Numeric `Tensor`
data: The tensors to print out if the condition is `False`. Defaults to
error message and ... | [
"def",
"assert_close",
"(",
"x",
",",
"y",
",",
"data",
"=",
"None",
",",
"summarize",
"=",
"None",
",",
"message",
"=",
"None",
",",
"name",
"=",
"\"assert_close\"",
")",
":",
"message",
"=",
"message",
"or",
"\"\"",
"x",
"=",
"ops",
".",
"convert_t... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/distribution_util.py#L32-L66 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/configuration.py | python | Configuration.save | (self) | Save the current in-memory state. | Save the current in-memory state. | [
"Save",
"the",
"current",
"in",
"-",
"memory",
"state",
"."
] | def save(self):
# type: () -> None
"""Save the current in-memory state.
"""
self._ensure_have_load_only()
for fname, parser in self._modified_parsers:
logger.info("Writing to %s", fname)
# Ensure directory exists.
ensure_dir(os.path.dirname(f... | [
"def",
"save",
"(",
"self",
")",
":",
"# type: () -> None",
"self",
".",
"_ensure_have_load_only",
"(",
")",
"for",
"fname",
",",
"parser",
"in",
"self",
".",
"_modified_parsers",
":",
"logger",
".",
"info",
"(",
"\"Writing to %s\"",
",",
"fname",
")",
"# En... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/configuration.py#L216-L229 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | Grid.IsColShown | (*args, **kwargs) | return _grid.Grid_IsColShown(*args, **kwargs) | IsColShown(self, int col) -> bool | IsColShown(self, int col) -> bool | [
"IsColShown",
"(",
"self",
"int",
"col",
")",
"-",
">",
"bool"
] | def IsColShown(*args, **kwargs):
"""IsColShown(self, int col) -> bool"""
return _grid.Grid_IsColShown(*args, **kwargs) | [
"def",
"IsColShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"Grid_IsColShown",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1766-L1768 | |
opencv/opencv | 76aff8478883858f0e46746044348ebb16dc3c67 | samples/python/mouse_and_match.py | python | App.run | (self) | Loop through all the images in the directory | Loop through all the images in the directory | [
"Loop",
"through",
"all",
"the",
"images",
"in",
"the",
"directory"
] | def run(self):
parser = argparse.ArgumentParser(description='Demonstrate mouse interaction with images')
parser.add_argument("-i","--input", default='../data/', help="Input directory.")
args = parser.parse_args()
path = args.input
cv.namedWindow("gray",1)
cv.setMouseCall... | [
"def",
"run",
"(",
"self",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Demonstrate mouse interaction with images'",
")",
"parser",
".",
"add_argument",
"(",
"\"-i\"",
",",
"\"--input\"",
",",
"default",
"=",
"'../data/'",... | https://github.com/opencv/opencv/blob/76aff8478883858f0e46746044348ebb16dc3c67/samples/python/mouse_and_match.py#L58-L82 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/code_coverage/croc_html.py | python | CrocHtml.CreateHtmlDoc | (self, filename, title) | return f | Creates a new HTML document.
Args:
filename: Filename to write to, relative to self.output_root.
title: Title of page
Returns:
The document. | Creates a new HTML document. | [
"Creates",
"a",
"new",
"HTML",
"document",
"."
] | def CreateHtmlDoc(self, filename, title):
"""Creates a new HTML document.
Args:
filename: Filename to write to, relative to self.output_root.
title: Title of page
Returns:
The document.
"""
f = HtmlFile(self.xml_impl, self.output_root + '/' + filename)
f.head.E('title').Text... | [
"def",
"CreateHtmlDoc",
"(",
"self",
",",
"filename",
",",
"title",
")",
":",
"f",
"=",
"HtmlFile",
"(",
"self",
".",
"xml_impl",
",",
"self",
".",
"output_root",
"+",
"'/'",
"+",
"filename",
")",
"f",
".",
"head",
".",
"E",
"(",
"'title'",
")",
".... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/code_coverage/croc_html.py#L124-L149 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/platform.py | python | node | () | return uname()[1] | Returns the computer's network name (which may not be fully
qualified)
An empty string is returned if the value cannot be determined. | Returns the computer's network name (which may not be fully
qualified) | [
"Returns",
"the",
"computer",
"s",
"network",
"name",
"(",
"which",
"may",
"not",
"be",
"fully",
"qualified",
")"
] | def node():
""" Returns the computer's network name (which may not be fully
qualified)
An empty string is returned if the value cannot be determined.
"""
return uname()[1] | [
"def",
"node",
"(",
")",
":",
"return",
"uname",
"(",
")",
"[",
"1",
"]"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/platform.py#L1312-L1320 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/util.py | python | execute | (func, args, msg=None, verbose=0, dry_run=0) | Perform some action that affects the outside world (eg. by
writing to the filesystem). Such actions are special because they
are disabled by the 'dry_run' flag. This method takes care of all
that bureaucracy for you; all you have to do is supply the
function to call and an argument tuple for it (to e... | Perform some action that affects the outside world (eg. by
writing to the filesystem). Such actions are special because they
are disabled by the 'dry_run' flag. This method takes care of all
that bureaucracy for you; all you have to do is supply the
function to call and an argument tuple for it (to e... | [
"Perform",
"some",
"action",
"that",
"affects",
"the",
"outside",
"world",
"(",
"eg",
".",
"by",
"writing",
"to",
"the",
"filesystem",
")",
".",
"Such",
"actions",
"are",
"special",
"because",
"they",
"are",
"disabled",
"by",
"the",
"dry_run",
"flag",
".",... | def execute (func, args, msg=None, verbose=0, dry_run=0):
"""Perform some action that affects the outside world (eg. by
writing to the filesystem). Such actions are special because they
are disabled by the 'dry_run' flag. This method takes care of all
that bureaucracy for you; all you have to do is s... | [
"def",
"execute",
"(",
"func",
",",
"args",
",",
"msg",
"=",
"None",
",",
"verbose",
"=",
"0",
",",
"dry_run",
"=",
"0",
")",
":",
"if",
"msg",
"is",
"None",
":",
"msg",
"=",
"\"%s%r\"",
"%",
"(",
"func",
".",
"__name__",
",",
"args",
")",
"if"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/util.py#L308-L324 | ||
geemaple/leetcode | 68bc5032e1ee52c22ef2f2e608053484c487af54 | leetcode/286.walls-and-gates.py | python | Solution.wallsAndGates | (self, rooms) | :type rooms: List[List[int]]
:rtype: void Do not return anything, modify rooms in-place instead. | :type rooms: List[List[int]]
:rtype: void Do not return anything, modify rooms in-place instead. | [
":",
"type",
"rooms",
":",
"List",
"[",
"List",
"[",
"int",
"]]",
":",
"rtype",
":",
"void",
"Do",
"not",
"return",
"anything",
"modify",
"rooms",
"in",
"-",
"place",
"instead",
"."
] | def wallsAndGates(self, rooms):
"""
:type rooms: List[List[int]]
:rtype: void Do not return anything, modify rooms in-place instead.
"""
queue = []
visited = set()
for i in range(len(rooms)):
for j in range(len(rooms[i])):
if ... | [
"def",
"wallsAndGates",
"(",
"self",
",",
"rooms",
")",
":",
"queue",
"=",
"[",
"]",
"visited",
"=",
"set",
"(",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"rooms",
")",
")",
":",
"for",
"j",
"in",
"range",
"(",
"len",
"(",
"rooms",
"[",
... | https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/286.walls-and-gates.py#L8-L42 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/urllib/request.py | python | FancyURLopener.http_error_301 | (self, url, fp, errcode, errmsg, headers, data=None) | return self.http_error_302(url, fp, errcode, errmsg, headers, data) | Error 301 -- also relocated (permanently). | Error 301 -- also relocated (permanently). | [
"Error",
"301",
"--",
"also",
"relocated",
"(",
"permanently",
")",
"."
] | def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):
"""Error 301 -- also relocated (permanently)."""
return self.http_error_302(url, fp, errcode, errmsg, headers, data) | [
"def",
"http_error_301",
"(",
"self",
",",
"url",
",",
"fp",
",",
"errcode",
",",
"errmsg",
",",
"headers",
",",
"data",
"=",
"None",
")",
":",
"return",
"self",
".",
"http_error_302",
"(",
"url",
",",
"fp",
",",
"errcode",
",",
"errmsg",
",",
"heade... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/urllib/request.py#L2200-L2202 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scikit-learn/py3/sklearn/linear_model/_bayes.py | python | BayesianRidge.fit | (self, X, y, sample_weight=None) | return self | Fit the model
Parameters
----------
X : ndarray of shape (n_samples, n_features)
Training data
y : ndarray of shape (n_samples,)
Target values. Will be cast to X's dtype if necessary
sample_weight : ndarray of shape (n_samples,), default=None
... | Fit the model | [
"Fit",
"the",
"model"
] | def fit(self, X, y, sample_weight=None):
"""Fit the model
Parameters
----------
X : ndarray of shape (n_samples, n_features)
Training data
y : ndarray of shape (n_samples,)
Target values. Will be cast to X's dtype if necessary
sample_weight : nda... | [
"def",
"fit",
"(",
"self",
",",
"X",
",",
"y",
",",
"sample_weight",
"=",
"None",
")",
":",
"if",
"self",
".",
"n_iter",
"<",
"1",
":",
"raise",
"ValueError",
"(",
"'n_iter should be greater than or equal to 1.'",
"' Got {!r}.'",
".",
"format",
"(",
"self",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/linear_model/_bayes.py#L168-L292 | |
lballabio/quantlib-old | 136336947ed4fea9ecc1da6edad188700e821739 | gensrc/gensrc/addins/enumerations.py | python | Enumerations.generateEnumeratedClass | (self, enumeratedClassGroup) | return template % {
'type' : enumeratedClassGroup.className(),
'buffer' : buffer } | Generate source code for enumerated type group. | Generate source code for enumerated type group. | [
"Generate",
"source",
"code",
"for",
"enumerated",
"type",
"group",
"."
] | def generateEnumeratedClass(self, enumeratedClassGroup):
"""Generate source code for enumerated type group."""
buffer = ''
for enumeratedType in enumeratedClassGroup.enumeratedClasses():
buffer += Enumerations.ENUM_LINE2 % {
'string' : enumeratedType.string(),
... | [
"def",
"generateEnumeratedClass",
"(",
"self",
",",
"enumeratedClassGroup",
")",
":",
"buffer",
"=",
"''",
"for",
"enumeratedType",
"in",
"enumeratedClassGroup",
".",
"enumeratedClasses",
"(",
")",
":",
"buffer",
"+=",
"Enumerations",
".",
"ENUM_LINE2",
"%",
"{",
... | https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/addins/enumerations.py#L111-L124 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/general_fitting_context.py | python | GeneralFittingContext.simultaneous_fit_by | (self) | return self._simultaneous_fit_by | Returns the simultaneous fit by parameter stored in the model. | Returns the simultaneous fit by parameter stored in the model. | [
"Returns",
"the",
"simultaneous",
"fit",
"by",
"parameter",
"stored",
"in",
"the",
"model",
"."
] | def simultaneous_fit_by(self) -> str:
"""Returns the simultaneous fit by parameter stored in the model."""
return self._simultaneous_fit_by | [
"def",
"simultaneous_fit_by",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_simultaneous_fit_by"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/general_fitting_context.py#L144-L146 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/tools/js2c.py | python | BuildMetadata | (sources, source_bytes, native_type) | return metadata | Build the meta data required to generate a libaries file.
Args:
sources: A Sources instance with the prepared sources.
source_bytes: A list of source bytes.
(The concatenation of all sources; might be compressed.)
native_type: The parameter for the NativesCollection template.
Returns:
A di... | Build the meta data required to generate a libaries file. | [
"Build",
"the",
"meta",
"data",
"required",
"to",
"generate",
"a",
"libaries",
"file",
"."
] | def BuildMetadata(sources, source_bytes, native_type):
"""Build the meta data required to generate a libaries file.
Args:
sources: A Sources instance with the prepared sources.
source_bytes: A list of source bytes.
(The concatenation of all sources; might be compressed.)
native_type: The parame... | [
"def",
"BuildMetadata",
"(",
"sources",
",",
"source_bytes",
",",
"native_type",
")",
":",
"total_length",
"=",
"len",
"(",
"source_bytes",
")",
"raw_sources",
"=",
"\"\"",
".",
"join",
"(",
"sources",
".",
"modules",
")",
"# The sources are expected to be ASCII-o... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/tools/js2c.py#L232-L283 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_print.py | python | EdPrinter.__init__ | (self, parent, mode=ed_glob.PRINT_NORMAL) | Initializes the Printer
@param parent: parent window
@keyword mode: printer mode | Initializes the Printer
@param parent: parent window
@keyword mode: printer mode | [
"Initializes",
"the",
"Printer",
"@param",
"parent",
":",
"parent",
"window",
"@keyword",
"mode",
":",
"printer",
"mode"
] | def __init__(self, parent, mode=ed_glob.PRINT_NORMAL):
"""Initializes the Printer
@param parent: parent window
@keyword mode: printer mode
"""
super(EdPrinter, self).__init__()
# Attributes
self.stc = None
self.title = wx.EmptyString
self.parent ... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"mode",
"=",
"ed_glob",
".",
"PRINT_NORMAL",
")",
":",
"super",
"(",
"EdPrinter",
",",
"self",
")",
".",
"__init__",
"(",
")",
"# Attributes",
"self",
".",
"stc",
"=",
"None",
"self",
".",
"title",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_print.py#L50-L64 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | PointCloud.setDepthImage | (self,intrinsics,depth,depth_scale=1.0) | Sets a structured point cloud from a depth image.
Args:
intrinsics (4-list): the intrinsics parameters [fx,fy,cx,cy].
depth (np.ndarray): the depth values, of size h x w. Should have
dtype float, np.float32, or np.uint16 for best performance.
depth_scale (fl... | Sets a structured point cloud from a depth image. | [
"Sets",
"a",
"structured",
"point",
"cloud",
"from",
"a",
"depth",
"image",
"."
] | def setDepthImage(self,intrinsics,depth,depth_scale=1.0):
"""
Sets a structured point cloud from a depth image.
Args:
intrinsics (4-list): the intrinsics parameters [fx,fy,cx,cy].
depth (np.ndarray): the depth values, of size h x w. Should have
dtype flo... | [
"def",
"setDepthImage",
"(",
"self",
",",
"intrinsics",
",",
"depth",
",",
"depth_scale",
"=",
"1.0",
")",
":",
"import",
"numpy",
"as",
"np",
"if",
"len",
"(",
"intrinsics",
")",
"!=",
"4",
":",
"raise",
"ValueError",
"(",
"\"Invalid value for the intrinsic... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L1493-L1514 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/swig.py | python | generate | (env) | Add Builders and construction variables for swig to an Environment. | Add Builders and construction variables for swig to an Environment. | [
"Add",
"Builders",
"and",
"construction",
"variables",
"for",
"swig",
"to",
"an",
"Environment",
"."
] | def generate(env):
"""Add Builders and construction variables for swig to an Environment."""
c_file, cxx_file = SCons.Tool.createCFileBuilders(env)
c_file.suffix['.i'] = swigSuffixEmitter
cxx_file.suffix['.i'] = swigSuffixEmitter
c_file.add_action('.i', SwigAction)
c_file.add_emitter('.i', _sw... | [
"def",
"generate",
"(",
"env",
")",
":",
"c_file",
",",
"cxx_file",
"=",
"SCons",
".",
"Tool",
".",
"createCFileBuilders",
"(",
"env",
")",
"c_file",
".",
"suffix",
"[",
"'.i'",
"]",
"=",
"swigSuffixEmitter",
"cxx_file",
".",
"suffix",
"[",
"'.i'",
"]",
... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/swig.py#L166-L209 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/gyp/pylib/gyp/MSVSVersion.py | python | VisualStudioVersion.Description | (self) | return self.description | Get the full description of the version. | Get the full description of the version. | [
"Get",
"the",
"full",
"description",
"of",
"the",
"version",
"."
] | def Description(self):
"""Get the full description of the version."""
return self.description | [
"def",
"Description",
"(",
"self",
")",
":",
"return",
"self",
".",
"description"
] | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/MSVSVersion.py#L51-L53 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/pydoc.py | python | _start_server | (urlhandler, hostname, port) | return thread | Start an HTTP server thread on a specific port.
Start an HTML/text server thread, so HTML or text documents can be
browsed dynamically and interactively with a Web browser. Example use:
>>> import time
>>> import pydoc
Define a URL handler. To determine what the client is asking
... | Start an HTTP server thread on a specific port. | [
"Start",
"an",
"HTTP",
"server",
"thread",
"on",
"a",
"specific",
"port",
"."
] | def _start_server(urlhandler, hostname, port):
"""Start an HTTP server thread on a specific port.
Start an HTML/text server thread, so HTML or text documents can be
browsed dynamically and interactively with a Web browser. Example use:
>>> import time
>>> import pydoc
Define a UR... | [
"def",
"_start_server",
"(",
"urlhandler",
",",
"hostname",
",",
"port",
")",
":",
"import",
"http",
".",
"server",
"import",
"email",
".",
"message",
"import",
"select",
"import",
"threading",
"class",
"DocHandler",
"(",
"http",
".",
"server",
".",
"BaseHTT... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pydoc.py#L2285-L2434 | |
ValveSoftware/source-sdk-2013 | 0d8dceea4310fde5706b3ce1c70609d72a38efdf | mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/service_reflection.py | python | GeneratedServiceStubType.__init__ | (cls, name, bases, dictionary) | Creates a message service stub class.
Args:
name: Name of the class (ignored, here).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
dictionary[_DESCRIPTOR_KEY] must contain a ServiceDescriptor object
describing ... | Creates a message service stub class. | [
"Creates",
"a",
"message",
"service",
"stub",
"class",
"."
] | def __init__(cls, name, bases, dictionary):
"""Creates a message service stub class.
Args:
name: Name of the class (ignored, here).
bases: Base classes of the class being constructed.
dictionary: The class dictionary of the class being constructed.
dictionary[_DESCRIPTOR_KEY] must con... | [
"def",
"__init__",
"(",
"cls",
",",
"name",
",",
"bases",
",",
"dictionary",
")",
":",
"super",
"(",
"GeneratedServiceStubType",
",",
"cls",
")",
".",
"__init__",
"(",
"name",
",",
"bases",
",",
"dictionary",
")",
"# Don't do anything if this class doesn't have ... | https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/service_reflection.py#L94-L111 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/scons/getversion.py | python | _GitGeneratedLongVersion | () | return "{0}-{1}".format(versionName, buildNumber) | Calculate the version name and build number into a single build string. | Calculate the version name and build number into a single build string. | [
"Calculate",
"the",
"version",
"name",
"and",
"build",
"number",
"into",
"a",
"single",
"build",
"string",
"."
] | def _GitGeneratedLongVersion():
"""Calculate the version name and build number into a single build string."""
versionName, buildNumber = _GitVersionNameAndBuildNumber()
return "{0}-{1}".format(versionName, buildNumber) | [
"def",
"_GitGeneratedLongVersion",
"(",
")",
":",
"versionName",
",",
"buildNumber",
"=",
"_GitVersionNameAndBuildNumber",
"(",
")",
"return",
"\"{0}-{1}\"",
".",
"format",
"(",
"versionName",
",",
"buildNumber",
")"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/scons/getversion.py#L49-L53 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/array_analysis.py | python | EquivSet.is_empty | (self) | return self.obj_to_ind == {} | Return true if the set is empty, or false otherwise. | Return true if the set is empty, or false otherwise. | [
"Return",
"true",
"if",
"the",
"set",
"is",
"empty",
"or",
"false",
"otherwise",
"."
] | def is_empty(self):
"""Return true if the set is empty, or false otherwise.
"""
return self.obj_to_ind == {} | [
"def",
"is_empty",
"(",
"self",
")",
":",
"return",
"self",
".",
"obj_to_ind",
"==",
"{",
"}"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/array_analysis.py#L194-L197 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mhlib.py | python | Folder.listallsubfolders | (self) | return self.mh.listallsubfolders(self.name) | Return list of all subfolders. | Return list of all subfolders. | [
"Return",
"list",
"of",
"all",
"subfolders",
"."
] | def listallsubfolders(self):
"""Return list of all subfolders."""
return self.mh.listallsubfolders(self.name) | [
"def",
"listallsubfolders",
"(",
"self",
")",
":",
"return",
"self",
".",
"mh",
".",
"listallsubfolders",
"(",
"self",
".",
"name",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mhlib.py#L276-L278 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/html2.py | python | WebViewHandler.GetFile | (*args, **kwargs) | return _html2.WebViewHandler_GetFile(*args, **kwargs) | GetFile(self, String uri) -> FSFile | GetFile(self, String uri) -> FSFile | [
"GetFile",
"(",
"self",
"String",
"uri",
")",
"-",
">",
"FSFile"
] | def GetFile(*args, **kwargs):
"""GetFile(self, String uri) -> FSFile"""
return _html2.WebViewHandler_GetFile(*args, **kwargs) | [
"def",
"GetFile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html2",
".",
"WebViewHandler_GetFile",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/html2.py#L392-L394 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewItemAttr.SetItalic | (*args, **kwargs) | return _dataview.DataViewItemAttr_SetItalic(*args, **kwargs) | SetItalic(self, bool set) | SetItalic(self, bool set) | [
"SetItalic",
"(",
"self",
"bool",
"set",
")"
] | def SetItalic(*args, **kwargs):
"""SetItalic(self, bool set)"""
return _dataview.DataViewItemAttr_SetItalic(*args, **kwargs) | [
"def",
"SetItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewItemAttr_SetItalic",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L341-L343 | |
OGRECave/ogre-next | 287307980e6de8910f04f3cc0994451b075071fd | Tools/BlenderExport/ogrepkg/armatureexport.py | python | ArmatureExporter.getAdditionalRootBoneTransformation | (self) | return self.additionalRootBoneTransformation | Retruns transformation from Blender's armature object coordinate system
to Blender's mesh object coordinate system. | Retruns transformation from Blender's armature object coordinate system
to Blender's mesh object coordinate system. | [
"Retruns",
"transformation",
"from",
"Blender",
"s",
"armature",
"object",
"coordinate",
"system",
"to",
"Blender",
"s",
"mesh",
"object",
"coordinate",
"system",
"."
] | def getAdditionalRootBoneTransformation(self):
"""Retruns transformation from Blender's armature object coordinate system
to Blender's mesh object coordinate system.
"""
return self.additionalRootBoneTransformation | [
"def",
"getAdditionalRootBoneTransformation",
"(",
"self",
")",
":",
"return",
"self",
".",
"additionalRootBoneTransformation"
] | https://github.com/OGRECave/ogre-next/blob/287307980e6de8910f04f3cc0994451b075071fd/Tools/BlenderExport/ogrepkg/armatureexport.py#L509-L513 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_view.py | python | GeneralFittingView.set_slot_for_simultaneous_fit_by_changed | (self, slot) | Connect the slot for the fit by combo box being changed. | Connect the slot for the fit by combo box being changed. | [
"Connect",
"the",
"slot",
"for",
"the",
"fit",
"by",
"combo",
"box",
"being",
"changed",
"."
] | def set_slot_for_simultaneous_fit_by_changed(self, slot) -> None:
"""Connect the slot for the fit by combo box being changed."""
self.general_fitting_options.set_slot_for_simultaneous_fit_by_changed(slot) | [
"def",
"set_slot_for_simultaneous_fit_by_changed",
"(",
"self",
",",
"slot",
")",
"->",
"None",
":",
"self",
".",
"general_fitting_options",
".",
"set_slot_for_simultaneous_fit_by_changed",
"(",
"slot",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_view.py#L34-L36 | ||
funnyzhou/Adaptive_Feeding | 9c78182331d8c0ea28de47226e805776c638d46f | tools/demo.py | python | demo | (net, image_name) | Detect object classes in an image using pre-computed object proposals. | Detect object classes in an image using pre-computed object proposals. | [
"Detect",
"object",
"classes",
"in",
"an",
"image",
"using",
"pre",
"-",
"computed",
"object",
"proposals",
"."
] | def demo(net, image_name):
"""Detect object classes in an image using pre-computed object proposals."""
# Load the demo image
im_file = os.path.join(cfg.DATA_DIR, 'demo', image_name)
im = cv2.imread(im_file)
# Detect all object classes and regress object bounds
timer = Timer()
timer.tic()
... | [
"def",
"demo",
"(",
"net",
",",
"image_name",
")",
":",
"# Load the demo image",
"im_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"cfg",
".",
"DATA_DIR",
",",
"'demo'",
",",
"image_name",
")",
"im",
"=",
"cv2",
".",
"imread",
"(",
"im_file",
")",
... | https://github.com/funnyzhou/Adaptive_Feeding/blob/9c78182331d8c0ea28de47226e805776c638d46f/tools/demo.py#L72-L98 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | Font.GetNativeFontInfo | (*args, **kwargs) | return _gdi_.Font_GetNativeFontInfo(*args, **kwargs) | GetNativeFontInfo(self) -> NativeFontInfo
Constructs a `wx.NativeFontInfo` object from this font. | GetNativeFontInfo(self) -> NativeFontInfo | [
"GetNativeFontInfo",
"(",
"self",
")",
"-",
">",
"NativeFontInfo"
] | def GetNativeFontInfo(*args, **kwargs):
"""
GetNativeFontInfo(self) -> NativeFontInfo
Constructs a `wx.NativeFontInfo` object from this font.
"""
return _gdi_.Font_GetNativeFontInfo(*args, **kwargs) | [
"def",
"GetNativeFontInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_GetNativeFontInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L2255-L2261 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/applications/workbench/workbench/widgets/plotselector/view.py | python | HumanReadableSortItem.convert | (self, text) | return int(text) if text.isdigit() else text.lower() | Convert some text for comparison
:param text: A string with the text to convert
:return: An int if the string is fully numeric, else the text
in lower case | Convert some text for comparison
:param text: A string with the text to convert
:return: An int if the string is fully numeric, else the text
in lower case | [
"Convert",
"some",
"text",
"for",
"comparison",
":",
"param",
"text",
":",
"A",
"string",
"with",
"the",
"text",
"to",
"convert",
":",
"return",
":",
"An",
"int",
"if",
"the",
"string",
"is",
"fully",
"numeric",
"else",
"the",
"text",
"in",
"lower",
"c... | def convert(self, text):
"""
Convert some text for comparison
:param text: A string with the text to convert
:return: An int if the string is fully numeric, else the text
in lower case
"""
return int(text) if text.isdigit() else text.lower() | [
"def",
"convert",
"(",
"self",
",",
"text",
")",
":",
"return",
"int",
"(",
"text",
")",
"if",
"text",
".",
"isdigit",
"(",
")",
"else",
"text",
".",
"lower",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/widgets/plotselector/view.py#L769-L776 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/propgrid.py | python | PropertyGrid.GetSelectionForegroundColour | (*args, **kwargs) | return _propgrid.PropertyGrid_GetSelectionForegroundColour(*args, **kwargs) | GetSelectionForegroundColour(self) -> Colour | GetSelectionForegroundColour(self) -> Colour | [
"GetSelectionForegroundColour",
"(",
"self",
")",
"-",
">",
"Colour"
] | def GetSelectionForegroundColour(*args, **kwargs):
"""GetSelectionForegroundColour(self) -> Colour"""
return _propgrid.PropertyGrid_GetSelectionForegroundColour(*args, **kwargs) | [
"def",
"GetSelectionForegroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_GetSelectionForegroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2134-L2136 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/inference.py | python | _iterable_not_string | (obj) | return isinstance(obj, abc.Iterable) and not isinstance(obj, str) | Check if the object is an iterable but not a string.
Parameters
----------
obj : The object to check.
Returns
-------
is_iter_not_string : bool
Whether `obj` is a non-string iterable.
Examples
--------
>>> _iterable_not_string([1, 2, 3])
True
>>> _iterable_not_stri... | Check if the object is an iterable but not a string. | [
"Check",
"if",
"the",
"object",
"is",
"an",
"iterable",
"but",
"not",
"a",
"string",
"."
] | def _iterable_not_string(obj) -> bool:
"""
Check if the object is an iterable but not a string.
Parameters
----------
obj : The object to check.
Returns
-------
is_iter_not_string : bool
Whether `obj` is a non-string iterable.
Examples
--------
>>> _iterable_not_st... | [
"def",
"_iterable_not_string",
"(",
"obj",
")",
"->",
"bool",
":",
"return",
"isinstance",
"(",
"obj",
",",
"abc",
".",
"Iterable",
")",
"and",
"not",
"isinstance",
"(",
"obj",
",",
"str",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/dtypes/inference.py#L70-L93 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/mavlink_px4.py | python | MAVLink.set_quad_swarm_led_roll_pitch_yaw_thrust_send | (self, group, mode, led_red, led_blue, led_green, roll, pitch, yaw, thrust) | return self.send(self.set_quad_swarm_led_roll_pitch_yaw_thrust_encode(group, mode, led_red, led_blue, led_green, roll, pitch, yaw, thrust)) | Setpoint for up to four quadrotors in a group / wing
group : ID of the quadrotor group (0 - 255, up to 256 groups supported) (uint8_t)
mode : ID of the flight mode (0 - 255, up to 256 modes supported) (uint8_t)
led_red ... | Setpoint for up to four quadrotors in a group / wing | [
"Setpoint",
"for",
"up",
"to",
"four",
"quadrotors",
"in",
"a",
"group",
"/",
"wing"
] | def set_quad_swarm_led_roll_pitch_yaw_thrust_send(self, group, mode, led_red, led_blue, led_green, roll, pitch, yaw, thrust):
'''
Setpoint for up to four quadrotors in a group / wing
group : ID of the quadrotor group (0 - 255, up to 256 groups support... | [
"def",
"set_quad_swarm_led_roll_pitch_yaw_thrust_send",
"(",
"self",
",",
"group",
",",
"mode",
",",
"led_red",
",",
"led_blue",
",",
"led_green",
",",
"roll",
",",
"pitch",
",",
"yaw",
",",
"thrust",
")",
":",
"return",
"self",
".",
"send",
"(",
"self",
"... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/mavlink_px4.py#L4164-L4179 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/codecs.py | python | StreamWriter.writelines | (self, list) | Writes the concatenated list of strings to the stream
using .write(). | Writes the concatenated list of strings to the stream
using .write(). | [
"Writes",
"the",
"concatenated",
"list",
"of",
"strings",
"to",
"the",
"stream",
"using",
".",
"write",
"()",
"."
] | def writelines(self, list):
""" Writes the concatenated list of strings to the stream
using .write().
"""
self.write(''.join(list)) | [
"def",
"writelines",
"(",
"self",
",",
"list",
")",
":",
"self",
".",
"write",
"(",
"''",
".",
"join",
"(",
"list",
")",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/codecs.py#L354-L359 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/python/gem5/components/memory/dramsim_3.py | python | SingleChannel.__init__ | (self, mem_type: str, size: Optional[str]) | :param mem_name: The name of the type of memory to be configured.
:param num_chnls: The number of channels. | :param mem_name: The name of the type of memory to be configured.
:param num_chnls: The number of channels. | [
":",
"param",
"mem_name",
":",
"The",
"name",
"of",
"the",
"type",
"of",
"memory",
"to",
"be",
"configured",
".",
":",
"param",
"num_chnls",
":",
"The",
"number",
"of",
"channels",
"."
] | def __init__(self, mem_type: str, size: Optional[str]):
"""
:param mem_name: The name of the type of memory to be configured.
:param num_chnls: The number of channels.
"""
super().__init__()
self.mem_ctrl = DRAMSim3MemCtrl(mem_type, 1)
self._size = toMemorySize(s... | [
"def",
"__init__",
"(",
"self",
",",
"mem_type",
":",
"str",
",",
"size",
":",
"Optional",
"[",
"str",
"]",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
")",
"self",
".",
"mem_ctrl",
"=",
"DRAMSim3MemCtrl",
"(",
"mem_type",
",",
"1",
")",
"se... | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/gem5/components/memory/dramsim_3.py#L92-L103 | ||
uzh-rpg/rpg_svo | d6161063b47f36ce78252ee4c4fedf3f6d8f2898 | svo_analysis/src/svo_analysis/tum_benchmark_tools/evaluate_rpe.py | python | compute_distance | (transform) | return numpy.linalg.norm(transform[0:3,3]) | Compute the distance of the translational component of a 4x4 homogeneous matrix. | Compute the distance of the translational component of a 4x4 homogeneous matrix. | [
"Compute",
"the",
"distance",
"of",
"the",
"translational",
"component",
"of",
"a",
"4x4",
"homogeneous",
"matrix",
"."
] | def compute_distance(transform):
"""
Compute the distance of the translational component of a 4x4 homogeneous matrix.
"""
return numpy.linalg.norm(transform[0:3,3]) | [
"def",
"compute_distance",
"(",
"transform",
")",
":",
"return",
"numpy",
".",
"linalg",
".",
"norm",
"(",
"transform",
"[",
"0",
":",
"3",
",",
"3",
"]",
")"
] | https://github.com/uzh-rpg/rpg_svo/blob/d6161063b47f36ce78252ee4c4fedf3f6d8f2898/svo_analysis/src/svo_analysis/tum_benchmark_tools/evaluate_rpe.py#L162-L166 | |
qt/qtbase | 81b9ee66b8e40ed145185fe46b7c91929688cafd | src/3rdparty/freetype/src/tools/glnames.py | python | adobe_glyph_values | () | return glyphs, values | return the list of glyph names and their unicode values | return the list of glyph names and their unicode values | [
"return",
"the",
"list",
"of",
"glyph",
"names",
"and",
"their",
"unicode",
"values"
] | def adobe_glyph_values():
"""return the list of glyph names and their unicode values"""
lines = string.split( adobe_glyph_list, '\n' )
glyphs = []
values = []
for line in lines:
if line:
fields = string.split( line, ';' )
# print fields[1] + ' - ' + fields[0]
subfields = string.split( f... | [
"def",
"adobe_glyph_values",
"(",
")",
":",
"lines",
"=",
"string",
".",
"split",
"(",
"adobe_glyph_list",
",",
"'\\n'",
")",
"glyphs",
"=",
"[",
"]",
"values",
"=",
"[",
"]",
"for",
"line",
"in",
"lines",
":",
"if",
"line",
":",
"fields",
"=",
"stri... | https://github.com/qt/qtbase/blob/81b9ee66b8e40ed145185fe46b7c91929688cafd/src/3rdparty/freetype/src/tools/glnames.py#L5177-L5193 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/interpolate/fitpack2.py | python | SphereBivariateSpline.__call__ | (self, theta, phi, dtheta=0, dphi=0, grid=True) | return _BivariateSplineBase.__call__(self, theta, phi,
dx=dtheta, dy=dphi, grid=grid) | Evaluate the spline or its derivatives at given positions.
Parameters
----------
theta, phi : array_like
Input coordinates.
If `grid` is False, evaluate the spline at points
``(theta[i], phi[i]), i=0, ..., len(x)-1``. Standard
Numpy broadcasting... | Evaluate the spline or its derivatives at given positions. | [
"Evaluate",
"the",
"spline",
"or",
"its",
"derivatives",
"at",
"given",
"positions",
"."
] | def __call__(self, theta, phi, dtheta=0, dphi=0, grid=True):
"""
Evaluate the spline or its derivatives at given positions.
Parameters
----------
theta, phi : array_like
Input coordinates.
If `grid` is False, evaluate the spline at points
``(... | [
"def",
"__call__",
"(",
"self",
",",
"theta",
",",
"phi",
",",
"dtheta",
"=",
"0",
",",
"dphi",
"=",
"0",
",",
"grid",
"=",
"True",
")",
":",
"theta",
"=",
"np",
".",
"asarray",
"(",
"theta",
")",
"phi",
"=",
"np",
".",
"asarray",
"(",
"phi",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/interpolate/fitpack2.py#L1225-L1265 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/pubsub/core/topicmgr.py | python | TopicManager.delTopic | (self, name) | return True | Delete the named topic, including all sub-topics. Returns False
if topic does not exist; True otherwise. Also unsubscribe any listeners
of topic and all subtopics. | Delete the named topic, including all sub-topics. Returns False
if topic does not exist; True otherwise. Also unsubscribe any listeners
of topic and all subtopics. | [
"Delete",
"the",
"named",
"topic",
"including",
"all",
"sub",
"-",
"topics",
".",
"Returns",
"False",
"if",
"topic",
"does",
"not",
"exist",
";",
"True",
"otherwise",
".",
"Also",
"unsubscribe",
"any",
"listeners",
"of",
"topic",
"and",
"all",
"subtopics",
... | def delTopic(self, name):
"""Delete the named topic, including all sub-topics. Returns False
if topic does not exist; True otherwise. Also unsubscribe any listeners
of topic and all subtopics. """
# find from which parent the topic object should be removed
dottedName = stringize... | [
"def",
"delTopic",
"(",
"self",
",",
"name",
")",
":",
"# find from which parent the topic object should be removed",
"dottedName",
"=",
"stringize",
"(",
"name",
")",
"try",
":",
"#obj = weakref( self._topicsMap[dottedName] )",
"obj",
"=",
"self",
".",
"_topicsMap",
"[... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pubsub/core/topicmgr.py#L262-L283 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/installers.py | python | InstallerContext.set_os_override | (self, os_name, os_version) | Override the OS detector with *os_name* and *os_version*. See
:meth:`InstallerContext.detect_os`.
:param os_name: OS name value to use, ``str``
:param os_version: OS version value to use, ``str`` | Override the OS detector with *os_name* and *os_version*. See
:meth:`InstallerContext.detect_os`. | [
"Override",
"the",
"OS",
"detector",
"with",
"*",
"os_name",
"*",
"and",
"*",
"os_version",
"*",
".",
"See",
":",
"meth",
":",
"InstallerContext",
".",
"detect_os",
"."
] | def set_os_override(self, os_name, os_version):
"""
Override the OS detector with *os_name* and *os_version*. See
:meth:`InstallerContext.detect_os`.
:param os_name: OS name value to use, ``str``
:param os_version: OS version value to use, ``str``
"""
if self.ve... | [
"def",
"set_os_override",
"(",
"self",
",",
"os_name",
",",
"os_version",
")",
":",
"if",
"self",
".",
"verbose",
":",
"print",
"(",
"\"overriding OS to [%s:%s]\"",
"%",
"(",
"os_name",
",",
"os_version",
")",
")",
"self",
".",
"os_override",
"=",
"os_name",... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/installers.py#L80-L90 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/serializer_deserializer.py | python | expand_path | (node_repr, key, val) | Convert relative to absolute path. | Convert relative to absolute path. | [
"Convert",
"relative",
"to",
"absolute",
"path",
"."
] | def expand_path(node_repr, key, val):
"""Convert relative to absolute path."""
if isinstance(val, list):
node_repr[key] = [os.path.abspath(file) for file in val]
else:
node_repr[key] = os.path.abspath(val) | [
"def",
"expand_path",
"(",
"node_repr",
",",
"key",
",",
"val",
")",
":",
"if",
"isinstance",
"(",
"val",
",",
"list",
")",
":",
"node_repr",
"[",
"key",
"]",
"=",
"[",
"os",
".",
"path",
".",
"abspath",
"(",
"file",
")",
"for",
"file",
"in",
"va... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/serializer_deserializer.py#L94-L99 | ||
SpaceNetChallenge/BuildingDetectors | 3def3c44b5847c744cd2f3356182892d92496579 | qinhaifang/src/caffe-mnc/scripts/cpp_lint.py | python | CheckForNewlineAtEOF | (filename, lines, error) | Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found. | Logs an error if there is no newline char at the end of the file. | [
"Logs",
"an",
"error",
"if",
"there",
"is",
"no",
"newline",
"char",
"at",
"the",
"end",
"of",
"the",
"file",
"."
] | def CheckForNewlineAtEOF(filename, lines, error):
"""Logs an error if there is no newline char at the end of the file.
Args:
filename: The name of the current file.
lines: An array of strings, each representing a line of the file.
error: The function to call with any errors found.
"""
# The array ... | [
"def",
"CheckForNewlineAtEOF",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"# The array lines() was created by adding two newlines to the",
"# original file (go figure), then splitting on \\n.",
"# To verify that the file ends in \\n, we just have to make sure the",
"# last-but-... | https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/caffe-mnc/scripts/cpp_lint.py#L1508-L1523 | ||
DanielSWolf/rhubarb-lip-sync | 5cface0af3b6e4e58c0b829c51561d784fb9f52f | rhubarb/lib/sphinxbase-rev13216/doc/doxy2swig.py | python | Doxy2SWIG.parse | (self, node) | Parse a given node. This function in turn calls the
`parse_<nodeType>` functions which handle the respective
nodes. | Parse a given node. This function in turn calls the
`parse_<nodeType>` functions which handle the respective
nodes. | [
"Parse",
"a",
"given",
"node",
".",
"This",
"function",
"in",
"turn",
"calls",
"the",
"parse_<nodeType",
">",
"functions",
"which",
"handle",
"the",
"respective",
"nodes",
"."
] | def parse(self, node):
"""Parse a given node. This function in turn calls the
`parse_<nodeType>` functions which handle the respective
nodes.
"""
pm = getattr(self, "parse_%s"%node.__class__.__name__)
pm(node) | [
"def",
"parse",
"(",
"self",
",",
"node",
")",
":",
"pm",
"=",
"getattr",
"(",
"self",
",",
"\"parse_%s\"",
"%",
"node",
".",
"__class__",
".",
"__name__",
")",
"pm",
"(",
"node",
")"
] | https://github.com/DanielSWolf/rhubarb-lip-sync/blob/5cface0af3b6e4e58c0b829c51561d784fb9f52f/rhubarb/lib/sphinxbase-rev13216/doc/doxy2swig.py#L125-L132 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/datasets.py | python | Dataset.sync_update | (self, condition_name, num_batch=None, data=None) | Release a blocking condition and trigger callback with given data.
Args:
condition_name (str): The condition name that is used to toggle sending next row.
num_batch (Union[int, None]): The number of batches (rows) that are released.
When num_batch is None, it will defaul... | Release a blocking condition and trigger callback with given data. | [
"Release",
"a",
"blocking",
"condition",
"and",
"trigger",
"callback",
"with",
"given",
"data",
"."
] | def sync_update(self, condition_name, num_batch=None, data=None):
"""
Release a blocking condition and trigger callback with given data.
Args:
condition_name (str): The condition name that is used to toggle sending next row.
num_batch (Union[int, None]): The number of ba... | [
"def",
"sync_update",
"(",
"self",
",",
"condition_name",
",",
"num_batch",
"=",
"None",
",",
"data",
"=",
"None",
")",
":",
"if",
"(",
"not",
"isinstance",
"(",
"num_batch",
",",
"int",
")",
"and",
"num_batch",
"is",
"not",
"None",
")",
"or",
"(",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/datasets.py#L1705-L1731 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/jinja2/compiler.py | python | CodeGenerator.buffer | (self, frame) | Enable buffering for the frame from that point onwards. | Enable buffering for the frame from that point onwards. | [
"Enable",
"buffering",
"for",
"the",
"frame",
"from",
"that",
"point",
"onwards",
"."
] | def buffer(self, frame):
"""Enable buffering for the frame from that point onwards."""
frame.buffer = self.temporary_identifier()
self.writeline('%s = []' % frame.buffer) | [
"def",
"buffer",
"(",
"self",
",",
"frame",
")",
":",
"frame",
".",
"buffer",
"=",
"self",
".",
"temporary_identifier",
"(",
")",
"self",
".",
"writeline",
"(",
"'%s = []'",
"%",
"frame",
".",
"buffer",
")"
] | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/jinja2/compiler.py#L430-L433 | ||
ucsb-seclab/dr_checker | fe3f1cda247a10a4952e372f1e240709fe4be462 | visualizer/server/app.py | python | get_sourcecode | (path) | return resp | This route rreturns the sourcecode of the requested file if it exists | This route rreturns the sourcecode of the requested file if it exists | [
"This",
"route",
"rreturns",
"the",
"sourcecode",
"of",
"the",
"requested",
"file",
"if",
"it",
"exists"
] | def get_sourcecode(path):
"""
This route rreturns the sourcecode of the requested file if it exists
"""
path = path.replace('*', '/')
local_path_to_sourcecode = os.path.join(app.config["SOURCECODE_DIR"], path)
resp = "No such file..."
if os.path.exists(local_path_to_sourcecode):
with... | [
"def",
"get_sourcecode",
"(",
"path",
")",
":",
"path",
"=",
"path",
".",
"replace",
"(",
"'*'",
",",
"'/'",
")",
"local_path_to_sourcecode",
"=",
"os",
".",
"path",
".",
"join",
"(",
"app",
".",
"config",
"[",
"\"SOURCECODE_DIR\"",
"]",
",",
"path",
"... | https://github.com/ucsb-seclab/dr_checker/blob/fe3f1cda247a10a4952e372f1e240709fe4be462/visualizer/server/app.py#L104-L114 | |
perilouswithadollarsign/cstrike15_src | f82112a2388b841d72cb62ca48ab1846dfcc11c8 | thirdparty/protobuf-2.5.0/python/google/protobuf/internal/encoder.py | python | StringSizer | (field_number, is_repeated, is_packed) | Returns a sizer for a string field. | Returns a sizer for a string field. | [
"Returns",
"a",
"sizer",
"for",
"a",
"string",
"field",
"."
] | def StringSizer(field_number, is_repeated, is_packed):
"""Returns a sizer for a string field."""
tag_size = _TagSize(field_number)
local_VarintSize = _VarintSize
local_len = len
assert not is_packed
if is_repeated:
def RepeatedFieldSize(value):
result = tag_size * len(value)
for element in ... | [
"def",
"StringSizer",
"(",
"field_number",
",",
"is_repeated",
",",
"is_packed",
")",
":",
"tag_size",
"=",
"_TagSize",
"(",
"field_number",
")",
"local_VarintSize",
"=",
"_VarintSize",
"local_len",
"=",
"len",
"assert",
"not",
"is_packed",
"if",
"is_repeated",
... | https://github.com/perilouswithadollarsign/cstrike15_src/blob/f82112a2388b841d72cb62ca48ab1846dfcc11c8/thirdparty/protobuf-2.5.0/python/google/protobuf/internal/encoder.py#L227-L246 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/client/timeline.py | python | Timeline._allocate_pids | (self) | Allocate fake process ids for each device in the StepStats. | Allocate fake process ids for each device in the StepStats. | [
"Allocate",
"fake",
"process",
"ids",
"for",
"each",
"device",
"in",
"the",
"StepStats",
"."
] | def _allocate_pids(self):
"""Allocate fake process ids for each device in the StepStats."""
self._allocators_pid = self._alloc_pid()
self._chrome_trace.emit_pid('Allocators', self._allocators_pid)
# Add processes in the Chrome trace to show compute and data activity.
for dev_stats in self._step_sta... | [
"def",
"_allocate_pids",
"(",
"self",
")",
":",
"self",
".",
"_allocators_pid",
"=",
"self",
".",
"_alloc_pid",
"(",
")",
"self",
".",
"_chrome_trace",
".",
"emit_pid",
"(",
"'Allocators'",
",",
"self",
".",
"_allocators_pid",
")",
"# Add processes in the Chrome... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/client/timeline.py#L480-L492 | ||
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/showutil/TexMemWatcher.py | python | TexMemWatcher.placeTexture | (self, tr) | Places the texture somewhere on the canvas where it will
fit. | Places the texture somewhere on the canvas where it will
fit. | [
"Places",
"the",
"texture",
"somewhere",
"on",
"the",
"canvas",
"where",
"it",
"will",
"fit",
"."
] | def placeTexture(self, tr):
""" Places the texture somewhere on the canvas where it will
fit. """
tr.computePlacementSize(self)
tr.overflowed = 0
shouldFit = False
availableSize = self.limit - self.placedSize
if availableSize >= tr.size:
shouldFit = ... | [
"def",
"placeTexture",
"(",
"self",
",",
"tr",
")",
":",
"tr",
".",
"computePlacementSize",
"(",
"self",
")",
"tr",
".",
"overflowed",
"=",
"0",
"shouldFit",
"=",
"False",
"availableSize",
"=",
"self",
".",
"limit",
"-",
"self",
".",
"placedSize",
"if",
... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showutil/TexMemWatcher.py#L772-L836 | ||
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | DQMServices/Components/python/HTTP.py | python | RequestManager._request_init | (self, c, url) | Default request initialisation callback. | Default request initialisation callback. | [
"Default",
"request",
"initialisation",
"callback",
"."
] | def _request_init(self, c, url):
"""Default request initialisation callback."""
c.setopt(URL, url) | [
"def",
"_request_init",
"(",
"self",
",",
"c",
",",
"url",
")",
":",
"c",
".",
"setopt",
"(",
"URL",
",",
"url",
")"
] | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DQMServices/Components/python/HTTP.py#L74-L76 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/pystache/setup.py | python | make_temp_path | (path, new_ext=None) | return temp_path | Arguments:
new_ext: the new file extension, including the leading dot.
Defaults to preserving the existing file extension. | Arguments: | [
"Arguments",
":"
] | def make_temp_path(path, new_ext=None):
"""
Arguments:
new_ext: the new file extension, including the leading dot.
Defaults to preserving the existing file extension.
"""
root, ext = os.path.splitext(path)
if new_ext is None:
new_ext = ext
temp_path = root + TEMP_EXTENSIO... | [
"def",
"make_temp_path",
"(",
"path",
",",
"new_ext",
"=",
"None",
")",
":",
"root",
",",
"ext",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"path",
")",
"if",
"new_ext",
"is",
"None",
":",
"new_ext",
"=",
"ext",
"temp_path",
"=",
"root",
"+",
"T... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/pystache/setup.py#L183-L195 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/Fingerprints/FingerprintMols.py | python | Usage | () | prints a usage string and exits | prints a usage string and exits | [
"prints",
"a",
"usage",
"string",
"and",
"exits"
] | def Usage():
""" prints a usage string and exits
"""
print(_usageDoc)
sys.exit(-1) | [
"def",
"Usage",
"(",
")",
":",
"print",
"(",
"_usageDoc",
")",
"sys",
".",
"exit",
"(",
"-",
"1",
")"
] | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/Fingerprints/FingerprintMols.py#L339-L344 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/sql.py | python | get_engine | (engine: str) | return our implementation | return our implementation | [
"return",
"our",
"implementation"
] | def get_engine(engine: str) -> BaseEngine:
"""return our implementation"""
if engine == "auto":
engine = get_option("io.sql.engine")
if engine == "auto":
# try engines in this order
engine_classes = [SQLAlchemyEngine]
error_msgs = ""
for engine_class in engine_class... | [
"def",
"get_engine",
"(",
"engine",
":",
"str",
")",
"->",
"BaseEngine",
":",
"if",
"engine",
"==",
"\"auto\"",
":",
"engine",
"=",
"get_option",
"(",
"\"io.sql.engine\"",
")",
"if",
"engine",
"==",
"\"auto\"",
":",
"# try engines in this order",
"engine_classes... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/sql.py#L1353-L1382 | ||
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/internal/decoder.py | python | _FieldSkipper | () | return SkipField | Constructs the SkipField function. | Constructs the SkipField function. | [
"Constructs",
"the",
"SkipField",
"function",
"."
] | def _FieldSkipper():
"""Constructs the SkipField function."""
WIRETYPE_TO_SKIPPER = [
_SkipVarint,
_SkipFixed64,
_SkipLengthDelimited,
_SkipGroup,
_EndGroup,
_SkipFixed32,
_RaiseInvalidWireType,
_RaiseInvalidWireType,
]
wiretype_mask = wire_format.TAG_TYPE_M... | [
"def",
"_FieldSkipper",
"(",
")",
":",
"WIRETYPE_TO_SKIPPER",
"=",
"[",
"_SkipVarint",
",",
"_SkipFixed64",
",",
"_SkipLengthDelimited",
",",
"_SkipGroup",
",",
"_EndGroup",
",",
"_SkipFixed32",
",",
"_RaiseInvalidWireType",
",",
"_RaiseInvalidWireType",
",",
"]",
"... | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/decoder.py#L799-L829 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_data.py | python | Data.put_sequence | (self, s: List[Any]) | A convenience method for encoding a Python ``list`` as an
AMQP list.
:param s: The sequence to be encoded
:raise: :exc:`DataException` if there is a Proton error. | A convenience method for encoding a Python ``list`` as an
AMQP list. | [
"A",
"convenience",
"method",
"for",
"encoding",
"a",
"Python",
"list",
"as",
"an",
"AMQP",
"list",
"."
] | def put_sequence(self, s: List[Any]) -> None:
"""
A convenience method for encoding a Python ``list`` as an
AMQP list.
:param s: The sequence to be encoded
:raise: :exc:`DataException` if there is a Proton error.
"""
self.put_list()
self.enter()
t... | [
"def",
"put_sequence",
"(",
"self",
",",
"s",
":",
"List",
"[",
"Any",
"]",
")",
"->",
"None",
":",
"self",
".",
"put_list",
"(",
")",
"self",
".",
"enter",
"(",
")",
"try",
":",
"for",
"o",
"in",
"s",
":",
"self",
".",
"put_object",
"(",
"o",
... | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_data.py#L1449-L1463 | ||
devsisters/libquic | 8954789a056d8e7d5fcb6452fd1572ca57eb5c4e | src/third_party/protobuf/python/google/protobuf/message.py | python | Message.MergeFrom | (self, other_msg) | Merges the contents of the specified message into current message.
This method merges the contents of the specified message into the current
message. Singular fields that are set in the specified message overwrite
the corresponding fields in the current message. Repeated fields are
appended. Singular s... | Merges the contents of the specified message into current message. | [
"Merges",
"the",
"contents",
"of",
"the",
"specified",
"message",
"into",
"current",
"message",
"."
] | def MergeFrom(self, other_msg):
"""Merges the contents of the specified message into current message.
This method merges the contents of the specified message into the current
message. Singular fields that are set in the specified message overwrite
the corresponding fields in the current message. Repea... | [
"def",
"MergeFrom",
"(",
"self",
",",
"other_msg",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/message.py#L93-L104 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | NumberGenerator.deasterisk | (self, type) | return type.replace('*', '') | Remove the possible asterisk in a layout type. | Remove the possible asterisk in a layout type. | [
"Remove",
"the",
"possible",
"asterisk",
"in",
"a",
"layout",
"type",
"."
] | def deasterisk(self, type):
"Remove the possible asterisk in a layout type."
return type.replace('*', '') | [
"def",
"deasterisk",
"(",
"self",
",",
"type",
")",
":",
"return",
"type",
".",
"replace",
"(",
"'*'",
",",
"''",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L3299-L3301 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | current/deps/v8/third_party/jinja2/sandbox.py | python | SandboxedEnvironment.call_unop | (self, context, operator, arg) | return self.unop_table[operator](arg) | For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6 | For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators. | [
"For",
"intercepted",
"unary",
"operator",
"calls",
"(",
":",
"meth",
":",
"intercepted_unops",
")",
"this",
"function",
"is",
"executed",
"instead",
"of",
"the",
"builtin",
"operator",
".",
"This",
"can",
"be",
"used",
"to",
"fine",
"tune",
"the",
"behavior... | def call_unop(self, context, operator, arg):
"""For intercepted unary operator calls (:meth:`intercepted_unops`)
this function is executed instead of the builtin operator. This can
be used to fine tune the behavior of certain operators.
.. versionadded:: 2.6
"""
return ... | [
"def",
"call_unop",
"(",
"self",
",",
"context",
",",
"operator",
",",
"arg",
")",
":",
"return",
"self",
".",
"unop_table",
"[",
"operator",
"]",
"(",
"arg",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/sandbox.py#L350-L357 | |
google/or-tools | 2cb85b4eead4c38e1c54b48044f92087cf165bce | examples/python/integer_programming.py | python | RunIntegerExampleCppStyleAPI | (optimization_problem_type) | Example of simple integer program with the C++ style API. | Example of simple integer program with the C++ style API. | [
"Example",
"of",
"simple",
"integer",
"program",
"with",
"the",
"C",
"++",
"style",
"API",
"."
] | def RunIntegerExampleCppStyleAPI(optimization_problem_type):
"""Example of simple integer program with the C++ style API."""
solver = pywraplp.Solver.CreateSolver(optimization_problem_type)
if not solver:
return
Announce(optimization_problem_type, 'C++ style API')
infinity = solver.infinit... | [
"def",
"RunIntegerExampleCppStyleAPI",
"(",
"optimization_problem_type",
")",
":",
"solver",
"=",
"pywraplp",
".",
"Solver",
".",
"CreateSolver",
"(",
"optimization_problem_type",
")",
"if",
"not",
"solver",
":",
"return",
"Announce",
"(",
"optimization_problem_type",
... | https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/examples/python/integer_programming.py#L45-L68 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/gdb/mongo.py | python | get_boost_optional | (optional) | return storage.cast(value_ref_type).dereference() | Retrieve the value stored in a boost::optional type, if it is non-empty.
Returns None if the optional is empty.
TODO: Import the boost pretty printers instead of using this custom function. | Retrieve the value stored in a boost::optional type, if it is non-empty. | [
"Retrieve",
"the",
"value",
"stored",
"in",
"a",
"boost",
"::",
"optional",
"type",
"if",
"it",
"is",
"non",
"-",
"empty",
"."
] | def get_boost_optional(optional):
"""
Retrieve the value stored in a boost::optional type, if it is non-empty.
Returns None if the optional is empty.
TODO: Import the boost pretty printers instead of using this custom function.
"""
if not optional['m_initialized']:
return None
valu... | [
"def",
"get_boost_optional",
"(",
"optional",
")",
":",
"if",
"not",
"optional",
"[",
"'m_initialized'",
"]",
":",
"return",
"None",
"value_ref_type",
"=",
"optional",
".",
"type",
".",
"template_argument",
"(",
"0",
")",
".",
"pointer",
"(",
")",
"storage",... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/gdb/mongo.py#L183-L195 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py | python | install.change_roots | (self, *names) | Change the install directories pointed by name using root. | Change the install directories pointed by name using root. | [
"Change",
"the",
"install",
"directories",
"pointed",
"by",
"name",
"using",
"root",
"."
] | def change_roots(self, *names):
"""Change the install directories pointed by name using root."""
for name in names:
attr = "install_" + name
setattr(self, attr, change_root(self.root, getattr(self, attr))) | [
"def",
"change_roots",
"(",
"self",
",",
"*",
"names",
")",
":",
"for",
"name",
"in",
"names",
":",
"attr",
"=",
"\"install_\"",
"+",
"name",
"setattr",
"(",
"self",
",",
"attr",
",",
"change_root",
"(",
"self",
".",
"root",
",",
"getattr",
"(",
"sel... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py#L523-L527 | ||
hzl123456/LibyuvDemo | d02b6500d0cf111bdd8778c56983154e6d14bdb4 | libyuv/src/main/cpp/libyuv/tools_libyuv/autoroller/roll_deps.py | python | _GetBranches | () | return active, branches | Returns a tuple of active,branches.
The 'active' is the name of the currently active branch and 'branches' is a
list of all branches. | Returns a tuple of active,branches. | [
"Returns",
"a",
"tuple",
"of",
"active",
"branches",
"."
] | def _GetBranches():
"""Returns a tuple of active,branches.
The 'active' is the name of the currently active branch and 'branches' is a
list of all branches.
"""
lines = _RunCommand(['git', 'branch'])[0].split('\n')
branches = []
active = ''
for line in lines:
if '*' in line:
# The assumption ... | [
"def",
"_GetBranches",
"(",
")",
":",
"lines",
"=",
"_RunCommand",
"(",
"[",
"'git'",
",",
"'branch'",
"]",
")",
"[",
"0",
"]",
".",
"split",
"(",
"'\\n'",
")",
"branches",
"=",
"[",
"]",
"active",
"=",
"''",
"for",
"line",
"in",
"lines",
":",
"i... | https://github.com/hzl123456/LibyuvDemo/blob/d02b6500d0cf111bdd8778c56983154e6d14bdb4/libyuv/src/main/cpp/libyuv/tools_libyuv/autoroller/roll_deps.py#L129-L147 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/reduction_gui/reduction/diffraction/diffraction_reduction_script.py | python | DiffractionReductionScripter.__init__ | (self, name, facility='SNS') | return | Initialization | Initialization | [
"Initialization"
] | def __init__(self, name, facility='SNS'):
""" Initialization
"""
# Call base class
super(DiffractionReductionScripter, self).__init__(name=name, facility=facility)
# Find whether there is stored setup XMLs
homedir = os.path.expanduser("~")
mantidconfigdir = os.pa... | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"facility",
"=",
"'SNS'",
")",
":",
"# Call base class",
"super",
"(",
"DiffractionReductionScripter",
",",
"self",
")",
".",
"__init__",
"(",
"name",
"=",
"name",
",",
"facility",
"=",
"facility",
")",
"# ... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/reduction_gui/reduction/diffraction/diffraction_reduction_script.py#L35-L58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.