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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NVIDIA/TensorRT | 42805f078052daad1a98bc5965974fcffaad0960 | demo/BERT/helpers/tokenization.py | python | BertTokenizer.convert_ids_to_tokens | (self, ids) | return tokens | Converts a sequence of ids in wordpiece tokens using the vocab. | Converts a sequence of ids in wordpiece tokens using the vocab. | [
"Converts",
"a",
"sequence",
"of",
"ids",
"in",
"wordpiece",
"tokens",
"using",
"the",
"vocab",
"."
] | def convert_ids_to_tokens(self, ids):
"""Converts a sequence of ids in wordpiece tokens using the vocab."""
tokens = []
for i in ids:
tokens.append(self.ids_to_tokens[i])
return tokens | [
"def",
"convert_ids_to_tokens",
"(",
"self",
",",
"ids",
")",
":",
"tokens",
"=",
"[",
"]",
"for",
"i",
"in",
"ids",
":",
"tokens",
".",
"append",
"(",
"self",
".",
"ids_to_tokens",
"[",
"i",
"]",
")",
"return",
"tokens"
] | https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/BERT/helpers/tokenization.py#L208-L213 | |
adventuregamestudio/ags | efa89736d868e9dfda4200149d33ba8637746399 | Common/libsrc/freetype-2.1.3/src/tools/docmaker/tohtml.py | python | HtmlFormatter.make_html_words | ( self, words ) | return line | convert a series of simple words into some HTML text | convert a series of simple words into some HTML text | [
"convert",
"a",
"series",
"of",
"simple",
"words",
"into",
"some",
"HTML",
"text"
] | def make_html_words( self, words ):
""" convert a series of simple words into some HTML text """
line = ""
if words:
line = html_quote( words[0] )
for w in words[1:]:
line = line + " " + html_quote( w )
return line | [
"def",
"make_html_words",
"(",
"self",
",",
"words",
")",
":",
"line",
"=",
"\"\"",
"if",
"words",
":",
"line",
"=",
"html_quote",
"(",
"words",
"[",
"0",
"]",
")",
"for",
"w",
"in",
"words",
"[",
"1",
":",
"]",
":",
"line",
"=",
"line",
"+",
"... | https://github.com/adventuregamestudio/ags/blob/efa89736d868e9dfda4200149d33ba8637746399/Common/libsrc/freetype-2.1.3/src/tools/docmaker/tohtml.py#L156-L164 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/incubate/fleet/parameter_server/ir/trainer_pass.py | python | _get_output_map_from_op | (varmap, op) | return iomap | Returns a dict from op output name to the vars in varmap. | Returns a dict from op output name to the vars in varmap. | [
"Returns",
"a",
"dict",
"from",
"op",
"output",
"name",
"to",
"the",
"vars",
"in",
"varmap",
"."
] | def _get_output_map_from_op(varmap, op):
"""Returns a dict from op output name to the vars in varmap."""
iomap = collections.OrderedDict()
for key in op.output_names:
vars = []
for varname in op.output(key):
if varname == "@EMPTY@":
continue
if "lod_te... | [
"def",
"_get_output_map_from_op",
"(",
"varmap",
",",
"op",
")",
":",
"iomap",
"=",
"collections",
".",
"OrderedDict",
"(",
")",
"for",
"key",
"in",
"op",
".",
"output_names",
":",
"vars",
"=",
"[",
"]",
"for",
"varname",
"in",
"op",
".",
"output",
"("... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/incubate/fleet/parameter_server/ir/trainer_pass.py#L1941-L1956 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_controls.py | python | DatePickerCtrlBase.GetUpperLimit | (*args, **kwargs) | return _controls_.DatePickerCtrlBase_GetUpperLimit(*args, **kwargs) | GetUpperLimit(self) -> DateTime
Get the upper limit of the valid range for the date selection, if any.
If there is no range or there is no upper limit, then the
`wx.DateTime` value returned will be invalid. | GetUpperLimit(self) -> DateTime | [
"GetUpperLimit",
"(",
"self",
")",
"-",
">",
"DateTime"
] | def GetUpperLimit(*args, **kwargs):
"""
GetUpperLimit(self) -> DateTime
Get the upper limit of the valid range for the date selection, if any.
If there is no range or there is no upper limit, then the
`wx.DateTime` value returned will be invalid.
"""
return _cont... | [
"def",
"GetUpperLimit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"DatePickerCtrlBase_GetUpperLimit",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L6486-L6494 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.GetCaretLineVisible | (*args, **kwargs) | return _stc.StyledTextCtrl_GetCaretLineVisible(*args, **kwargs) | GetCaretLineVisible(self) -> bool
Is the background of the line containing the caret in a different colour? | GetCaretLineVisible(self) -> bool | [
"GetCaretLineVisible",
"(",
"self",
")",
"-",
">",
"bool"
] | def GetCaretLineVisible(*args, **kwargs):
"""
GetCaretLineVisible(self) -> bool
Is the background of the line containing the caret in a different colour?
"""
return _stc.StyledTextCtrl_GetCaretLineVisible(*args, **kwargs) | [
"def",
"GetCaretLineVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetCaretLineVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L2987-L2993 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/client/timeline.py | python | _ChromeTraceFormatter.emit_counters | (self, category, name, pid, timestamp, counters) | Emits a counter record for the dictionary 'counters'.
Args:
category: The event category as a string.
name: The event name as a string.
pid: Identifier of the process generating this event as an integer.
timestamp: The timestamp of this event as a long integer.
counters: Dictionary... | Emits a counter record for the dictionary 'counters'. | [
"Emits",
"a",
"counter",
"record",
"for",
"the",
"dictionary",
"counters",
"."
] | def emit_counters(self, category, name, pid, timestamp, counters):
"""Emits a counter record for the dictionary 'counters'.
Args:
category: The event category as a string.
name: The event name as a string.
pid: Identifier of the process generating this event as an integer.
timestamp: ... | [
"def",
"emit_counters",
"(",
"self",
",",
"category",
",",
"name",
",",
"pid",
",",
"timestamp",
",",
"counters",
")",
":",
"event",
"=",
"self",
".",
"_create_event",
"(",
"'C'",
",",
"category",
",",
"name",
",",
"pid",
",",
"0",
",",
"timestamp",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/client/timeline.py#L231-L243 | ||
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/MSVSSettings.py | python | _MovedAndRenamed | (tool, msvs_settings_name, msbuild_tool_name,
msbuild_settings_name, setting_type) | Defines a setting that may have moved to a new section.
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
msvs_settings_name: the MSVS name of the setting.
msbuild_tool_name: the name of the MSBuild tool to place the setting under.
msbuild_settings_name: the MSBuild name... | Defines a setting that may have moved to a new section. | [
"Defines",
"a",
"setting",
"that",
"may",
"have",
"moved",
"to",
"a",
"new",
"section",
"."
] | def _MovedAndRenamed(tool, msvs_settings_name, msbuild_tool_name,
msbuild_settings_name, setting_type):
"""Defines a setting that may have moved to a new section.
Args:
tool: a dictionary that gives the names of the tool for MSVS and MSBuild.
msvs_settings_name: the MSVS name of the se... | [
"def",
"_MovedAndRenamed",
"(",
"tool",
",",
"msvs_settings_name",
",",
"msbuild_tool_name",
",",
"msbuild_settings_name",
",",
"setting_type",
")",
":",
"def",
"_Translate",
"(",
"value",
",",
"msbuild_settings",
")",
":",
"tool_settings",
"=",
"msbuild_settings",
... | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/MSVSSettings.py#L269-L289 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/stc.py | python | StyledTextCtrl.DocLineFromVisible | (*args, **kwargs) | return _stc.StyledTextCtrl_DocLineFromVisible(*args, **kwargs) | DocLineFromVisible(self, int lineDisplay) -> int
Find the document line of a display line taking hidden lines into account. | DocLineFromVisible(self, int lineDisplay) -> int | [
"DocLineFromVisible",
"(",
"self",
"int",
"lineDisplay",
")",
"-",
">",
"int"
] | def DocLineFromVisible(*args, **kwargs):
"""
DocLineFromVisible(self, int lineDisplay) -> int
Find the document line of a display line taking hidden lines into account.
"""
return _stc.StyledTextCtrl_DocLineFromVisible(*args, **kwargs) | [
"def",
"DocLineFromVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_DocLineFromVisible",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3880-L3886 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/base.py | python | c2pyerror | (err_msg) | return out_msg, err_type | Translate C API error message to python style.
Parameters
----------
err_msg : str
The error message.
Returns
-------
new_msg : str
Translated message.
err_type : str
Detected error type. | Translate C API error message to python style. | [
"Translate",
"C",
"API",
"error",
"message",
"to",
"python",
"style",
"."
] | def c2pyerror(err_msg):
"""Translate C API error message to python style.
Parameters
----------
err_msg : str
The error message.
Returns
-------
new_msg : str
Translated message.
err_type : str
Detected error type.
"""
arr = err_msg.split("\n")
if a... | [
"def",
"c2pyerror",
"(",
"err_msg",
")",
":",
"arr",
"=",
"err_msg",
".",
"split",
"(",
"\"\\n\"",
")",
"if",
"arr",
"[",
"-",
"1",
"]",
"==",
"\"\"",
":",
"arr",
".",
"pop",
"(",
")",
"err_type",
"=",
"_find_error_type",
"(",
"arr",
"[",
"0",
"]... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/base.py#L166-L205 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/bayesflow/python/ops/stochastic_gradient_estimators.py | python | get_score_function_with_advantage | (advantage_fn=None,
name="ScoreFunctionWithAdvantage") | return score_function_with_advantage | Score function estimator with advantage function.
Args:
advantage_fn: callable that takes the `StochasticTensor` and the
downstream `loss` and returns a `Tensor` advantage
(e.g. `loss - baseline`).
name: name to prepend ops with.
Returns:
Callable score function estimator that takes the `S... | Score function estimator with advantage function. | [
"Score",
"function",
"estimator",
"with",
"advantage",
"function",
"."
] | def get_score_function_with_advantage(advantage_fn=None,
name="ScoreFunctionWithAdvantage"):
"""Score function estimator with advantage function.
Args:
advantage_fn: callable that takes the `StochasticTensor` and the
downstream `loss` and returns a `Tensor` advantage... | [
"def",
"get_score_function_with_advantage",
"(",
"advantage_fn",
"=",
"None",
",",
"name",
"=",
"\"ScoreFunctionWithAdvantage\"",
")",
":",
"def",
"score_function_with_advantage",
"(",
"stochastic_tensor",
",",
"value",
",",
"loss",
")",
":",
"with",
"ops",
".",
"na... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/bayesflow/python/ops/stochastic_gradient_estimators.py#L102-L123 | |
p4lang/PI | 38d87e81253feff9fff0660d662c885be78fb719 | proto/ptf/ptf_runner.py | python | run_test | (config_path, p4info_path, grpc_addr, device_id,
ptfdir, port_map_path, extra_args=[]) | return p.returncode == 0 | Runs PTF tests included in provided directory.
Device must be running and configfured with appropriate P4 program. | Runs PTF tests included in provided directory.
Device must be running and configfured with appropriate P4 program. | [
"Runs",
"PTF",
"tests",
"included",
"in",
"provided",
"directory",
".",
"Device",
"must",
"be",
"running",
"and",
"configfured",
"with",
"appropriate",
"P4",
"program",
"."
] | def run_test(config_path, p4info_path, grpc_addr, device_id,
ptfdir, port_map_path, extra_args=[]):
'''
Runs PTF tests included in provided directory.
Device must be running and configfured with appropriate P4 program.
'''
# TODO: check schema?
# "p4_port" is ignored for now, we ass... | [
"def",
"run_test",
"(",
"config_path",
",",
"p4info_path",
",",
"grpc_addr",
",",
"device_id",
",",
"ptfdir",
",",
"port_map_path",
",",
"extra_args",
"=",
"[",
"]",
")",
":",
"# TODO: check schema?",
"# \"p4_port\" is ignored for now, we assume that ports are provided by... | https://github.com/p4lang/PI/blob/38d87e81253feff9fff0660d662c885be78fb719/proto/ptf/ptf_runner.py#L90-L138 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/platform/benchmark.py | python | TensorFlowBenchmark.run_op_benchmark | (self,
sess,
op_or_tensor,
feed_dict=None,
burn_iters=2,
min_iters=10,
store_trace=False,
name=None,
extras=None) | return benchmark_values | Run an op or tensor in the given session. Report the results.
Args:
sess: `Session` object to use for timing.
op_or_tensor: `Operation` or `Tensor` to benchmark.
feed_dict: A `dict` of values to feed for each op iteration (see the
`feed_dict` parameter of `Session.run`).
burn_iters... | Run an op or tensor in the given session. Report the results. | [
"Run",
"an",
"op",
"or",
"tensor",
"in",
"the",
"given",
"session",
".",
"Report",
"the",
"results",
"."
] | def run_op_benchmark(self,
sess,
op_or_tensor,
feed_dict=None,
burn_iters=2,
min_iters=10,
store_trace=False,
name=None,
extras=None):
... | [
"def",
"run_op_benchmark",
"(",
"self",
",",
"sess",
",",
"op_or_tensor",
",",
"feed_dict",
"=",
"None",
",",
"burn_iters",
"=",
"2",
",",
"min_iters",
"=",
"10",
",",
"store_trace",
"=",
"False",
",",
"name",
"=",
"None",
",",
"extras",
"=",
"None",
"... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/platform/benchmark.py#L196-L264 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/copy.py | python | _keep_alive | (x, memo) | Keeps a reference to the object x in the memo.
Because we remember objects by their id, we have
to assure that possibly temporary objects are kept
alive by referencing them.
We store a reference at the id of the memo, which should
normally not be used unless someone tries to deepcopy
the memo i... | Keeps a reference to the object x in the memo. | [
"Keeps",
"a",
"reference",
"to",
"the",
"object",
"x",
"in",
"the",
"memo",
"."
] | def _keep_alive(x, memo):
"""Keeps a reference to the object x in the memo.
Because we remember objects by their id, we have
to assure that possibly temporary objects are kept
alive by referencing them.
We store a reference at the id of the memo, which should
normally not be used unless someone... | [
"def",
"_keep_alive",
"(",
"x",
",",
"memo",
")",
":",
"try",
":",
"memo",
"[",
"id",
"(",
"memo",
")",
"]",
".",
"append",
"(",
"x",
")",
"except",
"KeyError",
":",
"# aha, this is the first one :-)",
"memo",
"[",
"id",
"(",
"memo",
")",
"]",
"=",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/copy.py#L267-L281 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | dom/bindings/parser/WebIDL.py | python | Parser.p_TypeSuffixBrackets | (self, p) | TypeSuffix : LBRACKET RBRACKET TypeSuffix | TypeSuffix : LBRACKET RBRACKET TypeSuffix | [
"TypeSuffix",
":",
"LBRACKET",
"RBRACKET",
"TypeSuffix"
] | def p_TypeSuffixBrackets(self, p):
"""
TypeSuffix : LBRACKET RBRACKET TypeSuffix
"""
p[0] = [(IDLMethod.TypeSuffixModifier.Brackets, self.getLocation(p, 1))]
p[0].extend(p[3]) | [
"def",
"p_TypeSuffixBrackets",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"[",
"(",
"IDLMethod",
".",
"TypeSuffixModifier",
".",
"Brackets",
",",
"self",
".",
"getLocation",
"(",
"p",
",",
"1",
")",
")",
"]",
"p",
"[",
"0",
"]",
".... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/parser/WebIDL.py#L5421-L5426 | ||
thunil/tempoGAN | a9b92181e28a82c2029049791f875a6c1341d62b | tensorflow/tools/fluiddataloader.py | python | FluidDataLoader.collectFilenamesFromDir | (self, list_index) | Build filename list from single dir
list_index: number in index list (or alternatively label list) | Build filename list from single dir
list_index: number in index list (or alternatively label list) | [
"Build",
"filename",
"list",
"from",
"single",
"dir",
"list_index",
":",
"number",
"in",
"index",
"list",
"(",
"or",
"alternatively",
"label",
"list",
")"
] | def collectFilenamesFromDir(self, list_index):
""" Build filename list from single dir
list_index: number in index list (or alternatively label list)
"""
sim_index = self.indices[list_index] # get simulation directory index from list
labelstr = "" # debug info only
foundCnt = 0
if self.wildcard is not... | [
"def",
"collectFilenamesFromDir",
"(",
"self",
",",
"list_index",
")",
":",
"sim_index",
"=",
"self",
".",
"indices",
"[",
"list_index",
"]",
"# get simulation directory index from list",
"labelstr",
"=",
"\"\"",
"# debug info only",
"foundCnt",
"=",
"0",
"if",
"sel... | https://github.com/thunil/tempoGAN/blob/a9b92181e28a82c2029049791f875a6c1341d62b/tensorflow/tools/fluiddataloader.py#L165-L251 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/pydoc.py | python | pathdirs | () | return dirs | Convert sys.path into a list of absolute, existing, unique paths. | Convert sys.path into a list of absolute, existing, unique paths. | [
"Convert",
"sys",
".",
"path",
"into",
"a",
"list",
"of",
"absolute",
"existing",
"unique",
"paths",
"."
] | def pathdirs():
"""Convert sys.path into a list of absolute, existing, unique paths."""
dirs = []
normdirs = []
for dir in sys.path:
dir = os.path.abspath(dir or '.')
normdir = os.path.normcase(dir)
if normdir not in normdirs and os.path.isdir(dir):
dirs.append(dir)
... | [
"def",
"pathdirs",
"(",
")",
":",
"dirs",
"=",
"[",
"]",
"normdirs",
"=",
"[",
"]",
"for",
"dir",
"in",
"sys",
".",
"path",
":",
"dir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"dir",
"or",
"'.'",
")",
"normdir",
"=",
"os",
".",
"path",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pydoc.py#L81-L91 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/genpy/src/genpy/rostime.py | python | Time.__init__ | (self, secs=0, nsecs=0) | Constructor: secs and nsecs are integers. You may prefer to use the static L{from_sec()} factory
method instead.
:param secs: seconds since epoch, ``int``
:param nsecs: nanoseconds since seconds (since epoch), ``int`` | Constructor: secs and nsecs are integers. You may prefer to use the static L{from_sec()} factory
method instead.
:param secs: seconds since epoch, ``int``
:param nsecs: nanoseconds since seconds (since epoch), ``int`` | [
"Constructor",
":",
"secs",
"and",
"nsecs",
"are",
"integers",
".",
"You",
"may",
"prefer",
"to",
"use",
"the",
"static",
"L",
"{",
"from_sec",
"()",
"}",
"factory",
"method",
"instead",
".",
":",
"param",
"secs",
":",
"seconds",
"since",
"epoch",
"int",... | def __init__(self, secs=0, nsecs=0):
"""
Constructor: secs and nsecs are integers. You may prefer to use the static L{from_sec()} factory
method instead.
:param secs: seconds since epoch, ``int``
:param nsecs: nanoseconds since seconds (since epoch), ``int``
"""
... | [
"def",
"__init__",
"(",
"self",
",",
"secs",
"=",
"0",
",",
"nsecs",
"=",
"0",
")",
":",
"super",
"(",
"Time",
",",
"self",
")",
".",
"__init__",
"(",
"secs",
",",
"nsecs",
")",
"if",
"self",
".",
"secs",
"<",
"0",
":",
"raise",
"TypeError",
"(... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genpy/src/genpy/rostime.py#L195-L205 | ||
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/bindings/python/clang/cindex.py | python | Cursor.referenced | (self) | return self._referenced | For a cursor that is a reference, returns a cursor
representing the entity that it references. | For a cursor that is a reference, returns a cursor
representing the entity that it references. | [
"For",
"a",
"cursor",
"that",
"is",
"a",
"reference",
"returns",
"a",
"cursor",
"representing",
"the",
"entity",
"that",
"it",
"references",
"."
] | def referenced(self):
"""
For a cursor that is a reference, returns a cursor
representing the entity that it references.
"""
if not hasattr(self, '_referenced'):
self._referenced = conf.lib.clang_getCursorReferenced(self)
return self._referenced | [
"def",
"referenced",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_referenced'",
")",
":",
"self",
".",
"_referenced",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorReferenced",
"(",
"self",
")",
"return",
"self",
".",
"_referenced"
] | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/bindings/python/clang/cindex.py#L1780-L1788 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | VarScrollHelperBase.RefreshAll | (*args, **kwargs) | return _windows_.VarScrollHelperBase_RefreshAll(*args, **kwargs) | RefreshAll(self) | RefreshAll(self) | [
"RefreshAll",
"(",
"self",
")"
] | def RefreshAll(*args, **kwargs):
"""RefreshAll(self)"""
return _windows_.VarScrollHelperBase_RefreshAll(*args, **kwargs) | [
"def",
"RefreshAll",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"VarScrollHelperBase_RefreshAll",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L2214-L2216 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/abins/io.py | python | IO.get_previous_ab_initio_program | (self) | return self.load(list_of_attributes=["ab_initio_program"])["attributes"]["ab_initio_program"] | :returns: name of ab initio program which was used in the previous calculation. | :returns: name of ab initio program which was used in the previous calculation. | [
":",
"returns",
":",
"name",
"of",
"ab",
"initio",
"program",
"which",
"was",
"used",
"in",
"the",
"previous",
"calculation",
"."
] | def get_previous_ab_initio_program(self):
"""
:returns: name of ab initio program which was used in the previous calculation.
"""
return self.load(list_of_attributes=["ab_initio_program"])["attributes"]["ab_initio_program"] | [
"def",
"get_previous_ab_initio_program",
"(",
"self",
")",
":",
"return",
"self",
".",
"load",
"(",
"list_of_attributes",
"=",
"[",
"\"ab_initio_program\"",
"]",
")",
"[",
"\"attributes\"",
"]",
"[",
"\"ab_initio_program\"",
"]"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/abins/io.py#L137-L141 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.HighlightAll | (self, on=True) | Highlights/unhighlights all the lines in :class:`UltimateListCtrl`.
:param `on`: ``True`` to highlight all the lines, ``False`` to unhighlight them. | Highlights/unhighlights all the lines in :class:`UltimateListCtrl`. | [
"Highlights",
"/",
"unhighlights",
"all",
"the",
"lines",
"in",
":",
"class",
":",
"UltimateListCtrl",
"."
] | def HighlightAll(self, on=True):
"""
Highlights/unhighlights all the lines in :class:`UltimateListCtrl`.
:param `on`: ``True`` to highlight all the lines, ``False`` to unhighlight them.
"""
if self.IsSingleSel():
if on:
raise Exception("can't do thi... | [
"def",
"HighlightAll",
"(",
"self",
",",
"on",
"=",
"True",
")",
":",
"if",
"self",
".",
"IsSingleSel",
"(",
")",
":",
"if",
"on",
":",
"raise",
"Exception",
"(",
"\"can't do this in a single sel control\"",
")",
"# we just have one item to turn off",
"if",
"sel... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L7259-L7278 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/textwrap.py | python | wrap | (text, width=70, **kwargs) | return w.wrap(text) | Wrap a single paragraph of text, returning a list of wrapped lines.
Reformat the single paragraph in 'text' so it fits in lines of no
more than 'width' columns, and return a list of wrapped lines. By
default, tabs in 'text' are expanded with string.expandtabs(), and
all other whitespace characters (in... | Wrap a single paragraph of text, returning a list of wrapped lines. | [
"Wrap",
"a",
"single",
"paragraph",
"of",
"text",
"returning",
"a",
"list",
"of",
"wrapped",
"lines",
"."
] | def wrap(text, width=70, **kwargs):
"""Wrap a single paragraph of text, returning a list of wrapped lines.
Reformat the single paragraph in 'text' so it fits in lines of no
more than 'width' columns, and return a list of wrapped lines. By
default, tabs in 'text' are expanded with string.expandtabs(), ... | [
"def",
"wrap",
"(",
"text",
",",
"width",
"=",
"70",
",",
"*",
"*",
"kwargs",
")",
":",
"w",
"=",
"TextWrapper",
"(",
"width",
"=",
"width",
",",
"*",
"*",
"kwargs",
")",
"return",
"w",
".",
"wrap",
"(",
"text",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/textwrap.py#L343-L354 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/socks.py | python | SOCKSConnection._new_conn | (self) | return conn | Establish a new connection via the SOCKS proxy. | [] | def _new_conn(self):
"""
Establish a new connection via the SOCKS proxy.
"""
extra_kw = {}
if self.source_address:
extra_kw["source_address"] = self.source_address
if self.socket_options:
extra_kw["socket_options"] = self.socket_options
... | [
"def",
"_new_conn",
"(",
"self",
")",
":",
"extra_kw",
"=",
"{",
"}",
"if",
"self",
".",
"source_address",
":",
"extra_kw",
"[",
"\"source_address\"",
"]",
"=",
"self",
".",
"source_address",
"if",
"self",
".",
"socket_options",
":",
"extra_kw",
"[",
"\"so... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/socks.py#L167-L279 | ||
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_parser.py | python | p_tterm_term_colon_symbol | (p) | tterm : tapp COLON atype | tterm : tapp COLON atype | [
"tterm",
":",
"tapp",
"COLON",
"atype"
] | def p_tterm_term_colon_symbol(p):
'tterm : tapp COLON atype'
p[0] = p[1]
p[0].sort = p[3] | [
"def",
"p_tterm_term_colon_symbol",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]",
"p",
"[",
"0",
"]",
".",
"sort",
"=",
"p",
"[",
"3",
"]"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_parser.py#L1424-L1427 | ||
ukoethe/vigra | 093d57d15c8c237adf1704d96daa6393158ce299 | vigranumpy/lib/arraytypes.py | python | VigraArray.take | (self, indices, axis=None, out=None, mode='raise') | The array is always transposed to 'C' order before flattening.
The 'axis' parameter can be an int (axis position) or string (axis key). | The array is always transposed to 'C' order before flattening.
The 'axis' parameter can be an int (axis position) or string (axis key). | [
"The",
"array",
"is",
"always",
"transposed",
"to",
"C",
"order",
"before",
"flattening",
".",
"The",
"axis",
"parameter",
"can",
"be",
"an",
"int",
"(",
"axis",
"position",
")",
"or",
"string",
"(",
"axis",
"key",
")",
"."
] | def take(self, indices, axis=None, out=None, mode='raise'):
'''
The array is always transposed to 'C' order before flattening.
The 'axis' parameter can be an int (axis position) or string (axis key).
'''
if type(axis) == str:
axis = self.axistags.index(axis)
i... | [
"def",
"take",
"(",
"self",
",",
"indices",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
",",
"mode",
"=",
"'raise'",
")",
":",
"if",
"type",
"(",
"axis",
")",
"==",
"str",
":",
"axis",
"=",
"self",
".",
"axistags",
".",
"index",
"(",
"ax... | https://github.com/ukoethe/vigra/blob/093d57d15c8c237adf1704d96daa6393158ce299/vigranumpy/lib/arraytypes.py#L1558-L1568 | ||
SpenceKonde/megaTinyCore | 1c4a70b18a149fe6bcb551dfa6db11ca50b8997b | megaavr/tools/libs/serial/serialwin32.py | python | Serial.reset_output_buffer | (self) | \
Clear output buffer, aborting the current output and discarding all
that is in the buffer. | \
Clear output buffer, aborting the current output and discarding all
that is in the buffer. | [
"\\",
"Clear",
"output",
"buffer",
"aborting",
"the",
"current",
"output",
"and",
"discarding",
"all",
"that",
"is",
"in",
"the",
"buffer",
"."
] | def reset_output_buffer(self):
"""\
Clear output buffer, aborting the current output and discarding all
that is in the buffer.
"""
if not self.is_open:
raise portNotOpenError
win32.PurgeComm(self._port_handle, win32.PURGE_TXCLEAR | win32.PURGE_TXABORT) | [
"def",
"reset_output_buffer",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"is_open",
":",
"raise",
"portNotOpenError",
"win32",
".",
"PurgeComm",
"(",
"self",
".",
"_port_handle",
",",
"win32",
".",
"PURGE_TXCLEAR",
"|",
"win32",
".",
"PURGE_TXABORT",
"... | https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/serialwin32.py#L355-L362 | ||
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | tools/sampcd_processor.py | python | get_filenames | (full_test=False) | return all_sample_code_filenames | this function will get the sample code files that pending for check.
Args:
full_test: the full apis or the increment
Returns:
dict: the sample code files pending for check . | this function will get the sample code files that pending for check. | [
"this",
"function",
"will",
"get",
"the",
"sample",
"code",
"files",
"that",
"pending",
"for",
"check",
"."
] | def get_filenames(full_test=False):
'''
this function will get the sample code files that pending for check.
Args:
full_test: the full apis or the increment
Returns:
dict: the sample code files pending for check .
'''
global whl_error
import paddle
import paddle.fluid... | [
"def",
"get_filenames",
"(",
"full_test",
"=",
"False",
")",
":",
"global",
"whl_error",
"import",
"paddle",
"import",
"paddle",
".",
"fluid",
".",
"contrib",
".",
"slim",
".",
"quantization",
"whl_error",
"=",
"[",
"]",
"if",
"full_test",
":",
"get_full_api... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/tools/sampcd_processor.py#L429-L467 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.StyleGetBold | (*args, **kwargs) | return _stc.StyledTextCtrl_StyleGetBold(*args, **kwargs) | StyleGetBold(self, int style) -> bool
Get is a style bold or not. | StyleGetBold(self, int style) -> bool | [
"StyleGetBold",
"(",
"self",
"int",
"style",
")",
"-",
">",
"bool"
] | def StyleGetBold(*args, **kwargs):
"""
StyleGetBold(self, int style) -> bool
Get is a style bold or not.
"""
return _stc.StyledTextCtrl_StyleGetBold(*args, **kwargs) | [
"def",
"StyleGetBold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_StyleGetBold",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L2602-L2608 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/numbers.py | python | Real.__divmod__ | (self, other) | return (self // other, self % other) | divmod(self, other): The pair (self // other, self % other).
Sometimes this can be computed faster than the pair of
operations. | divmod(self, other): The pair (self // other, self % other). | [
"divmod",
"(",
"self",
"other",
")",
":",
"The",
"pair",
"(",
"self",
"//",
"other",
"self",
"%",
"other",
")",
"."
] | def __divmod__(self, other):
"""divmod(self, other): The pair (self // other, self % other).
Sometimes this can be computed faster than the pair of
operations.
"""
return (self // other, self % other) | [
"def",
"__divmod__",
"(",
"self",
",",
"other",
")",
":",
"return",
"(",
"self",
"//",
"other",
",",
"self",
"%",
"other",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/numbers.py#L200-L206 | |
netket/netket | 0d534e54ecbf25b677ea72af6b85947979420652 | netket/nn/fast_masked_linear.py | python | FastMaskedConv1D.update_site | (self, inputs: Array, index: int) | return y_i | Adds an input site into the cache, and applies the masked convolution to the cache.
Args:
inputs: an input site to be added into the cache with dimensions (batch, features).
index: the index of the output site. The index of the input site should be `index - self.exclusive`.
Returns... | Adds an input site into the cache, and applies the masked convolution to the cache. | [
"Adds",
"an",
"input",
"site",
"into",
"the",
"cache",
"and",
"applies",
"the",
"masked",
"convolution",
"to",
"the",
"cache",
"."
] | def update_site(self, inputs: Array, index: int) -> Array:
"""
Adds an input site into the cache, and applies the masked convolution to the cache.
Args:
inputs: an input site to be added into the cache with dimensions (batch, features).
index: the index of the output site. T... | [
"def",
"update_site",
"(",
"self",
",",
"inputs",
":",
"Array",
",",
"index",
":",
"int",
")",
"->",
"Array",
":",
"dtype",
"=",
"jnp",
".",
"promote_types",
"(",
"inputs",
".",
"dtype",
",",
"self",
".",
"dtype",
")",
"inputs",
"=",
"jnp",
".",
"a... | https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/nn/fast_masked_linear.py#L194-L282 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/distribute_coordinator.py | python | _run_single_worker | (worker_fn,
strategy,
cluster_spec,
task_type,
task_id,
session_config,
rpc_layer="",
worker_barrier=None,
coord=None) | Runs a single worker by calling `worker_fn` under context. | Runs a single worker by calling `worker_fn` under context. | [
"Runs",
"a",
"single",
"worker",
"by",
"calling",
"worker_fn",
"under",
"context",
"."
] | def _run_single_worker(worker_fn,
strategy,
cluster_spec,
task_type,
task_id,
session_config,
rpc_layer="",
worker_barrier=None,
coord=N... | [
"def",
"_run_single_worker",
"(",
"worker_fn",
",",
"strategy",
",",
"cluster_spec",
",",
"task_type",
",",
"task_id",
",",
"session_config",
",",
"rpc_layer",
"=",
"\"\"",
",",
"worker_barrier",
"=",
"None",
",",
"coord",
"=",
"None",
")",
":",
"session_confi... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/distribute_coordinator.py#L322-L356 | ||
eric612/MobileNet-YOLO | 69b4441cb3ec8d553fbdef788ad033e246f901bd | examples/ssd/ssd_detect.py | python | parse_args | () | return parser.parse_args() | parse args | parse args | [
"parse",
"args"
] | def parse_args():
'''parse args'''
parser = argparse.ArgumentParser()
parser.add_argument('--gpu_id', type=int, default=0, help='gpu id')
parser.add_argument('--labelmap_file',
default='data/VOC0712/labelmap_voc.prototxt')
parser.add_argument('--model_def',
... | [
"def",
"parse_args",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'--gpu_id'",
",",
"type",
"=",
"int",
",",
"default",
"=",
"0",
",",
"help",
"=",
"'gpu id'",
")",
"parser",
".",
"add_... | https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/examples/ssd/ssd_detect.py#L133-L146 | |
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | grc/core/generator/FlowGraphProxy.py | python | FlowGraphProxy.get_hier_block_io | (self, direction) | return ports | Get a list of io ports for this flow graph.
Args:
direction: a string of 'in' or 'out'
Returns:
a list of dicts with: type, label, vlen, size, optional | Get a list of io ports for this flow graph. | [
"Get",
"a",
"list",
"of",
"io",
"ports",
"for",
"this",
"flow",
"graph",
"."
] | def get_hier_block_io(self, direction):
"""
Get a list of io ports for this flow graph.
Args:
direction: a string of 'in' or 'out'
Returns:
a list of dicts with: type, label, vlen, size, optional
"""
pads = self.get_pad_sources() if direction in ... | [
"def",
"get_hier_block_io",
"(",
"self",
",",
"direction",
")",
":",
"pads",
"=",
"self",
".",
"get_pad_sources",
"(",
")",
"if",
"direction",
"in",
"(",
"'sink'",
",",
"'in'",
")",
"else",
"self",
".",
"get_pad_sinks",
"(",
")",
"if",
"direction",
"in",... | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/generator/FlowGraphProxy.py#L44-L75 | |
domino-team/openwrt-cc | 8b181297c34d14d3ca521cc9f31430d561dbc688 | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | _AddPrefix | (element, prefix) | Add |prefix| to |element| or each subelement if element is iterable. | Add |prefix| to |element| or each subelement if element is iterable. | [
"Add",
"|prefix|",
"to",
"|element|",
"or",
"each",
"subelement",
"if",
"element",
"is",
"iterable",
"."
] | def _AddPrefix(element, prefix):
"""Add |prefix| to |element| or each subelement if element is iterable."""
if element is None:
return element
# Note, not Iterable because we don't want to handle strings like that.
if isinstance(element, list) or isinstance(element, tuple):
return [prefix + e for e in e... | [
"def",
"_AddPrefix",
"(",
"element",
",",
"prefix",
")",
":",
"if",
"element",
"is",
"None",
":",
"return",
"element",
"# Note, not Iterable because we don't want to handle strings like that.",
"if",
"isinstance",
"(",
"element",
",",
"list",
")",
"or",
"isinstance",
... | https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L79-L87 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/polynomial/legendre.py | python | legder | (c, m=1, scl=1, axis=0) | return c | Differentiate a Legendre series.
Returns the Legendre series coefficients `c` differentiated `m` times
along `axis`. At each iteration the result is multiplied by `scl` (the
scaling factor is for use in a linear change of variable). The argument
`c` is an array of coefficients from low to high degree ... | Differentiate a Legendre series. | [
"Differentiate",
"a",
"Legendre",
"series",
"."
] | def legder(c, m=1, scl=1, axis=0):
"""
Differentiate a Legendre series.
Returns the Legendre series coefficients `c` differentiated `m` times
along `axis`. At each iteration the result is multiplied by `scl` (the
scaling factor is for use in a linear change of variable). The argument
`c` is an... | [
"def",
"legder",
"(",
"c",
",",
"m",
"=",
"1",
",",
"scl",
"=",
"1",
",",
"axis",
"=",
"0",
")",
":",
"c",
"=",
"np",
".",
"array",
"(",
"c",
",",
"ndmin",
"=",
"1",
",",
"copy",
"=",
"True",
")",
"if",
"c",
".",
"dtype",
".",
"char",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/legendre.py#L612-L701 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/AlignAndFocusPowderFromFiles.py | python | AlignAndFocusPowderFromFiles.__loadCacheFile | (self, filename, wkspname) | return True | @returns True if a file was loaded | [] | def __loadCacheFile(self, filename, wkspname):
'''@returns True if a file was loaded'''
if os.path.exists(filename):
self.log().notice('Loading cache from {}'.format(filename))
else:
return False
LoadNexusProcessed(Filename=filename, OutputWorkspace=wkspname)
... | [
"def",
"__loadCacheFile",
"(",
"self",
",",
"filename",
",",
"wkspname",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"self",
".",
"log",
"(",
")",
".",
"notice",
"(",
"'Loading cache from {}'",
".",
"format",
"(",
"file... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/AlignAndFocusPowderFromFiles.py#L620-L643 | ||
gemrb/gemrb | 730206eed8d1dd358ca5e69a62f9e099aa22ffc6 | gemrb/GUIScripts/pst/GUIOPT.py | python | OpenAudioOptionsWindow | () | Open audio options window | Open audio options window | [
"Open",
"audio",
"options",
"window"
] | def OpenAudioOptionsWindow ():
"""Open audio options window"""
global AudioHelpText
Window = GemRB.LoadWindow (5, "GUIOPT")
def OnClose(Window):
global AudioHelpText
# Restore values in case of cancel
if GemRB.GetVar ("Cancel") == 1:
for k, v in list(saved_audio_options.items ()):
GemRB.SetVar (k, v)... | [
"def",
"OpenAudioOptionsWindow",
"(",
")",
":",
"global",
"AudioHelpText",
"Window",
"=",
"GemRB",
".",
"LoadWindow",
"(",
"5",
",",
"\"GUIOPT\"",
")",
"def",
"OnClose",
"(",
"Window",
")",
":",
"global",
"AudioHelpText",
"# Restore values in case of cancel",
"if"... | https://github.com/gemrb/gemrb/blob/730206eed8d1dd358ca5e69a62f9e099aa22ffc6/gemrb/GUIScripts/pst/GUIOPT.py#L136-L175 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/filters.py | python | do_list | (value) | return list(value) | Convert the value into a list. If it was a string the returned list
will be a list of characters. | Convert the value into a list. If it was a string the returned list
will be a list of characters. | [
"Convert",
"the",
"value",
"into",
"a",
"list",
".",
"If",
"it",
"was",
"a",
"string",
"the",
"returned",
"list",
"will",
"be",
"a",
"list",
"of",
"characters",
"."
] | def do_list(value):
"""Convert the value into a list. If it was a string the returned list
will be a list of characters.
"""
return list(value) | [
"def",
"do_list",
"(",
"value",
")",
":",
"return",
"list",
"(",
"value",
")"
] | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/filters.py#L876-L880 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/tokenizer.py | python | Tokenizer.unget | (self, token) | Unget a token.
The unget buffer for tokens is only one token large; it is
an error to try to unget a token when the unget buffer is not
empty.
@param token: the token to unget
@type token: Token object
@raises UngetBufferFull: there is already an ungotten token | Unget a token. | [
"Unget",
"a",
"token",
"."
] | def unget(self, token):
"""Unget a token.
The unget buffer for tokens is only one token large; it is
an error to try to unget a token when the unget buffer is not
empty.
@param token: the token to unget
@type token: Token object
@raises UngetBufferFull: there is... | [
"def",
"unget",
"(",
"self",
",",
"token",
")",
":",
"if",
"not",
"self",
".",
"ungotten_token",
"is",
"None",
":",
"raise",
"UngetBufferFull",
"self",
".",
"ungotten_token",
"=",
"token"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/tokenizer.py#L406-L420 | ||
OpenGenus/quark | 225ad96efdfcc66cb6584a756c17eb3871e6eb62 | code/code/data_structures/src/hashs/bloom_filter/bloom_filter.py | python | bloomFilter.__contains__ | (self, value) | return True | Determine whether a value is present. A false positive might be returned even if the element is
not present. However, a false negative will never be returned. | Determine whether a value is present. A false positive might be returned even if the element is
not present. However, a false negative will never be returned. | [
"Determine",
"whether",
"a",
"value",
"is",
"present",
".",
"A",
"false",
"positive",
"might",
"be",
"returned",
"even",
"if",
"the",
"element",
"is",
"not",
"present",
".",
"However",
"a",
"false",
"negative",
"will",
"never",
"be",
"returned",
"."
] | def __contains__(self, value):
"""
Determine whether a value is present. A false positive might be returned even if the element is
not present. However, a false negative will never be returned.
"""
for hf in self.hashFunctions:
if self.bits & 1 << hf(value, self.M) ==... | [
"def",
"__contains__",
"(",
"self",
",",
"value",
")",
":",
"for",
"hf",
"in",
"self",
".",
"hashFunctions",
":",
"if",
"self",
".",
"bits",
"&",
"1",
"<<",
"hf",
"(",
"value",
",",
"self",
".",
"M",
")",
"==",
"0",
":",
"return",
"False",
"retur... | https://github.com/OpenGenus/quark/blob/225ad96efdfcc66cb6584a756c17eb3871e6eb62/code/code/data_structures/src/hashs/bloom_filter/bloom_filter.py#L25-L33 | |
nasa/trick | 7b85aa66329d62fe8816462627c09a353aac8299 | share/trick/trickops/WorkflowCommon.py | python | tprint | (line, color='ENDC', verbosity='INFO') | Utility method for writing text to both the log and stdout, with optional
color for stdout
Parameters
----------
line : str
Line of string to both print and log
color : str
Color/style of text. Options are listed in Colorstr() class. | Utility method for writing text to both the log and stdout, with optional
color for stdout | [
"Utility",
"method",
"for",
"writing",
"text",
"to",
"both",
"the",
"log",
"and",
"stdout",
"with",
"optional",
"color",
"for",
"stdout"
] | def tprint(line, color='ENDC', verbosity='INFO'):
"""
Utility method for writing text to both the log and stdout, with optional
color for stdout
Parameters
----------
line : str
Line of string to both print and log
color : str
Color/style of text. Options are listed in Color... | [
"def",
"tprint",
"(",
"line",
",",
"color",
"=",
"'ENDC'",
",",
"verbosity",
"=",
"'INFO'",
")",
":",
"colorLine",
"=",
"printer",
".",
"colorstr",
"(",
"line",
",",
"color",
")",
"sys",
".",
"stdout",
".",
"write",
"(",
"colorLine",
"+",
"\"\\n\"",
... | https://github.com/nasa/trick/blob/7b85aa66329d62fe8816462627c09a353aac8299/share/trick/trickops/WorkflowCommon.py#L85-L108 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/third_party/depot_tools/cpplint.py | python | _IncludeState.FindHeader | (self, header) | return -1 | Check if a header has already been included.
Args:
header: header to check.
Returns:
Line number of previous occurrence, or -1 if the header has not
been seen before. | Check if a header has already been included. | [
"Check",
"if",
"a",
"header",
"has",
"already",
"been",
"included",
"."
] | def FindHeader(self, header):
"""Check if a header has already been included.
Args:
header: header to check.
Returns:
Line number of previous occurrence, or -1 if the header has not
been seen before.
"""
for section_list in self.include_list:
for f in section_list:
i... | [
"def",
"FindHeader",
"(",
"self",
",",
"header",
")",
":",
"for",
"section_list",
"in",
"self",
".",
"include_list",
":",
"for",
"f",
"in",
"section_list",
":",
"if",
"f",
"[",
"0",
"]",
"==",
"header",
":",
"return",
"f",
"[",
"1",
"]",
"return",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/depot_tools/cpplint.py#L701-L714 | |
neoml-lib/neoml | a0d370fba05269a1b2258cef126f77bbd2054a3e | NeoML/Python/neoml/Dnn/MultichannelLookup.py | python | MultichannelLookup.set_embeddings | (self, index, blob) | return self._internal.set_embeddings(index, blob._internal) | Sets the representation table with the given index
as a blob of the dimensions:
- BatchLength * BatchWidth * ListSize is dimensions[i].VectorCount
- Height * Width * Depth * Channels is dimensions[i].VectorSize | Sets the representation table with the given index
as a blob of the dimensions: | [
"Sets",
"the",
"representation",
"table",
"with",
"the",
"given",
"index",
"as",
"a",
"blob",
"of",
"the",
"dimensions",
":"
] | def set_embeddings(self, index, blob):
"""Sets the representation table with the given index
as a blob of the dimensions:
- BatchLength * BatchWidth * ListSize is dimensions[i].VectorCount
- Height * Width * Depth * Channels is dimensions[i].VectorSize
"""
if no... | [
"def",
"set_embeddings",
"(",
"self",
",",
"index",
",",
"blob",
")",
":",
"if",
"not",
"type",
"(",
"blob",
")",
"is",
"Blob",
".",
"Blob",
":",
"raise",
"ValueError",
"(",
"'The `blob` must be neoml.Blob.'",
")",
"return",
"self",
".",
"_internal",
".",
... | https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/MultichannelLookup.py#L121-L131 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rosservice/src/rosservice/__init__.py | python | _rosservice_cmd_type | (argv) | Parse 'type' command arguments and run command Will cause a system
exit if command-line argument parsing fails.
@param argv: command-line arguments
@type argv: [str]
@raise ROSServiceException: if type command cannot be executed | Parse 'type' command arguments and run command Will cause a system
exit if command-line argument parsing fails. | [
"Parse",
"type",
"command",
"arguments",
"and",
"run",
"command",
"Will",
"cause",
"a",
"system",
"exit",
"if",
"command",
"-",
"line",
"argument",
"parsing",
"fails",
"."
] | def _rosservice_cmd_type(argv):
"""
Parse 'type' command arguments and run command Will cause a system
exit if command-line argument parsing fails.
@param argv: command-line arguments
@type argv: [str]
@raise ROSServiceException: if type command cannot be executed
"""
_rosservice_type(_... | [
"def",
"_rosservice_cmd_type",
"(",
"argv",
")",
":",
"_rosservice_type",
"(",
"_optparse_service_only",
"(",
"'type'",
",",
"argv",
"=",
"argv",
")",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosservice/src/rosservice/__init__.py#L519-L527 | ||
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_queue_runner.py | python | FeedingQueueRunner.__init__ | (self, queue=None, enqueue_ops=None, close_op=None,
cancel_op=None, feed_fns=None) | Initialize the queue runner.
For further documentation, see `queue_runner.py`. Note that
`FeedingQueueRunner` does not support construction from protobuffer nor
serialization to protobuffer.
Args:
queue: A `Queue`.
enqueue_ops: List of enqueue ops to run in threads later.
close_op: O... | Initialize the queue runner. | [
"Initialize",
"the",
"queue",
"runner",
"."
] | def __init__(self, queue=None, enqueue_ops=None, close_op=None,
cancel_op=None, feed_fns=None):
"""Initialize the queue runner.
For further documentation, see `queue_runner.py`. Note that
`FeedingQueueRunner` does not support construction from protobuffer nor
serialization to protobuffer... | [
"def",
"__init__",
"(",
"self",
",",
"queue",
"=",
"None",
",",
"enqueue_ops",
"=",
"None",
",",
"close_op",
"=",
"None",
",",
"cancel_op",
"=",
"None",
",",
"feed_fns",
"=",
"None",
")",
":",
"super",
"(",
"FeedingQueueRunner",
",",
"self",
")",
".",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_queue_runner.py#L32-L61 | ||
zhaoweicai/mscnn | 534bcac5710a579d60827f192035f7eef6d8c585 | python/caffe/io.py | python | array_to_blobproto | (arr, diff=None) | return blob | Converts a N-dimensional array to blob proto. If diff is given, also
convert the diff. You need to make sure that arr and diff have the same
shape, and this function does not do sanity check. | Converts a N-dimensional array to blob proto. If diff is given, also
convert the diff. You need to make sure that arr and diff have the same
shape, and this function does not do sanity check. | [
"Converts",
"a",
"N",
"-",
"dimensional",
"array",
"to",
"blob",
"proto",
".",
"If",
"diff",
"is",
"given",
"also",
"convert",
"the",
"diff",
".",
"You",
"need",
"to",
"make",
"sure",
"that",
"arr",
"and",
"diff",
"have",
"the",
"same",
"shape",
"and",... | def array_to_blobproto(arr, diff=None):
"""Converts a N-dimensional array to blob proto. If diff is given, also
convert the diff. You need to make sure that arr and diff have the same
shape, and this function does not do sanity check.
"""
blob = caffe_pb2.BlobProto()
blob.shape.dim.extend(arr.sh... | [
"def",
"array_to_blobproto",
"(",
"arr",
",",
"diff",
"=",
"None",
")",
":",
"blob",
"=",
"caffe_pb2",
".",
"BlobProto",
"(",
")",
"blob",
".",
"shape",
".",
"dim",
".",
"extend",
"(",
"arr",
".",
"shape",
")",
"blob",
".",
"data",
".",
"extend",
"... | https://github.com/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/python/caffe/io.py#L36-L46 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py | python | Helper.getline | (self, prompt) | Read one line, using raw_input when available. | Read one line, using raw_input when available. | [
"Read",
"one",
"line",
"using",
"raw_input",
"when",
"available",
"."
] | def getline(self, prompt):
"""Read one line, using raw_input when available."""
if self.input is sys.stdin:
return raw_input(prompt)
else:
self.output.write(prompt)
self.output.flush()
return self.input.readline() | [
"def",
"getline",
"(",
"self",
",",
"prompt",
")",
":",
"if",
"self",
".",
"input",
"is",
"sys",
".",
"stdin",
":",
"return",
"raw_input",
"(",
"prompt",
")",
"else",
":",
"self",
".",
"output",
".",
"write",
"(",
"prompt",
")",
"self",
".",
"outpu... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/pydoc.py#L1771-L1778 | ||
Qihoo360/mongosync | 55b647e81c072ebe91daaa3b9dc1a953c3c22e19 | dep/mongo-cxx-driver/site_scons/buildscripts/docs.py | python | version | () | Get the server version from doxygenConfig. | Get the server version from doxygenConfig. | [
"Get",
"the",
"server",
"version",
"from",
"doxygenConfig",
"."
] | def version():
"""Get the server version from doxygenConfig.
"""
with open("etc/doxygen/config") as f:
for line in f.readlines():
if line.startswith("PROJECT_NUMBER"):
return line.split("=")[1].strip() | [
"def",
"version",
"(",
")",
":",
"with",
"open",
"(",
"\"etc/doxygen/config\"",
")",
"as",
"f",
":",
"for",
"line",
"in",
"f",
".",
"readlines",
"(",
")",
":",
"if",
"line",
".",
"startswith",
"(",
"\"PROJECT_NUMBER\"",
")",
":",
"return",
"line",
".",... | https://github.com/Qihoo360/mongosync/blob/55b647e81c072ebe91daaa3b9dc1a953c3c22e19/dep/mongo-cxx-driver/site_scons/buildscripts/docs.py#L27-L33 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/common/extensions/docs/build/directory.py | python | sorted_walk | (path) | A version of os.walk that yields results in order sorted by name.
This is to prevent spurious docs changes due to os.walk returning items in a
filesystem dependent order (by inode creation time, etc). | A version of os.walk that yields results in order sorted by name. | [
"A",
"version",
"of",
"os",
".",
"walk",
"that",
"yields",
"results",
"in",
"order",
"sorted",
"by",
"name",
"."
] | def sorted_walk(path):
""" A version of os.walk that yields results in order sorted by name.
This is to prevent spurious docs changes due to os.walk returning items in a
filesystem dependent order (by inode creation time, etc).
"""
for base, dirs, files in os.walk(path):
dirs.sort()
files.sort()
... | [
"def",
"sorted_walk",
"(",
"path",
")",
":",
"for",
"base",
",",
"dirs",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"path",
")",
":",
"dirs",
".",
"sort",
"(",
")",
"files",
".",
"sort",
"(",
")",
"yield",
"base",
",",
"dirs",
",",
"files"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/common/extensions/docs/build/directory.py#L37-L46 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | TextBoxAttr.IsFloating | (*args, **kwargs) | return _richtext.TextBoxAttr_IsFloating(*args, **kwargs) | IsFloating(self) -> bool | IsFloating(self) -> bool | [
"IsFloating",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsFloating(*args, **kwargs):
"""IsFloating(self) -> bool"""
return _richtext.TextBoxAttr_IsFloating(*args, **kwargs) | [
"def",
"IsFloating",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"TextBoxAttr_IsFloating",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L588-L590 | |
esa/pagmo | 80281d549c8f1b470e1489a5d37c8f06b2e429c0 | PyGMO/util/_analysis.py | python | analysis.__init__ | (self, input_object, npoints=0, method='sobol', first=1, output_to_file=False) | Constructor of the analysis class from a problem or population object. Also calls
analysis.sample when npoints>0 or by default when a population object is input.
**USAGE:**
analysis(input_object=prob [, npoints=1000, method='sobol', first=1, output_to_file=False])
* input_object: probl... | Constructor of the analysis class from a problem or population object. Also calls
analysis.sample when npoints>0 or by default when a population object is input. | [
"Constructor",
"of",
"the",
"analysis",
"class",
"from",
"a",
"problem",
"or",
"population",
"object",
".",
"Also",
"calls",
"analysis",
".",
"sample",
"when",
"npoints",
">",
"0",
"or",
"by",
"default",
"when",
"a",
"population",
"object",
"is",
"input",
... | def __init__(self, input_object, npoints=0, method='sobol', first=1, output_to_file=False):
"""
Constructor of the analysis class from a problem or population object. Also calls
analysis.sample when npoints>0 or by default when a population object is input.
**USAGE:**
analysis(i... | [
"def",
"__init__",
"(",
"self",
",",
"input_object",
",",
"npoints",
"=",
"0",
",",
"method",
"=",
"'sobol'",
",",
"first",
"=",
"1",
",",
"output_to_file",
"=",
"False",
")",
":",
"self",
".",
"npoints",
"=",
"0",
"self",
".",
"points",
"=",
"[",
... | https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/util/_analysis.py#L15-L105 | ||
lammps/lammps | b75c3065430a75b1b5543a10e10f46d9b4c91913 | tools/i-pi/ipi/inputs/outputs.py | python | InputCheckpoint.store | (self, chk) | Stores a CheckpointOutput object. | Stores a CheckpointOutput object. | [
"Stores",
"a",
"CheckpointOutput",
"object",
"."
] | def store(self, chk):
"""Stores a CheckpointOutput object."""
super(InputCheckpoint,self).store(chk.step)
self.stride.store(chk.stride)
self.filename.store(chk.filename)
self.overwrite.store(chk.overwrite) | [
"def",
"store",
"(",
"self",
",",
"chk",
")",
":",
"super",
"(",
"InputCheckpoint",
",",
"self",
")",
".",
"store",
"(",
"chk",
".",
"step",
")",
"self",
".",
"stride",
".",
"store",
"(",
"chk",
".",
"stride",
")",
"self",
".",
"filename",
".",
"... | https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/inputs/outputs.py#L217-L223 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/idl/idl/generator.py | python | _CppSourceFileWriter.gen_bson_serializer_method | (self, struct) | Generate the serialize method definition. | Generate the serialize method definition. | [
"Generate",
"the",
"serialize",
"method",
"definition",
"."
] | def gen_bson_serializer_method(self, struct):
# type: (ast.Struct) -> None
"""Generate the serialize method definition."""
struct_type_info = struct_types.get_struct_info(struct)
with self._block('%s {' % (struct_type_info.get_serializer_method().get_definition()), '}'):
se... | [
"def",
"gen_bson_serializer_method",
"(",
"self",
",",
"struct",
")",
":",
"# type: (ast.Struct) -> None",
"struct_type_info",
"=",
"struct_types",
".",
"get_struct_info",
"(",
"struct",
")",
"with",
"self",
".",
"_block",
"(",
"'%s {'",
"%",
"(",
"struct_type_info"... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/idl/idl/generator.py#L1251-L1258 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/python_gflags/gflags.py | python | _StrOrUnicode | (value) | Converts value to a python string or, if necessary, unicode-string. | Converts value to a python string or, if necessary, unicode-string. | [
"Converts",
"value",
"to",
"a",
"python",
"string",
"or",
"if",
"necessary",
"unicode",
"-",
"string",
"."
] | def _StrOrUnicode(value):
"""Converts value to a python string or, if necessary, unicode-string."""
try:
return str(value)
except UnicodeEncodeError:
return unicode(value) | [
"def",
"_StrOrUnicode",
"(",
"value",
")",
":",
"try",
":",
"return",
"str",
"(",
"value",
")",
"except",
"UnicodeEncodeError",
":",
"return",
"unicode",
"(",
"value",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/python_gflags/gflags.py#L1767-L1772 | ||
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/port/base.py | python | Port.version | (self) | return self._version | Returns a string indicating the version of a given platform, e.g.
'leopard' or 'xp'.
This is used to help identify the exact port when parsing test
expectations, determining search paths, and logging information. | Returns a string indicating the version of a given platform, e.g.
'leopard' or 'xp'. | [
"Returns",
"a",
"string",
"indicating",
"the",
"version",
"of",
"a",
"given",
"platform",
"e",
".",
"g",
".",
"leopard",
"or",
"xp",
"."
] | def version(self):
"""Returns a string indicating the version of a given platform, e.g.
'leopard' or 'xp'.
This is used to help identify the exact port when parsing test
expectations, determining search paths, and logging information."""
return self._version | [
"def",
"version",
"(",
"self",
")",
":",
"return",
"self",
".",
"_version"
] | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/port/base.py#L737-L743 | |
alexgkendall/caffe-segnet | 344c113bf1832886f1cbe9f33ffe28a3beeaf412 | python/caffe/draw.py | python | get_pooling_types_dict | () | return d | Get dictionary mapping pooling type number to type name | Get dictionary mapping pooling type number to type name | [
"Get",
"dictionary",
"mapping",
"pooling",
"type",
"number",
"to",
"type",
"name"
] | def get_pooling_types_dict():
"""Get dictionary mapping pooling type number to type name
"""
desc = caffe_pb2.PoolingParameter.PoolMethod.DESCRIPTOR
d = {}
for k, v in desc.values_by_name.items():
d[v.number] = k
return d | [
"def",
"get_pooling_types_dict",
"(",
")",
":",
"desc",
"=",
"caffe_pb2",
".",
"PoolingParameter",
".",
"PoolMethod",
".",
"DESCRIPTOR",
"d",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"desc",
".",
"values_by_name",
".",
"items",
"(",
")",
":",
"d",
"[... | https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/python/caffe/draw.py#L27-L34 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py | python | CCompiler.undefine_macro | (self, name) | Undefine a preprocessor macro for all compilations driven by
this compiler object. If the same macro is defined by
'define_macro()' and undefined by 'undefine_macro()' the last call
takes precedence (including multiple redefinitions or
undefinitions). If the macro is redefined/undefine... | Undefine a preprocessor macro for all compilations driven by
this compiler object. If the same macro is defined by
'define_macro()' and undefined by 'undefine_macro()' the last call
takes precedence (including multiple redefinitions or
undefinitions). If the macro is redefined/undefine... | [
"Undefine",
"a",
"preprocessor",
"macro",
"for",
"all",
"compilations",
"driven",
"by",
"this",
"compiler",
"object",
".",
"If",
"the",
"same",
"macro",
"is",
"defined",
"by",
"define_macro",
"()",
"and",
"undefined",
"by",
"undefine_macro",
"()",
"the",
"last... | def undefine_macro(self, name):
"""Undefine a preprocessor macro for all compilations driven by
this compiler object. If the same macro is defined by
'define_macro()' and undefined by 'undefine_macro()' the last call
takes precedence (including multiple redefinitions or
undefini... | [
"def",
"undefine_macro",
"(",
"self",
",",
"name",
")",
":",
"# Delete from the list of macro definitions/undefinitions if",
"# already there (so that this one will take precedence).",
"i",
"=",
"self",
".",
"_find_macro",
"(",
"name",
")",
"if",
"i",
"is",
"not",
"None",... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/ccompiler.py#L211-L227 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/fftpack/basic.py | python | ifft2 | (x, shape=None, axes=(-2,-1), overwrite_x=False) | return ifftn(x,shape,axes,overwrite_x) | 2-D discrete inverse Fourier transform of real or complex sequence.
Return inverse two-dimensional discrete Fourier transform of
arbitrary type sequence x.
See `ifft` for more information.
See also
--------
fft2, ifft | 2-D discrete inverse Fourier transform of real or complex sequence. | [
"2",
"-",
"D",
"discrete",
"inverse",
"Fourier",
"transform",
"of",
"real",
"or",
"complex",
"sequence",
"."
] | def ifft2(x, shape=None, axes=(-2,-1), overwrite_x=False):
"""
2-D discrete inverse Fourier transform of real or complex sequence.
Return inverse two-dimensional discrete Fourier transform of
arbitrary type sequence x.
See `ifft` for more information.
See also
--------
fft2, ifft
... | [
"def",
"ifft2",
"(",
"x",
",",
"shape",
"=",
"None",
",",
"axes",
"=",
"(",
"-",
"2",
",",
"-",
"1",
")",
",",
"overwrite_x",
"=",
"False",
")",
":",
"return",
"ifftn",
"(",
"x",
",",
"shape",
",",
"axes",
",",
"overwrite_x",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/fftpack/basic.py#L651-L665 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/math_ops.py | python | exp | (x, dtype=None) | return _apply_tensor_op(F.tensor_exp, x, dtype=dtype) | Calculates the exponential of all elements in the input array.
Note:
Numpy arguments `casting`, `order`, `subok`, `signature`, and `extobj` are
not supported.
When `where` is provided, `out` must have a tensor value. `out` is not supported
for storing the result, however it can be u... | Calculates the exponential of all elements in the input array. | [
"Calculates",
"the",
"exponential",
"of",
"all",
"elements",
"in",
"the",
"input",
"array",
"."
] | def exp(x, dtype=None):
"""
Calculates the exponential of all elements in the input array.
Note:
Numpy arguments `casting`, `order`, `subok`, `signature`, and `extobj` are
not supported.
When `where` is provided, `out` must have a tensor value. `out` is not supported
for sto... | [
"def",
"exp",
"(",
"x",
",",
"dtype",
"=",
"None",
")",
":",
"return",
"_apply_tensor_op",
"(",
"F",
".",
"tensor_exp",
",",
"x",
",",
"dtype",
"=",
"dtype",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/math_ops.py#L1780-L1811 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/aui.py | python | AuiTabContainer.GetFlags | (*args, **kwargs) | return _aui.AuiTabContainer_GetFlags(*args, **kwargs) | GetFlags(self) -> int | GetFlags(self) -> int | [
"GetFlags",
"(",
"self",
")",
"-",
">",
"int"
] | def GetFlags(*args, **kwargs):
"""GetFlags(self) -> int"""
return _aui.AuiTabContainer_GetFlags(*args, **kwargs) | [
"def",
"GetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiTabContainer_GetFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1141-L1143 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | site_scons/site_tools/auto_install_binaries.py | python | list_components | (env, **kwargs) | List registered components for env. | List registered components for env. | [
"List",
"registered",
"components",
"for",
"env",
"."
] | def list_components(env, **kwargs):
"""List registered components for env."""
print("Known AIB components:")
for key in env[ALIAS_MAP]:
print("\t", key) | [
"def",
"list_components",
"(",
"env",
",",
"*",
"*",
"kwargs",
")",
":",
"print",
"(",
"\"Known AIB components:\"",
")",
"for",
"key",
"in",
"env",
"[",
"ALIAS_MAP",
"]",
":",
"print",
"(",
"\"\\t\"",
",",
"key",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/site_scons/site_tools/auto_install_binaries.py#L532-L536 | ||
PaddlePaddle/PaddleOCR | b756bf5f8c90142e0d89d3db0163965c686b6ffe | ppstructure/table/tablepyxl/tablepyxl.py | python | document_to_workbook | (doc, wb=None, base_url=None) | return wb | Takes a string representation of an html document and writes one sheet for
every table in the document.
The workbook is returned | Takes a string representation of an html document and writes one sheet for
every table in the document.
The workbook is returned | [
"Takes",
"a",
"string",
"representation",
"of",
"an",
"html",
"document",
"and",
"writes",
"one",
"sheet",
"for",
"every",
"table",
"in",
"the",
"document",
".",
"The",
"workbook",
"is",
"returned"
] | def document_to_workbook(doc, wb=None, base_url=None):
"""
Takes a string representation of an html document and writes one sheet for
every table in the document.
The workbook is returned
"""
if not wb:
wb = Workbook()
wb.remove(wb.active)
inline_styles_doc = Premailer(doc, ... | [
"def",
"document_to_workbook",
"(",
"doc",
",",
"wb",
"=",
"None",
",",
"base_url",
"=",
"None",
")",
":",
"if",
"not",
"wb",
":",
"wb",
"=",
"Workbook",
"(",
")",
"wb",
".",
"remove",
"(",
"wb",
".",
"active",
")",
"inline_styles_doc",
"=",
"Premail... | https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/ppstructure/table/tablepyxl/tablepyxl.py#L77-L93 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/google_appengine_cloudstorage/cloudstorage/common.py | python | dt_str_to_posix | (dt_str) | return calendar.timegm(dt.utctimetuple()) | format str to posix.
datetime str is of format %Y-%m-%dT%H:%M:%S.%fZ,
e.g. 2013-04-12T00:22:27.978Z. According to ISO 8601, T is a separator
between date and time when they are on the same line.
Z indicates UTC (zero meridian).
A pointer: http://www.cl.cam.ac.uk/~mgk25/iso-time.html
This is used to parse... | format str to posix. | [
"format",
"str",
"to",
"posix",
"."
] | def dt_str_to_posix(dt_str):
"""format str to posix.
datetime str is of format %Y-%m-%dT%H:%M:%S.%fZ,
e.g. 2013-04-12T00:22:27.978Z. According to ISO 8601, T is a separator
between date and time when they are on the same line.
Z indicates UTC (zero meridian).
A pointer: http://www.cl.cam.ac.uk/~mgk25/iso-... | [
"def",
"dt_str_to_posix",
"(",
"dt_str",
")",
":",
"parsable",
",",
"_",
"=",
"dt_str",
".",
"split",
"(",
"'.'",
")",
"dt",
"=",
"datetime",
".",
"datetime",
".",
"strptime",
"(",
"parsable",
",",
"_DT_FORMAT",
")",
"return",
"calendar",
".",
"timegm",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/google_appengine_cloudstorage/cloudstorage/common.py#L327-L348 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/NinjaWriter.py | python | NinjaWriter._GetSortedXcodeEnv | (self, additional_settings=None) | return gyp.xcode_emulation.GetSortedXcodeEnv(self.xcode_settings, self.abs_build_dir, path, self.config_name, additional_settings) | Returns the variables Xcode would set for build steps. | Returns the variables Xcode would set for build steps. | [
"Returns",
"the",
"variables",
"Xcode",
"would",
"set",
"for",
"build",
"steps",
"."
] | def _GetSortedXcodeEnv(self, additional_settings=None):
"""Returns the variables Xcode would set for build steps."""
assert self.abs_build_dir
path = os.path.join(self.abs_build_dir, self.build_to_base)
return gyp.xcode_emulation.GetSortedXcodeEnv(self.xcode_settings, self.abs_build_dir, path, self.conf... | [
"def",
"_GetSortedXcodeEnv",
"(",
"self",
",",
"additional_settings",
"=",
"None",
")",
":",
"assert",
"self",
".",
"abs_build_dir",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"abs_build_dir",
",",
"self",
".",
"build_to_base",
")",
"re... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/NinjaWriter.py#L1024-L1028 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/value.py | python | TypeRef.name | (self) | return ffi.ret_string(ffi.lib.LLVMPY_GetTypeName(self)) | Get type name | Get type name | [
"Get",
"type",
"name"
] | def name(self):
"""
Get type name
"""
return ffi.ret_string(ffi.lib.LLVMPY_GetTypeName(self)) | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"ffi",
".",
"ret_string",
"(",
"ffi",
".",
"lib",
".",
"LLVMPY_GetTypeName",
"(",
"self",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/binding/value.py#L50-L54 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/ros_comm/rospy/src/rospy/impl/broadcast_manager.py | python | BroadcastManager.unregisterSubscriber | (self, name, topic, uri) | return 1, "unregisterSubscriber" ,0 | unregisterSubscriber | unregisterSubscriber | [
"unregisterSubscriber"
] | def unregisterSubscriber(self, name, topic, uri):
"""
unregisterSubscriber
"""
data = self._generate_message("unregisterSubscriber")
data[NODE_NAME] = name
data[TOPIC_NAME] = topic
data[TOPIC_URI] = uri
self._send(self._encode(data))
try:
... | [
"def",
"unregisterSubscriber",
"(",
"self",
",",
"name",
",",
"topic",
",",
"uri",
")",
":",
"data",
"=",
"self",
".",
"_generate_message",
"(",
"\"unregisterSubscriber\"",
")",
"data",
"[",
"NODE_NAME",
"]",
"=",
"name",
"data",
"[",
"TOPIC_NAME",
"]",
"=... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/impl/broadcast_manager.py#L259-L272 | |
plaidml/plaidml | f3c6681db21460e5fdc11ae651d6d7b6c27f8262 | cmake/git-clang-format.py | python | run_clang_format_and_save_to_tree | (changed_lines,
revision=None,
binary='clang-format',
style=None) | return create_tree(index_info_generator(), '--index-info') | Run clang-format on each file and save the result to a git tree.
Returns the object ID (SHA-1) of the created tree. | Run clang-format on each file and save the result to a git tree. | [
"Run",
"clang",
"-",
"format",
"on",
"each",
"file",
"and",
"save",
"the",
"result",
"to",
"a",
"git",
"tree",
"."
] | def run_clang_format_and_save_to_tree(changed_lines,
revision=None,
binary='clang-format',
style=None):
"""Run clang-format on each file and save the result to a git tree.
Returns the object ID (SHA-... | [
"def",
"run_clang_format_and_save_to_tree",
"(",
"changed_lines",
",",
"revision",
"=",
"None",
",",
"binary",
"=",
"'clang-format'",
",",
"style",
"=",
"None",
")",
":",
"def",
"iteritems",
"(",
"container",
")",
":",
"try",
":",
"return",
"container",
".",
... | https://github.com/plaidml/plaidml/blob/f3c6681db21460e5fdc11ae651d6d7b6c27f8262/cmake/git-clang-format.py#L357-L396 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/rnn/python/ops/lstm_ops.py | python | _block_lstm | (seq_len_max,
x,
w,
b,
cs_prev=None,
h_prev=None,
wci=None,
wcf=None,
wco=None,
forget_bias=None,
cell_clip=None,
use_peephole=None,
... | return array_ops.unpack(i), array_ops.unpack(cs), array_ops.unpack(
f), array_ops.unpack(o), array_ops.unpack(ci), array_ops.unpack(
co), array_ops.unpack(h) | r"""TODO(williamchan): add doc.
Args:
seq_len_max: A `Tensor` of type `int64`.
x: A list of at least 1 `Tensor` objects of the same type in: `float32`.
w: A `Tensor`. Must have the same type as `x`.
b: A `Tensor`. Must have the same type as `x`.
cs_prev: A `Tensor`. Must have the same type as `x`... | r"""TODO(williamchan): add doc. | [
"r",
"TODO",
"(",
"williamchan",
")",
":",
"add",
"doc",
"."
] | def _block_lstm(seq_len_max,
x,
w,
b,
cs_prev=None,
h_prev=None,
wci=None,
wcf=None,
wco=None,
forget_bias=None,
cell_clip=None,
use_peephole=No... | [
"def",
"_block_lstm",
"(",
"seq_len_max",
",",
"x",
",",
"w",
",",
"b",
",",
"cs_prev",
"=",
"None",
",",
"h_prev",
"=",
"None",
",",
"wci",
"=",
"None",
",",
"wcf",
"=",
"None",
",",
"wco",
"=",
"None",
",",
"forget_bias",
"=",
"None",
",",
"cel... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/rnn/python/ops/lstm_ops.py#L140-L226 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/dygraph/dygraph_to_static/function_spec.py | python | get_buffers | (layer_instance, include_sublayer=True) | return buffers | Returns Variable buffers of decorated layers. If set `include_sublayer` True,
the Variable buffers created in sub layers will be added. | Returns Variable buffers of decorated layers. If set `include_sublayer` True,
the Variable buffers created in sub layers will be added. | [
"Returns",
"Variable",
"buffers",
"of",
"decorated",
"layers",
".",
"If",
"set",
"include_sublayer",
"True",
"the",
"Variable",
"buffers",
"created",
"in",
"sub",
"layers",
"will",
"be",
"added",
"."
] | def get_buffers(layer_instance, include_sublayer=True):
"""
Returns Variable buffers of decorated layers. If set `include_sublayer` True,
the Variable buffers created in sub layers will be added.
"""
buffers = collections.OrderedDict()
if layer_instance is not None:
if isinstance(layer_i... | [
"def",
"get_buffers",
"(",
"layer_instance",
",",
"include_sublayer",
"=",
"True",
")",
":",
"buffers",
"=",
"collections",
".",
"OrderedDict",
"(",
")",
"if",
"layer_instance",
"is",
"not",
"None",
":",
"if",
"isinstance",
"(",
"layer_instance",
",",
"layers"... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/dygraph/dygraph_to_static/function_spec.py#L252-L270 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGridInterface.AutoFill | (self,obj,parent=None) | Clears properties and re-fills to match members and\nvalues of | Clears properties and re-fills to match members and\nvalues of | [
"Clears",
"properties",
"and",
"re",
"-",
"fills",
"to",
"match",
"members",
"and",
"\\",
"nvalues",
"of"
] | def AutoFill(self,obj,parent=None):
"Clears properties and re-fills to match members and\nvalues of "
"given object or dictionary obj."
self.edited_objects[parent] = obj
cur_page = False
is_manager = isinstance(self,PropertyGridManager)
if not parent:
if is... | [
"def",
"AutoFill",
"(",
"self",
",",
"obj",
",",
"parent",
"=",
"None",
")",
":",
"\"given object or dictionary obj.\"",
"self",
".",
"edited_objects",
"[",
"parent",
"]",
"=",
"obj",
"cur_page",
"=",
"False",
"is_manager",
"=",
"isinstance",
"(",
"self",
",... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L1660-L1701 | ||
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/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/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/containers.py#L257-L260 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py | python | Real.__le__ | (self, other) | self <= other | self <= other | [
"self",
"<",
"=",
"other"
] | def __le__(self, other):
"""self <= other"""
raise NotImplementedError | [
"def",
"__le__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/numbers.py#L244-L246 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/rpm.py | python | SimpleTagCompiler.compile | (self, values) | return str | Compiles the tagset and returns a str containing the result | Compiles the tagset and returns a str containing the result | [
"Compiles",
"the",
"tagset",
"and",
"returns",
"a",
"str",
"containing",
"the",
"result"
] | def compile(self, values):
""" Compiles the tagset and returns a str containing the result
"""
def is_international(tag):
return tag.endswith('_')
def get_country_code(tag):
return tag[-2:]
def strip_country_code(tag):
return tag[:-2]
... | [
"def",
"compile",
"(",
"self",
",",
"values",
")",
":",
"def",
"is_international",
"(",
"tag",
")",
":",
"return",
"tag",
".",
"endswith",
"(",
"'_'",
")",
"def",
"get_country_code",
"(",
"tag",
")",
":",
"return",
"tag",
"[",
"-",
"2",
":",
"]",
"... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/packaging/rpm.py#L308-L342 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/aui.py | python | AuiPaneInfo.Movable | (*args, **kwargs) | return _aui.AuiPaneInfo_Movable(*args, **kwargs) | Movable(self, bool b=True) -> AuiPaneInfo | Movable(self, bool b=True) -> AuiPaneInfo | [
"Movable",
"(",
"self",
"bool",
"b",
"=",
"True",
")",
"-",
">",
"AuiPaneInfo"
] | def Movable(*args, **kwargs):
"""Movable(self, bool b=True) -> AuiPaneInfo"""
return _aui.AuiPaneInfo_Movable(*args, **kwargs) | [
"def",
"Movable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_Movable",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L497-L499 | |
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/utils/check_cfc/obj_diff.py | python | compare_debug_info | (objfilea, objfileb) | return first_diff(dbga, dbgb, objfilea, objfileb) | Compare debug info of two different files.
Allowing unavoidable differences, such as filenames.
Return the first difference if the debug info differs, or None.
If there are differences in the code, there will almost certainly be differences in the debug info too. | Compare debug info of two different files.
Allowing unavoidable differences, such as filenames.
Return the first difference if the debug info differs, or None.
If there are differences in the code, there will almost certainly be differences in the debug info too. | [
"Compare",
"debug",
"info",
"of",
"two",
"different",
"files",
".",
"Allowing",
"unavoidable",
"differences",
"such",
"as",
"filenames",
".",
"Return",
"the",
"first",
"difference",
"if",
"the",
"debug",
"info",
"differs",
"or",
"None",
".",
"If",
"there",
"... | def compare_debug_info(objfilea, objfileb):
"""Compare debug info of two different files.
Allowing unavoidable differences, such as filenames.
Return the first difference if the debug info differs, or None.
If there are differences in the code, there will almost certainly be differences in the ... | [
"def",
"compare_debug_info",
"(",
"objfilea",
",",
"objfileb",
")",
":",
"dbga",
"=",
"dump_debug",
"(",
"objfilea",
")",
"dbgb",
"=",
"dump_debug",
"(",
"objfileb",
")",
"return",
"first_diff",
"(",
"dbga",
",",
"dbgb",
",",
"objfilea",
",",
"objfileb",
"... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/utils/check_cfc/obj_diff.py#L76-L84 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/cython/Cython/Compiler/Optimize.py | python | OptimizeBuiltinCalls._handle_simple_method_object_pop | (self, node, function, args, is_unbound_method, is_list=False) | return node | Optimistic optimisation as X.pop([n]) is almost always
referring to a list. | Optimistic optimisation as X.pop([n]) is almost always
referring to a list. | [
"Optimistic",
"optimisation",
"as",
"X",
".",
"pop",
"(",
"[",
"n",
"]",
")",
"is",
"almost",
"always",
"referring",
"to",
"a",
"list",
"."
] | def _handle_simple_method_object_pop(self, node, function, args, is_unbound_method, is_list=False):
"""Optimistic optimisation as X.pop([n]) is almost always
referring to a list.
"""
if not args:
return node
obj = args[0]
if is_list:
type_name = 'L... | [
"def",
"_handle_simple_method_object_pop",
"(",
"self",
",",
"node",
",",
"function",
",",
"args",
",",
"is_unbound_method",
",",
"is_list",
"=",
"False",
")",
":",
"if",
"not",
"args",
":",
"return",
"node",
"obj",
"=",
"args",
"[",
"0",
"]",
"if",
"is_... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Compiler/Optimize.py#L3003-L3069 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/codecs.py | python | StreamReader.__init__ | (self, stream, errors='strict') | Creates a StreamReader instance.
stream must be a file-like object open for reading
(binary) data.
The StreamReader may use different error handling
schemes by providing the errors keyword argument. These
parameters are predefined:
'strict' - r... | Creates a StreamReader instance. | [
"Creates",
"a",
"StreamReader",
"instance",
"."
] | def __init__(self, stream, errors='strict'):
""" Creates a StreamReader instance.
stream must be a file-like object open for reading
(binary) data.
The StreamReader may use different error handling
schemes by providing the errors keyword argument. These
... | [
"def",
"__init__",
"(",
"self",
",",
"stream",
",",
"errors",
"=",
"'strict'",
")",
":",
"self",
".",
"stream",
"=",
"stream",
"self",
".",
"errors",
"=",
"errors",
"self",
".",
"bytebuffer",
"=",
"\"\"",
"# For str->str decoding this will stay a str",
"# For ... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/codecs.py#L395-L419 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/launch.py | python | run | () | Run the script in sys.argv[1] as if it had
been invoked naturally. | Run the script in sys.argv[1] as if it had
been invoked naturally. | [
"Run",
"the",
"script",
"in",
"sys",
".",
"argv",
"[",
"1",
"]",
"as",
"if",
"it",
"had",
"been",
"invoked",
"naturally",
"."
] | def run():
"""
Run the script in sys.argv[1] as if it had
been invoked naturally.
"""
__builtins__
script_name = sys.argv[1]
namespace = dict(
__file__=script_name,
__name__='__main__',
__doc__=None,
)
sys.argv[:] = sys.argv[1:]
open_ = getattr(tokenize, ... | [
"def",
"run",
"(",
")",
":",
"__builtins__",
"script_name",
"=",
"sys",
".",
"argv",
"[",
"1",
"]",
"namespace",
"=",
"dict",
"(",
"__file__",
"=",
"script_name",
",",
"__name__",
"=",
"'__main__'",
",",
"__doc__",
"=",
"None",
",",
")",
"sys",
".",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/launch.py#L13-L31 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/logging/handlers.py | python | TimedRotatingFileHandler.computeRollover | (self, currentTime) | return result | Work out the rollover time based on the specified time. | Work out the rollover time based on the specified time. | [
"Work",
"out",
"the",
"rollover",
"time",
"based",
"on",
"the",
"specified",
"time",
"."
] | def computeRollover(self, currentTime):
"""
Work out the rollover time based on the specified time.
"""
result = currentTime + self.interval
# If we are rolling over at midnight or weekly, then the interval is already known.
# What we need to figure out is WHEN the next i... | [
"def",
"computeRollover",
"(",
"self",
",",
"currentTime",
")",
":",
"result",
"=",
"currentTime",
"+",
"self",
".",
"interval",
"# If we are rolling over at midnight or weekly, then the interval is already known.",
"# What we need to figure out is WHEN the next interval is. In othe... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/handlers.py#L210-L267 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/appstats.py | python | OutputBeautifier.__PrintNetworkStatsHeader | (self) | return self.__ColorString(headers, 'BOLD') | Returns a header string for network usage statistics. | Returns a header string for network usage statistics. | [
"Returns",
"a",
"header",
"string",
"for",
"network",
"usage",
"statistics",
"."
] | def __PrintNetworkStatsHeader(self):
"""Returns a header string for network usage statistics."""
headers = ''
for header in self.__NETWORK_COLUMN_TITLES:
headers += self.__PadString(header, 8, True) + ' '
headers += self.__PadString('(kB)', 8, False)
return self.__ColorString(headers, 'BOLD'... | [
"def",
"__PrintNetworkStatsHeader",
"(",
"self",
")",
":",
"headers",
"=",
"''",
"for",
"header",
"in",
"self",
".",
"__NETWORK_COLUMN_TITLES",
":",
"headers",
"+=",
"self",
".",
"__PadString",
"(",
"header",
",",
"8",
",",
"True",
")",
"+",
"' '",
"header... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/appstats.py#L575-L581 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_stc.py | python | EditraStc.ExpandAll | (self) | Expand all folded code blocks | Expand all folded code blocks | [
"Expand",
"all",
"folded",
"code",
"blocks"
] | def ExpandAll(self):
"""Expand all folded code blocks"""
line_count = self.GetLineCount()
for line_num in xrange(line_count):
if self.GetFoldLevel(line_num) & wx.stc.STC_FOLDLEVELHEADERFLAG:
if not self.GetFoldExpanded(line_num):
self.Expand(line_n... | [
"def",
"ExpandAll",
"(",
"self",
")",
":",
"line_count",
"=",
"self",
".",
"GetLineCount",
"(",
")",
"for",
"line_num",
"in",
"xrange",
"(",
"line_count",
")",
":",
"if",
"self",
".",
"GetFoldLevel",
"(",
"line_num",
")",
"&",
"wx",
".",
"stc",
".",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_stc.py#L1063-L1069 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/polynomial/polynomial.py | python | polycompanion | (c) | return mat | Return the companion matrix of c.
The companion matrix for power series cannot be made symmetric by
scaling the basis, so this function differs from those for the
orthogonal polynomials.
Parameters
----------
c : array_like
1-D array of polynomial coefficients ordered from low to high
... | Return the companion matrix of c. | [
"Return",
"the",
"companion",
"matrix",
"of",
"c",
"."
] | def polycompanion(c):
"""
Return the companion matrix of c.
The companion matrix for power series cannot be made symmetric by
scaling the basis, so this function differs from those for the
orthogonal polynomials.
Parameters
----------
c : array_like
1-D array of polynomial coef... | [
"def",
"polycompanion",
"(",
"c",
")",
":",
"# c is a trimmed copy",
"[",
"c",
"]",
"=",
"pu",
".",
"as_series",
"(",
"[",
"c",
"]",
")",
"if",
"len",
"(",
"c",
")",
"<",
"2",
":",
"raise",
"ValueError",
"(",
"'Series must have maximum degree of at least 1... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/polynomial.py#L1364-L1401 | |
nucleic/atom | 9f0cb2a8101dd63c354a98ebc7489b2c616dc82a | atom/atom.py | python | ObserveHandler.clone | (self) | return clone | Create a clone of the sentinel. | Create a clone of the sentinel. | [
"Create",
"a",
"clone",
"of",
"the",
"sentinel",
"."
] | def clone(self) -> "ObserveHandler":
"""Create a clone of the sentinel."""
clone = type(self)(self.pairs)
clone.func = self.func
return clone | [
"def",
"clone",
"(",
"self",
")",
"->",
"\"ObserveHandler\"",
":",
"clone",
"=",
"type",
"(",
"self",
")",
"(",
"self",
".",
"pairs",
")",
"clone",
".",
"func",
"=",
"self",
".",
"func",
"return",
"clone"
] | https://github.com/nucleic/atom/blob/9f0cb2a8101dd63c354a98ebc7489b2c616dc82a/atom/atom.py#L105-L109 | |
raspberrypi/tools | 13474ee775d0c5ec8a7da4fb0a9fa84187abfc87 | arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/share/gdb/python/gdb/command/explore.py | python | ReferenceExplorer.explore_type | (name, datatype, is_child) | return False | Function to explore pointer types.
See Explorer.explore_type for more information. | Function to explore pointer types.
See Explorer.explore_type for more information. | [
"Function",
"to",
"explore",
"pointer",
"types",
".",
"See",
"Explorer",
".",
"explore_type",
"for",
"more",
"information",
"."
] | def explore_type(name, datatype, is_child):
"""Function to explore pointer types.
See Explorer.explore_type for more information.
"""
target_type = datatype.target()
Explorer.explore_type(name, target_type, is_child)
return False | [
"def",
"explore_type",
"(",
"name",
",",
"datatype",
",",
"is_child",
")",
":",
"target_type",
"=",
"datatype",
".",
"target",
"(",
")",
"Explorer",
".",
"explore_type",
"(",
"name",
",",
"target_type",
",",
"is_child",
")",
"return",
"False"
] | https://github.com/raspberrypi/tools/blob/13474ee775d0c5ec8a7da4fb0a9fa84187abfc87/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/share/gdb/python/gdb/command/explore.py#L313-L319 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/telnetlib.py | python | Telnet.process_rawq | (self) | Transfer from raw queue to cooked queue.
Set self.eof when connection is closed. Don't block unless in
the midst of an IAC sequence. | Transfer from raw queue to cooked queue. | [
"Transfer",
"from",
"raw",
"queue",
"to",
"cooked",
"queue",
"."
] | def process_rawq(self):
"""Transfer from raw queue to cooked queue.
Set self.eof when connection is closed. Don't block unless in
the midst of an IAC sequence.
"""
buf = [b'', b'']
try:
while self.rawq:
c = self.rawq_getchar()
... | [
"def",
"process_rawq",
"(",
"self",
")",
":",
"buf",
"=",
"[",
"b''",
",",
"b''",
"]",
"try",
":",
"while",
"self",
".",
"rawq",
":",
"c",
"=",
"self",
".",
"rawq_getchar",
"(",
")",
"if",
"not",
"self",
".",
"iacseq",
":",
"if",
"c",
"==",
"th... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/telnetlib.py#L422-L492 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/aui.py | python | AuiNotebook.SetTabCtrlHeight | (*args, **kwargs) | return _aui.AuiNotebook_SetTabCtrlHeight(*args, **kwargs) | SetTabCtrlHeight(self, int height) | SetTabCtrlHeight(self, int height) | [
"SetTabCtrlHeight",
"(",
"self",
"int",
"height",
")"
] | def SetTabCtrlHeight(*args, **kwargs):
"""SetTabCtrlHeight(self, int height)"""
return _aui.AuiNotebook_SetTabCtrlHeight(*args, **kwargs) | [
"def",
"SetTabCtrlHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiNotebook_SetTabCtrlHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L1317-L1319 | |
ros-industrial/industrial_training | e6761c7bee65d3802fee6cf7c99e3113d3dc1af2 | gh_pages/_themes/sphinx_rtd_theme/__init__.py | python | get_html_theme_path | () | return cur_dir | Return list of HTML theme paths. | Return list of HTML theme paths. | [
"Return",
"list",
"of",
"HTML",
"theme",
"paths",
"."
] | def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
return cur_dir | [
"def",
"get_html_theme_path",
"(",
")",
":",
"cur_dir",
"=",
"path",
".",
"abspath",
"(",
"path",
".",
"dirname",
"(",
"path",
".",
"dirname",
"(",
"__file__",
")",
")",
")",
"return",
"cur_dir"
] | https://github.com/ros-industrial/industrial_training/blob/e6761c7bee65d3802fee6cf7c99e3113d3dc1af2/gh_pages/_themes/sphinx_rtd_theme/__init__.py#L12-L15 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/application/application.py | python | Application.exit | (
self,
result: Optional[_AppResult] = None,
exception: Optional[Union[BaseException, Type[BaseException]]] = None,
style: str = "",
) | Exit application.
.. note::
If `Application.exit` is called before `Application.run()` is
called, then the `Application` won't exit (because the
`Application.future` doesn't correspond to the current run). Use a
`pre_run` hook and an event to synchronize the clo... | Exit application. | [
"Exit",
"application",
"."
] | def exit(
self,
result: Optional[_AppResult] = None,
exception: Optional[Union[BaseException, Type[BaseException]]] = None,
style: str = "",
) -> None:
"""
Exit application.
.. note::
If `Application.exit` is called before `Application.run()` is
... | [
"def",
"exit",
"(",
"self",
",",
"result",
":",
"Optional",
"[",
"_AppResult",
"]",
"=",
"None",
",",
"exception",
":",
"Optional",
"[",
"Union",
"[",
"BaseException",
",",
"Type",
"[",
"BaseException",
"]",
"]",
"]",
"=",
"None",
",",
"style",
":",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/application/application.py#L1103-L1140 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | uCSIsTamil | (code) | return ret | Check whether the character is part of Tamil UCS Block | Check whether the character is part of Tamil UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Tamil",
"UCS",
"Block"
] | def uCSIsTamil(code):
"""Check whether the character is part of Tamil UCS Block """
ret = libxml2mod.xmlUCSIsTamil(code)
return ret | [
"def",
"uCSIsTamil",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsTamil",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L2933-L2936 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PGProperty.GetChildrenHeight | (*args, **kwargs) | return _propgrid.PGProperty_GetChildrenHeight(*args, **kwargs) | GetChildrenHeight(self, int lh, int iMax=-1) -> int | GetChildrenHeight(self, int lh, int iMax=-1) -> int | [
"GetChildrenHeight",
"(",
"self",
"int",
"lh",
"int",
"iMax",
"=",
"-",
"1",
")",
"-",
">",
"int"
] | def GetChildrenHeight(*args, **kwargs):
"""GetChildrenHeight(self, int lh, int iMax=-1) -> int"""
return _propgrid.PGProperty_GetChildrenHeight(*args, **kwargs) | [
"def",
"GetChildrenHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_GetChildrenHeight",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L806-L808 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | FileCtrl.HasMultipleFileSelection | (*args, **kwargs) | return _controls_.FileCtrl_HasMultipleFileSelection(*args, **kwargs) | HasMultipleFileSelection(self) -> bool | HasMultipleFileSelection(self) -> bool | [
"HasMultipleFileSelection",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasMultipleFileSelection(*args, **kwargs):
"""HasMultipleFileSelection(self) -> bool"""
return _controls_.FileCtrl_HasMultipleFileSelection(*args, **kwargs) | [
"def",
"HasMultipleFileSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"FileCtrl_HasMultipleFileSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L7703-L7705 | |
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/core.py | python | CherryTree.link_check_around_cursor_iter | (self, text_iter) | return "" | Check if the text iter is on a link | Check if the text iter is on a link | [
"Check",
"if",
"the",
"text",
"iter",
"is",
"on",
"a",
"link"
] | def link_check_around_cursor_iter(self, text_iter):
"""Check if the text iter is on a link"""
tags = text_iter.get_tags()
for tag in tags:
tag_name = tag.get_property("name")
if tag_name and tag_name[0:4] == cons.TAG_LINK: return tag_name
return "" | [
"def",
"link_check_around_cursor_iter",
"(",
"self",
",",
"text_iter",
")",
":",
"tags",
"=",
"text_iter",
".",
"get_tags",
"(",
")",
"for",
"tag",
"in",
"tags",
":",
"tag_name",
"=",
"tag",
".",
"get_property",
"(",
"\"name\"",
")",
"if",
"tag_name",
"and... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/core.py#L4865-L4871 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/richtext.py | python | RichTextCtrl.GetFullLayoutTime | (*args, **kwargs) | return _richtext.RichTextCtrl_GetFullLayoutTime(*args, **kwargs) | GetFullLayoutTime(self) -> wxLongLong | GetFullLayoutTime(self) -> wxLongLong | [
"GetFullLayoutTime",
"(",
"self",
")",
"-",
">",
"wxLongLong"
] | def GetFullLayoutTime(*args, **kwargs):
"""GetFullLayoutTime(self) -> wxLongLong"""
return _richtext.RichTextCtrl_GetFullLayoutTime(*args, **kwargs) | [
"def",
"GetFullLayoutTime",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_GetFullLayoutTime",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2969-L2971 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/setuptools/config.py | python | ConfigOptionsHandler.parse_section_entry_points | (self, section_options) | Parses `entry_points` configuration file section.
:param dict section_options: | Parses `entry_points` configuration file section. | [
"Parses",
"entry_points",
"configuration",
"file",
"section",
"."
] | def parse_section_entry_points(self, section_options):
"""Parses `entry_points` configuration file section.
:param dict section_options:
"""
parsed = self._parse_section_to_dict(section_options, self._parse_list)
self['entry_points'] = parsed | [
"def",
"parse_section_entry_points",
"(",
"self",
",",
"section_options",
")",
":",
"parsed",
"=",
"self",
".",
"_parse_section_to_dict",
"(",
"section_options",
",",
"self",
".",
"_parse_list",
")",
"self",
"[",
"'entry_points'",
"]",
"=",
"parsed"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/config.py#L611-L617 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | caffe2/python/dataset.py | python | Dataset.field_types | (self) | return self.field_types | Return the list of field dtypes for this dataset.
If a list of strings, not a schema.Struct, was passed to the
constructor, this will return a list of dtype(np.void). | Return the list of field dtypes for this dataset. | [
"Return",
"the",
"list",
"of",
"field",
"dtypes",
"for",
"this",
"dataset",
"."
] | def field_types(self):
"""
Return the list of field dtypes for this dataset.
If a list of strings, not a schema.Struct, was passed to the
constructor, this will return a list of dtype(np.void).
"""
return self.field_types | [
"def",
"field_types",
"(",
"self",
")",
":",
"return",
"self",
".",
"field_types"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/dataset.py#L267-L274 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/user_preferences.py | python | UserPreferences.animations_enabled | (self) | return self._animations_enabled | Gets the animations_enabled of this UserPreferences. # noqa: E501
:return: The animations_enabled of this UserPreferences. # noqa: E501
:rtype: bool | Gets the animations_enabled of this UserPreferences. # noqa: E501 | [
"Gets",
"the",
"animations_enabled",
"of",
"this",
"UserPreferences",
".",
"#",
"noqa",
":",
"E501"
] | def animations_enabled(self):
"""Gets the animations_enabled of this UserPreferences. # noqa: E501
:return: The animations_enabled of this UserPreferences. # noqa: E501
:rtype: bool
"""
return self._animations_enabled | [
"def",
"animations_enabled",
"(",
"self",
")",
":",
"return",
"self",
".",
"_animations_enabled"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user_preferences.py#L202-L209 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/toolbox.py | python | BaseTool.get_optionspanel | (self, parent, size=wx.DefaultSize) | return self._optionspanel | Return tool option widgets on given parent | Return tool option widgets on given parent | [
"Return",
"tool",
"option",
"widgets",
"on",
"given",
"parent"
] | def get_optionspanel(self, parent, size=wx.DefaultSize):
"""
Return tool option widgets on given parent
"""
size = (200, -1)
self._optionspanel = ObjPanel(parent, obj=self,
attrconfigs=None,
#tables = Non... | [
"def",
"get_optionspanel",
"(",
"self",
",",
"parent",
",",
"size",
"=",
"wx",
".",
"DefaultSize",
")",
":",
"size",
"=",
"(",
"200",
",",
"-",
"1",
")",
"self",
".",
"_optionspanel",
"=",
"ObjPanel",
"(",
"parent",
",",
"obj",
"=",
"self",
",",
"a... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/toolbox.py#L121-L138 | |
herbstluftwm/herbstluftwm | 23ef0274bd4d317208eae5fea72b21478a71431b | doc/gendoc.py | python | TokenGroup.IsTokenGroup | (tokenStringOrGroup, opening_token=None) | returns whether the given object is a token group.
if an 'opening_token' is given, it is additionally checked
whether the opening_token matches | returns whether the given object is a token group.
if an 'opening_token' is given, it is additionally checked
whether the opening_token matches | [
"returns",
"whether",
"the",
"given",
"object",
"is",
"a",
"token",
"group",
".",
"if",
"an",
"opening_token",
"is",
"given",
"it",
"is",
"additionally",
"checked",
"whether",
"the",
"opening_token",
"matches"
] | def IsTokenGroup(tokenStringOrGroup, opening_token=None):
"""returns whether the given object is a token group.
if an 'opening_token' is given, it is additionally checked
whether the opening_token matches"""
if isinstance(tokenStringOrGroup, TokenGroup):
if opening_token is n... | [
"def",
"IsTokenGroup",
"(",
"tokenStringOrGroup",
",",
"opening_token",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"tokenStringOrGroup",
",",
"TokenGroup",
")",
":",
"if",
"opening_token",
"is",
"not",
"None",
":",
"return",
"tokenStringOrGroup",
".",
"open... | https://github.com/herbstluftwm/herbstluftwm/blob/23ef0274bd4d317208eae5fea72b21478a71431b/doc/gendoc.py#L120-L130 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/closure_linter/closure_linter/statetracker.py | python | _GetNextIdentifierToken | (start_token) | return None | Searches for and returns the first identifier at the beginning of a token.
Searches each token after the start to see if it starts with an identifier.
If found, will split the token into at most 3 piecies: leading whitespace,
identifier, rest of token, returning the identifier token. If no identifier is
found ... | Searches for and returns the first identifier at the beginning of a token. | [
"Searches",
"for",
"and",
"returns",
"the",
"first",
"identifier",
"at",
"the",
"beginning",
"of",
"a",
"token",
"."
] | def _GetNextIdentifierToken(start_token):
"""Searches for and returns the first identifier at the beginning of a token.
Searches each token after the start to see if it starts with an identifier.
If found, will split the token into at most 3 piecies: leading whitespace,
identifier, rest of token, returning the... | [
"def",
"_GetNextIdentifierToken",
"(",
"start_token",
")",
":",
"token",
"=",
"start_token",
".",
"next",
"while",
"token",
"and",
"not",
"token",
".",
"type",
"in",
"Type",
".",
"FLAG_ENDING_TYPES",
":",
"match",
"=",
"javascripttokenizer",
".",
"JavaScriptToke... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/statetracker.py#L438-L464 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/scipy/linalg.py | python | lu | (a, permute_l=False, overwrite_a=False, check_finite=True) | return p, l, u | Compute pivoted LU decomposition of a general matrix.
The decomposition is:
.. math::
A = P L U
where :math:`P` is a permutation matrix, :math:`L` lower triangular with unit
diagonal elements, and :math:`U` upper triangular.
Args:
a (Tensor): a :math:`(M, N)` matrix to decompose.... | Compute pivoted LU decomposition of a general matrix. | [
"Compute",
"pivoted",
"LU",
"decomposition",
"of",
"a",
"general",
"matrix",
"."
] | def lu(a, permute_l=False, overwrite_a=False, check_finite=True):
"""
Compute pivoted LU decomposition of a general matrix.
The decomposition is:
.. math::
A = P L U
where :math:`P` is a permutation matrix, :math:`L` lower triangular with unit
diagonal elements, and :math:`U` upper tr... | [
"def",
"lu",
"(",
"a",
",",
"permute_l",
"=",
"False",
",",
"overwrite_a",
"=",
"False",
",",
"check_finite",
"=",
"True",
")",
":",
"msp_lu",
"=",
"LU",
"(",
")",
"m_lu",
",",
"_",
",",
"p",
"=",
"msp_lu",
"(",
"a",
")",
"m",
"=",
"a",
".",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/scipy/linalg.py#L520-L590 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.