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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/ReflectometryReductionOneLiveData.py | python | ReflectometryReductionOneLiveData._run_reduction_algorithm | (self, alg) | Run the reduction | Run the reduction | [
"Run",
"the",
"reduction"
] | def _run_reduction_algorithm(self, alg):
"""Run the reduction"""
alg.execute()
out_ws = alg.getProperty("OutputWorkspaceBinned").value
self.setProperty("OutputWorkspace", out_ws) | [
"def",
"_run_reduction_algorithm",
"(",
"self",
",",
"alg",
")",
":",
"alg",
".",
"execute",
"(",
")",
"out_ws",
"=",
"alg",
".",
"getProperty",
"(",
"\"OutputWorkspaceBinned\"",
")",
".",
"value",
"self",
".",
"setProperty",
"(",
"\"OutputWorkspace\"",
",",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/ReflectometryReductionOneLiveData.py#L97-L101 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/layers/nn.py | python | fc | (input,
size,
num_flatten_dims=1,
param_attr=None,
bias_attr=None,
act=None,
name=None) | return helper.append_activation(pre_activation) | r"""
:api_attr: Static Graph
**Fully Connected Layer**
This operator creates a fully connected layer in the network. It can take
a Tensor(or LoDTensor) or a list of Tensor(or LoDTensor) as its inputs(see
Args in detail). It creates a variable called weight for each input Tensor,
which represen... | r"""
:api_attr: Static Graph | [
"r",
":",
"api_attr",
":",
"Static",
"Graph"
] | def fc(input,
size,
num_flatten_dims=1,
param_attr=None,
bias_attr=None,
act=None,
name=None):
r"""
:api_attr: Static Graph
**Fully Connected Layer**
This operator creates a fully connected layer in the network. It can take
a Tensor(or LoDTensor) or a list... | [
"def",
"fc",
"(",
"input",
",",
"size",
",",
"num_flatten_dims",
"=",
"1",
",",
"param_attr",
"=",
"None",
",",
"bias_attr",
"=",
"None",
",",
"act",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"helper",
"=",
"LayerHelper",
"(",
"\"fc\"",
",",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/nn.py#L212-L371 | |
apache/qpid-proton | 6bcdfebb55ea3554bc29b1901422532db331a591 | python/proton/_utils.py | python | BlockingConnection.on_connection_remote_close | (self, event: 'Event') | Event callback for when the link peer closes the connection. | Event callback for when the link peer closes the connection. | [
"Event",
"callback",
"for",
"when",
"the",
"link",
"peer",
"closes",
"the",
"connection",
"."
] | def on_connection_remote_close(self, event: 'Event') -> None:
"""
Event callback for when the link peer closes the connection.
"""
if event.connection.state & Endpoint.LOCAL_ACTIVE:
event.connection.close()
if not self.closing:
raise ConnectionClos... | [
"def",
"on_connection_remote_close",
"(",
"self",
",",
"event",
":",
"'Event'",
")",
"->",
"None",
":",
"if",
"event",
".",
"connection",
".",
"state",
"&",
"Endpoint",
".",
"LOCAL_ACTIVE",
":",
"event",
".",
"connection",
".",
"close",
"(",
")",
"if",
"... | https://github.com/apache/qpid-proton/blob/6bcdfebb55ea3554bc29b1901422532db331a591/python/proton/_utils.py#L545-L552 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBListener.WaitForEvent | (self, num_seconds, event) | return _lldb.SBListener_WaitForEvent(self, num_seconds, event) | WaitForEvent(SBListener self, uint32_t num_seconds, SBEvent event) -> bool | WaitForEvent(SBListener self, uint32_t num_seconds, SBEvent event) -> bool | [
"WaitForEvent",
"(",
"SBListener",
"self",
"uint32_t",
"num_seconds",
"SBEvent",
"event",
")",
"-",
">",
"bool"
] | def WaitForEvent(self, num_seconds, event):
"""WaitForEvent(SBListener self, uint32_t num_seconds, SBEvent event) -> bool"""
return _lldb.SBListener_WaitForEvent(self, num_seconds, event) | [
"def",
"WaitForEvent",
"(",
"self",
",",
"num_seconds",
",",
"event",
")",
":",
"return",
"_lldb",
".",
"SBListener_WaitForEvent",
"(",
"self",
",",
"num_seconds",
",",
"event",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L6855-L6857 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/encodings/quopri_codec.py | python | quopri_decode | (input, errors='strict') | return (output, len(input)) | Decode the input, returning a tuple (output object, length consumed).
errors defines the error handling to apply. It defaults to
'strict' handling which is the only currently supported
error handling for this codec. | Decode the input, returning a tuple (output object, length consumed). | [
"Decode",
"the",
"input",
"returning",
"a",
"tuple",
"(",
"output",
"object",
"length",
"consumed",
")",
"."
] | def quopri_decode(input, errors='strict'):
"""Decode the input, returning a tuple (output object, length consumed).
errors defines the error handling to apply. It defaults to
'strict' handling which is the only currently supported
error handling for this codec.
"""
assert errors == 'strict'
... | [
"def",
"quopri_decode",
"(",
"input",
",",
"errors",
"=",
"'strict'",
")",
":",
"assert",
"errors",
"==",
"'strict'",
"f",
"=",
"StringIO",
"(",
"str",
"(",
"input",
")",
")",
"g",
"=",
"StringIO",
"(",
")",
"quopri",
".",
"decode",
"(",
"f",
",",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/encodings/quopri_codec.py#L28-L41 | |
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py | python | spawn.__str__ | (self) | return '\n'.join(s) | This returns a human-readable string that represents the state of
the object. | This returns a human-readable string that represents the state of
the object. | [
"This",
"returns",
"a",
"human",
"-",
"readable",
"string",
"that",
"represents",
"the",
"state",
"of",
"the",
"object",
"."
] | def __str__(self):
'''This returns a human-readable string that represents the state of
the object. '''
s = []
s.append(repr(self))
s.append('command: ' + str(self.command))
s.append('args: %r' % (self.args,))
s.append('buffer (last 100 chars): %r' % self.buffer[... | [
"def",
"__str__",
"(",
"self",
")",
":",
"s",
"=",
"[",
"]",
"s",
".",
"append",
"(",
"repr",
"(",
"self",
")",
")",
"s",
".",
"append",
"(",
"'command: '",
"+",
"str",
"(",
"self",
".",
"command",
")",
")",
"s",
".",
"append",
"(",
"'args: %r'... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/third_party/Python/module/pexpect-4.6/pexpect/pty_spawn.py#L207-L237 | |
fmtlib/fmt | ecd6022c24e4fed94e1ea09029c386f36da4a2b8 | support/rst2md.py | python | convert | (rst_path) | return core.publish_file(source_path=rst_path, writer=MDWriter()) | Converts RST file to Markdown. | Converts RST file to Markdown. | [
"Converts",
"RST",
"file",
"to",
"Markdown",
"."
] | def convert(rst_path):
"""Converts RST file to Markdown."""
return core.publish_file(source_path=rst_path, writer=MDWriter()) | [
"def",
"convert",
"(",
"rst_path",
")",
":",
"return",
"core",
".",
"publish_file",
"(",
"source_path",
"=",
"rst_path",
",",
"writer",
"=",
"MDWriter",
"(",
")",
")"
] | https://github.com/fmtlib/fmt/blob/ecd6022c24e4fed94e1ea09029c386f36da4a2b8/support/rst2md.py#L153-L155 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/explore.py | python | ExploreUtils.check_args | (name, arg_str) | Utility to check if adequate number of arguments are passed to an
explore command.
Arguments:
name: The name of the explore command.
arg_str: The argument string passed to the explore command.
Returns:
True if adequate arguments are passed, false otherwise.
... | Utility to check if adequate number of arguments are passed to an
explore command. | [
"Utility",
"to",
"check",
"if",
"adequate",
"number",
"of",
"arguments",
"are",
"passed",
"to",
"an",
"explore",
"command",
"."
] | def check_args(name, arg_str):
"""Utility to check if adequate number of arguments are passed to an
explore command.
Arguments:
name: The name of the explore command.
arg_str: The argument string passed to the explore command.
Returns:
True if adequa... | [
"def",
"check_args",
"(",
"name",
",",
"arg_str",
")",
":",
"if",
"len",
"(",
"arg_str",
")",
"<",
"1",
":",
"raise",
"gdb",
".",
"GdbError",
"(",
"\"ERROR: '%s' requires an argument.\"",
"%",
"name",
")",
"return",
"False",
"else",
":",
"return",
"True"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/share/gdb/python/gdb/command/explore.py#L587-L606 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview.py | python | MplGraphicsView.move_indicator | (self, line_id, dx, dy) | return | Move the indicator line in horizontal
:param line_id:
:param dx:
:return: | Move the indicator line in horizontal
:param line_id:
:param dx:
:return: | [
"Move",
"the",
"indicator",
"line",
"in",
"horizontal",
":",
"param",
"line_id",
":",
":",
"param",
"dx",
":",
":",
"return",
":"
] | def move_indicator(self, line_id, dx, dy):
"""
Move the indicator line in horizontal
:param line_id:
:param dx:
:return:
"""
# Shift value
self._myIndicatorsManager.shift(line_id, dx=dx, dy=dy)
# apply to plot on canvas
if self._myIndicato... | [
"def",
"move_indicator",
"(",
"self",
",",
"line_id",
",",
"dx",
",",
"dy",
")",
":",
"# Shift value",
"self",
".",
"_myIndicatorsManager",
".",
"shift",
"(",
"line_id",
",",
"dx",
"=",
"dx",
",",
"dy",
"=",
"dy",
")",
"# apply to plot on canvas",
"if",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/mplgraphicsview.py#L764-L788 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | samples/networking/03-distributed-node/AIDGameObject.py | python | AIDGameObject.d_requestDataFromAI | (self) | Request some data from the AI and passing it some data from us. | Request some data from the AI and passing it some data from us. | [
"Request",
"some",
"data",
"from",
"the",
"AI",
"and",
"passing",
"it",
"some",
"data",
"from",
"us",
"."
] | def d_requestDataFromAI(self):
""" Request some data from the AI and passing it some data from us. """
data = ("Some Data", 1, -1.25)
print("Sending game data:", data)
self.sendUpdate('messageRoundtripToAI', [data]) | [
"def",
"d_requestDataFromAI",
"(",
"self",
")",
":",
"data",
"=",
"(",
"\"Some Data\"",
",",
"1",
",",
"-",
"1.25",
")",
"print",
"(",
"\"Sending game data:\"",
",",
"data",
")",
"self",
".",
"sendUpdate",
"(",
"'messageRoundtripToAI'",
",",
"[",
"data",
"... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/networking/03-distributed-node/AIDGameObject.py#L19-L23 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/threading.py | python | _Condition.notifyAll | (self) | Wake up all threads waiting on this condition.
If the calling thread has not acquired the lock when this method
is called, a RuntimeError is raised. | Wake up all threads waiting on this condition. | [
"Wake",
"up",
"all",
"threads",
"waiting",
"on",
"this",
"condition",
"."
] | def notifyAll(self):
"""Wake up all threads waiting on this condition.
If the calling thread has not acquired the lock when this method
is called, a RuntimeError is raised.
"""
self.notify(len(self.__waiters)) | [
"def",
"notifyAll",
"(",
"self",
")",
":",
"self",
".",
"notify",
"(",
"len",
"(",
"self",
".",
"__waiters",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/threading.py#L399-L406 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/cpp.py | python | PreProcessor.restore | (self) | Pops the previous dispatch table off the stack and makes it the
current one. | Pops the previous dispatch table off the stack and makes it the
current one. | [
"Pops",
"the",
"previous",
"dispatch",
"table",
"off",
"the",
"stack",
"and",
"makes",
"it",
"the",
"current",
"one",
"."
] | def restore(self):
"""
Pops the previous dispatch table off the stack and makes it the
current one.
"""
try: self.dispatch_table = self.stack.pop()
except IndexError: pass | [
"def",
"restore",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"dispatch_table",
"=",
"self",
".",
"stack",
".",
"pop",
"(",
")",
"except",
"IndexError",
":",
"pass"
] | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/cpp.py#L365-L371 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py | python | Notebook.enable_traversal | (self) | Enable keyboard traversal for a toplevel window containing
this notebook.
This will extend the bindings for the toplevel window containing
this notebook as follows:
Control-Tab: selects the tab following the currently selected
one
Shift-Control... | Enable keyboard traversal for a toplevel window containing
this notebook. | [
"Enable",
"keyboard",
"traversal",
"for",
"a",
"toplevel",
"window",
"containing",
"this",
"notebook",
"."
] | def enable_traversal(self):
"""Enable keyboard traversal for a toplevel window containing
this notebook.
This will extend the bindings for the toplevel window containing
this notebook as follows:
Control-Tab: selects the tab following the currently selected
... | [
"def",
"enable_traversal",
"(",
"self",
")",
":",
"# The only, and good, difference I see is about mnemonics, which works",
"# after calling this method. Control-Tab and Shift-Control-Tab always",
"# works (here at least).",
"self",
".",
"tk",
".",
"call",
"(",
"\"ttk::notebook::enable... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/lib-tk/ttk.py#L904-L927 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.ParaDownExtend | (*args, **kwargs) | return _stc.StyledTextCtrl_ParaDownExtend(*args, **kwargs) | ParaDownExtend(self) | ParaDownExtend(self) | [
"ParaDownExtend",
"(",
"self",
")"
] | def ParaDownExtend(*args, **kwargs):
"""ParaDownExtend(self)"""
return _stc.StyledTextCtrl_ParaDownExtend(*args, **kwargs) | [
"def",
"ParaDownExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_ParaDownExtend",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L5288-L5290 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/extras/review.py | python | ReviewContext.compare_review_set | (self, set1, set2) | return True | Return true if the review sets specified are equal. | Return true if the review sets specified are equal. | [
"Return",
"true",
"if",
"the",
"review",
"sets",
"specified",
"are",
"equal",
"."
] | def compare_review_set(self, set1, set2):
"""
Return true if the review sets specified are equal.
"""
if len(set1.keys()) != len(set2.keys()):
return False
for key in set1.keys():
if not key in set2 or set1[key] != set2[key]:
return False
return True | [
"def",
"compare_review_set",
"(",
"self",
",",
"set1",
",",
"set2",
")",
":",
"if",
"len",
"(",
"set1",
".",
"keys",
"(",
")",
")",
"!=",
"len",
"(",
"set2",
".",
"keys",
"(",
")",
")",
":",
"return",
"False",
"for",
"key",
"in",
"set1",
".",
"... | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/extras/review.py#L241-L250 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/tools/grit/grit/node/structure.py | python | StructureNode.GetLineEnd | (self) | Returns the end-of-line character or characters for files output because
of this node ('\r\n', '\n', or '\r' depending on the 'line_end' attribute). | Returns the end-of-line character or characters for files output because
of this node ('\r\n', '\n', or '\r' depending on the 'line_end' attribute). | [
"Returns",
"the",
"end",
"-",
"of",
"-",
"line",
"character",
"or",
"characters",
"for",
"files",
"output",
"because",
"of",
"this",
"node",
"(",
"\\",
"r",
"\\",
"n",
"\\",
"n",
"or",
"\\",
"r",
"depending",
"on",
"the",
"line_end",
"attribute",
")",
... | def GetLineEnd(self):
'''Returns the end-of-line character or characters for files output because
of this node ('\r\n', '\n', or '\r' depending on the 'line_end' attribute).
'''
if self.attrs['line_end'] == 'unix':
return '\n'
elif self.attrs['line_end'] == 'windows':
return '\r\n'
e... | [
"def",
"GetLineEnd",
"(",
"self",
")",
":",
"if",
"self",
".",
"attrs",
"[",
"'line_end'",
"]",
"==",
"'unix'",
":",
"return",
"'\\n'",
"elif",
"self",
".",
"attrs",
"[",
"'line_end'",
"]",
"==",
"'windows'",
":",
"return",
"'\\r\\n'",
"elif",
"self",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/node/structure.py#L175-L188 | ||
ufal/udpipe | e51f02d2744cdfd4a29efc1320644ea04d535f0b | doc/t2t_docsys/txt2tags.py | python | ConfigMaster._get_off | (self) | return off | Turns OFF all the config/options/flags | Turns OFF all the config/options/flags | [
"Turns",
"OFF",
"all",
"the",
"config",
"/",
"options",
"/",
"flags"
] | def _get_off(self):
"Turns OFF all the config/options/flags"
off = {}
for key in self.defaults.keys():
kind = type(self.defaults[key])
if kind == type(9):
off[key] = 0
elif issubclass(kind, string_type):
off[key] = ''
elif kind == type([]):
off[key] = []
else:
Error('ConfigMaster: %... | [
"def",
"_get_off",
"(",
"self",
")",
":",
"off",
"=",
"{",
"}",
"for",
"key",
"in",
"self",
".",
"defaults",
".",
"keys",
"(",
")",
":",
"kind",
"=",
"type",
"(",
"self",
".",
"defaults",
"[",
"key",
"]",
")",
"if",
"kind",
"==",
"type",
"(",
... | https://github.com/ufal/udpipe/blob/e51f02d2744cdfd4a29efc1320644ea04d535f0b/doc/t2t_docsys/txt2tags.py#L2724-L2737 | |
NREL/EnergyPlus | fadc5973b85c70e8cc923efb69c144e808a26078 | src/EnergyPlus/api/datatransfer.py | python | DataExchange.tomorrow_weather_is_raining_at_time | (self, state: c_void_p, hour: int, time_step_number: int) | return self.api.tomorrowWeatherIsRainAtTime(state, hour, time_step_number) == 1 | Gets the specified weather data at the specified hour and time step index within that hour
:param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`.
:param hour: Integer hour of day (0 to 23)
:param time_step_number: Time step index in hour, fro... | Gets the specified weather data at the specified hour and time step index within that hour | [
"Gets",
"the",
"specified",
"weather",
"data",
"at",
"the",
"specified",
"hour",
"and",
"time",
"step",
"index",
"within",
"that",
"hour"
] | def tomorrow_weather_is_raining_at_time(self, state: c_void_p, hour: int, time_step_number: int) -> bool:
"""
Gets the specified weather data at the specified hour and time step index within that hour
:param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.... | [
"def",
"tomorrow_weather_is_raining_at_time",
"(",
"self",
",",
"state",
":",
"c_void_p",
",",
"hour",
":",
"int",
",",
"time_step_number",
":",
"int",
")",
"->",
"bool",
":",
"return",
"self",
".",
"api",
".",
"tomorrowWeatherIsRainAtTime",
"(",
"state",
",",... | https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/src/EnergyPlus/api/datatransfer.py#L1275-L1284 | |
smilehao/xlua-framework | a03801538be2b0e92d39332d445b22caca1ef61f | ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/containers.py | python | RepeatedCompositeFieldContainer.__delslice__ | (self, start, stop) | Deletes the subset of items from between the specified indices. | Deletes the subset of items from between the specified indices. | [
"Deletes",
"the",
"subset",
"of",
"items",
"from",
"between",
"the",
"specified",
"indices",
"."
] | def __delslice__(self, start, stop):
"""Deletes the subset of items from between the specified indices."""
del self._values[start:stop]
self._message_listener.Modified() | [
"def",
"__delslice__",
"(",
"self",
",",
"start",
",",
"stop",
")",
":",
"del",
"self",
".",
"_values",
"[",
"start",
":",
"stop",
"]",
"self",
".",
"_message_listener",
".",
"Modified",
"(",
")"
] | https://github.com/smilehao/xlua-framework/blob/a03801538be2b0e92d39332d445b22caca1ef61f/ConfigData/trunk/tools/protobuf-2.5.0/protobuf-2.5.0/python/build/lib/google/protobuf/internal/containers.py#L257-L260 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/distribute/optimizer_combinations.py | python | distributions_and_v1_and_v2_optimizers | () | return combinations.combine(
distribution=[
strategy_combinations_base.one_device_strategy,
strategy_combinations_base.mirrored_strategy_with_gpu_and_cpu,
strategy_combinations_base.mirrored_strategy_with_two_gpus,
strategy_combinations_base
.mirrored_strategy_wit... | A common set of combination with DistributionStrategies and Optimizers. | A common set of combination with DistributionStrategies and Optimizers. | [
"A",
"common",
"set",
"of",
"combination",
"with",
"DistributionStrategies",
"and",
"Optimizers",
"."
] | def distributions_and_v1_and_v2_optimizers():
"""A common set of combination with DistributionStrategies and Optimizers."""
return combinations.combine(
distribution=[
strategy_combinations_base.one_device_strategy,
strategy_combinations_base.mirrored_strategy_with_gpu_and_cpu,
s... | [
"def",
"distributions_and_v1_and_v2_optimizers",
"(",
")",
":",
"return",
"combinations",
".",
"combine",
"(",
"distribution",
"=",
"[",
"strategy_combinations_base",
".",
"one_device_strategy",
",",
"strategy_combinations_base",
".",
"mirrored_strategy_with_gpu_and_cpu",
","... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/distribute/optimizer_combinations.py#L103-L113 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column_ops.py | python | _Transformer.__init__ | (self, columns_to_tensors) | Initializes transfomer.
Args:
columns_to_tensors: A mapping from feature columns to tensors. 'string'
key means a base feature (not-transformed). It can have FeatureColumn as
a key too. That means that FeatureColumn is already transformed by input
pipeline. For example, `inflow` may h... | Initializes transfomer. | [
"Initializes",
"transfomer",
"."
] | def __init__(self, columns_to_tensors):
"""Initializes transfomer.
Args:
columns_to_tensors: A mapping from feature columns to tensors. 'string'
key means a base feature (not-transformed). It can have FeatureColumn as
a key too. That means that FeatureColumn is already transformed by inpu... | [
"def",
"__init__",
"(",
"self",
",",
"columns_to_tensors",
")",
":",
"self",
".",
"_columns_to_tensors",
"=",
"columns_to_tensors"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/layers/python/layers/feature_column_ops.py#L354-L364 | ||
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/icu/tools/unicode/py/preparseucd.py | python | ParseOneProperty | (in_file, pname) | Parses a .txt file where the first column is a code point range
and the second column is the value of a known property. | Parses a .txt file where the first column is a code point range
and the second column is the value of a known property. | [
"Parses",
"a",
".",
"txt",
"file",
"where",
"the",
"first",
"column",
"is",
"a",
"code",
"point",
"range",
"and",
"the",
"second",
"column",
"is",
"the",
"value",
"of",
"a",
"known",
"property",
"."
] | def ParseOneProperty(in_file, pname):
"""Parses a .txt file where the first column is a code point range
and the second column is the value of a known property."""
prop = GetProperty(pname)
for data in ReadUCDLines(in_file, want_missing=True):
if data[0] == "missing":
SetDefaultValue(pname, data[2][0]... | [
"def",
"ParseOneProperty",
"(",
"in_file",
",",
"pname",
")",
":",
"prop",
"=",
"GetProperty",
"(",
"pname",
")",
"for",
"data",
"in",
"ReadUCDLines",
"(",
"in_file",
",",
"want_missing",
"=",
"True",
")",
":",
"if",
"data",
"[",
"0",
"]",
"==",
"\"mis... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/icu/tools/unicode/py/preparseucd.py#L805-L814 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/layers/merge.py | python | dot | (inputs, axes, normalize=False, **kwargs) | return Dot(axes=axes, normalize=normalize, **kwargs)(inputs) | Functional interface to the `Dot` layer.
Arguments:
inputs: A list of input tensors (at least 2).
axes: Integer or tuple of integers,
axis or axes along which to take the dot product.
normalize: Whether to L2-normalize samples along the
dot product axis before taking the dot pro... | Functional interface to the `Dot` layer. | [
"Functional",
"interface",
"to",
"the",
"Dot",
"layer",
"."
] | def dot(inputs, axes, normalize=False, **kwargs):
"""Functional interface to the `Dot` layer.
Arguments:
inputs: A list of input tensors (at least 2).
axes: Integer or tuple of integers,
axis or axes along which to take the dot product.
normalize: Whether to L2-normalize samples along t... | [
"def",
"dot",
"(",
"inputs",
",",
"axes",
",",
"normalize",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"Dot",
"(",
"axes",
"=",
"axes",
",",
"normalize",
"=",
"normalize",
",",
"*",
"*",
"kwargs",
")",
"(",
"inputs",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/layers/merge.py#L709-L725 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/poplib.py | python | POP3.stat | (self) | return (numMessages, sizeMessages) | Get mailbox status.
Result is tuple of 2 ints (message count, mailbox size) | Get mailbox status. | [
"Get",
"mailbox",
"status",
"."
] | def stat(self):
"""Get mailbox status.
Result is tuple of 2 ints (message count, mailbox size)
"""
retval = self._shortcmd('STAT')
rets = retval.split()
if self._debugging: print '*stat*', repr(rets)
numMessages = int(rets[1])
sizeMessages = int(rets[2])
... | [
"def",
"stat",
"(",
"self",
")",
":",
"retval",
"=",
"self",
".",
"_shortcmd",
"(",
"'STAT'",
")",
"rets",
"=",
"retval",
".",
"split",
"(",
")",
"if",
"self",
".",
"_debugging",
":",
"print",
"'*stat*'",
",",
"repr",
"(",
"rets",
")",
"numMessages",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/poplib.py#L192-L202 | |
TGAC/KAT | e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216 | deps/boost/tools/build/src/build/targets.py | python | TargetRegistry.main_target_usage_requirements | (self, specification, project) | return project_usage_requirements.add (usage_requirements) | Returns the use requirement to use when declaraing a main target,
which are obtained by
- translating all specified property paths, and
- adding project's usage requirements
specification: Use-properties explicitly specified for a main target
project: ... | Returns the use requirement to use when declaraing a main target,
which are obtained by
- translating all specified property paths, and
- adding project's usage requirements
specification: Use-properties explicitly specified for a main target
project: ... | [
"Returns",
"the",
"use",
"requirement",
"to",
"use",
"when",
"declaraing",
"a",
"main",
"target",
"which",
"are",
"obtained",
"by",
"-",
"translating",
"all",
"specified",
"property",
"paths",
"and",
"-",
"adding",
"project",
"s",
"usage",
"requirements",
"spe... | def main_target_usage_requirements (self, specification, project):
""" Returns the use requirement to use when declaraing a main target,
which are obtained by
- translating all specified property paths, and
- adding project's usage requirements
specification: Use... | [
"def",
"main_target_usage_requirements",
"(",
"self",
",",
"specification",
",",
"project",
")",
":",
"assert",
"is_iterable_typed",
"(",
"specification",
",",
"basestring",
")",
"assert",
"isinstance",
"(",
"project",
",",
"ProjectTarget",
")",
"project_usage_require... | https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/boost/tools/build/src/build/targets.py#L169-L188 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/lib/backgroundjobs.py | python | BackgroundJobManager._status_new | (self) | return new_comp or new_dead | Print the status of newly finished jobs.
Return True if any new jobs are reported.
This call resets its own state every time, so it only reports jobs
which have finished since the last time it was called. | Print the status of newly finished jobs. | [
"Print",
"the",
"status",
"of",
"newly",
"finished",
"jobs",
"."
] | def _status_new(self):
"""Print the status of newly finished jobs.
Return True if any new jobs are reported.
This call resets its own state every time, so it only reports jobs
which have finished since the last time it was called."""
self._update_status()
new_comp = se... | [
"def",
"_status_new",
"(",
"self",
")",
":",
"self",
".",
"_update_status",
"(",
")",
"new_comp",
"=",
"self",
".",
"_group_report",
"(",
"self",
".",
"_comp_report",
",",
"'Completed'",
")",
"new_dead",
"=",
"self",
".",
"_group_report",
"(",
"self",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/lib/backgroundjobs.py#L268-L282 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/transaction.py | python | Transaction.__repr__ | (self) | return self.to_str() | For `print` and `pprint` | For `print` and `pprint` | [
"For",
"print",
"and",
"pprint"
] | def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str() | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"self",
".",
"to_str",
"(",
")"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/transaction.py#L389-L391 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py | python | TensorFlowDataFrame._from_csv_base | (cls, filepatterns, get_default_values, has_header,
column_names, num_threads, enqueue_size,
batch_size, queue_capacity, min_after_dequeue, shuffle,
seed) | return dataframe | Create a `DataFrame` from CSV files.
If `has_header` is false, then `column_names` must be specified. If
`has_header` is true and `column_names` are specified, then `column_names`
overrides the names in the header.
Args:
filepatterns: a list of file patterns that resolve to CSV files.
get_... | Create a `DataFrame` from CSV files. | [
"Create",
"a",
"DataFrame",
"from",
"CSV",
"files",
"."
] | def _from_csv_base(cls, filepatterns, get_default_values, has_header,
column_names, num_threads, enqueue_size,
batch_size, queue_capacity, min_after_dequeue, shuffle,
seed):
"""Create a `DataFrame` from CSV files.
If `has_header` is false, then `co... | [
"def",
"_from_csv_base",
"(",
"cls",
",",
"filepatterns",
",",
"get_default_values",
",",
"has_header",
",",
"column_names",
",",
"num_threads",
",",
"enqueue_size",
",",
"batch_size",
",",
"queue_capacity",
",",
"min_after_dequeue",
",",
"shuffle",
",",
"seed",
"... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/tensorflow_dataframe.py#L259-L327 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftobjects/pointarray.py | python | get_point_list | (point_object) | return pt_list, count | Extract a list of points from a point object.
Parameters
----------
point_object: Part::Feature
Either a `Draft Block`, a `Part::Compound`,
or a `Sketcher::SketchObject` containing points.
Returns
-------
list, int
A list of points that have `X`, `Y`, `Z` coordinates;
... | Extract a list of points from a point object. | [
"Extract",
"a",
"list",
"of",
"points",
"from",
"a",
"point",
"object",
"."
] | def get_point_list(point_object):
"""Extract a list of points from a point object.
Parameters
----------
point_object: Part::Feature
Either a `Draft Block`, a `Part::Compound`,
or a `Sketcher::SketchObject` containing points.
Returns
-------
list, int
A list of poin... | [
"def",
"get_point_list",
"(",
"point_object",
")",
":",
"# If its a clone, extract the real object",
"while",
"utils",
".",
"get_type",
"(",
"point_object",
")",
"==",
"'Clone'",
":",
"point_object",
"=",
"point_object",
".",
"Objects",
"[",
"0",
"]",
"# If the poin... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftobjects/pointarray.py#L164-L232 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/transports.py | python | WriteTransport.writelines | (self, list_of_data) | Write a list (or any iterable) of data bytes to the transport.
The default implementation concatenates the arguments and
calls write() on the result. | Write a list (or any iterable) of data bytes to the transport. | [
"Write",
"a",
"list",
"(",
"or",
"any",
"iterable",
")",
"of",
"data",
"bytes",
"to",
"the",
"transport",
"."
] | def writelines(self, list_of_data):
"""Write a list (or any iterable) of data bytes to the transport.
The default implementation concatenates the arguments and
calls write() on the result.
"""
data = b''.join(list_of_data)
self.write(data) | [
"def",
"writelines",
"(",
"self",
",",
"list_of_data",
")",
":",
"data",
"=",
"b''",
".",
"join",
"(",
"list_of_data",
")",
"self",
".",
"write",
"(",
"data",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/transports.py#L104-L111 | ||
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/distributions/python/ops/vector_laplace_linear_operator.py | python | VectorLaplaceLinearOperator.__init__ | (self,
loc=None,
scale=None,
validate_args=False,
allow_nan_stats=True,
name="VectorLaplaceLinearOperator") | Construct Vector Laplace distribution on `R^k`.
The `batch_shape` is the broadcast shape between `loc` and `scale`
arguments.
The `event_shape` is given by last dimension of the matrix implied by
`scale`. The last dimension of `loc` (if provided) must broadcast with this.
Recall that `covariance ... | Construct Vector Laplace distribution on `R^k`. | [
"Construct",
"Vector",
"Laplace",
"distribution",
"on",
"R^k",
"."
] | def __init__(self,
loc=None,
scale=None,
validate_args=False,
allow_nan_stats=True,
name="VectorLaplaceLinearOperator"):
"""Construct Vector Laplace distribution on `R^k`.
The `batch_shape` is the broadcast shape between `loc` and `scal... | [
"def",
"__init__",
"(",
"self",
",",
"loc",
"=",
"None",
",",
"scale",
"=",
"None",
",",
"validate_args",
"=",
"False",
",",
"allow_nan_stats",
"=",
"True",
",",
"name",
"=",
"\"VectorLaplaceLinearOperator\"",
")",
":",
"parameters",
"=",
"locals",
"(",
")... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/distributions/python/ops/vector_laplace_linear_operator.py#L158-L218 | ||
ceph/ceph | 959663007321a369c83218414a29bd9dbc8bda3a | src/pybind/mgr/restful/api/pool.py | python | Pool.get | (self, **kwargs) | return pools | Show the information for all the pools | Show the information for all the pools | [
"Show",
"the",
"information",
"for",
"all",
"the",
"pools"
] | def get(self, **kwargs):
"""
Show the information for all the pools
"""
pools = context.instance.get('osd_map')['pools']
# pgp_num is called pg_placement_num, deal with that
for pool in pools:
if 'pg_placement_num' in pool:
pool['pgp_num'] = p... | [
"def",
"get",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"pools",
"=",
"context",
".",
"instance",
".",
"get",
"(",
"'osd_map'",
")",
"[",
"'pools'",
"]",
"# pgp_num is called pg_placement_num, deal with that",
"for",
"pool",
"in",
"pools",
":",
"if",
... | https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/restful/api/pool.py#L83-L94 | |
opengauss-mirror/openGauss-server | e383f1b77720a00ddbe4c0655bc85914d9b02a2b | src/gausskernel/dbmind/tools/ai_manager/module/anomaly_detection/install_remote.py | python | RemoteInstaller._mk_remote_module_dir | (self) | Create install path if the path is not exist. | Create install path if the path is not exist. | [
"Create",
"install",
"path",
"if",
"the",
"path",
"is",
"not",
"exist",
"."
] | def _mk_remote_module_dir(self):
"""
Create install path if the path is not exist.
"""
for node in self.agent_nodes:
ip = node.get(Constant.NODE_IP)
uname = node.get(Constant.NODE_USER)
pwd = node.get(Constant.NODE_PWD)
CommonTools.remote_m... | [
"def",
"_mk_remote_module_dir",
"(",
"self",
")",
":",
"for",
"node",
"in",
"self",
".",
"agent_nodes",
":",
"ip",
"=",
"node",
".",
"get",
"(",
"Constant",
".",
"NODE_IP",
")",
"uname",
"=",
"node",
".",
"get",
"(",
"Constant",
".",
"NODE_USER",
")",
... | https://github.com/opengauss-mirror/openGauss-server/blob/e383f1b77720a00ddbe4c0655bc85914d9b02a2b/src/gausskernel/dbmind/tools/ai_manager/module/anomaly_detection/install_remote.py#L163-L173 | ||
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/executor.py | python | Executor.arg_dict | (self) | return self._arg_dict | Get dictionary representation of argument arrrays.
Returns
-------
arg_dict : dict of str to NDArray
The dictionary that maps the names of arguments to NDArrays.
Raises
------
ValueError : if there are duplicated names in the arguments. | Get dictionary representation of argument arrrays. | [
"Get",
"dictionary",
"representation",
"of",
"argument",
"arrrays",
"."
] | def arg_dict(self):
"""Get dictionary representation of argument arrrays.
Returns
-------
arg_dict : dict of str to NDArray
The dictionary that maps the names of arguments to NDArrays.
Raises
------
ValueError : if there are duplicated names in the a... | [
"def",
"arg_dict",
"(",
"self",
")",
":",
"if",
"self",
".",
"_arg_dict",
"is",
"None",
":",
"self",
".",
"_arg_dict",
"=",
"Executor",
".",
"_get_dict",
"(",
"self",
".",
"_symbol",
".",
"list_arguments",
"(",
")",
",",
"self",
".",
"arg_arrays",
")",... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/executor.py#L263-L278 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/fx/experimental/fx_acc/acc_ops.py | python | softmax | (*, input, dim, dtype) | return torch.nn.functional.softmax(input=input, dim=dim, dtype=dtype) | _stacklevel are ignored here. | _stacklevel are ignored here. | [
"_stacklevel",
"are",
"ignored",
"here",
"."
] | def softmax(*, input, dim, dtype):
"""
_stacklevel are ignored here.
"""
return torch.nn.functional.softmax(input=input, dim=dim, dtype=dtype) | [
"def",
"softmax",
"(",
"*",
",",
"input",
",",
"dim",
",",
"dtype",
")",
":",
"return",
"torch",
".",
"nn",
".",
"functional",
".",
"softmax",
"(",
"input",
"=",
"input",
",",
"dim",
"=",
"dim",
",",
"dtype",
"=",
"dtype",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/experimental/fx_acc/acc_ops.py#L323-L327 | |
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | _AddFilters | (filters) | Adds more filter overrides.
Unlike _SetFilters, this function does not reset the current list of filters
available.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Adds more filter overrides. | [
"Adds",
"more",
"filter",
"overrides",
"."
] | def _AddFilters(filters):
"""Adds more filter overrides.
Unlike _SetFilters, this function does not reset the current list of filters
available.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint_sta... | [
"def",
"_AddFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"AddFilters",
"(",
"filters",
")"
] | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1013-L1023 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/models.py | python | Response.close | (self) | Releases the connection back to the pool. Once this method has been
called the underlying ``raw`` object must not be accessed again.
*Note: Should not normally need to be called explicitly.* | Releases the connection back to the pool. Once this method has been
called the underlying ``raw`` object must not be accessed again. | [
"Releases",
"the",
"connection",
"back",
"to",
"the",
"pool",
".",
"Once",
"this",
"method",
"has",
"been",
"called",
"the",
"underlying",
"raw",
"object",
"must",
"not",
"be",
"accessed",
"again",
"."
] | def close(self):
"""Releases the connection back to the pool. Once this method has been
called the underlying ``raw`` object must not be accessed again.
*Note: Should not normally need to be called explicitly.*
"""
if not self._content_consumed:
self.raw.close()
... | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_content_consumed",
":",
"self",
".",
"raw",
".",
"close",
"(",
")",
"release_conn",
"=",
"getattr",
"(",
"self",
".",
"raw",
",",
"'release_conn'",
",",
"None",
")",
"if",
"release_conn... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/models.py#L943-L954 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Tools/wiki2qhelp.py | python | output | (html,page) | encapsulates raw html code into nice html body | encapsulates raw html code into nice html body | [
"encapsulates",
"raw",
"html",
"code",
"into",
"nice",
"html",
"body"
] | def output(html,page):
"encapsulates raw html code into nice html body"
header = "<html><head>"
header += "<title>"
header += page
header += "</title>"
header += "<link type='text/css' href='wiki.css' rel='stylesheet'>"
header += "</head><body>"
footer = "</body></html>"
html = heade... | [
"def",
"output",
"(",
"html",
",",
"page",
")",
":",
"header",
"=",
"\"<html><head>\"",
"header",
"+=",
"\"<title>\"",
"header",
"+=",
"page",
"header",
"+=",
"\"</title>\"",
"header",
"+=",
"\"<link type='text/css' href='wiki.css' rel='stylesheet'>\"",
"header",
"+="... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Tools/wiki2qhelp.py#L561-L574 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/_config/config.py | python | is_nonnegative_int | (value: int | None) | Verify that value is None or a positive int.
Parameters
----------
value : None or int
The `value` to be checked.
Raises
------
ValueError
When the value is not None or is a negative integer | Verify that value is None or a positive int. | [
"Verify",
"that",
"value",
"is",
"None",
"or",
"a",
"positive",
"int",
"."
] | def is_nonnegative_int(value: int | None) -> None:
"""
Verify that value is None or a positive int.
Parameters
----------
value : None or int
The `value` to be checked.
Raises
------
ValueError
When the value is not None or is a negative integer
"""
if value... | [
"def",
"is_nonnegative_int",
"(",
"value",
":",
"int",
"|",
"None",
")",
"->",
"None",
":",
"if",
"value",
"is",
"None",
":",
"return",
"elif",
"isinstance",
"(",
"value",
",",
"int",
")",
":",
"if",
"value",
">=",
"0",
":",
"return",
"msg",
"=",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/_config/config.py#L826-L848 | ||
LLNL/Caliper | 60e06980fc65057e1da01296e6eebbbed30f59c8 | python/caliper-reader/caliperreader/metadatadb.py | python | Node.append | (self, child) | Append a child node to this node. | Append a child node to this node. | [
"Append",
"a",
"child",
"node",
"to",
"this",
"node",
"."
] | def append(self, child):
""" Append a child node to this node.
"""
child.parent = self
self.children.append(child) | [
"def",
"append",
"(",
"self",
",",
"child",
")",
":",
"child",
".",
"parent",
"=",
"self",
"self",
".",
"children",
".",
"append",
"(",
"child",
")"
] | https://github.com/LLNL/Caliper/blob/60e06980fc65057e1da01296e6eebbbed30f59c8/python/caliper-reader/caliperreader/metadatadb.py#L22-L27 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/tpu/tensor_tracer.py | python | set_parameters | (tensor_tracer_params=None) | Enables tensor tracer and sets its parameters.
Example usage:
tensor_tracer_parameters = {'trace_dir': '/usr/tmp/trace_dir',
'trace_mode': 'norm',
'report_file': '/usr/tmp/trace_dir/report.all'}
tensor_tracer.set_parameters(tensor_tracer_paramet... | Enables tensor tracer and sets its parameters. | [
"Enables",
"tensor",
"tracer",
"and",
"sets",
"its",
"parameters",
"."
] | def set_parameters(tensor_tracer_params=None):
"""Enables tensor tracer and sets its parameters.
Example usage:
tensor_tracer_parameters = {'trace_dir': '/usr/tmp/trace_dir',
'trace_mode': 'norm',
'report_file': '/usr/tmp/trace_dir/report.all'}
... | [
"def",
"set_parameters",
"(",
"tensor_tracer_params",
"=",
"None",
")",
":",
"flags",
"=",
"'--%s=1'",
"%",
"tensor_tracer_flags",
".",
"FLAG_NAME_ENABLE",
"if",
"tensor_tracer_params",
":",
"for",
"key",
",",
"value",
"in",
"tensor_tracer_params",
".",
"items",
"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/tpu/tensor_tracer.py#L123-L215 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/browser.py | python | ModuleBrowserTreeItem.IsExpandable | (self) | return os.path.normcase(self.file[-3:]) == ".py" | Return True if Python (.py) file. | Return True if Python (.py) file. | [
"Return",
"True",
"if",
"Python",
"(",
".",
"py",
")",
"file",
"."
] | def IsExpandable(self):
"Return True if Python (.py) file."
return os.path.normcase(self.file[-3:]) == ".py" | [
"def",
"IsExpandable",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"normcase",
"(",
"self",
".",
"file",
"[",
"-",
"3",
":",
"]",
")",
"==",
"\".py\""
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/browser.py#L170-L172 | |
pgRouting/osm2pgrouting | 8491929fc4037d308f271e84d59bb96da3c28aa2 | tools/cpplint.py | python | CheckForHeaderGuard | (filename, clean_lines, error) | Checks that the file contains a header guard.
Logs an error if no #ifndef header guard is present. For other
headers, checks that the full pathname is used.
Args:
filename: The name of the C++ header file.
clean_lines: A CleansedLines instance containing the file.
error: The function to call with a... | Checks that the file contains a header guard. | [
"Checks",
"that",
"the",
"file",
"contains",
"a",
"header",
"guard",
"."
] | def CheckForHeaderGuard(filename, clean_lines, error):
"""Checks that the file contains a header guard.
Logs an error if no #ifndef header guard is present. For other
headers, checks that the full pathname is used.
Args:
filename: The name of the C++ header file.
clean_lines: A CleansedLines instance... | [
"def",
"CheckForHeaderGuard",
"(",
"filename",
",",
"clean_lines",
",",
"error",
")",
":",
"# Don't check for header guards if there are error suppression",
"# comments somewhere in this file.",
"#",
"# Because this is silencing a warning for a nonexistent line, we",
"# only support the ... | https://github.com/pgRouting/osm2pgrouting/blob/8491929fc4037d308f271e84d59bb96da3c28aa2/tools/cpplint.py#L1675-L1770 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/methodDefs_hierarchyOptimiser/updateHierarchySpace.py | python | checkIndexSpaceNotTooBig | () | Check if index space is of correct size | Check if index space is of correct size | [
"Check",
"if",
"index",
"space",
"is",
"of",
"correct",
"size"
] | def checkIndexSpaceNotTooBig():
"""
Check if index space is of correct size
"""
pass | [
"def",
"checkIndexSpaceNotTooBig",
"(",
")",
":",
"pass"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/MultilevelMonteCarloApplication/external_libraries/XMC/xmc/methodDefs_hierarchyOptimiser/updateHierarchySpace.py#L1-L5 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py2/numpy/lib/function_base.py | python | quantile | (a, q, axis=None, out=None,
overwrite_input=False, interpolation='linear', keepdims=False) | return _quantile_unchecked(
a, q, axis, out, overwrite_input, interpolation, keepdims) | Compute the q-th quantile of the data along the specified axis.
..versionadded:: 1.15.0
Parameters
----------
a : array_like
Input array or object that can be converted to an array.
q : array_like of float
Quantile or sequence of quantiles to compute, which must be between
0... | Compute the q-th quantile of the data along the specified axis.
..versionadded:: 1.15.0 | [
"Compute",
"the",
"q",
"-",
"th",
"quantile",
"of",
"the",
"data",
"along",
"the",
"specified",
"axis",
".",
"..",
"versionadded",
"::",
"1",
".",
"15",
".",
"0"
] | def quantile(a, q, axis=None, out=None,
overwrite_input=False, interpolation='linear', keepdims=False):
"""
Compute the q-th quantile of the data along the specified axis.
..versionadded:: 1.15.0
Parameters
----------
a : array_like
Input array or object that can be convert... | [
"def",
"quantile",
"(",
"a",
",",
"q",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
",",
"overwrite_input",
"=",
"False",
",",
"interpolation",
"=",
"'linear'",
",",
"keepdims",
"=",
"False",
")",
":",
"q",
"=",
"np",
".",
"asanyarray",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/function_base.py#L3716-L3818 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py | python | Text.mark_set | (self, markName, index) | Set mark MARKNAME before the character at INDEX. | Set mark MARKNAME before the character at INDEX. | [
"Set",
"mark",
"MARKNAME",
"before",
"the",
"character",
"at",
"INDEX",
"."
] | def mark_set(self, markName, index):
"""Set mark MARKNAME before the character at INDEX."""
self.tk.call(self._w, 'mark', 'set', markName, index) | [
"def",
"mark_set",
"(",
"self",
",",
"markName",
",",
"index",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"'mark'",
",",
"'set'",
",",
"markName",
",",
"index",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/tkinter/__init__.py#L3282-L3284 | ||
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSNew.py | python | MSVSProject.__init__ | (self, path, name = None, dependencies = None, guid = None,
spec = None, build_file = None, config_platform_overrides = None,
fixpath_prefix = None) | Initializes the project.
Args:
path: Absolute path to the project file.
name: Name of project. If None, the name will be the same as the base
name of the project file.
dependencies: List of other Project objects this project is dependent
upon, if not None.
guid: GUID to... | Initializes the project. | [
"Initializes",
"the",
"project",
"."
] | def __init__(self, path, name = None, dependencies = None, guid = None,
spec = None, build_file = None, config_platform_overrides = None,
fixpath_prefix = None):
"""Initializes the project.
Args:
path: Absolute path to the project file.
name: Name of project. If None,... | [
"def",
"__init__",
"(",
"self",
",",
"path",
",",
"name",
"=",
"None",
",",
"dependencies",
"=",
"None",
",",
"guid",
"=",
"None",
",",
"spec",
"=",
"None",
",",
"build_file",
"=",
"None",
",",
"config_platform_overrides",
"=",
"None",
",",
"fixpath_pref... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSNew.py#L112-L147 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/easy_install.py | python | ScriptWriter._ensure_safe_name | (name) | Prevent paths in *_scripts entry point names. | Prevent paths in *_scripts entry point names. | [
"Prevent",
"paths",
"in",
"*",
"_scripts",
"entry",
"point",
"names",
"."
] | def _ensure_safe_name(name):
"""
Prevent paths in *_scripts entry point names.
"""
has_path_sep = re.search(r'[\\/]', name)
if has_path_sep:
raise ValueError("Path separators not allowed in script names") | [
"def",
"_ensure_safe_name",
"(",
"name",
")",
":",
"has_path_sep",
"=",
"re",
".",
"search",
"(",
"r'[\\\\/]'",
",",
"name",
")",
"if",
"has_path_sep",
":",
"raise",
"ValueError",
"(",
"\"Path separators not allowed in script names\"",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/command/easy_install.py#L2126-L2132 | ||
genn-team/genn | 75e1eb218cafa228bf36ae4613d1ce26e877b12c | pygenn/genn_model.py | python | create_custom_current_source_class | (class_name, param_names=None,
var_name_types=None,
derived_params=None,
injection_code=None,
extra_global_params=None,
custo... | return create_custom_model_class(
class_name, genn_wrapper.CurrentSourceModels.Custom, param_names,
var_name_types, derived_params, body) | This helper function creates a custom NeuronModel class.
See also:
create_custom_neuron_class
create_custom_weight_update_class
create_custom_current_source_class
create_custom_init_var_snippet_class
create_custom_sparse_connect_init_snippet_class
Args:
class_name -- name of t... | This helper function creates a custom NeuronModel class.
See also:
create_custom_neuron_class
create_custom_weight_update_class
create_custom_current_source_class
create_custom_init_var_snippet_class
create_custom_sparse_connect_init_snippet_class | [
"This",
"helper",
"function",
"creates",
"a",
"custom",
"NeuronModel",
"class",
".",
"See",
"also",
":",
"create_custom_neuron_class",
"create_custom_weight_update_class",
"create_custom_current_source_class",
"create_custom_init_var_snippet_class",
"create_custom_sparse_connect_init... | def create_custom_current_source_class(class_name, param_names=None,
var_name_types=None,
derived_params=None,
injection_code=None,
extra_global_params=None,
... | [
"def",
"create_custom_current_source_class",
"(",
"class_name",
",",
"param_names",
"=",
"None",
",",
"var_name_types",
"=",
"None",
",",
"derived_params",
"=",
"None",
",",
"injection_code",
"=",
"None",
",",
"extra_global_params",
"=",
"None",
",",
"custom_body",
... | https://github.com/genn-team/genn/blob/75e1eb218cafa228bf36ae4613d1ce26e877b12c/pygenn/genn_model.py#L1348-L1396 | |
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/tools/common.py | python | get_invocation_command_nodefault | (
toolset, tool, user_provided_command=[], additional_paths=[], path_last=False) | return command | A helper rule to get the command to invoke some tool. If
'user-provided-command' is not given, tries to find binary named 'tool' in
PATH and in the passed 'additional-path'. Otherwise, verifies that the first
element of 'user-provided-command' is an existing program.
This rule returns t... | A helper rule to get the command to invoke some tool. If
'user-provided-command' is not given, tries to find binary named 'tool' in
PATH and in the passed 'additional-path'. Otherwise, verifies that the first
element of 'user-provided-command' is an existing program. | [
"A",
"helper",
"rule",
"to",
"get",
"the",
"command",
"to",
"invoke",
"some",
"tool",
".",
"If",
"user",
"-",
"provided",
"-",
"command",
"is",
"not",
"given",
"tries",
"to",
"find",
"binary",
"named",
"tool",
"in",
"PATH",
"and",
"in",
"the",
"passed"... | def get_invocation_command_nodefault(
toolset, tool, user_provided_command=[], additional_paths=[], path_last=False):
"""
A helper rule to get the command to invoke some tool. If
'user-provided-command' is not given, tries to find binary named 'tool' in
PATH and in the passed 'additional... | [
"def",
"get_invocation_command_nodefault",
"(",
"toolset",
",",
"tool",
",",
"user_provided_command",
"=",
"[",
"]",
",",
"additional_paths",
"=",
"[",
"]",
",",
"path_last",
"=",
"False",
")",
":",
"assert",
"isinstance",
"(",
"toolset",
",",
"basestring",
")... | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/tools/common.py#L285-L321 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mhlib.py | python | MH.openfolder | (self, name) | return Folder(self, name) | Return a new Folder object for the named folder. | Return a new Folder object for the named folder. | [
"Return",
"a",
"new",
"Folder",
"object",
"for",
"the",
"named",
"folder",
"."
] | def openfolder(self, name):
"""Return a new Folder object for the named folder."""
return Folder(self, name) | [
"def",
"openfolder",
"(",
"self",
",",
"name",
")",
":",
"return",
"Folder",
"(",
"self",
",",
"name",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mhlib.py#L211-L213 | |
RoboJackets/robocup-software | bce13ce53ddb2ecb9696266d980722c34617dc15 | rj_gameplay/stp/role/__init__.py | python | unconstrained_constraint_fn | (
robot: stp.rc.Robot,
prev_result: Optional["RoleResult"],
world_state: stp.rc.WorldState,
) | return True | An unconstrained constraint fn, ie it always returns True.
:param robot: The current robot to check costs for.
:param prev_result: The previous role assignment result.
:param world_state: The current world state.
:return: True. | An unconstrained constraint fn, ie it always returns True.
:param robot: The current robot to check costs for.
:param prev_result: The previous role assignment result.
:param world_state: The current world state.
:return: True. | [
"An",
"unconstrained",
"constraint",
"fn",
"ie",
"it",
"always",
"returns",
"True",
".",
":",
"param",
"robot",
":",
"The",
"current",
"robot",
"to",
"check",
"costs",
"for",
".",
":",
"param",
"prev_result",
":",
"The",
"previous",
"role",
"assignment",
"... | def unconstrained_constraint_fn(
robot: stp.rc.Robot,
prev_result: Optional["RoleResult"],
world_state: stp.rc.WorldState,
) -> bool:
"""An unconstrained constraint fn, ie it always returns True.
:param robot: The current robot to check costs for.
:param prev_result: The previous role assignment... | [
"def",
"unconstrained_constraint_fn",
"(",
"robot",
":",
"stp",
".",
"rc",
".",
"Robot",
",",
"prev_result",
":",
"Optional",
"[",
"\"RoleResult\"",
"]",
",",
"world_state",
":",
"stp",
".",
"rc",
".",
"WorldState",
",",
")",
"->",
"bool",
":",
"return",
... | https://github.com/RoboJackets/robocup-software/blob/bce13ce53ddb2ecb9696266d980722c34617dc15/rj_gameplay/stp/role/__init__.py#L114-L125 | |
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/android/lighttpd_server.py | python | LighttpdServer.ShutdownHttpServer | (self) | Shuts down our lighttpd processes. | Shuts down our lighttpd processes. | [
"Shuts",
"down",
"our",
"lighttpd",
"processes",
"."
] | def ShutdownHttpServer(self):
"""Shuts down our lighttpd processes."""
if self.process:
self.process.terminate()
shutil.rmtree(self.temp_dir, ignore_errors=True) | [
"def",
"ShutdownHttpServer",
"(",
"self",
")",
":",
"if",
"self",
".",
"process",
":",
"self",
".",
"process",
".",
"terminate",
"(",
")",
"shutil",
".",
"rmtree",
"(",
"self",
".",
"temp_dir",
",",
"ignore_errors",
"=",
"True",
")"
] | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/lighttpd_server.py#L119-L123 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/ccompiler.py | python | CCompiler._fix_compile_args | (self, output_dir, macros, include_dirs) | return output_dir, macros, include_dirs | Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it with 'self.macros'; ensures that
'include_dirs' is a list, and au... | Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it with 'self.macros'; ensures that
'include_dirs' is a list, and au... | [
"Typecheck",
"and",
"fix",
"-",
"up",
"some",
"of",
"the",
"arguments",
"to",
"the",
"compile",
"()",
"method",
"and",
"return",
"fixed",
"-",
"up",
"values",
".",
"Specifically",
":",
"if",
"output_dir",
"is",
"None",
"replaces",
"it",
"with",
"self",
"... | def _fix_compile_args(self, output_dir, macros, include_dirs):
"""Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it... | [
"def",
"_fix_compile_args",
"(",
"self",
",",
"output_dir",
",",
"macros",
",",
"include_dirs",
")",
":",
"if",
"output_dir",
"is",
"None",
":",
"output_dir",
"=",
"self",
".",
"output_dir",
"elif",
"not",
"isinstance",
"(",
"output_dir",
",",
"str",
")",
... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/distutils/ccompiler.py#L376-L406 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/joblib/joblib/_memmapping_reducer.py | python | unlink_file | (filename) | Wrapper around os.unlink with a retry mechanism.
The retry mechanism has been implemented primarily to overcome a race
condition happening during the finalizer of a np.memmap: when a process
holding the last reference to a mmap-backed np.memmap/np.array is about to
delete this array (and close the refe... | Wrapper around os.unlink with a retry mechanism. | [
"Wrapper",
"around",
"os",
".",
"unlink",
"with",
"a",
"retry",
"mechanism",
"."
] | def unlink_file(filename):
"""Wrapper around os.unlink with a retry mechanism.
The retry mechanism has been implemented primarily to overcome a race
condition happening during the finalizer of a np.memmap: when a process
holding the last reference to a mmap-backed np.memmap/np.array is about to
del... | [
"def",
"unlink_file",
"(",
"filename",
")",
":",
"NUM_RETRIES",
"=",
"10",
"for",
"retry_no",
"in",
"range",
"(",
"1",
",",
"NUM_RETRIES",
"+",
"1",
")",
":",
"try",
":",
"os",
".",
"unlink",
"(",
"filename",
")",
"break",
"except",
"PermissionError",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/joblib/joblib/_memmapping_reducer.py#L77-L101 | ||
epam/Indigo | 30e40b4b1eb9bae0207435a26cfcb81ddcc42be1 | api/python/indigo/__init__.py | python | IndigoObject.getSGroupParentId | (self) | return self.dispatcher._checkResult(
Indigo._lib.indigoGetSGroupParentId(self.id)
) | SGroup method returns parent id
Returns:
int: parent id | SGroup method returns parent id | [
"SGroup",
"method",
"returns",
"parent",
"id"
] | def getSGroupParentId(self):
"""SGroup method returns parent id
Returns:
int: parent id
"""
self.dispatcher._setSessionId()
return self.dispatcher._checkResult(
Indigo._lib.indigoGetSGroupParentId(self.id)
) | [
"def",
"getSGroupParentId",
"(",
"self",
")",
":",
"self",
".",
"dispatcher",
".",
"_setSessionId",
"(",
")",
"return",
"self",
".",
"dispatcher",
".",
"_checkResult",
"(",
"Indigo",
".",
"_lib",
".",
"indigoGetSGroupParentId",
"(",
"self",
".",
"id",
")",
... | https://github.com/epam/Indigo/blob/30e40b4b1eb9bae0207435a26cfcb81ddcc42be1/api/python/indigo/__init__.py#L2154-L2163 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/utils/__init__.py | python | ask | (message, options) | Ask the message interactively, with the given possible responses | Ask the message interactively, with the given possible responses | [
"Ask",
"the",
"message",
"interactively",
"with",
"the",
"given",
"possible",
"responses"
] | def ask(message, options):
"""Ask the message interactively, with the given possible responses"""
while 1:
if os.environ.get('PIP_NO_INPUT'):
raise Exception(
'No input was expected ($PIP_NO_INPUT set); question: %s' %
message
)
response = ... | [
"def",
"ask",
"(",
"message",
",",
"options",
")",
":",
"while",
"1",
":",
"if",
"os",
".",
"environ",
".",
"get",
"(",
"'PIP_NO_INPUT'",
")",
":",
"raise",
"Exception",
"(",
"'No input was expected ($PIP_NO_INPUT set); question: %s'",
"%",
"message",
")",
"re... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/utils/__init__.py#L137-L153 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | ScrollHelper.EnableScrolling | (*args, **kwargs) | return _windows_.ScrollHelper_EnableScrolling(*args, **kwargs) | EnableScrolling(self, bool x_scrolling, bool y_scrolling) | EnableScrolling(self, bool x_scrolling, bool y_scrolling) | [
"EnableScrolling",
"(",
"self",
"bool",
"x_scrolling",
"bool",
"y_scrolling",
")"
] | def EnableScrolling(*args, **kwargs):
"""EnableScrolling(self, bool x_scrolling, bool y_scrolling)"""
return _windows_.ScrollHelper_EnableScrolling(*args, **kwargs) | [
"def",
"EnableScrolling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"ScrollHelper_EnableScrolling",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L187-L189 | |
scribusproject/scribus | 41ec7c775a060912cf251682a8b1437f753f80f4 | codegen/cheetah/Cheetah/Templates/_SkeletonPage.py | python | _SkeletonPage.currentDate | (self, formatString="%b %d, %Y") | return time.strftime(formatString, time.localtime(time.time())) | Return a string representing the current localtime. | Return a string representing the current localtime. | [
"Return",
"a",
"string",
"representing",
"the",
"current",
"localtime",
"."
] | def currentDate(self, formatString="%b %d, %Y"):
"""Return a string representing the current localtime."""
return time.strftime(formatString, time.localtime(time.time())) | [
"def",
"currentDate",
"(",
"self",
",",
"formatString",
"=",
"\"%b %d, %Y\"",
")",
":",
"return",
"time",
".",
"strftime",
"(",
"formatString",
",",
"time",
".",
"localtime",
"(",
"time",
".",
"time",
"(",
")",
")",
")"
] | https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/codegen/cheetah/Cheetah/Templates/_SkeletonPage.py#L187-L189 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/nntplib.py | python | NNTP.date | (self) | return resp, date, time | Process the DATE command. Arguments:
None
Returns:
resp: server response if successful
date: Date suitable for newnews/newgroups commands etc.
time: Time suitable for newnews/newgroups commands etc. | Process the DATE command. Arguments:
None
Returns:
resp: server response if successful
date: Date suitable for newnews/newgroups commands etc.
time: Time suitable for newnews/newgroups commands etc. | [
"Process",
"the",
"DATE",
"command",
".",
"Arguments",
":",
"None",
"Returns",
":",
"resp",
":",
"server",
"response",
"if",
"successful",
"date",
":",
"Date",
"suitable",
"for",
"newnews",
"/",
"newgroups",
"commands",
"etc",
".",
"time",
":",
"Time",
"su... | def date (self):
"""Process the DATE command. Arguments:
None
Returns:
resp: server response if successful
date: Date suitable for newnews/newgroups commands etc.
time: Time suitable for newnews/newgroups commands etc."""
resp = self.shortcmd("DATE")
if r... | [
"def",
"date",
"(",
"self",
")",
":",
"resp",
"=",
"self",
".",
"shortcmd",
"(",
"\"DATE\"",
")",
"if",
"resp",
"[",
":",
"3",
"]",
"!=",
"'111'",
":",
"raise",
"NNTPReplyError",
"(",
"resp",
")",
"elem",
"=",
"resp",
".",
"split",
"(",
")",
"if"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/nntplib.py#L528-L546 | |
sailing-pmls/pmls-caffe | 49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a | scripts/cpp_lint.py | python | CleanseRawStrings | (raw_lines) | return lines_without_raw_strings | Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Returns:
list of lines with C++11 raw str... | Removes C++11 raw strings from lines. | [
"Removes",
"C",
"++",
"11",
"raw",
"strings",
"from",
"lines",
"."
] | def CleanseRawStrings(raw_lines):
"""Removes C++11 raw strings from lines.
Before:
static const char kData[] = R"(
multi-line string
)";
After:
static const char kData[] = ""
(replaced by blank line)
"";
Args:
raw_lines: list of raw lines.
Return... | [
"def",
"CleanseRawStrings",
"(",
"raw_lines",
")",
":",
"delimiter",
"=",
"None",
"lines_without_raw_strings",
"=",
"[",
"]",
"for",
"line",
"in",
"raw_lines",
":",
"if",
"delimiter",
":",
"# Inside a raw string, look for the end",
"end",
"=",
"line",
".",
"find",... | https://github.com/sailing-pmls/pmls-caffe/blob/49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a/scripts/cpp_lint.py#L1062-L1120 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/SIP/models.py | python | modelColeColeSigma | (f, sigma, m, tau, c, a=1) | return (1. + m / (1-m) * (1. - relaxationTerm(f, tau, c, a))) * sigma | Complex-valued conductivity Cole-Cole model | Complex-valued conductivity Cole-Cole model | [
"Complex",
"-",
"valued",
"conductivity",
"Cole",
"-",
"Cole",
"model"
] | def modelColeColeSigma(f, sigma, m, tau, c, a=1):
"""Complex-valued conductivity Cole-Cole model"""
return (1. + m / (1-m) * (1. - relaxationTerm(f, tau, c, a))) * sigma | [
"def",
"modelColeColeSigma",
"(",
"f",
",",
"sigma",
",",
"m",
",",
"tau",
",",
"c",
",",
"a",
"=",
"1",
")",
":",
"return",
"(",
"1.",
"+",
"m",
"/",
"(",
"1",
"-",
"m",
")",
"*",
"(",
"1.",
"-",
"relaxationTerm",
"(",
"f",
",",
"tau",
","... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/SIP/models.py#L105-L107 | |
stellar-deprecated/stellard | 67eabb2217bdfa9a6ea317f62338fb6bca458c90 | src/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool._ConvertMessageDescriptor | (self, desc_proto, package=None, file_desc=None,
scope=None) | return desc | Adds the proto to the pool in the specified package.
Args:
desc_proto: The descriptor_pb2.DescriptorProto protobuf message.
package: The package the proto should be located in.
file_desc: The file containing this message.
scope: Dict mapping short and full symbols to message and enum types.... | Adds the proto to the pool in the specified package. | [
"Adds",
"the",
"proto",
"to",
"the",
"pool",
"in",
"the",
"specified",
"package",
"."
] | def _ConvertMessageDescriptor(self, desc_proto, package=None, file_desc=None,
scope=None):
"""Adds the proto to the pool in the specified package.
Args:
desc_proto: The descriptor_pb2.DescriptorProto protobuf message.
package: The package the proto should be located ... | [
"def",
"_ConvertMessageDescriptor",
"(",
"self",
",",
"desc_proto",
",",
"package",
"=",
"None",
",",
"file_desc",
"=",
"None",
",",
"scope",
"=",
"None",
")",
":",
"if",
"package",
":",
"desc_name",
"=",
"'.'",
".",
"join",
"(",
"(",
"package",
",",
"... | https://github.com/stellar-deprecated/stellard/blob/67eabb2217bdfa9a6ea317f62338fb6bca458c90/src/protobuf/python/google/protobuf/descriptor_pool.py#L230-L294 | |
ZeroCM/zcm | a4f8a1c2d81414a13116a70c0979b1bf546866df | waftools/wafcache.py | python | get_process | () | Returns a worker process that can process waf cache commands
The worker process is assumed to be returned to the process pool when unused | Returns a worker process that can process waf cache commands
The worker process is assumed to be returned to the process pool when unused | [
"Returns",
"a",
"worker",
"process",
"that",
"can",
"process",
"waf",
"cache",
"commands",
"The",
"worker",
"process",
"is",
"assumed",
"to",
"be",
"returned",
"to",
"the",
"process",
"pool",
"when",
"unused"
] | def get_process():
"""
Returns a worker process that can process waf cache commands
The worker process is assumed to be returned to the process pool when unused
"""
try:
return process_pool.pop()
except IndexError:
filepath = os.path.dirname(os.path.abspath(__file__)) + os.sep + 'wafcache.py'
cmd = [sys.exe... | [
"def",
"get_process",
"(",
")",
":",
"try",
":",
"return",
"process_pool",
".",
"pop",
"(",
")",
"except",
"IndexError",
":",
"filepath",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"__file__",
")",
")",
"+",
... | https://github.com/ZeroCM/zcm/blob/a4f8a1c2d81414a13116a70c0979b1bf546866df/waftools/wafcache.py#L235-L245 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ribbon/page.py | python | RibbonPage.GetMajorAxis | (self) | Get the direction in which ribbon panels are stacked within the page.
This is controlled by the style of the containing :class:`~lib.agw.ribbon.bar.RibbonBar`, meaning that all
pages within a bar will have the same major axis. As well as being the direction
in which panels are stacked, it is al... | Get the direction in which ribbon panels are stacked within the page. | [
"Get",
"the",
"direction",
"in",
"which",
"ribbon",
"panels",
"are",
"stacked",
"within",
"the",
"page",
"."
] | def GetMajorAxis(self):
"""
Get the direction in which ribbon panels are stacked within the page.
This is controlled by the style of the containing :class:`~lib.agw.ribbon.bar.RibbonBar`, meaning that all
pages within a bar will have the same major axis. As well as being the direction
... | [
"def",
"GetMajorAxis",
"(",
"self",
")",
":",
"if",
"self",
".",
"_art",
"and",
"(",
"self",
".",
"_art",
".",
"GetFlags",
"(",
")",
"&",
"RIBBON_BAR_FLOW_VERTICAL",
")",
":",
"return",
"wx",
".",
"VERTICAL",
"else",
":",
"return",
"wx",
".",
"HORIZONT... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ribbon/page.py#L227-L242 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/strings.py | python | str_replace | (arr, pat, repl, n=-1, case=None, flags=0, regex=True) | return _na_map(f, arr, dtype=str) | r"""
Replace occurrences of pattern/regex in the Series/Index with
some other string. Equivalent to :meth:`str.replace` or
:func:`re.sub`.
Parameters
----------
pat : str or compiled regex
String can be a character sequence or regular expression.
repl : str or callable
Repla... | r"""
Replace occurrences of pattern/regex in the Series/Index with
some other string. Equivalent to :meth:`str.replace` or
:func:`re.sub`. | [
"r",
"Replace",
"occurrences",
"of",
"pattern",
"/",
"regex",
"in",
"the",
"Series",
"/",
"Index",
"with",
"some",
"other",
"string",
".",
"Equivalent",
"to",
":",
"meth",
":",
"str",
".",
"replace",
"or",
":",
"func",
":",
"re",
".",
"sub",
"."
] | def str_replace(arr, pat, repl, n=-1, case=None, flags=0, regex=True):
r"""
Replace occurrences of pattern/regex in the Series/Index with
some other string. Equivalent to :meth:`str.replace` or
:func:`re.sub`.
Parameters
----------
pat : str or compiled regex
String can be a charact... | [
"def",
"str_replace",
"(",
"arr",
",",
"pat",
",",
"repl",
",",
"n",
"=",
"-",
"1",
",",
"case",
"=",
"None",
",",
"flags",
"=",
"0",
",",
"regex",
"=",
"True",
")",
":",
"# Check whether repl is valid (GH 13438, GH 15055)",
"if",
"not",
"(",
"isinstance... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/strings.py#L573-L726 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/wsgiref/headers.py | python | Headers.items | (self) | return self._headers[:] | Get all the header fields and values.
These will be sorted in the order they were in the original header
list, or were added to this instance, and may contain duplicates.
Any fields deleted and re-inserted are always appended to the header
list. | Get all the header fields and values. | [
"Get",
"all",
"the",
"header",
"fields",
"and",
"values",
"."
] | def items(self):
"""Get all the header fields and values.
These will be sorted in the order they were in the original header
list, or were added to this instance, and may contain duplicates.
Any fields deleted and re-inserted are always appended to the header
list.
"""
... | [
"def",
"items",
"(",
"self",
")",
":",
"return",
"self",
".",
"_headers",
"[",
":",
"]"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/wsgiref/headers.py#L115-L123 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/plotting/_converter.py | python | deregister | () | Remove pandas' formatters and converters
Removes the custom converters added by :func:`register`. This
attempts to set the state of the registry back to the state before
pandas registered its own units. Converters for pandas' own types like
Timestamp and Period are removed completely. Converters for ty... | Remove pandas' formatters and converters | [
"Remove",
"pandas",
"formatters",
"and",
"converters"
] | def deregister():
"""
Remove pandas' formatters and converters
Removes the custom converters added by :func:`register`. This
attempts to set the state of the registry back to the state before
pandas registered its own units. Converters for pandas' own types like
Timestamp and Period are removed... | [
"def",
"deregister",
"(",
")",
":",
"# Renamed in pandas.plotting.__init__",
"for",
"type_",
",",
"cls",
"in",
"get_pairs",
"(",
")",
":",
"# We use type to catch our classes directly, no inheritance",
"if",
"type",
"(",
"units",
".",
"registry",
".",
"get",
"(",
"t... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/plotting/_converter.py#L88-L114 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/user_preferences.py | python | UserPreferences.sounds | (self, sounds) | Sets the sounds of this UserPreferences.
:param sounds: The sounds of this UserPreferences. # noqa: E501
:type: list[str] | Sets the sounds of this UserPreferences. | [
"Sets",
"the",
"sounds",
"of",
"this",
"UserPreferences",
"."
] | def sounds(self, sounds):
"""Sets the sounds of this UserPreferences.
:param sounds: The sounds of this UserPreferences. # noqa: E501
:type: list[str]
"""
self._sounds = sounds | [
"def",
"sounds",
"(",
"self",
",",
"sounds",
")",
":",
"self",
".",
"_sounds",
"=",
"sounds"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user_preferences.py#L632-L640 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/richtext.py | python | RichTextBuffer.InsertImageWithUndo | (*args, **kwargs) | return _richtext.RichTextBuffer_InsertImageWithUndo(*args, **kwargs) | InsertImageWithUndo(self, long pos, wxRichTextImageBlock imageBlock, RichTextCtrl ctrl,
int flags=0) -> bool | InsertImageWithUndo(self, long pos, wxRichTextImageBlock imageBlock, RichTextCtrl ctrl,
int flags=0) -> bool | [
"InsertImageWithUndo",
"(",
"self",
"long",
"pos",
"wxRichTextImageBlock",
"imageBlock",
"RichTextCtrl",
"ctrl",
"int",
"flags",
"=",
"0",
")",
"-",
">",
"bool"
] | def InsertImageWithUndo(*args, **kwargs):
"""
InsertImageWithUndo(self, long pos, wxRichTextImageBlock imageBlock, RichTextCtrl ctrl,
int flags=0) -> bool
"""
return _richtext.RichTextBuffer_InsertImageWithUndo(*args, **kwargs) | [
"def",
"InsertImageWithUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_InsertImageWithUndo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/richtext.py#L2518-L2523 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/dummyarray.py | python | _compute_size | (start, stop, step) | return (hi - lo - 1) // step + 1 | Algorithm adapted from cpython rangeobject.c | Algorithm adapted from cpython rangeobject.c | [
"Algorithm",
"adapted",
"from",
"cpython",
"rangeobject",
".",
"c"
] | def _compute_size(start, stop, step):
"""Algorithm adapted from cpython rangeobject.c
"""
if step > 0:
lo = start
hi = stop
else:
lo = stop
hi = start
step = -step
if lo >= hi:
return 0
return (hi - lo - 1) // step + 1 | [
"def",
"_compute_size",
"(",
"start",
",",
"stop",
",",
"step",
")",
":",
"if",
"step",
">",
"0",
":",
"lo",
"=",
"start",
"hi",
"=",
"stop",
"else",
":",
"lo",
"=",
"stop",
"hi",
"=",
"start",
"step",
"=",
"-",
"step",
"if",
"lo",
">=",
"hi",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/dummyarray.py#L409-L421 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/training/coordinator.py | python | Coordinator.raise_requested_exception | (self) | If an exception has been passed to `request_stop`, this raises it. | If an exception has been passed to `request_stop`, this raises it. | [
"If",
"an",
"exception",
"has",
"been",
"passed",
"to",
"request_stop",
"this",
"raises",
"it",
"."
] | def raise_requested_exception(self):
"""If an exception has been passed to `request_stop`, this raises it."""
with self._lock:
if self._exc_info_to_raise:
six.reraise(*self._exc_info_to_raise) | [
"def",
"raise_requested_exception",
"(",
"self",
")",
":",
"with",
"self",
".",
"_lock",
":",
"if",
"self",
".",
"_exc_info_to_raise",
":",
"six",
".",
"reraise",
"(",
"*",
"self",
".",
"_exc_info_to_raise",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/coordinator.py#L403-L407 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/_header_value_parser.py | python | get_value | (value) | return v, value | quoted-string / attribute | quoted-string / attribute | [
"quoted",
"-",
"string",
"/",
"attribute"
] | def get_value(value):
""" quoted-string / attribute
"""
v = Value()
if not value:
raise errors.HeaderParseError("Expected value but found end of string")
leader = None
if value[0] in CFWS_LEADER:
leader, value = get_cfws(value)
if not value:
raise errors.HeaderParseE... | [
"def",
"get_value",
"(",
"value",
")",
":",
"v",
"=",
"Value",
"(",
")",
"if",
"not",
"value",
":",
"raise",
"errors",
".",
"HeaderParseError",
"(",
"\"Expected value but found end of string\"",
")",
"leader",
"=",
"None",
"if",
"value",
"[",
"0",
"]",
"in... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/email/_header_value_parser.py#L2270-L2290 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/oldnumeric/ma.py | python | _MaskedPrintOption.enabled | (self) | return self._enabled | Is the use of the display value enabled? | Is the use of the display value enabled? | [
"Is",
"the",
"use",
"of",
"the",
"display",
"value",
"enabled?"
] | def enabled (self):
"Is the use of the display value enabled?"
return self._enabled | [
"def",
"enabled",
"(",
"self",
")",
":",
"return",
"self",
".",
"_enabled"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/oldnumeric/ma.py#L61-L63 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py | python | _dnsname_match | (dn, hostname, max_wildcards=1) | return pat.match(hostname) | Matching according to RFC 6125, section 6.4.3
http://tools.ietf.org/html/rfc6125#section-6.4.3 | Matching according to RFC 6125, section 6.4.3 | [
"Matching",
"according",
"to",
"RFC",
"6125",
"section",
"6",
".",
"4",
".",
"3"
] | def _dnsname_match(dn, hostname, max_wildcards=1):
"""Matching according to RFC 6125, section 6.4.3
http://tools.ietf.org/html/rfc6125#section-6.4.3
"""
pats = []
if not dn:
return False
# Ported from python3-syntax:
# leftmost, *remainder = dn.split(r'.')
parts = dn.split(r"."... | [
"def",
"_dnsname_match",
"(",
"dn",
",",
"hostname",
",",
"max_wildcards",
"=",
"1",
")",
":",
"pats",
"=",
"[",
"]",
"if",
"not",
"dn",
":",
"return",
"False",
"# Ported from python3-syntax:",
"# leftmost, *remainder = dn.split(r'.')",
"parts",
"=",
"dn",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py#L25-L76 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiPaneInfo.CentrePane | (*args, **kwargs) | return _aui.AuiPaneInfo_CentrePane(*args, **kwargs) | CentrePane(self) -> AuiPaneInfo | CentrePane(self) -> AuiPaneInfo | [
"CentrePane",
"(",
"self",
")",
"-",
">",
"AuiPaneInfo"
] | def CentrePane(*args, **kwargs):
"""CentrePane(self) -> AuiPaneInfo"""
return _aui.AuiPaneInfo_CentrePane(*args, **kwargs) | [
"def",
"CentrePane",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_CentrePane",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L513-L515 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/ordered_set.py | python | OrderedSet.difference | (self, *sets) | return cls(items) | Returns all elements that are in this set but not the others.
Example:
>>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]))
OrderedSet([1, 3])
>>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3]))
OrderedSet([1])
>>> OrderedSet([1, 2... | Returns all elements that are in this set but not the others. | [
"Returns",
"all",
"elements",
"that",
"are",
"in",
"this",
"set",
"but",
"not",
"the",
"others",
"."
] | def difference(self, *sets):
"""
Returns all elements that are in this set but not the others.
Example:
>>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]))
OrderedSet([1, 3])
>>> OrderedSet([1, 2, 3]).difference(OrderedSet([2]), OrderedSet([3]))
... | [
"def",
"difference",
"(",
"self",
",",
"*",
"sets",
")",
":",
"cls",
"=",
"self",
".",
"__class__",
"if",
"sets",
":",
"other",
"=",
"set",
".",
"union",
"(",
"*",
"map",
"(",
"set",
",",
"sets",
")",
")",
"items",
"=",
"(",
"item",
"for",
"ite... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/ordered_set.py#L355-L375 | |
tensorflow/io | 92b44e180674a8af0e12e405530f7343e3e693e4 | tensorflow_io/python/experimental/serial_ops.py | python | _float_feature | (value) | return tf.train.Feature(float_list=tf.train.FloatList(value=value)) | value: list | value: list | [
"value",
":",
"list"
] | def _float_feature(value):
"""value: list"""
return tf.train.Feature(float_list=tf.train.FloatList(value=value)) | [
"def",
"_float_feature",
"(",
"value",
")",
":",
"return",
"tf",
".",
"train",
".",
"Feature",
"(",
"float_list",
"=",
"tf",
".",
"train",
".",
"FloatList",
"(",
"value",
"=",
"value",
")",
")"
] | https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/experimental/serial_ops.py#L53-L55 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py | python | Filterer.removeFilter | (self, filter) | Remove the specified filter from this handler. | Remove the specified filter from this handler. | [
"Remove",
"the",
"specified",
"filter",
"from",
"this",
"handler",
"."
] | def removeFilter(self, filter):
"""
Remove the specified filter from this handler.
"""
if filter in self.filters:
self.filters.remove(filter) | [
"def",
"removeFilter",
"(",
"self",
",",
"filter",
")",
":",
"if",
"filter",
"in",
"self",
".",
"filters",
":",
"self",
".",
"filters",
".",
"remove",
"(",
"filter",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py#L591-L596 | ||
samdauwe/BabylonCpp | 3dad13a666299cbcf2e2db5b24575c19743e1000 | cmake_build.py | python | WindowsBuild.getDevenvCommand | (self) | return 'start BabylonCpp.sln' | Returns command to start Visual Studio. | Returns command to start Visual Studio. | [
"Returns",
"command",
"to",
"start",
"Visual",
"Studio",
"."
] | def getDevenvCommand(self):
'''
Returns command to start Visual Studio.
'''
return 'start BabylonCpp.sln' | [
"def",
"getDevenvCommand",
"(",
"self",
")",
":",
"return",
"'start BabylonCpp.sln'"
] | https://github.com/samdauwe/BabylonCpp/blob/3dad13a666299cbcf2e2db5b24575c19743e1000/cmake_build.py#L307-L311 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py | python | have_gui | () | return int(vim.eval("has('gui_running')")) == 1 | Returns True if vim is in a gui (Gvim/MacVim), False otherwise. | Returns True if vim is in a gui (Gvim/MacVim), False otherwise. | [
"Returns",
"True",
"if",
"vim",
"is",
"in",
"a",
"gui",
"(",
"Gvim",
"/",
"MacVim",
")",
"False",
"otherwise",
"."
] | def have_gui():
""" Returns True if vim is in a gui (Gvim/MacVim), False otherwise. """
return int(vim.eval("has('gui_running')")) == 1 | [
"def",
"have_gui",
"(",
")",
":",
"return",
"int",
"(",
"vim",
".",
"eval",
"(",
"\"has('gui_running')\"",
")",
")",
"==",
"1"
] | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py#L140-L142 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/coremodules/simulation/result_oglviewer.py | python | EdgeresultDrawings.configure | (self, attrname,
resultwidth=15.0,
length_arrowhead=5.0,
is_widthvalue=True,
is_colorvalue=False,
color_fill=np.array([0.3, 0.3, 1.0, 0.95], dtype=np.float32),
) | Configures all sorts of parameters and updates everything at once.
Called by tool. | Configures all sorts of parameters and updates everything at once.
Called by tool. | [
"Configures",
"all",
"sorts",
"of",
"parameters",
"and",
"updates",
"everything",
"at",
"once",
".",
"Called",
"by",
"tool",
"."
] | def configure(self, attrname,
resultwidth=15.0,
length_arrowhead=5.0,
is_widthvalue=True,
is_colorvalue=False,
color_fill=np.array([0.3, 0.3, 1.0, 0.95], dtype=np.float32),
):
"""
Configures all s... | [
"def",
"configure",
"(",
"self",
",",
"attrname",
",",
"resultwidth",
"=",
"15.0",
",",
"length_arrowhead",
"=",
"5.0",
",",
"is_widthvalue",
"=",
"True",
",",
"is_colorvalue",
"=",
"False",
",",
"color_fill",
"=",
"np",
".",
"array",
"(",
"[",
"0.3",
",... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/simulation/result_oglviewer.py#L719-L762 | ||
gv22ga/dlib-face-recognition-android | 42d6305cbd85833f2b85bb79b70ab9ab004153c9 | tools/lint/cpplint.py | python | _SetOutputFormat | (output_format) | Sets the module's output format. | Sets the module's output format. | [
"Sets",
"the",
"module",
"s",
"output",
"format",
"."
] | def _SetOutputFormat(output_format):
"""Sets the module's output format."""
_cpplint_state.SetOutputFormat(output_format) | [
"def",
"_SetOutputFormat",
"(",
"output_format",
")",
":",
"_cpplint_state",
".",
"SetOutputFormat",
"(",
"output_format",
")"
] | https://github.com/gv22ga/dlib-face-recognition-android/blob/42d6305cbd85833f2b85bb79b70ab9ab004153c9/tools/lint/cpplint.py#L891-L893 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/polynomial/legendre.py | python | legsub | (c1, c2) | return pu._sub(c1, c2) | Subtract one Legendre series from another.
Returns the difference of two Legendre series `c1` - `c2`. The
sequences of coefficients are from lowest order term to highest, i.e.,
[1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``.
Parameters
----------
c1, c2 : array_like
1-D arrays ... | Subtract one Legendre series from another. | [
"Subtract",
"one",
"Legendre",
"series",
"from",
"another",
"."
] | def legsub(c1, c2):
"""
Subtract one Legendre series from another.
Returns the difference of two Legendre series `c1` - `c2`. The
sequences of coefficients are from lowest order term to highest, i.e.,
[1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``.
Parameters
----------
c1, c2 ... | [
"def",
"legsub",
"(",
"c1",
",",
"c2",
")",
":",
"return",
"pu",
".",
"_sub",
"(",
"c1",
",",
"c2",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/legendre.py#L364-L405 | |
mit-nlp/MITIE | bf8c532c9bbd23f2aea7c3b88a3ebfe03c1e0878 | mitielib/mitie.py | python | tokenize_with_offsets | (string) | return res | Split string into tokens and return them as a list. Also, each element of the list
contains a tuple of the token text and the byte offset which indicates the position of the
first character in the token within the input string. | Split string into tokens and return them as a list. Also, each element of the list
contains a tuple of the token text and the byte offset which indicates the position of the
first character in the token within the input string. | [
"Split",
"string",
"into",
"tokens",
"and",
"return",
"them",
"as",
"a",
"list",
".",
"Also",
"each",
"element",
"of",
"the",
"list",
"contains",
"a",
"tuple",
"of",
"the",
"token",
"text",
"and",
"the",
"byte",
"offset",
"which",
"indicates",
"the",
"po... | def tokenize_with_offsets(string):
"""Split string into tokens and return them as a list. Also, each element of the list
contains a tuple of the token text and the byte offset which indicates the position of the
first character in the token within the input string."""
mitie_tokenize = _f.mitie_to... | [
"def",
"tokenize_with_offsets",
"(",
"string",
")",
":",
"mitie_tokenize",
"=",
"_f",
".",
"mitie_tokenize_with_offsets",
"mitie_tokenize",
".",
"restype",
"=",
"ctypes",
".",
"POINTER",
"(",
"ctypes",
".",
"c_char_p",
")",
"mitie_tokenize",
".",
"argtypes",
"=",
... | https://github.com/mit-nlp/MITIE/blob/bf8c532c9bbd23f2aea7c3b88a3ebfe03c1e0878/mitielib/mitie.py#L206-L225 | |
JarveeLee/SynthText_Chinese_version | 4b2cbc7d14741f21d0bb17966a339ab3574b09a8 | colorize3_poisson.py | python | Colorize.border | (self, alpha, size, kernel_type='RECT') | return border | alpha : alpha layer of the text
size : size of the kernel
kernel_type : one of [rect,ellipse,cross]
@return : alpha layer of the border (color to be added externally). | alpha : alpha layer of the text
size : size of the kernel
kernel_type : one of [rect,ellipse,cross] | [
"alpha",
":",
"alpha",
"layer",
"of",
"the",
"text",
"size",
":",
"size",
"of",
"the",
"kernel",
"kernel_type",
":",
"one",
"of",
"[",
"rect",
"ellipse",
"cross",
"]"
] | def border(self, alpha, size, kernel_type='RECT'):
"""
alpha : alpha layer of the text
size : size of the kernel
kernel_type : one of [rect,ellipse,cross]
@return : alpha layer of the border (color to be added externally).
"""
kdict = {'RECT':cv.MORPH_RECT, 'ELL... | [
"def",
"border",
"(",
"self",
",",
"alpha",
",",
"size",
",",
"kernel_type",
"=",
"'RECT'",
")",
":",
"kdict",
"=",
"{",
"'RECT'",
":",
"cv",
".",
"MORPH_RECT",
",",
"'ELLIPSE'",
":",
"cv",
".",
"MORPH_ELLIPSE",
",",
"'CROSS'",
":",
"cv",
".",
"MORPH... | https://github.com/JarveeLee/SynthText_Chinese_version/blob/4b2cbc7d14741f21d0bb17966a339ab3574b09a8/colorize3_poisson.py#L175-L187 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/waflib/Task.py | python | Task.post_run | (self) | Called after successful execution to update the cache data :py:class:`waflib.Node.Node` sigs
and :py:attr:`waflib.Build.BuildContext.task_sigs`.
The node signature is obtained from the task signature, but the output nodes may also get the signature
of their contents. See the class decorator :py:func:`waflib.Task... | Called after successful execution to update the cache data :py:class:`waflib.Node.Node` sigs
and :py:attr:`waflib.Build.BuildContext.task_sigs`. | [
"Called",
"after",
"successful",
"execution",
"to",
"update",
"the",
"cache",
"data",
":",
"py",
":",
"class",
":",
"waflib",
".",
"Node",
".",
"Node",
"sigs",
"and",
":",
"py",
":",
"attr",
":",
"waflib",
".",
"Build",
".",
"BuildContext",
".",
"task_... | def post_run(self):
"""
Called after successful execution to update the cache data :py:class:`waflib.Node.Node` sigs
and :py:attr:`waflib.Build.BuildContext.task_sigs`.
The node signature is obtained from the task signature, but the output nodes may also get the signature
of their contents. See the class dec... | [
"def",
"post_run",
"(",
"self",
")",
":",
"bld",
"=",
"self",
".",
"generator",
".",
"bld",
"sig",
"=",
"self",
".",
"signature",
"(",
")",
"for",
"node",
"in",
"self",
".",
"outputs",
":",
"# check if the node exists ..",
"try",
":",
"os",
".",
"stat"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Task.py#L618-L641 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathToolBitLibraryGui.py | python | ModelFactory.libraryOpen | (self, model, lib="") | return model | opens the tools in library
Returns a QStandardItemModel | opens the tools in library
Returns a QStandardItemModel | [
"opens",
"the",
"tools",
"in",
"library",
"Returns",
"a",
"QStandardItemModel"
] | def libraryOpen(self, model, lib=""):
"""
opens the tools in library
Returns a QStandardItemModel
"""
PathLog.track(lib)
if lib == "":
lib = PathPreferences.lastFileToolLibrary()
if lib == "" or lib is None:
return model
if os.pa... | [
"def",
"libraryOpen",
"(",
"self",
",",
"model",
",",
"lib",
"=",
"\"\"",
")",
":",
"PathLog",
".",
"track",
"(",
"lib",
")",
"if",
"lib",
"==",
"\"\"",
":",
"lib",
"=",
"PathPreferences",
".",
"lastFileToolLibrary",
"(",
")",
"if",
"lib",
"==",
"\"\... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathToolBitLibraryGui.py#L336-L353 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rostopic/src/rostopic/__init__.py | python | file_yaml_arg | (filename) | return bagy_iter | :param filename: file name, ``str``
:returns: Iterator that yields pub args (list of args), ``iterator``
:raises: :exc:`ROSTopicException` If filename is invalid | :param filename: file name, ``str``
:returns: Iterator that yields pub args (list of args), ``iterator``
:raises: :exc:`ROSTopicException` If filename is invalid | [
":",
"param",
"filename",
":",
"file",
"name",
"str",
":",
"returns",
":",
"Iterator",
"that",
"yields",
"pub",
"args",
"(",
"list",
"of",
"args",
")",
"iterator",
":",
"raises",
":",
":",
"exc",
":",
"ROSTopicException",
"If",
"filename",
"is",
"invalid... | def file_yaml_arg(filename):
"""
:param filename: file name, ``str``
:returns: Iterator that yields pub args (list of args), ``iterator``
:raises: :exc:`ROSTopicException` If filename is invalid
"""
if not os.path.isfile(filename):
raise ROSTopicException("file does not exist: %s"%(filen... | [
"def",
"file_yaml_arg",
"(",
"filename",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"filename",
")",
":",
"raise",
"ROSTopicException",
"(",
"\"file does not exist: %s\"",
"%",
"(",
"filename",
")",
")",
"import",
"yaml",
"def",
"bagy_iter... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rostopic/src/rostopic/__init__.py#L1623-L1641 | |
microsoft/DirectXShaderCompiler | 8348ff8d9e0287610ba05d3a828e10af981a1c05 | utils/lit/lit/discovery.py | python | find_tests_for_inputs | (lit_config, inputs) | return tests | find_tests_for_inputs(lit_config, inputs) -> [Test]
Given a configuration object and a list of input specifiers, find all the
tests to execute. | find_tests_for_inputs(lit_config, inputs) -> [Test] | [
"find_tests_for_inputs",
"(",
"lit_config",
"inputs",
")",
"-",
">",
"[",
"Test",
"]"
] | def find_tests_for_inputs(lit_config, inputs):
"""
find_tests_for_inputs(lit_config, inputs) -> [Test]
Given a configuration object and a list of input specifiers, find all the
tests to execute.
"""
# Expand '@...' form in inputs.
actual_inputs = []
for input in inputs:
if inpu... | [
"def",
"find_tests_for_inputs",
"(",
"lit_config",
",",
"inputs",
")",
":",
"# Expand '@...' form in inputs.",
"actual_inputs",
"=",
"[",
"]",
"for",
"input",
"in",
"inputs",
":",
"if",
"input",
".",
"startswith",
"(",
"'@'",
")",
":",
"f",
"=",
"open",
"(",... | https://github.com/microsoft/DirectXShaderCompiler/blob/8348ff8d9e0287610ba05d3a828e10af981a1c05/utils/lit/lit/discovery.py#L192-L231 | |
xlgames-inc/XLE | cdd8682367d9e9fdbdda9f79d72bb5b1499cec46 | Foreign/FreeType/src/tools/glnames.py | python | main | () | main program body | main program body | [
"main",
"program",
"body"
] | def main():
"""main program body"""
if len( sys.argv ) != 2:
print __doc__ % sys.argv[0]
sys.exit( 1 )
file = open( sys.argv[1], "w\n" )
write = file.write
count_sid = len( sid_standard_names )
# `mac_extras' contains the list of glyph names in the Macintosh standard
# encoding which are not ... | [
"def",
"main",
"(",
")",
":",
"if",
"len",
"(",
"sys",
".",
"argv",
")",
"!=",
"2",
":",
"print",
"__doc__",
"%",
"sys",
".",
"argv",
"[",
"0",
"]",
"sys",
".",
"exit",
"(",
"1",
")",
"file",
"=",
"open",
"(",
"sys",
".",
"argv",
"[",
"1",
... | https://github.com/xlgames-inc/XLE/blob/cdd8682367d9e9fdbdda9f79d72bb5b1499cec46/Foreign/FreeType/src/tools/glnames.py#L5238-L5479 | ||
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | cd/utils/artifact_repository.py | python | get_linux_os_release_properties | () | Makes a dictionary out of /etc/os-release
:return: A dictionary of os release properties | Makes a dictionary out of /etc/os-release
:return: A dictionary of os release properties | [
"Makes",
"a",
"dictionary",
"out",
"of",
"/",
"etc",
"/",
"os",
"-",
"release",
":",
"return",
":",
"A",
"dictionary",
"of",
"os",
"release",
"properties"
] | def get_linux_os_release_properties() -> Optional[Dict[str, str]]:
"""
Makes a dictionary out of /etc/os-release
:return: A dictionary of os release properties
"""
logger.debug('Extracting operating system properties from /etc/os-release')
if not os.path.isfile('/etc/os-release'):
logger... | [
"def",
"get_linux_os_release_properties",
"(",
")",
"->",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"str",
"]",
"]",
":",
"logger",
".",
"debug",
"(",
"'Extracting operating system properties from /etc/os-release'",
")",
"if",
"not",
"os",
".",
"path",
".",
"isf... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/cd/utils/artifact_repository.py#L164-L182 | ||
google/mysql-protobuf | 467cda676afaa49e762c5c9164a43f6ad31a1fbf | protobuf/python/google/protobuf/service.py | python | Service.CallMethod | (self, method_descriptor, rpc_controller,
request, done) | Calls a method of the service specified by method_descriptor.
If "done" is None then the call is blocking and the response
message will be returned directly. Otherwise the call is asynchronous
and "done" will later be called with the response value.
In the blocking case, RpcException will be raised o... | Calls a method of the service specified by method_descriptor. | [
"Calls",
"a",
"method",
"of",
"the",
"service",
"specified",
"by",
"method_descriptor",
"."
] | def CallMethod(self, method_descriptor, rpc_controller,
request, done):
"""Calls a method of the service specified by method_descriptor.
If "done" is None then the call is blocking and the response
message will be returned directly. Otherwise the call is asynchronous
and "done" will l... | [
"def",
"CallMethod",
"(",
"self",
",",
"method_descriptor",
",",
"rpc_controller",
",",
"request",
",",
"done",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/service.py#L65-L91 | ||
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/vision_opencv/image_geometry/src/image_geometry/cameramodels.py | python | PinholeCameraModel.Ty | (self) | return self.P[1,3] | Return the y-translation term of the projection matrix | Return the y-translation term of the projection matrix | [
"Return",
"the",
"y",
"-",
"translation",
"term",
"of",
"the",
"projection",
"matrix"
] | def Ty(self):
""" Return the y-translation term of the projection matrix """
return self.P[1,3] | [
"def",
"Ty",
"(",
"self",
")",
":",
"return",
"self",
".",
"P",
"[",
"1",
",",
"3",
"]"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/vision_opencv/image_geometry/src/image_geometry/cameramodels.py#L247-L249 | |
TimoSaemann/caffe-segnet-cudnn5 | abcf30dca449245e101bf4ced519f716177f0885 | python/caffe/classifier.py | python | Classifier.predict | (self, inputs, oversample=True) | return predictions | Predict classification probabilities of inputs.
Parameters
----------
inputs : iterable of (H x W x K) input ndarrays.
oversample : boolean
average predictions across center, corners, and mirrors
when True (default). Center-only prediction when False.
Re... | Predict classification probabilities of inputs. | [
"Predict",
"classification",
"probabilities",
"of",
"inputs",
"."
] | def predict(self, inputs, oversample=True):
"""
Predict classification probabilities of inputs.
Parameters
----------
inputs : iterable of (H x W x K) input ndarrays.
oversample : boolean
average predictions across center, corners, and mirrors
whe... | [
"def",
"predict",
"(",
"self",
",",
"inputs",
",",
"oversample",
"=",
"True",
")",
":",
"# Scale to standardize input dimensions.",
"input_",
"=",
"np",
".",
"zeros",
"(",
"(",
"len",
"(",
"inputs",
")",
",",
"self",
".",
"image_dims",
"[",
"0",
"]",
","... | https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/python/caffe/classifier.py#L47-L98 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/binder.py | python | _bind_server_parameter_with_storage | (ctxt, ast_param, param) | return ast_param | Bind and validate ServerParameter attributes specific to bound ServerParameters. | Bind and validate ServerParameter attributes specific to bound ServerParameters. | [
"Bind",
"and",
"validate",
"ServerParameter",
"attributes",
"specific",
"to",
"bound",
"ServerParameters",
"."
] | def _bind_server_parameter_with_storage(ctxt, ast_param, param):
# type: (errors.ParserContext, ast.ServerParameter, syntax.ServerParameter) -> ast.ServerParameter
"""Bind and validate ServerParameter attributes specific to bound ServerParameters."""
# Fields specific to specialized and unbound standard pa... | [
"def",
"_bind_server_parameter_with_storage",
"(",
"ctxt",
",",
"ast_param",
",",
"param",
")",
":",
"# type: (errors.ParserContext, ast.ServerParameter, syntax.ServerParameter) -> ast.ServerParameter",
"# Fields specific to specialized and unbound standard params.",
"for",
"field",
"in"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/binder.py#L1290-L1314 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/coverage/coverage/data.py | python | CoverageData.__init__ | (self, debug=None) | Create a CoverageData.
`debug` is a `DebugControl` object for writing debug messages. | Create a CoverageData. | [
"Create",
"a",
"CoverageData",
"."
] | def __init__(self, debug=None):
"""Create a CoverageData.
`debug` is a `DebugControl` object for writing debug messages.
"""
self._debug = debug
# A map from canonical Python source file name to a dictionary in
# which there's an entry for each line number that has bee... | [
"def",
"__init__",
"(",
"self",
",",
"debug",
"=",
"None",
")",
":",
"self",
".",
"_debug",
"=",
"debug",
"# A map from canonical Python source file name to a dictionary in",
"# which there's an entry for each line number that has been",
"# executed:",
"#",
"# { 'filename1.py... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/data.py#L114-L144 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/telemetry/third_party/pyserial/serial/serialcli.py | python | IronSerial.close | (self) | Close port | Close port | [
"Close",
"port"
] | def close(self):
"""Close port"""
if self._isOpen:
if self._port_handle:
try:
self._port_handle.Close()
except System.IO.Ports.InvalidOperationException:
# ignore errors. can happen for unplugged USB serial devices
... | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"self",
".",
"_isOpen",
":",
"if",
"self",
".",
"_port_handle",
":",
"try",
":",
"self",
".",
"_port_handle",
".",
"Close",
"(",
")",
"except",
"System",
".",
"IO",
".",
"Ports",
".",
"InvalidOperationExcept... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/pyserial/serial/serialcli.py#L127-L137 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/DraftVecUtils.py | python | isNull | (vector) | return (x == 0 and y == 0 and z == 0) | Return False if each of the components of the vector is zero.
Due to rounding errors, an element is probably never going to be
exactly zero. Therefore, it rounds the element by the number
of decimals specified in the `precision` parameter
in the parameter database, accessed through `FreeCAD.ParamGet()`... | Return False if each of the components of the vector is zero. | [
"Return",
"False",
"if",
"each",
"of",
"the",
"components",
"of",
"the",
"vector",
"is",
"zero",
"."
] | def isNull(vector):
"""Return False if each of the components of the vector is zero.
Due to rounding errors, an element is probably never going to be
exactly zero. Therefore, it rounds the element by the number
of decimals specified in the `precision` parameter
in the parameter database, accessed t... | [
"def",
"isNull",
"(",
"vector",
")",
":",
"p",
"=",
"precision",
"(",
")",
"x",
"=",
"round",
"(",
"vector",
".",
"x",
",",
"p",
")",
"y",
"=",
"round",
"(",
"vector",
".",
"y",
",",
"p",
")",
"z",
"=",
"round",
"(",
"vector",
".",
"z",
","... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/DraftVecUtils.py#L548-L572 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/instruments/__init__.py | python | get_instrument | (name: str, **kwargs) | Instantiate a named Instrument
Instruments inherit from abins.instruments.instrument.Instrument and
implement models and relationships specific to the corresponding instrument
geometry.
Args:
name: Instrument name as defined in abins.constants.ALL_INSTRUMENTS
kwargs: remaining argument... | Instantiate a named Instrument | [
"Instantiate",
"a",
"named",
"Instrument"
] | def get_instrument(name: str, **kwargs) -> Instrument:
"""Instantiate a named Instrument
Instruments inherit from abins.instruments.instrument.Instrument and
implement models and relationships specific to the corresponding instrument
geometry.
Args:
name: Instrument name as defined in abin... | [
"def",
"get_instrument",
"(",
"name",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"Instrument",
":",
"if",
"name",
".",
"lower",
"(",
")",
"in",
"instruments",
":",
"instrument_factory",
"=",
"instruments",
".",
"get",
"(",
"name",
".",
"lower",
"(... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/instruments/__init__.py#L16-L47 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.