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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/yapf/yapf/yapflib/unwrapped_line.py | python | IsSurroundedByBrackets | (tok) | return None | Return True if the token is surrounded by brackets. | Return True if the token is surrounded by brackets. | [
"Return",
"True",
"if",
"the",
"token",
"is",
"surrounded",
"by",
"brackets",
"."
] | def IsSurroundedByBrackets(tok):
"""Return True if the token is surrounded by brackets."""
paren_count = 0
brace_count = 0
sq_bracket_count = 0
previous_token = tok.previous_token
while previous_token:
if previous_token.value == ')':
paren_count -= 1
elif previous_token.value == '}':
bra... | [
"def",
"IsSurroundedByBrackets",
"(",
"tok",
")",
":",
"paren_count",
"=",
"0",
"brace_count",
"=",
"0",
"sq_bracket_count",
"=",
"0",
"previous_token",
"=",
"tok",
".",
"previous_token",
"while",
"previous_token",
":",
"if",
"previous_token",
".",
"value",
"=="... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/unwrapped_line.py#L387-L415 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_model.py | python | TFAsymmetryFittingModel._convert_global_ties_for_tf_asymmetry_mode | (self, global_ties: str) | return [self._convert_global_tie_for_tf_asymmetry_mode(global_tie) for global_tie in global_ties] | Converts the global ties to the equivalent global ties in the TF Asymmetry function. | Converts the global ties to the equivalent global ties in the TF Asymmetry function. | [
"Converts",
"the",
"global",
"ties",
"to",
"the",
"equivalent",
"global",
"ties",
"in",
"the",
"TF",
"Asymmetry",
"function",
"."
] | def _convert_global_ties_for_tf_asymmetry_mode(self, global_ties: str) -> str:
"""Converts the global ties to the equivalent global ties in the TF Asymmetry function."""
return [self._convert_global_tie_for_tf_asymmetry_mode(global_tie) for global_tie in global_ties] | [
"def",
"_convert_global_ties_for_tf_asymmetry_mode",
"(",
"self",
",",
"global_ties",
":",
"str",
")",
"->",
"str",
":",
"return",
"[",
"self",
".",
"_convert_global_tie_for_tf_asymmetry_mode",
"(",
"global_tie",
")",
"for",
"global_tie",
"in",
"global_ties",
"]"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_model.py#L628-L630 | |
lmb-freiburg/ogn | 974f72ef4bf840d6f6693d22d1843a79223e77ce | tools/extra/parse_log.py | python | parse_log | (path_to_log) | return train_dict_list, test_dict_list | Parse log file
Returns (train_dict_list, test_dict_list)
train_dict_list and test_dict_list are lists of dicts that define the table
rows | Parse log file
Returns (train_dict_list, test_dict_list) | [
"Parse",
"log",
"file",
"Returns",
"(",
"train_dict_list",
"test_dict_list",
")"
] | def parse_log(path_to_log):
"""Parse log file
Returns (train_dict_list, test_dict_list)
train_dict_list and test_dict_list are lists of dicts that define the table
rows
"""
regex_iteration = re.compile('Iteration (\d+)')
regex_train_output = re.compile('Train net output #(\d+): (\S+) = ([\... | [
"def",
"parse_log",
"(",
"path_to_log",
")",
":",
"regex_iteration",
"=",
"re",
".",
"compile",
"(",
"'Iteration (\\d+)'",
")",
"regex_train_output",
"=",
"re",
".",
"compile",
"(",
"'Train net output #(\\d+): (\\S+) = ([\\.\\deE+-]+)'",
")",
"regex_test_output",
"=",
... | https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/tools/extra/parse_log.py#L17-L83 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | VListBox._setCallbackInfo | (*args, **kwargs) | return _windows_.VListBox__setCallbackInfo(*args, **kwargs) | _setCallbackInfo(self, PyObject self, PyObject _class) | _setCallbackInfo(self, PyObject self, PyObject _class) | [
"_setCallbackInfo",
"(",
"self",
"PyObject",
"self",
"PyObject",
"_class",
")"
] | def _setCallbackInfo(*args, **kwargs):
"""_setCallbackInfo(self, PyObject self, PyObject _class)"""
return _windows_.VListBox__setCallbackInfo(*args, **kwargs) | [
"def",
"_setCallbackInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"VListBox__setCallbackInfo",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L2593-L2595 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/xrc.py | python | XmlResource.GetDomain | (*args, **kwargs) | return _xrc.XmlResource_GetDomain(*args, **kwargs) | GetDomain(self) -> String | GetDomain(self) -> String | [
"GetDomain",
"(",
"self",
")",
"-",
">",
"String"
] | def GetDomain(*args, **kwargs):
"""GetDomain(self) -> String"""
return _xrc.XmlResource_GetDomain(*args, **kwargs) | [
"def",
"GetDomain",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResource_GetDomain",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/xrc.py#L218-L220 | |
snap-stanford/snap-python | d53c51b0a26aa7e3e7400b014cdf728948fde80a | setup/snap.py | python | TStrV.Ins | (self, *args) | return _snap.TStrV_Ins(self, *args) | Ins(TStrV self, int const & ValN, TStr Val)
Parameters:
ValN: int const &
Val: TStr const & | Ins(TStrV self, int const & ValN, TStr Val) | [
"Ins",
"(",
"TStrV",
"self",
"int",
"const",
"&",
"ValN",
"TStr",
"Val",
")"
] | def Ins(self, *args):
"""
Ins(TStrV self, int const & ValN, TStr Val)
Parameters:
ValN: int const &
Val: TStr const &
"""
return _snap.TStrV_Ins(self, *args) | [
"def",
"Ins",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_snap",
".",
"TStrV_Ins",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L19538-L19547 | |
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/dbwrap.py | python | DB4.make_dhdft_Figure_1 | (self) | Plot all the graphics needed for the grey bars plot
in Fig. 1 of DHDFT. | Plot all the graphics needed for the grey bars plot
in Fig. 1 of DHDFT. | [
"Plot",
"all",
"the",
"graphics",
"needed",
"for",
"the",
"grey",
"bars",
"plot",
"in",
"Fig",
".",
"1",
"of",
"DHDFT",
"."
] | def make_dhdft_Figure_1(self):
"""Plot all the graphics needed for the grey bars plot
in Fig. 1 of DHDFT.
"""
# Fig. bars (a)
self.plot_bars([
'M052X-unCP-adz', 'M052X-CP-adz', 'M052X-unCP-atz', 'M052X-CP-atz', None,
'M062X-unCP-adz', 'M062X-CP-adz', 'M06... | [
"def",
"make_dhdft_Figure_1",
"(",
"self",
")",
":",
"# Fig. bars (a)",
"self",
".",
"plot_bars",
"(",
"[",
"'M052X-unCP-adz'",
",",
"'M052X-CP-adz'",
",",
"'M052X-unCP-atz'",
",",
"'M052X-CP-atz'",
",",
"None",
",",
"'M062X-unCP-adz'",
",",
"'M062X-CP-adz'",
",",
... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/dbwrap.py#L3284-L3327 | ||
google/shaka-packager | e1b0c7c45431327fd3ce193514a5407d07b39b22 | packager/third_party/protobuf/python/google/protobuf/internal/python_message.py | python | _ExtensionDict._FindExtensionByNumber | (self, number) | return self._extended_message._extensions_by_number.get(number, None) | Tries to find a known extension with the field number.
Args:
number: Extension field number.
Returns:
Extension field descriptor. | Tries to find a known extension with the field number. | [
"Tries",
"to",
"find",
"a",
"known",
"extension",
"with",
"the",
"field",
"number",
"."
] | def _FindExtensionByNumber(self, number):
"""Tries to find a known extension with the field number.
Args:
number: Extension field number.
Returns:
Extension field descriptor.
"""
return self._extended_message._extensions_by_number.get(number, None) | [
"def",
"_FindExtensionByNumber",
"(",
"self",
",",
"number",
")",
":",
"return",
"self",
".",
"_extended_message",
".",
"_extensions_by_number",
".",
"get",
"(",
"number",
",",
"None",
")"
] | https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/internal/python_message.py#L1529-L1538 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/vis/ipython/widgets.py | python | EditPoint | (value=None,min=None,max=None,labels=None,
klampt_widget=None,point_name='edited_point',point_radius=DEFAULT_POINT_RADIUS,
callback=None) | return widgets.VBox(elems) | Creates a Jupyter widget for interactive editing of an xyz point
Args:
value (list of 3 floats, optional): the initial value of the point. If given, this must
be a list and will hold the edited values.
min/max (list of 3 floats, optional): the minimum and maximum of the point
la... | Creates a Jupyter widget for interactive editing of an xyz point | [
"Creates",
"a",
"Jupyter",
"widget",
"for",
"interactive",
"editing",
"of",
"an",
"xyz",
"point"
] | def EditPoint(value=None,min=None,max=None,labels=None,
klampt_widget=None,point_name='edited_point',point_radius=DEFAULT_POINT_RADIUS,
callback=None):
"""Creates a Jupyter widget for interactive editing of an xyz point
Args:
value (list of 3 floats, optional): the initial value of the point. I... | [
"def",
"EditPoint",
"(",
"value",
"=",
"None",
",",
"min",
"=",
"None",
",",
"max",
"=",
"None",
",",
"labels",
"=",
"None",
",",
"klampt_widget",
"=",
"None",
",",
"point_name",
"=",
"'edited_point'",
",",
"point_radius",
"=",
"DEFAULT_POINT_RADIUS",
",",... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/vis/ipython/widgets.py#L703-L755 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/core/display.py | python | Image.__init__ | (self, data=None, url=None, filename=None, format=None,
embed=None, width=None, height=None, retina=False,
unconfined=False, metadata=None) | Create a PNG/JPEG image object given raw data.
When this object is returned by an input cell or passed to the
display function, it will result in the image being displayed
in the frontend.
Parameters
----------
data : unicode, str or bytes
The raw image data... | Create a PNG/JPEG image object given raw data. | [
"Create",
"a",
"PNG",
"/",
"JPEG",
"image",
"object",
"given",
"raw",
"data",
"."
] | def __init__(self, data=None, url=None, filename=None, format=None,
embed=None, width=None, height=None, retina=False,
unconfined=False, metadata=None):
"""Create a PNG/JPEG image object given raw data.
When this object is returned by an input cell or passed to the
... | [
"def",
"__init__",
"(",
"self",
",",
"data",
"=",
"None",
",",
"url",
"=",
"None",
",",
"filename",
"=",
"None",
",",
"format",
"=",
"None",
",",
"embed",
"=",
"None",
",",
"width",
"=",
"None",
",",
"height",
"=",
"None",
",",
"retina",
"=",
"Fa... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/display.py#L934-L1046 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/rsa/rsa/_version200.py | python | gluechops | (string, key, n, funcref) | return message | Glues chops back together into a string. calls
funcref(integer, key, n) for each chop.
Used by 'decrypt' and 'verify'. | Glues chops back together into a string. calls
funcref(integer, key, n) for each chop. | [
"Glues",
"chops",
"back",
"together",
"into",
"a",
"string",
".",
"calls",
"funcref",
"(",
"integer",
"key",
"n",
")",
"for",
"each",
"chop",
"."
] | def gluechops(string, key, n, funcref):
"""Glues chops back together into a string. calls
funcref(integer, key, n) for each chop.
Used by 'decrypt' and 'verify'.
"""
message = ""
chops = decode64chops(string) #Decode base64 strings into integer chops
for cpart in chops:
mpar... | [
"def",
"gluechops",
"(",
"string",
",",
"key",
",",
"n",
",",
"funcref",
")",
":",
"message",
"=",
"\"\"",
"chops",
"=",
"decode64chops",
"(",
"string",
")",
"#Decode base64 strings into integer chops",
"for",
"cpart",
"in",
"chops",
":",
"mpart",
"=",
"func... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/rsa/rsa/_version200.py#L479-L493 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard.py | python | get_engine_node | (ctx) | return ctx.engine_node | Determine the engine root path from SetupAssistantUserPreferences. if it exists | Determine the engine root path from SetupAssistantUserPreferences. if it exists | [
"Determine",
"the",
"engine",
"root",
"path",
"from",
"SetupAssistantUserPreferences",
".",
"if",
"it",
"exists"
] | def get_engine_node(ctx):
"""
Determine the engine root path from SetupAssistantUserPreferences. if it exists
"""
try:
return ctx.engine_node
except AttributeError:
pass
# Root context path must have an engine.json file, regardless if this is an internal or external proj... | [
"def",
"get_engine_node",
"(",
"ctx",
")",
":",
"try",
":",
"return",
"ctx",
".",
"engine_node",
"except",
"AttributeError",
":",
"pass",
"# Root context path must have an engine.json file, regardless if this is an internal or external project",
"engine_json_file_path",
"=",
"c... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/lumberyard.py#L1421-L1463 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | AcceleratorEntry.ToString | (*args, **kwargs) | return _core_.AcceleratorEntry_ToString(*args, **kwargs) | ToString(self) -> String
Returns a string representation for the this accelerator. The string
is formatted using the <flags>-<keycode> format where <flags> maybe a
hyphen-separed list of "shift|alt|ctrl" | ToString(self) -> String | [
"ToString",
"(",
"self",
")",
"-",
">",
"String"
] | def ToString(*args, **kwargs):
"""
ToString(self) -> String
Returns a string representation for the this accelerator. The string
is formatted using the <flags>-<keycode> format where <flags> maybe a
hyphen-separed list of "shift|alt|ctrl"
"""
return _core_.Acce... | [
"def",
"ToString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"AcceleratorEntry_ToString",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L8960-L8969 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextEvent.GetModificationType | (*args, **kwargs) | return _stc.StyledTextEvent_GetModificationType(*args, **kwargs) | GetModificationType(self) -> int | GetModificationType(self) -> int | [
"GetModificationType",
"(",
"self",
")",
"-",
">",
"int"
] | def GetModificationType(*args, **kwargs):
"""GetModificationType(self) -> int"""
return _stc.StyledTextEvent_GetModificationType(*args, **kwargs) | [
"def",
"GetModificationType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextEvent_GetModificationType",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L7134-L7136 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/examples/python/gdbremote.py | python | Packet.get_number | (self, fail_value=-1) | Get a number from the packet. The number must be in big endian format and should be parsed
according to its prefix (starts with "0x" means hex, starts with "0" means octal, starts with
[1-9] means decimal, etc) | Get a number from the packet. The number must be in big endian format and should be parsed
according to its prefix (starts with "0x" means hex, starts with "0" means octal, starts with
[1-9] means decimal, etc) | [
"Get",
"a",
"number",
"from",
"the",
"packet",
".",
"The",
"number",
"must",
"be",
"in",
"big",
"endian",
"format",
"and",
"should",
"be",
"parsed",
"according",
"to",
"its",
"prefix",
"(",
"starts",
"with",
"0x",
"means",
"hex",
"starts",
"with",
"0",
... | def get_number(self, fail_value=-1):
'''Get a number from the packet. The number must be in big endian format and should be parsed
according to its prefix (starts with "0x" means hex, starts with "0" means octal, starts with
[1-9] means decimal, etc)'''
match = g_number_regex.match(self.... | [
"def",
"get_number",
"(",
"self",
",",
"fail_value",
"=",
"-",
"1",
")",
":",
"match",
"=",
"g_number_regex",
".",
"match",
"(",
"self",
".",
"str",
")",
"if",
"match",
":",
"number_str",
"=",
"match",
".",
"group",
"(",
"1",
")",
"self",
".",
"str... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/examples/python/gdbremote.py#L491-L501 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cgutils.py | python | gep | (builder, ptr, *inds, **kws) | return builder.gep(ptr, idx, name=name, inbounds=inbounds) | Emit a getelementptr instruction for the given pointer and indices.
The indices can be LLVM values or Python int constants. | Emit a getelementptr instruction for the given pointer and indices.
The indices can be LLVM values or Python int constants. | [
"Emit",
"a",
"getelementptr",
"instruction",
"for",
"the",
"given",
"pointer",
"and",
"indices",
".",
"The",
"indices",
"can",
"be",
"LLVM",
"values",
"or",
"Python",
"int",
"constants",
"."
] | def gep(builder, ptr, *inds, **kws):
"""
Emit a getelementptr instruction for the given pointer and indices.
The indices can be LLVM values or Python int constants.
"""
name = kws.pop('name', '')
inbounds = kws.pop('inbounds', False)
assert not kws
idx = []
for i in inds:
if ... | [
"def",
"gep",
"(",
"builder",
",",
"ptr",
",",
"*",
"inds",
",",
"*",
"*",
"kws",
")",
":",
"name",
"=",
"kws",
".",
"pop",
"(",
"'name'",
",",
"''",
")",
"inbounds",
"=",
"kws",
".",
"pop",
"(",
"'inbounds'",
",",
"False",
")",
"assert",
"not"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cgutils.py#L866-L882 | |
synfig/synfig | a5ec91db5b751dc12e4400ccfb5c063fd6d2d928 | synfig-studio/plugins/lottie-exporter/layers/group.py | python | flip_time | (time) | return ret | Time will be in a set();
Example: input: ((2, 3), (4, 5))
output: ((0, 2), (3, 4), (5, frame_last_time))
Args:
time (set) : Range of time is stored in this
Returns:
(set) : Flipped/opposite of `time` is returned | Time will be in a set();
Example: input: ((2, 3), (4, 5))
output: ((0, 2), (3, 4), (5, frame_last_time)) | [
"Time",
"will",
"be",
"in",
"a",
"set",
"()",
";",
"Example",
":",
"input",
":",
"((",
"2",
"3",
")",
"(",
"4",
"5",
"))",
"output",
":",
"((",
"0",
"2",
")",
"(",
"3",
"4",
")",
"(",
"5",
"frame_last_time",
"))"
] | def flip_time(time):
"""
Time will be in a set();
Example: input: ((2, 3), (4, 5))
output: ((0, 2), (3, 4), (5, frame_last_time))
Args:
time (set) : Range of time is stored in this
Returns:
(set) : Flipped/opposite of `time` is returned
"""
ret = set()
last... | [
"def",
"flip_time",
"(",
"time",
")",
":",
"ret",
"=",
"set",
"(",
")",
"last",
"=",
"settings",
".",
"lottie_format",
"[",
"\"op\"",
"]",
"/",
"settings",
".",
"lottie_format",
"[",
"\"fr\"",
"]",
"z",
"=",
"0",
"for",
"it",
"in",
"time",
":",
"if... | https://github.com/synfig/synfig/blob/a5ec91db5b751dc12e4400ccfb5c063fd6d2d928/synfig-studio/plugins/lottie-exporter/layers/group.py#L283-L304 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Window.GetScreenPositionTuple | (*args, **kwargs) | return _core_.Window_GetScreenPositionTuple(*args, **kwargs) | GetScreenPositionTuple() -> (x,y)
Get the position of the window in screen coordinantes. | GetScreenPositionTuple() -> (x,y) | [
"GetScreenPositionTuple",
"()",
"-",
">",
"(",
"x",
"y",
")"
] | def GetScreenPositionTuple(*args, **kwargs):
"""
GetScreenPositionTuple() -> (x,y)
Get the position of the window in screen coordinantes.
"""
return _core_.Window_GetScreenPositionTuple(*args, **kwargs) | [
"def",
"GetScreenPositionTuple",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_GetScreenPositionTuple",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L9484-L9490 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/server/wsgi/serve/snippets/util/snippet_masker.py | python | _FlexibleBool | (bool_text) | Tolerant boolean text.
Args:
bool_text: the bool text.
Returns:
Boolean value of text.
Raises:
ValueError: if the text bool isn't recognized. | Tolerant boolean text. | [
"Tolerant",
"boolean",
"text",
"."
] | def _FlexibleBool(bool_text):
"""Tolerant boolean text.
Args:
bool_text: the bool text.
Returns:
Boolean value of text.
Raises:
ValueError: if the text bool isn't recognized.
"""
as_lower = bool_text.lower()
if as_lower in _FlexibleBool.TEXT_TRUES:
return True
elif as_lower in _... | [
"def",
"_FlexibleBool",
"(",
"bool_text",
")",
":",
"as_lower",
"=",
"bool_text",
".",
"lower",
"(",
")",
"if",
"as_lower",
"in",
"_FlexibleBool",
".",
"TEXT_TRUES",
":",
"return",
"True",
"elif",
"as_lower",
"in",
"_FlexibleBool",
".",
"TEXT_FALSES",
":",
"... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/serve/snippets/util/snippet_masker.py#L88-L106 | ||
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/hang_analyzer/dumper.py | python | get_dumpers | (root_logger: logging.Logger, dbg_output: str) | return Dumpers(dbg=dbg, jstack=jstack) | Return OS-appropriate dumpers.
:param root_logger: Top-level logger
:param dbg_output: 'stdout' or 'file' | Return OS-appropriate dumpers. | [
"Return",
"OS",
"-",
"appropriate",
"dumpers",
"."
] | def get_dumpers(root_logger: logging.Logger, dbg_output: str):
"""
Return OS-appropriate dumpers.
:param root_logger: Top-level logger
:param dbg_output: 'stdout' or 'file'
"""
dbg = None
jstack = None
if sys.platform.startswith("linux"):
dbg = GDBDumper(root_logger, dbg_output... | [
"def",
"get_dumpers",
"(",
"root_logger",
":",
"logging",
".",
"Logger",
",",
"dbg_output",
":",
"str",
")",
":",
"dbg",
"=",
"None",
"jstack",
"=",
"None",
"if",
"sys",
".",
"platform",
".",
"startswith",
"(",
"\"linux\"",
")",
":",
"dbg",
"=",
"GDBDu... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/hang_analyzer/dumper.py#L18-L38 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/linalg/python/ops/linear_operator_util.py | python | assert_zero_imag_part | (x, message=None, name="assert_zero_imag_part") | Returns `Op` that asserts Tensor `x` has no non-zero imaginary parts.
Args:
x: Numeric `Tensor`, real, integer, or complex.
message: A string message to prepend to failure message.
name: A name to give this `Op`.
Returns:
An `Op` that asserts `x` has no entries with modulus zero. | Returns `Op` that asserts Tensor `x` has no non-zero imaginary parts. | [
"Returns",
"Op",
"that",
"asserts",
"Tensor",
"x",
"has",
"no",
"non",
"-",
"zero",
"imaginary",
"parts",
"."
] | def assert_zero_imag_part(x, message=None, name="assert_zero_imag_part"):
"""Returns `Op` that asserts Tensor `x` has no non-zero imaginary parts.
Args:
x: Numeric `Tensor`, real, integer, or complex.
message: A string message to prepend to failure message.
name: A name to give this `Op`.
Returns... | [
"def",
"assert_zero_imag_part",
"(",
"x",
",",
"message",
"=",
"None",
",",
"name",
"=",
"\"assert_zero_imag_part\"",
")",
":",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"values",
"=",
"[",
"x",
"]",
")",
":",
"x",
"=",
"ops",
".",
"convert_t... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/linalg/python/ops/linear_operator_util.py#L49-L68 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | xmlNode.setNsProp | (self, ns, name, value) | return __tmp | Set (or reset) an attribute carried by a node. The ns
structure must be in scope, this is not checked | Set (or reset) an attribute carried by a node. The ns
structure must be in scope, this is not checked | [
"Set",
"(",
"or",
"reset",
")",
"an",
"attribute",
"carried",
"by",
"a",
"node",
".",
"The",
"ns",
"structure",
"must",
"be",
"in",
"scope",
"this",
"is",
"not",
"checked"
] | def setNsProp(self, ns, name, value):
"""Set (or reset) an attribute carried by a node. The ns
structure must be in scope, this is not checked """
if ns is None: ns__o = None
else: ns__o = ns._o
ret = libxml2mod.xmlSetNsProp(self._o, ns__o, name, value)
if ret is None:... | [
"def",
"setNsProp",
"(",
"self",
",",
"ns",
",",
"name",
",",
"value",
")",
":",
"if",
"ns",
"is",
"None",
":",
"ns__o",
"=",
"None",
"else",
":",
"ns__o",
"=",
"ns",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlSetNsProp",
"(",
"self",
".",
"_o... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L2782-L2790 | |
papyrussolution/OpenPapyrus | bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91 | Src/OSF/abseil/absl/abseil.podspec.gen.py | python | read_build | (package) | return [
parse_rule(elem, package)
for elem in root
if elem.tag == "rule" and elem.attrib["class"].startswith("cc_")
] | Runs bazel query on given package file and returns all cc rules. | Runs bazel query on given package file and returns all cc rules. | [
"Runs",
"bazel",
"query",
"on",
"given",
"package",
"file",
"and",
"returns",
"all",
"cc",
"rules",
"."
] | def read_build(package):
"""Runs bazel query on given package file and returns all cc rules."""
result = subprocess.check_output(
["bazel", "query", package + ":all", "--output", "xml"])
root = xml.etree.ElementTree.fromstring(result)
return [
parse_rule(elem, package)
for elem in root
i... | [
"def",
"read_build",
"(",
"package",
")",
":",
"result",
"=",
"subprocess",
".",
"check_output",
"(",
"[",
"\"bazel\"",
",",
"\"query\"",
",",
"package",
"+",
"\":all\"",
",",
"\"--output\"",
",",
"\"xml\"",
"]",
")",
"root",
"=",
"xml",
".",
"etree",
".... | https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/abseil/absl/abseil.podspec.gen.py#L89-L98 | |
panda3d/panda3d | 833ad89ebad58395d0af0b7ec08538e5e4308265 | direct/src/extensions_native/extension_native_helpers.py | python | Dtool_funcToMethod | (func, cls, method_name=None) | Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method.
The new method is accessible to any instance immediately. | Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method.
The new method is accessible to any instance immediately. | [
"Adds",
"func",
"to",
"class",
"so",
"it",
"is",
"an",
"accessible",
"method",
";",
"use",
"method_name",
"to",
"specify",
"the",
"name",
"to",
"be",
"used",
"for",
"calling",
"the",
"method",
".",
"The",
"new",
"method",
"is",
"accessible",
"to",
"any",... | def Dtool_funcToMethod(func, cls, method_name=None):
"""Adds func to class so it is an accessible method; use method_name to specify the name to be used for calling the method.
The new method is accessible to any instance immediately."""
func.__func__ = func
func.__self__ = None
if not method_name:
... | [
"def",
"Dtool_funcToMethod",
"(",
"func",
",",
"cls",
",",
"method_name",
"=",
"None",
")",
":",
"func",
".",
"__func__",
"=",
"func",
"func",
".",
"__self__",
"=",
"None",
"if",
"not",
"method_name",
":",
"method_name",
"=",
"func",
".",
"__name__",
"cl... | https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/extensions_native/extension_native_helpers.py#L8-L15 | ||
microsoft/TSS.MSR | 0f2516fca2cd9929c31d5450e39301c9bde43688 | TSS.Py/src/TpmTypes.py | python | TPM_HANDLE.nv | (nvIndex) | return TPM_HANDLE((TPM_HT.NV_INDEX << 24) + nvIndex) | Creates a TPM_HANDLE for an NV slot
Args:
nvIndex (int): The NV index
Returns:
New TPM_HANDLE object | Creates a TPM_HANDLE for an NV slot
Args:
nvIndex (int): The NV index
Returns:
New TPM_HANDLE object | [
"Creates",
"a",
"TPM_HANDLE",
"for",
"an",
"NV",
"slot",
"Args",
":",
"nvIndex",
"(",
"int",
")",
":",
"The",
"NV",
"index",
"Returns",
":",
"New",
"TPM_HANDLE",
"object"
] | def nv(nvIndex):
""" Creates a TPM_HANDLE for an NV slot
Args:
nvIndex (int): The NV index
Returns:
New TPM_HANDLE object
"""
return TPM_HANDLE((TPM_HT.NV_INDEX << 24) + nvIndex) | [
"def",
"nv",
"(",
"nvIndex",
")",
":",
"return",
"TPM_HANDLE",
"(",
"(",
"TPM_HT",
".",
"NV_INDEX",
"<<",
"24",
")",
"+",
"nvIndex",
")"
] | https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L3488-L3495 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/numbers.py | python | Integral.__xor__ | (self, other) | self ^ other | self ^ other | [
"self",
"^",
"other"
] | def __xor__(self, other):
"""self ^ other"""
raise NotImplementedError | [
"def",
"__xor__",
"(",
"self",
",",
"other",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/numbers.py#L354-L356 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/yapf/yapf/yapflib/pytree_utils.py | python | DumpNodeToString | (node) | Dump a string representation of the given node. For debugging.
Arguments:
node: the node.
Returns:
The string representation. | Dump a string representation of the given node. For debugging. | [
"Dump",
"a",
"string",
"representation",
"of",
"the",
"given",
"node",
".",
"For",
"debugging",
"."
] | def DumpNodeToString(node):
"""Dump a string representation of the given node. For debugging.
Arguments:
node: the node.
Returns:
The string representation.
"""
if isinstance(node, pytree.Leaf):
fmt = '{name}({value}) [lineno={lineno}, column={column}, prefix={prefix}]'
return fmt.format(
... | [
"def",
"DumpNodeToString",
"(",
"node",
")",
":",
"if",
"isinstance",
"(",
"node",
",",
"pytree",
".",
"Leaf",
")",
":",
"fmt",
"=",
"'{name}({value}) [lineno={lineno}, column={column}, prefix={prefix}]'",
"return",
"fmt",
".",
"format",
"(",
"name",
"=",
"NodeNam... | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/pytree_utils.py#L261-L283 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/MLUtils/VoteImg.py | python | CollectVotes | (composite, data, badOnly) | return res, values, trueValues, misCount | collects the votes from _composite_ for the examples in _data_
**Arguments**
- composite: a composite model
- data: a list of examples to run through _composite_
- badOnly: if set only bad (misclassified) examples will be kept
**Returns**
a 4-tuple containing:
1) the expan... | collects the votes from _composite_ for the examples in _data_ | [
"collects",
"the",
"votes",
"from",
"_composite_",
"for",
"the",
"examples",
"in",
"_data_"
] | def CollectVotes(composite, data, badOnly):
""" collects the votes from _composite_ for the examples in _data_
**Arguments**
- composite: a composite model
- data: a list of examples to run through _composite_
- badOnly: if set only bad (misclassified) examples will be kept
**Returns**
... | [
"def",
"CollectVotes",
"(",
"composite",
",",
"data",
",",
"badOnly",
")",
":",
"res",
"=",
"[",
"]",
"values",
"=",
"[",
"]",
"trueValues",
"=",
"[",
"]",
"misCount",
"=",
"0",
"for",
"pt",
"in",
"data",
":",
"val",
",",
"_",
"=",
"composite",
"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/MLUtils/VoteImg.py#L15-L63 | |
OpenLightingProject/ola | d1433a1bed73276fbe55ce18c03b1c208237decc | tools/rdm/ModelCollector.py | python | ModelCollector._HandleSoftwareVersionLabel | (self, data) | Called when we get a SOFTWARE_VERSION_LABEL response. | Called when we get a SOFTWARE_VERSION_LABEL response. | [
"Called",
"when",
"we",
"get",
"a",
"SOFTWARE_VERSION_LABEL",
"response",
"."
] | def _HandleSoftwareVersionLabel(self, data):
"""Called when we get a SOFTWARE_VERSION_LABEL response."""
if data is not None:
this_version = self._GetVersion()
this_version['label'] = data['label']
self._NextState() | [
"def",
"_HandleSoftwareVersionLabel",
"(",
"self",
",",
"data",
")",
":",
"if",
"data",
"is",
"not",
"None",
":",
"this_version",
"=",
"self",
".",
"_GetVersion",
"(",
")",
"this_version",
"[",
"'label'",
"]",
"=",
"data",
"[",
"'label'",
"]",
"self",
".... | https://github.com/OpenLightingProject/ola/blob/d1433a1bed73276fbe55ce18c03b1c208237decc/tools/rdm/ModelCollector.py#L271-L276 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/xml/sax/handler.py | python | DTDHandler.unparsedEntityDecl | (self, name, publicId, systemId, ndata) | Handle an unparsed entity declaration event. | Handle an unparsed entity declaration event. | [
"Handle",
"an",
"unparsed",
"entity",
"declaration",
"event",
"."
] | def unparsedEntityDecl(self, name, publicId, systemId, ndata):
"Handle an unparsed entity declaration event." | [
"def",
"unparsedEntityDecl",
"(",
"self",
",",
"name",
",",
"publicId",
",",
"systemId",
",",
"ndata",
")",
":"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/sax/handler.py#L217-L218 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/indexes/base.py | python | Index.__getitem__ | (self, key) | Override numpy.ndarray's __getitem__ method to work as desired.
This function adds lists and Series as valid boolean indexers
(ndarrays only supports ndarray with dtype=bool).
If resulting ndim != 1, plain ndarray is returned instead of
corresponding `Index` subclass. | Override numpy.ndarray's __getitem__ method to work as desired. | [
"Override",
"numpy",
".",
"ndarray",
"s",
"__getitem__",
"method",
"to",
"work",
"as",
"desired",
"."
] | def __getitem__(self, key):
"""
Override numpy.ndarray's __getitem__ method to work as desired.
This function adds lists and Series as valid boolean indexers
(ndarrays only supports ndarray with dtype=bool).
If resulting ndim != 1, plain ndarray is returned instead of
c... | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"# There's no custom logic to be implemented in __getslice__, so it's",
"# not overloaded intentionally.",
"getitem",
"=",
"self",
".",
"_data",
".",
"__getitem__",
"if",
"is_scalar",
"(",
"key",
")",
":",
"key",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/indexes/base.py#L4587-L4629 | ||
alexgkendall/caffe-segnet | 344c113bf1832886f1cbe9f33ffe28a3beeaf412 | scripts/cpp_lint.py | python | CleansedLines.NumLines | (self) | return self.num_lines | Returns the number of lines represented. | Returns the number of lines represented. | [
"Returns",
"the",
"number",
"of",
"lines",
"represented",
"."
] | def NumLines(self):
"""Returns the number of lines represented."""
return self.num_lines | [
"def",
"NumLines",
"(",
"self",
")",
":",
"return",
"self",
".",
"num_lines"
] | https://github.com/alexgkendall/caffe-segnet/blob/344c113bf1832886f1cbe9f33ffe28a3beeaf412/scripts/cpp_lint.py#L1204-L1206 | |
Tencent/Pebble | 68315f176d9e328a233ace29b7579a829f89879f | tools/blade/src/blade/blade.py | python | Blade.get_scons_platform | (self) | return self.__scons_platform | Return handle of the platform class. | Return handle of the platform class. | [
"Return",
"handle",
"of",
"the",
"platform",
"class",
"."
] | def get_scons_platform(self):
"""Return handle of the platform class. """
return self.__scons_platform | [
"def",
"get_scons_platform",
"(",
"self",
")",
":",
"return",
"self",
".",
"__scons_platform"
] | https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/blade.py#L336-L338 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/cgi.py | python | FieldStorage.getvalue | (self, key, default=None) | Dictionary style get() method, including 'value' lookup. | Dictionary style get() method, including 'value' lookup. | [
"Dictionary",
"style",
"get",
"()",
"method",
"including",
"value",
"lookup",
"."
] | def getvalue(self, key, default=None):
"""Dictionary style get() method, including 'value' lookup."""
if key in self:
value = self[key]
if type(value) is type([]):
return map(attrgetter('value'), value)
else:
return value.value
... | [
"def",
"getvalue",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"if",
"key",
"in",
"self",
":",
"value",
"=",
"self",
"[",
"key",
"]",
"if",
"type",
"(",
"value",
")",
"is",
"type",
"(",
"[",
"]",
")",
":",
"return",
"map",
... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/cgi.py#L547-L556 | ||
Kitware/ParaView | f760af9124ff4634b23ebbeab95a4f56e0261955 | Plugins/pvblot/blotish.py | python | nintv | (value=None) | Set nintv | Set nintv | [
"Set",
"nintv"
] | def nintv(value=None):
"""Set nintv"""
state.time_selection.set_nintv(_maybe_convert(value, int))
state.time_selection.print_show() | [
"def",
"nintv",
"(",
"value",
"=",
"None",
")",
":",
"state",
".",
"time_selection",
".",
"set_nintv",
"(",
"_maybe_convert",
"(",
"value",
",",
"int",
")",
")",
"state",
".",
"time_selection",
".",
"print_show",
"(",
")"
] | https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Plugins/pvblot/blotish.py#L887-L890 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | to_double | (x, name="ToDouble") | return cast(x, dtypes.float64, name=name) | Casts a tensor to type `float64`.
Args:
x: A `Tensor` or `SparseTensor`.
name: A name for the operation (optional).
Returns:
A `Tensor` or `SparseTensor` with same shape as `x` with type `float64`.
Raises:
TypeError: If `x` cannot be cast to the `float64`. | Casts a tensor to type `float64`. | [
"Casts",
"a",
"tensor",
"to",
"type",
"float64",
"."
] | def to_double(x, name="ToDouble"):
"""Casts a tensor to type `float64`.
Args:
x: A `Tensor` or `SparseTensor`.
name: A name for the operation (optional).
Returns:
A `Tensor` or `SparseTensor` with same shape as `x` with type `float64`.
Raises:
TypeError: If `x` cannot be cast to the `float64`... | [
"def",
"to_double",
"(",
"x",
",",
"name",
"=",
"\"ToDouble\"",
")",
":",
"return",
"cast",
"(",
"x",
",",
"dtypes",
".",
"float64",
",",
"name",
"=",
"name",
")"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L673-L686 | |
citp/BlockSci | 14ccc9358443b2eb5730bb2902c4b11ab7928abf | blockscipy/blocksci/__init__.py | python | filter_blocks_legacy | (
self, filter_func, start=None, end=None, cpu_count=psutil.cpu_count()
) | return mapreduce_block_ranges(
self, map_func, reduce_func, MISSING_PARAM, start, end, cpu_count=cpu_count
) | Return all blocks in range which match the given criteria | Return all blocks in range which match the given criteria | [
"Return",
"all",
"blocks",
"in",
"range",
"which",
"match",
"the",
"given",
"criteria"
] | def filter_blocks_legacy(
self, filter_func, start=None, end=None, cpu_count=psutil.cpu_count()
):
"""Return all blocks in range which match the given criteria
"""
def map_func(blocks):
return [block for block in blocks if filter_func(block)]
def reduce_func(accum, new_val):
accum.... | [
"def",
"filter_blocks_legacy",
"(",
"self",
",",
"filter_func",
",",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"cpu_count",
"=",
"psutil",
".",
"cpu_count",
"(",
")",
")",
":",
"def",
"map_func",
"(",
"blocks",
")",
":",
"return",
"[",
"block... | https://github.com/citp/BlockSci/blob/14ccc9358443b2eb5730bb2902c4b11ab7928abf/blockscipy/blocksci/__init__.py#L194-L209 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py | python | _ProxyFile.__init__ | (self, f, pos=None) | Initialize a _ProxyFile. | Initialize a _ProxyFile. | [
"Initialize",
"a",
"_ProxyFile",
"."
] | def __init__(self, f, pos=None):
"""Initialize a _ProxyFile."""
self._file = f
if pos is None:
self._pos = f.tell()
else:
self._pos = pos | [
"def",
"__init__",
"(",
"self",
",",
"f",
",",
"pos",
"=",
"None",
")",
":",
"self",
".",
"_file",
"=",
"f",
"if",
"pos",
"is",
"None",
":",
"self",
".",
"_pos",
"=",
"f",
".",
"tell",
"(",
")",
"else",
":",
"self",
".",
"_pos",
"=",
"pos"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/mailbox.py#L1863-L1869 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/debug.py | python | ProcessedTraceback.render_as_html | (self, full=False) | return u'%s\n\n<!--\n%s\n-->' % (
render_traceback(self, full=full),
self.render_as_text().decode('utf-8', 'replace')
) | Return a unicode string with the traceback as rendered HTML. | Return a unicode string with the traceback as rendered HTML. | [
"Return",
"a",
"unicode",
"string",
"with",
"the",
"traceback",
"as",
"rendered",
"HTML",
"."
] | def render_as_html(self, full=False):
"""Return a unicode string with the traceback as rendered HTML."""
from jinja2.debugrenderer import render_traceback
return u'%s\n\n<!--\n%s\n-->' % (
render_traceback(self, full=full),
self.render_as_text().decode('utf-8', 'replace')... | [
"def",
"render_as_html",
"(",
"self",
",",
"full",
"=",
"False",
")",
":",
"from",
"jinja2",
".",
"debugrenderer",
"import",
"render_traceback",
"return",
"u'%s\\n\\n<!--\\n%s\\n-->'",
"%",
"(",
"render_traceback",
"(",
"self",
",",
"full",
"=",
"full",
")",
"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/debug.py#L103-L109 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel.delete_element_field | (self,
element_field_names,
element_block_ids='all') | Delete one or more element fields.
Examples:
>>> model.delete_element_field('eqps')
>>> model.delete_element_field('all') | Delete one or more element fields. | [
"Delete",
"one",
"or",
"more",
"element",
"fields",
"."
] | def delete_element_field(self,
element_field_names,
element_block_ids='all'):
"""
Delete one or more element fields.
Examples:
>>> model.delete_element_field('eqps')
>>> model.delete_element_field('all')
"""
... | [
"def",
"delete_element_field",
"(",
"self",
",",
"element_field_names",
",",
"element_block_ids",
"=",
"'all'",
")",
":",
"element_block_ids",
"=",
"self",
".",
"_format_element_block_id_list",
"(",
"element_block_ids",
")",
"element_field_names",
"=",
"self",
".",
"_... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L4762-L4792 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Taskmaster.py | python | Task._exception_raise | (self) | Raises a pending exception that was recorded while getting a
Task ready for execution. | Raises a pending exception that was recorded while getting a
Task ready for execution. | [
"Raises",
"a",
"pending",
"exception",
"that",
"was",
"recorded",
"while",
"getting",
"a",
"Task",
"ready",
"for",
"execution",
"."
] | def _exception_raise(self):
"""
Raises a pending exception that was recorded while getting a
Task ready for execution.
"""
exc = self.exc_info()[:]
try:
exc_type, exc_value, exc_traceback = exc
except ValueError:
exc_type, exc_value = exc ... | [
"def",
"_exception_raise",
"(",
"self",
")",
":",
"exc",
"=",
"self",
".",
"exc_info",
"(",
")",
"[",
":",
"]",
"try",
":",
"exc_type",
",",
"exc_value",
",",
"exc_traceback",
"=",
"exc",
"except",
"ValueError",
":",
"exc_type",
",",
"exc_value",
"=",
... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Taskmaster.py#L525-L543 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | Window.CanBeOutsideClientArea | (*args, **kwargs) | return _core_.Window_CanBeOutsideClientArea(*args, **kwargs) | CanBeOutsideClientArea(self) -> bool | CanBeOutsideClientArea(self) -> bool | [
"CanBeOutsideClientArea",
"(",
"self",
")",
"-",
">",
"bool"
] | def CanBeOutsideClientArea(*args, **kwargs):
"""CanBeOutsideClientArea(self) -> bool"""
return _core_.Window_CanBeOutsideClientArea(*args, **kwargs) | [
"def",
"CanBeOutsideClientArea",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Window_CanBeOutsideClientArea",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L11595-L11597 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/boost/boost_1_68_0/libs/metaparse/tools/benchmark/char_stat.py | python | count_characters | (root, out) | Count the occurrances of the different characters in the files | Count the occurrances of the different characters in the files | [
"Count",
"the",
"occurrances",
"of",
"the",
"different",
"characters",
"in",
"the",
"files"
] | def count_characters(root, out):
"""Count the occurrances of the different characters in the files"""
if os.path.isfile(root):
with open(root, 'rb') as in_f:
for line in in_f:
for char in line:
if char not in out:
out[char] = 0
... | [
"def",
"count_characters",
"(",
"root",
",",
"out",
")",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"root",
")",
":",
"with",
"open",
"(",
"root",
",",
"'rb'",
")",
"as",
"in_f",
":",
"for",
"line",
"in",
"in_f",
":",
"for",
"char",
"in",
... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/libs/metaparse/tools/benchmark/char_stat.py#L13-L24 | ||
blackberry/Boost | fc90c3fde129c62565c023f091eddc4a7ed9902b | tools/build/v2/tools/builtin.py | python | variant | (name, parents_or_properties, explicit_properties = []) | Declares a new variant.
First determines explicit properties for this variant, by
refining parents' explicit properties with the passed explicit
properties. The result is remembered and will be used if
this variant is used as parent.
Second, determines the full property ... | Declares a new variant.
First determines explicit properties for this variant, by
refining parents' explicit properties with the passed explicit
properties. The result is remembered and will be used if
this variant is used as parent.
Second, determines the full property ... | [
"Declares",
"a",
"new",
"variant",
".",
"First",
"determines",
"explicit",
"properties",
"for",
"this",
"variant",
"by",
"refining",
"parents",
"explicit",
"properties",
"with",
"the",
"passed",
"explicit",
"properties",
".",
"The",
"result",
"is",
"remembered",
... | def variant (name, parents_or_properties, explicit_properties = []):
""" Declares a new variant.
First determines explicit properties for this variant, by
refining parents' explicit properties with the passed explicit
properties. The result is remembered and will be used if
this vari... | [
"def",
"variant",
"(",
"name",
",",
"parents_or_properties",
",",
"explicit_properties",
"=",
"[",
"]",
")",
":",
"parents",
"=",
"[",
"]",
"if",
"not",
"explicit_properties",
":",
"explicit_properties",
"=",
"parents_or_properties",
"else",
":",
"parents",
"=",... | https://github.com/blackberry/Boost/blob/fc90c3fde129c62565c023f091eddc4a7ed9902b/tools/build/v2/tools/builtin.py#L33-L82 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | Image.SetMaskFromImage | (*args, **kwargs) | return _core_.Image_SetMaskFromImage(*args, **kwargs) | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
Sets the image's mask so that the pixels that have RGB value of
``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
by first finding an unused colour in the image, setting this colour as
the mask col... | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | [
"SetMaskFromImage",
"(",
"self",
"Image",
"mask",
"byte",
"mr",
"byte",
"mg",
"byte",
"mb",
")",
"-",
">",
"bool"
] | def SetMaskFromImage(*args, **kwargs):
"""
SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
Sets the image's mask so that the pixels that have RGB value of
``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
by first finding an unused colou... | [
"def",
"SetMaskFromImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Image_SetMaskFromImage",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L3138-L3155 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | ListCtrl.HasColumnOrderSupport | (*args, **kwargs) | return _controls_.ListCtrl_HasColumnOrderSupport(*args, **kwargs) | HasColumnOrderSupport() -> bool | HasColumnOrderSupport() -> bool | [
"HasColumnOrderSupport",
"()",
"-",
">",
"bool"
] | def HasColumnOrderSupport(*args, **kwargs):
"""HasColumnOrderSupport() -> bool"""
return _controls_.ListCtrl_HasColumnOrderSupport(*args, **kwargs) | [
"def",
"HasColumnOrderSupport",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListCtrl_HasColumnOrderSupport",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4476-L4478 | |
yyzybb537/libgo | 4af17b7c67643c4d54aa354dcc77963ea07847d0 | third_party/boost.context/tools/build/src/build/virtual_target.py | python | Action.actualize_sources | (self, sources, prop_set) | Creates actual jam targets for sources. Initializes two member
variables:
'self.actual_sources_' -- sources which are passed to updating action
'self.dependency_only_sources_' -- sources which are made dependencies, but
are not used otherwise.
New values will... | Creates actual jam targets for sources. Initializes two member
variables:
'self.actual_sources_' -- sources which are passed to updating action
'self.dependency_only_sources_' -- sources which are made dependencies, but
are not used otherwise. | [
"Creates",
"actual",
"jam",
"targets",
"for",
"sources",
".",
"Initializes",
"two",
"member",
"variables",
":",
"self",
".",
"actual_sources_",
"--",
"sources",
"which",
"are",
"passed",
"to",
"updating",
"action",
"self",
".",
"dependency_only_sources_",
"--",
... | def actualize_sources (self, sources, prop_set):
""" Creates actual jam targets for sources. Initializes two member
variables:
'self.actual_sources_' -- sources which are passed to updating action
'self.dependency_only_sources_' -- sources which are made dependencies, but
... | [
"def",
"actualize_sources",
"(",
"self",
",",
"sources",
",",
"prop_set",
")",
":",
"assert",
"is_iterable_typed",
"(",
"sources",
",",
"VirtualTarget",
")",
"assert",
"isinstance",
"(",
"prop_set",
",",
"property_set",
".",
"PropertySet",
")",
"dependencies",
"... | https://github.com/yyzybb537/libgo/blob/4af17b7c67643c4d54aa354dcc77963ea07847d0/third_party/boost.context/tools/build/src/build/virtual_target.py#L883-L914 | ||
NVIDIA-Merlin/HugeCTR | b596bcc44e14bb0c62c4f7e9c0b55301d94f2154 | tutorial/dump_to_tf/dump.py | python | DumpToTF.parse_dense | (self, layer_bytes, layer_type, **kwargs) | get one layer weights at a time. | get one layer weights at a time. | [
"get",
"one",
"layer",
"weights",
"at",
"a",
"time",
"."
] | def parse_dense(self, layer_bytes, layer_type, **kwargs):
"""
get one layer weights at a time.
"""
if self.model_content is None:
self.parse_json()
self.offset = 0
with open(self.dense_model_name, 'rb') as file:
print("[INFO] begin to parse de... | [
"def",
"parse_dense",
"(",
"self",
",",
"layer_bytes",
",",
"layer_type",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"model_content",
"is",
"None",
":",
"self",
".",
"parse_json",
"(",
")",
"self",
".",
"offset",
"=",
"0",
"with",
"open",
... | https://github.com/NVIDIA-Merlin/HugeCTR/blob/b596bcc44e14bb0c62c4f7e9c0b55301d94f2154/tutorial/dump_to_tf/dump.py#L123-L177 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/utils/analyzer/CmpRuns.py | python | load_results | (results: ResultsDirectory, delete_empty: bool = True,
verbose_log: Optional[str] = None) | return load_results_from_single_run(SingleRunInfo(results,
verbose_log),
delete_empty) | Backwards compatibility API. | Backwards compatibility API. | [
"Backwards",
"compatibility",
"API",
"."
] | def load_results(results: ResultsDirectory, delete_empty: bool = True,
verbose_log: Optional[str] = None) -> AnalysisRun:
"""
Backwards compatibility API.
"""
return load_results_from_single_run(SingleRunInfo(results,
verbose_log),
... | [
"def",
"load_results",
"(",
"results",
":",
"ResultsDirectory",
",",
"delete_empty",
":",
"bool",
"=",
"True",
",",
"verbose_log",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"AnalysisRun",
":",
"return",
"load_results_from_single_run",
"(",
"Sin... | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/utils/analyzer/CmpRuns.py#L273-L280 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/bindings/python/llvm/object.py | python | ObjectFile.get_symbols | (self, cache=False) | Obtain the symbols in this object file.
This is a generator for llvm.object.Symbol instances.
Each Symbol instance is a limited-use object. See this module's
documentation on iterators for more. | Obtain the symbols in this object file. | [
"Obtain",
"the",
"symbols",
"in",
"this",
"object",
"file",
"."
] | def get_symbols(self, cache=False):
"""Obtain the symbols in this object file.
This is a generator for llvm.object.Symbol instances.
Each Symbol instance is a limited-use object. See this module's
documentation on iterators for more.
"""
symbols = lib.LLVMGetSymbols(sel... | [
"def",
"get_symbols",
"(",
"self",
",",
"cache",
"=",
"False",
")",
":",
"symbols",
"=",
"lib",
".",
"LLVMGetSymbols",
"(",
"self",
")",
"last",
"=",
"None",
"while",
"True",
":",
"if",
"lib",
".",
"LLVMIsSymbolIteratorAtEnd",
"(",
"self",
",",
"symbols"... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/bindings/python/llvm/object.py#L151-L177 | ||
hakuna-m/wubiuefi | caec1af0a09c78fd5a345180ada1fe45e0c63493 | src/openpgp/sap/crypto.py | python | encrypt_public_session | (keypkt, key, symalg) | return create_Packet(PKT_PUBKEYSESKEY, sesbody._d) | Create a public-key encrypted session key.
:Parameters:
- `keypkt`: either an `OpenPGP.packet.PublicKey.PublicKey` (or
subclass) instance or encryption passphrase string
- `key`: string encryptrion algorithm used for `symalg`
- `symalg`: integer symmetric encryption algorithm cons... | Create a public-key encrypted session key. | [
"Create",
"a",
"public",
"-",
"key",
"encrypted",
"session",
"key",
"."
] | def encrypt_public_session(keypkt, key, symalg):
"""Create a public-key encrypted session key.
:Parameters:
- `keypkt`: either an `OpenPGP.packet.PublicKey.PublicKey` (or
subclass) instance or encryption passphrase string
- `key`: string encryptrion algorithm used for `symalg`
... | [
"def",
"encrypt_public_session",
"(",
"keypkt",
",",
"key",
",",
"symalg",
")",
":",
"from",
"openpgp",
".",
"sap",
".",
"pkt",
".",
"Packet",
"import",
"create_Packet",
"from",
"openpgp",
".",
"sap",
".",
"pkt",
".",
"PublicKeyEncryptedSessionKey",
"import",
... | https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/openpgp/sap/crypto.py#L1218-L1262 | |
feelpp/feelpp | 2d547ed701cc5adb01639185b4a8eb47940367c7 | toolboxes/pyfeelpp-toolboxes/feelpp/toolboxes/solid/__init__.py | python | solid | (dim=2, orderDisp=1, worldComm=None, keyword="solid", subprefix="", modelRep=None) | return _csms[key](prefix="solid", keyword=keyword, worldComm=worldComm, subprefix="", modelRep=modelRep) | create a solid toolbox solver
Keyword arguments:
dim -- the dimension (default: 2)
orderDisp -- the polynomial order for the displacement (default: 1)
worldComm -- the parallel communicator for the mesh (default: core.Environment::worldCommPtr()) | create a solid toolbox solver
Keyword arguments:
dim -- the dimension (default: 2)
orderDisp -- the polynomial order for the displacement (default: 1)
worldComm -- the parallel communicator for the mesh (default: core.Environment::worldCommPtr()) | [
"create",
"a",
"solid",
"toolbox",
"solver",
"Keyword",
"arguments",
":",
"dim",
"--",
"the",
"dimension",
"(",
"default",
":",
"2",
")",
"orderDisp",
"--",
"the",
"polynomial",
"order",
"for",
"the",
"displacement",
"(",
"default",
":",
"1",
")",
"worldCo... | def solid(dim=2, orderDisp=1, worldComm=None, keyword="solid", subprefix="", modelRep=None):
"""create a solid toolbox solver
Keyword arguments:
dim -- the dimension (default: 2)
orderDisp -- the polynomial order for the displacement (default: 1)
worldComm -- the parallel communicator for the mesh (... | [
"def",
"solid",
"(",
"dim",
"=",
"2",
",",
"orderDisp",
"=",
"1",
",",
"worldComm",
"=",
"None",
",",
"keyword",
"=",
"\"solid\"",
",",
"subprefix",
"=",
"\"\"",
",",
"modelRep",
"=",
"None",
")",
":",
"if",
"not",
"has_csm",
":",
"raise",
"Exception... | https://github.com/feelpp/feelpp/blob/2d547ed701cc5adb01639185b4a8eb47940367c7/toolboxes/pyfeelpp-toolboxes/feelpp/toolboxes/solid/__init__.py#L21-L39 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/inspect.py | python | isgenerator | (object) | return isinstance(object, types.GeneratorType) | Return true if the object is a generator.
Generator objects provide these attributes:
__iter__ defined to support interation over container
close raises a new GeneratorExit exception inside the
generator to terminate the iteration
gi_code cod... | Return true if the object is a generator. | [
"Return",
"true",
"if",
"the",
"object",
"is",
"a",
"generator",
"."
] | def isgenerator(object):
"""Return true if the object is a generator.
Generator objects provide these attributes:
__iter__ defined to support interation over container
close raises a new GeneratorExit exception inside the
generator to terminate the itera... | [
"def",
"isgenerator",
"(",
"object",
")",
":",
"return",
"isinstance",
"(",
"object",
",",
"types",
".",
"GeneratorType",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/inspect.py#L164-L179 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | buildscripts/resmokelib/setup_multiversion/setup_multiversion.py | python | SetupMultiversion.get_urls | (self, version: str, buildvariant_name: Optional[str] = None) | return EvgURLInfo(urls=urls, evg_version_id=evg_version.version_id) | Return multiversion urls for a given version (as binary version or commit hash or evergreen_version_id). | Return multiversion urls for a given version (as binary version or commit hash or evergreen_version_id). | [
"Return",
"multiversion",
"urls",
"for",
"a",
"given",
"version",
"(",
"as",
"binary",
"version",
"or",
"commit",
"hash",
"or",
"evergreen_version_id",
")",
"."
] | def get_urls(self, version: str, buildvariant_name: Optional[str] = None) -> EvgURLInfo:
"""Return multiversion urls for a given version (as binary version or commit hash or evergreen_version_id)."""
evg_version = evergreen_conn.get_evergreen_version(self.evg_api, version)
if evg_version is Non... | [
"def",
"get_urls",
"(",
"self",
",",
"version",
":",
"str",
",",
"buildvariant_name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"EvgURLInfo",
":",
"evg_version",
"=",
"evergreen_conn",
".",
"get_evergreen_version",
"(",
"self",
".",
"evg_api"... | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/setup_multiversion/setup_multiversion.py#L338-L371 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillTableWidget.py | python | DrillTableWidget.setHorizontalHeaderLabels | (self, labels) | Overrides QTableWidget::setHorizontalHeaderLabels. This methods calls
the base class method and keeps a list of columns label for later use.
Args:
labels (list(str)): columns labels | Overrides QTableWidget::setHorizontalHeaderLabels. This methods calls
the base class method and keeps a list of columns label for later use. | [
"Overrides",
"QTableWidget",
"::",
"setHorizontalHeaderLabels",
".",
"This",
"methods",
"calls",
"the",
"base",
"class",
"method",
"and",
"keeps",
"a",
"list",
"of",
"columns",
"label",
"for",
"later",
"use",
"."
] | def setHorizontalHeaderLabels(self, labels):
"""
Overrides QTableWidget::setHorizontalHeaderLabels. This methods calls
the base class method and keeps a list of columns label for later use.
Args:
labels (list(str)): columns labels
"""
super(DrillTableWidget, ... | [
"def",
"setHorizontalHeaderLabels",
"(",
"self",
",",
"labels",
")",
":",
"super",
"(",
"DrillTableWidget",
",",
"self",
")",
".",
"setHorizontalHeaderLabels",
"(",
"labels",
")",
"self",
".",
"_columns",
"=",
"list",
"(",
")",
"for",
"label",
"in",
"labels"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/drill/view/DrillTableWidget.py#L82-L93 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/ML/NaiveBayes/ClassificationModel.py | python | NaiveBayesClassifier.trainModel | (self) | We will assume at this point that the training examples have been set
We have to estmate the conditional probabilities for each of the (binned) descriptor
component give a outcome (or class). Also the probabilities for each class is estimated | We will assume at this point that the training examples have been set | [
"We",
"will",
"assume",
"at",
"this",
"point",
"that",
"the",
"training",
"examples",
"have",
"been",
"set"
] | def trainModel(self):
""" We will assume at this point that the training examples have been set
We have to estmate the conditional probabilities for each of the (binned) descriptor
component give a outcome (or class). Also the probabilities for each class is estimated
"""
# firs... | [
"def",
"trainModel",
"(",
"self",
")",
":",
"# first estimate the class probabilities",
"n",
"=",
"len",
"(",
"self",
".",
"_trainingExamples",
")",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"_nClasses",
")",
":",
"self",
".",
"_classProbs",
"[",
"i",
"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/ML/NaiveBayes/ClassificationModel.py#L158-L238 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/auibook.py | python | TabTextCtrl.AcceptChanges | (self) | return True | Accepts/refuses the changes made by the user. | Accepts/refuses the changes made by the user. | [
"Accepts",
"/",
"refuses",
"the",
"changes",
"made",
"by",
"the",
"user",
"."
] | def AcceptChanges(self):
""" Accepts/refuses the changes made by the user. """
value = self.GetValue()
notebook = self._owner.GetParent()
if value == self._startValue:
# nothing changed, always accept
# when an item remains unchanged, the owner
# nee... | [
"def",
"AcceptChanges",
"(",
"self",
")",
":",
"value",
"=",
"self",
".",
"GetValue",
"(",
")",
"notebook",
"=",
"self",
".",
"_owner",
".",
"GetParent",
"(",
")",
"if",
"value",
"==",
"self",
".",
"_startValue",
":",
"# nothing changed, always accept",
"#... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/auibook.py#L190-L212 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py | python | TPUClusterResolver.connect | (tpu=None,
zone=None,
project=None) | return resolver | Initializes TPU and returns a TPUClusterResolver.
This API will connect to remote TPU cluster and initialize the TPU
hardwares. Example usage:
>>> resolver = tf.distribute.cluster_resolver.TPUClusterResolver.connect(
... tpu='')
It can be viewed as convenient wrapper of the following code:
... | Initializes TPU and returns a TPUClusterResolver. | [
"Initializes",
"TPU",
"and",
"returns",
"a",
"TPUClusterResolver",
"."
] | def connect(tpu=None,
zone=None,
project=None):
"""Initializes TPU and returns a TPUClusterResolver.
This API will connect to remote TPU cluster and initialize the TPU
hardwares. Example usage:
>>> resolver = tf.distribute.cluster_resolver.TPUClusterResolver.connect(
..... | [
"def",
"connect",
"(",
"tpu",
"=",
"None",
",",
"zone",
"=",
"None",
",",
"project",
"=",
"None",
")",
":",
"resolver",
"=",
"TPUClusterResolver",
"(",
"tpu",
",",
"zone",
",",
"project",
")",
"from",
"tensorflow",
".",
"python",
".",
"eager",
"import"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py#L71-L110 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/operations/_grad_ops.py | python | Conv3DBackpropFilter.__init__ | (self,
out_channel,
kernel_size,
mode=1,
pad_mode="valid",
pad=0,
stride=(1, 1, 1, 1, 1),
dilation=(1, 1, 1, 1, 1),
group=1,
data_format="NCDHW") | Initialize Convolution | Initialize Convolution | [
"Initialize",
"Convolution"
] | def __init__(self,
out_channel,
kernel_size,
mode=1,
pad_mode="valid",
pad=0,
stride=(1, 1, 1, 1, 1),
dilation=(1, 1, 1, 1, 1),
group=1,
data_format="NCDHW"):
... | [
"def",
"__init__",
"(",
"self",
",",
"out_channel",
",",
"kernel_size",
",",
"mode",
"=",
"1",
",",
"pad_mode",
"=",
"\"valid\"",
",",
"pad",
"=",
"0",
",",
"stride",
"=",
"(",
"1",
",",
"1",
",",
"1",
",",
"1",
",",
"1",
")",
",",
"dilation",
... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/_grad_ops.py#L293-L332 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/easy_install.py | python | PthDistributions.remove | (self, dist) | Remove `dist` from the distribution map | Remove `dist` from the distribution map | [
"Remove",
"dist",
"from",
"the",
"distribution",
"map"
] | def remove(self, dist):
"""Remove `dist` from the distribution map"""
while dist.location in self.paths:
self.paths.remove(dist.location)
self.dirty = True
Environment.remove(self, dist) | [
"def",
"remove",
"(",
"self",
",",
"dist",
")",
":",
"while",
"dist",
".",
"location",
"in",
"self",
".",
"paths",
":",
"self",
".",
"paths",
".",
"remove",
"(",
"dist",
".",
"location",
")",
"self",
".",
"dirty",
"=",
"True",
"Environment",
".",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/easy_install.py#L1574-L1579 | ||
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/value_object/read/media/datfile/tech.py | python | EffectBundle.get_data_format_members | (cls, game_version) | return data_format | Return the members in this struct. | Return the members in this struct. | [
"Return",
"the",
"members",
"in",
"this",
"struct",
"."
] | def get_data_format_members(cls, game_version):
"""
Return the members in this struct.
"""
if game_version[0].game_id in ("AOE1DE", "AOE2DE"):
data_format = [
(SKIP, "name_len_debug", StorageType.INT_MEMBER, "uint16_t"),
(READ, "name_len", Stor... | [
"def",
"get_data_format_members",
"(",
"cls",
",",
"game_version",
")",
":",
"if",
"game_version",
"[",
"0",
"]",
".",
"game_id",
"in",
"(",
"\"AOE1DE\"",
",",
"\"AOE2DE\"",
")",
":",
"data_format",
"=",
"[",
"(",
"SKIP",
",",
"\"name_len_debug\"",
",",
"S... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/value_object/read/media/datfile/tech.py#L37-L61 | |
KhronosGroup/SPIR | f33c27876d9f3d5810162b60fa89cc13d2b55725 | bindings/python/clang/cindex.py | python | Token.cursor | (self) | return cursor | The Cursor this Token corresponds to. | The Cursor this Token corresponds to. | [
"The",
"Cursor",
"this",
"Token",
"corresponds",
"to",
"."
] | def cursor(self):
"""The Cursor this Token corresponds to."""
cursor = Cursor()
conf.lib.clang_annotateTokens(self._tu, byref(self), 1, byref(cursor))
return cursor | [
"def",
"cursor",
"(",
"self",
")",
":",
"cursor",
"=",
"Cursor",
"(",
")",
"conf",
".",
"lib",
".",
"clang_annotateTokens",
"(",
"self",
".",
"_tu",
",",
"byref",
"(",
"self",
")",
",",
"1",
",",
"byref",
"(",
"cursor",
")",
")",
"return",
"cursor"... | https://github.com/KhronosGroup/SPIR/blob/f33c27876d9f3d5810162b60fa89cc13d2b55725/bindings/python/clang/cindex.py#L2435-L2441 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/utils/tf_inspect.py | python | isroutine | (object) | return _inspect.isroutine(tf_decorator.unwrap(object)[1]) | TFDecorator-aware replacement for inspect.isroutine. | TFDecorator-aware replacement for inspect.isroutine. | [
"TFDecorator",
"-",
"aware",
"replacement",
"for",
"inspect",
".",
"isroutine",
"."
] | def isroutine(object): # pylint: disable=redefined-builtin
"""TFDecorator-aware replacement for inspect.isroutine."""
return _inspect.isroutine(tf_decorator.unwrap(object)[1]) | [
"def",
"isroutine",
"(",
"object",
")",
":",
"# pylint: disable=redefined-builtin",
"return",
"_inspect",
".",
"isroutine",
"(",
"tf_decorator",
".",
"unwrap",
"(",
"object",
")",
"[",
"1",
"]",
")"
] | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/utils/tf_inspect.py#L395-L397 | |
crosslife/OpenBird | 9e0198a1a2295f03fa1e8676e216e22c9c7d380b | cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py | python | TranslationUnit.__init__ | (self, ptr, index) | Create a TranslationUnit instance.
TranslationUnits should be created using one of the from_* @classmethod
functions above. __init__ is only called internally. | Create a TranslationUnit instance. | [
"Create",
"a",
"TranslationUnit",
"instance",
"."
] | def __init__(self, ptr, index):
"""Create a TranslationUnit instance.
TranslationUnits should be created using one of the from_* @classmethod
functions above. __init__ is only called internally.
"""
assert isinstance(index, Index)
ClangObject.__init__(self, ptr) | [
"def",
"__init__",
"(",
"self",
",",
"ptr",
",",
"index",
")",
":",
"assert",
"isinstance",
"(",
"index",
",",
"Index",
")",
"ClangObject",
".",
"__init__",
"(",
"self",
",",
"ptr",
")"
] | https://github.com/crosslife/OpenBird/blob/9e0198a1a2295f03fa1e8676e216e22c9c7d380b/cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/cindex.py#L2075-L2083 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/client/__init__.py | python | DispatchWithEvents | (clsid, user_event_class) | return EventsProxy(instance) | Create a COM object that can fire events to a user defined class.
clsid -- The ProgID or CLSID of the object to create.
user_event_class -- A Python class object that responds to the events.
This requires makepy support for the COM object being created. If
this support does not exist it will be automatically ... | Create a COM object that can fire events to a user defined class.
clsid -- The ProgID or CLSID of the object to create.
user_event_class -- A Python class object that responds to the events. | [
"Create",
"a",
"COM",
"object",
"that",
"can",
"fire",
"events",
"to",
"a",
"user",
"defined",
"class",
".",
"clsid",
"--",
"The",
"ProgID",
"or",
"CLSID",
"of",
"the",
"object",
"to",
"create",
".",
"user_event_class",
"--",
"A",
"Python",
"class",
"obj... | def DispatchWithEvents(clsid, user_event_class):
"""Create a COM object that can fire events to a user defined class.
clsid -- The ProgID or CLSID of the object to create.
user_event_class -- A Python class object that responds to the events.
This requires makepy support for the COM object being created. If
... | [
"def",
"DispatchWithEvents",
"(",
"clsid",
",",
"user_event_class",
")",
":",
"# Create/Get the object.",
"disp",
"=",
"Dispatch",
"(",
"clsid",
")",
"if",
"not",
"disp",
".",
"__class__",
".",
"__dict__",
".",
"get",
"(",
"\"CLSID\"",
")",
":",
"# Eeek - no m... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32com/client/__init__.py#L205-L276 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/aicpu/dropout_genmask.py | python | _dropout_genmask_aicpu | () | return | DropoutGenMask AiCPU register | DropoutGenMask AiCPU register | [
"DropoutGenMask",
"AiCPU",
"register"
] | def _dropout_genmask_aicpu():
"""DropoutGenMask AiCPU register"""
return | [
"def",
"_dropout_genmask_aicpu",
"(",
")",
":",
"return"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/aicpu/dropout_genmask.py#L30-L32 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/misc_util.py | python | allpath | (name) | return os.path.join(*splitted) | Convert a /-separated pathname to one using the OS's path separator. | Convert a /-separated pathname to one using the OS's path separator. | [
"Convert",
"a",
"/",
"-",
"separated",
"pathname",
"to",
"one",
"using",
"the",
"OS",
"s",
"path",
"separator",
"."
] | def allpath(name):
"Convert a /-separated pathname to one using the OS's path separator."
splitted = name.split('/')
return os.path.join(*splitted) | [
"def",
"allpath",
"(",
"name",
")",
":",
"splitted",
"=",
"name",
".",
"split",
"(",
"'/'",
")",
"return",
"os",
".",
"path",
".",
"join",
"(",
"*",
"splitted",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/misc_util.py#L128-L131 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | build/android/gyp/package_resources.py | python | CheckForMissedConfigs | (apk_path, check_density, languages) | Raises an exception if apk_path contains any unexpected configs. | Raises an exception if apk_path contains any unexpected configs. | [
"Raises",
"an",
"exception",
"if",
"apk_path",
"contains",
"any",
"unexpected",
"configs",
"."
] | def CheckForMissedConfigs(apk_path, check_density, languages):
"""Raises an exception if apk_path contains any unexpected configs."""
triggers = []
if check_density:
triggers.extend(re.compile('-%s' % density) for density in DENSITY_SPLITS)
if languages:
triggers.extend(re.compile(r'-%s\b' % lang) for l... | [
"def",
"CheckForMissedConfigs",
"(",
"apk_path",
",",
"check_density",
",",
"languages",
")",
":",
"triggers",
"=",
"[",
"]",
"if",
"check_density",
":",
"triggers",
".",
"extend",
"(",
"re",
".",
"compile",
"(",
"'-%s'",
"%",
"density",
")",
"for",
"densi... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/build/android/gyp/package_resources.py#L203-L217 | ||
runtimejs/runtime | 0a6e84c30823d35a4548d6634166784260ae7b74 | deps/v8/gypfiles/vs_toolchain.py | python | _GetDesiredVsToolchainHashes | () | Load a list of SHA1s corresponding to the toolchains that we want installed
to build with. | Load a list of SHA1s corresponding to the toolchains that we want installed
to build with. | [
"Load",
"a",
"list",
"of",
"SHA1s",
"corresponding",
"to",
"the",
"toolchains",
"that",
"we",
"want",
"installed",
"to",
"build",
"with",
"."
] | def _GetDesiredVsToolchainHashes():
"""Load a list of SHA1s corresponding to the toolchains that we want installed
to build with."""
if GetVisualStudioVersion() == '2015':
# Update 2.
return ['95ddda401ec5678f15eeed01d2bee08fcbc5ee97']
else:
return ['03a4e939cd325d6bc5216af41b92d02dda1366a6'] | [
"def",
"_GetDesiredVsToolchainHashes",
"(",
")",
":",
"if",
"GetVisualStudioVersion",
"(",
")",
"==",
"'2015'",
":",
"# Update 2.",
"return",
"[",
"'95ddda401ec5678f15eeed01d2bee08fcbc5ee97'",
"]",
"else",
":",
"return",
"[",
"'03a4e939cd325d6bc5216af41b92d02dda1366a6'",
... | https://github.com/runtimejs/runtime/blob/0a6e84c30823d35a4548d6634166784260ae7b74/deps/v8/gypfiles/vs_toolchain.py#L279-L286 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/traitlets/py3/traitlets/traitlets.py | python | Type.validate | (self, obj, value) | Validates that the value is a valid object instance. | Validates that the value is a valid object instance. | [
"Validates",
"that",
"the",
"value",
"is",
"a",
"valid",
"object",
"instance",
"."
] | def validate(self, obj, value):
"""Validates that the value is a valid object instance."""
if isinstance(value, str):
try:
value = self._resolve_string(value)
except ImportError:
raise TraitError("The '%s' trait of %s instance must be a type, but "... | [
"def",
"validate",
"(",
"self",
",",
"obj",
",",
"value",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"try",
":",
"value",
"=",
"self",
".",
"_resolve_string",
"(",
"value",
")",
"except",
"ImportError",
":",
"raise",
"TraitError"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/traitlets.py#L1744-L1758 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py | python | Distribution.egg_name | (self) | return filename | Return what this distribution's standard .egg filename should be | Return what this distribution's standard .egg filename should be | [
"Return",
"what",
"this",
"distribution",
"s",
"standard",
".",
"egg",
"filename",
"should",
"be"
] | def egg_name(self):
"""Return what this distribution's standard .egg filename should be"""
filename = "%s-%s-py%s" % (
to_filename(self.project_name), to_filename(self.version),
self.py_version or PY_MAJOR
)
if self.platform:
filename += '-' + self.pl... | [
"def",
"egg_name",
"(",
"self",
")",
":",
"filename",
"=",
"\"%s-%s-py%s\"",
"%",
"(",
"to_filename",
"(",
"self",
".",
"project_name",
")",
",",
"to_filename",
"(",
"self",
".",
"version",
")",
",",
"self",
".",
"py_version",
"or",
"PY_MAJOR",
")",
"if"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pkg_resources/__init__.py#L2794-L2803 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py | python | CudnnParamsFormatConverter._cu_canonical_to_tf_canonical_single_layer | (self,
cu_weights,
cu_biases,
tf_weights,
tf_biases,
tf_weigths_proj=None) | r"""Transform single layer Cudnn canonicals to tf canonicals.
The elements of cu_weights, cu_biases are laid out in the following format:
-------------------------------------------------------------------------
| gate0 param on inputs | gate0 param on hidden state | gate1 ..........|
-----------------... | r"""Transform single layer Cudnn canonicals to tf canonicals. | [
"r",
"Transform",
"single",
"layer",
"Cudnn",
"canonicals",
"to",
"tf",
"canonicals",
"."
] | def _cu_canonical_to_tf_canonical_single_layer(self,
cu_weights,
cu_biases,
tf_weights,
tf_biases,
... | [
"def",
"_cu_canonical_to_tf_canonical_single_layer",
"(",
"self",
",",
"cu_weights",
",",
"cu_biases",
",",
"tf_weights",
",",
"tf_biases",
",",
"tf_weigths_proj",
"=",
"None",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"Abstract method\"",
")"
] | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L378-L396 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/core/config.py | python | load | (file) | Load the project configuration from the file format.
Args:
file (str): Path of the configuration file to be loaded.
Raises:
RuntimeError: If file is invalid and parsing fails.
Examples:
>>> # Set new default configuration according to values in the configuration file.
>>> ... | Load the project configuration from the file format. | [
"Load",
"the",
"project",
"configuration",
"from",
"the",
"file",
"format",
"."
] | def load(file):
"""
Load the project configuration from the file format.
Args:
file (str): Path of the configuration file to be loaded.
Raises:
RuntimeError: If file is invalid and parsing fails.
Examples:
>>> # Set new default configuration according to values in the conf... | [
"def",
"load",
"(",
"file",
")",
":",
"_config",
".",
"load",
"(",
"file",
")"
] | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/core/config.py#L399-L421 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/socksipy-branch/socks.py | python | wrapmodule | (module) | wrapmodule(module)
Attempts to replace a module's socket library with a SOCKS socket. Must set
a default proxy using setdefaultproxy(...) first.
This will only work on modules that import socket directly into the namespace;
most of the Python Standard Library falls into this category. | wrapmodule(module)
Attempts to replace a module's socket library with a SOCKS socket. Must set
a default proxy using setdefaultproxy(...) first.
This will only work on modules that import socket directly into the namespace;
most of the Python Standard Library falls into this category. | [
"wrapmodule",
"(",
"module",
")",
"Attempts",
"to",
"replace",
"a",
"module",
"s",
"socket",
"library",
"with",
"a",
"SOCKS",
"socket",
".",
"Must",
"set",
"a",
"default",
"proxy",
"using",
"setdefaultproxy",
"(",
"...",
")",
"first",
".",
"This",
"will",
... | def wrapmodule(module):
"""wrapmodule(module)
Attempts to replace a module's socket library with a SOCKS socket. Must set
a default proxy using setdefaultproxy(...) first.
This will only work on modules that import socket directly into the namespace;
most of the Python Standard Library falls into th... | [
"def",
"wrapmodule",
"(",
"module",
")",
":",
"if",
"_defaultproxy",
"!=",
"None",
":",
"module",
".",
"socket",
".",
"socket",
"=",
"socksocket",
"else",
":",
"raise",
"GeneralProxyError",
"(",
"(",
"4",
",",
"\"no proxy specified\"",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/socksipy-branch/socks.py#L101-L111 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | SystemOptions.SetOption | (*args, **kwargs) | return _misc_.SystemOptions_SetOption(*args, **kwargs) | SetOption(String name, String value) | SetOption(String name, String value) | [
"SetOption",
"(",
"String",
"name",
"String",
"value",
")"
] | def SetOption(*args, **kwargs):
"""SetOption(String name, String value)"""
return _misc_.SystemOptions_SetOption(*args, **kwargs) | [
"def",
"SetOption",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"SystemOptions_SetOption",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L221-L223 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/distutils/cygwinccompiler.py | python | CygwinCCompiler.object_filenames | (self, source_filenames, strip_dir=0, output_dir='') | return obj_names | Adds supports for rc and res files. | Adds supports for rc and res files. | [
"Adds",
"supports",
"for",
"rc",
"and",
"res",
"files",
"."
] | def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
"""Adds supports for rc and res files."""
if output_dir is None:
output_dir = ''
obj_names = []
for src_name in source_filenames:
# use normcase to make sure '.rc' is really '.rc' and not '.... | [
"def",
"object_filenames",
"(",
"self",
",",
"source_filenames",
",",
"strip_dir",
"=",
"0",
",",
"output_dir",
"=",
"''",
")",
":",
"if",
"output_dir",
"is",
"None",
":",
"output_dir",
"=",
"''",
"obj_names",
"=",
"[",
"]",
"for",
"src_name",
"in",
"sou... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/distutils/cygwinccompiler.py#L250-L270 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Menu.tk_popup | (self, x, y, entry="") | Post the menu at position X,Y with entry ENTRY. | Post the menu at position X,Y with entry ENTRY. | [
"Post",
"the",
"menu",
"at",
"position",
"X",
"Y",
"with",
"entry",
"ENTRY",
"."
] | def tk_popup(self, x, y, entry=""):
"""Post the menu at position X,Y with entry ENTRY."""
self.tk.call('tk_popup', self._w, x, y, entry) | [
"def",
"tk_popup",
"(",
"self",
",",
"x",
",",
"y",
",",
"entry",
"=",
"\"\"",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"'tk_popup'",
",",
"self",
".",
"_w",
",",
"x",
",",
"y",
",",
"entry",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2665-L2667 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.GetItemSpacing | (self, isSmall=False) | return (isSmall and [self._small_spacing] or [self._normal_spacing])[0] | Returns the spacing between item texts and icons, in pixels.
:param `isSmall`: ``True`` if using a ``wx.IMAGE_LIST_SMALL`` image list,
``False`` if using a ``wx.IMAGE_LIST_NORMAL`` image list. | Returns the spacing between item texts and icons, in pixels. | [
"Returns",
"the",
"spacing",
"between",
"item",
"texts",
"and",
"icons",
"in",
"pixels",
"."
] | def GetItemSpacing(self, isSmall=False):
"""
Returns the spacing between item texts and icons, in pixels.
:param `isSmall`: ``True`` if using a ``wx.IMAGE_LIST_SMALL`` image list,
``False`` if using a ``wx.IMAGE_LIST_NORMAL`` image list.
"""
return (isSmall and [self._... | [
"def",
"GetItemSpacing",
"(",
"self",
",",
"isSmall",
"=",
"False",
")",
":",
"return",
"(",
"isSmall",
"and",
"[",
"self",
".",
"_small_spacing",
"]",
"or",
"[",
"self",
".",
"_normal_spacing",
"]",
")",
"[",
"0",
"]"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L8592-L8600 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/inspect.py | python | ismodule | (object) | return isinstance(object, types.ModuleType) | Return true if the object is a module.
Module objects provide these attributes:
__doc__ documentation string
__file__ filename (missing for built-in modules) | Return true if the object is a module. | [
"Return",
"true",
"if",
"the",
"object",
"is",
"a",
"module",
"."
] | def ismodule(object):
"""Return true if the object is a module.
Module objects provide these attributes:
__doc__ documentation string
__file__ filename (missing for built-in modules)"""
return isinstance(object, types.ModuleType) | [
"def",
"ismodule",
"(",
"object",
")",
":",
"return",
"isinstance",
"(",
"object",
",",
"types",
".",
"ModuleType",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/inspect.py#L51-L57 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | TreeItemAttr.HasFont | (self) | return self._font != wx.NullFont | Returns whether the attribute has font.
:return: ``True`` if the font attribute has been set, ``False`` otherwise. | Returns whether the attribute has font. | [
"Returns",
"whether",
"the",
"attribute",
"has",
"font",
"."
] | def HasFont(self):
"""
Returns whether the attribute has font.
:return: ``True`` if the font attribute has been set, ``False`` otherwise.
"""
return self._font != wx.NullFont | [
"def",
"HasFont",
"(",
"self",
")",
":",
"return",
"self",
".",
"_font",
"!=",
"wx",
".",
"NullFont"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L925-L932 | |
yuxng/PoseCNN | 9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04 | lib/gt_synthesize_layer/layer.py | python | GtSynthesizeLayer.forward | (self, iter) | return blobs | Get blobs and copy them into this layer's top blob vector. | Get blobs and copy them into this layer's top blob vector. | [
"Get",
"blobs",
"and",
"copy",
"them",
"into",
"this",
"layer",
"s",
"top",
"blob",
"vector",
"."
] | def forward(self, iter):
"""Get blobs and copy them into this layer's top blob vector."""
blobs = self._get_next_minibatch(iter)
return blobs | [
"def",
"forward",
"(",
"self",
",",
"iter",
")",
":",
"blobs",
"=",
"self",
".",
"_get_next_minibatch",
"(",
"iter",
")",
"return",
"blobs"
] | https://github.com/yuxng/PoseCNN/blob/9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04/lib/gt_synthesize_layer/layer.py#L115-L119 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | tools/symsrc/pefile.py | python | PE.retrieve_flags | (self, flag_dict, flag_filter) | return [(f[0], f[1]) for f in flag_dict.items() if
isinstance(f[0], str) and f[0].startswith(flag_filter)] | Read the flags from a dictionary and return them in a usable form.
Will return a list of (flag, value) for all flags in "flag_dict"
matching the filter "flag_filter". | Read the flags from a dictionary and return them in a usable form.
Will return a list of (flag, value) for all flags in "flag_dict"
matching the filter "flag_filter". | [
"Read",
"the",
"flags",
"from",
"a",
"dictionary",
"and",
"return",
"them",
"in",
"a",
"usable",
"form",
".",
"Will",
"return",
"a",
"list",
"of",
"(",
"flag",
"value",
")",
"for",
"all",
"flags",
"in",
"flag_dict",
"matching",
"the",
"filter",
"flag_fil... | def retrieve_flags(self, flag_dict, flag_filter):
"""Read the flags from a dictionary and return them in a usable form.
Will return a list of (flag, value) for all flags in "flag_dict"
matching the filter "flag_filter".
"""
return [(f[0], f[1]) for f in flag_dic... | [
"def",
"retrieve_flags",
"(",
"self",
",",
"flag_dict",
",",
"flag_filter",
")",
":",
"return",
"[",
"(",
"f",
"[",
"0",
"]",
",",
"f",
"[",
"1",
"]",
")",
"for",
"f",
"in",
"flag_dict",
".",
"items",
"(",
")",
"if",
"isinstance",
"(",
"f",
"[",
... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/symsrc/pefile.py#L1783-L1791 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/gradients_util.py | python | _MaybeCaptured | (t) | return t | If t is a captured value placeholder, returns the original captured value.
Args:
t: Tensor
Returns:
A tensor, potentially from a different Graph/FuncGraph. | If t is a captured value placeholder, returns the original captured value. | [
"If",
"t",
"is",
"a",
"captured",
"value",
"placeholder",
"returns",
"the",
"original",
"captured",
"value",
"."
] | def _MaybeCaptured(t):
"""If t is a captured value placeholder, returns the original captured value.
Args:
t: Tensor
Returns:
A tensor, potentially from a different Graph/FuncGraph.
"""
# pylint: disable=protected-access
if (not isinstance(t, ops.EagerTensor) and
_IsFunction(t.op.graph) and ... | [
"def",
"_MaybeCaptured",
"(",
"t",
")",
":",
"# pylint: disable=protected-access",
"if",
"(",
"not",
"isinstance",
"(",
"t",
",",
"ops",
".",
"EagerTensor",
")",
"and",
"_IsFunction",
"(",
"t",
".",
"op",
".",
"graph",
")",
"and",
"t",
".",
"op",
".",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/gradients_util.py#L409-L425 | |
rapidsai/cudf | d5b2448fc69f17509304d594f029d0df56984962 | python/cudf/cudf/core/multiindex.py | python | MultiIndex._level_index_from_level | (self, level) | Return level index from given level name or index | Return level index from given level name or index | [
"Return",
"level",
"index",
"from",
"given",
"level",
"name",
"or",
"index"
] | def _level_index_from_level(self, level):
"""
Return level index from given level name or index
"""
try:
return self.names.index(level)
except ValueError:
if not is_integer(level):
raise KeyError(f"Level {level} not found")
if l... | [
"def",
"_level_index_from_level",
"(",
"self",
",",
"level",
")",
":",
"try",
":",
"return",
"self",
".",
"names",
".",
"index",
"(",
"level",
")",
"except",
"ValueError",
":",
"if",
"not",
"is_integer",
"(",
"level",
")",
":",
"raise",
"KeyError",
"(",
... | https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/multiindex.py#L1519-L1535 | ||
RLBot/RLBot | 34332b12cf158b3ef8dbf174ae67c53683368a9d | src/main/python/rlbot/parsing/custom_config.py | python | ConfigObject.get_header | (self, header_name) | return self.add_header_name(header_name) | Returns a header with that name, creates it if it does not exist. | Returns a header with that name, creates it if it does not exist. | [
"Returns",
"a",
"header",
"with",
"that",
"name",
"creates",
"it",
"if",
"it",
"does",
"not",
"exist",
"."
] | def get_header(self, header_name):
"""
Returns a header with that name, creates it if it does not exist.
"""
if header_name in self.headers:
return self.headers[header_name]
return self.add_header_name(header_name) | [
"def",
"get_header",
"(",
"self",
",",
"header_name",
")",
":",
"if",
"header_name",
"in",
"self",
".",
"headers",
":",
"return",
"self",
".",
"headers",
"[",
"header_name",
"]",
"return",
"self",
".",
"add_header_name",
"(",
"header_name",
")"
] | https://github.com/RLBot/RLBot/blob/34332b12cf158b3ef8dbf174ae67c53683368a9d/src/main/python/rlbot/parsing/custom_config.py#L47-L53 | |
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/python/ops/rnn_cell.py | python | EmbeddingWrapper.__call__ | (self, inputs, state, scope=None) | return self._cell(embedded, state) | Run the cell on embedded inputs. | Run the cell on embedded inputs. | [
"Run",
"the",
"cell",
"on",
"embedded",
"inputs",
"."
] | def __call__(self, inputs, state, scope=None):
"""Run the cell on embedded inputs."""
with vs.variable_scope(scope or type(self).__name__): # "EmbeddingWrapper"
with ops.device("/cpu:0"):
if self._initializer:
initializer = self._initializer
elif vs.get_variable_scope().initiali... | [
"def",
"__call__",
"(",
"self",
",",
"inputs",
",",
"state",
",",
"scope",
"=",
"None",
")",
":",
"with",
"vs",
".",
"variable_scope",
"(",
"scope",
"or",
"type",
"(",
"self",
")",
".",
"__name__",
")",
":",
"# \"EmbeddingWrapper\"",
"with",
"ops",
"."... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/rnn_cell.py#L732-L756 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/tf_asymmetry_fitting_context.py | python | TFAsymmetryFittingContext.tf_asymmetry_single_functions | (self) | return self._tf_asymmetry_single_functions | Returns the fit functions used for single TF Asymmetry fitting. Each function corresponds to a dataset. | Returns the fit functions used for single TF Asymmetry fitting. Each function corresponds to a dataset. | [
"Returns",
"the",
"fit",
"functions",
"used",
"for",
"single",
"TF",
"Asymmetry",
"fitting",
".",
"Each",
"function",
"corresponds",
"to",
"a",
"dataset",
"."
] | def tf_asymmetry_single_functions(self) -> list:
"""Returns the fit functions used for single TF Asymmetry fitting. Each function corresponds to a dataset."""
return self._tf_asymmetry_single_functions | [
"def",
"tf_asymmetry_single_functions",
"(",
"self",
")",
"->",
"list",
":",
"return",
"self",
".",
"_tf_asymmetry_single_functions"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/contexts/fitting_contexts/tf_asymmetry_fitting_context.py#L87-L89 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py | python | Tk.__getattr__ | (self, attr) | return getattr(self.tk, attr) | Delegate attribute access to the interpreter object | Delegate attribute access to the interpreter object | [
"Delegate",
"attribute",
"access",
"to",
"the",
"interpreter",
"object"
] | def __getattr__(self, attr):
"Delegate attribute access to the interpreter object"
return getattr(self.tk, attr) | [
"def",
"__getattr__",
"(",
"self",
",",
"attr",
")",
":",
"return",
"getattr",
"(",
"self",
".",
"tk",
",",
"attr",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L2099-L2101 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/layer1.py | python | Layer1.scan | (self, table_name, scan_filter=None,
attributes_to_get=None, limit=None,
exclusive_start_key=None, object_hook=None, count=False) | return self.make_request('Scan', json_input, object_hook=object_hook) | Perform a scan of DynamoDB. This version is currently punting
and expecting you to provide a full and correct JSON body
which is passed as is to DynamoDB.
:type table_name: str
:param table_name: The name of the table to scan.
:type scan_filter: dict
:param scan_filter... | Perform a scan of DynamoDB. This version is currently punting
and expecting you to provide a full and correct JSON body
which is passed as is to DynamoDB. | [
"Perform",
"a",
"scan",
"of",
"DynamoDB",
".",
"This",
"version",
"is",
"currently",
"punting",
"and",
"expecting",
"you",
"to",
"provide",
"a",
"full",
"and",
"correct",
"JSON",
"body",
"which",
"is",
"passed",
"as",
"is",
"to",
"DynamoDB",
"."
] | def scan(self, table_name, scan_filter=None,
attributes_to_get=None, limit=None,
exclusive_start_key=None, object_hook=None, count=False):
"""
Perform a scan of DynamoDB. This version is currently punting
and expecting you to provide a full and correct JSON body
... | [
"def",
"scan",
"(",
"self",
",",
"table_name",
",",
"scan_filter",
"=",
"None",
",",
"attributes_to_get",
"=",
"None",
",",
"limit",
"=",
"None",
",",
"exclusive_start_key",
"=",
"None",
",",
"object_hook",
"=",
"None",
",",
"count",
"=",
"False",
")",
"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/layer1.py#L532-L577 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/interpolate/_cubic.py | python | pchip_interpolate | (xi, yi, x, der=0, axis=0) | Convenience function for pchip interpolation.
xi and yi are arrays of values used to approximate some function f,
with ``yi = f(xi)``. The interpolant uses monotonic cubic splines
to find the value of new points x and the derivatives there.
See `PchipInterpolator` for details.
Parameters
----... | Convenience function for pchip interpolation.
xi and yi are arrays of values used to approximate some function f,
with ``yi = f(xi)``. The interpolant uses monotonic cubic splines
to find the value of new points x and the derivatives there. | [
"Convenience",
"function",
"for",
"pchip",
"interpolation",
".",
"xi",
"and",
"yi",
"are",
"arrays",
"of",
"values",
"used",
"to",
"approximate",
"some",
"function",
"f",
"with",
"yi",
"=",
"f",
"(",
"xi",
")",
".",
"The",
"interpolant",
"uses",
"monotonic... | def pchip_interpolate(xi, yi, x, der=0, axis=0):
"""
Convenience function for pchip interpolation.
xi and yi are arrays of values used to approximate some function f,
with ``yi = f(xi)``. The interpolant uses monotonic cubic splines
to find the value of new points x and the derivatives there.
... | [
"def",
"pchip_interpolate",
"(",
"xi",
",",
"yi",
",",
"x",
",",
"der",
"=",
"0",
",",
"axis",
"=",
"0",
")",
":",
"P",
"=",
"PchipInterpolator",
"(",
"xi",
",",
"yi",
",",
"axis",
"=",
"axis",
")",
"if",
"der",
"==",
"0",
":",
"return",
"P",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/interpolate/_cubic.py#L179-L221 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/warnings.py | python | filterwarnings | (action, message="", category=Warning, module="", lineno=0,
append=0) | Insert an entry into the list of warnings filters (at the front).
'action' -- one of "error", "ignore", "always", "default", "module",
or "once"
'message' -- a regex that the warning message must match
'category' -- a class that the warning must be a subclass of
'module' -- a regex that... | Insert an entry into the list of warnings filters (at the front). | [
"Insert",
"an",
"entry",
"into",
"the",
"list",
"of",
"warnings",
"filters",
"(",
"at",
"the",
"front",
")",
"."
] | def filterwarnings(action, message="", category=Warning, module="", lineno=0,
append=0):
"""Insert an entry into the list of warnings filters (at the front).
'action' -- one of "error", "ignore", "always", "default", "module",
or "once"
'message' -- a regex that the warni... | [
"def",
"filterwarnings",
"(",
"action",
",",
"message",
"=",
"\"\"",
",",
"category",
"=",
"Warning",
",",
"module",
"=",
"\"\"",
",",
"lineno",
"=",
"0",
",",
"append",
"=",
"0",
")",
":",
"import",
"re",
"assert",
"action",
"in",
"(",
"\"error\"",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/warnings.py#L45-L72 | ||
yue/yue | 619d62c191b13c51c01be451dc48917c34a5aefc | building/tools/cpplint.py | python | CheckIncludeLine | (filename, clean_lines, linenum, include_state, error) | Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage must be put here.
Args:
filename: The name of the current file.
clean_l... | Check rules that are applicable to #include lines. | [
"Check",
"rules",
"that",
"are",
"applicable",
"to",
"#include",
"lines",
"."
] | def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
"""Check rules that are applicable to #include lines.
Strings on #include lines are NOT removed from elided line, to make
certain tasks easier. However, to prevent false positives, checks
applicable to #include lines in CheckLanguage m... | [
"def",
"CheckIncludeLine",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"include_state",
",",
"error",
")",
":",
"fileinfo",
"=",
"FileInfo",
"(",
"filename",
")",
"line",
"=",
"clean_lines",
".",
"lines",
"[",
"linenum",
"]",
"# \"include\" shoul... | https://github.com/yue/yue/blob/619d62c191b13c51c01be451dc48917c34a5aefc/building/tools/cpplint.py#L4510-L4580 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/grid.py | python | GridCellAttr.Clone | (*args, **kwargs) | return _grid.GridCellAttr_Clone(*args, **kwargs) | Clone(self) -> GridCellAttr | Clone(self) -> GridCellAttr | [
"Clone",
"(",
"self",
")",
"-",
">",
"GridCellAttr"
] | def Clone(*args, **kwargs):
"""Clone(self) -> GridCellAttr"""
return _grid.GridCellAttr_Clone(*args, **kwargs) | [
"def",
"Clone",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellAttr_Clone",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L535-L537 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/plotting/_core.py | python | PlotAccessor.area | (self, x=None, y=None, **kwargs) | return self(kind="area", x=x, y=y, **kwargs) | Draw a stacked area plot.
An area plot displays quantitative data visually.
This function wraps the matplotlib area function.
Parameters
----------
x : label or position, optional
Coordinates for the X axis. By default uses the index.
y : label or position, ... | Draw a stacked area plot. | [
"Draw",
"a",
"stacked",
"area",
"plot",
"."
] | def area(self, x=None, y=None, **kwargs):
"""
Draw a stacked area plot.
An area plot displays quantitative data visually.
This function wraps the matplotlib area function.
Parameters
----------
x : label or position, optional
Coordinates for the X ax... | [
"def",
"area",
"(",
"self",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
"(",
"kind",
"=",
"\"area\"",
",",
"x",
"=",
"x",
",",
"y",
"=",
"y",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/plotting/_core.py#L1425-L1496 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/dataview.py | python | DataViewItem.__hash__ | (*args, **kwargs) | return _dataview.DataViewItem___hash__(*args, **kwargs) | __hash__(self) -> long | __hash__(self) -> long | [
"__hash__",
"(",
"self",
")",
"-",
">",
"long"
] | def __hash__(*args, **kwargs):
"""__hash__(self) -> long"""
return _dataview.DataViewItem___hash__(*args, **kwargs) | [
"def",
"__hash__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewItem___hash__",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/dataview.py#L113-L115 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | driver/python/bson/objectid.py | python | ObjectId.from_datetime | (cls, generation_time) | return cls(oid) | Create a dummy ObjectId instance with a specific generation time.
This method is useful for doing range queries on a field
containing :class:`ObjectId` instances.
.. warning::
It is not safe to insert a document containing an ObjectId
generated using this method. This met... | Create a dummy ObjectId instance with a specific generation time. | [
"Create",
"a",
"dummy",
"ObjectId",
"instance",
"with",
"a",
"specific",
"generation",
"time",
"."
] | def from_datetime(cls, generation_time):
"""Create a dummy ObjectId instance with a specific generation time.
This method is useful for doing range queries on a field
containing :class:`ObjectId` instances.
.. warning::
It is not safe to insert a document containing an Objec... | [
"def",
"from_datetime",
"(",
"cls",
",",
"generation_time",
")",
":",
"if",
"generation_time",
".",
"utcoffset",
"(",
")",
"is",
"not",
"None",
":",
"generation_time",
"=",
"generation_time",
"-",
"generation_time",
".",
"utcoffset",
"(",
")",
"ts",
"=",
"ca... | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/bson/objectid.py#L99-L136 | |
SequoiaDB/SequoiaDB | 2894ed7e5bd6fe57330afc900cf76d0ff0df9f64 | tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py | python | uCSIsMyanmar | (code) | return ret | Check whether the character is part of Myanmar UCS Block | Check whether the character is part of Myanmar UCS Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"Myanmar",
"UCS",
"Block"
] | def uCSIsMyanmar(code):
"""Check whether the character is part of Myanmar UCS Block """
ret = libxml2mod.xmlUCSIsMyanmar(code)
return ret | [
"def",
"uCSIsMyanmar",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsMyanmar",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2731-L2734 | |
TimoSaemann/caffe-segnet-cudnn5 | abcf30dca449245e101bf4ced519f716177f0885 | scripts/cpp_lint.py | python | _BlockInfo.CheckEnd | (self, filename, clean_lines, linenum, error) | Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
error: The function to... | Run checks that applies to text after the closing brace. | [
"Run",
"checks",
"that",
"applies",
"to",
"text",
"after",
"the",
"closing",
"brace",
"."
] | def CheckEnd(self, filename, clean_lines, linenum, error):
"""Run checks that applies to text after the closing brace.
This is mostly used for checking end of namespace comments.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
line... | [
"def",
"CheckEnd",
"(",
"self",
",",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"pass"
] | https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/scripts/cpp_lint.py#L1778-L1789 | ||
msftguy/ssh-rd | a5f3a79daeac5844edebf01916c9613563f1c390 | _3rd/boost_1_48_0/tools/build/v2/build/targets.py | python | BasicTarget.create_subvariant | (self, root_targets, all_targets,
build_request, sources,
rproperties, usage_requirements) | return s | Creates a new subvariant-dg instances for 'targets'
- 'root-targets' the virtual targets will be returned to dependents
- 'all-targets' all virtual
targets created while building this main target
- 'build-request' is property-set instance with
requested build propertie... | Creates a new subvariant-dg instances for 'targets'
- 'root-targets' the virtual targets will be returned to dependents
- 'all-targets' all virtual
targets created while building this main target
- 'build-request' is property-set instance with
requested build propertie... | [
"Creates",
"a",
"new",
"subvariant",
"-",
"dg",
"instances",
"for",
"targets",
"-",
"root",
"-",
"targets",
"the",
"virtual",
"targets",
"will",
"be",
"returned",
"to",
"dependents",
"-",
"all",
"-",
"targets",
"all",
"virtual",
"targets",
"created",
"while"... | def create_subvariant (self, root_targets, all_targets,
build_request, sources,
rproperties, usage_requirements):
"""Creates a new subvariant-dg instances for 'targets'
- 'root-targets' the virtual targets will be returned to dependents
- '... | [
"def",
"create_subvariant",
"(",
"self",
",",
"root_targets",
",",
"all_targets",
",",
"build_request",
",",
"sources",
",",
"rproperties",
",",
"usage_requirements",
")",
":",
"for",
"e",
"in",
"root_targets",
":",
"e",
".",
"root",
"(",
"True",
")",
"s",
... | https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/targets.py#L1248-L1268 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PGProperty.IsEnabled | (*args, **kwargs) | return _propgrid.PGProperty_IsEnabled(*args, **kwargs) | IsEnabled(self) -> bool | IsEnabled(self) -> bool | [
"IsEnabled",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsEnabled(*args, **kwargs):
"""IsEnabled(self) -> bool"""
return _propgrid.PGProperty_IsEnabled(*args, **kwargs) | [
"def",
"IsEnabled",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGProperty_IsEnabled",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L662-L664 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.