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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py | python | FilePosition.__init__ | (self, filename) | Create the position from a file. | Create the position from a file. | [
"Create",
"the",
"position",
"from",
"a",
"file",
"."
] | def __init__(self, filename):
"Create the position from a file."
Position.__init__(self)
self.reader = LineReader(filename)
self.pos = 0
self.checkbytemark() | [
"def",
"__init__",
"(",
"self",
",",
"filename",
")",
":",
"Position",
".",
"__init__",
"(",
"self",
")",
"self",
".",
"reader",
"=",
"LineReader",
"(",
"filename",
")",
"self",
".",
"pos",
"=",
"0",
"self",
".",
"checkbytemark",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L2114-L2119 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | toolkit/crashreporter/tools/symbolstore.py | python | Dumper_Mac.ProcessFilesWorkMac | (self, file) | return result | dump_syms on Mac needs to be run on a dSYM bundle produced
by dsymutil(1), so run dsymutil here and pass the bundle name
down to the superclass method instead. | dump_syms on Mac needs to be run on a dSYM bundle produced
by dsymutil(1), so run dsymutil here and pass the bundle name
down to the superclass method instead. | [
"dump_syms",
"on",
"Mac",
"needs",
"to",
"be",
"run",
"on",
"a",
"dSYM",
"bundle",
"produced",
"by",
"dsymutil",
"(",
"1",
")",
"so",
"run",
"dsymutil",
"here",
"and",
"pass",
"the",
"bundle",
"name",
"down",
"to",
"the",
"superclass",
"method",
"instead... | def ProcessFilesWorkMac(self, file):
"""dump_syms on Mac needs to be run on a dSYM bundle produced
by dsymutil(1), so run dsymutil here and pass the bundle name
down to the superclass method instead."""
self.output_pid(sys.stderr, "Worker running Mac pre-processing on file: %s" % (file,)... | [
"def",
"ProcessFilesWorkMac",
"(",
"self",
",",
"file",
")",
":",
"self",
".",
"output_pid",
"(",
"sys",
".",
"stderr",
",",
"\"Worker running Mac pre-processing on file: %s\"",
"%",
"(",
"file",
",",
")",
")",
"# our return is a status and a tuple of files to dump symb... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/toolkit/crashreporter/tools/symbolstore.py#L854-L879 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | python/singa/utils.py | python | get_output_shape | (auto_pad, input_spatial_shape, kernel_spatial_shape,
strides_spatial) | return out_shape | return output shape of conv2d or pooling,
! borrow from onnx
Args:
auto_pad: string
input_spatial_shape: list[int]
kernel_spatial_shape: list[int]
strides_spatial: list[int]
output_spatial_shape: list[int]
Returns:
list[int | return output shape of conv2d or pooling,
! borrow from onnx
Args:
auto_pad: string
input_spatial_shape: list[int]
kernel_spatial_shape: list[int]
strides_spatial: list[int]
output_spatial_shape: list[int]
Returns:
list[int | [
"return",
"output",
"shape",
"of",
"conv2d",
"or",
"pooling",
"!",
"borrow",
"from",
"onnx",
"Args",
":",
"auto_pad",
":",
"string",
"input_spatial_shape",
":",
"list",
"[",
"int",
"]",
"kernel_spatial_shape",
":",
"list",
"[",
"int",
"]",
"strides_spatial",
... | def get_output_shape(auto_pad, input_spatial_shape, kernel_spatial_shape,
strides_spatial):
"""
return output shape of conv2d or pooling,
! borrow from onnx
Args:
auto_pad: string
input_spatial_shape: list[int]
kernel_spatial_shape: list[int]
strides_... | [
"def",
"get_output_shape",
"(",
"auto_pad",
",",
"input_spatial_shape",
",",
"kernel_spatial_shape",
",",
"strides_spatial",
")",
":",
"out_shape",
"=",
"[",
"0",
"]",
"*",
"len",
"(",
"input_spatial_shape",
")",
"if",
"auto_pad",
"in",
"(",
"'SAME_UPPER'",
",",... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/utils.py#L189-L216 | |
mingchen/protobuf-ios | 0958df34558cd54cb7b6e6ca5c8855bf3d475046 | compiler/python/google/protobuf/reflection.py | python | GeneratedProtocolMessageType.__new__ | (cls, name, bases, dictionary) | return superclass.__new__(cls, name, bases, dictionary) | Custom allocation for runtime-generated class types.
We override __new__ because this is apparently the only place
where we can meaningfully set __slots__ on the class we're creating(?).
(The interplay between metaclasses and slots is not very well-documented).
Args:
name: Name of the class (ign... | Custom allocation for runtime-generated class types. | [
"Custom",
"allocation",
"for",
"runtime",
"-",
"generated",
"class",
"types",
"."
] | def __new__(cls, name, bases, dictionary):
"""Custom allocation for runtime-generated class types.
We override __new__ because this is apparently the only place
where we can meaningfully set __slots__ on the class we're creating(?).
(The interplay between metaclasses and slots is not very well-document... | [
"def",
"__new__",
"(",
"cls",
",",
"name",
",",
"bases",
",",
"dictionary",
")",
":",
"descriptor",
"=",
"dictionary",
"[",
"GeneratedProtocolMessageType",
".",
"_DESCRIPTOR_KEY",
"]",
"_AddSlots",
"(",
"descriptor",
",",
"dictionary",
")",
"_AddClassAttributesFor... | https://github.com/mingchen/protobuf-ios/blob/0958df34558cd54cb7b6e6ca5c8855bf3d475046/compiler/python/google/protobuf/reflection.py#L97-L122 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/combo.py | python | ComboCtrl.GetTextRect | (*args, **kwargs) | return _combo.ComboCtrl_GetTextRect(*args, **kwargs) | GetTextRect(self) -> Rect
Returns area covered by the text field (includes everything except
borders and the dropdown button). | GetTextRect(self) -> Rect | [
"GetTextRect",
"(",
"self",
")",
"-",
">",
"Rect"
] | def GetTextRect(*args, **kwargs):
"""
GetTextRect(self) -> Rect
Returns area covered by the text field (includes everything except
borders and the dropdown button).
"""
return _combo.ComboCtrl_GetTextRect(*args, **kwargs) | [
"def",
"GetTextRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"ComboCtrl_GetTextRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/combo.py#L377-L384 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset13.py | python | convert_max | (node, **kwargs) | Map MXNet's max operator attributes to onnx's ReduceMax operator
and return the created node. | Map MXNet's max operator attributes to onnx's ReduceMax operator
and return the created node. | [
"Map",
"MXNet",
"s",
"max",
"operator",
"attributes",
"to",
"onnx",
"s",
"ReduceMax",
"operator",
"and",
"return",
"the",
"created",
"node",
"."
] | def convert_max(node, **kwargs):
"""Map MXNet's max operator attributes to onnx's ReduceMax operator
and return the created node.
"""
from onnx.helper import make_node
name, input_nodes, attrs = get_inputs(node, kwargs)
mx_axis = str(attrs.get("axis", 'None'))
axes = convert_string_to_list(... | [
"def",
"convert_max",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"onnx",
".",
"helper",
"import",
"make_node",
"name",
",",
"input_nodes",
",",
"attrs",
"=",
"get_inputs",
"(",
"node",
",",
"kwargs",
")",
"mx_axis",
"=",
"str",
"(",
"attrs... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/onnx/mx2onnx/_op_translations/_op_translations_opset13.py#L1470-L1515 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM_HANDLE.fromBytes | (buffer) | return TpmBuffer(buffer).createObj(TPM_HANDLE) | Returns new TPM_HANDLE object constructed from its marshaled
representation in the given byte buffer | Returns new TPM_HANDLE object constructed from its marshaled
representation in the given byte buffer | [
"Returns",
"new",
"TPM_HANDLE",
"object",
"constructed",
"from",
"its",
"marshaled",
"representation",
"in",
"the",
"given",
"byte",
"buffer"
] | def fromBytes(buffer):
""" Returns new TPM_HANDLE object constructed from its marshaled
representation in the given byte buffer
"""
return TpmBuffer(buffer).createObj(TPM_HANDLE) | [
"def",
"fromBytes",
"(",
"buffer",
")",
":",
"return",
"TpmBuffer",
"(",
"buffer",
")",
".",
"createObj",
"(",
"TPM_HANDLE",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L3455-L3459 | |
microsoft/ivy | 9f3c7ecc0b2383129fdd0953e10890d98d09a82d | ivy/ivy_parser.py | python | p_typesymbol_this | (p) | typesymbol : THIS | typesymbol : THIS | [
"typesymbol",
":",
"THIS"
] | def p_typesymbol_this(p):
'typesymbol : THIS'
p[0] = This()
p[0].lineno = get_lineno(p,1) | [
"def",
"p_typesymbol_this",
"(",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"This",
"(",
")",
"p",
"[",
"0",
"]",
".",
"lineno",
"=",
"get_lineno",
"(",
"p",
",",
"1",
")"
] | https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_parser.py#L1313-L1316 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/base.py | python | StringMixin.__bytes__ | (self) | return self.__unicode__().encode(encoding, 'replace') | Return a string representation for a particular object.
Invoked by bytes(obj) in py3 only.
Yields a bytestring in both py2/py3. | Return a string representation for a particular object. | [
"Return",
"a",
"string",
"representation",
"for",
"a",
"particular",
"object",
"."
] | def __bytes__(self):
"""
Return a string representation for a particular object.
Invoked by bytes(obj) in py3 only.
Yields a bytestring in both py2/py3.
"""
from pandas.core.config import get_option
encoding = get_option("display.encoding")
return self._... | [
"def",
"__bytes__",
"(",
"self",
")",
":",
"from",
"pandas",
".",
"core",
".",
"config",
"import",
"get_option",
"encoding",
"=",
"get_option",
"(",
"\"display.encoding\"",
")",
"return",
"self",
".",
"__unicode__",
"(",
")",
".",
"encode",
"(",
"encoding",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/base.py#L60-L70 | |
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/util/set.py | python | equal | (a, b) | return contains (a, b) and contains (b, a) | Returns True iff 'a' contains the same elements as 'b', irrespective of their order.
# TODO: Python 2.4 has a proper set class. | Returns True iff 'a' contains the same elements as 'b', irrespective of their order.
# TODO: Python 2.4 has a proper set class. | [
"Returns",
"True",
"iff",
"a",
"contains",
"the",
"same",
"elements",
"as",
"b",
"irrespective",
"of",
"their",
"order",
".",
"#",
"TODO",
":",
"Python",
"2",
".",
"4",
"has",
"a",
"proper",
"set",
"class",
"."
] | def equal (a, b):
""" Returns True iff 'a' contains the same elements as 'b', irrespective of their order.
# TODO: Python 2.4 has a proper set class.
"""
return contains (a, b) and contains (b, a) | [
"def",
"equal",
"(",
"a",
",",
"b",
")",
":",
"return",
"contains",
"(",
"a",
",",
"b",
")",
"and",
"contains",
"(",
"b",
",",
"a",
")"
] | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/util/set.py#L38-L42 | |
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | array/min_max_arr.py | python | getminmax_linear_search | (arr) | return min_num, max_num | Linear method
Initialize values of min and max as minimum and maximum of the first two elements
respectively. Starting from 3rd, compare each element with max and min, and
change max and min accordingly | Linear method
Initialize values of min and max as minimum and maximum of the first two elements
respectively. Starting from 3rd, compare each element with max and min, and
change max and min accordingly | [
"Linear",
"method",
"Initialize",
"values",
"of",
"min",
"and",
"max",
"as",
"minimum",
"and",
"maximum",
"of",
"the",
"first",
"two",
"elements",
"respectively",
".",
"Starting",
"from",
"3rd",
"compare",
"each",
"element",
"with",
"max",
"and",
"min",
"and... | def getminmax_linear_search(arr):
""" Linear method
Initialize values of min and max as minimum and maximum of the first two elements
respectively. Starting from 3rd, compare each element with max and min, and
change max and min accordingly
"""
if len(arr) == 0:
return None, ... | [
"def",
"getminmax_linear_search",
"(",
"arr",
")",
":",
"if",
"len",
"(",
"arr",
")",
"==",
"0",
":",
"return",
"None",
",",
"None",
"if",
"len",
"(",
"arr",
")",
"==",
"1",
":",
"return",
"arr",
"[",
"0",
"]",
",",
"arr",
"[",
"0",
"]",
"min_n... | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/array/min_max_arr.py#L8-L35 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_options_view.py | python | GeneralFittingOptionsView.simultaneous_fit_by_specifier | (self) | return self.simul_fit_by_specifier.currentText() | Returns the run, group or pair name. | Returns the run, group or pair name. | [
"Returns",
"the",
"run",
"group",
"or",
"pair",
"name",
"."
] | def simultaneous_fit_by_specifier(self) -> str:
"""Returns the run, group or pair name."""
return self.simul_fit_by_specifier.currentText() | [
"def",
"simultaneous_fit_by_specifier",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"simul_fit_by_specifier",
".",
"currentText",
"(",
")"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_options_view.py#L62-L64 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/thewb/thewb_api.py | python | Videos.getSeasonEpisode | (self, title) | return s_e | Check is there is any season or episode number information in an item's title
return array of season and/or episode numbers plus any duration in minutes and seconds
return array with None values | Check is there is any season or episode number information in an item's title
return array of season and/or episode numbers plus any duration in minutes and seconds
return array with None values | [
"Check",
"is",
"there",
"is",
"any",
"season",
"or",
"episode",
"number",
"information",
"in",
"an",
"item",
"s",
"title",
"return",
"array",
"of",
"season",
"and",
"/",
"or",
"episode",
"numbers",
"plus",
"any",
"duration",
"in",
"minutes",
"and",
"second... | def getSeasonEpisode(self, title):
''' Check is there is any season or episode number information in an item's title
return array of season and/or episode numbers plus any duration in minutes and seconds
return array with None values
'''
s_e = []
for index in range(len(se... | [
"def",
"getSeasonEpisode",
"(",
"self",
",",
"title",
")",
":",
"s_e",
"=",
"[",
"]",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"s_e_Patterns",
")",
")",
":",
"match",
"=",
"self",
".",
"s_e_Patterns",
"[",
"index",
"]",
".",
"ma... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/thewb/thewb_api.py#L205-L216 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/parserdata.py | python | Location.offset | (self, s, start, end) | return Location(self.path, line, column) | Returns a new location offset by
the specified string. | Returns a new location offset by
the specified string. | [
"Returns",
"a",
"new",
"location",
"offset",
"by",
"the",
"specified",
"string",
"."
] | def offset(self, s, start, end):
"""
Returns a new location offset by
the specified string.
"""
if start == end:
return self
skiplines = s.count('\n', start, end)
line = self.line + skiplines
if skiplines:
lastnl = s.rfind('\n', s... | [
"def",
"offset",
"(",
"self",
",",
"s",
",",
"start",
",",
"end",
")",
":",
"if",
"start",
"==",
"end",
":",
"return",
"self",
"skiplines",
"=",
"s",
".",
"count",
"(",
"'\\n'",
",",
"start",
",",
"end",
")",
"line",
"=",
"self",
".",
"line",
"... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/build/pymake/pymake/parserdata.py#L24-L54 | |
p4lang/PI | 38d87e81253feff9fff0660d662c885be78fb719 | tools/cpplint.py | python | CheckForNonStandardConstructs | (filename, clean_lines, linenum,
nesting_state, error) | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint is one way to ease the
transition to new compilers.
- put storage class first (e.g. "static const" instead of "const stat... | r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2. | [
"r",
"Logs",
"an",
"error",
"if",
"we",
"see",
"certain",
"non",
"-",
"ANSI",
"constructs",
"ignored",
"by",
"gcc",
"-",
"2",
"."
] | def CheckForNonStandardConstructs(filename, clean_lines, linenum,
nesting_state, error):
r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint ... | [
"def",
"CheckForNonStandardConstructs",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Remove comments from the line, but leave in strings for now.",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"i... | https://github.com/p4lang/PI/blob/38d87e81253feff9fff0660d662c885be78fb719/tools/cpplint.py#L3271-L3433 | ||
dartsim/dart | 495c82120c836005f2d136d4a50c8cc997fb879b | tools/cpplint.py | python | GetHeaderGuardCPPVariable | (filename) | return re.sub(r'[-./\s]', '_', file_path_from_root).upper() + '_' | Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file. | Returns the CPP variable that should be used as a header guard. | [
"Returns",
"the",
"CPP",
"variable",
"that",
"should",
"be",
"used",
"as",
"a",
"header",
"guard",
"."
] | def GetHeaderGuardCPPVariable(filename):
"""Returns the CPP variable that should be used as a header guard.
Args:
filename: The name of a C++ header file.
Returns:
The CPP variable that should be used as a header guard in the
named file.
"""
# Restores original filename in case that cpplint is... | [
"def",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
":",
"# Restores original filename in case that cpplint is invoked from Emacs's",
"# flymake.",
"filename",
"=",
"re",
".",
"sub",
"(",
"r'_flymake\\.h$'",
",",
"'.h'",
",",
"filename",
")",
"filename",
"=",
"re",
... | https://github.com/dartsim/dart/blob/495c82120c836005f2d136d4a50c8cc997fb879b/tools/cpplint.py#L1362-L1383 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/python/mock-1.0.0/mock.py | python | NonCallableMagicMock.mock_add_spec | (self, spec, spec_set=False) | Add a spec to a mock. `spec` can either be an object or a
list of strings. Only attributes on the `spec` can be fetched as
attributes from the mock.
If `spec_set` is True then only attributes on the spec can be set. | Add a spec to a mock. `spec` can either be an object or a
list of strings. Only attributes on the `spec` can be fetched as
attributes from the mock. | [
"Add",
"a",
"spec",
"to",
"a",
"mock",
".",
"spec",
"can",
"either",
"be",
"an",
"object",
"or",
"a",
"list",
"of",
"strings",
".",
"Only",
"attributes",
"on",
"the",
"spec",
"can",
"be",
"fetched",
"as",
"attributes",
"from",
"the",
"mock",
"."
] | def mock_add_spec(self, spec, spec_set=False):
"""Add a spec to a mock. `spec` can either be an object or a
list of strings. Only attributes on the `spec` can be fetched as
attributes from the mock.
If `spec_set` is True then only attributes on the spec can be set."""
self._mock... | [
"def",
"mock_add_spec",
"(",
"self",
",",
"spec",
",",
"spec_set",
"=",
"False",
")",
":",
"self",
".",
"_mock_add_spec",
"(",
"spec",
",",
"spec_set",
")",
"self",
".",
"_mock_set_magics",
"(",
")"
] | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/mock-1.0.0/mock.py#L1868-L1875 | ||
moderngl/moderngl | 32fe79927e02b0fa893b3603d677bdae39771e14 | moderngl/framebuffer.py | python | Framebuffer.size | (self) | return self._size | tuple: The size of the framebuffer.
Framebuffers created by a window will only report its initial size.
It's better get size information from the window itself. | tuple: The size of the framebuffer. | [
"tuple",
":",
"The",
"size",
"of",
"the",
"framebuffer",
"."
] | def size(self) -> tuple:
'''
tuple: The size of the framebuffer.
Framebuffers created by a window will only report its initial size.
It's better get size information from the window itself.
'''
return self._size | [
"def",
"size",
"(",
"self",
")",
"->",
"tuple",
":",
"return",
"self",
".",
"_size"
] | https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/framebuffer.py#L177-L185 | |
macchina-io/macchina.io | ef24ba0e18379c3dd48fb84e6dbf991101cb8db0 | platform/JS/V8/tools/gyp/pylib/gyp/generator/cmake.py | python | NormjoinPathForceCMakeSource | (base_path, rel_path) | return os.path.join('${CMAKE_CURRENT_LIST_DIR}',
os.path.normpath(os.path.join(base_path, rel_path))) | Resolves rel_path against base_path and returns the result.
If rel_path is an absolute path it is returned unchanged.
Otherwise it is resolved against base_path and normalized.
If the result is a relative path, it is forced to be relative to the
CMakeLists.txt. | Resolves rel_path against base_path and returns the result. | [
"Resolves",
"rel_path",
"against",
"base_path",
"and",
"returns",
"the",
"result",
"."
] | def NormjoinPathForceCMakeSource(base_path, rel_path):
"""Resolves rel_path against base_path and returns the result.
If rel_path is an absolute path it is returned unchanged.
Otherwise it is resolved against base_path and normalized.
If the result is a relative path, it is forced to be relative to the
CMake... | [
"def",
"NormjoinPathForceCMakeSource",
"(",
"base_path",
",",
"rel_path",
")",
":",
"if",
"os",
".",
"path",
".",
"isabs",
"(",
"rel_path",
")",
":",
"return",
"rel_path",
"if",
"any",
"(",
"[",
"rel_path",
".",
"startswith",
"(",
"var",
")",
"for",
"var... | https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/generator/cmake.py#L94-L108 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py | python | error | (msg, *args, **kwargs) | Log a message with severity 'ERROR' on the root logger. | Log a message with severity 'ERROR' on the root logger. | [
"Log",
"a",
"message",
"with",
"severity",
"ERROR",
"on",
"the",
"root",
"logger",
"."
] | def error(msg, *args, **kwargs):
"""
Log a message with severity 'ERROR' on the root logger.
"""
if len(root.handlers) == 0:
basicConfig()
root.error(msg, *args, **kwargs) | [
"def",
"error",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"len",
"(",
"root",
".",
"handlers",
")",
"==",
"0",
":",
"basicConfig",
"(",
")",
"root",
".",
"error",
"(",
"msg",
",",
"*",
"args",
",",
"*",
"*",
"kwar... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/__init__.py#L1579-L1585 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/tcpserver.py | python | TCPServer.add_sockets | (self, sockets: Iterable[socket.socket]) | Makes this server start accepting connections on the given sockets.
The ``sockets`` parameter is a list of socket objects such as
those returned by `~tornado.netutil.bind_sockets`.
`add_sockets` is typically used in combination with that
method and `tornado.process.fork_processes` to pr... | Makes this server start accepting connections on the given sockets. | [
"Makes",
"this",
"server",
"start",
"accepting",
"connections",
"on",
"the",
"given",
"sockets",
"."
] | def add_sockets(self, sockets: Iterable[socket.socket]) -> None:
"""Makes this server start accepting connections on the given sockets.
The ``sockets`` parameter is a list of socket objects such as
those returned by `~tornado.netutil.bind_sockets`.
`add_sockets` is typically used in com... | [
"def",
"add_sockets",
"(",
"self",
",",
"sockets",
":",
"Iterable",
"[",
"socket",
".",
"socket",
"]",
")",
"->",
"None",
":",
"for",
"sock",
"in",
"sockets",
":",
"self",
".",
"_sockets",
"[",
"sock",
".",
"fileno",
"(",
")",
"]",
"=",
"sock",
"se... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/tcpserver.py#L154-L167 | ||
9miao/CrossApp | 1f5375e061bf69841eb19728598f5ae3f508d620 | tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | SourceLocation.offset | (self) | return self._get_instantiation()[3] | Get the file offset represented by this source location. | Get the file offset represented by this source location. | [
"Get",
"the",
"file",
"offset",
"represented",
"by",
"this",
"source",
"location",
"."
] | def offset(self):
"""Get the file offset represented by this source location."""
return self._get_instantiation()[3] | [
"def",
"offset",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_instantiation",
"(",
")",
"[",
"3",
"]"
] | https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L213-L215 | |
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.WriteMacXCassets | (self, xcassets, bundle_depends) | return partial_info_plist | Writes ninja edges for 'mac_bundle_resources' .xcassets files.
This add an invocation of 'actool' via the 'mac_tool.py' helper script.
It assumes that the assets catalogs define at least one imageset and
thus an Assets.car file will be generated in the application resources
directory. If this is not th... | Writes ninja edges for 'mac_bundle_resources' .xcassets files. | [
"Writes",
"ninja",
"edges",
"for",
"mac_bundle_resources",
".",
"xcassets",
"files",
"."
] | def WriteMacXCassets(self, xcassets, bundle_depends):
"""Writes ninja edges for 'mac_bundle_resources' .xcassets files.
This add an invocation of 'actool' via the 'mac_tool.py' helper script.
It assumes that the assets catalogs define at least one imageset and
thus an Assets.car file will be generated ... | [
"def",
"WriteMacXCassets",
"(",
"self",
",",
"xcassets",
",",
"bundle_depends",
")",
":",
"if",
"not",
"xcassets",
":",
"return",
"extra_arguments",
"=",
"{",
"}",
"settings_to_arg",
"=",
"{",
"'XCASSETS_APP_ICON'",
":",
"'app-icon'",
",",
"'XCASSETS_LAUNCH_IMAGE'... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/ninja.py#L824-L868 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/parameter.py | python | Parameter.initialize | (self, init=None, device=None, default_init=initializer.Uniform(),
force_reinit=False) | Initializes parameter and gradient arrays. Only used for :py:class:`NDArray` API.
Parameters
----------
init : Initializer
The initializer to use. Overrides :py:meth:`Parameter.init` and default_init.
device : Device or list of Device, default :py:meth:`device.current_device... | Initializes parameter and gradient arrays. Only used for :py:class:`NDArray` API. | [
"Initializes",
"parameter",
"and",
"gradient",
"arrays",
".",
"Only",
"used",
"for",
":",
"py",
":",
"class",
":",
"NDArray",
"API",
"."
] | def initialize(self, init=None, device=None, default_init=initializer.Uniform(),
force_reinit=False):
"""Initializes parameter and gradient arrays. Only used for :py:class:`NDArray` API.
Parameters
----------
init : Initializer
The initializer to use. Over... | [
"def",
"initialize",
"(",
"self",
",",
"init",
"=",
"None",
",",
"device",
"=",
"None",
",",
"default_init",
"=",
"initializer",
".",
"Uniform",
"(",
")",
",",
"force_reinit",
"=",
"False",
")",
":",
"if",
"self",
".",
"_data",
"is",
"not",
"None",
"... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/parameter.py#L425-L492 | ||
microsoft/checkedc-clang | a173fefde5d7877b7750e7ce96dd08cf18baebf2 | compiler-rt/lib/sanitizer_common/scripts/cpplint.py | python | IsCppString | (line) | return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1 | Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string constant. | Does line terminate so, that the next symbol is in string constant. | [
"Does",
"line",
"terminate",
"so",
"that",
"the",
"next",
"symbol",
"is",
"in",
"string",
"constant",
"."
] | def IsCppString(line):
"""Does line terminate so, that the next symbol is in string constant.
This function does not consider single-line nor multi-line comments.
Args:
line: is a partial line of code starting from the 0..n.
Returns:
True, if next character appended to 'line' is inside a
string c... | [
"def",
"IsCppString",
"(",
"line",
")",
":",
"line",
"=",
"line",
".",
"replace",
"(",
"r'\\\\'",
",",
"'XX'",
")",
"# after this, \\\\\" does not match to \\\"",
"return",
"(",
"(",
"line",
".",
"count",
"(",
"'\"'",
")",
"-",
"line",
".",
"count",
"(",
... | https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1271-L1285 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/numpy/py3/numpy/core/_string_helpers.py | python | english_lower | (s) | return lowered | Apply English case rules to convert ASCII strings to all lower case.
This is an internal utility function to replace calls to str.lower() such
that we can avoid changing behavior with changing locales. In particular,
Turkish has distinct dotted and dotless variants of the Latin letter "I" in
both lower... | Apply English case rules to convert ASCII strings to all lower case. | [
"Apply",
"English",
"case",
"rules",
"to",
"convert",
"ASCII",
"strings",
"to",
"all",
"lower",
"case",
"."
] | def english_lower(s):
""" Apply English case rules to convert ASCII strings to all lower case.
This is an internal utility function to replace calls to str.lower() such
that we can avoid changing behavior with changing locales. In particular,
Turkish has distinct dotted and dotless variants of the Lati... | [
"def",
"english_lower",
"(",
"s",
")",
":",
"lowered",
"=",
"s",
".",
"translate",
"(",
"LOWER_TABLE",
")",
"return",
"lowered"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/_string_helpers.py#L16-L41 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/twodim_base.py | python | tril | (m, k=0) | return where(mask, m, zeros(1, m.dtype)) | Lower triangle of an array.
Return a copy of an array with elements above the `k`-th diagonal zeroed.
Parameters
----------
m : array_like, shape (M, N)
Input array.
k : int, optional
Diagonal above which to zero elements. `k = 0` (the default) is the
main diagonal, `k < 0... | Lower triangle of an array. | [
"Lower",
"triangle",
"of",
"an",
"array",
"."
] | def tril(m, k=0):
"""
Lower triangle of an array.
Return a copy of an array with elements above the `k`-th diagonal zeroed.
Parameters
----------
m : array_like, shape (M, N)
Input array.
k : int, optional
Diagonal above which to zero elements. `k = 0` (the default) is the... | [
"def",
"tril",
"(",
"m",
",",
"k",
"=",
"0",
")",
":",
"m",
"=",
"asanyarray",
"(",
"m",
")",
"mask",
"=",
"tri",
"(",
"*",
"m",
".",
"shape",
"[",
"-",
"2",
":",
"]",
",",
"k",
"=",
"k",
",",
"dtype",
"=",
"bool",
")",
"return",
"where",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/twodim_base.py#L403-L438 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | StaticBox.Create | (*args, **kwargs) | return _controls_.StaticBox_Create(*args, **kwargs) | Create(self, Window parent, int id=-1, String label=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, String name=StaticBoxNameStr) -> bool | Create(self, Window parent, int id=-1, String label=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, String name=StaticBoxNameStr) -> bool | [
"Create",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"-",
"1",
"String",
"label",
"=",
"EmptyString",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"0",
"String",
"name",
"=",
"StaticBoxNameStr",
... | def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String label=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, String name=StaticBoxNameStr) -> bool
"""
return _controls_.StaticBox_Create(*args, **kwargs) | [
"def",
"Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"StaticBox_Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L849-L855 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Source/bindings/scripts/v8_interface.py | python | resolution_tests_methods | (effective_overloads) | Yields resolution test and associated method, in resolution order, for effective overloads of a given length.
This is the heart of the resolution algorithm.
http://heycam.github.io/webidl/#dfn-overload-resolution-algorithm
Note that a given method can be listed multiple times, with different tests!
Th... | Yields resolution test and associated method, in resolution order, for effective overloads of a given length. | [
"Yields",
"resolution",
"test",
"and",
"associated",
"method",
"in",
"resolution",
"order",
"for",
"effective",
"overloads",
"of",
"a",
"given",
"length",
"."
] | def resolution_tests_methods(effective_overloads):
"""Yields resolution test and associated method, in resolution order, for effective overloads of a given length.
This is the heart of the resolution algorithm.
http://heycam.github.io/webidl/#dfn-overload-resolution-algorithm
Note that a given method ... | [
"def",
"resolution_tests_methods",
"(",
"effective_overloads",
")",
":",
"methods",
"=",
"[",
"effective_overload",
"[",
"0",
"]",
"for",
"effective_overload",
"in",
"effective_overloads",
"]",
"if",
"len",
"(",
"methods",
")",
"==",
"1",
":",
"# If only one metho... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Source/bindings/scripts/v8_interface.py#L963-L1137 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge3.py | python | ExodusModel._get_coordinates_at_time | (self, timestep) | return [(x + dx, y + dy, z + dz)
for (x, y,
z), dx, dy, dz in zip(self.nodes, *displacement_values)] | Return the node coordinates list at the given timestep.
This includes the displacement if it exists. | Return the node coordinates list at the given timestep. | [
"Return",
"the",
"node",
"coordinates",
"list",
"at",
"the",
"given",
"timestep",
"."
] | def _get_coordinates_at_time(self, timestep):
"""
Return the node coordinates list at the given timestep.
This includes the displacement if it exists.
"""
timestep = self._format_id_list(timestep, self.get_timesteps(),
'timestep')
... | [
"def",
"_get_coordinates_at_time",
"(",
"self",
",",
"timestep",
")",
":",
"timestep",
"=",
"self",
".",
"_format_id_list",
"(",
"timestep",
",",
"self",
".",
"get_timesteps",
"(",
")",
",",
"'timestep'",
")",
"if",
"len",
"(",
"timestep",
")",
">",
"1",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge3.py#L1611-L1633 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/data/python/ops/dataset_ops.py | python | TensorDataset.__init__ | (self, tensors) | See `Dataset.from_tensors()` for details. | See `Dataset.from_tensors()` for details. | [
"See",
"Dataset",
".",
"from_tensors",
"()",
"for",
"details",
"."
] | def __init__(self, tensors):
"""See `Dataset.from_tensors()` for details."""
super(TensorDataset, self).__init__()
with ops.name_scope("tensors"):
self._tensors = nest.pack_sequence_as(tensors, [
ops.convert_to_tensor(t, name="component_%d" % i)
for i, t in enumerate(nest.flatten(t... | [
"def",
"__init__",
"(",
"self",
",",
"tensors",
")",
":",
"super",
"(",
"TensorDataset",
",",
"self",
")",
".",
"__init__",
"(",
")",
"with",
"ops",
".",
"name_scope",
"(",
"\"tensors\"",
")",
":",
"self",
".",
"_tensors",
"=",
"nest",
".",
"pack_seque... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/data/python/ops/dataset_ops.py#L1078-L1085 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/metrics_impl.py | python | specificity_at_sensitivity | (
labels, predictions, sensitivity, weights=None, num_thresholds=200,
metrics_collections=None, updates_collections=None, name=None) | Computes the specificity at a given sensitivity.
The `specificity_at_sensitivity` function creates four local
variables, `true_positives`, `true_negatives`, `false_positives` and
`false_negatives` that are used to compute the specificity at the given
sensitivity value. The threshold for the given sensitivity v... | Computes the specificity at a given sensitivity. | [
"Computes",
"the",
"specificity",
"at",
"a",
"given",
"sensitivity",
"."
] | def specificity_at_sensitivity(
labels, predictions, sensitivity, weights=None, num_thresholds=200,
metrics_collections=None, updates_collections=None, name=None):
"""Computes the specificity at a given sensitivity.
The `specificity_at_sensitivity` function creates four local
variables, `true_positives`,... | [
"def",
"specificity_at_sensitivity",
"(",
"labels",
",",
"predictions",
",",
"sensitivity",
",",
"weights",
"=",
"None",
",",
"num_thresholds",
"=",
"200",
",",
"metrics_collections",
"=",
"None",
",",
"updates_collections",
"=",
"None",
",",
"name",
"=",
"None"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/metrics_impl.py#L3066-L3173 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/third_party/abseil-cpp/absl/abseil.podspec.gen.py | python | generate | (args) | Generates a podspec file from all BUILD files under absl directory. | Generates a podspec file from all BUILD files under absl directory. | [
"Generates",
"a",
"podspec",
"file",
"from",
"all",
"BUILD",
"files",
"under",
"absl",
"directory",
"."
] | def generate(args):
"""Generates a podspec file from all BUILD files under absl directory."""
rules = filter(relevant_rule, collect_rules("absl"))
with open(args.output, "wt") as f:
write_podspec(f, rules, vars(args)) | [
"def",
"generate",
"(",
"args",
")",
":",
"rules",
"=",
"filter",
"(",
"relevant_rule",
",",
"collect_rules",
"(",
"\"absl\"",
")",
")",
"with",
"open",
"(",
"args",
".",
"output",
",",
"\"wt\"",
")",
"as",
"f",
":",
"write_podspec",
"(",
"f",
",",
"... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/third_party/abseil-cpp/absl/abseil.podspec.gen.py#L200-L204 | ||
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | docs/examples/use_cases/pytorch/resnet50/main.py | python | adjust_learning_rate | (optimizer, epoch, step, len_epoch) | LR schedule that should yield 76% converged accuracy with batch size 256 | LR schedule that should yield 76% converged accuracy with batch size 256 | [
"LR",
"schedule",
"that",
"should",
"yield",
"76%",
"converged",
"accuracy",
"with",
"batch",
"size",
"256"
] | def adjust_learning_rate(optimizer, epoch, step, len_epoch):
"""LR schedule that should yield 76% converged accuracy with batch size 256"""
factor = epoch // 30
if epoch >= 80:
factor = factor + 1
lr = args.lr*(0.1**factor)
"""Warmup"""
if epoch < 5:
lr = lr*float(1 + step + e... | [
"def",
"adjust_learning_rate",
"(",
"optimizer",
",",
"epoch",
",",
"step",
",",
"len_epoch",
")",
":",
"factor",
"=",
"epoch",
"//",
"30",
"if",
"epoch",
">=",
"80",
":",
"factor",
"=",
"factor",
"+",
"1",
"lr",
"=",
"args",
".",
"lr",
"*",
"(",
"... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/docs/examples/use_cases/pytorch/resnet50/main.py#L536-L550 | ||
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBWatchpoint.GetWatchpointEventTypeFromEvent | (event) | return _lldb.SBWatchpoint_GetWatchpointEventTypeFromEvent(event) | GetWatchpointEventTypeFromEvent(SBEvent event) -> lldb::WatchpointEventType | GetWatchpointEventTypeFromEvent(SBEvent event) -> lldb::WatchpointEventType | [
"GetWatchpointEventTypeFromEvent",
"(",
"SBEvent",
"event",
")",
"-",
">",
"lldb",
"::",
"WatchpointEventType"
] | def GetWatchpointEventTypeFromEvent(event):
"""GetWatchpointEventTypeFromEvent(SBEvent event) -> lldb::WatchpointEventType"""
return _lldb.SBWatchpoint_GetWatchpointEventTypeFromEvent(event) | [
"def",
"GetWatchpointEventTypeFromEvent",
"(",
"event",
")",
":",
"return",
"_lldb",
".",
"SBWatchpoint_GetWatchpointEventTypeFromEvent",
"(",
"event",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L15257-L15259 | |
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | EntryProxy.__get_windows_path | (self) | r"""Return the path with \ as the path separator,
regardless of platform. | r"""Return the path with \ as the path separator,
regardless of platform. | [
"r",
"Return",
"the",
"path",
"with",
"\\",
"as",
"the",
"path",
"separator",
"regardless",
"of",
"platform",
"."
] | def __get_windows_path(self):
r"""Return the path with \ as the path separator,
regardless of platform."""
if OS_SEP == '\\':
return self
else:
entry = self.get()
r = entry.get_path().replace(OS_SEP, '\\')
return SCons.Subst.SpecialAttrWrap... | [
"def",
"__get_windows_path",
"(",
"self",
")",
":",
"if",
"OS_SEP",
"==",
"'\\\\'",
":",
"return",
"self",
"else",
":",
"entry",
"=",
"self",
".",
"get",
"(",
")",
"r",
"=",
"entry",
".",
"get_path",
"(",
")",
".",
"replace",
"(",
"OS_SEP",
",",
"'... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L476-L484 | ||
francinexue/xuefu | b6ff79747a42e020588c0c0a921048e08fe4680c | ctpx/ctp2/ctptd.py | python | CtpTd.onRspQryTransferBank | (self, TransferBankField, RspInfoField, requestId, final) | 请求查询转帐银行响应 | 请求查询转帐银行响应 | [
"请求查询转帐银行响应"
] | def onRspQryTransferBank(self, TransferBankField, RspInfoField, requestId, final):
"""请求查询转帐银行响应"""
pass | [
"def",
"onRspQryTransferBank",
"(",
"self",
",",
"TransferBankField",
",",
"RspInfoField",
",",
"requestId",
",",
"final",
")",
":",
"pass"
] | https://github.com/francinexue/xuefu/blob/b6ff79747a42e020588c0c0a921048e08fe4680c/ctpx/ctp2/ctptd.py#L245-L247 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/flatmenu.py | python | FlatMenu.GetLabel | (self, itemId) | return item.GetText() | Returns the label of a :class:`FlatMenuItem`.
:param integer `id`: the menu item identifier;
:see: :meth:`~FlatMenu.SetLabel`. | Returns the label of a :class:`FlatMenuItem`. | [
"Returns",
"the",
"label",
"of",
"a",
":",
"class",
":",
"FlatMenuItem",
"."
] | def GetLabel(self, itemId):
"""
Returns the label of a :class:`FlatMenuItem`.
:param integer `id`: the menu item identifier;
:see: :meth:`~FlatMenu.SetLabel`.
"""
item = self.FindItem(itemId)
return item.GetText() | [
"def",
"GetLabel",
"(",
"self",
",",
"itemId",
")",
":",
"item",
"=",
"self",
".",
"FindItem",
"(",
"itemId",
")",
"return",
"item",
".",
"GetText",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L6881-L6891 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/path.py/path.py | python | Path.write_bytes | (self, bytes, append=False) | Open this file and write the given bytes to it.
Default behavior is to overwrite any existing file.
Call ``p.write_bytes(bytes, append=True)`` to append instead. | Open this file and write the given bytes to it. | [
"Open",
"this",
"file",
"and",
"write",
"the",
"given",
"bytes",
"to",
"it",
"."
] | def write_bytes(self, bytes, append=False):
""" Open this file and write the given bytes to it.
Default behavior is to overwrite any existing file.
Call ``p.write_bytes(bytes, append=True)`` to append instead.
"""
if append:
mode = 'ab'
else:
mode... | [
"def",
"write_bytes",
"(",
"self",
",",
"bytes",
",",
"append",
"=",
"False",
")",
":",
"if",
"append",
":",
"mode",
"=",
"'ab'",
"else",
":",
"mode",
"=",
"'wb'",
"with",
"self",
".",
"open",
"(",
"mode",
")",
"as",
"f",
":",
"f",
".",
"write",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/path.py/path.py#L767-L778 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/database.py | python | InstalledDistribution.read_exports | (self) | return result | Read exports data from a file in .ini format.
:return: A dictionary of exports, mapping an export category to a list
of :class:`ExportEntry` instances describing the individual
export entries. | [] | def read_exports(self):
"""
Read exports data from a file in .ini format.
:return: A dictionary of exports, mapping an export category to a list
of :class:`ExportEntry` instances describing the individual
export entries.
"""
result = {}
... | [
"def",
"read_exports",
"(",
"self",
")",
":",
"result",
"=",
"{",
"}",
"r",
"=",
"self",
".",
"get_distinfo_resource",
"(",
"EXPORTS_FILENAME",
")",
"if",
"r",
":",
"with",
"contextlib",
".",
"closing",
"(",
"r",
".",
"as_stream",
"(",
")",
")",
"as",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/distlib/database.py#L1233-L1259 | ||
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/gauth.py | python | AuthSubToken.from_url | (str_or_uri) | return AuthSubToken(token_and_scopes[0], token_and_scopes[1]) | Creates a new AuthSubToken using information in the URL.
Uses auth_sub_string_from_url.
Args:
str_or_uri: The current page's URL (as a str or atom.http_core.Uri)
which should contain a token query parameter since the
Google auth server redirected the user's browser to... | Creates a new AuthSubToken using information in the URL. | [
"Creates",
"a",
"new",
"AuthSubToken",
"using",
"information",
"in",
"the",
"URL",
"."
] | def from_url(str_or_uri):
"""Creates a new AuthSubToken using information in the URL.
Uses auth_sub_string_from_url.
Args:
str_or_uri: The current page's URL (as a str or atom.http_core.Uri)
which should contain a token query parameter since the
Google auth server... | [
"def",
"from_url",
"(",
"str_or_uri",
")",
":",
"token_and_scopes",
"=",
"auth_sub_string_from_url",
"(",
"str_or_uri",
")",
"return",
"AuthSubToken",
"(",
"token_and_scopes",
"[",
"0",
"]",
",",
"token_and_scopes",
"[",
"1",
"]",
")"
] | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/gauth.py#L335-L347 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/_config/config.py | python | register_option | (key: str, defval: object, doc="", validator=None, cb=None) | Register an option in the package-wide pandas config object
Parameters
----------
key - a fully-qualified key, e.g. "x.y.option - z".
defval - the default value of the option
doc - a string description of the option
validator - a function of a single argument, should raise `Value... | Register an option in the package-wide pandas config object | [
"Register",
"an",
"option",
"in",
"the",
"package",
"-",
"wide",
"pandas",
"config",
"object"
] | def register_option(key: str, defval: object, doc="", validator=None, cb=None):
"""Register an option in the package-wide pandas config object
Parameters
----------
key - a fully-qualified key, e.g. "x.y.option - z".
defval - the default value of the option
doc - a string descrip... | [
"def",
"register_option",
"(",
"key",
":",
"str",
",",
"defval",
":",
"object",
",",
"doc",
"=",
"\"\"",
",",
"validator",
"=",
"None",
",",
"cb",
"=",
"None",
")",
":",
"import",
"tokenize",
"import",
"keyword",
"key",
"=",
"key",
".",
"lower",
"(",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/_config/config.py#L413-L479 | ||
OkCupid/okws | 1c337392c676ccb4e9a4c92d11d5d2fada6427d2 | contrib/pub2-upgrade.py | python | PubParser.p_pub_block | (self, p) | pub_block : LBP block_inner RBP | pub_block : LBP block_inner RBP | [
"pub_block",
":",
"LBP",
"block_inner",
"RBP"
] | def p_pub_block (self, p):
'''pub_block : LBP block_inner RBP'''
p[0] = PubBlock (p[2], p[1], p[3]) | [
"def",
"p_pub_block",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"PubBlock",
"(",
"p",
"[",
"2",
"]",
",",
"p",
"[",
"1",
"]",
",",
"p",
"[",
"3",
"]",
")"
] | https://github.com/OkCupid/okws/blob/1c337392c676ccb4e9a4c92d11d5d2fada6427d2/contrib/pub2-upgrade.py#L274-L276 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/optim/_multi_tensor/_functional.py | python | adamax | (params: List[Tensor],
grads: List[Tensor],
exp_avgs: List[Tensor],
exp_infs: List[Tensor],
state_steps: List[Tensor],
*,
beta1: float,
beta2: float,
lr: float,
weight_decay: float,
eps: float) | r"""Functional API that performs Adamax algorithm computation.
See :class:`~torch.optim.Adamax` for details. | r"""Functional API that performs Adamax algorithm computation. | [
"r",
"Functional",
"API",
"that",
"performs",
"Adamax",
"algorithm",
"computation",
"."
] | def adamax(params: List[Tensor],
grads: List[Tensor],
exp_avgs: List[Tensor],
exp_infs: List[Tensor],
state_steps: List[Tensor],
*,
beta1: float,
beta2: float,
lr: float,
weight_decay: float,
eps: float):
r... | [
"def",
"adamax",
"(",
"params",
":",
"List",
"[",
"Tensor",
"]",
",",
"grads",
":",
"List",
"[",
"Tensor",
"]",
",",
"exp_avgs",
":",
"List",
"[",
"Tensor",
"]",
",",
"exp_infs",
":",
"List",
"[",
"Tensor",
"]",
",",
"state_steps",
":",
"List",
"["... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/optim/_multi_tensor/_functional.py#L75-L116 | ||
NVIDIAGameWorks/kaolin | e5148d05e9c1e2ce92a07881ce3593b1c5c3f166 | kaolin/ops/spc/spc.py | python | unbatched_query | (octree, exsum, query_points, level) | return _C.ops.spc.query_cuda(octree.contiguous(), exsum.contiguous(),
query_points.contiguous(), level).long() | r"""Query point indices from the octree.
Given a point hierarchy, this function will efficiently find the corresponding indices of the
points in the points tensor. For each input in query_points, returns a index to the points tensor.
Returns -1 if the point does not exist.
Args:
octree (torch.... | r"""Query point indices from the octree. | [
"r",
"Query",
"point",
"indices",
"from",
"the",
"octree",
"."
] | def unbatched_query(octree, exsum, query_points, level):
r"""Query point indices from the octree.
Given a point hierarchy, this function will efficiently find the corresponding indices of the
points in the points tensor. For each input in query_points, returns a index to the points tensor.
Returns -1 i... | [
"def",
"unbatched_query",
"(",
"octree",
",",
"exsum",
",",
"query_points",
",",
"level",
")",
":",
"return",
"_C",
".",
"ops",
".",
"spc",
".",
"query_cuda",
"(",
"octree",
".",
"contiguous",
"(",
")",
",",
"exsum",
".",
"contiguous",
"(",
")",
",",
... | https://github.com/NVIDIAGameWorks/kaolin/blob/e5148d05e9c1e2ce92a07881ce3593b1c5c3f166/kaolin/ops/spc/spc.py#L242-L259 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py | python | VocabularyFileCategoricalColumn.transform_feature | (self, transformation_cache, state_manager) | return self._transform_input_tensor(input_tensor, state_manager) | Creates a lookup table for the vocabulary. | Creates a lookup table for the vocabulary. | [
"Creates",
"a",
"lookup",
"table",
"for",
"the",
"vocabulary",
"."
] | def transform_feature(self, transformation_cache, state_manager):
"""Creates a lookup table for the vocabulary."""
input_tensor = _to_sparse_input_and_drop_ignore_values(
transformation_cache.get(self.key, state_manager))
return self._transform_input_tensor(input_tensor, state_manager) | [
"def",
"transform_feature",
"(",
"self",
",",
"transformation_cache",
",",
"state_manager",
")",
":",
"input_tensor",
"=",
"_to_sparse_input_and_drop_ignore_values",
"(",
"transformation_cache",
".",
"get",
"(",
"self",
".",
"key",
",",
"state_manager",
")",
")",
"r... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L3621-L3625 | |
cvxpy/cvxpy | 5165b4fb750dfd237de8659383ef24b4b2e33aaf | cvxpy/problems/problem.py | python | Problem._sort_candidate_solvers | (solvers) | Sorts candidate solvers lists according to slv_def.CONIC_SOLVERS/QP_SOLVERS
Arguments
---------
candidates : dict
Dictionary of candidate solvers divided in qp_solvers
and conic_solvers
Returns
-------
None | Sorts candidate solvers lists according to slv_def.CONIC_SOLVERS/QP_SOLVERS | [
"Sorts",
"candidate",
"solvers",
"lists",
"according",
"to",
"slv_def",
".",
"CONIC_SOLVERS",
"/",
"QP_SOLVERS"
] | def _sort_candidate_solvers(solvers) -> None:
"""Sorts candidate solvers lists according to slv_def.CONIC_SOLVERS/QP_SOLVERS
Arguments
---------
candidates : dict
Dictionary of candidate solvers divided in qp_solvers
and conic_solvers
Returns
----... | [
"def",
"_sort_candidate_solvers",
"(",
"solvers",
")",
"->",
"None",
":",
"if",
"len",
"(",
"solvers",
"[",
"'conic_solvers'",
"]",
")",
">",
"1",
":",
"solvers",
"[",
"'conic_solvers'",
"]",
"=",
"sorted",
"(",
"solvers",
"[",
"'conic_solvers'",
"]",
",",... | https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/problems/problem.py#L815-L834 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/eclib/finddlg.py | python | FindBox.__init__ | (self, parent, fdata, id=wx.ID_ANY, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=AFR_STYLE_FINDDIALOG,
name=FindBoxName) | Create the container box
@param fdata: wx.FindReplaceData | Create the container box
@param fdata: wx.FindReplaceData | [
"Create",
"the",
"container",
"box",
"@param",
"fdata",
":",
"wx",
".",
"FindReplaceData"
] | def __init__(self, parent, fdata, id=wx.ID_ANY, pos=wx.DefaultPosition,
size=wx.DefaultSize, style=AFR_STYLE_FINDDIALOG,
name=FindBoxName):
"""Create the container box
@param fdata: wx.FindReplaceData
"""
super(FindBox, self).__init__(parent, id, pos, s... | [
"def",
"__init__",
"(",
"self",
",",
"parent",
",",
"fdata",
",",
"id",
"=",
"wx",
".",
"ID_ANY",
",",
"pos",
"=",
"wx",
".",
"DefaultPosition",
",",
"size",
"=",
"wx",
".",
"DefaultSize",
",",
"style",
"=",
"AFR_STYLE_FINDDIALOG",
",",
"name",
"=",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/finddlg.py#L637-L672 | ||
cornell-zhang/heterocl | 6d9e4b4acc2ee2707b2d25b27298c0335bccedfd | python/heterocl/devices.py | python | device_to_str | (dtype) | Convert a device type to string format.
Parameters
----------
dtype : Device or str
The device type to be converted
Returns
-------
str
The converted device type in string format. | Convert a device type to string format. | [
"Convert",
"a",
"device",
"type",
"to",
"string",
"format",
"."
] | def device_to_str(dtype):
"""Convert a device type to string format.
Parameters
----------
dtype : Device or str
The device type to be converted
Returns
-------
str
The converted device type in string format.
"""
if isinstance(dtype, Device):
if isinstance(d... | [
"def",
"device_to_str",
"(",
"dtype",
")",
":",
"if",
"isinstance",
"(",
"dtype",
",",
"Device",
")",
":",
"if",
"isinstance",
"(",
"dtype",
",",
"CPU",
")",
":",
"return",
"\"cpu_\"",
"+",
"str",
"(",
"dtype",
".",
"model",
")",
"elif",
"isinstance",
... | https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/devices.py#L328-L349 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/histograms.py | python | _hist_bin_scott | (x, range) | return (24.0 * np.pi**0.5 / x.size)**(1.0 / 3.0) * np.std(x) | Scott histogram bin estimator.
The binwidth is proportional to the standard deviation of the data
and inversely proportional to the cube root of data size
(asymptotically optimal).
Parameters
----------
x : array_like
Input data that is to be histogrammed, trimmed to range. May not
... | Scott histogram bin estimator. | [
"Scott",
"histogram",
"bin",
"estimator",
"."
] | def _hist_bin_scott(x, range):
"""
Scott histogram bin estimator.
The binwidth is proportional to the standard deviation of the data
and inversely proportional to the cube root of data size
(asymptotically optimal).
Parameters
----------
x : array_like
Input data that is to be ... | [
"def",
"_hist_bin_scott",
"(",
"x",
",",
"range",
")",
":",
"del",
"range",
"# unused",
"return",
"(",
"24.0",
"*",
"np",
".",
"pi",
"**",
"0.5",
"/",
"x",
".",
"size",
")",
"**",
"(",
"1.0",
"/",
"3.0",
")",
"*",
"np",
".",
"std",
"(",
"x",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/histograms.py#L103-L122 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | third_party/closure_linter/closure_linter/closurizednamespacesinfo.py | python | ClosurizedNamespacesInfo.IsFirstProvide | (self, token) | return self._provide_tokens and token == self._provide_tokens[0] | Returns whether token is the first provide token. | Returns whether token is the first provide token. | [
"Returns",
"whether",
"token",
"is",
"the",
"first",
"provide",
"token",
"."
] | def IsFirstProvide(self, token):
"""Returns whether token is the first provide token."""
return self._provide_tokens and token == self._provide_tokens[0] | [
"def",
"IsFirstProvide",
"(",
"self",
",",
"token",
")",
":",
"return",
"self",
".",
"_provide_tokens",
"and",
"token",
"==",
"self",
".",
"_provide_tokens",
"[",
"0",
"]"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/closurizednamespacesinfo.py#L264-L266 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/Descriptors/Descriptors.py | python | DescriptorCalculator.ShowDescriptors | (self) | prints out a list of the descriptors | prints out a list of the descriptors | [
"prints",
"out",
"a",
"list",
"of",
"the",
"descriptors"
] | def ShowDescriptors(self):
""" prints out a list of the descriptors
"""
if self.simpleList is None:
raise NotImplementedError('Need to have a simpleList defined')
print('#---------')
print('Simple:')
for desc in self.simpleList:
print(desc)
if self.compoundList:
print('#--... | [
"def",
"ShowDescriptors",
"(",
"self",
")",
":",
"if",
"self",
".",
"simpleList",
"is",
"None",
":",
"raise",
"NotImplementedError",
"(",
"'Need to have a simpleList defined'",
")",
"print",
"(",
"'#---------'",
")",
"print",
"(",
"'Simple:'",
")",
"for",
"desc"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/Descriptors/Descriptors.py#L28-L42 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | ppapi/generators/idl_parser.py | python | IDLParser.p_label_cont | (self, p) | label_cont : ',' label_list
| | label_cont : ',' label_list
| | [
"label_cont",
":",
"label_list",
"|"
] | def p_label_cont(self, p):
"""label_cont : ',' label_list
|"""
if len(p) > 1: p[0] = p[2]
if self.parse_debug: DumpReduction('label_cont', p) | [
"def",
"p_label_cont",
"(",
"self",
",",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
">",
"1",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"2",
"]",
"if",
"self",
".",
"parse_debug",
":",
"DumpReduction",
"(",
"'label_cont'",
",",
"p",
")"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_parser.py#L717-L721 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/io/formats/info.py | python | TableBuilderAbstract.add_dtypes_line | (self) | Add summary line with dtypes present in dataframe. | Add summary line with dtypes present in dataframe. | [
"Add",
"summary",
"line",
"with",
"dtypes",
"present",
"in",
"dataframe",
"."
] | def add_dtypes_line(self) -> None:
"""Add summary line with dtypes present in dataframe."""
collected_dtypes = [
f"{key}({val:d})" for key, val in sorted(self.dtype_counts.items())
]
self._lines.append(f"dtypes: {', '.join(collected_dtypes)}") | [
"def",
"add_dtypes_line",
"(",
"self",
")",
"->",
"None",
":",
"collected_dtypes",
"=",
"[",
"f\"{key}({val:d})\"",
"for",
"key",
",",
"val",
"in",
"sorted",
"(",
"self",
".",
"dtype_counts",
".",
"items",
"(",
")",
")",
"]",
"self",
".",
"_lines",
".",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/io/formats/info.py#L451-L456 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/fractions.py | python | gcd | (a, b) | return a | Calculate the Greatest Common Divisor of a and b.
Unless b==0, the result will have the same sign as b (so that when
b is divided by it, the result comes out positive). | Calculate the Greatest Common Divisor of a and b. | [
"Calculate",
"the",
"Greatest",
"Common",
"Divisor",
"of",
"a",
"and",
"b",
"."
] | def gcd(a, b):
"""Calculate the Greatest Common Divisor of a and b.
Unless b==0, the result will have the same sign as b (so that when
b is divided by it, the result comes out positive).
"""
while b:
a, b = b, a%b
return a | [
"def",
"gcd",
"(",
"a",
",",
"b",
")",
":",
"while",
"b",
":",
"a",
",",
"b",
"=",
"b",
",",
"a",
"%",
"b",
"return",
"a"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/fractions.py#L18-L26 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/filter_design.py | python | cheby2 | (N, rs, Wn, btype='low', analog=False, output='ba') | return iirfilter(N, Wn, rs=rs, btype=btype, analog=analog,
output=output, ftype='cheby2') | Chebyshev type II digital and analog filter design.
Design an Nth-order digital or analog Chebyshev type II filter and
return the filter coefficients.
Parameters
----------
N : int
The order of the filter.
rs : float
The minimum attenuation required in the stop band.
Sp... | Chebyshev type II digital and analog filter design. | [
"Chebyshev",
"type",
"II",
"digital",
"and",
"analog",
"filter",
"design",
"."
] | def cheby2(N, rs, Wn, btype='low', analog=False, output='ba'):
"""
Chebyshev type II digital and analog filter design.
Design an Nth-order digital or analog Chebyshev type II filter and
return the filter coefficients.
Parameters
----------
N : int
The order of the filter.
rs : ... | [
"def",
"cheby2",
"(",
"N",
",",
"rs",
",",
"Wn",
",",
"btype",
"=",
"'low'",
",",
"analog",
"=",
"False",
",",
"output",
"=",
"'ba'",
")",
":",
"return",
"iirfilter",
"(",
"N",
",",
"Wn",
",",
"rs",
"=",
"rs",
",",
"btype",
"=",
"btype",
",",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/filter_design.py#L2203-L2281 | |
NREL/EnergyPlus | fadc5973b85c70e8cc923efb69c144e808a26078 | src/EnergyPlus/api/datatransfer.py | python | DataExchange.today_weather_outdoor_relative_humidity_at_time | (self, state: c_void_p, hour: int,
time_step_number: int) | return self.api.todayWeatherOutRelativeHumidityAtTime(state, hour, time_step_number) | Gets the specified weather data at the specified hour and time step index within that hour
:param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`.
:param hour: Integer hour of day (0 to 23)
:param time_step_number: Time step index in hour, fro... | Gets the specified weather data at the specified hour and time step index within that hour | [
"Gets",
"the",
"specified",
"weather",
"data",
"at",
"the",
"specified",
"hour",
"and",
"time",
"step",
"index",
"within",
"that",
"hour"
] | def today_weather_outdoor_relative_humidity_at_time(self, state: c_void_p, hour: int,
time_step_number: int) -> float:
"""
Gets the specified weather data at the specified hour and time step index within that hour
:param state: An active E... | [
"def",
"today_weather_outdoor_relative_humidity_at_time",
"(",
"self",
",",
"state",
":",
"c_void_p",
",",
"hour",
":",
"int",
",",
"time_step_number",
":",
"int",
")",
"->",
"float",
":",
"return",
"self",
".",
"api",
".",
"todayWeatherOutRelativeHumidityAtTime",
... | https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/src/EnergyPlus/api/datatransfer.py#L1175-L1185 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/saving/saved_model/save.py | python | _reset_layer_losses | (parent_layer) | return losses_dict | Resets losses of layer and its sublayers, and returns original losses. | Resets losses of layer and its sublayers, and returns original losses. | [
"Resets",
"losses",
"of",
"layer",
"and",
"its",
"sublayers",
"and",
"returns",
"original",
"losses",
"."
] | def _reset_layer_losses(parent_layer):
"""Resets losses of layer and its sublayers, and returns original losses."""
losses_dict = {}
for layer in _list_all_layers(parent_layer) + [parent_layer]:
losses_dict[layer] = {'losses': layer._losses[:],
'eager_losses': layer._eager_losses[:]}... | [
"def",
"_reset_layer_losses",
"(",
"parent_layer",
")",
":",
"losses_dict",
"=",
"{",
"}",
"for",
"layer",
"in",
"_list_all_layers",
"(",
"parent_layer",
")",
"+",
"[",
"parent_layer",
"]",
":",
"losses_dict",
"[",
"layer",
"]",
"=",
"{",
"'losses'",
":",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/saving/saved_model/save.py#L372-L381 | |
NERSC/timemory | 431912b360ff50d1a160d7826e2eea04fbd1037f | scripts/gprof2dot.py | python | Profile._tarjan | (self, function, order, stack, data) | return order | Tarjan's strongly connected components algorithm.
See also:
- http://en.wikipedia.org/wiki/Tarjan's_strongly_connected_components_algorithm | Tarjan's strongly connected components algorithm. | [
"Tarjan",
"s",
"strongly",
"connected",
"components",
"algorithm",
"."
] | def _tarjan(self, function, order, stack, data):
"""Tarjan's strongly connected components algorithm.
See also:
- http://en.wikipedia.org/wiki/Tarjan's_strongly_connected_components_algorithm
"""
try:
func_data = data[function.id]
return order
ex... | [
"def",
"_tarjan",
"(",
"self",
",",
"function",
",",
"order",
",",
"stack",
",",
"data",
")",
":",
"try",
":",
"func_data",
"=",
"data",
"[",
"function",
".",
"id",
"]",
"return",
"order",
"except",
"KeyError",
":",
"func_data",
"=",
"self",
".",
"_T... | https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/scripts/gprof2dot.py#L402-L441 | |
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py | python | GraphRewriter.remove_redundant_quantization | (self, old_graph) | return self.output_graph | Removes unneeded pairs of quantize/dequantize ops from the graph.
This is a bit of a tricky function, because it's attempting to spot the
pattern of dequantizing from eight-bit up to float, and then immediately
quantizing back down to eight bits again, that's introduced by previous
passes that do 'key-... | Removes unneeded pairs of quantize/dequantize ops from the graph. | [
"Removes",
"unneeded",
"pairs",
"of",
"quantize",
"/",
"dequantize",
"ops",
"from",
"the",
"graph",
"."
] | def remove_redundant_quantization(self, old_graph):
"""Removes unneeded pairs of quantize/dequantize ops from the graph.
This is a bit of a tricky function, because it's attempting to spot the
pattern of dequantizing from eight-bit up to float, and then immediately
quantizing back down to eight bits ag... | [
"def",
"remove_redundant_quantization",
"(",
"self",
",",
"old_graph",
")",
":",
"old_nodes_map",
"=",
"self",
".",
"create_nodes_map",
"(",
"old_graph",
")",
"self",
".",
"output_graph",
"=",
"tf",
".",
"GraphDef",
"(",
")",
"inputs_to_rename",
"=",
"{",
"}",... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/quantization/tools/quantize_graph.py#L804-L904 | |
PaddlePaddle/PaddleOCR | b756bf5f8c90142e0d89d3db0163965c686b6ffe | PPOCRLabel/PPOCRLabel.py | python | MainWindow.newShape | (self, value=True) | Pop-up and give focus to the label editor.
position MUST be in global coordinates. | Pop-up and give focus to the label editor. | [
"Pop",
"-",
"up",
"and",
"give",
"focus",
"to",
"the",
"label",
"editor",
"."
] | def newShape(self, value=True):
"""Pop-up and give focus to the label editor.
position MUST be in global coordinates.
"""
if len(self.labelHist) > 0:
self.labelDialog = LabelDialog(
parent=self, listItem=self.labelHist)
if value:
text = s... | [
"def",
"newShape",
"(",
"self",
",",
"value",
"=",
"True",
")",
":",
"if",
"len",
"(",
"self",
".",
"labelHist",
")",
">",
"0",
":",
"self",
".",
"labelDialog",
"=",
"LabelDialog",
"(",
"parent",
"=",
"self",
",",
"listItem",
"=",
"self",
".",
"lab... | https://github.com/PaddlePaddle/PaddleOCR/blob/b756bf5f8c90142e0d89d3db0163965c686b6ffe/PPOCRLabel/PPOCRLabel.py#L1185-L1216 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | PyApp.WakeUpIdle | (*args, **kwargs) | return _core_.PyApp_WakeUpIdle(*args, **kwargs) | WakeUpIdle(self)
Make sure that idle events are sent again.
:see: `wx.WakeUpIdle` | WakeUpIdle(self) | [
"WakeUpIdle",
"(",
"self",
")"
] | def WakeUpIdle(*args, **kwargs):
"""
WakeUpIdle(self)
Make sure that idle events are sent again.
:see: `wx.WakeUpIdle`
"""
return _core_.PyApp_WakeUpIdle(*args, **kwargs) | [
"def",
"WakeUpIdle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"PyApp_WakeUpIdle",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L7926-L7933 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/robotsim.py | python | Simulator.getTime | (self) | return _robotsim.Simulator_getTime(self) | r"""
Returns the simulation time. | r"""
Returns the simulation time. | [
"r",
"Returns",
"the",
"simulation",
"time",
"."
] | def getTime(self) ->float:
r"""
Returns the simulation time.
"""
return _robotsim.Simulator_getTime(self) | [
"def",
"getTime",
"(",
"self",
")",
"->",
"float",
":",
"return",
"_robotsim",
".",
"Simulator_getTime",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L7864-L7869 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/http/cookiejar.py | python | CookiePolicy.set_ok | (self, cookie, request) | Return true if (and only if) cookie should be accepted from server.
Currently, pre-expired cookies never get this far -- the CookieJar
class deletes such cookies itself. | Return true if (and only if) cookie should be accepted from server. | [
"Return",
"true",
"if",
"(",
"and",
"only",
"if",
")",
"cookie",
"should",
"be",
"accepted",
"from",
"server",
"."
] | def set_ok(self, cookie, request):
"""Return true if (and only if) cookie should be accepted from server.
Currently, pre-expired cookies never get this far -- the CookieJar
class deletes such cookies itself.
"""
raise NotImplementedError() | [
"def",
"set_ok",
"(",
"self",
",",
"cookie",
",",
"request",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/http/cookiejar.py#L843-L850 | ||
fasiondog/hikyuu | 842751aa25283f9fdafc6f560ea262f79e67a307 | hikyuu/draw/drawplot/bokeh_draw.py | python | mkplot | (kdata, new=True, axes=None, colorup='r', colordown='g', ticksize=3) | return None | 绘制美式K线图
:param KData kdata: K线数据
:param bool new: 是否在新窗口中显示,只在没有指定axes时生效
:param axes: 指定的坐标轴
:param colorup: the color of the lines where close >= open
:param colordown: the color of the lines where close < open
:param ticksize: open/close tick marker in points | 绘制美式K线图
:param KData kdata: K线数据
:param bool new: 是否在新窗口中显示,只在没有指定axes时生效
:param axes: 指定的坐标轴
:param colorup: the color of the lines where close >= open
:param colordown: the color of the lines where close < open
:param ticksize: open/close tick marker in points | [
"绘制美式K线图",
":",
"param",
"KData",
"kdata",
":",
"K线数据",
":",
"param",
"bool",
"new",
":",
"是否在新窗口中显示,只在没有指定axes时生效",
":",
"param",
"axes",
":",
"指定的坐标轴",
":",
"param",
"colorup",
":",
"the",
"color",
"of",
"the",
"lines",
"where",
"close",
">",
"=",
"ope... | def mkplot(kdata, new=True, axes=None, colorup='r', colordown='g', ticksize=3):
"""绘制美式K线图
:param KData kdata: K线数据
:param bool new: 是否在新窗口中显示,只在没有指定axes时生效
:param axes: 指定的坐标轴
:param colorup: the color of the lines where close >= open
:param colordown: the color of the line... | [
"def",
"mkplot",
"(",
"kdata",
",",
"new",
"=",
"True",
",",
"axes",
"=",
"None",
",",
"colorup",
"=",
"'r'",
",",
"colordown",
"=",
"'g'",
",",
"ticksize",
"=",
"3",
")",
":",
"print",
"(",
"\"Bokeh 暂不支持绘制美式K线图, 请使用 matplotlib\")",
"",
"return",
"None"
... | https://github.com/fasiondog/hikyuu/blob/842751aa25283f9fdafc6f560ea262f79e67a307/hikyuu/draw/drawplot/bokeh_draw.py#L212-L223 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/distributed/distributed_c10d.py | python | all_reduce | (tensor, op=ReduceOp.SUM, group=None, async_op=False) | Reduces the tensor data across all machines in such a way that all get
the final result.
After the call ``tensor`` is going to be bitwise identical in all processes.
Complex tensors are supported.
Args:
tensor (Tensor): Input and output of the collective. The function
operates in-... | Reduces the tensor data across all machines in such a way that all get
the final result. | [
"Reduces",
"the",
"tensor",
"data",
"across",
"all",
"machines",
"in",
"such",
"a",
"way",
"that",
"all",
"get",
"the",
"final",
"result",
"."
] | def all_reduce(tensor, op=ReduceOp.SUM, group=None, async_op=False):
"""
Reduces the tensor data across all machines in such a way that all get
the final result.
After the call ``tensor`` is going to be bitwise identical in all processes.
Complex tensors are supported.
Args:
tensor (T... | [
"def",
"all_reduce",
"(",
"tensor",
",",
"op",
"=",
"ReduceOp",
".",
"SUM",
",",
"group",
"=",
"None",
",",
"async_op",
"=",
"False",
")",
":",
"_check_single_tensor",
"(",
"tensor",
",",
"\"tensor\"",
")",
"if",
"_rank_not_in_group",
"(",
"group",
")",
... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/distributed_c10d.py#L1253-L1321 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/tools/grokdump.py | python | InspectionShell.do_disassemble | (self, args) | Unassemble memory in the region [address, address + size).
If the size is not specified, a default value of 32 bytes is used.
Synopsis: u 0x<address> 0x<size> | Unassemble memory in the region [address, address + size). | [
"Unassemble",
"memory",
"in",
"the",
"region",
"[",
"address",
"address",
"+",
"size",
")",
"."
] | def do_disassemble(self, args):
"""
Unassemble memory in the region [address, address + size).
If the size is not specified, a default value of 32 bytes is used.
Synopsis: u 0x<address> 0x<size>
"""
if len(args) != 0:
args = args.split(' ')
self.u_start = self.ParseAddressExpr(ar... | [
"def",
"do_disassemble",
"(",
"self",
",",
"args",
")",
":",
"if",
"len",
"(",
"args",
")",
"!=",
"0",
":",
"args",
"=",
"args",
".",
"split",
"(",
"' '",
")",
"self",
".",
"u_start",
"=",
"self",
".",
"ParseAddressExpr",
"(",
"args",
"[",
"0",
"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/tools/grokdump.py#L3740-L3774 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/integrate/_ivp/base.py | python | check_arguments | (fun, y0, support_complex) | return fun_wrapped, y0 | Helper function for checking arguments common to all solvers. | Helper function for checking arguments common to all solvers. | [
"Helper",
"function",
"for",
"checking",
"arguments",
"common",
"to",
"all",
"solvers",
"."
] | def check_arguments(fun, y0, support_complex):
"""Helper function for checking arguments common to all solvers."""
y0 = np.asarray(y0)
if np.issubdtype(y0.dtype, np.complexfloating):
if not support_complex:
raise ValueError("`y0` is complex, but the chosen solver does "
... | [
"def",
"check_arguments",
"(",
"fun",
",",
"y0",
",",
"support_complex",
")",
":",
"y0",
"=",
"np",
".",
"asarray",
"(",
"y0",
")",
"if",
"np",
".",
"issubdtype",
"(",
"y0",
".",
"dtype",
",",
"np",
".",
"complexfloating",
")",
":",
"if",
"not",
"s... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/integrate/_ivp/base.py#L5-L23 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py | python | CodeGenerator.pop_parameter_definitions | (self) | Pops the current parameter definitions set. | Pops the current parameter definitions set. | [
"Pops",
"the",
"current",
"parameter",
"definitions",
"set",
"."
] | def pop_parameter_definitions(self):
"""Pops the current parameter definitions set."""
self._param_def_block.pop() | [
"def",
"pop_parameter_definitions",
"(",
"self",
")",
":",
"self",
".",
"_param_def_block",
".",
"pop",
"(",
")"
] | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/compiler.py#L623-L625 | ||
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | xpathParserContext.xpathRoundFunction | (self, nargs) | Implement the round() XPath function number round(number)
The round function returns the number that is closest to
the argument and that is an integer. If there are two such
numbers, then the one that is even is returned. | Implement the round() XPath function number round(number)
The round function returns the number that is closest to
the argument and that is an integer. If there are two such
numbers, then the one that is even is returned. | [
"Implement",
"the",
"round",
"()",
"XPath",
"function",
"number",
"round",
"(",
"number",
")",
"The",
"round",
"function",
"returns",
"the",
"number",
"that",
"is",
"closest",
"to",
"the",
"argument",
"and",
"that",
"is",
"an",
"integer",
".",
"If",
"there... | def xpathRoundFunction(self, nargs):
"""Implement the round() XPath function number round(number)
The round function returns the number that is closest to
the argument and that is an integer. If there are two such
numbers, then the one that is even is returned. """
libxml2... | [
"def",
"xpathRoundFunction",
"(",
"self",
",",
"nargs",
")",
":",
"libxml2mod",
".",
"xmlXPathRoundFunction",
"(",
"self",
".",
"_o",
",",
"nargs",
")"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L7772-L7777 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/parfor.py | python | ParforDiagnostics.sort_pf_by_line | (self, pf_id, parfors_simple) | return line | pd_id - the parfors id
parfors_simple - the simple parfors map | pd_id - the parfors id
parfors_simple - the simple parfors map | [
"pd_id",
"-",
"the",
"parfors",
"id",
"parfors_simple",
"-",
"the",
"simple",
"parfors",
"map"
] | def sort_pf_by_line(self, pf_id, parfors_simple):
"""
pd_id - the parfors id
parfors_simple - the simple parfors map
"""
# this sorts parfors by source line number
pf = parfors_simple[pf_id][0]
pattern = pf.patterns[0]
line = max(0, pf.loc.line - 1) # why ... | [
"def",
"sort_pf_by_line",
"(",
"self",
",",
"pf_id",
",",
"parfors_simple",
")",
":",
"# this sorts parfors by source line number",
"pf",
"=",
"parfors_simple",
"[",
"pf_id",
"]",
"[",
"0",
"]",
"pattern",
"=",
"pf",
".",
"patterns",
"[",
"0",
"]",
"line",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/parfor.py#L776-L832 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/grit/grit/extern/tclib.py | python | Message.SetIsHidden | (self, is_hidden) | Sets whether this message should be hidden.
Args:
is_hidden : 0 or 1 - if the message should be hidden, 0 otherwise | Sets whether this message should be hidden. | [
"Sets",
"whether",
"this",
"message",
"should",
"be",
"hidden",
"."
] | def SetIsHidden(self, is_hidden):
"""Sets whether this message should be hidden.
Args:
is_hidden : 0 or 1 - if the message should be hidden, 0 otherwise
"""
if is_hidden not in [0, 1]:
raise MessageTranslationError, "is_hidden must be 0 or 1, got %s"
self.__is_hidden = is_hidden | [
"def",
"SetIsHidden",
"(",
"self",
",",
"is_hidden",
")",
":",
"if",
"is_hidden",
"not",
"in",
"[",
"0",
",",
"1",
"]",
":",
"raise",
"MessageTranslationError",
",",
"\"is_hidden must be 0 or 1, got %s\"",
"self",
".",
"__is_hidden",
"=",
"is_hidden"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/grit/grit/extern/tclib.py#L439-L447 | ||
giuspen/cherrytree | 84712f206478fcf9acf30174009ad28c648c6344 | pygtk2/modules/machines.py | python | get_encoded_buffer_from_pixbuf | (pixbuf) | return encoded_buffer | Pixbuf To Encoded Buffer | Pixbuf To Encoded Buffer | [
"Pixbuf",
"To",
"Encoded",
"Buffer"
] | def get_encoded_buffer_from_pixbuf(pixbuf):
"""Pixbuf To Encoded Buffer"""
io = StringIO.StringIO()
pixbuf.save_to_callback(io.write, "png")
encoded_buffer = base64.b64encode(io.getvalue())
return encoded_buffer | [
"def",
"get_encoded_buffer_from_pixbuf",
"(",
"pixbuf",
")",
":",
"io",
"=",
"StringIO",
".",
"StringIO",
"(",
")",
"pixbuf",
".",
"save_to_callback",
"(",
"io",
".",
"write",
",",
"\"png\"",
")",
"encoded_buffer",
"=",
"base64",
".",
"b64encode",
"(",
"io",... | https://github.com/giuspen/cherrytree/blob/84712f206478fcf9acf30174009ad28c648c6344/pygtk2/modules/machines.py#L56-L61 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py2/pandas/core/arrays/period.py | python | _period_array_cmp | (cls, op) | return compat.set_function_name(wrapper, opname, cls) | Wrap comparison operations to convert Period-like to PeriodDtype | Wrap comparison operations to convert Period-like to PeriodDtype | [
"Wrap",
"comparison",
"operations",
"to",
"convert",
"Period",
"-",
"like",
"to",
"PeriodDtype"
] | def _period_array_cmp(cls, op):
"""
Wrap comparison operations to convert Period-like to PeriodDtype
"""
opname = '__{name}__'.format(name=op.__name__)
nat_result = True if opname == '__ne__' else False
def wrapper(self, other):
op = getattr(self.asi8, opname)
if isinstance(oth... | [
"def",
"_period_array_cmp",
"(",
"cls",
",",
"op",
")",
":",
"opname",
"=",
"'__{name}__'",
".",
"format",
"(",
"name",
"=",
"op",
".",
"__name__",
")",
"nat_result",
"=",
"True",
"if",
"opname",
"==",
"'__ne__'",
"else",
"False",
"def",
"wrapper",
"(",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/arrays/period.py#L44-L86 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py | python | Misc.winfo_height | (self) | return self.tk.getint(
self.tk.call('winfo', 'height', self._w)) | Return height of this widget. | Return height of this widget. | [
"Return",
"height",
"of",
"this",
"widget",
"."
] | def winfo_height(self):
"""Return height of this widget."""
return self.tk.getint(
self.tk.call('winfo', 'height', self._w)) | [
"def",
"winfo_height",
"(",
"self",
")",
":",
"return",
"self",
".",
"tk",
".",
"getint",
"(",
"self",
".",
"tk",
".",
"call",
"(",
"'winfo'",
",",
"'height'",
",",
"self",
".",
"_w",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/__init__.py#L997-L1000 | |
0ad/0ad | f58db82e0e925016d83f4e3fa7ca599e3866e2af | source/tools/i18n/updateTemplates.py | python | warnAboutUntouchedMods | () | Warn about mods that are not properly configured to get their messages extracted. | Warn about mods that are not properly configured to get their messages extracted. | [
"Warn",
"about",
"mods",
"that",
"are",
"not",
"properly",
"configured",
"to",
"get",
"their",
"messages",
"extracted",
"."
] | def warnAboutUntouchedMods():
"""
Warn about mods that are not properly configured to get their messages extracted.
"""
modsRootFolder = os.path.join(projectRootDirectory, "binaries", "data", "mods")
untouchedMods = {}
for modFolder in os.listdir(modsRootFolder):
if modFolder[0] != "... | [
"def",
"warnAboutUntouchedMods",
"(",
")",
":",
"modsRootFolder",
"=",
"os",
".",
"path",
".",
"join",
"(",
"projectRootDirectory",
",",
"\"binaries\"",
",",
"\"data\"",
",",
"\"mods\"",
")",
"untouchedMods",
"=",
"{",
"}",
"for",
"modFolder",
"in",
"os",
".... | https://github.com/0ad/0ad/blob/f58db82e0e925016d83f4e3fa7ca599e3866e2af/source/tools/i18n/updateTemplates.py#L31-L54 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/operators/control_flow.py | python | _is_none_or_undef | (value) | return ((value is None)
or isinstance(value, variables.UndefinedReturnValue)
or isinstance(value, variables.Undefined)) | Tests whether a value is None or undefined.
AutoGraph represents undefined symbols using special objects of type Undefined
or UndefinedReturnValue.
Args:
value: value to test
Returns:
Boolean | Tests whether a value is None or undefined. | [
"Tests",
"whether",
"a",
"value",
"is",
"None",
"or",
"undefined",
"."
] | def _is_none_or_undef(value):
"""Tests whether a value is None or undefined.
AutoGraph represents undefined symbols using special objects of type Undefined
or UndefinedReturnValue.
Args:
value: value to test
Returns:
Boolean
"""
return ((value is None)
or isinstance(value, variables.U... | [
"def",
"_is_none_or_undef",
"(",
"value",
")",
":",
"return",
"(",
"(",
"value",
"is",
"None",
")",
"or",
"isinstance",
"(",
"value",
",",
"variables",
".",
"UndefinedReturnValue",
")",
"or",
"isinstance",
"(",
"value",
",",
"variables",
".",
"Undefined",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/operators/control_flow.py#L100-L114 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/unsafe/numbers.py | python | leading_zeros | (typeingctx, src) | return src(src), codegen | Counts leading zeros in the binary representation of an integer. | Counts leading zeros in the binary representation of an integer. | [
"Counts",
"leading",
"zeros",
"in",
"the",
"binary",
"representation",
"of",
"an",
"integer",
"."
] | def leading_zeros(typeingctx, src):
"""Counts leading zeros in the binary representation of an integer."""
if not isinstance(src, types.Integer):
raise TypeError(
"leading_zeros is only defined for integers, but passed value was "
"'{}'.".format(src)
)
def codegen(co... | [
"def",
"leading_zeros",
"(",
"typeingctx",
",",
"src",
")",
":",
"if",
"not",
"isinstance",
"(",
"src",
",",
"types",
".",
"Integer",
")",
":",
"raise",
"TypeError",
"(",
"\"leading_zeros is only defined for integers, but passed value was \"",
"\"'{}'.\"",
".",
"for... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/unsafe/numbers.py#L44-L55 | |
deepmind/open_spiel | 4ca53bea32bb2875c7385d215424048ae92f78c8 | open_spiel/python/algorithms/adidas_utils/solvers/nonsymmetric/ate_anneal.py | python | Solver.init_vars | (self, num_strats, num_players) | return (init_dist, init_y, init_anneal_steps) | Initialize solver parameters. | Initialize solver parameters. | [
"Initialize",
"solver",
"parameters",
"."
] | def init_vars(self, num_strats, num_players):
"""Initialize solver parameters."""
self.num_players = num_players
if len(num_strats) != num_players:
raise ValueError('Must specify num strategies for each player')
init_dist = []
for num_strats_i in num_strats:
if self.rnd_init:
ini... | [
"def",
"init_vars",
"(",
"self",
",",
"num_strats",
",",
"num_players",
")",
":",
"self",
".",
"num_players",
"=",
"num_players",
"if",
"len",
"(",
"num_strats",
")",
"!=",
"num_players",
":",
"raise",
"ValueError",
"(",
"'Must specify num strategies for each play... | https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/adidas_utils/solvers/nonsymmetric/ate_anneal.py#L58-L73 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/subprocess32/subprocess32.py | python | Popen.communicate | (self, input=None, timeout=None) | return (stdout, stderr) | Interact with process: Send data to stdin. Read data from
stdout and stderr, until end-of-file is reached. Wait for
process to terminate. The optional input argument should be a
string to be sent to the child process, or None, if no data
should be sent to the child.
communica... | Interact with process: Send data to stdin. Read data from
stdout and stderr, until end-of-file is reached. Wait for
process to terminate. The optional input argument should be a
string to be sent to the child process, or None, if no data
should be sent to the child. | [
"Interact",
"with",
"process",
":",
"Send",
"data",
"to",
"stdin",
".",
"Read",
"data",
"from",
"stdout",
"and",
"stderr",
"until",
"end",
"-",
"of",
"-",
"file",
"is",
"reached",
".",
"Wait",
"for",
"process",
"to",
"terminate",
".",
"The",
"optional",
... | def communicate(self, input=None, timeout=None):
"""Interact with process: Send data to stdin. Read data from
stdout and stderr, until end-of-file is reached. Wait for
process to terminate. The optional input argument should be a
string to be sent to the child process, or None, if no ... | [
"def",
"communicate",
"(",
"self",
",",
"input",
"=",
"None",
",",
"timeout",
"=",
"None",
")",
":",
"if",
"self",
".",
"_communication_started",
"and",
"input",
":",
"raise",
"ValueError",
"(",
"\"Cannot send input after starting communication\"",
")",
"if",
"t... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/subprocess32/subprocess32.py#L712-L754 | |
GrammaTech/gtirb | 415dd72e1e3c475004d013723c16cdcb29c0826e | python/gtirb/symbol.py | python | Symbol.__init__ | (
self,
name: str,
uuid: typing.Optional[UUID] = None,
payload: typing.Optional[Payload] = None,
at_end: bool = False,
module: typing.Optional["Module"] = None,
) | :param name: The name of this symbol.
:param uuid: The UUID of this ``Symbol``,
or None if a new UUID needs generated via :func:`uuid.uuid4`.
Defaults to None.
:param payload: The value this symbol points to.
May be an address, a Node, or None.
:param at_end: ... | :param name: The name of this symbol.
:param uuid: The UUID of this ``Symbol``,
or None if a new UUID needs generated via :func:`uuid.uuid4`.
Defaults to None.
:param payload: The value this symbol points to.
May be an address, a Node, or None.
:param at_end: ... | [
":",
"param",
"name",
":",
"The",
"name",
"of",
"this",
"symbol",
".",
":",
"param",
"uuid",
":",
"The",
"UUID",
"of",
"this",
"Symbol",
"or",
"None",
"if",
"a",
"new",
"UUID",
"needs",
"generated",
"via",
":",
"func",
":",
"uuid",
".",
"uuid4",
".... | def __init__(
self,
name: str,
uuid: typing.Optional[UUID] = None,
payload: typing.Optional[Payload] = None,
at_end: bool = False,
module: typing.Optional["Module"] = None,
):
"""
:param name: The name of this symbol.
:param uuid: The UUID of t... | [
"def",
"__init__",
"(",
"self",
",",
"name",
":",
"str",
",",
"uuid",
":",
"typing",
".",
"Optional",
"[",
"UUID",
"]",
"=",
"None",
",",
"payload",
":",
"typing",
".",
"Optional",
"[",
"Payload",
"]",
"=",
"None",
",",
"at_end",
":",
"bool",
"=",
... | https://github.com/GrammaTech/gtirb/blob/415dd72e1e3c475004d013723c16cdcb29c0826e/python/gtirb/symbol.py#L29-L55 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py3/scipy/special/basic.py | python | assoc_laguerre | (x, n, k=0.0) | return orthogonal.eval_genlaguerre(n, k, x) | Compute the generalized (associated) Laguerre polynomial of degree n and order k.
The polynomial :math:`L^{(k)}_n(x)` is orthogonal over ``[0, inf)``,
with weighting function ``exp(-x) * x**k`` with ``k > -1``.
Notes
-----
`assoc_laguerre` is a simple wrapper around `eval_genlaguerre`, with
re... | Compute the generalized (associated) Laguerre polynomial of degree n and order k. | [
"Compute",
"the",
"generalized",
"(",
"associated",
")",
"Laguerre",
"polynomial",
"of",
"degree",
"n",
"and",
"order",
"k",
"."
] | def assoc_laguerre(x, n, k=0.0):
"""Compute the generalized (associated) Laguerre polynomial of degree n and order k.
The polynomial :math:`L^{(k)}_n(x)` is orthogonal over ``[0, inf)``,
with weighting function ``exp(-x) * x**k`` with ``k > -1``.
Notes
-----
`assoc_laguerre` is a simple wrappe... | [
"def",
"assoc_laguerre",
"(",
"x",
",",
"n",
",",
"k",
"=",
"0.0",
")",
":",
"return",
"orthogonal",
".",
"eval_genlaguerre",
"(",
"n",
",",
"k",
",",
"x",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/special/basic.py#L922-L934 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | GridSizeEvent.__init__ | (self, *args, **kwargs) | __init__(self, int id, EventType type, Grid obj, int rowOrCol=-1,
int x=-1, int y=-1, bool control=False, bool shift=False,
bool alt=False, bool meta=False) -> GridSizeEvent | __init__(self, int id, EventType type, Grid obj, int rowOrCol=-1,
int x=-1, int y=-1, bool control=False, bool shift=False,
bool alt=False, bool meta=False) -> GridSizeEvent | [
"__init__",
"(",
"self",
"int",
"id",
"EventType",
"type",
"Grid",
"obj",
"int",
"rowOrCol",
"=",
"-",
"1",
"int",
"x",
"=",
"-",
"1",
"int",
"y",
"=",
"-",
"1",
"bool",
"control",
"=",
"False",
"bool",
"shift",
"=",
"False",
"bool",
"alt",
"=",
... | def __init__(self, *args, **kwargs):
"""
__init__(self, int id, EventType type, Grid obj, int rowOrCol=-1,
int x=-1, int y=-1, bool control=False, bool shift=False,
bool alt=False, bool meta=False) -> GridSizeEvent
"""
_grid.GridSizeEvent_swiginit(self,_grid.ne... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_grid",
".",
"GridSizeEvent_swiginit",
"(",
"self",
",",
"_grid",
".",
"new_GridSizeEvent",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L2350-L2356 | ||
Cantera/cantera | 0119484b261967ccb55a0066c020599cacc312e4 | interfaces/cython/cantera/examples/thermo/isentropic.py | python | soundspeed | (gas) | return math.sqrt(gamma * ct.gas_constant
* gas.T / gas.mean_molecular_weight) | The speed of sound. Assumes an ideal gas. | The speed of sound. Assumes an ideal gas. | [
"The",
"speed",
"of",
"sound",
".",
"Assumes",
"an",
"ideal",
"gas",
"."
] | def soundspeed(gas):
"""The speed of sound. Assumes an ideal gas."""
gamma = gas.cp / gas.cv
return math.sqrt(gamma * ct.gas_constant
* gas.T / gas.mean_molecular_weight) | [
"def",
"soundspeed",
"(",
"gas",
")",
":",
"gamma",
"=",
"gas",
".",
"cp",
"/",
"gas",
".",
"cv",
"return",
"math",
".",
"sqrt",
"(",
"gamma",
"*",
"ct",
".",
"gas_constant",
"*",
"gas",
".",
"T",
"/",
"gas",
".",
"mean_molecular_weight",
")"
] | https://github.com/Cantera/cantera/blob/0119484b261967ccb55a0066c020599cacc312e4/interfaces/cython/cantera/examples/thermo/isentropic.py#L12-L17 | |
christinaa/LLVM-VideoCore4 | 7773c3c9e5d22b785d4b96ed0acea37c8aa9c183 | examples/Kaleidoscope/MCJIT/complete/genk-timing.py | python | KScriptGenerator.updateFunctionCallMap | (self, caller, callee) | Maintains a map of functions that are called from other functions | Maintains a map of functions that are called from other functions | [
"Maintains",
"a",
"map",
"of",
"functions",
"that",
"are",
"called",
"from",
"other",
"functions"
] | def updateFunctionCallMap(self, caller, callee):
"""Maintains a map of functions that are called from other functions"""
if not caller in self.calledFunctionTable:
self.calledFunctionTable[caller] = []
if not callee in self.calledFunctionTable[caller]:
self.calledFunction... | [
"def",
"updateFunctionCallMap",
"(",
"self",
",",
"caller",
",",
"callee",
")",
":",
"if",
"not",
"caller",
"in",
"self",
".",
"calledFunctionTable",
":",
"self",
".",
"calledFunctionTable",
"[",
"caller",
"]",
"=",
"[",
"]",
"if",
"not",
"callee",
"in",
... | https://github.com/christinaa/LLVM-VideoCore4/blob/7773c3c9e5d22b785d4b96ed0acea37c8aa9c183/examples/Kaleidoscope/MCJIT/complete/genk-timing.py#L61-L69 | ||
gem5/gem5 | 141cc37c2d4b93959d4c249b8f7e6a8b2ef75338 | src/python/m5/ext/pyfdt/pyfdt.py | python | FdtPropertyStrings.__getitem__ | (self, index) | return self.strings[index] | Get strings, returns a string | Get strings, returns a string | [
"Get",
"strings",
"returns",
"a",
"string"
] | def __getitem__(self, index):
"""Get strings, returns a string"""
return self.strings[index] | [
"def",
"__getitem__",
"(",
"self",
",",
"index",
")",
":",
"return",
"self",
".",
"strings",
"[",
"index",
"]"
] | https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/m5/ext/pyfdt/pyfdt.py#L226-L228 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py | python | Resolution._backtrack | (self) | return False | Perform backtracking.
When we enter here, the stack is like this::
[ state Z ]
[ state Y ]
[ state X ]
.... earlier states are irrelevant.
1. No pins worked for Z, so it does not have a pin.
2. We want to reset state Y to unpinned, and pin anoth... | Perform backtracking. | [
"Perform",
"backtracking",
"."
] | def _backtrack(self):
"""Perform backtracking.
When we enter here, the stack is like this::
[ state Z ]
[ state Y ]
[ state X ]
.... earlier states are irrelevant.
1. No pins worked for Z, so it does not have a pin.
2. We want to reset s... | [
"def",
"_backtrack",
"(",
"self",
")",
":",
"while",
"len",
"(",
"self",
".",
"_states",
")",
">=",
"3",
":",
"# Remove the state that triggered backtracking.",
"del",
"self",
".",
"_states",
"[",
"-",
"1",
"]",
"# Retrieve the last candidate pin and known incompati... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py#L236-L306 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plistlib.py | python | writePlist | (rootObject, pathOrFile) | Write 'rootObject' to a .plist file. 'pathOrFile' may either be a
file name or a (writable) file object. | Write 'rootObject' to a .plist file. 'pathOrFile' may either be a
file name or a (writable) file object. | [
"Write",
"rootObject",
"to",
"a",
".",
"plist",
"file",
".",
"pathOrFile",
"may",
"either",
"be",
"a",
"file",
"name",
"or",
"a",
"(",
"writable",
")",
"file",
"object",
"."
] | def writePlist(rootObject, pathOrFile):
"""Write 'rootObject' to a .plist file. 'pathOrFile' may either be a
file name or a (writable) file object.
"""
didOpen = 0
if isinstance(pathOrFile, (str, unicode)):
pathOrFile = open(pathOrFile, "w")
didOpen = 1
writer = PlistWriter(pathO... | [
"def",
"writePlist",
"(",
"rootObject",
",",
"pathOrFile",
")",
":",
"didOpen",
"=",
"0",
"if",
"isinstance",
"(",
"pathOrFile",
",",
"(",
"str",
",",
"unicode",
")",
")",
":",
"pathOrFile",
"=",
"open",
"(",
"pathOrFile",
",",
"\"w\"",
")",
"didOpen",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/plistlib.py#L84-L97 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/tools/gyp/pylib/gyp/MSVSVersion.py | python | _RegistryGetValue | (key, value) | return match.group(1) | Use _winreg or reg.exe to obtain the value of a registry key.
Using _winreg is preferable because it solves an issue on some corporate
environments where access to reg.exe is locked down. However, we still need
to fallback to reg.exe for the case where the _winreg module is not available
(for example in cygwin... | Use _winreg or reg.exe to obtain the value of a registry key. | [
"Use",
"_winreg",
"or",
"reg",
".",
"exe",
"to",
"obtain",
"the",
"value",
"of",
"a",
"registry",
"key",
"."
] | def _RegistryGetValue(key, value):
"""Use _winreg or reg.exe to obtain the value of a registry key.
Using _winreg is preferable because it solves an issue on some corporate
environments where access to reg.exe is locked down. However, we still need
to fallback to reg.exe for the case where the _winreg module i... | [
"def",
"_RegistryGetValue",
"(",
"key",
",",
"value",
")",
":",
"try",
":",
"return",
"_RegistryGetValueUsingWinReg",
"(",
"key",
",",
"value",
")",
"except",
"ImportError",
":",
"pass",
"# Fallback to reg.exe if we fail to import _winreg.",
"text",
"=",
"_RegistryQue... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/MSVSVersion.py#L230-L257 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TPrGraph | (*args) | return _snap.TPrGraph(*args) | TPrGraph(PUNGraph G) -> TUNGraph
Parameters:
G: PUNGraph | TPrGraph(PUNGraph G) -> TUNGraph | [
"TPrGraph",
"(",
"PUNGraph",
"G",
")",
"-",
">",
"TUNGraph"
] | def TPrGraph(*args):
"""
TPrGraph(PUNGraph G) -> TUNGraph
Parameters:
G: PUNGraph
"""
return _snap.TPrGraph(*args) | [
"def",
"TPrGraph",
"(",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TPrGraph",
"(",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L21203-L21211 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Menu.UpdateUI | (*args, **kwargs) | return _core_.Menu_UpdateUI(*args, **kwargs) | UpdateUI(self, EvtHandler source=None) | UpdateUI(self, EvtHandler source=None) | [
"UpdateUI",
"(",
"self",
"EvtHandler",
"source",
"=",
"None",
")"
] | def UpdateUI(*args, **kwargs):
"""UpdateUI(self, EvtHandler source=None)"""
return _core_.Menu_UpdateUI(*args, **kwargs) | [
"def",
"UpdateUI",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Menu_UpdateUI",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L12222-L12224 | |
runtimejs/runtime | 0a6e84c30823d35a4548d6634166784260ae7b74 | deps/v8/gypfiles/vs_toolchain.py | python | GetVisualStudioVersion | () | return os.environ.get('GYP_MSVS_VERSION', CURRENT_DEFAULT_TOOLCHAIN_VERSION) | Return GYP_MSVS_VERSION of Visual Studio. | Return GYP_MSVS_VERSION of Visual Studio. | [
"Return",
"GYP_MSVS_VERSION",
"of",
"Visual",
"Studio",
"."
] | def GetVisualStudioVersion():
"""Return GYP_MSVS_VERSION of Visual Studio.
"""
return os.environ.get('GYP_MSVS_VERSION', CURRENT_DEFAULT_TOOLCHAIN_VERSION) | [
"def",
"GetVisualStudioVersion",
"(",
")",
":",
"return",
"os",
".",
"environ",
".",
"get",
"(",
"'GYP_MSVS_VERSION'",
",",
"CURRENT_DEFAULT_TOOLCHAIN_VERSION",
")"
] | https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/gypfiles/vs_toolchain.py#L110-L113 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/image/detection.py | python | DetAugmenter.__call__ | (self, src, label) | Abstract implementation body | Abstract implementation body | [
"Abstract",
"implementation",
"body"
] | def __call__(self, src, label):
"""Abstract implementation body"""
raise NotImplementedError("Must override implementation.") | [
"def",
"__call__",
"(",
"self",
",",
"src",
",",
"label",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Must override implementation.\"",
")"
] | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/image/detection.py#L58-L60 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py2/traitlets/traitlets.py | python | HasTraits.on_trait_change | (self, handler=None, name=None, remove=False) | DEPRECATED: Setup a handler to be called when a trait changes.
This is used to setup dynamic notifications of trait changes.
Static handlers can be created by creating methods on a HasTraits
subclass with the naming convention '_[traitname]_changed'. Thus,
to create static handler for... | DEPRECATED: Setup a handler to be called when a trait changes. | [
"DEPRECATED",
":",
"Setup",
"a",
"handler",
"to",
"be",
"called",
"when",
"a",
"trait",
"changes",
"."
] | def on_trait_change(self, handler=None, name=None, remove=False):
"""DEPRECATED: Setup a handler to be called when a trait changes.
This is used to setup dynamic notifications of trait changes.
Static handlers can be created by creating methods on a HasTraits
subclass with the naming c... | [
"def",
"on_trait_change",
"(",
"self",
",",
"handler",
"=",
"None",
",",
"name",
"=",
"None",
",",
"remove",
"=",
"False",
")",
":",
"warn",
"(",
"\"on_trait_change is deprecated in traitlets 4.1: use observe instead\"",
",",
"DeprecationWarning",
",",
"stacklevel",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py2/traitlets/traitlets.py#L1200-L1235 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | IKObjective.setFreePosition | (self) | return _robotsim.IKObjective_setFreePosition(self) | setFreePosition(IKObjective self)
Manual: Sets a free position constraint. | setFreePosition(IKObjective self) | [
"setFreePosition",
"(",
"IKObjective",
"self",
")"
] | def setFreePosition(self):
"""
setFreePosition(IKObjective self)
Manual: Sets a free position constraint.
"""
return _robotsim.IKObjective_setFreePosition(self) | [
"def",
"setFreePosition",
"(",
"self",
")",
":",
"return",
"_robotsim",
".",
"IKObjective_setFreePosition",
"(",
"self",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L6317-L6326 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch.py | python | GradientBoostedDecisionTreeModel.make_update_ensemble_fn | (self, ensemble_stamp, training_state,
dropout_seed, class_id) | return _update_ensemble | A method to create the function which updates the tree ensemble. | A method to create the function which updates the tree ensemble. | [
"A",
"method",
"to",
"create",
"the",
"function",
"which",
"updates",
"the",
"tree",
"ensemble",
"."
] | def make_update_ensemble_fn(self, ensemble_stamp, training_state,
dropout_seed, class_id):
"""A method to create the function which updates the tree ensemble."""
# Determine learning rate.
learning_rate_tuner = self._learner_config.learning_rate_tuner.WhichOneof(
"tuner... | [
"def",
"make_update_ensemble_fn",
"(",
"self",
",",
"ensemble_stamp",
",",
"training_state",
",",
"dropout_seed",
",",
"class_id",
")",
":",
"# Determine learning rate.",
"learning_rate_tuner",
"=",
"self",
".",
"_learner_config",
".",
"learning_rate_tuner",
".",
"Which... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch.py#L1040-L1180 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/check-if-a-parentheses-string-can-be-valid.py | python | Solution.canBeValid | (self, s, locked) | return True | :type s: str
:type locked: str
:rtype: bool | :type s: str
:type locked: str
:rtype: bool | [
":",
"type",
"s",
":",
"str",
":",
"type",
"locked",
":",
"str",
":",
"rtype",
":",
"bool"
] | def canBeValid(self, s, locked):
"""
:type s: str
:type locked: str
:rtype: bool
"""
if len(s)%2:
return False
for direction, c in ((lambda x:x, '('), (reversed, ')')):
cnt = bal = 0
for i in direction(xrange(len(s))):
... | [
"def",
"canBeValid",
"(",
"self",
",",
"s",
",",
"locked",
")",
":",
"if",
"len",
"(",
"s",
")",
"%",
"2",
":",
"return",
"False",
"for",
"direction",
",",
"c",
"in",
"(",
"(",
"lambda",
"x",
":",
"x",
",",
"'('",
")",
",",
"(",
"reversed",
"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/check-if-a-parentheses-string-can-be-valid.py#L5-L22 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/closure_linter/closure_linter/aliaspass.py | python | AliasPass._IsTokenInParentBlock | (token, parent_block) | return False | Determines whether the given token is contained by the given block.
Args:
token: A token
parent_block: An EcmaContext.
Returns:
Whether the token is in a context that is or is a child of the given
parent_block context. | Determines whether the given token is contained by the given block. | [
"Determines",
"whether",
"the",
"given",
"token",
"is",
"contained",
"by",
"the",
"given",
"block",
"."
] | def _IsTokenInParentBlock(token, parent_block):
"""Determines whether the given token is contained by the given block.
Args:
token: A token
parent_block: An EcmaContext.
Returns:
Whether the token is in a context that is or is a child of the given
parent_block context.
"""
... | [
"def",
"_IsTokenInParentBlock",
"(",
"token",
",",
"parent_block",
")",
":",
"context",
"=",
"token",
".",
"metadata",
".",
"context",
"while",
"context",
":",
"if",
"context",
"is",
"parent_block",
":",
"return",
"True",
"context",
"=",
"context",
".",
"par... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/closure_linter/closure_linter/aliaspass.py#L159-L177 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/pprint.py | python | _safe_tuple | (t) | return _safe_key(t[0]), _safe_key(t[1]) | Helper function for comparing 2-tuples | Helper function for comparing 2-tuples | [
"Helper",
"function",
"for",
"comparing",
"2",
"-",
"tuples"
] | def _safe_tuple(t):
"Helper function for comparing 2-tuples"
return _safe_key(t[0]), _safe_key(t[1]) | [
"def",
"_safe_tuple",
"(",
"t",
")",
":",
"return",
"_safe_key",
"(",
"t",
"[",
"0",
"]",
")",
",",
"_safe_key",
"(",
"t",
"[",
"1",
"]",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pprint.py#L94-L96 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py | python | AppleScript_Suite_Events._3c_ | (self, _object, _attributes={}, **_arguments) | <: Less than
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | <: Less than
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything | [
"<",
":",
"Less",
"than",
"Required",
"argument",
":",
"an",
"AE",
"object",
"reference",
"Keyword",
"argument",
"_attributes",
":",
"AppleEvent",
"attribute",
"dictionary",
"Returns",
":",
"anything"
] | def _3c_(self, _object, _attributes={}, **_arguments):
"""<: Less than
Required argument: an AE object reference
Keyword argument _attributes: AppleEvent attribute dictionary
Returns: anything
"""
_code = 'ascr'
_subcode = '< '
if _arguments: raise Type... | [
"def",
"_3c_",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'ascr'",
"_subcode",
"=",
"'< '",
"if",
"_arguments",
":",
"raise",
"TypeError",
",",
"'No optional args expected'",
"_ar... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/StdSuites/AppleScript_Suite.py#L99-L118 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.