nwo stringlengths 5 86 | sha stringlengths 40 40 | path stringlengths 4 189 | language stringclasses 1
value | identifier stringlengths 1 94 | parameters stringlengths 2 4.03k | argument_list stringclasses 1
value | return_statement stringlengths 0 11.5k | docstring stringlengths 1 33.2k | docstring_summary stringlengths 0 5.15k | docstring_tokens list | function stringlengths 34 151k | function_tokens list | url stringlengths 90 278 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | relaxNgSchema.relaxNGNewValidCtxt | (self) | return __tmp | Create an XML RelaxNGs validation context based on the
given schema | Create an XML RelaxNGs validation context based on the
given schema | [
"Create",
"an",
"XML",
"RelaxNGs",
"validation",
"context",
"based",
"on",
"the",
"given",
"schema"
] | def relaxNGNewValidCtxt(self):
"""Create an XML RelaxNGs validation context based on the
given schema """
ret = libxml2mod.xmlRelaxNGNewValidCtxt(self._o)
if ret is None:raise treeError('xmlRelaxNGNewValidCtxt() failed')
__tmp = relaxNgValidCtxt(_obj=ret)
__tmp.schema ... | [
"def",
"relaxNGNewValidCtxt",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlRelaxNGNewValidCtxt",
"(",
"self",
".",
"_o",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"treeError",
"(",
"'xmlRelaxNGNewValidCtxt() failed'",
")",
"__tmp",
"=",
"relax... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L5476-L5483 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/ransom-note.py | python | Solution2.canConstruct | (self, ransomNote, magazine) | return not collections.Counter(ransomNote) - collections.Counter(magazine) | :type ransomNote: str
:type magazine: str
:rtype: bool | :type ransomNote: str
:type magazine: str
:rtype: bool | [
":",
"type",
"ransomNote",
":",
"str",
":",
"type",
"magazine",
":",
"str",
":",
"rtype",
":",
"bool"
] | def canConstruct(self, ransomNote, magazine):
"""
:type ransomNote: str
:type magazine: str
:rtype: bool
"""
return not collections.Counter(ransomNote) - collections.Counter(magazine) | [
"def",
"canConstruct",
"(",
"self",
",",
"ransomNote",
",",
"magazine",
")",
":",
"return",
"not",
"collections",
".",
"Counter",
"(",
"ransomNote",
")",
"-",
"collections",
".",
"Counter",
"(",
"magazine",
")"
] | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/ransom-note.py#L33-L39 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/numpy/math_ops.py | python | _handle_prepend_append | (combined, tensor, additional_tensor, axis) | return combined | Concatenates prepend or append to tensor. | Concatenates prepend or append to tensor. | [
"Concatenates",
"prepend",
"or",
"append",
"to",
"tensor",
"."
] | def _handle_prepend_append(combined, tensor, additional_tensor, axis):
"""Concatenates prepend or append to tensor."""
if isinstance(additional_tensor, (int, float, bool)):
additional_tensor = asarray_const(additional_tensor)
elif not isinstance(additional_tensor, Tensor):
_raise_type_error(... | [
"def",
"_handle_prepend_append",
"(",
"combined",
",",
"tensor",
",",
"additional_tensor",
",",
"axis",
")",
":",
"if",
"isinstance",
"(",
"additional_tensor",
",",
"(",
"int",
",",
"float",
",",
"bool",
")",
")",
":",
"additional_tensor",
"=",
"asarray_const"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/numpy/math_ops.py#L1882-L1892 | |
eerolanguage/clang | 91360bee004a1cbdb95fe5eb605ef243152da41b | docs/tools/dump_ast_matchers.py | python | act_on_decl | (declaration, comment, allowed_types) | Parse the matcher out of the given declaration and comment.
If 'allowed_types' is set, it contains a list of node types the matcher
can match on, as extracted from the static type asserts in the matcher
definition. | Parse the matcher out of the given declaration and comment. | [
"Parse",
"the",
"matcher",
"out",
"of",
"the",
"given",
"declaration",
"and",
"comment",
"."
] | def act_on_decl(declaration, comment, allowed_types):
"""Parse the matcher out of the given declaration and comment.
If 'allowed_types' is set, it contains a list of node types the matcher
can match on, as extracted from the static type asserts in the matcher
definition.
"""
if declaration.strip()... | [
"def",
"act_on_decl",
"(",
"declaration",
",",
"comment",
",",
"allowed_types",
")",
":",
"if",
"declaration",
".",
"strip",
"(",
")",
":",
"# Node matchers are defined by writing:",
"# VariadicDynCastAllOfMatcher<ResultType, ArgumentType> name;",
"m",
"=",
"re",
".",
... | https://github.com/eerolanguage/clang/blob/91360bee004a1cbdb95fe5eb605ef243152da41b/docs/tools/dump_ast_matchers.py#L126-L277 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGrid.SetVirtualWidth | (*args, **kwargs) | return _propgrid.PropertyGrid_SetVirtualWidth(*args, **kwargs) | SetVirtualWidth(self, int width) | SetVirtualWidth(self, int width) | [
"SetVirtualWidth",
"(",
"self",
"int",
"width",
")"
] | def SetVirtualWidth(*args, **kwargs):
"""SetVirtualWidth(self, int width)"""
return _propgrid.PropertyGrid_SetVirtualWidth(*args, **kwargs) | [
"def",
"SetVirtualWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGrid_SetVirtualWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L2299-L2301 | |
intel/caffe | 3f494b442ee3f9d17a07b09ecbd5fa2bbda00836 | examples/rfcn/lib/pycocotools/coco.py | python | COCO.loadRes | (self, resFile) | return res | Load result file and return a result api object.
:param resFile (str) : file name of result file
:return: res (obj) : result api object | Load result file and return a result api object.
:param resFile (str) : file name of result file
:return: res (obj) : result api object | [
"Load",
"result",
"file",
"and",
"return",
"a",
"result",
"api",
"object",
".",
":",
"param",
"resFile",
"(",
"str",
")",
":",
"file",
"name",
"of",
"result",
"file",
":",
"return",
":",
"res",
"(",
"obj",
")",
":",
"result",
"api",
"object"
] | def loadRes(self, resFile):
"""
Load result file and return a result api object.
:param resFile (str) : file name of result file
:return: res (obj) : result api object
"""
res = COCO()
res.dataset['images'] = [img for img in self.dataset['images']]
... | [
"def",
"loadRes",
"(",
"self",
",",
"resFile",
")",
":",
"res",
"=",
"COCO",
"(",
")",
"res",
".",
"dataset",
"[",
"'images'",
"]",
"=",
"[",
"img",
"for",
"img",
"in",
"self",
".",
"dataset",
"[",
"'images'",
"]",
"]",
"# res.dataset['info'] = copy.de... | https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/rfcn/lib/pycocotools/coco.py#L281-L327 | |
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | llvm/utils/lit/lit/run.py | python | Run.execute | (self) | Execute the tests in the run using up to the specified number of
parallel tasks, and inform the caller of each individual result. The
provided tests should be a subset of the tests available in this run
object.
The progress_callback will be invoked for each completed test.
If t... | Execute the tests in the run using up to the specified number of
parallel tasks, and inform the caller of each individual result. The
provided tests should be a subset of the tests available in this run
object. | [
"Execute",
"the",
"tests",
"in",
"the",
"run",
"using",
"up",
"to",
"the",
"specified",
"number",
"of",
"parallel",
"tasks",
"and",
"inform",
"the",
"caller",
"of",
"each",
"individual",
"result",
".",
"The",
"provided",
"tests",
"should",
"be",
"a",
"subs... | def execute(self):
"""
Execute the tests in the run using up to the specified number of
parallel tasks, and inform the caller of each individual result. The
provided tests should be a subset of the tests available in this run
object.
The progress_callback will be invoked... | [
"def",
"execute",
"(",
"self",
")",
":",
"self",
".",
"failure_count",
"=",
"0",
"self",
".",
"hit_max_failures",
"=",
"False",
"# Larger timeouts (one year, positive infinity) don't work on Windows.",
"one_week",
"=",
"7",
"*",
"24",
"*",
"60",
"*",
"60",
"# days... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/llvm/utils/lit/lit/run.py#L35-L66 | ||
gnuradio/gnuradio | 09c3c4fa4bfb1a02caac74cb5334dfe065391e3b | gr-channels/python/channels/impairments.py | python | impairments.set_i_ofs | (self, i_ofs) | Set inphase part of DC offset | Set inphase part of DC offset | [
"Set",
"inphase",
"part",
"of",
"DC",
"offset"
] | def set_i_ofs(self, i_ofs):
"""Set inphase part of DC offset"""
self.i_ofs = i_ofs
self.dc_offset.set_k((self.i_ofs + self.q_ofs * 1j, )) | [
"def",
"set_i_ofs",
"(",
"self",
",",
"i_ofs",
")",
":",
"self",
".",
"i_ofs",
"=",
"i_ofs",
"self",
".",
"dc_offset",
".",
"set_k",
"(",
"(",
"self",
".",
"i_ofs",
"+",
"self",
".",
"q_ofs",
"*",
"1j",
",",
")",
")"
] | https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-channels/python/channels/impairments.py#L116-L119 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/__init__.py | python | Process.num_ctx_switches | (self) | return self._proc.num_ctx_switches() | Return the number of voluntary and involuntary context
switches performed by this process. | Return the number of voluntary and involuntary context
switches performed by this process. | [
"Return",
"the",
"number",
"of",
"voluntary",
"and",
"involuntary",
"context",
"switches",
"performed",
"by",
"this",
"process",
"."
] | def num_ctx_switches(self):
"""Return the number of voluntary and involuntary context
switches performed by this process.
"""
return self._proc.num_ctx_switches() | [
"def",
"num_ctx_switches",
"(",
"self",
")",
":",
"return",
"self",
".",
"_proc",
".",
"num_ctx_switches",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/__init__.py#L868-L872 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewListCtrl.SetValue | (*args, **kwargs) | return _dataview.DataViewListCtrl_SetValue(*args, **kwargs) | SetValue(self, wxVariant value, unsigned int row, unsigned int col) | SetValue(self, wxVariant value, unsigned int row, unsigned int col) | [
"SetValue",
"(",
"self",
"wxVariant",
"value",
"unsigned",
"int",
"row",
"unsigned",
"int",
"col",
")"
] | def SetValue(*args, **kwargs):
"""SetValue(self, wxVariant value, unsigned int row, unsigned int col)"""
return _dataview.DataViewListCtrl_SetValue(*args, **kwargs) | [
"def",
"SetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewListCtrl_SetValue",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L2176-L2178 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/_parseaddr.py | python | AddrlistClass.__init__ | (self, field) | Initialize a new instance.
`field' is an unparsed address header field, containing
one or more addresses. | Initialize a new instance. | [
"Initialize",
"a",
"new",
"instance",
"."
] | def __init__(self, field):
"""Initialize a new instance.
`field' is an unparsed address header field, containing
one or more addresses.
"""
self.specials = '()<>@,:;.\"[]'
self.pos = 0
self.LWS = ' \t'
self.CR = '\r\n'
self.FWS = self.LWS + self.C... | [
"def",
"__init__",
"(",
"self",
",",
"field",
")",
":",
"self",
".",
"specials",
"=",
"'()<>@,:;.\\\"[]'",
"self",
".",
"pos",
"=",
"0",
"self",
".",
"LWS",
"=",
"' \\t'",
"self",
".",
"CR",
"=",
"'\\r\\n'",
"self",
".",
"FWS",
"=",
"self",
".",
"L... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/email/_parseaddr.py#L182-L199 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/idl/idl/generator.py | python | _CppHeaderFileWriter.gen_template_declaration | (self) | Generate a template declaration for a command's base class. | Generate a template declaration for a command's base class. | [
"Generate",
"a",
"template",
"declaration",
"for",
"a",
"command",
"s",
"base",
"class",
"."
] | def gen_template_declaration(self):
# type: () -> None
"""Generate a template declaration for a command's base class."""
self._writer.write_line('template <typename Derived>') | [
"def",
"gen_template_declaration",
"(",
"self",
")",
":",
"# type: () -> None",
"self",
".",
"_writer",
".",
"write_line",
"(",
"'template <typename Derived>'",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/generator.py#L853-L856 | ||
facebook/openr | ed38bdfd6bf290084bfab4821b59f83e7b59315d | openr/py/openr/cli/commands/kvstore.py | python | StreamSummaryCmd.get_subscriber_row | (self, stream_session_info) | return row | Takes StreamSubscriberInfo from thrift and returns list[str] (aka row)
representing the subscriber | Takes StreamSubscriberInfo from thrift and returns list[str] (aka row)
representing the subscriber | [
"Takes",
"StreamSubscriberInfo",
"from",
"thrift",
"and",
"returns",
"list",
"[",
"str",
"]",
"(",
"aka",
"row",
")",
"representing",
"the",
"subscriber"
] | def get_subscriber_row(self, stream_session_info):
"""
Takes StreamSubscriberInfo from thrift and returns list[str] (aka row)
representing the subscriber
"""
uptime = "unknown"
last_msg_time = "unknown"
if (
stream_session_info.uptime is not None
... | [
"def",
"get_subscriber_row",
"(",
"self",
",",
"stream_session_info",
")",
":",
"uptime",
"=",
"\"unknown\"",
"last_msg_time",
"=",
"\"unknown\"",
"if",
"(",
"stream_session_info",
".",
"uptime",
"is",
"not",
"None",
"and",
"stream_session_info",
".",
"last_msg_sent... | https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/commands/kvstore.py#L1417-L1442 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/wrappers/framework.py | python | NonInteractiveDebugWrapperSession.__init__ | (self, sess, watch_fn=None, thread_name_filter=None,
pass_through_operrors=False) | Constructor of NonInteractiveDebugWrapperSession.
Args:
sess: The TensorFlow `Session` object being wrapped.
watch_fn: (`Callable`) A Callable that maps the fetches and feeds of a
debugged `Session.run()` call to `WatchOptions.`
* Args:
* `fetches`: the fetches to the `Session... | Constructor of NonInteractiveDebugWrapperSession. | [
"Constructor",
"of",
"NonInteractiveDebugWrapperSession",
"."
] | def __init__(self, sess, watch_fn=None, thread_name_filter=None,
pass_through_operrors=False):
"""Constructor of NonInteractiveDebugWrapperSession.
Args:
sess: The TensorFlow `Session` object being wrapped.
watch_fn: (`Callable`) A Callable that maps the fetches and feeds of a
... | [
"def",
"__init__",
"(",
"self",
",",
"sess",
",",
"watch_fn",
"=",
"None",
",",
"thread_name_filter",
"=",
"None",
",",
"pass_through_operrors",
"=",
"False",
")",
":",
"BaseDebugWrapperSession",
".",
"__init__",
"(",
"self",
",",
"sess",
",",
"thread_name_fil... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/wrappers/framework.py#L889-L923 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/lib/utils.py | python | _median_nancheck | (data, result, axis, out) | return result | Utility function to check median result from data for NaN values at the end
and return NaN in that case. Input result can also be a MaskedArray.
Parameters
----------
data : array
Input data to median function
result : Array or MaskedArray
Result of median function
axis : int
... | Utility function to check median result from data for NaN values at the end
and return NaN in that case. Input result can also be a MaskedArray. | [
"Utility",
"function",
"to",
"check",
"median",
"result",
"from",
"data",
"for",
"NaN",
"values",
"at",
"the",
"end",
"and",
"return",
"NaN",
"in",
"that",
"case",
".",
"Input",
"result",
"can",
"also",
"be",
"a",
"MaskedArray",
"."
] | def _median_nancheck(data, result, axis, out):
"""
Utility function to check median result from data for NaN values at the end
and return NaN in that case. Input result can also be a MaskedArray.
Parameters
----------
data : array
Input data to median function
result : Array or Mask... | [
"def",
"_median_nancheck",
"(",
"data",
",",
"result",
",",
"axis",
",",
"out",
")",
":",
"if",
"data",
".",
"size",
"==",
"0",
":",
"return",
"result",
"n",
"=",
"np",
".",
"isnan",
"(",
"data",
".",
"take",
"(",
"-",
"1",
",",
"axis",
"=",
"a... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/utils.py#L1007-L1043 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_parser.py | python | p_paramval_false | (p) | paramval : FALSE | paramval : FALSE | [
"paramval",
":",
"FALSE"
] | def p_paramval_false(p):
'paramval : FALSE'
p[0] = Atom('false')
p[0].lineno = get_lineno(p,1) | [
"def",
"p_paramval_false",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"Atom",
"(",
"'false'",
")",
"p",
"[",
"0",
"]",
".",
"lineno",
"=",
"get_lineno",
"(",
"p",
",",
"1",
")"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_parser.py#L774-L777 | ||
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/trade_bin.py | python | TradeBin.open | (self, open) | Sets the open of this TradeBin.
:param open: The open of this TradeBin. # noqa: E501
:type: float | Sets the open of this TradeBin. | [
"Sets",
"the",
"open",
"of",
"this",
"TradeBin",
"."
] | def open(self, open):
"""Sets the open of this TradeBin.
:param open: The open of this TradeBin. # noqa: E501
:type: float
"""
self._open = open | [
"def",
"open",
"(",
"self",
",",
"open",
")",
":",
"self",
".",
"_open",
"=",
"open"
] | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/trade_bin.py#L165-L173 | ||
forkineye/ESPixelStick | 22926f1c0d1131f1369fc7cad405689a095ae3cb | dist/bin/esptool/esptool.py | python | BaseFirmwareImage.save_segment | (self, f, segment, checksum=None) | Save the next segment to the image file, return next checksum value if provided | Save the next segment to the image file, return next checksum value if provided | [
"Save",
"the",
"next",
"segment",
"to",
"the",
"image",
"file",
"return",
"next",
"checksum",
"value",
"if",
"provided"
] | def save_segment(self, f, segment, checksum=None):
""" Save the next segment to the image file, return next checksum value if provided """
segment_data = self.maybe_patch_segment_data(f, segment.data)
f.write(struct.pack('<II', segment.addr, len(segment_data)))
f.write(segment_data)
... | [
"def",
"save_segment",
"(",
"self",
",",
"f",
",",
"segment",
",",
"checksum",
"=",
"None",
")",
":",
"segment_data",
"=",
"self",
".",
"maybe_patch_segment_data",
"(",
"f",
",",
"segment",
".",
"data",
")",
"f",
".",
"write",
"(",
"struct",
".",
"pack... | https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/esptool.py#L1501-L1507 | ||
Samsung/veles | 95ed733c2e49bc011ad98ccf2416ecec23fbf352 | veles/external/progressbar/widgets.py | python | AdaptiveETA.update | (self, pbar) | Updates the widget to show the ETA or total time when finished. | Updates the widget to show the ETA or total time when finished. | [
"Updates",
"the",
"widget",
"to",
"show",
"the",
"ETA",
"or",
"total",
"time",
"when",
"finished",
"."
] | def update(self, pbar):
"""Updates the widget to show the ETA or total time when finished."""
if pbar.currval == 0:
return 'ETA: --:--:--'
elif pbar.finished:
return 'Time: %s' % self.format_time(pbar.seconds_elapsed)
else:
elapsed = pbar.seconds_elap... | [
"def",
"update",
"(",
"self",
",",
"pbar",
")",
":",
"if",
"pbar",
".",
"currval",
"==",
"0",
":",
"return",
"'ETA: --:--:--'",
"elif",
"pbar",
".",
"finished",
":",
"return",
"'Time: %s'",
"%",
"self",
".",
"format_time",
"(",
"pbar",
".",
"seconds_ela... | https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/external/progressbar/widgets.py#L150-L166 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | FileSystemHandler.GetRightLocation | (*args, **kwargs) | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) | GetRightLocation(String location) -> String | GetRightLocation(String location) -> String | [
"GetRightLocation",
"(",
"String",
"location",
")",
"-",
">",
"String"
] | def GetRightLocation(*args, **kwargs):
"""GetRightLocation(String location) -> String"""
return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) | [
"def",
"GetRightLocation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"FileSystemHandler_GetRightLocation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L2375-L2377 | |
GoSSIP-SJTU/TripleDoggy | 03648d6b19c812504b14e8b98c8c7b3f443f4e54 | tools/clang/bindings/python/clang/cindex.py | python | Cursor.extent | (self) | return self._extent | Return the source range (the range of text) occupied by the entity
pointed at by the cursor. | Return the source range (the range of text) occupied by the entity
pointed at by the cursor. | [
"Return",
"the",
"source",
"range",
"(",
"the",
"range",
"of",
"text",
")",
"occupied",
"by",
"the",
"entity",
"pointed",
"at",
"by",
"the",
"cursor",
"."
] | def extent(self):
"""
Return the source range (the range of text) occupied by the entity
pointed at by the cursor.
"""
if not hasattr(self, '_extent'):
self._extent = conf.lib.clang_getCursorExtent(self)
return self._extent | [
"def",
"extent",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_extent'",
")",
":",
"self",
".",
"_extent",
"=",
"conf",
".",
"lib",
".",
"clang_getCursorExtent",
"(",
"self",
")",
"return",
"self",
".",
"_extent"
] | https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/bindings/python/clang/cindex.py#L1577-L1585 | |
DLR-SC/tigl | d1c5901e948e33d10b1f9659ff3e22c4717b455f | bindings/python_internal/tigl3/occ_helpers/containers.py | python | int_array | (int_list) | return result | Creates an OpenCASCADE TColStd_HArray1OfInteger from
a list of integers
:param int_list: List of integer values
:return: TColStd_HArray1OfInteger | Creates an OpenCASCADE TColStd_HArray1OfInteger from
a list of integers
:param int_list: List of integer values
:return: TColStd_HArray1OfInteger | [
"Creates",
"an",
"OpenCASCADE",
"TColStd_HArray1OfInteger",
"from",
"a",
"list",
"of",
"integers",
":",
"param",
"int_list",
":",
"List",
"of",
"integer",
"values",
":",
"return",
":",
"TColStd_HArray1OfInteger"
] | def int_array(int_list):
"""
Creates an OpenCASCADE TColStd_HArray1OfInteger from
a list of integers
:param int_list: List of integer values
:return: TColStd_HArray1OfInteger
"""
result = TColStd_HArray1OfInteger(1, len(int_list))
for i, value in enumerate(int_list):
result.SetVa... | [
"def",
"int_array",
"(",
"int_list",
")",
":",
"result",
"=",
"TColStd_HArray1OfInteger",
"(",
"1",
",",
"len",
"(",
"int_list",
")",
")",
"for",
"i",
",",
"value",
"in",
"enumerate",
"(",
"int_list",
")",
":",
"result",
".",
"SetValue",
"(",
"i",
"+",... | https://github.com/DLR-SC/tigl/blob/d1c5901e948e33d10b1f9659ff3e22c4717b455f/bindings/python_internal/tigl3/occ_helpers/containers.py#L22-L32 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/frame.py | python | DataFrame.query | (self, expr, inplace=False, **kwargs) | Query the columns of a DataFrame with a boolean expression.
Parameters
----------
expr : string
The query string to evaluate. You can refer to variables
in the environment by prefixing them with an '@' character like
``@a + b``.
inplace : bool
... | Query the columns of a DataFrame with a boolean expression. | [
"Query",
"the",
"columns",
"of",
"a",
"DataFrame",
"with",
"a",
"boolean",
"expression",
"."
] | def query(self, expr, inplace=False, **kwargs):
"""
Query the columns of a DataFrame with a boolean expression.
Parameters
----------
expr : string
The query string to evaluate. You can refer to variables
in the environment by prefixing them with an '@' ... | [
"def",
"query",
"(",
"self",
",",
"expr",
",",
"inplace",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"'inplace'",
")",
"if",
"not",
"isinstance",
"(",
"expr",
",",
"compat",
".",
"string... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/frame.py#L3012-L3100 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/IO/PEM.py | python | decode | (pem_data, passphrase=None) | return (data, marker, enc_flag) | Decode a PEM block into binary.
Args:
pem_data (string):
The PEM block.
passphrase (byte string):
If given and the PEM block is encrypted,
the key will be derived from the passphrase.
Returns:
A tuple with the binary data, the marker string, and a boolean to
ind... | Decode a PEM block into binary. | [
"Decode",
"a",
"PEM",
"block",
"into",
"binary",
"."
] | def decode(pem_data, passphrase=None):
"""Decode a PEM block into binary.
Args:
pem_data (string):
The PEM block.
passphrase (byte string):
If given and the PEM block is encrypted,
the key will be derived from the passphrase.
Returns:
A tuple with the binary data,... | [
"def",
"decode",
"(",
"pem_data",
",",
"passphrase",
"=",
"None",
")",
":",
"# Verify Pre-Encapsulation Boundary",
"r",
"=",
"re",
".",
"compile",
"(",
"r\"\\s*-----BEGIN (.*)-----\\s+\"",
")",
"m",
"=",
"r",
".",
"match",
"(",
"pem_data",
")",
"if",
"not",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/IO/PEM.py#L106-L189 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/listobj.py | python | get_list_payload | (context, builder, list_type, value) | return context.make_data_helper(builder, payload_type, ref=payload) | Given a list value and type, get its payload structure (as a
reference, so that mutations are seen by all). | Given a list value and type, get its payload structure (as a
reference, so that mutations are seen by all). | [
"Given",
"a",
"list",
"value",
"and",
"type",
"get",
"its",
"payload",
"structure",
"(",
"as",
"a",
"reference",
"so",
"that",
"mutations",
"are",
"seen",
"by",
"all",
")",
"."
] | def get_list_payload(context, builder, list_type, value):
"""
Given a list value and type, get its payload structure (as a
reference, so that mutations are seen by all).
"""
payload_type = types.ListPayload(list_type)
payload = context.nrt.meminfo_data(builder, value.meminfo)
ptrty = context... | [
"def",
"get_list_payload",
"(",
"context",
",",
"builder",
",",
"list_type",
",",
"value",
")",
":",
"payload_type",
"=",
"types",
".",
"ListPayload",
"(",
"list_type",
")",
"payload",
"=",
"context",
".",
"nrt",
".",
"meminfo_data",
"(",
"builder",
",",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/listobj.py#L21-L30 | |
gklz1982/caffe-yolov2 | ebb27029db4ddc0d40e520634633b0fa9cdcc10d | scripts/cpp_lint.py | python | FindPreviousMatchingAngleBracket | (clean_lines, linenum, init_prefix) | return False | Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True if a matching bracket exists. | Find the corresponding < that started a template. | [
"Find",
"the",
"corresponding",
"<",
"that",
"started",
"a",
"template",
"."
] | def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix):
"""Find the corresponding < that started a template.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: Current line number.
init_prefix: Part of the current line before the initial >.
Returns:
True i... | [
"def",
"FindPreviousMatchingAngleBracket",
"(",
"clean_lines",
",",
"linenum",
",",
"init_prefix",
")",
":",
"line",
"=",
"init_prefix",
"nesting_stack",
"=",
"[",
"'>'",
"]",
"while",
"True",
":",
"# Find the previous operator",
"match",
"=",
"Search",
"(",
"r'^(... | https://github.com/gklz1982/caffe-yolov2/blob/ebb27029db4ddc0d40e520634633b0fa9cdcc10d/scripts/cpp_lint.py#L2586-L2640 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_interp.py | python | diagram | (state,clauses,implied=false_clauses(),extra_axioms=None,weaken=True) | return under | Return the diagram of a single model of clauses in state or
None if clauses are unsat. | Return the diagram of a single model of clauses in state or
None if clauses are unsat. | [
"Return",
"the",
"diagram",
"of",
"a",
"single",
"model",
"of",
"clauses",
"in",
"state",
"or",
"None",
"if",
"clauses",
"are",
"unsat",
"."
] | def diagram(state,clauses,implied=false_clauses(),extra_axioms=None,weaken=True):
""" Return the diagram of a single model of clauses in state or
None if clauses are unsat.
"""
axioms = state.domain.background_theory(state.in_scope)
if extra_axioms:
axioms = and_clauses(axioms,extra_axioms)
... | [
"def",
"diagram",
"(",
"state",
",",
"clauses",
",",
"implied",
"=",
"false_clauses",
"(",
")",
",",
"extra_axioms",
"=",
"None",
",",
"weaken",
"=",
"True",
")",
":",
"axioms",
"=",
"state",
".",
"domain",
".",
"background_theory",
"(",
"state",
".",
... | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_interp.py#L337-L345 | |
psnonis/FinBERT | c0c555d833a14e2316a3701e59c0b5156f804b4e | bert-gpu/tensorrt-inference-server/src/clients/python/__init__.py | python | ServerStatusContext.close | (self) | Close the context. Any future calls to get_server_status() will
result in an Error. | Close the context. Any future calls to get_server_status() will
result in an Error. | [
"Close",
"the",
"context",
".",
"Any",
"future",
"calls",
"to",
"get_server_status",
"()",
"will",
"result",
"in",
"an",
"Error",
"."
] | def close(self):
"""Close the context. Any future calls to get_server_status() will
result in an Error.
"""
_crequest_status_ctx_del(self._ctx)
self._ctx = None | [
"def",
"close",
"(",
"self",
")",
":",
"_crequest_status_ctx_del",
"(",
"self",
".",
"_ctx",
")",
"self",
".",
"_ctx",
"=",
"None"
] | https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert-gpu/tensorrt-inference-server/src/clients/python/__init__.py#L439-L445 | ||
ianmaclarty/amulet | 3d1363e0a0dde5e4c346409cefab66c2dc91b237 | third_party/freetype-2.5.5/src/tools/docmaker/tohtml.py | python | HtmlFormatter.make_html_code | ( self, lines ) | return line + code_footer | Convert a code sequence to HTML. | Convert a code sequence to HTML. | [
"Convert",
"a",
"code",
"sequence",
"to",
"HTML",
"."
] | def make_html_code( self, lines ):
"""Convert a code sequence to HTML."""
line = code_header + '\n'
for l in lines:
line = line + html_quote( l ) + '\n'
return line + code_footer | [
"def",
"make_html_code",
"(",
"self",
",",
"lines",
")",
":",
"line",
"=",
"code_header",
"+",
"'\\n'",
"for",
"l",
"in",
"lines",
":",
"line",
"=",
"line",
"+",
"html_quote",
"(",
"l",
")",
"+",
"'\\n'",
"return",
"line",
"+",
"code_footer"
] | https://github.com/ianmaclarty/amulet/blob/3d1363e0a0dde5e4c346409cefab66c2dc91b237/third_party/freetype-2.5.5/src/tools/docmaker/tohtml.py#L365-L371 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/layout.py | python | Layout.focus_previous | (self) | Focus the previous visible/focusable Window. | Focus the previous visible/focusable Window. | [
"Focus",
"the",
"previous",
"visible",
"/",
"focusable",
"Window",
"."
] | def focus_previous(self) -> None:
"""
Focus the previous visible/focusable Window.
"""
windows = self.get_visible_focusable_windows()
if len(windows) > 0:
try:
index = windows.index(self.current_window)
except ValueError:
i... | [
"def",
"focus_previous",
"(",
"self",
")",
"->",
"None",
":",
"windows",
"=",
"self",
".",
"get_visible_focusable_windows",
"(",
")",
"if",
"len",
"(",
"windows",
")",
">",
"0",
":",
"try",
":",
"index",
"=",
"windows",
".",
"index",
"(",
"self",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/layout.py#L325-L339 | ||
indutny/candor | 48e7260618f5091c80a3416828e2808cad3ea22e | tools/gyp/pylib/gyp/win_tool.py | python | WinTool._CommandifyName | (self, name_string) | return name_string.title().replace('-', '') | Transforms a tool name like recursive-mirror to RecursiveMirror. | Transforms a tool name like recursive-mirror to RecursiveMirror. | [
"Transforms",
"a",
"tool",
"name",
"like",
"recursive",
"-",
"mirror",
"to",
"RecursiveMirror",
"."
] | def _CommandifyName(self, name_string):
"""Transforms a tool name like recursive-mirror to RecursiveMirror."""
return name_string.title().replace('-', '') | [
"def",
"_CommandifyName",
"(",
"self",
",",
"name_string",
")",
":",
"return",
"name_string",
".",
"title",
"(",
")",
".",
"replace",
"(",
"'-'",
",",
"''",
")"
] | https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/win_tool.py#L56-L58 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/distributions/util.py | python | prefer_static_value | (x) | return x | Return static value of tensor `x` if available, else `x`.
Args:
x: `Tensor` (already converted).
Returns:
Numpy array (if static value is obtainable), else `Tensor`. | Return static value of tensor `x` if available, else `x`. | [
"Return",
"static",
"value",
"of",
"tensor",
"x",
"if",
"available",
"else",
"x",
"."
] | def prefer_static_value(x):
"""Return static value of tensor `x` if available, else `x`.
Args:
x: `Tensor` (already converted).
Returns:
Numpy array (if static value is obtainable), else `Tensor`.
"""
static_x = tensor_util.constant_value(x)
if static_x is not None:
return static_x
return x | [
"def",
"prefer_static_value",
"(",
"x",
")",
":",
"static_x",
"=",
"tensor_util",
".",
"constant_value",
"(",
"x",
")",
"if",
"static_x",
"is",
"not",
"None",
":",
"return",
"static_x",
"return",
"x"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/distributions/util.py#L772-L784 | |
MhLiao/TextBoxes_plusplus | 39d4898de1504c53a2ed3d67966a57b3595836d0 | python/caffe/io.py | python | arraylist_to_blobprotovector_str | (arraylist) | return vec.SerializeToString() | Converts a list of arrays to a serialized blobprotovec, which could be
then passed to a network for processing. | Converts a list of arrays to a serialized blobprotovec, which could be
then passed to a network for processing. | [
"Converts",
"a",
"list",
"of",
"arrays",
"to",
"a",
"serialized",
"blobprotovec",
"which",
"could",
"be",
"then",
"passed",
"to",
"a",
"network",
"for",
"processing",
"."
] | def arraylist_to_blobprotovector_str(arraylist):
"""Converts a list of arrays to a serialized blobprotovec, which could be
then passed to a network for processing.
"""
vec = caffe_pb2.BlobProtoVector()
vec.blobs.extend([array_to_blobproto(arr) for arr in arraylist])
return vec.SerializeToString(... | [
"def",
"arraylist_to_blobprotovector_str",
"(",
"arraylist",
")",
":",
"vec",
"=",
"caffe_pb2",
".",
"BlobProtoVector",
"(",
")",
"vec",
".",
"blobs",
".",
"extend",
"(",
"[",
"array_to_blobproto",
"(",
"arr",
")",
"for",
"arr",
"in",
"arraylist",
"]",
")",
... | https://github.com/MhLiao/TextBoxes_plusplus/blob/39d4898de1504c53a2ed3d67966a57b3595836d0/python/caffe/io.py#L49-L55 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/models/image/cifar10/cifar10.py | python | _activation_summary | (x) | Helper to create summaries for activations.
Creates a summary that provides a histogram of activations.
Creates a summary that measure the sparsity of activations.
Args:
x: Tensor
Returns:
nothing | Helper to create summaries for activations. | [
"Helper",
"to",
"create",
"summaries",
"for",
"activations",
"."
] | def _activation_summary(x):
"""Helper to create summaries for activations.
Creates a summary that provides a histogram of activations.
Creates a summary that measure the sparsity of activations.
Args:
x: Tensor
Returns:
nothing
"""
# Remove 'tower_[0-9]/' from the name in case this is a multi-GP... | [
"def",
"_activation_summary",
"(",
"x",
")",
":",
"# Remove 'tower_[0-9]/' from the name in case this is a multi-GPU training",
"# session. This helps the clarity of presentation on tensorboard.",
"tensor_name",
"=",
"re",
".",
"sub",
"(",
"'%s_[0-9]*/'",
"%",
"TOWER_NAME",
",",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/models/image/cifar10/cifar10.py#L80-L95 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py | python | BasicFittingView.set_slot_for_dataset_changed | (self, slot) | Connect the slot for the display workspace combo box being changed. | Connect the slot for the display workspace combo box being changed. | [
"Connect",
"the",
"slot",
"for",
"the",
"display",
"workspace",
"combo",
"box",
"being",
"changed",
"."
] | def set_slot_for_dataset_changed(self, slot) -> None:
"""Connect the slot for the display workspace combo box being changed."""
self.workspace_selector.set_slot_for_dataset_changed(slot) | [
"def",
"set_slot_for_dataset_changed",
"(",
"self",
",",
"slot",
")",
"->",
"None",
":",
"self",
".",
"workspace_selector",
".",
"set_slot_for_dataset_changed",
"(",
"slot",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/basic_fitting/basic_fitting_view.py#L60-L62 | ||
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | example/rcnn/rcnn/pycocotools/coco.py | python | COCO.getImgIds | (self, imgIds=[], catIds=[]) | return list(ids) | Get img ids that satisfy given filter conditions.
:param imgIds (int array) : get imgs for given ids
:param catIds (int array) : get imgs with all given cats
:return: ids (int array) : integer array of img ids | Get img ids that satisfy given filter conditions.
:param imgIds (int array) : get imgs for given ids
:param catIds (int array) : get imgs with all given cats
:return: ids (int array) : integer array of img ids | [
"Get",
"img",
"ids",
"that",
"satisfy",
"given",
"filter",
"conditions",
".",
":",
"param",
"imgIds",
"(",
"int",
"array",
")",
":",
"get",
"imgs",
"for",
"given",
"ids",
":",
"param",
"catIds",
"(",
"int",
"array",
")",
":",
"get",
"imgs",
"with",
"... | def getImgIds(self, imgIds=[], catIds=[]):
'''
Get img ids that satisfy given filter conditions.
:param imgIds (int array) : get imgs for given ids
:param catIds (int array) : get imgs with all given cats
:return: ids (int array) : integer array of img ids
'''
im... | [
"def",
"getImgIds",
"(",
"self",
",",
"imgIds",
"=",
"[",
"]",
",",
"catIds",
"=",
"[",
"]",
")",
":",
"imgIds",
"=",
"imgIds",
"if",
"type",
"(",
"imgIds",
")",
"==",
"list",
"else",
"[",
"imgIds",
"]",
"catIds",
"=",
"catIds",
"if",
"type",
"("... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/rcnn/rcnn/pycocotools/coco.py#L191-L210 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/module.py | python | Module.add_metadata | (self, operands) | return md | Add an unnamed metadata to the module with the given *operands*
(a sequence of values) or return a previous equivalent metadata.
A MDValue instance is returned, it can then be associated to
e.g. an instruction. | Add an unnamed metadata to the module with the given *operands*
(a sequence of values) or return a previous equivalent metadata.
A MDValue instance is returned, it can then be associated to
e.g. an instruction. | [
"Add",
"an",
"unnamed",
"metadata",
"to",
"the",
"module",
"with",
"the",
"given",
"*",
"operands",
"*",
"(",
"a",
"sequence",
"of",
"values",
")",
"or",
"return",
"a",
"previous",
"equivalent",
"metadata",
".",
"A",
"MDValue",
"instance",
"is",
"returned"... | def add_metadata(self, operands):
"""
Add an unnamed metadata to the module with the given *operands*
(a sequence of values) or return a previous equivalent metadata.
A MDValue instance is returned, it can then be associated to
e.g. an instruction.
"""
if not isin... | [
"def",
"add_metadata",
"(",
"self",
",",
"operands",
")",
":",
"if",
"not",
"isinstance",
"(",
"operands",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"raise",
"TypeError",
"(",
"\"expected a list or tuple of metadata values, \"",
"\"got %r\"",
"%",
"(",
"o... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/module.py#L47-L65 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/nn/probability/distribution/log_normal.py | python | LogNormal._log_prob | (self, value, loc=None, scale=None) | return unadjust_prob + log_jacobian | r"""
Compute the log prob via the below formula,
where g is the exp bijector,
and P is the pdf of the underlying normal dist
.. math::
Y = g(X)
Py(a) = Px(g^{-1}(a)) * (g^{-1})'(a)
\log(Py(a)) = \log(Px(g^{-1}(a))) + \log((g^{-1})'(a)) | r"""
Compute the log prob via the below formula,
where g is the exp bijector,
and P is the pdf of the underlying normal dist
.. math::
Y = g(X)
Py(a) = Px(g^{-1}(a)) * (g^{-1})'(a)
\log(Py(a)) = \log(Px(g^{-1}(a))) + \log((g^{-1})'(a)) | [
"r",
"Compute",
"the",
"log",
"prob",
"via",
"the",
"below",
"formula",
"where",
"g",
"is",
"the",
"exp",
"bijector",
"and",
"P",
"is",
"the",
"pdf",
"of",
"the",
"underlying",
"normal",
"dist",
"..",
"math",
"::",
"Y",
"=",
"g",
"(",
"X",
")",
"Py... | def _log_prob(self, value, loc=None, scale=None):
r"""
Compute the log prob via the below formula,
where g is the exp bijector,
and P is the pdf of the underlying normal dist
.. math::
Y = g(X)
Py(a) = Px(g^{-1}(a)) * (g^{-1})'(a)
\log(Py(a)) =... | [
"def",
"_log_prob",
"(",
"self",
",",
"value",
",",
"loc",
"=",
"None",
",",
"scale",
"=",
"None",
")",
":",
"mean",
",",
"sd",
"=",
"self",
".",
"_check_param_type",
"(",
"loc",
",",
"scale",
")",
"inverse_value",
"=",
"self",
".",
"bijector",
"(",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/probability/distribution/log_normal.py#L222-L236 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/ttk.py | python | Treeview.column | (self, column, option=None, **kw) | return _val_or_dict(kw, self.tk.call, self._w, "column", column) | Query or modify the options for the specified column.
If kw is not given, returns a dict of the column option values. If
option is specified then the value for that option is returned.
Otherwise, sets the options to the corresponding values. | Query or modify the options for the specified column. | [
"Query",
"or",
"modify",
"the",
"options",
"for",
"the",
"specified",
"column",
"."
] | def column(self, column, option=None, **kw):
"""Query or modify the options for the specified column.
If kw is not given, returns a dict of the column option values. If
option is specified then the value for that option is returned.
Otherwise, sets the options to the corresponding value... | [
"def",
"column",
"(",
"self",
",",
"column",
",",
"option",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"if",
"option",
"is",
"not",
"None",
":",
"kw",
"[",
"option",
"]",
"=",
"None",
"return",
"_val_or_dict",
"(",
"kw",
",",
"self",
".",
"tk",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/ttk.py#L1203-L1211 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/sping/pid.py | python | Canvas.save | (self, file=None, format=None) | For backends that can be save to a file or sent to a
stream, create a valid file out of what's currently been
drawn on the canvas. Trigger any finalization here.
Though some backends may allow further drawing after this call,
presume that ... | For backends that can be save to a file or sent to a
stream, create a valid file out of what's currently been
drawn on the canvas. Trigger any finalization here.
Though some backends may allow further drawing after this call,
presume that ... | [
"For",
"backends",
"that",
"can",
"be",
"save",
"to",
"a",
"file",
"or",
"sent",
"to",
"a",
"stream",
"create",
"a",
"valid",
"file",
"out",
"of",
"what",
"s",
"currently",
"been",
"drawn",
"on",
"the",
"canvas",
".",
"Trigger",
"any",
"finalization",
... | def save(self, file=None, format=None):
"""For backends that can be save to a file or sent to a
stream, create a valid file out of what's currently been
drawn on the canvas. Trigger any finalization here.
Though some backends may allow further drawing... | [
"def",
"save",
"(",
"self",
",",
"file",
"=",
"None",
",",
"format",
"=",
"None",
")",
":",
"pass"
] | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/pid.py#L264-L278 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xpathContext.xpathNewParserContext | (self, str) | return __tmp | Create a new xmlXPathParserContext | Create a new xmlXPathParserContext | [
"Create",
"a",
"new",
"xmlXPathParserContext"
] | def xpathNewParserContext(self, str):
"""Create a new xmlXPathParserContext """
ret = libxml2mod.xmlXPathNewParserContext(str, self._o)
if ret is None:raise xpathError('xmlXPathNewParserContext() failed')
__tmp = xpathParserContext(_obj=ret)
return __tmp | [
"def",
"xpathNewParserContext",
"(",
"self",
",",
"str",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlXPathNewParserContext",
"(",
"str",
",",
"self",
".",
"_o",
")",
"if",
"ret",
"is",
"None",
":",
"raise",
"xpathError",
"(",
"'xmlXPathNewParserContext() fail... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L7357-L7362 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/generator/msvs.py | python | _EscapeEnvironmentVariableExpansion | (s) | return s | Escapes % characters.
Escapes any % characters so that Windows-style environment variable
expansions will leave them alone.
See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile
to understand why we have to do this.
Args:
s... | Escapes % characters. | [
"Escapes",
"%",
"characters",
"."
] | def _EscapeEnvironmentVariableExpansion(s):
"""Escapes % characters.
Escapes any % characters so that Windows-style environment variable
expansions will leave them alone.
See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile
to un... | [
"def",
"_EscapeEnvironmentVariableExpansion",
"(",
"s",
")",
":",
"s",
"=",
"s",
".",
"replace",
"(",
"'%'",
",",
"'%%'",
")",
"return",
"s"
] | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/generator/msvs.py#L684-L699 | |
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/exports.py | python | ExportPrint.pango_text_add_node_name | (self, tree_iter, pango_text) | Add Node Name to Pango Text Vector | Add Node Name to Pango Text Vector | [
"Add",
"Node",
"Name",
"to",
"Pango",
"Text",
"Vector"
] | def pango_text_add_node_name(self, tree_iter, pango_text):
"""Add Node Name to Pango Text Vector"""
pango_text[0] = "<b><i><span size=\"xx-large\">" \
+ cgi.escape(self.dad.treestore[tree_iter][1]) \
+ "</span></i></b>" + 2*cons.CHAR_NEWLINE + pango_text[0] | [
"def",
"pango_text_add_node_name",
"(",
"self",
",",
"tree_iter",
",",
"pango_text",
")",
":",
"pango_text",
"[",
"0",
"]",
"=",
"\"<b><i><span size=\\\"xx-large\\\">\"",
"+",
"cgi",
".",
"escape",
"(",
"self",
".",
"dad",
".",
"treestore",
"[",
"tree_iter",
"... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/exports.py#L261-L265 | ||
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSNew.py | python | MSVSProject.__init__ | (self, path, name = None, dependencies = None, guid = None,
spec = None, build_file = None, config_platform_overrides = None,
fixpath_prefix = None) | Initializes the project.
Args:
path: Absolute path to the project file.
name: Name of project. If None, the name will be the same as the base
name of the project file.
dependencies: List of other Project objects this project is dependent
upon, if not None.
guid: GUID to... | Initializes the project. | [
"Initializes",
"the",
"project",
"."
] | def __init__(self, path, name = None, dependencies = None, guid = None,
spec = None, build_file = None, config_platform_overrides = None,
fixpath_prefix = None):
"""Initializes the project.
Args:
path: Absolute path to the project file.
name: Name of project. If None,... | [
"def",
"__init__",
"(",
"self",
",",
"path",
",",
"name",
"=",
"None",
",",
"dependencies",
"=",
"None",
",",
"guid",
"=",
"None",
",",
"spec",
"=",
"None",
",",
"build_file",
"=",
"None",
",",
"config_platform_overrides",
"=",
"None",
",",
"fixpath_pref... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/MSVSNew.py#L112-L147 | ||
D-X-Y/caffe-faster-rcnn | eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb | python/caffe/io.py | python | Transformer.set_mean | (self, in_, mean) | Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable) | Set the mean to subtract for centering the data. | [
"Set",
"the",
"mean",
"to",
"subtract",
"for",
"centering",
"the",
"data",
"."
] | def set_mean(self, in_, mean):
"""
Set the mean to subtract for centering the data.
Parameters
----------
in_ : which input to assign this mean.
mean : mean ndarray (input dimensional or broadcastable)
"""
self.__check_input(in_)
ms = mean.shape
... | [
"def",
"set_mean",
"(",
"self",
",",
"in_",
",",
"mean",
")",
":",
"self",
".",
"__check_input",
"(",
"in_",
")",
"ms",
"=",
"mean",
".",
"shape",
"if",
"mean",
".",
"ndim",
"==",
"1",
":",
"# broadcast channels",
"if",
"ms",
"[",
"0",
"]",
"!=",
... | https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/python/caffe/io.py#L236-L265 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | BookCtrlBase.GetPageText | (*args, **kwargs) | return _core_.BookCtrlBase_GetPageText(*args, **kwargs) | GetPageText(self, size_t n) -> String | GetPageText(self, size_t n) -> String | [
"GetPageText",
"(",
"self",
"size_t",
"n",
")",
"-",
">",
"String"
] | def GetPageText(*args, **kwargs):
"""GetPageText(self, size_t n) -> String"""
return _core_.BookCtrlBase_GetPageText(*args, **kwargs) | [
"def",
"GetPageText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"BookCtrlBase_GetPageText",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13554-L13556 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py | python | Token.spelling | (self) | return conf.lib.clang_getTokenSpelling(self._tu, self) | The spelling of this token.
This is the textual representation of the token in source. | The spelling of this token. | [
"The",
"spelling",
"of",
"this",
"token",
"."
] | def spelling(self):
"""The spelling of this token.
This is the textual representation of the token in source.
"""
return conf.lib.clang_getTokenSpelling(self._tu, self) | [
"def",
"spelling",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_getTokenSpelling",
"(",
"self",
".",
"_tu",
",",
"self",
")"
] | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L3018-L3023 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/graph_editor/subgraph.py | python | SubGraphView.passthroughs | (self) | return util.ListView(self._passthrough_ts) | The passthrough tensors, going straight from input to output. | The passthrough tensors, going straight from input to output. | [
"The",
"passthrough",
"tensors",
"going",
"straight",
"from",
"input",
"to",
"output",
"."
] | def passthroughs(self):
"""The passthrough tensors, going straight from input to output."""
return util.ListView(self._passthrough_ts) | [
"def",
"passthroughs",
"(",
"self",
")",
":",
"return",
"util",
".",
"ListView",
"(",
"self",
".",
"_passthrough_ts",
")"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/graph_editor/subgraph.py#L514-L516 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Tools/CryVersionSelector/release_project.py | python | run | (project_file) | Entry point for setting up the process to release a packaged build. | Entry point for setting up the process to release a packaged build. | [
"Entry",
"point",
"for",
"setting",
"up",
"the",
"process",
"to",
"release",
"a",
"packaged",
"build",
"."
] | def run(project_file):
"""
Entry point for setting up the process to release a packaged build.
"""
# Path to the project file as created by the launcher
# Engine and project path are derivable from this.
project = cryproject.CryProject()
try:
project.load(project_file)
except Exc... | [
"def",
"run",
"(",
"project_file",
")",
":",
"# Path to the project file as created by the launcher",
"# Engine and project path are derivable from this.",
"project",
"=",
"cryproject",
".",
"CryProject",
"(",
")",
"try",
":",
"project",
".",
"load",
"(",
"project_file",
... | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Tools/CryVersionSelector/release_project.py#L67-L174 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/tbe/hsigmoid.py | python | _hsigmoid_tbe | () | return | HSigmoid TBE register | HSigmoid TBE register | [
"HSigmoid",
"TBE",
"register"
] | def _hsigmoid_tbe():
"""HSigmoid TBE register"""
return | [
"def",
"_hsigmoid_tbe",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/hsigmoid.py#L43-L45 | |
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/hang_analyzer.py | python | WindowsProcessList.__find_ps | (self) | return os.path.join(os.environ["WINDIR"], "system32", "tasklist.exe") | Finds tasklist | Finds tasklist | [
"Finds",
"tasklist"
] | def __find_ps(self):
"""Finds tasklist """
return os.path.join(os.environ["WINDIR"], "system32", "tasklist.exe") | [
"def",
"__find_ps",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"environ",
"[",
"\"WINDIR\"",
"]",
",",
"\"system32\"",
",",
"\"tasklist.exe\"",
")"
] | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/hang_analyzer.py#L168-L170 | |
facebook/openr | ed38bdfd6bf290084bfab4821b59f83e7b59315d | openr/py/openr/cli/utils/utils.py | python | build_global_prefix_db | (resp) | return global_prefix_db | build a map of all prefixes in the network. this is used
for checking for changes in topology
:param resp kv_store_types.Publication: the parsed publication
:return map(node, set([prefix])): the global prefix map,
prefixes mapped to the node | build a map of all prefixes in the network. this is used
for checking for changes in topology | [
"build",
"a",
"map",
"of",
"all",
"prefixes",
"in",
"the",
"network",
".",
"this",
"is",
"used",
"for",
"checking",
"for",
"changes",
"in",
"topology"
] | def build_global_prefix_db(resp):
"""build a map of all prefixes in the network. this is used
for checking for changes in topology
:param resp kv_store_types.Publication: the parsed publication
:return map(node, set([prefix])): the global prefix map,
prefixes mapped to the node
"""
# ... | [
"def",
"build_global_prefix_db",
"(",
"resp",
")",
":",
"# map: (node) -> set([prefix])",
"global_prefix_db",
"=",
"{",
"}",
"prefix_maps",
"=",
"collate_prefix_keys",
"(",
"resp",
".",
"keyVals",
")",
"for",
"_",
",",
"prefix_db",
"in",
"prefix_maps",
".",
"items... | https://github.com/facebook/openr/blob/ed38bdfd6bf290084bfab4821b59f83e7b59315d/openr/py/openr/cli/utils/utils.py#L436-L453 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Canvas.addtag_above | (self, newtag, tagOrId) | Add tag NEWTAG to all items above TAGORID. | Add tag NEWTAG to all items above TAGORID. | [
"Add",
"tag",
"NEWTAG",
"to",
"all",
"items",
"above",
"TAGORID",
"."
] | def addtag_above(self, newtag, tagOrId):
"""Add tag NEWTAG to all items above TAGORID."""
self.addtag(newtag, 'above', tagOrId) | [
"def",
"addtag_above",
"(",
"self",
",",
"newtag",
",",
"tagOrId",
")",
":",
"self",
".",
"addtag",
"(",
"newtag",
",",
"'above'",
",",
"tagOrId",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L2409-L2411 | ||
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/data_structures/gframe.py | python | GFrame.num_rows | (self) | Returns the number of rows.
Returns
-------
out : int
Number of rows in the SFrame. | Returns the number of rows. | [
"Returns",
"the",
"number",
"of",
"rows",
"."
] | def num_rows(self):
"""
Returns the number of rows.
Returns
-------
out : int
Number of rows in the SFrame.
"""
if self._is_vertex_frame():
return self.__graph__.summary()['num_vertices']
elif self._is_edge_frame():
ret... | [
"def",
"num_rows",
"(",
"self",
")",
":",
"if",
"self",
".",
"_is_vertex_frame",
"(",
")",
":",
"return",
"self",
".",
"__graph__",
".",
"summary",
"(",
")",
"[",
"'num_vertices'",
"]",
"elif",
"self",
".",
"_is_edge_frame",
"(",
")",
":",
"return",
"s... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/gframe.py#L222-L234 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | llvm/utils/git/pre-push.py | python | handle_push | (args, local_ref, local_sha, remote_ref, remote_sha) | return | Check a single push request (which can include multiple revisions) | Check a single push request (which can include multiple revisions) | [
"Check",
"a",
"single",
"push",
"request",
"(",
"which",
"can",
"include",
"multiple",
"revisions",
")"
] | def handle_push(args, local_ref, local_sha, remote_ref, remote_sha):
'''Check a single push request (which can include multiple revisions)'''
log_verbose('Handle push, reproduce with '
'`echo %s %s %s %s | pre-push.py %s %s'
% (local_ref, local_sha, remote_ref, remote_sha, args.... | [
"def",
"handle_push",
"(",
"args",
",",
"local_ref",
",",
"local_sha",
",",
"remote_ref",
",",
"remote_sha",
")",
":",
"log_verbose",
"(",
"'Handle push, reproduce with '",
"'`echo %s %s %s %s | pre-push.py %s %s'",
"%",
"(",
"local_ref",
",",
"local_sha",
",",
"remot... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/llvm/utils/git/pre-push.py#L141-L193 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/xcode_emulation.py | python | XcodeArchsDefault._VariableMapping | (self, sdkroot) | Returns the dictionary of variable mapping depending on the SDKROOT. | Returns the dictionary of variable mapping depending on the SDKROOT. | [
"Returns",
"the",
"dictionary",
"of",
"variable",
"mapping",
"depending",
"on",
"the",
"SDKROOT",
"."
] | def _VariableMapping(self, sdkroot):
"""Returns the dictionary of variable mapping depending on the SDKROOT."""
sdkroot = sdkroot.lower()
if 'iphoneos' in sdkroot:
return self._archs['ios']
elif 'iphonesimulator' in sdkroot:
return self._archs['iossim']
else:
return self._archs['ma... | [
"def",
"_VariableMapping",
"(",
"self",
",",
"sdkroot",
")",
":",
"sdkroot",
"=",
"sdkroot",
".",
"lower",
"(",
")",
"if",
"'iphoneos'",
"in",
"sdkroot",
":",
"return",
"self",
".",
"_archs",
"[",
"'ios'",
"]",
"elif",
"'iphonesimulator'",
"in",
"sdkroot",... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/xcode_emulation.py#L57-L65 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/ssl.py | python | SSLSocket.write | (self, data) | return self._sslobj.write(data) | Write DATA to the underlying SSL channel. Returns
number of bytes of DATA actually transmitted. | Write DATA to the underlying SSL channel. Returns
number of bytes of DATA actually transmitted. | [
"Write",
"DATA",
"to",
"the",
"underlying",
"SSL",
"channel",
".",
"Returns",
"number",
"of",
"bytes",
"of",
"DATA",
"actually",
"transmitted",
"."
] | def write(self, data):
"""Write DATA to the underlying SSL channel. Returns
number of bytes of DATA actually transmitted."""
self._checkClosed()
if self._sslobj is None:
raise ValueError("Write on closed or unwrapped SSL socket.")
return self._sslobj.write(data) | [
"def",
"write",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"_checkClosed",
"(",
")",
"if",
"self",
".",
"_sslobj",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Write on closed or unwrapped SSL socket.\"",
")",
"return",
"self",
".",
"_sslobj",
"."... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/ssl.py#L1129-L1136 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/appstats.py | python | DeviceSnapshot.GetUserIdForPid | (self, search_pid) | return None | Returns the application userId for an associated |pid|. This only works
if |search_pid| is tracked by this snapshot and the application userId is
queryable. | Returns the application userId for an associated |pid|. This only works
if |search_pid| is tracked by this snapshot and the application userId is
queryable. | [
"Returns",
"the",
"application",
"userId",
"for",
"an",
"associated",
"|pid|",
".",
"This",
"only",
"works",
"if",
"|search_pid|",
"is",
"tracked",
"by",
"this",
"snapshot",
"and",
"the",
"application",
"userId",
"is",
"queryable",
"."
] | def GetUserIdForPid(self, search_pid):
"""Returns the application userId for an associated |pid|. This only works
if |search_pid| is tracked by this snapshot and the application userId is
queryable."""
for (userid, pid, name) in self.pids:
if pid == search_pid:
return userid
return No... | [
"def",
"GetUserIdForPid",
"(",
"self",
",",
"search_pid",
")",
":",
"for",
"(",
"userid",
",",
"pid",
",",
"name",
")",
"in",
"self",
".",
"pids",
":",
"if",
"pid",
"==",
"search_pid",
":",
"return",
"userid",
"return",
"None"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/appstats.py#L383-L390 | |
namecoin/namecoin-legacy | b043fba28018721b68c90edfc81b9eacb070b47d | client/socks.py | python | socksocket.__negotiatehttp | (self,destaddr,destport) | __negotiatehttp(self,destaddr,destport)
Negotiates a connection through an HTTP server. | __negotiatehttp(self,destaddr,destport)
Negotiates a connection through an HTTP server. | [
"__negotiatehttp",
"(",
"self",
"destaddr",
"destport",
")",
"Negotiates",
"a",
"connection",
"through",
"an",
"HTTP",
"server",
"."
] | def __negotiatehttp(self,destaddr,destport):
"""__negotiatehttp(self,destaddr,destport)
Negotiates a connection through an HTTP server.
"""
# If we need to resolve locally, we do this now
if self.__proxy[3] == False:
addr = socket.gethostbyname(destaddr)
else:
addr = destaddr
self.sendall("CONNECT "... | [
"def",
"__negotiatehttp",
"(",
"self",
",",
"destaddr",
",",
"destport",
")",
":",
"# If we need to resolve locally, we do this now",
"if",
"self",
".",
"__proxy",
"[",
"3",
"]",
"==",
"False",
":",
"addr",
"=",
"socket",
".",
"gethostbyname",
"(",
"destaddr",
... | https://github.com/namecoin/namecoin-legacy/blob/b043fba28018721b68c90edfc81b9eacb070b47d/client/socks.py#L322-L351 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/scipy/optimize/line_search.py | python | line_search | (f, xk, pk, gfk=None, old_fval=None, old_old_fval=None, c1=1e-4,
c2=0.9, maxiter=20) | return state | Inexact line search that satisfies strong Wolfe conditions.
Algorithm 3.5 from Wright and Nocedal, 'Numerical Optimization', 1999, pg. 59-61
Args:
f (function): function of the form f(x) where x is a flat Tensor and returns a real
scalar. The function should be composed of operations with ... | Inexact line search that satisfies strong Wolfe conditions. | [
"Inexact",
"line",
"search",
"that",
"satisfies",
"strong",
"Wolfe",
"conditions",
"."
] | def line_search(f, xk, pk, gfk=None, old_fval=None, old_old_fval=None, c1=1e-4,
c2=0.9, maxiter=20):
"""Inexact line search that satisfies strong Wolfe conditions.
Algorithm 3.5 from Wright and Nocedal, 'Numerical Optimization', 1999, pg. 59-61
Args:
f (function): function of the f... | [
"def",
"line_search",
"(",
"f",
",",
"xk",
",",
"pk",
",",
"gfk",
"=",
"None",
",",
"old_fval",
"=",
"None",
",",
"old_old_fval",
"=",
"None",
",",
"c1",
"=",
"1e-4",
",",
"c2",
"=",
"0.9",
",",
"maxiter",
"=",
"20",
")",
":",
"state",
"=",
"Li... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/scipy/optimize/line_search.py#L305-L364 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextCtrl.GetTargetRect | (*args, **kwargs) | return _richtext.RichTextCtrl_GetTargetRect(*args, **kwargs) | GetTargetRect(self) -> Rect | GetTargetRect(self) -> Rect | [
"GetTargetRect",
"(",
"self",
")",
"-",
">",
"Rect"
] | def GetTargetRect(*args, **kwargs):
"""GetTargetRect(self) -> Rect"""
return _richtext.RichTextCtrl_GetTargetRect(*args, **kwargs) | [
"def",
"GetTargetRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextCtrl_GetTargetRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4198-L4200 | |
tenzir/vast | ff450d61f35c721db1760339869085a89222386f | scripts/splunk-search.py | python | outputResults | (results, fields = None, mvdelim = '\n',
outputfile = sys.stdout) | Outputs the contents of a result set to STDOUT in Interplunk format. | Outputs the contents of a result set to STDOUT in Interplunk format. | [
"Outputs",
"the",
"contents",
"of",
"a",
"result",
"set",
"to",
"STDOUT",
"in",
"Interplunk",
"format",
"."
] | def outputResults(results, fields = None, mvdelim = '\n',
outputfile = sys.stdout):
'''
Outputs the contents of a result set to STDOUT in Interplunk format.
'''
if results == None:
return
s = set()
'''
Check each entry to see if it is a list (multivalued)... | [
"def",
"outputResults",
"(",
"results",
",",
"fields",
"=",
"None",
",",
"mvdelim",
"=",
"'\\n'",
",",
"outputfile",
"=",
"sys",
".",
"stdout",
")",
":",
"if",
"results",
"==",
"None",
":",
"return",
"s",
"=",
"set",
"(",
")",
"'''\n Check each entry ... | https://github.com/tenzir/vast/blob/ff450d61f35c721db1760339869085a89222386f/scripts/splunk-search.py#L96-L132 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/sans/command_interface/ISISCommandInterface.py | python | TransmissionSample | (sample, direct, reload=True,
period_t=ALL_PERIODS, period_d=ALL_PERIODS) | Specify the transmission and direct runs for the sample.
@param sample: the transmission run
@param direct: direct run
@param reload: if to replace the workspace if it is already there
@param period_t: the entry number of the transmission run (default single entry file)
@param period_d: the entry n... | Specify the transmission and direct runs for the sample. | [
"Specify",
"the",
"transmission",
"and",
"direct",
"runs",
"for",
"the",
"sample",
"."
] | def TransmissionSample(sample, direct, reload=True,
period_t=ALL_PERIODS, period_d=ALL_PERIODS):
"""
Specify the transmission and direct runs for the sample.
@param sample: the transmission run
@param direct: direct run
@param reload: if to replace the workspace if it is alre... | [
"def",
"TransmissionSample",
"(",
"sample",
",",
"direct",
",",
"reload",
"=",
"True",
",",
"period_t",
"=",
"ALL_PERIODS",
",",
"period_d",
"=",
"ALL_PERIODS",
")",
":",
"_",
"=",
"reload",
"# noqa",
"# First of all the default for all periods used to be -1. If we en... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/command_interface/ISISCommandInterface.py#L206-L235 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | DragImage.DoDrawImage | (*args, **kwargs) | return _controls_.DragImage_DoDrawImage(*args, **kwargs) | DoDrawImage(self, DC dc, Point pos) -> bool | DoDrawImage(self, DC dc, Point pos) -> bool | [
"DoDrawImage",
"(",
"self",
"DC",
"dc",
"Point",
"pos",
")",
"-",
">",
"bool"
] | def DoDrawImage(*args, **kwargs):
"""DoDrawImage(self, DC dc, Point pos) -> bool"""
return _controls_.DragImage_DoDrawImage(*args, **kwargs) | [
"def",
"DoDrawImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"DragImage_DoDrawImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L6384-L6386 | |
utsaslab/RECIPE | e13136ce5644de35f5c09d6da82f4fe7d792ab9c | index-microbench/read_email_key.py | python | read_new_file | () | return ret | This function reads the 27MB file into a list and return | This function reads the 27MB file into a list and return | [
"This",
"function",
"reads",
"the",
"27MB",
"file",
"into",
"a",
"list",
"and",
"return"
] | def read_new_file():
"""
This function reads the 27MB file into a list and return
"""
filename = sys.argv[3]
if os.path.isfile(filename) is False:
raise TypeError("Illegal 27M file: %s" % (filename, ))
fp = open(filename, "r")
ret = []
for line in fp:
ret.append(line.strip())
fp.close()
... | [
"def",
"read_new_file",
"(",
")",
":",
"filename",
"=",
"sys",
".",
"argv",
"[",
"3",
"]",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"filename",
")",
"is",
"False",
":",
"raise",
"TypeError",
"(",
"\"Illegal 27M file: %s\"",
"%",
"(",
"filename",
",... | https://github.com/utsaslab/RECIPE/blob/e13136ce5644de35f5c09d6da82f4fe7d792ab9c/index-microbench/read_email_key.py#L40-L54 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rcode.py | python | to_text | (value) | return text | Convert rcode into text.
@param value: the rcode
@type value: int
@rtype: string | Convert rcode into text. | [
"Convert",
"rcode",
"into",
"text",
"."
] | def to_text(value):
"""Convert rcode into text.
@param value: the rcode
@type value: int
@rtype: string
"""
text = _by_value.get(value)
if text is None:
text = str(value)
return text | [
"def",
"to_text",
"(",
"value",
")",
":",
"text",
"=",
"_by_value",
".",
"get",
"(",
"value",
")",
"if",
"text",
"is",
"None",
":",
"text",
"=",
"str",
"(",
"value",
")",
"return",
"text"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/third_party/dns/rcode.py#L108-L119 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py | python | _LogicalConnection.set_read_state | (self, new_state) | Sets the state of this connection. Called when an event for this
connection has occurred.
Args:
new_state: state to be set. new_state must be one of followings:
- STATE_GRACEFULLY_CLOSED: when closing handshake for this
connection has been received.
-... | Sets the state of this connection. Called when an event for this
connection has occurred. | [
"Sets",
"the",
"state",
"of",
"this",
"connection",
".",
"Called",
"when",
"an",
"event",
"for",
"this",
"connection",
"has",
"occurred",
"."
] | def set_read_state(self, new_state):
"""Sets the state of this connection. Called when an event for this
connection has occurred.
Args:
new_state: state to be set. new_state must be one of followings:
- STATE_GRACEFULLY_CLOSED: when closing handshake for this
... | [
"def",
"set_read_state",
"(",
"self",
",",
"new_state",
")",
":",
"self",
".",
"_read_condition",
".",
"acquire",
"(",
")",
"self",
".",
"_read_state",
"=",
"new_state",
"self",
".",
"_read_condition",
".",
"notify",
"(",
")",
"self",
".",
"_read_condition",... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py#L682-L697 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | Joystick.GetMaxAxes | (*args, **kwargs) | return _misc_.Joystick_GetMaxAxes(*args, **kwargs) | GetMaxAxes(self) -> int | GetMaxAxes(self) -> int | [
"GetMaxAxes",
"(",
"self",
")",
"-",
">",
"int"
] | def GetMaxAxes(*args, **kwargs):
"""GetMaxAxes(self) -> int"""
return _misc_.Joystick_GetMaxAxes(*args, **kwargs) | [
"def",
"GetMaxAxes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"Joystick_GetMaxAxes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L2222-L2224 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_misc.py | python | AboutDialogInfo.SetVersion | (*args, **kwargs) | return _misc_.AboutDialogInfo_SetVersion(*args, **kwargs) | SetVersion(self, String version, String longVersion=wxEmptyString)
Set the version of the program. The version is in free format,
i.e. not necessarily in the x.y.z form but it shouldn't contain the
"version" word. | SetVersion(self, String version, String longVersion=wxEmptyString) | [
"SetVersion",
"(",
"self",
"String",
"version",
"String",
"longVersion",
"=",
"wxEmptyString",
")"
] | def SetVersion(*args, **kwargs):
"""
SetVersion(self, String version, String longVersion=wxEmptyString)
Set the version of the program. The version is in free format,
i.e. not necessarily in the x.y.z form but it shouldn't contain the
"version" word.
"""
return _... | [
"def",
"SetVersion",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"AboutDialogInfo_SetVersion",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L6605-L6613 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py3/IPython/lib/guisupport.py | python | is_event_loop_running_qt4 | (app=None) | Is the qt4 event loop running. | Is the qt4 event loop running. | [
"Is",
"the",
"qt4",
"event",
"loop",
"running",
"."
] | def is_event_loop_running_qt4(app=None):
"""Is the qt4 event loop running."""
# New way: check attribute on shell instance
ip = get_ipython()
if ip is not None:
return ip.active_eventloop and ip.active_eventloop.startswith('qt')
# Old way: check attribute on QApplication singleton
if ap... | [
"def",
"is_event_loop_running_qt4",
"(",
"app",
"=",
"None",
")",
":",
"# New way: check attribute on shell instance",
"ip",
"=",
"get_ipython",
"(",
")",
"if",
"ip",
"is",
"not",
"None",
":",
"return",
"ip",
".",
"active_eventloop",
"and",
"ip",
".",
"active_ev... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/lib/guisupport.py#L122-L136 | ||
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/tools/inspector_protocol/jinja2/bccache.py | python | Bucket.load_bytecode | (self, f) | Loads bytecode from a file or file like object. | Loads bytecode from a file or file like object. | [
"Loads",
"bytecode",
"from",
"a",
"file",
"or",
"file",
"like",
"object",
"."
] | def load_bytecode(self, f):
"""Loads bytecode from a file or file like object."""
# make sure the magic header is correct
magic = f.read(len(bc_magic))
if magic != bc_magic:
self.reset()
return
# the source code of the file changed, we need to reload
... | [
"def",
"load_bytecode",
"(",
"self",
",",
"f",
")",
":",
"# make sure the magic header is correct",
"magic",
"=",
"f",
".",
"read",
"(",
"len",
"(",
"bc_magic",
")",
")",
"if",
"magic",
"!=",
"bc_magic",
":",
"self",
".",
"reset",
"(",
")",
"return",
"# ... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/inspector_protocol/jinja2/bccache.py#L79-L96 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/datamodel/models.py | python | DataModel.traverse | (self, builder) | return [] | Traverse contained members.
Returns a iterable of contained (types, getters).
Each getter is a one-argument function accepting a LLVM value. | Traverse contained members.
Returns a iterable of contained (types, getters).
Each getter is a one-argument function accepting a LLVM value. | [
"Traverse",
"contained",
"members",
".",
"Returns",
"a",
"iterable",
"of",
"contained",
"(",
"types",
"getters",
")",
".",
"Each",
"getter",
"is",
"a",
"one",
"-",
"argument",
"function",
"accepting",
"a",
"LLVM",
"value",
"."
] | def traverse(self, builder):
"""
Traverse contained members.
Returns a iterable of contained (types, getters).
Each getter is a one-argument function accepting a LLVM value.
"""
return [] | [
"def",
"traverse",
"(",
"self",
",",
"builder",
")",
":",
"return",
"[",
"]"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/datamodel/models.py#L89-L95 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.GetMainSelection | (*args, **kwargs) | return _stc.StyledTextCtrl_GetMainSelection(*args, **kwargs) | GetMainSelection(self) -> int
Which selection is the main selection | GetMainSelection(self) -> int | [
"GetMainSelection",
"(",
"self",
")",
"-",
">",
"int"
] | def GetMainSelection(*args, **kwargs):
"""
GetMainSelection(self) -> int
Which selection is the main selection
"""
return _stc.StyledTextCtrl_GetMainSelection(*args, **kwargs) | [
"def",
"GetMainSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetMainSelection",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L6136-L6142 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/ftplib.py | python | Netrc.get_macros | (self) | return self.__macros.keys() | Return a list of all defined macro names. | Return a list of all defined macro names. | [
"Return",
"a",
"list",
"of",
"all",
"defined",
"macro",
"names",
"."
] | def get_macros(self):
"""Return a list of all defined macro names."""
return self.__macros.keys() | [
"def",
"get_macros",
"(",
"self",
")",
":",
"return",
"self",
".",
"__macros",
".",
"keys",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ftplib.py#L1024-L1026 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/nanfunctions.py | python | nanvar | (a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue) | return var | Compute the variance along the specified axis, while ignoring NaNs.
Returns the variance of the array elements, a measure of the spread of
a distribution. The variance is computed for the flattened array by
default, otherwise over the specified axis.
For all-NaN slices or slices with zero degrees of ... | Compute the variance along the specified axis, while ignoring NaNs. | [
"Compute",
"the",
"variance",
"along",
"the",
"specified",
"axis",
"while",
"ignoring",
"NaNs",
"."
] | def nanvar(a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue):
"""
Compute the variance along the specified axis, while ignoring NaNs.
Returns the variance of the array elements, a measure of the spread of
a distribution. The variance is computed for the flattened array by
default, ... | [
"def",
"nanvar",
"(",
"a",
",",
"axis",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"out",
"=",
"None",
",",
"ddof",
"=",
"0",
",",
"keepdims",
"=",
"np",
".",
"_NoValue",
")",
":",
"arr",
",",
"mask",
"=",
"_replace_nan",
"(",
"a",
",",
"0",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/lib/nanfunctions.py#L1424-L1563 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/richtext.py | python | RichTextBuffer.GetFloatingLayoutMode | (*args, **kwargs) | return _richtext.RichTextBuffer_GetFloatingLayoutMode(*args, **kwargs) | GetFloatingLayoutMode() -> bool | GetFloatingLayoutMode() -> bool | [
"GetFloatingLayoutMode",
"()",
"-",
">",
"bool"
] | def GetFloatingLayoutMode(*args, **kwargs):
"""GetFloatingLayoutMode() -> bool"""
return _richtext.RichTextBuffer_GetFloatingLayoutMode(*args, **kwargs) | [
"def",
"GetFloatingLayoutMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_GetFloatingLayoutMode",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L2643-L2645 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/core/defchararray.py | python | decode | (a, encoding=None, errors=None) | return _to_string_or_unicode_array(
_vec_string(a, object_, 'decode', _clean_args(encoding, errors))) | Calls `str.decode` element-wise.
The set of available codecs comes from the Python standard library,
and may be extended at runtime. For more information, see the
:mod:`codecs` module.
Parameters
----------
a : array_like of str or unicode
encoding : str, optional
The name of an e... | Calls `str.decode` element-wise. | [
"Calls",
"str",
".",
"decode",
"element",
"-",
"wise",
"."
] | def decode(a, encoding=None, errors=None):
"""
Calls `str.decode` element-wise.
The set of available codecs comes from the Python standard library,
and may be extended at runtime. For more information, see the
:mod:`codecs` module.
Parameters
----------
a : array_like of str or unicod... | [
"def",
"decode",
"(",
"a",
",",
"encoding",
"=",
"None",
",",
"errors",
"=",
"None",
")",
":",
"return",
"_to_string_or_unicode_array",
"(",
"_vec_string",
"(",
"a",
",",
"object_",
",",
"'decode'",
",",
"_clean_args",
"(",
"encoding",
",",
"errors",
")",
... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/core/defchararray.py#L479-L522 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/autograd.py | python | reduce_mean | (x, axes=None, keepdims=1) | return ReduceMean(axes, keepdims)(x)[0] | Init a ReduceMean, computes the mean of the input tensor's element along
the provided axes.
Args:
x (Tensor): input tensor.
axes (list of int): A list of integers, along which to reduce.
Accepted range is [-r, r-1] where r = rank(data). The default
is None, which reduces ... | Init a ReduceMean, computes the mean of the input tensor's element along
the provided axes.
Args:
x (Tensor): input tensor.
axes (list of int): A list of integers, along which to reduce.
Accepted range is [-r, r-1] where r = rank(data). The default
is None, which reduces ... | [
"Init",
"a",
"ReduceMean",
"computes",
"the",
"mean",
"of",
"the",
"input",
"tensor",
"s",
"element",
"along",
"the",
"provided",
"axes",
".",
"Args",
":",
"x",
"(",
"Tensor",
")",
":",
"input",
"tensor",
".",
"axes",
"(",
"list",
"of",
"int",
")",
"... | def reduce_mean(x, axes=None, keepdims=1):
"""
Init a ReduceMean, computes the mean of the input tensor's element along
the provided axes.
Args:
x (Tensor): input tensor.
axes (list of int): A list of integers, along which to reduce.
Accepted range is [-r, r-1] where r = rank... | [
"def",
"reduce_mean",
"(",
"x",
",",
"axes",
"=",
"None",
",",
"keepdims",
"=",
"1",
")",
":",
"return",
"ReduceMean",
"(",
"axes",
",",
"keepdims",
")",
"(",
"x",
")",
"[",
"0",
"]"
] | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/autograd.py#L4142-L4156 | |
kevin-ssy/Optical-Flow-Guided-Feature | 07d4501a29002ee7821c38c1820e4a64c1acf6e8 | lib/caffe-action/scripts/cpp_lint.py | python | IsErrorSuppressedByNolint | (category, linenum) | return (linenum in _error_suppressions.get(category, set()) or
linenum in _error_suppressions.get(None, set())) | Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the current line number.
Returns:
bool, True iff the error... | Returns true if the specified error category is suppressed on this line. | [
"Returns",
"true",
"if",
"the",
"specified",
"error",
"category",
"is",
"suppressed",
"on",
"this",
"line",
"."
] | def IsErrorSuppressedByNolint(category, linenum):
"""Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the curre... | [
"def",
"IsErrorSuppressedByNolint",
"(",
"category",
",",
"linenum",
")",
":",
"return",
"(",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"category",
",",
"set",
"(",
")",
")",
"or",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"None... | https://github.com/kevin-ssy/Optical-Flow-Guided-Feature/blob/07d4501a29002ee7821c38c1820e4a64c1acf6e8/lib/caffe-action/scripts/cpp_lint.py#L500-L513 | |
lawy623/SVS | b7c7ae367c82a4797ff4a896a2ff304f02e7f724 | caffe/scripts/cpp_lint.py | python | _NestingState.CheckCompletedBlocks | (self, filename, error) | Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found. | Checks that all classes and namespaces have been completely parsed. | [
"Checks",
"that",
"all",
"classes",
"and",
"namespaces",
"have",
"been",
"completely",
"parsed",
"."
] | def CheckCompletedBlocks(self, filename, error):
"""Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
filename: The name of the current file.
error: The function to call with any errors found.
"""
# Note: Th... | [
"def",
"CheckCompletedBlocks",
"(",
"self",
",",
"filename",
",",
"error",
")",
":",
"# Note: This test can result in false positives if #ifdef constructs",
"# get in the way of brace matching. See the testBuildClass test in",
"# cpplint_unittest.py for an example of this.",
"for",
"obj"... | https://github.com/lawy623/SVS/blob/b7c7ae367c82a4797ff4a896a2ff304f02e7f724/caffe/scripts/cpp_lint.py#L2172-L2191 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/interpolate/interpolate.py | python | NdPPoly.construct_fast | (cls, c, x, extrapolate=None) | return self | Construct the piecewise polynomial without making checks.
Takes the same parameters as the constructor. Input arguments
`c` and `x` must be arrays of the correct shape and type. The
`c` array can only be of dtypes float and complex, and `x`
array must have dtype float. | Construct the piecewise polynomial without making checks. | [
"Construct",
"the",
"piecewise",
"polynomial",
"without",
"making",
"checks",
"."
] | def construct_fast(cls, c, x, extrapolate=None):
"""
Construct the piecewise polynomial without making checks.
Takes the same parameters as the constructor. Input arguments
`c` and `x` must be arrays of the correct shape and type. The
`c` array can only be of dtypes float and c... | [
"def",
"construct_fast",
"(",
"cls",
",",
"c",
",",
"x",
",",
"extrapolate",
"=",
"None",
")",
":",
"self",
"=",
"object",
".",
"__new__",
"(",
"cls",
")",
"self",
".",
"c",
"=",
"c",
"self",
".",
"x",
"=",
"x",
"if",
"extrapolate",
"is",
"None",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/interpolate/interpolate.py#L1848-L1864 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/moosetree/Node.py | python | Node.__iter__ | (self) | return iter(self.__children) | Iterate of the children (e.g., `for child in node:`) | Iterate of the children (e.g., `for child in node:`) | [
"Iterate",
"of",
"the",
"children",
"(",
"e",
".",
"g",
".",
"for",
"child",
"in",
"node",
":",
")"
] | def __iter__(self):
"""Iterate of the children (e.g., `for child in node:`)"""
return iter(self.__children) | [
"def",
"__iter__",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"self",
".",
"__children",
")"
] | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/moosetree/Node.py#L81-L83 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/custreamz/custreamz/kafka.py | python | Consumer.get_watermark_offsets | (self, partition, timeout=10000, cached=False) | return offsets[b"low"], offsets[b"high"] | Retrieve the low and high watermark offsets from the Kafka consumer
Returns
-------
Tuple with a [low, high] value
Examples
--------
>>> from custream import kafka
>>> kafka_configs = {
... "metadata.broker.list": "localhost:9092",
... "enable.pa... | Retrieve the low and high watermark offsets from the Kafka consumer | [
"Retrieve",
"the",
"low",
"and",
"high",
"watermark",
"offsets",
"from",
"the",
"Kafka",
"consumer"
] | def get_watermark_offsets(self, partition, timeout=10000, cached=False):
"""
Retrieve the low and high watermark offsets from the Kafka consumer
Returns
-------
Tuple with a [low, high] value
Examples
--------
>>> from custream import kafka
>>> k... | [
"def",
"get_watermark_offsets",
"(",
"self",
",",
"partition",
",",
"timeout",
"=",
"10000",
",",
"cached",
"=",
"False",
")",
":",
"offsets",
"=",
"(",
")",
"try",
":",
"offsets",
"=",
"self",
".",
"kafka_meta_client",
".",
"get_watermark_offset",
"(",
"t... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/custreamz/custreamz/kafka.py#L212-L259 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/linalg/linear_operator_full_matrix.py | python | LinearOperatorFullMatrix.__init__ | (self,
matrix,
is_non_singular=None,
is_self_adjoint=None,
is_positive_definite=None,
is_square=None,
name="LinearOperatorFullMatrix") | r"""Initialize a `LinearOperatorFullMatrix`.
Args:
matrix: Shape `[B1,...,Bb, M, N]` with `b >= 0`, `M, N >= 0`.
Allowed dtypes: `float32`, `float64`, `complex64`, `complex128`.
is_non_singular: Expect that this operator is non-singular.
is_self_adjoint: Expect that this operator is eq... | r"""Initialize a `LinearOperatorFullMatrix`. | [
"r",
"Initialize",
"a",
"LinearOperatorFullMatrix",
"."
] | def __init__(self,
matrix,
is_non_singular=None,
is_self_adjoint=None,
is_positive_definite=None,
is_square=None,
name="LinearOperatorFullMatrix"):
r"""Initialize a `LinearOperatorFullMatrix`.
Args:
matrix: Shape `... | [
"def",
"__init__",
"(",
"self",
",",
"matrix",
",",
"is_non_singular",
"=",
"None",
",",
"is_self_adjoint",
"=",
"None",
",",
"is_positive_definite",
"=",
"None",
",",
"is_square",
"=",
"None",
",",
"name",
"=",
"\"LinearOperatorFullMatrix\"",
")",
":",
"with"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/linalg/linear_operator_full_matrix.py#L106-L145 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur.py | python | Minitaur.SetMotorStrengthRatios | (self, ratios) | Set the strength of each motor relative to the default value.
Args:
ratios: The relative strength. A numpy array ranging from 0.0 to 1.0. | Set the strength of each motor relative to the default value. | [
"Set",
"the",
"strength",
"of",
"each",
"motor",
"relative",
"to",
"the",
"default",
"value",
"."
] | def SetMotorStrengthRatios(self, ratios):
"""Set the strength of each motor relative to the default value.
Args:
ratios: The relative strength. A numpy array ranging from 0.0 to 1.0.
"""
if self._accurate_motor_model_enabled:
self._motor_model.set_strength_ratios(ratios) | [
"def",
"SetMotorStrengthRatios",
"(",
"self",
",",
"ratios",
")",
":",
"if",
"self",
".",
"_accurate_motor_model_enabled",
":",
"self",
".",
"_motor_model",
".",
"set_strength_ratios",
"(",
"ratios",
")"
] | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur.py#L937-L944 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/logging/buildlogger.py | python | BuildloggerServer.get_build_log_url | (build_id) | return "%s/%s" % (base_url, endpoint.strip("/")) | Return the build log URL. | Return the build log URL. | [
"Return",
"the",
"build",
"log",
"URL",
"."
] | def get_build_log_url(build_id):
"""Return the build log URL."""
base_url = _config.BUILDLOGGER_URL.rstrip("/")
endpoint = APPEND_GLOBAL_LOGS_ENDPOINT % {"build_id": build_id}
return "%s/%s" % (base_url, endpoint.strip("/")) | [
"def",
"get_build_log_url",
"(",
"build_id",
")",
":",
"base_url",
"=",
"_config",
".",
"BUILDLOGGER_URL",
".",
"rstrip",
"(",
"\"/\"",
")",
"endpoint",
"=",
"APPEND_GLOBAL_LOGS_ENDPOINT",
"%",
"{",
"\"build_id\"",
":",
"build_id",
"}",
"return",
"\"%s/%s\"",
"%... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/logging/buildlogger.py#L329-L333 | |
timi-liuliang/echo | 40a5a24d430eee4118314459ab7e03afcb3b8719 | thirdparty/protobuf/python/ez_setup.py | python | main | (argv, version=DEFAULT_VERSION) | Install or upgrade setuptools and EasyInstall | Install or upgrade setuptools and EasyInstall | [
"Install",
"or",
"upgrade",
"setuptools",
"and",
"EasyInstall"
] | def main(argv, version=DEFAULT_VERSION):
"""Install or upgrade setuptools and EasyInstall"""
try:
import setuptools
except ImportError:
egg = None
try:
egg = download_setuptools(version, delay=0)
sys.path.insert(0,egg)
from setuptools.command.easy_... | [
"def",
"main",
"(",
"argv",
",",
"version",
"=",
"DEFAULT_VERSION",
")",
":",
"try",
":",
"import",
"setuptools",
"except",
"ImportError",
":",
"egg",
"=",
"None",
"try",
":",
"egg",
"=",
"download_setuptools",
"(",
"version",
",",
"delay",
"=",
"0",
")"... | https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/ez_setup.py#L209-L248 | ||
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | mlir/python/mlir/dialects/_pdl_ops_ext.py | python | RewriteOp.body | (self) | return self.regions[0].blocks[0] | Return the body (block) of the rewrite. | Return the body (block) of the rewrite. | [
"Return",
"the",
"body",
"(",
"block",
")",
"of",
"the",
"rewrite",
"."
] | def body(self):
"""Return the body (block) of the rewrite."""
return self.regions[0].blocks[0] | [
"def",
"body",
"(",
"self",
")",
":",
"return",
"self",
".",
"regions",
"[",
"0",
"]",
".",
"blocks",
"[",
"0",
"]"
] | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/python/mlir/dialects/_pdl_ops_ext.py#L255-L257 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/tabbedpages.py | python | TabSet._arrange_tabs | (self) | Arrange the tabs in rows, in the order in which they were added.
If n_rows >= 1, this will be the number of rows used. Otherwise the
number of rows will be calculated according to the number of tabs and
max_tabs_per_row. In this case, the number of rows may change when
adding/removing t... | Arrange the tabs in rows, in the order in which they were added. | [
"Arrange",
"the",
"tabs",
"in",
"rows",
"in",
"the",
"order",
"in",
"which",
"they",
"were",
"added",
"."
] | def _arrange_tabs(self):
"""
Arrange the tabs in rows, in the order in which they were added.
If n_rows >= 1, this will be the number of rows used. Otherwise the
number of rows will be calculated according to the number of tabs and
max_tabs_per_row. In this case, the number of r... | [
"def",
"_arrange_tabs",
"(",
"self",
")",
":",
"# remove all tabs and rows",
"for",
"tab_name",
"in",
"self",
".",
"_tabs",
".",
"keys",
"(",
")",
":",
"self",
".",
"_tabs",
".",
"pop",
"(",
"tab_name",
")",
".",
"destroy",
"(",
")",
"self",
".",
"_res... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/idlelib/tabbedpages.py#L135-L173 | ||
lhmRyan/deep-supervised-hashing-DSH | 631901f82e2ab031fbac33f914a5b08ef8e21d57 | python/caffe/io.py | python | load_image | (filename, color=True) | return img | Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
Returns
-------
image : an image with type ... | Load an image converting from grayscale or alpha as needed. | [
"Load",
"an",
"image",
"converting",
"from",
"grayscale",
"or",
"alpha",
"as",
"needed",
"."
] | def load_image(filename, color=True):
"""
Load an image converting from grayscale or alpha as needed.
Parameters
----------
filename : string
color : boolean
flag for color format. True (default) loads as RGB while False
loads as intensity (if image is already grayscale).
R... | [
"def",
"load_image",
"(",
"filename",
",",
"color",
"=",
"True",
")",
":",
"img",
"=",
"skimage",
".",
"img_as_float",
"(",
"skimage",
".",
"io",
".",
"imread",
"(",
"filename",
",",
"as_grey",
"=",
"not",
"color",
")",
")",
".",
"astype",
"(",
"np",... | https://github.com/lhmRyan/deep-supervised-hashing-DSH/blob/631901f82e2ab031fbac33f914a5b08ef8e21d57/python/caffe/io.py#L278-L302 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_print.py | python | EdPrinter.SetStc | (self, stc) | Set the stc we are printing for
@param stc: instance of wx.stc.StyledTextCtrl
@note: MUST be called prior to any other print operations | Set the stc we are printing for
@param stc: instance of wx.stc.StyledTextCtrl
@note: MUST be called prior to any other print operations | [
"Set",
"the",
"stc",
"we",
"are",
"printing",
"for",
"@param",
"stc",
":",
"instance",
"of",
"wx",
".",
"stc",
".",
"StyledTextCtrl",
"@note",
":",
"MUST",
"be",
"called",
"prior",
"to",
"any",
"other",
"print",
"operations"
] | def SetStc(self, stc):
"""Set the stc we are printing for
@param stc: instance of wx.stc.StyledTextCtrl
@note: MUST be called prior to any other print operations
"""
self.stc = stc | [
"def",
"SetStc",
"(",
"self",
",",
"stc",
")",
":",
"self",
".",
"stc",
"=",
"stc"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_print.py#L157-L163 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/types.py | python | Type.wrap_constant_value | (self, value) | return value | Wrap constant *value* if necessary. This method may be overriden
by subclasses (especially aggregate types). | Wrap constant *value* if necessary. This method may be overriden
by subclasses (especially aggregate types). | [
"Wrap",
"constant",
"*",
"value",
"*",
"if",
"necessary",
".",
"This",
"method",
"may",
"be",
"overriden",
"by",
"subclasses",
"(",
"especially",
"aggregate",
"types",
")",
"."
] | def wrap_constant_value(self, value):
"""
Wrap constant *value* if necessary. This method may be overriden
by subclasses (especially aggregate types).
"""
return value | [
"def",
"wrap_constant_value",
"(",
"self",
",",
"value",
")",
":",
"return",
"value"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/types.py#L72-L77 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/notebook/callback.py | python | LiveBokehChart.setup_chart | (self) | Render a bokeh object and return a handle to it. | Render a bokeh object and return a handle to it. | [
"Render",
"a",
"bokeh",
"object",
"and",
"return",
"a",
"handle",
"to",
"it",
"."
] | def setup_chart(self):
"""Render a bokeh object and return a handle to it.
"""
raise NotImplementedError("Incomplete base class: LiveBokehChart must be sub-classed") | [
"def",
"setup_chart",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Incomplete base class: LiveBokehChart must be sub-classed\"",
")"
] | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/notebook/callback.py#L225-L228 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | GraphicsPath.AddPath | (*args, **kwargs) | return _gdi_.GraphicsPath_AddPath(*args, **kwargs) | AddPath(self, GraphicsPath path)
Adds another path | AddPath(self, GraphicsPath path) | [
"AddPath",
"(",
"self",
"GraphicsPath",
"path",
")"
] | def AddPath(*args, **kwargs):
"""
AddPath(self, GraphicsPath path)
Adds another path
"""
return _gdi_.GraphicsPath_AddPath(*args, **kwargs) | [
"def",
"AddPath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsPath_AddPath",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L5725-L5731 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/pyparsing.py | python | ParserElement.setDebug | ( self, flag=True ) | return self | Enable display of debugging messages while doing pattern matching.
Set C{flag} to True to enable, False to disable.
Example::
wd = Word(alphas).setName("alphaword")
integer = Word(nums).setName("numword")
term = wd | integer
# turn on debuggi... | Enable display of debugging messages while doing pattern matching.
Set C{flag} to True to enable, False to disable. | [
"Enable",
"display",
"of",
"debugging",
"messages",
"while",
"doing",
"pattern",
"matching",
".",
"Set",
"C",
"{",
"flag",
"}",
"to",
"True",
"to",
"enable",
"False",
"to",
"disable",
"."
] | def setDebug( self, flag=True ):
"""
Enable display of debugging messages while doing pattern matching.
Set C{flag} to True to enable, False to disable.
Example::
wd = Word(alphas).setName("alphaword")
integer = Word(nums).setName("numword")
term = wd... | [
"def",
"setDebug",
"(",
"self",
",",
"flag",
"=",
"True",
")",
":",
"if",
"flag",
":",
"self",
".",
"setDebugActions",
"(",
"_defaultStartDebugAction",
",",
"_defaultSuccessDebugAction",
",",
"_defaultExceptionDebugAction",
")",
"else",
":",
"self",
".",
"debug"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/_vendor/pyparsing.py#L2112-L2151 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/autograd/functional.py | python | hvp | (func, inputs, v=None, create_graph=False, strict=False) | return _tuple_postprocess(outputs, is_outputs_tuple), _tuple_postprocess(hvp, is_inputs_tuple) | r"""Function that computes the dot product between the Hessian of a given scalar
function and a vector ``v`` at the point given by the inputs.
Args:
func (function): a Python function that takes Tensor inputs and returns
a Tensor with a single element.
inputs (tuple of Tensors or Te... | r"""Function that computes the dot product between the Hessian of a given scalar
function and a vector ``v`` at the point given by the inputs. | [
"r",
"Function",
"that",
"computes",
"the",
"dot",
"product",
"between",
"the",
"Hessian",
"of",
"a",
"given",
"scalar",
"function",
"and",
"a",
"vector",
"v",
"at",
"the",
"point",
"given",
"by",
"the",
"inputs",
"."
] | def hvp(func, inputs, v=None, create_graph=False, strict=False):
r"""Function that computes the dot product between the Hessian of a given scalar
function and a vector ``v`` at the point given by the inputs.
Args:
func (function): a Python function that takes Tensor inputs and returns
a... | [
"def",
"hvp",
"(",
"func",
",",
"inputs",
",",
"v",
"=",
"None",
",",
"create_graph",
"=",
"False",
",",
"strict",
"=",
"False",
")",
":",
"with",
"torch",
".",
"enable_grad",
"(",
")",
":",
"is_inputs_tuple",
",",
"inputs",
"=",
"_as_tuple",
"(",
"i... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/autograd/functional.py#L903-L1005 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | xmlNode.getContent | (self) | return ret | Read the value of a node, this can be either the text
carried directly by this node if it's a TEXT node or the
aggregate string of the values carried by this node child's
(TEXT and ENTITY_REF). Entity references are substituted. | Read the value of a node, this can be either the text
carried directly by this node if it's a TEXT node or the
aggregate string of the values carried by this node child's
(TEXT and ENTITY_REF). Entity references are substituted. | [
"Read",
"the",
"value",
"of",
"a",
"node",
"this",
"can",
"be",
"either",
"the",
"text",
"carried",
"directly",
"by",
"this",
"node",
"if",
"it",
"s",
"a",
"TEXT",
"node",
"or",
"the",
"aggregate",
"string",
"of",
"the",
"values",
"carried",
"by",
"thi... | def getContent(self):
"""Read the value of a node, this can be either the text
carried directly by this node if it's a TEXT node or the
aggregate string of the values carried by this node child's
(TEXT and ENTITY_REF). Entity references are substituted. """
ret = libxml2mo... | [
"def",
"getContent",
"(",
"self",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlNodeGetContent",
"(",
"self",
".",
"_o",
")",
"return",
"ret"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L3250-L3256 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/parsing_ops.py | python | parse_single_example_v2_unoptimized | (
serialized, features, example_names=None, name=None
) | return _construct_sparse_tensors_for_sparse_features(features, outputs) | Parses a single `Example` proto.
Similar to `parse_example`, except:
For dense tensors, the returned `Tensor` is identical to the output of
`parse_example`, except there is no batch dimension, the output shape is the
same as the shape given in `dense_shape`.
For `SparseTensor`s, the first (batch) column of... | Parses a single `Example` proto. | [
"Parses",
"a",
"single",
"Example",
"proto",
"."
] | def parse_single_example_v2_unoptimized(
serialized, features, example_names=None, name=None
):
"""Parses a single `Example` proto.
Similar to `parse_example`, except:
For dense tensors, the returned `Tensor` is identical to the output of
`parse_example`, except there is no batch dimension, the output... | [
"def",
"parse_single_example_v2_unoptimized",
"(",
"serialized",
",",
"features",
",",
"example_names",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"not",
"features",
":",
"raise",
"ValueError",
"(",
"\"Missing features.\"",
")",
"if",
"example_names",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/parsing_ops.py#L1026-L1072 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py | python | _StandaloneRequest.get_unparsed_uri | (self) | return self._request_handler.path | Getter to mimic request.unparsed_uri. | Getter to mimic request.unparsed_uri. | [
"Getter",
"to",
"mimic",
"request",
".",
"unparsed_uri",
"."
] | def get_unparsed_uri(self):
"""Getter to mimic request.unparsed_uri."""
return self._request_handler.path | [
"def",
"get_unparsed_uri",
"(",
"self",
")",
":",
"return",
"self",
".",
"_request_handler",
".",
"path"
] | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/standalone.py#L240-L243 | |
CMU-Perceptual-Computing-Lab/caffe_rtpose | a4778bb1c3eb74d7250402016047216f77b4dba6 | scripts/cpp_lint.py | python | CheckForBadCharacters | (filename, lines, error) | Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that it's possible for this to throw off line
numbering if... | Logs an error for each line containing bad characters. | [
"Logs",
"an",
"error",
"for",
"each",
"line",
"containing",
"bad",
"characters",
"."
] | def CheckForBadCharacters(filename, lines, error):
"""Logs an error for each line containing bad characters.
Two kinds of bad characters:
1. Unicode replacement characters: These indicate that either the file
contained invalid UTF-8 (likely) or Unicode replacement characters (which
it shouldn't). Note that... | [
"def",
"CheckForBadCharacters",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"for",
"linenum",
",",
"line",
"in",
"enumerate",
"(",
"lines",
")",
":",
"if",
"u'\\ufffd'",
"in",
"line",
":",
"error",
"(",
"filename",
",",
"linenum",
",",
"'reada... | https://github.com/CMU-Perceptual-Computing-Lab/caffe_rtpose/blob/a4778bb1c3eb74d7250402016047216f77b4dba6/scripts/cpp_lint.py#L1483-L1505 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.