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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/robotsim.py | python | ContactQueryResult.__init__ | (self) | __init__(ContactQueryResult self) -> ContactQueryResult
The result from a contact query of :class:`~klampt.Geometry3D`. The number of
contacts n is variable.
Attributes:
depths (list of n floats): penetration depths for each contact point.
The depth is measur... | __init__(ContactQueryResult self) -> ContactQueryResult | [
"__init__",
"(",
"ContactQueryResult",
"self",
")",
"-",
">",
"ContactQueryResult"
] | def __init__(self):
"""
__init__(ContactQueryResult self) -> ContactQueryResult
The result from a contact query of :class:`~klampt.Geometry3D`. The number of
contacts n is variable.
Attributes:
depths (list of n floats): penetration depths for each contact po... | [
"def",
"__init__",
"(",
"self",
")",
":",
"this",
"=",
"_robotsim",
".",
"new_ContactQueryResult",
"(",
")",
"try",
":",
"self",
".",
"this",
".",
"append",
"(",
"this",
")",
"except",
"Exception",
":",
"self",
".",
"this",
"=",
"this"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/robotsim.py#L1794-L1827 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextBuffer.GetStyleStackSize | (*args, **kwargs) | return _richtext.RichTextBuffer_GetStyleStackSize(*args, **kwargs) | GetStyleStackSize(self) -> size_t | GetStyleStackSize(self) -> size_t | [
"GetStyleStackSize",
"(",
"self",
")",
"-",
">",
"size_t"
] | def GetStyleStackSize(*args, **kwargs):
"""GetStyleStackSize(self) -> size_t"""
return _richtext.RichTextBuffer_GetStyleStackSize(*args, **kwargs) | [
"def",
"GetStyleStackSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextBuffer_GetStyleStackSize",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L2329-L2331 | |
naver/sling | 5671cd445a2caae0b4dd0332299e4cfede05062c | webkit/Tools/Scripts/webkitpy/common/system/filesystem.py | python | FileSystem.files_under | (self, path, dirs_to_skip=[], file_filter=None) | return files | Return the list of all files under the given path in topdown order.
Args:
dirs_to_skip: a list of directories to skip over during the
traversal (e.g., .svn, resources, etc.)
file_filter: if not None, the filter will be invoked
with the filesystem object a... | Return the list of all files under the given path in topdown order. | [
"Return",
"the",
"list",
"of",
"all",
"files",
"under",
"the",
"given",
"path",
"in",
"topdown",
"order",
"."
] | def files_under(self, path, dirs_to_skip=[], file_filter=None):
"""Return the list of all files under the given path in topdown order.
Args:
dirs_to_skip: a list of directories to skip over during the
traversal (e.g., .svn, resources, etc.)
file_filter: if not No... | [
"def",
"files_under",
"(",
"self",
",",
"path",
",",
"dirs_to_skip",
"=",
"[",
"]",
",",
"file_filter",
"=",
"None",
")",
":",
"def",
"filter_all",
"(",
"fs",
",",
"dirpath",
",",
"basename",
")",
":",
"return",
"True",
"file_filter",
"=",
"file_filter",... | https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/common/system/filesystem.py#L108-L140 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | catboost/python-package/catboost/metrics.py | python | BuiltinMetric.eval | (self,
label,
approx,
weight=None,
group_id=None,
group_weight=None,
subgroup_id=None,
pairs=None,
thread_count=-1) | return _catboost._eval_metric_util(
label, approx, str(self), weight, group_id, group_weight, subgroup_id, pairs, thread_count
) | Evaluate the metric with raw approxes and labels.
Parameters
----------
label : list or numpy.ndarrays or pandas.DataFrame or pandas.Series
Object labels.
approx : list or numpy.ndarrays or pandas.DataFrame or pandas.Series
Object approxes.
weight : lis... | Evaluate the metric with raw approxes and labels. | [
"Evaluate",
"the",
"metric",
"with",
"raw",
"approxes",
"and",
"labels",
"."
] | def eval(self,
label,
approx,
weight=None,
group_id=None,
group_weight=None,
subgroup_id=None,
pairs=None,
thread_count=-1):
"""
Evaluate the metric with raw approxes and labels.
Parameters
-... | [
"def",
"eval",
"(",
"self",
",",
"label",
",",
"approx",
",",
"weight",
"=",
"None",
",",
"group_id",
"=",
"None",
",",
"group_weight",
"=",
"None",
",",
"subgroup_id",
"=",
"None",
",",
"pairs",
"=",
"None",
",",
"thread_count",
"=",
"-",
"1",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/catboost/python-package/catboost/metrics.py#L56-L113 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/stata.py | python | StataStrLWriter.generate_blob | (self, gso_table) | return bio.read() | Generates the binary blob of GSOs that is written to the dta file.
Parameters
----------
gso_table : dict
Ordered dictionary (str, vo)
Returns
-------
gso : bytes
Binary content of dta file to be placed between strl tags
Notes
--... | Generates the binary blob of GSOs that is written to the dta file. | [
"Generates",
"the",
"binary",
"blob",
"of",
"GSOs",
"that",
"is",
"written",
"to",
"the",
"dta",
"file",
"."
] | def generate_blob(self, gso_table):
"""
Generates the binary blob of GSOs that is written to the dta file.
Parameters
----------
gso_table : dict
Ordered dictionary (str, vo)
Returns
-------
gso : bytes
Binary content of dta file ... | [
"def",
"generate_blob",
"(",
"self",
",",
"gso_table",
")",
":",
"# Format information",
"# Length includes null term",
"# 117",
"# GSOvvvvooootllllxxxxxxxxxxxxxxx...x",
"# 3 u4 u4 u1 u4 string + null term",
"#",
"# 118, 119",
"# GSOvvvvooooooootllllxxxxxxxxxxxxxxx...x",
"# 3 u... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/io/stata.py#L2750-L2812 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aquabutton.py | python | AquaButton.DoGetBestSize | (self) | return wx.Size(retWidth+constant, retHeight+constant) | Overridden base class virtual. Determines the best size of the
button based on the label and bezel size.
:return: An instance of :class:`Size`.
:note: Overridden from :class:`PyControl`. | Overridden base class virtual. Determines the best size of the
button based on the label and bezel size. | [
"Overridden",
"base",
"class",
"virtual",
".",
"Determines",
"the",
"best",
"size",
"of",
"the",
"button",
"based",
"on",
"the",
"label",
"and",
"bezel",
"size",
"."
] | def DoGetBestSize(self):
"""
Overridden base class virtual. Determines the best size of the
button based on the label and bezel size.
:return: An instance of :class:`Size`.
:note: Overridden from :class:`PyControl`.
"""
label = self.GetLabel()
i... | [
"def",
"DoGetBestSize",
"(",
"self",
")",
":",
"label",
"=",
"self",
".",
"GetLabel",
"(",
")",
"if",
"not",
"label",
":",
"return",
"wx",
".",
"Size",
"(",
"112",
",",
"48",
")",
"dc",
"=",
"wx",
".",
"ClientDC",
"(",
"self",
")",
"dc",
".",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aquabutton.py#L645-L671 | |
SFTtech/openage | d6a08c53c48dc1e157807471df92197f6ca9e04d | openage/convert/tool/subtool/acquire_sourcedir.py | python | set_custom_wineprefix | () | Allow the customization of the WINEPREFIX environment variable. | Allow the customization of the WINEPREFIX environment variable. | [
"Allow",
"the",
"customization",
"of",
"the",
"WINEPREFIX",
"environment",
"variable",
"."
] | def set_custom_wineprefix():
"""
Allow the customization of the WINEPREFIX environment variable.
"""
print("The WINEPREFIX is a separate 'container' for windows "
"software installations.")
current_wineprefix = os.environ.get("WINEPREFIX")
if current_wineprefix:
print(f"Curre... | [
"def",
"set_custom_wineprefix",
"(",
")",
":",
"print",
"(",
"\"The WINEPREFIX is a separate 'container' for windows \"",
"\"software installations.\"",
")",
"current_wineprefix",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"\"WINEPREFIX\"",
")",
"if",
"current_wineprefix",... | https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/tool/subtool/acquire_sourcedir.py#L86-L116 | ||
mavlink/mavros | a32232d57a5e91abf6737e454d4199cae29b369c | mavros/mavros/cmd/system.py | python | rate | (
ctx,
client,
all,
raw_sensors,
ext_status,
rc_channels,
raw_controller,
position,
extra1,
extra2,
extra3,
stream_id,
) | Set stream rate. | Set stream rate. | [
"Set",
"stream",
"rate",
"."
] | def rate(
ctx,
client,
all,
raw_sensors,
ext_status,
rc_channels,
raw_controller,
position,
extra1,
extra2,
extra3,
stream_id,
):
"""Set stream rate."""
_ = 1 # yapf
def set_rate(rate_arg: typing.Optional[int], id_: int):
if rate_arg is None:
... | [
"def",
"rate",
"(",
"ctx",
",",
"client",
",",
"all",
",",
"raw_sensors",
",",
"ext_status",
",",
"rc_channels",
",",
"raw_controller",
",",
"position",
",",
"extra1",
",",
"extra2",
",",
"extra3",
",",
"stream_id",
",",
")",
":",
"_",
"=",
"1",
"# yap... | https://github.com/mavlink/mavros/blob/a32232d57a5e91abf6737e454d4199cae29b369c/mavros/mavros/cmd/system.py#L107-L146 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/wppm.py | python | Distribution.find_package | (self, name) | Find installed package | Find installed package | [
"Find",
"installed",
"package"
] | def find_package(self, name):
"""Find installed package"""
for pack in self.get_installed_packages():
if pack.name == name:
return pack | [
"def",
"find_package",
"(",
"self",
",",
"name",
")",
":",
"for",
"pack",
"in",
"self",
".",
"get_installed_packages",
"(",
")",
":",
"if",
"pack",
".",
"name",
"==",
"name",
":",
"return",
"pack"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/winpython/wppm.py#L305-L309 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/Paste/paste/auth/form.py | python | make_form | (app, global_conf, realm, authfunc, **kw) | return AuthFormHandler(app, authfunc, template) | Grant access via form authentication
Config looks like this::
[filter:grant]
use = egg:Paste#auth_form
realm=myrealm
authfunc=somepackage.somemodule:somefunction | Grant access via form authentication | [
"Grant",
"access",
"via",
"form",
"authentication"
] | def make_form(app, global_conf, realm, authfunc, **kw):
"""
Grant access via form authentication
Config looks like this::
[filter:grant]
use = egg:Paste#auth_form
realm=myrealm
authfunc=somepackage.somemodule:somefunction
"""
from paste.util.import_string import eval_impor... | [
"def",
"make_form",
"(",
"app",
",",
"global_conf",
",",
"realm",
",",
"authfunc",
",",
"*",
"*",
"kw",
")",
":",
"from",
"paste",
".",
"util",
".",
"import_string",
"import",
"eval_import",
"import",
"types",
"authfunc",
"=",
"eval_import",
"(",
"authfunc... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/Paste/paste/auth/form.py#L124-L145 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/telemetry/core/android_action_runner.py | python | AndroidActionRunner.InputTap | (self, x_coord, y_coord) | Perform a tap input at the given coordinates.
Args:
x_coord: The x coordinate of the tap event.
y_coord: The y coordinate of the tap event. | Perform a tap input at the given coordinates. | [
"Perform",
"a",
"tap",
"input",
"at",
"the",
"given",
"coordinates",
"."
] | def InputTap(self, x_coord, y_coord):
"""Perform a tap input at the given coordinates.
Args:
x_coord: The x coordinate of the tap event.
y_coord: The y coordinate of the tap event.
"""
self._platform_backend.device.RunShellCommand('input tap %s %s' % (x_coord,
... | [
"def",
"InputTap",
"(",
"self",
",",
"x_coord",
",",
"y_coord",
")",
":",
"self",
".",
"_platform_backend",
".",
"device",
".",
"RunShellCommand",
"(",
"'input tap %s %s'",
"%",
"(",
"x_coord",
",",
"y_coord",
")",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/core/android_action_runner.py#L81-L89 | ||
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/modules/container.py | python | ModuleDict.keys | (self) | return self._modules.keys() | r"""Return an iterable of the ModuleDict keys. | r"""Return an iterable of the ModuleDict keys. | [
"r",
"Return",
"an",
"iterable",
"of",
"the",
"ModuleDict",
"keys",
"."
] | def keys(self) -> Iterable[str]:
r"""Return an iterable of the ModuleDict keys.
"""
return self._modules.keys() | [
"def",
"keys",
"(",
"self",
")",
"->",
"Iterable",
"[",
"str",
"]",
":",
"return",
"self",
".",
"_modules",
".",
"keys",
"(",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/modules/container.py#L364-L367 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBTypeSynthetic.GetData | (self) | return _lldb.SBTypeSynthetic_GetData(self) | GetData(SBTypeSynthetic self) -> char const * | GetData(SBTypeSynthetic self) -> char const * | [
"GetData",
"(",
"SBTypeSynthetic",
"self",
")",
"-",
">",
"char",
"const",
"*"
] | def GetData(self):
"""GetData(SBTypeSynthetic self) -> char const *"""
return _lldb.SBTypeSynthetic_GetData(self) | [
"def",
"GetData",
"(",
"self",
")",
":",
"return",
"_lldb",
".",
"SBTypeSynthetic_GetData",
"(",
"self",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L14019-L14021 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/labeled_tensor/python/ops/core.py | python | LabeledTensor._as_graph_element | (self) | return self.tensor | Support tf.Graph.as_graph_element on LabeledTensor objects.
This allows operations such as tf.name_scope to take labeled tensors.
Returns:
self.tensor | Support tf.Graph.as_graph_element on LabeledTensor objects. | [
"Support",
"tf",
".",
"Graph",
".",
"as_graph_element",
"on",
"LabeledTensor",
"objects",
"."
] | def _as_graph_element(self):
"""Support tf.Graph.as_graph_element on LabeledTensor objects.
This allows operations such as tf.name_scope to take labeled tensors.
Returns:
self.tensor
"""
return self.tensor | [
"def",
"_as_graph_element",
"(",
"self",
")",
":",
"return",
"self",
".",
"tensor"
] | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/labeled_tensor/python/ops/core.py#L344-L352 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/utils/_process_win32_controller.py | python | Win32ShellCommandController.__init__ | (self, cmd, mergeout = True) | Initializes the shell command controller.
The cmd is the program to execute, and mergeout is
whether to blend stdout and stderr into one output
in stdout. Merging them together in this fashion more
reliably keeps stdout and stderr in the correct order
especially for interactive ... | Initializes the shell command controller. | [
"Initializes",
"the",
"shell",
"command",
"controller",
"."
] | def __init__(self, cmd, mergeout = True):
"""Initializes the shell command controller.
The cmd is the program to execute, and mergeout is
whether to blend stdout and stderr into one output
in stdout. Merging them together in this fashion more
reliably keeps stdout and stderr in ... | [
"def",
"__init__",
"(",
"self",
",",
"cmd",
",",
"mergeout",
"=",
"True",
")",
":",
"self",
".",
"cmd",
"=",
"cmd",
"self",
".",
"mergeout",
"=",
"mergeout"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/_process_win32_controller.py#L221-L231 | ||
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | uCSIsPrivateUseArea | (code) | return ret | Check whether the character is part of PrivateUseArea UCS
Block | Check whether the character is part of PrivateUseArea UCS
Block | [
"Check",
"whether",
"the",
"character",
"is",
"part",
"of",
"PrivateUseArea",
"UCS",
"Block"
] | def uCSIsPrivateUseArea(code):
"""Check whether the character is part of PrivateUseArea UCS
Block """
ret = libxml2mod.xmlUCSIsPrivateUseArea(code)
return ret | [
"def",
"uCSIsPrivateUseArea",
"(",
"code",
")",
":",
"ret",
"=",
"libxml2mod",
".",
"xmlUCSIsPrivateUseArea",
"(",
"code",
")",
"return",
"ret"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L2040-L2044 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | DataObject.IsSupported | (*args, **kwargs) | return _misc_.DataObject_IsSupported(*args, **kwargs) | IsSupported(self, DataFormat format, int dir=Get) -> bool
Returns True if this format is supported. | IsSupported(self, DataFormat format, int dir=Get) -> bool | [
"IsSupported",
"(",
"self",
"DataFormat",
"format",
"int",
"dir",
"=",
"Get",
")",
"-",
">",
"bool"
] | def IsSupported(*args, **kwargs):
"""
IsSupported(self, DataFormat format, int dir=Get) -> bool
Returns True if this format is supported.
"""
return _misc_.DataObject_IsSupported(*args, **kwargs) | [
"def",
"IsSupported",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"DataObject_IsSupported",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L4949-L4955 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py | python | StateSpaceModel.get_prior_covariance | (self) | Constructs a variable prior covariance with data-based initialization.
Models should wrap any variables defined here in the model's variable scope.
Returns:
A two-dimensional [state dimension, state dimension] floating point Tensor
with a (positive definite) prior state covariance matrix. | Constructs a variable prior covariance with data-based initialization. | [
"Constructs",
"a",
"variable",
"prior",
"covariance",
"with",
"data",
"-",
"based",
"initialization",
"."
] | def get_prior_covariance(self):
"""Constructs a variable prior covariance with data-based initialization.
Models should wrap any variables defined here in the model's variable scope.
Returns:
A two-dimensional [state dimension, state dimension] floating point Tensor
with a (positive definite) ... | [
"def",
"get_prior_covariance",
"(",
"self",
")",
":",
"with",
"variable_scope",
".",
"variable_scope",
"(",
"self",
".",
"_variable_scope",
")",
":",
"state_dimension",
"=",
"ops",
".",
"convert_to_tensor",
"(",
"self",
".",
"get_state_transition",
"(",
")",
")"... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py#L704-L731 | ||
livecode/livecode | 4606a10ea10b16d5071d0f9f263ccdd7ede8b31d | gyp/pylib/gyp/MSVSProject.py | python | Tool._GetSpecification | (self) | return ['Tool', self._attrs] | Creates an element for the tool.
Returns:
A new xml.dom.Element for the tool. | Creates an element for the tool. | [
"Creates",
"an",
"element",
"for",
"the",
"tool",
"."
] | def _GetSpecification(self):
"""Creates an element for the tool.
Returns:
A new xml.dom.Element for the tool.
"""
return ['Tool', self._attrs] | [
"def",
"_GetSpecification",
"(",
"self",
")",
":",
"return",
"[",
"'Tool'",
",",
"self",
".",
"_attrs",
"]"
] | https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/MSVSProject.py#L26-L32 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/Pygments/py3/pygments/util.py | python | duplicates_removed | (it, already_seen=()) | return lst | Returns a list with duplicates removed from the iterable `it`.
Order is preserved. | Returns a list with duplicates removed from the iterable `it`. | [
"Returns",
"a",
"list",
"with",
"duplicates",
"removed",
"from",
"the",
"iterable",
"it",
"."
] | def duplicates_removed(it, already_seen=()):
"""
Returns a list with duplicates removed from the iterable `it`.
Order is preserved.
"""
lst = []
seen = set()
for i in it:
if i in seen or i in already_seen:
continue
lst.append(i)
seen.add(i)
return lst | [
"def",
"duplicates_removed",
"(",
"it",
",",
"already_seen",
"=",
"(",
")",
")",
":",
"lst",
"=",
"[",
"]",
"seen",
"=",
"set",
"(",
")",
"for",
"i",
"in",
"it",
":",
"if",
"i",
"in",
"seen",
"or",
"i",
"in",
"already_seen",
":",
"continue",
"lst... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/Pygments/py3/pygments/util.py#L233-L246 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/composite/base.py | python | _Grad.__init__ | (self, get_by_list=False, sens_param=False, get_by_position=False) | Initialize _Grad. | Initialize _Grad. | [
"Initialize",
"_Grad",
"."
] | def __init__(self, get_by_list=False, sens_param=False, get_by_position=False):
"""Initialize _Grad."""
if not isinstance(get_by_position, bool):
raise TypeError(f"For '_Grad', the 'get_by_position' should be bool, "
f"but got {type(get_by_position).__name__}")
... | [
"def",
"__init__",
"(",
"self",
",",
"get_by_list",
"=",
"False",
",",
"sens_param",
"=",
"False",
",",
"get_by_position",
"=",
"False",
")",
":",
"if",
"not",
"isinstance",
"(",
"get_by_position",
",",
"bool",
")",
":",
"raise",
"TypeError",
"(",
"f\"For ... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/base.py#L408-L426 | ||
BertaBescos/DynaSLAM | 8f894a8b9d63c0a608fd871d63c10796491b9312 | src/python/model.py | python | identity_block | (input_tensor, kernel_size, filters, stage, block,
use_bias=True) | return x | The identity_block is the block that has no conv layer at shortcut
# Arguments
input_tensor: input tensor
kernel_size: defualt 3, the kernel size of middle conv layer at main path
filters: list of integers, the nb_filters of 3 conv layer at main path
stage: integer, current stage lab... | The identity_block is the block that has no conv layer at shortcut
# Arguments
input_tensor: input tensor
kernel_size: defualt 3, the kernel size of middle conv layer at main path
filters: list of integers, the nb_filters of 3 conv layer at main path
stage: integer, current stage lab... | [
"The",
"identity_block",
"is",
"the",
"block",
"that",
"has",
"no",
"conv",
"layer",
"at",
"shortcut",
"#",
"Arguments",
"input_tensor",
":",
"input",
"tensor",
"kernel_size",
":",
"defualt",
"3",
"the",
"kernel",
"size",
"of",
"middle",
"conv",
"layer",
"at... | def identity_block(input_tensor, kernel_size, filters, stage, block,
use_bias=True):
"""The identity_block is the block that has no conv layer at shortcut
# Arguments
input_tensor: input tensor
kernel_size: defualt 3, the kernel size of middle conv layer at main path
f... | [
"def",
"identity_block",
"(",
"input_tensor",
",",
"kernel_size",
",",
"filters",
",",
"stage",
",",
"block",
",",
"use_bias",
"=",
"True",
")",
":",
"nb_filter1",
",",
"nb_filter2",
",",
"nb_filter3",
"=",
"filters",
"conv_name_base",
"=",
"'res'",
"+",
"st... | https://github.com/BertaBescos/DynaSLAM/blob/8f894a8b9d63c0a608fd871d63c10796491b9312/src/python/model.py#L75-L105 | |
albertz/openlierox | d316c14a8eb57848ef56e9bfa7b23a56f694a51b | tools/DedicatedServerVideo/gdata/docs/service.py | python | DocsService._UploadFile | (self, media_source, title, category, folder_or_uri=None) | return entry | Uploads a file to the Document List feed.
Args:
media_source: A gdata.MediaSource object containing the file to be
uploaded.
title: string The title of the document on the server after being
uploaded.
category: An atom.Category object specifying the appropriate document
... | Uploads a file to the Document List feed. | [
"Uploads",
"a",
"file",
"to",
"the",
"Document",
"List",
"feed",
"."
] | def _UploadFile(self, media_source, title, category, folder_or_uri=None):
"""Uploads a file to the Document List feed.
Args:
media_source: A gdata.MediaSource object containing the file to be
uploaded.
title: string The title of the document on the server after being
uploaded.
... | [
"def",
"_UploadFile",
"(",
"self",
",",
"media_source",
",",
"title",
",",
"category",
",",
"folder_or_uri",
"=",
"None",
")",
":",
"if",
"folder_or_uri",
":",
"try",
":",
"uri",
"=",
"folder_or_uri",
".",
"content",
".",
"src",
"except",
"AttributeError",
... | https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/docs/service.py#L127-L161 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mhlib.py | python | Folder.getsequences | (self) | return sequences | Return the set of sequences for the folder. | Return the set of sequences for the folder. | [
"Return",
"the",
"set",
"of",
"sequences",
"for",
"the",
"folder",
"."
] | def getsequences(self):
"""Return the set of sequences for the folder."""
sequences = {}
fullname = self.getsequencesfilename()
try:
f = open(fullname, 'r')
except IOError:
return sequences
while 1:
line = f.readline()
if no... | [
"def",
"getsequences",
"(",
"self",
")",
":",
"sequences",
"=",
"{",
"}",
"fullname",
"=",
"self",
".",
"getsequencesfilename",
"(",
")",
"try",
":",
"f",
"=",
"open",
"(",
"fullname",
",",
"'r'",
")",
"except",
"IOError",
":",
"return",
"sequences",
"... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/mhlib.py#L297-L315 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/scripts/transformations.py | python | vector_norm | (data, axis=None, out=None) | Return length, i.e. eucledian norm, of ndarray along axis.
>>> v = numpy.random.random(3)
>>> n = vector_norm(v)
>>> numpy.allclose(n, numpy.linalg.norm(v))
True
>>> v = numpy.random.rand(6, 5, 3)
>>> n = vector_norm(v, axis=-1)
>>> numpy.allclose(n, numpy.sqrt(numpy.sum(v*v, axis=2)))
... | Return length, i.e. eucledian norm, of ndarray along axis. | [
"Return",
"length",
"i",
".",
"e",
".",
"eucledian",
"norm",
"of",
"ndarray",
"along",
"axis",
"."
] | def vector_norm(data, axis=None, out=None):
"""Return length, i.e. eucledian norm, of ndarray along axis.
>>> v = numpy.random.random(3)
>>> n = vector_norm(v)
>>> numpy.allclose(n, numpy.linalg.norm(v))
True
>>> v = numpy.random.rand(6, 5, 3)
>>> n = vector_norm(v, axis=-1)
>>> numpy.a... | [
"def",
"vector_norm",
"(",
"data",
",",
"axis",
"=",
"None",
",",
"out",
"=",
"None",
")",
":",
"data",
"=",
"numpy",
".",
"array",
"(",
"data",
",",
"dtype",
"=",
"numpy",
".",
"float64",
",",
"copy",
"=",
"True",
")",
"if",
"out",
"is",
"None",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/Blast/3rdParty/assimp/port/PyAssimp/scripts/transformations.py#L1535-L1571 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/configHandler.py | python | IdleConf.CurrentTheme | (self) | return self.GetOption('main','Theme','name',default='') | Returns the name of the currently active theme | Returns the name of the currently active theme | [
"Returns",
"the",
"name",
"of",
"the",
"currently",
"active",
"theme"
] | def CurrentTheme(self):
"""
Returns the name of the currently active theme
"""
return self.GetOption('main','Theme','name',default='') | [
"def",
"CurrentTheme",
"(",
"self",
")",
":",
"return",
"self",
".",
"GetOption",
"(",
"'main'",
",",
"'Theme'",
",",
"'name'",
",",
"default",
"=",
"''",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/configHandler.py#L388-L392 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/SimpleHTTPServer.py | python | SimpleHTTPRequestHandler.send_head | (self) | return f | Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or
None, in... | Common code for GET and HEAD commands. | [
"Common",
"code",
"for",
"GET",
"and",
"HEAD",
"commands",
"."
] | def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all cir... | [
"def",
"send_head",
"(",
"self",
")",
":",
"path",
"=",
"self",
".",
"translate_path",
"(",
"self",
".",
"path",
")",
"f",
"=",
"None",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"path",
")",
":",
"if",
"not",
"self",
".",
"path",
".",
"endswith... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/SimpleHTTPServer.py#L54-L96 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/operator.py | python | ilshift | (a, b) | return a | Same as a <<= b. | Same as a <<= b. | [
"Same",
"as",
"a",
"<<",
"=",
"b",
"."
] | def ilshift(a, b):
"Same as a <<= b."
a <<= b
return a | [
"def",
"ilshift",
"(",
"a",
",",
"b",
")",
":",
"a",
"<<=",
"b",
"return",
"a"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/operator.py#L360-L363 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/configparser.py | python | RawConfigParser._convert_to_boolean | (self, value) | return self.BOOLEAN_STATES[value.lower()] | Return a boolean value translating from other types if necessary. | Return a boolean value translating from other types if necessary. | [
"Return",
"a",
"boolean",
"value",
"translating",
"from",
"other",
"types",
"if",
"necessary",
"."
] | def _convert_to_boolean(self, value):
"""Return a boolean value translating from other types if necessary.
"""
if value.lower() not in self.BOOLEAN_STATES:
raise ValueError('Not a boolean: %s' % value)
return self.BOOLEAN_STATES[value.lower()] | [
"def",
"_convert_to_boolean",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
".",
"lower",
"(",
")",
"not",
"in",
"self",
".",
"BOOLEAN_STATES",
":",
"raise",
"ValueError",
"(",
"'Not a boolean: %s'",
"%",
"value",
")",
"return",
"self",
".",
"BOOLEAN... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/configparser.py#L1162-L1167 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/deephol/prover.py | python | NoBacktrackProver.prove_one | (self, tree: proof_search_tree.ProofSearchTree,
task: proof_assistant_pb2.ProverTask) | Searches for a proof without backtracking.
Args:
tree: Search tree with a single goal node to be proved.
task: ProverTask to be performed.
Returns:
None on success and error message on failure. | Searches for a proof without backtracking. | [
"Searches",
"for",
"a",
"proof",
"without",
"backtracking",
"."
] | def prove_one(self, tree: proof_search_tree.ProofSearchTree,
task: proof_assistant_pb2.ProverTask) -> Optional[Text]:
"""Searches for a proof without backtracking.
Args:
tree: Search tree with a single goal node to be proved.
task: ProverTask to be performed.
Returns:
Non... | [
"def",
"prove_one",
"(",
"self",
",",
"tree",
":",
"proof_search_tree",
".",
"ProofSearchTree",
",",
"task",
":",
"proof_assistant_pb2",
".",
"ProverTask",
")",
"->",
"Optional",
"[",
"Text",
"]",
":",
"root",
"=",
"tree",
".",
"nodes",
"[",
"0",
"]",
"b... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/prover.py#L198-L237 | ||
NREL/EnergyPlus | fadc5973b85c70e8cc923efb69c144e808a26078 | third_party/EP-Launch-Lite/EPLaunchLite/EPLaunchLiteWindow.py | python | Window.gui_build_body | (self) | return vbox | This function builds out the specific widgets on the GUI
* Returns: A gtk.VBox suitable for adding directly onto the main gtk.Window | This function builds out the specific widgets on the GUI | [
"This",
"function",
"builds",
"out",
"the",
"specific",
"widgets",
"on",
"the",
"GUI"
] | def gui_build_body(self):
"""
This function builds out the specific widgets on the GUI
* Returns: A gtk.VBox suitable for adding directly onto the main gtk.Window
"""
# create a vbox here first
vbox = gtk.VBox(False, self.box_spacing)
# create the menu bar itse... | [
"def",
"gui_build_body",
"(",
"self",
")",
":",
"# create a vbox here first",
"vbox",
"=",
"gtk",
".",
"VBox",
"(",
"False",
",",
"self",
".",
"box_spacing",
")",
"# create the menu bar itself to hold the menus",
"mb",
"=",
"gtk",
".",
"MenuBar",
"(",
")",
"# cr... | https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/third_party/EP-Launch-Lite/EPLaunchLite/EPLaunchLiteWindow.py#L106-L251 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | build/android/buildbot/bb_device_steps.py | python | UploadHTML | (options, gs_base_dir, dir_to_upload, link_text,
link_rel_path='index.html', gs_url=GS_URL) | Uploads directory at |dir_to_upload| to Google Storage and output a link.
Args:
options: Command line options.
gs_base_dir: The Google Storage base directory (e.g.
'chromium-code-coverage/java')
dir_to_upload: Absolute path to the directory to be uploaded.
link_text: Link text to be displayed o... | Uploads directory at |dir_to_upload| to Google Storage and output a link. | [
"Uploads",
"directory",
"at",
"|dir_to_upload|",
"to",
"Google",
"Storage",
"and",
"output",
"a",
"link",
"."
] | def UploadHTML(options, gs_base_dir, dir_to_upload, link_text,
link_rel_path='index.html', gs_url=GS_URL):
"""Uploads directory at |dir_to_upload| to Google Storage and output a link.
Args:
options: Command line options.
gs_base_dir: The Google Storage base directory (e.g.
'chromium-co... | [
"def",
"UploadHTML",
"(",
"options",
",",
"gs_base_dir",
",",
"dir_to_upload",
",",
"link_text",
",",
"link_rel_path",
"=",
"'index.html'",
",",
"gs_url",
"=",
"GS_URL",
")",
":",
"revision",
"=",
"_GetRevision",
"(",
"options",
")",
"bot_id",
"=",
"options",
... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/build/android/buildbot/bb_device_steps.py#L489-L508 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/protobuf/py2/google/protobuf/internal/decoder.py | python | MessageSetItemDecoder | (descriptor) | return DecodeItem | Returns a decoder for a MessageSet item.
The parameter is the message Descriptor.
The message set message looks like this:
message MessageSet {
repeated group Item = 1 {
required int32 type_id = 2;
required string message = 3;
}
} | Returns a decoder for a MessageSet item. | [
"Returns",
"a",
"decoder",
"for",
"a",
"MessageSet",
"item",
"."
] | def MessageSetItemDecoder(descriptor):
"""Returns a decoder for a MessageSet item.
The parameter is the message Descriptor.
The message set message looks like this:
message MessageSet {
repeated group Item = 1 {
required int32 type_id = 2;
required string message = 3;
}
}
"... | [
"def",
"MessageSetItemDecoder",
"(",
"descriptor",
")",
":",
"type_id_tag_bytes",
"=",
"encoder",
".",
"TagBytes",
"(",
"2",
",",
"wire_format",
".",
"WIRETYPE_VARINT",
")",
"message_tag_bytes",
"=",
"encoder",
".",
"TagBytes",
"(",
"3",
",",
"wire_format",
".",... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/decoder.py#L766-L860 | |
DeepGraphLearning/graphvite | e067c59146f676e3eee3eee6106dce7ccc7cf9e4 | python/graphvite/application/application.py | python | GraphApplication.node_classification | (self, X=None, Y=None, file_name=None, portions=(0.02,), normalization=False, times=1,
patience=100) | return metrics | Evaluate node embeddings on node classification task.
Parameters:
X (list of str, optional): names of nodes
Y (list, optional): labels of nodes
file_name (str, optional): file of nodes & labels
portions (tuple of float, optional): how much data for training
... | Evaluate node embeddings on node classification task. | [
"Evaluate",
"node",
"embeddings",
"on",
"node",
"classification",
"task",
"."
] | def node_classification(self, X=None, Y=None, file_name=None, portions=(0.02,), normalization=False, times=1,
patience=100):
"""
Evaluate node embeddings on node classification task.
Parameters:
X (list of str, optional): names of nodes
Y (lis... | [
"def",
"node_classification",
"(",
"self",
",",
"X",
"=",
"None",
",",
"Y",
"=",
"None",
",",
"file_name",
"=",
"None",
",",
"portions",
"=",
"(",
"0.02",
",",
")",
",",
"normalization",
"=",
"False",
",",
"times",
"=",
"1",
",",
"patience",
"=",
"... | https://github.com/DeepGraphLearning/graphvite/blob/e067c59146f676e3eee3eee6106dce7ccc7cf9e4/python/graphvite/application/application.py#L293-L351 | |
CRYTEK/CRYENGINE | 232227c59a220cbbd311576f0fbeba7bb53b2a8c | Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py | python | ExFileObject.readlines | (self) | return result | Return a list with all remaining lines. | Return a list with all remaining lines. | [
"Return",
"a",
"list",
"with",
"all",
"remaining",
"lines",
"."
] | def readlines(self):
"""Return a list with all remaining lines.
"""
result = []
while True:
line = self.readline()
if not line: break
result.append(line)
return result | [
"def",
"readlines",
"(",
"self",
")",
":",
"result",
"=",
"[",
"]",
"while",
"True",
":",
"line",
"=",
"self",
".",
"readline",
"(",
")",
"if",
"not",
"line",
":",
"break",
"result",
".",
"append",
"(",
"line",
")",
"return",
"result"
] | https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py#L866-L874 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/train/summary/_summary_adapter.py | python | package_summary_event | (data_list, step, wall_time) | return summary_event | Package the summary to event protobuffer.
Args:
data_list (list): Summary data list.
step (Number): The recode step index.
wall_time (float): The wall time.
Returns:
Summary, the summary event. | Package the summary to event protobuffer. | [
"Package",
"the",
"summary",
"to",
"event",
"protobuffer",
"."
] | def package_summary_event(data_list, step, wall_time):
"""
Package the summary to event protobuffer.
Args:
data_list (list): Summary data list.
step (Number): The recode step index.
wall_time (float): The wall time.
Returns:
Summary, the summary event.
"""
# cre... | [
"def",
"package_summary_event",
"(",
"data_list",
",",
"step",
",",
"wall_time",
")",
":",
"# create the event of summary",
"summary_event",
"=",
"Event",
"(",
")",
"summary",
"=",
"summary_event",
".",
"summary",
"summary_event",
".",
"wall_time",
"=",
"wall_time",... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/train/summary/_summary_adapter.py#L106-L151 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/distutils/ccompiler.py | python | CCompiler._fix_compile_args | (self, output_dir, macros, include_dirs) | return output_dir, macros, include_dirs | Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it with 'self.macros'; ensures that
'include_dirs' is a list, and au... | Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it with 'self.macros'; ensures that
'include_dirs' is a list, and au... | [
"Typecheck",
"and",
"fix",
"-",
"up",
"some",
"of",
"the",
"arguments",
"to",
"the",
"compile",
"()",
"method",
"and",
"return",
"fixed",
"-",
"up",
"values",
".",
"Specifically",
":",
"if",
"output_dir",
"is",
"None",
"replaces",
"it",
"with",
"self",
"... | def _fix_compile_args(self, output_dir, macros, include_dirs):
"""Typecheck and fix-up some of the arguments to the 'compile()'
method, and return fixed-up values. Specifically: if 'output_dir'
is None, replaces it with 'self.output_dir'; ensures that 'macros'
is a list, and augments it... | [
"def",
"_fix_compile_args",
"(",
"self",
",",
"output_dir",
",",
"macros",
",",
"include_dirs",
")",
":",
"if",
"output_dir",
"is",
"None",
":",
"output_dir",
"=",
"self",
".",
"output_dir",
"elif",
"not",
"isinstance",
"(",
"output_dir",
",",
"str",
")",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/distutils/ccompiler.py#L382-L412 | |
etotheipi/BitcoinArmory | 2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98 | armoryengine/ArmoryUtils.py | python | hex_to_int | (h, endIn=LITTLEENDIAN) | return( int(hstr, 16) ) | Convert hex-string to integer (or long). Default behavior is to interpret
hex string as little-endian | Convert hex-string to integer (or long). Default behavior is to interpret
hex string as little-endian | [
"Convert",
"hex",
"-",
"string",
"to",
"integer",
"(",
"or",
"long",
")",
".",
"Default",
"behavior",
"is",
"to",
"interpret",
"hex",
"string",
"as",
"little",
"-",
"endian"
] | def hex_to_int(h, endIn=LITTLEENDIAN):
"""
Convert hex-string to integer (or long). Default behavior is to interpret
hex string as little-endian
"""
hstr = h.replace(' ','') # copies data, no references
if endIn==LITTLEENDIAN:
hstr = hex_switchEndian(hstr)
return( int(hstr, 16) ) | [
"def",
"hex_to_int",
"(",
"h",
",",
"endIn",
"=",
"LITTLEENDIAN",
")",
":",
"hstr",
"=",
"h",
".",
"replace",
"(",
"' '",
",",
"''",
")",
"# copies data, no references",
"if",
"endIn",
"==",
"LITTLEENDIAN",
":",
"hstr",
"=",
"hex_switchEndian",
"(",
"hstr"... | https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/ArmoryUtils.py#L1918-L1926 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/rnn/python/ops/core_rnn_cell.py | python | InputProjectionWrapper.call | (self, inputs, state) | return self._cell(projected, state) | Run the input projection and then the cell. | Run the input projection and then the cell. | [
"Run",
"the",
"input",
"projection",
"and",
"then",
"the",
"cell",
"."
] | def call(self, inputs, state):
"""Run the input projection and then the cell."""
# Default scope: "InputProjectionWrapper"
projected = _linear(inputs, self._num_proj, True)
if self._activation:
projected = self._activation(projected)
return self._cell(projected, state) | [
"def",
"call",
"(",
"self",
",",
"inputs",
",",
"state",
")",
":",
"# Default scope: \"InputProjectionWrapper\"",
"projected",
"=",
"_linear",
"(",
"inputs",
",",
"self",
".",
"_num_proj",
",",
"True",
")",
"if",
"self",
".",
"_activation",
":",
"projected",
... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/rnn/python/ops/core_rnn_cell.py#L170-L176 | |
OAID/Caffe-HRT | aae71e498ab842c6f92bcc23fc668423615a4d65 | scripts/cpp_lint.py | python | CheckForNonConstReference | (filename, clean_lines, linenum,
nesting_state, error) | Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
nesting_state: A... | Check for non-const references. | [
"Check",
"for",
"non",
"-",
"const",
"references",
"."
] | def CheckForNonConstReference(filename, clean_lines, linenum,
nesting_state, error):
"""Check for non-const references.
Separate from CheckLanguage since it scans backwards from current
line, instead of scanning forward.
Args:
filename: The name of the current file.
clean... | [
"def",
"CheckForNonConstReference",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"nesting_state",
",",
"error",
")",
":",
"# Do nothing if there is no '&' on current line.",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"if",
"'&'",
"n... | https://github.com/OAID/Caffe-HRT/blob/aae71e498ab842c6f92bcc23fc668423615a4d65/scripts/cpp_lint.py#L4134-L4244 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/externals.py | python | set_fnclex | (context, c_helpers) | return library | Install fnclex before fmod calls.
Workaround for https://support.microsoft.com/en-us/kb/982107 | Install fnclex before fmod calls.
Workaround for https://support.microsoft.com/en-us/kb/982107 | [
"Install",
"fnclex",
"before",
"fmod",
"calls",
".",
"Workaround",
"for",
"https",
":",
"//",
"support",
".",
"microsoft",
".",
"com",
"/",
"en",
"-",
"us",
"/",
"kb",
"/",
"982107"
] | def set_fnclex(context, c_helpers):
"""
Install fnclex before fmod calls.
Workaround for https://support.microsoft.com/en-us/kb/982107
"""
ptr_set_fnclex = c_helpers['set_fnclex']
fn = ctypes.CFUNCTYPE(None, ctypes.c_void_p)(ptr_set_fnclex)
library = compile_fnclex(context)
fnclex_ptr =... | [
"def",
"set_fnclex",
"(",
"context",
",",
"c_helpers",
")",
":",
"ptr_set_fnclex",
"=",
"c_helpers",
"[",
"'set_fnclex'",
"]",
"fn",
"=",
"ctypes",
".",
"CFUNCTYPE",
"(",
"None",
",",
"ctypes",
".",
"c_void_p",
")",
"(",
"ptr_set_fnclex",
")",
"library",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/targets/externals.py#L169-L181 | |
GJDuck/LowFat | ecf6a0f0fa1b73a27a626cf493cc39e477b6faea | llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/report.py | python | report_directory | (hint, keep) | Responsible for the report directory.
hint -- could specify the parent directory of the output directory.
keep -- a boolean value to keep or delete the empty report directory. | Responsible for the report directory. | [
"Responsible",
"for",
"the",
"report",
"directory",
"."
] | def report_directory(hint, keep):
""" Responsible for the report directory.
hint -- could specify the parent directory of the output directory.
keep -- a boolean value to keep or delete the empty report directory. """
stamp_format = 'scan-build-%Y-%m-%d-%H-%M-%S-%f-'
stamp = datetime.datetime.now(... | [
"def",
"report_directory",
"(",
"hint",
",",
"keep",
")",
":",
"stamp_format",
"=",
"'scan-build-%Y-%m-%d-%H-%M-%S-%f-'",
"stamp",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
".",
"strftime",
"(",
"stamp_format",
")",
"parentdir",
"=",
"os",
".",
... | https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/report.py#L32-L63 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/stc.py | python | StyledTextCtrl.GetSearchFlags | (*args, **kwargs) | return _stc.StyledTextCtrl_GetSearchFlags(*args, **kwargs) | GetSearchFlags(self) -> int
Get the search flags used by SearchInTarget. | GetSearchFlags(self) -> int | [
"GetSearchFlags",
"(",
"self",
")",
"-",
">",
"int"
] | def GetSearchFlags(*args, **kwargs):
"""
GetSearchFlags(self) -> int
Get the search flags used by SearchInTarget.
"""
return _stc.StyledTextCtrl_GetSearchFlags(*args, **kwargs) | [
"def",
"GetSearchFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_GetSearchFlags",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L3788-L3794 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_core.py | python | MenuItem.SetOwnerDrawn | (*args, **kwargs) | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | SetOwnerDrawn(self, bool ownerDrawn=True) | SetOwnerDrawn(self, bool ownerDrawn=True) | [
"SetOwnerDrawn",
"(",
"self",
"bool",
"ownerDrawn",
"=",
"True",
")"
] | def SetOwnerDrawn(*args, **kwargs):
"""SetOwnerDrawn(self, bool ownerDrawn=True)"""
return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | [
"def",
"SetOwnerDrawn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_SetOwnerDrawn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L12606-L12608 | |
apiaryio/snowcrash | b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3 | tools/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings._TargetConfig | (self, config) | return config | Returns the target-specific configuration. | Returns the target-specific configuration. | [
"Returns",
"the",
"target",
"-",
"specific",
"configuration",
"."
] | def _TargetConfig(self, config):
"""Returns the target-specific configuration."""
# There's two levels of architecture/platform specification in VS. The
# first level is globally for the configuration (this is what we consider
# "the" config at the gyp level, which will be something like 'Debug' or
... | [
"def",
"_TargetConfig",
"(",
"self",
",",
"config",
")",
":",
"# There's two levels of architecture/platform specification in VS. The",
"# first level is globally for the configuration (this is what we consider",
"# \"the\" config at the gyp level, which will be something like 'Debug' or",
"# ... | https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/msvs_emulation.py#L304-L317 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/ultimatelistctrl.py | python | UltimateListMainWindow.SetGradientStyle | (self, vertical=0) | Sets the gradient style for gradient-style selections.
:param `vertical`: 0 for horizontal gradient-style selections, 1 for vertical
gradient-style selections. | Sets the gradient style for gradient-style selections. | [
"Sets",
"the",
"gradient",
"style",
"for",
"gradient",
"-",
"style",
"selections",
"."
] | def SetGradientStyle(self, vertical=0):
"""
Sets the gradient style for gradient-style selections.
:param `vertical`: 0 for horizontal gradient-style selections, 1 for vertical
gradient-style selections.
"""
# 0 = Horizontal, 1 = Vertical
self._gradientstyle = ... | [
"def",
"SetGradientStyle",
"(",
"self",
",",
"vertical",
"=",
"0",
")",
":",
"# 0 = Horizontal, 1 = Vertical",
"self",
".",
"_gradientstyle",
"=",
"vertical",
"if",
"self",
".",
"_usegradients",
":",
"self",
".",
"RefreshSelected",
"(",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L10659-L10671 | ||
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Path/PathScripts/PathToolLibraryEditor.py | python | EditorPanel.loadTable | (self, name) | loads the tools for the selected tool table | loads the tools for the selected tool table | [
"loads",
"the",
"tools",
"for",
"the",
"selected",
"tool",
"table"
] | def loadTable(self, name):
"""loads the tools for the selected tool table"""
tooldata = self.TLM.getTools(name)
if tooldata:
self.form.ToolsList.setModel(tooldata)
self.form.ToolsList.resizeColumnsToContents()
self.form.ToolsList.horizontalHeader().setResizeMo... | [
"def",
"loadTable",
"(",
"self",
",",
"name",
")",
":",
"tooldata",
"=",
"self",
".",
"TLM",
".",
"getTools",
"(",
"name",
")",
"if",
"tooldata",
":",
"self",
".",
"form",
".",
"ToolsList",
".",
"setModel",
"(",
"tooldata",
")",
"self",
".",
"form",
... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Path/PathScripts/PathToolLibraryEditor.py#L319-L328 | ||
microsoft/ELL | a1d6bacc37a14879cc025d9be2ba40b1a0632315 | tools/importers/CNTK/lib/cntk_layers.py | python | MaxPoolingLayer.clone_cntk_layer | (self, feature) | return MaxPooling(filterShape, strides=(stride, stride), pad=pad)(feature) | Returns a clone of the CNTK layer for per-layer forward prop validation | Returns a clone of the CNTK layer for per-layer forward prop validation | [
"Returns",
"a",
"clone",
"of",
"the",
"CNTK",
"layer",
"for",
"per",
"-",
"layer",
"forward",
"prop",
"validation"
] | def clone_cntk_layer(self, feature):
"""Returns a clone of the CNTK layer for per-layer forward prop validation"""
pad, filterShape, stride = self.get_cntk_parameters()
return MaxPooling(filterShape, strides=(stride, stride), pad=pad)(feature) | [
"def",
"clone_cntk_layer",
"(",
"self",
",",
"feature",
")",
":",
"pad",
",",
"filterShape",
",",
"stride",
"=",
"self",
".",
"get_cntk_parameters",
"(",
")",
"return",
"MaxPooling",
"(",
"filterShape",
",",
"strides",
"=",
"(",
"stride",
",",
"stride",
")... | https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/CNTK/lib/cntk_layers.py#L608-L612 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/robotinfo.py | python | RobotInfo.klamptModel | (self) | return self.robotModel | Returns the Klamp't RobotModel associated with this robot, either by
the ``robotModel`` object or loading from the given filename
``self.modelFile``.
The results are cached so this can be called many times without a
performance hit. | Returns the Klamp't RobotModel associated with this robot, either by
the ``robotModel`` object or loading from the given filename
``self.modelFile``. | [
"Returns",
"the",
"Klamp",
"t",
"RobotModel",
"associated",
"with",
"this",
"robot",
"either",
"by",
"the",
"robotModel",
"object",
"or",
"loading",
"from",
"the",
"given",
"filename",
"self",
".",
"modelFile",
"."
] | def klamptModel(self) -> RobotModel:
"""Returns the Klamp't RobotModel associated with this robot, either by
the ``robotModel`` object or loading from the given filename
``self.modelFile``.
The results are cached so this can be called many times without a
performance hit.
... | [
"def",
"klamptModel",
"(",
"self",
")",
"->",
"RobotModel",
":",
"if",
"self",
".",
"robotModel",
"is",
"not",
"None",
":",
"return",
"self",
".",
"robotModel",
"if",
"self",
".",
"modelFile",
"is",
"None",
":",
"raise",
"RuntimeError",
"(",
"\"Can't load ... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/robotinfo.py#L170-L218 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | deps/src/libxml2-2.9.1/python/libxml2class.py | python | xpathParserContext.xpathErr | (self, error) | Handle an XPath error | Handle an XPath error | [
"Handle",
"an",
"XPath",
"error"
] | def xpathErr(self, error):
"""Handle an XPath error """
libxml2mod.xmlXPathErr(self._o, error) | [
"def",
"xpathErr",
"(",
"self",
",",
"error",
")",
":",
"libxml2mod",
".",
"xmlXPathErr",
"(",
"self",
".",
"_o",
",",
"error",
")"
] | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6715-L6717 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | Button_GetClassDefaultAttributes | (*args, **kwargs) | return _controls_.Button_GetClassDefaultAttributes(*args, **kwargs) | Button_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- which is a much better idea than hard coding specific
colours or ... | Button_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | [
"Button_GetClassDefaultAttributes",
"(",
"int",
"variant",
"=",
"WINDOW_VARIANT_NORMAL",
")",
"-",
">",
"VisualAttributes"
] | def Button_GetClassDefaultAttributes(*args, **kwargs):
"""
Button_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want
to use the same font or colour in your own control as in a standard
control -- whic... | [
"def",
"Button_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"Button_GetClassDefaultAttributes",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L269-L284 | |
Atarity/Lightpack | 4dee73a443cba4c4073291febe450e6c1941f3af | Software/apiexamples/liOSC/OSC.py | python | OSCMultiClient.hasOSCTarget | (self, address, prefix=None) | return False | Return True if the given OSCTarget exists in the Client's dict.
the 'address' argument can be a ((host, port) tuple), or a hostname.
If the 'prefix' argument is given, the return-value is only True if the address and prefix match. | Return True if the given OSCTarget exists in the Client's dict.
the 'address' argument can be a ((host, port) tuple), or a hostname.
If the 'prefix' argument is given, the return-value is only True if the address and prefix match. | [
"Return",
"True",
"if",
"the",
"given",
"OSCTarget",
"exists",
"in",
"the",
"Client",
"s",
"dict",
".",
"the",
"address",
"argument",
"can",
"be",
"a",
"((",
"host",
"port",
")",
"tuple",
")",
"or",
"a",
"hostname",
".",
"If",
"the",
"prefix",
"argumen... | def hasOSCTarget(self, address, prefix=None):
"""Return True if the given OSCTarget exists in the Client's dict.
the 'address' argument can be a ((host, port) tuple), or a hostname.
If the 'prefix' argument is given, the return-value is only True if the address and prefix match.
"""
if type(address) in types.... | [
"def",
"hasOSCTarget",
"(",
"self",
",",
"address",
",",
"prefix",
"=",
"None",
")",
":",
"if",
"type",
"(",
"address",
")",
"in",
"types",
".",
"StringTypes",
":",
"address",
"=",
"self",
".",
"_searchHostAddr",
"(",
"address",
")",
"if",
"type",
"(",... | https://github.com/Atarity/Lightpack/blob/4dee73a443cba4c4073291febe450e6c1941f3af/Software/apiexamples/liOSC/OSC.py#L1373-L1395 | |
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Node/FS.py | python | File.retrieve_from_cache | (self) | return self.get_build_env().get_CacheDir().retrieve(self) | Try to retrieve the node's content from a cache
This method is called from multiple threads in a parallel build,
so only do thread safe stuff here. Do thread unsafe stuff in
built().
Returns true if the node was successfully retrieved. | Try to retrieve the node's content from a cache | [
"Try",
"to",
"retrieve",
"the",
"node",
"s",
"content",
"from",
"a",
"cache"
] | def retrieve_from_cache(self):
"""Try to retrieve the node's content from a cache
This method is called from multiple threads in a parallel build,
so only do thread safe stuff here. Do thread unsafe stuff in
built().
Returns true if the node was successfully retrieved.
... | [
"def",
"retrieve_from_cache",
"(",
"self",
")",
":",
"if",
"self",
".",
"nocache",
":",
"return",
"None",
"if",
"not",
"self",
".",
"is_derived",
"(",
")",
":",
"return",
"None",
"return",
"self",
".",
"get_build_env",
"(",
")",
".",
"get_CacheDir",
"(",... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Node/FS.py#L2912-L2925 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ast.py | python | copy_location | (new_node, old_node) | return new_node | Copy source location (`lineno` and `col_offset` attributes) from
*old_node* to *new_node* if possible, and return *new_node*. | Copy source location (`lineno` and `col_offset` attributes) from
*old_node* to *new_node* if possible, and return *new_node*. | [
"Copy",
"source",
"location",
"(",
"lineno",
"and",
"col_offset",
"attributes",
")",
"from",
"*",
"old_node",
"*",
"to",
"*",
"new_node",
"*",
"if",
"possible",
"and",
"return",
"*",
"new_node",
"*",
"."
] | def copy_location(new_node, old_node):
"""
Copy source location (`lineno` and `col_offset` attributes) from
*old_node* to *new_node* if possible, and return *new_node*.
"""
for attr in 'lineno', 'col_offset':
if attr in old_node._attributes and attr in new_node._attributes \
and h... | [
"def",
"copy_location",
"(",
"new_node",
",",
"old_node",
")",
":",
"for",
"attr",
"in",
"'lineno'",
",",
"'col_offset'",
":",
"if",
"attr",
"in",
"old_node",
".",
"_attributes",
"and",
"attr",
"in",
"new_node",
".",
"_attributes",
"and",
"hasattr",
"(",
"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/ast.py#L133-L142 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/autograph/impl/conversion.py | python | is_unsupported | (o) | return False | Checks whether an entity is supported by AutoGraph at all. | Checks whether an entity is supported by AutoGraph at all. | [
"Checks",
"whether",
"an",
"entity",
"is",
"supported",
"by",
"AutoGraph",
"at",
"all",
"."
] | def is_unsupported(o):
"""Checks whether an entity is supported by AutoGraph at all."""
# TODO(b/122265385): Remove this bypass.
if (_is_known_loaded_type(o, 'wrapt', 'FunctionWrapper') or
_is_known_loaded_type(o, 'wrapt', 'BoundFunctionWrapper')):
logging.warning(
'{} appears to be decorated b... | [
"def",
"is_unsupported",
"(",
"o",
")",
":",
"# TODO(b/122265385): Remove this bypass.",
"if",
"(",
"_is_known_loaded_type",
"(",
"o",
",",
"'wrapt'",
",",
"'FunctionWrapper'",
")",
"or",
"_is_known_loaded_type",
"(",
"o",
",",
"'wrapt'",
",",
"'BoundFunctionWrapper'"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/autograph/impl/conversion.py#L69-L108 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_controls.py | python | ListCtrl.GetItem | (*args, **kwargs) | return val | GetItem(self, long itemId, int col=0) -> ListItem | GetItem(self, long itemId, int col=0) -> ListItem | [
"GetItem",
"(",
"self",
"long",
"itemId",
"int",
"col",
"=",
"0",
")",
"-",
">",
"ListItem"
] | def GetItem(*args, **kwargs):
"""GetItem(self, long itemId, int col=0) -> ListItem"""
val = _controls_.ListCtrl_GetItem(*args, **kwargs)
if val is not None: val.thisown = 1
return val | [
"def",
"GetItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_controls_",
".",
"ListCtrl_GetItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"if",
"val",
"is",
"not",
"None",
":",
"val",
".",
"thisown",
"=",
"1",
"ret... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L4509-L4513 | |
TimoSaemann/caffe-segnet-cudnn5 | abcf30dca449245e101bf4ced519f716177f0885 | scripts/cpp_lint.py | python | CheckForMultilineCommentsAndStrings | (filename, clean_lines, linenum, error) | Logs an error if we see /* ... */ or "..." that extend past one line.
/* ... */ comments are legit inside macros, for one line.
Otherwise, we prefer // comments, so it's ok to warn about the
other. Likewise, it's ok for strings to extend across multiple
lines, as long as a line continuation character (backsla... | Logs an error if we see /* ... */ or "..." that extend past one line. | [
"Logs",
"an",
"error",
"if",
"we",
"see",
"/",
"*",
"...",
"*",
"/",
"or",
"...",
"that",
"extend",
"past",
"one",
"line",
"."
] | def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
"""Logs an error if we see /* ... */ or "..." that extend past one line.
/* ... */ comments are legit inside macros, for one line.
Otherwise, we prefer // comments, so it's ok to warn about the
other. Likewise, it's ok for strings... | [
"def",
"CheckForMultilineCommentsAndStrings",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Remove all \\\\ (escaped backslashes) from the line. They are OK, and the",
"# secon... | https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/scripts/cpp_lint.py#L1526-L1561 | ||
Tencent/CMONGO | c40380caa14e05509f46993aa8b8da966b09b0b5 | buildscripts/cpplint.py | python | _SetFilters | (filters) | Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die. | Sets the module's error-message filters. | [
"Sets",
"the",
"module",
"s",
"error",
"-",
"message",
"filters",
"."
] | def _SetFilters(filters):
"""Sets the module's error-message filters.
These filters are applied when deciding whether to emit a given
error message.
Args:
filters: A string of comma-separated filters (eg "whitespace/indent").
Each filter should start with + or -; else we die.
"""
_cpplint... | [
"def",
"_SetFilters",
"(",
"filters",
")",
":",
"_cpplint_state",
".",
"SetFilters",
"(",
"filters",
")"
] | https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/buildscripts/cpplint.py#L876-L886 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tree.py | python | TreeItem.__init__ | (self) | Constructor. Do whatever you need to do. | Constructor. Do whatever you need to do. | [
"Constructor",
".",
"Do",
"whatever",
"you",
"need",
"to",
"do",
"."
] | def __init__(self):
"""Constructor. Do whatever you need to do.""" | [
"def",
"__init__",
"(",
"self",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/tree.py#L342-L343 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/lazy_wheel.py | python | LazyZipOverHTTP.writable | (self) | return False | Return False. | Return False. | [
"Return",
"False",
"."
] | def writable(self):
# type: () -> bool
"""Return False."""
return False | [
"def",
"writable",
"(",
"self",
")",
":",
"# type: () -> bool",
"return",
"False"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_internal/network/lazy_wheel.py#L146-L149 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/math/symbolic.py | python | is_scalar | (v,value=None) | Returns True if v evaluates to a scalar. If value is provided, then
returns True only if v evaluates to be equal to value | Returns True if v evaluates to a scalar. If value is provided, then
returns True only if v evaluates to be equal to value | [
"Returns",
"True",
"if",
"v",
"evaluates",
"to",
"a",
"scalar",
".",
"If",
"value",
"is",
"provided",
"then",
"returns",
"True",
"only",
"if",
"v",
"evaluates",
"to",
"be",
"equal",
"to",
"value"
] | def is_scalar(v,value=None):
"""Returns True if v evaluates to a scalar. If value is provided, then
returns True only if v evaluates to be equal to value"""
if isinstance(v,Variable):
if not v.type.is_scalar(): return False
return value is None or v.value == value
elif isinstance(v,Cons... | [
"def",
"is_scalar",
"(",
"v",
",",
"value",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"Variable",
")",
":",
"if",
"not",
"v",
".",
"type",
".",
"is_scalar",
"(",
")",
":",
"return",
"False",
"return",
"value",
"is",
"None",
"or",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/math/symbolic.py#L4463-L4478 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/site_compare/command_line.py | python | Command.AddArgument | (self, names, helptext, type="string", metaname=None,
required=False, default=None, positional=False) | return arg | Command-line argument to a command.
Args:
names: argument name, or list of synonyms
helptext: brief description of the argument
type: type of the argument
metaname: Name to display for value in help, inferred if not
required: True if argument must be specified
d... | Command-line argument to a command. | [
"Command",
"-",
"line",
"argument",
"to",
"a",
"command",
"."
] | def AddArgument(self, names, helptext, type="string", metaname=None,
required=False, default=None, positional=False):
"""Command-line argument to a command.
Args:
names: argument name, or list of synonyms
helptext: brief description of the argument
type: type of... | [
"def",
"AddArgument",
"(",
"self",
",",
"names",
",",
"helptext",
",",
"type",
"=",
"\"string\"",
",",
"metaname",
"=",
"None",
",",
"required",
"=",
"False",
",",
"default",
"=",
"None",
",",
"positional",
"=",
"False",
")",
":",
"if",
"IsString",
"("... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/site_compare/command_line.py#L180-L221 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Draft/draftobjects/draftlink.py | python | DraftLink.canLinkProperties | (self, _obj) | return False | Link properties.
TODO: add more explanation. Overrides a C++ method? | Link properties. | [
"Link",
"properties",
"."
] | def canLinkProperties(self, _obj):
"""Link properties.
TODO: add more explanation. Overrides a C++ method?
"""
return False | [
"def",
"canLinkProperties",
"(",
"self",
",",
"_obj",
")",
":",
"return",
"False"
] | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftobjects/draftlink.py#L85-L90 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/ordered_set.py | python | OrderedSet.__reversed__ | (self) | return reversed(self.items) | Example:
>>> list(reversed(OrderedSet([1, 2, 3])))
[3, 2, 1] | Example:
>>> list(reversed(OrderedSet([1, 2, 3])))
[3, 2, 1] | [
"Example",
":",
">>>",
"list",
"(",
"reversed",
"(",
"OrderedSet",
"(",
"[",
"1",
"2",
"3",
"]",
")))",
"[",
"3",
"2",
"1",
"]"
] | def __reversed__(self):
"""
Example:
>>> list(reversed(OrderedSet([1, 2, 3])))
[3, 2, 1]
"""
return reversed(self.items) | [
"def",
"__reversed__",
"(",
"self",
")",
":",
"return",
"reversed",
"(",
"self",
".",
"items",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/_vendor/ordered_set.py#L267-L273 | |
javafxports/openjdk-jfx | 6eabc8c84f698c04548395826a8bb738087666b5 | modules/javafx.web/src/main/native/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py | python | UdOpcodeTables.walk | (self, tbl, opcodes) | return e | Walk down the opcode trie, starting at a given opcode
table, given a string of opcodes. Return None if unable
to walk, the object at the leaf otherwise. | Walk down the opcode trie, starting at a given opcode
table, given a string of opcodes. Return None if unable
to walk, the object at the leaf otherwise. | [
"Walk",
"down",
"the",
"opcode",
"trie",
"starting",
"at",
"a",
"given",
"opcode",
"table",
"given",
"a",
"string",
"of",
"opcodes",
".",
"Return",
"None",
"if",
"unable",
"to",
"walk",
"the",
"object",
"at",
"the",
"leaf",
"otherwise",
"."
] | def walk(self, tbl, opcodes):
"""Walk down the opcode trie, starting at a given opcode
table, given a string of opcodes. Return None if unable
to walk, the object at the leaf otherwise.
"""
opc = opcodes[0]
e = tbl.lookup(opc)
if e is None:
ret... | [
"def",
"walk",
"(",
"self",
",",
"tbl",
",",
"opcodes",
")",
":",
"opc",
"=",
"opcodes",
"[",
"0",
"]",
"e",
"=",
"tbl",
".",
"lookup",
"(",
"opc",
")",
"if",
"e",
"is",
"None",
":",
"return",
"None",
"elif",
"isinstance",
"(",
"e",
",",
"UdOpc... | https://github.com/javafxports/openjdk-jfx/blob/6eabc8c84f698c04548395826a8bb738087666b5/modules/javafx.web/src/main/native/Source/JavaScriptCore/disassembler/udis86/ud_opcode.py#L279-L290 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.AutoCompComplete | (*args, **kwargs) | return _stc.StyledTextCtrl_AutoCompComplete(*args, **kwargs) | AutoCompComplete(self)
User has selected an item so remove the list and insert the selection. | AutoCompComplete(self) | [
"AutoCompComplete",
"(",
"self",
")"
] | def AutoCompComplete(*args, **kwargs):
"""
AutoCompComplete(self)
User has selected an item so remove the list and insert the selection.
"""
return _stc.StyledTextCtrl_AutoCompComplete(*args, **kwargs) | [
"def",
"AutoCompComplete",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_AutoCompComplete",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L3062-L3068 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py | python | Path.touch | (self, mode=0o666, exist_ok=True) | Create this file with the given access mode, if it doesn't exist. | Create this file with the given access mode, if it doesn't exist. | [
"Create",
"this",
"file",
"with",
"the",
"given",
"access",
"mode",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | def touch(self, mode=0o666, exist_ok=True):
"""
Create this file with the given access mode, if it doesn't exist.
"""
if self._closed:
self._raise_closed()
if exist_ok:
# First try to bump modification time
# Implementation note: GNU touch uses... | [
"def",
"touch",
"(",
"self",
",",
"mode",
"=",
"0o666",
",",
"exist_ok",
"=",
"True",
")",
":",
"if",
"self",
".",
"_closed",
":",
"self",
".",
"_raise_closed",
"(",
")",
"if",
"exist_ok",
":",
"# First try to bump modification time",
"# Implementation note: G... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pathlib.py#L1243-L1264 | ||
QMCPACK/qmcpack | d0948ab455e38364458740cc8e2239600a14c5cd | utils/afqmctools/afqmctools/utils/qe_driver.py | python | gen_qe_gto | (qe_info,bset,x=[],
fname='pyscf.orbitals.h5',prec=1e-12) | return nao | Writes periodic AO basis set in real space to hdf5 file.
This routine constructs a new gaussian basis set from a OptimizableBasisSet
object and an array of optimizable parameters.
With the resulting basis set, a new gto.Cell object is constructed consistent
with the QE calculation and ... | Writes periodic AO basis set in real space to hdf5 file.
This routine constructs a new gaussian basis set from a OptimizableBasisSet
object and an array of optimizable parameters.
With the resulting basis set, a new gto.Cell object is constructed consistent
with the QE calculation and ... | [
"Writes",
"periodic",
"AO",
"basis",
"set",
"in",
"real",
"space",
"to",
"hdf5",
"file",
".",
"This",
"routine",
"constructs",
"a",
"new",
"gaussian",
"basis",
"set",
"from",
"a",
"OptimizableBasisSet",
"object",
"and",
"an",
"array",
"of",
"optimizable",
"p... | def gen_qe_gto(qe_info,bset,x=[],
fname='pyscf.orbitals.h5',prec=1e-12):
""" Writes periodic AO basis set in real space to hdf5 file.
This routine constructs a new gaussian basis set from a OptimizableBasisSet
object and an array of optimizable parameters.
With the resulting ... | [
"def",
"gen_qe_gto",
"(",
"qe_info",
",",
"bset",
",",
"x",
"=",
"[",
"]",
",",
"fname",
"=",
"'pyscf.orbitals.h5'",
",",
"prec",
"=",
"1e-12",
")",
":",
"assert",
"(",
"len",
"(",
"x",
")",
"==",
"bset",
".",
"number_of_params",
")",
"basis",
"=",
... | https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/utils/afqmctools/afqmctools/utils/qe_driver.py#L270-L309 | |
facebookincubator/katran | 192eb988c398afc673620254097defb7035d669e | build/fbcode_builder/getdeps/copytree.py | python | copytree | (src_dir, dest_dir, ignore=None) | return shutil.copytree(src_dir, dest_dir, ignore=ignore) | Recursively copy the src_dir to the dest_dir, filtering
out entries using the ignore lambda. The behavior of the
ignore lambda must match that described by `shutil.copytree`.
This `copytree` function knows how to prefetch data when
running in an eden repo.
TODO: I'd like to either extend this or ad... | Recursively copy the src_dir to the dest_dir, filtering
out entries using the ignore lambda. The behavior of the
ignore lambda must match that described by `shutil.copytree`.
This `copytree` function knows how to prefetch data when
running in an eden repo.
TODO: I'd like to either extend this or ad... | [
"Recursively",
"copy",
"the",
"src_dir",
"to",
"the",
"dest_dir",
"filtering",
"out",
"entries",
"using",
"the",
"ignore",
"lambda",
".",
"The",
"behavior",
"of",
"the",
"ignore",
"lambda",
"must",
"match",
"that",
"described",
"by",
"shutil",
".",
"copytree",... | def copytree(src_dir, dest_dir, ignore=None):
"""Recursively copy the src_dir to the dest_dir, filtering
out entries using the ignore lambda. The behavior of the
ignore lambda must match that described by `shutil.copytree`.
This `copytree` function knows how to prefetch data when
running in an eden... | [
"def",
"copytree",
"(",
"src_dir",
",",
"dest_dir",
",",
"ignore",
"=",
"None",
")",
":",
"prefetch_dir_if_eden",
"(",
"src_dir",
")",
"return",
"shutil",
".",
"copytree",
"(",
"src_dir",
",",
"dest_dir",
",",
"ignore",
"=",
"ignore",
")"
] | https://github.com/facebookincubator/katran/blob/192eb988c398afc673620254097defb7035d669e/build/fbcode_builder/getdeps/copytree.py#L68-L78 | |
hfinkel/llvm-project-cxxjit | 91084ef018240bbb8e24235ff5cd8c355a9c1a1e | lldb/third_party/Python/module/pexpect-2.4/pxssh.py | python | pxssh.login | (
self,
server,
username,
password='',
terminal_type='ansi',
original_prompt=r"[#$]",
login_timeout=10,
port=None,
auto_prompt_reset=True) | return True | This logs the user into the given server. It uses the
'original_prompt' to try to find the prompt right after login. When it
finds the prompt it immediately tries to reset the prompt to something
more easily matched. The default 'original_prompt' is very optimistic
and is easily fooled. ... | This logs the user into the given server. It uses the
'original_prompt' to try to find the prompt right after login. When it
finds the prompt it immediately tries to reset the prompt to something
more easily matched. The default 'original_prompt' is very optimistic
and is easily fooled. ... | [
"This",
"logs",
"the",
"user",
"into",
"the",
"given",
"server",
".",
"It",
"uses",
"the",
"original_prompt",
"to",
"try",
"to",
"find",
"the",
"prompt",
"right",
"after",
"login",
".",
"When",
"it",
"finds",
"the",
"prompt",
"it",
"immediately",
"tries",
... | def login(
self,
server,
username,
password='',
terminal_type='ansi',
original_prompt=r"[#$]",
login_timeout=10,
port=None,
auto_prompt_reset=True):
"""This logs the user into the given server. It uses th... | [
"def",
"login",
"(",
"self",
",",
"server",
",",
"username",
",",
"password",
"=",
"''",
",",
"terminal_type",
"=",
"'ansi'",
",",
"original_prompt",
"=",
"r\"[#$]\"",
",",
"login_timeout",
"=",
"10",
",",
"port",
"=",
"None",
",",
"auto_prompt_reset",
"="... | https://github.com/hfinkel/llvm-project-cxxjit/blob/91084ef018240bbb8e24235ff5cd8c355a9c1a1e/lldb/third_party/Python/module/pexpect-2.4/pxssh.py#L178-L315 | |
plaidml/plaidml | f3c6681db21460e5fdc11ae651d6d7b6c27f8262 | cmake/git-clang-format.py | python | extract_lines | (patch_file) | return matches | Extract the changed lines in `patch_file`.
The return value is a dictionary mapping filename to a list of (start_line,
line_count) pairs.
The input must have been produced with ``-U0``, meaning unidiff format with
zero lines of context. The return value is a dict mapping filename to a
list of line `Range`s... | Extract the changed lines in `patch_file`. | [
"Extract",
"the",
"changed",
"lines",
"in",
"patch_file",
"."
] | def extract_lines(patch_file):
"""Extract the changed lines in `patch_file`.
The return value is a dictionary mapping filename to a list of (start_line,
line_count) pairs.
The input must have been produced with ``-U0``, meaning unidiff format with
zero lines of context. The return value is a dict mapping... | [
"def",
"extract_lines",
"(",
"patch_file",
")",
":",
"matches",
"=",
"{",
"}",
"for",
"line",
"in",
"patch_file",
":",
"line",
"=",
"convert_string",
"(",
"line",
")",
"match",
"=",
"re",
".",
"search",
"(",
"r'^\\+\\+\\+\\ [^/]+/(.*)'",
",",
"line",
")",
... | https://github.com/plaidml/plaidml/blob/f3c6681db21460e5fdc11ae651d6d7b6c27f8262/cmake/git-clang-format.py#L304-L327 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/google_appengine_cloudstorage/cloudstorage/cloudstorage_api.py | python | _Bucket._next_file_gen | (self, root) | Generator for next file element in the document.
Args:
root: root element of the XML tree.
Yields:
GCSFileStat for the next file. | Generator for next file element in the document. | [
"Generator",
"for",
"next",
"file",
"element",
"in",
"the",
"document",
"."
] | def _next_file_gen(self, root):
"""Generator for next file element in the document.
Args:
root: root element of the XML tree.
Yields:
GCSFileStat for the next file.
"""
for e in root.getiterator(common._T_CONTENTS):
st_ctime, size, etag, key = None, None, None, None
for chi... | [
"def",
"_next_file_gen",
"(",
"self",
",",
"root",
")",
":",
"for",
"e",
"in",
"root",
".",
"getiterator",
"(",
"common",
".",
"_T_CONTENTS",
")",
":",
"st_ctime",
",",
"size",
",",
"etag",
",",
"key",
"=",
"None",
",",
"None",
",",
"None",
",",
"N... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/google_appengine_cloudstorage/cloudstorage/cloudstorage_api.py#L358-L381 | ||
hughperkins/tf-coriander | 970d3df6c11400ad68405f22b0c42a52374e94ca | tensorflow/contrib/layers/python/layers/layers.py | python | fully_connected | (inputs,
num_outputs,
activation_fn=nn.relu,
normalizer_fn=None,
normalizer_params=None,
weights_initializer=initializers.xavier_initializer(),
weights_regularizer=None,
biases_ini... | Adds a fully connected layer.
`fully_connected` creates a variable called `weights`, representing a fully
connected weight matrix, which is multiplied by the `inputs` to produce a
`Tensor` of hidden units. If a `normalizer_fn` is provided (such as
`batch_norm`), it is then applied. Otherwise, if `normalizer_fn... | Adds a fully connected layer. | [
"Adds",
"a",
"fully",
"connected",
"layer",
"."
] | def fully_connected(inputs,
num_outputs,
activation_fn=nn.relu,
normalizer_fn=None,
normalizer_params=None,
weights_initializer=initializers.xavier_initializer(),
weights_regularizer=None,
... | [
"def",
"fully_connected",
"(",
"inputs",
",",
"num_outputs",
",",
"activation_fn",
"=",
"nn",
".",
"relu",
",",
"normalizer_fn",
"=",
"None",
",",
"normalizer_params",
"=",
"None",
",",
"weights_initializer",
"=",
"initializers",
".",
"xavier_initializer",
"(",
... | https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/layers/python/layers/layers.py#L854-L962 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/buildscripts/linter/git.py | python | get_files_to_check_from_patch | (patches, filter_function) | return valid_files | Take a patch file generated by git diff, and scan the patch for a list of files to check. | Take a patch file generated by git diff, and scan the patch for a list of files to check. | [
"Take",
"a",
"patch",
"file",
"generated",
"by",
"git",
"diff",
"and",
"scan",
"the",
"patch",
"for",
"a",
"list",
"of",
"files",
"to",
"check",
"."
] | def get_files_to_check_from_patch(patches, filter_function):
# type: (List[str], Callable[[str], bool]) -> List[str]
"""Take a patch file generated by git diff, and scan the patch for a list of files to check."""
candidates = [] # type: List[str]
# Get a list of candidate_files
check = re.compile(... | [
"def",
"get_files_to_check_from_patch",
"(",
"patches",
",",
"filter_function",
")",
":",
"# type: (List[str], Callable[[str], bool]) -> List[str]",
"candidates",
"=",
"[",
"]",
"# type: List[str]",
"# Get a list of candidate_files",
"check",
"=",
"re",
".",
"compile",
"(",
... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/buildscripts/linter/git.py#L168-L189 | |
nasa/astrobee | 9241e67e6692810d6e275abb3165b6d02f4ca5ef | scripts/git/cpplint.py | python | _FunctionState.End | (self) | Stop analyzing function body. | Stop analyzing function body. | [
"Stop",
"analyzing",
"function",
"body",
"."
] | def End(self):
"""Stop analyzing function body."""
self.in_a_function = False | [
"def",
"End",
"(",
"self",
")",
":",
"self",
".",
"in_a_function",
"=",
"False"
] | https://github.com/nasa/astrobee/blob/9241e67e6692810d6e275abb3165b6d02f4ca5ef/scripts/git/cpplint.py#L1004-L1006 | ||
google-ar/WebARonTango | e86965d2cbc652156b480e0fcf77c716745578cd | chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py | python | Function.WriteGLES2ImplementationHeader | (self, f) | Writes the GLES2 Implemention declaration. | Writes the GLES2 Implemention declaration. | [
"Writes",
"the",
"GLES2",
"Implemention",
"declaration",
"."
] | def WriteGLES2ImplementationHeader(self, f):
"""Writes the GLES2 Implemention declaration."""
self.type_handler.WriteGLES2ImplementationHeader(self, f) | [
"def",
"WriteGLES2ImplementationHeader",
"(",
"self",
",",
"f",
")",
":",
"self",
".",
"type_handler",
".",
"WriteGLES2ImplementationHeader",
"(",
"self",
",",
"f",
")"
] | https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L9643-L9645 | ||
KhronosGroup/SPIR | f33c27876d9f3d5810162b60fa89cc13d2b55725 | bindings/python/clang/cindex.py | python | SourceLocation.offset | (self) | return self._get_instantiation()[3] | Get the file offset represented by this source location. | Get the file offset represented by this source location. | [
"Get",
"the",
"file",
"offset",
"represented",
"by",
"this",
"source",
"location",
"."
] | def offset(self):
"""Get the file offset represented by this source location."""
return self._get_instantiation()[3] | [
"def",
"offset",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_instantiation",
"(",
")",
"[",
"3",
"]"
] | https://github.com/KhronosGroup/SPIR/blob/f33c27876d9f3d5810162b60fa89cc13d2b55725/bindings/python/clang/cindex.py#L213-L215 | |
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | third_party/numpy/files/numpy/numarray/session.py | python | _callers_modules | () | return mods | returns a list containing the names of all the modules in the caller's
global namespace. | returns a list containing the names of all the modules in the caller's
global namespace. | [
"returns",
"a",
"list",
"containing",
"the",
"names",
"of",
"all",
"the",
"modules",
"in",
"the",
"caller",
"s",
"global",
"namespace",
"."
] | def _callers_modules():
"""returns a list containing the names of all the modules in the caller's
global namespace."""
g = _callers_globals()
mods = []
for k,v in g.items():
if type(v) == type(sys):
mods.append(getattr(v,"__name__"))
return mods | [
"def",
"_callers_modules",
"(",
")",
":",
"g",
"=",
"_callers_globals",
"(",
")",
"mods",
"=",
"[",
"]",
"for",
"k",
",",
"v",
"in",
"g",
".",
"items",
"(",
")",
":",
"if",
"type",
"(",
"v",
")",
"==",
"type",
"(",
"sys",
")",
":",
"mods",
".... | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/numarray/session.py#L116-L124 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py | python | MainWindow.do_sync_ub | (self) | Purpose: synchronize UB matrix in use with UB matrix calculated.
Requirements: One of these must be given
1. a valid UB matrix from tableWidget_ubMatrix
2. an ascii file that contains 9 float
3. from text edit
:return: | Purpose: synchronize UB matrix in use with UB matrix calculated.
Requirements: One of these must be given
1. a valid UB matrix from tableWidget_ubMatrix
2. an ascii file that contains 9 float
3. from text edit
:return: | [
"Purpose",
":",
"synchronize",
"UB",
"matrix",
"in",
"use",
"with",
"UB",
"matrix",
"calculated",
".",
"Requirements",
":",
"One",
"of",
"these",
"must",
"be",
"given",
"1",
".",
"a",
"valid",
"UB",
"matrix",
"from",
"tableWidget_ubMatrix",
"2",
".",
"an",... | def do_sync_ub(self):
""" Purpose: synchronize UB matrix in use with UB matrix calculated.
Requirements: One of these must be given
1. a valid UB matrix from tableWidget_ubMatrix
2. an ascii file that contains 9 float
3. from text edit
:return:
"""
# get t... | [
"def",
"do_sync_ub",
"(",
"self",
")",
":",
"# get the radio button that is checked",
"if",
"self",
".",
"ui",
".",
"radioButton_ubFromTab1",
".",
"isChecked",
"(",
")",
":",
"# get ub matrix from tab 'Calculate UB Matrix'",
"ub_matrix",
"=",
"self",
".",
"ui",
".",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/HFIR_4Circle_Reduction/reduce4circleGUI.py#L3052-L3081 | ||
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/NERO/agent.py | python | NEATAgent.__init__ | (self, team_type, *args) | Create an agent brain | Create an agent brain | [
"Create",
"an",
"agent",
"brain"
] | def __init__(self, team_type, *args):
"""
Create an agent brain
"""
# this line is crucial, otherwise the class is not recognized as an
# AgentBrainPtr by C++
OpenNero.AgentBrain.__init__(self)
NeroAgent.__init__(self, team_type)
self.omit_friend_sensors... | [
"def",
"__init__",
"(",
"self",
",",
"team_type",
",",
"*",
"args",
")",
":",
"# this line is crucial, otherwise the class is not recognized as an",
"# AgentBrainPtr by C++",
"OpenNero",
".",
"AgentBrain",
".",
"__init__",
"(",
"self",
")",
"NeroAgent",
".",
"__init__",... | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/NERO/agent.py#L44-L62 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pytree.py | python | WildcardPattern.generate_matches | (self, nodes) | Generator yielding matches for a sequence of nodes.
Args:
nodes: sequence of nodes
Yields:
(count, results) tuples where:
count: the match comprises nodes[:count];
results: dict containing named submatches. | Generator yielding matches for a sequence of nodes. | [
"Generator",
"yielding",
"matches",
"for",
"a",
"sequence",
"of",
"nodes",
"."
] | def generate_matches(self, nodes):
"""
Generator yielding matches for a sequence of nodes.
Args:
nodes: sequence of nodes
Yields:
(count, results) tuples where:
count: the match comprises nodes[:count];
results: dict containing named subm... | [
"def",
"generate_matches",
"(",
"self",
",",
"nodes",
")",
":",
"if",
"self",
".",
"content",
"is",
"None",
":",
"# Shortcut for special case (see __init__.__doc__)",
"for",
"count",
"in",
"xrange",
"(",
"self",
".",
"min",
",",
"1",
"+",
"min",
"(",
"len",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib2to3/pytree.py#L722-L765 | ||
apache/kudu | 90895ce76590f10730ad7aac3613b69d89ff5422 | src/kudu/scripts/parse_metrics_log.py | python | cache_hit_ratio | (aggregated_prev, aggregated_cur) | return cache_ratio | Calculate the cache hit ratio between the two samples.
If there were no cache hits or misses, this returns NaN. | Calculate the cache hit ratio between the two samples.
If there were no cache hits or misses, this returns NaN. | [
"Calculate",
"the",
"cache",
"hit",
"ratio",
"between",
"the",
"two",
"samples",
".",
"If",
"there",
"were",
"no",
"cache",
"hits",
"or",
"misses",
"this",
"returns",
"NaN",
"."
] | def cache_hit_ratio(aggregated_prev, aggregated_cur):
"""
Calculate the cache hit ratio between the two samples.
If there were no cache hits or misses, this returns NaN.
"""
delta_hits = delta(aggregated_prev, aggregated_cur, 'server.block_cache_hits_caching')
delta_misses = delta(aggregated_prev, aggregate... | [
"def",
"cache_hit_ratio",
"(",
"aggregated_prev",
",",
"aggregated_cur",
")",
":",
"delta_hits",
"=",
"delta",
"(",
"aggregated_prev",
",",
"aggregated_cur",
",",
"'server.block_cache_hits_caching'",
")",
"delta_misses",
"=",
"delta",
"(",
"aggregated_prev",
",",
"agg... | https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/src/kudu/scripts/parse_metrics_log.py#L199-L210 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/network/download.py | python | sanitize_content_filename | (filename) | return os.path.basename(filename) | Sanitize the "filename" value from a Content-Disposition header. | Sanitize the "filename" value from a Content-Disposition header. | [
"Sanitize",
"the",
"filename",
"value",
"from",
"a",
"Content",
"-",
"Disposition",
"header",
"."
] | def sanitize_content_filename(filename):
# type: (str) -> str
"""
Sanitize the "filename" value from a Content-Disposition header.
"""
return os.path.basename(filename) | [
"def",
"sanitize_content_filename",
"(",
"filename",
")",
":",
"# type: (str) -> str",
"return",
"os",
".",
"path",
".",
"basename",
"(",
"filename",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/network/download.py#L81-L86 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | RichTextPrintout.GetRichTextBuffer | (*args, **kwargs) | return _richtext.RichTextPrintout_GetRichTextBuffer(*args, **kwargs) | GetRichTextBuffer(self) -> RichTextBuffer | GetRichTextBuffer(self) -> RichTextBuffer | [
"GetRichTextBuffer",
"(",
"self",
")",
"-",
">",
"RichTextBuffer"
] | def GetRichTextBuffer(*args, **kwargs):
"""GetRichTextBuffer(self) -> RichTextBuffer"""
return _richtext.RichTextPrintout_GetRichTextBuffer(*args, **kwargs) | [
"def",
"GetRichTextBuffer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_richtext",
".",
"RichTextPrintout_GetRichTextBuffer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4461-L4463 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/ops/variables.py | python | RefVariable.scatter_max | (self, sparse_delta, use_locking=False, name=None) | return gen_state_ops.scatter_max(
self._variable,
sparse_delta.indices,
sparse_delta.values,
use_locking=use_locking,
name=name) | Updates this variable with the max of `tf.IndexedSlices` and itself.
Args:
sparse_delta: `tf.IndexedSlices` to use as an argument of max with this
variable.
use_locking: If `True`, use locking during the operation.
name: the name of the operation.
Returns:
A `Tensor` that will ... | Updates this variable with the max of `tf.IndexedSlices` and itself. | [
"Updates",
"this",
"variable",
"with",
"the",
"max",
"of",
"tf",
".",
"IndexedSlices",
"and",
"itself",
"."
] | def scatter_max(self, sparse_delta, use_locking=False, name=None):
"""Updates this variable with the max of `tf.IndexedSlices` and itself.
Args:
sparse_delta: `tf.IndexedSlices` to use as an argument of max with this
variable.
use_locking: If `True`, use locking during the operation.
... | [
"def",
"scatter_max",
"(",
"self",
",",
"sparse_delta",
",",
"use_locking",
"=",
"False",
",",
"name",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"sparse_delta",
",",
"indexed_slices",
".",
"IndexedSlices",
")",
":",
"raise",
"TypeError",
"(",
... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/variables.py#L2147-L2170 | |
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/dataset/engine/validators.py | python | check_celebadataset | (method) | return new_method | A wrapper that wraps a parameter checker around the original Dataset(CelebADataset). | A wrapper that wraps a parameter checker around the original Dataset(CelebADataset). | [
"A",
"wrapper",
"that",
"wraps",
"a",
"parameter",
"checker",
"around",
"the",
"original",
"Dataset",
"(",
"CelebADataset",
")",
"."
] | def check_celebadataset(method):
"""A wrapper that wraps a parameter checker around the original Dataset(CelebADataset)."""
@wraps(method)
def new_method(self, *args, **kwargs):
_, param_dict = parse_user_args(method, *args, **kwargs)
nreq_param_int = ['num_samples', 'num_parallel_workers'... | [
"def",
"check_celebadataset",
"(",
"method",
")",
":",
"@",
"wraps",
"(",
"method",
")",
"def",
"new_method",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_",
",",
"param_dict",
"=",
"parse_user_args",
"(",
"method",
",",
"*",
"... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/engine/validators.py#L632-L668 | |
telefonicaid/fiware-orion | 27c3202b9ddcfb9e3635a0af8d373f76e89b1d24 | scripts/cpplint.py | python | GetPreviousNonBlankLine | (clean_lines, linenum) | return ('', -1) | Return the most recent non-blank line and its line number.
Args:
clean_lines: A CleansedLines instance containing the file contents.
linenum: The number of the line to check.
Returns:
A tuple with two elements. The first element is the contents of the last
non-blank line before the current line, ... | Return the most recent non-blank line and its line number. | [
"Return",
"the",
"most",
"recent",
"non",
"-",
"blank",
"line",
"and",
"its",
"line",
"number",
"."
] | def GetPreviousNonBlankLine(clean_lines, linenum):
"""Return the most recent non-blank line and its line number.
Args:
clean_lines: A CleansedLines instance containing the file contents.
linenum: The number of the line to check.
Returns:
A tuple with two elements. The first element is the contents ... | [
"def",
"GetPreviousNonBlankLine",
"(",
"clean_lines",
",",
"linenum",
")",
":",
"prevlinenum",
"=",
"linenum",
"-",
"1",
"while",
"prevlinenum",
">=",
"0",
":",
"prevline",
"=",
"clean_lines",
".",
"elided",
"[",
"prevlinenum",
"]",
"if",
"not",
"IsBlankLine",... | https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/cpplint.py#L1970-L1990 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/bundy/component.py | python | BaseComponent.set_restart_time | (self) | Calculates and sets the time this component should be restarted.
Currently, it uses a very basic algorithm; start time +
RESTART_DELAY (10 seconds). This algorithm may be improved upon
in the future. | Calculates and sets the time this component should be restarted.
Currently, it uses a very basic algorithm; start time +
RESTART_DELAY (10 seconds). This algorithm may be improved upon
in the future. | [
"Calculates",
"and",
"sets",
"the",
"time",
"this",
"component",
"should",
"be",
"restarted",
".",
"Currently",
"it",
"uses",
"a",
"very",
"basic",
"algorithm",
";",
"start",
"time",
"+",
"RESTART_DELAY",
"(",
"10",
"seconds",
")",
".",
"This",
"algorithm",
... | def set_restart_time(self):
"""Calculates and sets the time this component should be restarted.
Currently, it uses a very basic algorithm; start time +
RESTART_DELAY (10 seconds). This algorithm may be improved upon
in the future.
"""
self._restart_at = self.__st... | [
"def",
"set_restart_time",
"(",
"self",
")",
":",
"self",
".",
"_restart_at",
"=",
"self",
".",
"__start_time",
"+",
"COMPONENT_RESTART_DELAY"
] | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/bundy/component.py#L267-L273 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/distutils/text_file.py | python | TextFile.unreadline | (self, line) | Push 'line' (a string) onto an internal buffer that will be
checked by future 'readline()' calls. Handy for implementing
a parser with line-at-a-time lookahead. | Push 'line' (a string) onto an internal buffer that will be
checked by future 'readline()' calls. Handy for implementing
a parser with line-at-a-time lookahead. | [
"Push",
"line",
"(",
"a",
"string",
")",
"onto",
"an",
"internal",
"buffer",
"that",
"will",
"be",
"checked",
"by",
"future",
"readline",
"()",
"calls",
".",
"Handy",
"for",
"implementing",
"a",
"parser",
"with",
"line",
"-",
"at",
"-",
"a",
"-",
"time... | def unreadline (self, line):
"""Push 'line' (a string) onto an internal buffer that will be
checked by future 'readline()' calls. Handy for implementing
a parser with line-at-a-time lookahead."""
self.linebuf.append (line) | [
"def",
"unreadline",
"(",
"self",
",",
"line",
")",
":",
"self",
".",
"linebuf",
".",
"append",
"(",
"line",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/distutils/text_file.py#L299-L304 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/py2/scipy/interpolate/interpolate.py | python | _do_extrapolate | (fill_value) | return (isinstance(fill_value, string_types) and
fill_value == 'extrapolate') | Helper to check if fill_value == "extrapolate" without warnings | Helper to check if fill_value == "extrapolate" without warnings | [
"Helper",
"to",
"check",
"if",
"fill_value",
"==",
"extrapolate",
"without",
"warnings"
] | def _do_extrapolate(fill_value):
"""Helper to check if fill_value == "extrapolate" without warnings"""
return (isinstance(fill_value, string_types) and
fill_value == 'extrapolate') | [
"def",
"_do_extrapolate",
"(",
"fill_value",
")",
":",
"return",
"(",
"isinstance",
"(",
"fill_value",
",",
"string_types",
")",
"and",
"fill_value",
"==",
"'extrapolate'",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/interpolate/interpolate.py#L339-L342 | |
shedskin/shedskin | ae88dbca7b1d9671cd8be448cb0b497122758936 | examples/block.py | python | findprobs | (f=0.01,N=6) | return answer | Find probabilities of all the events
000000
000001
...
111111
<-N ->
>>> print findprobs(0.1,3) # doctest:+ELLIPSIS
[('000', 0.7...),..., ('111', 0.001...)] | Find probabilities of all the events
000000
000001
...
111111
<-N ->
>>> print findprobs(0.1,3) # doctest:+ELLIPSIS
[('000', 0.7...),..., ('111', 0.001...)] | [
"Find",
"probabilities",
"of",
"all",
"the",
"events",
"000000",
"000001",
"...",
"111111",
"<",
"-",
"N",
"-",
">",
">>>",
"print",
"findprobs",
"(",
"0",
".",
"1",
"3",
")",
"#",
"doctest",
":",
"+",
"ELLIPSIS",
"[",
"(",
"000",
"0",
".",
"7",
... | def findprobs(f=0.01,N=6):
""" Find probabilities of all the events
000000
000001
...
111111
<-N ->
>>> print findprobs(0.1,3) # doctest:+ELLIPSIS
[('000', 0.7...),..., ('111', 0.001...)]
"""
answer = []
for n in range(2**N):
s = dec_to_bin(n,N)
... | [
"def",
"findprobs",
"(",
"f",
"=",
"0.01",
",",
"N",
"=",
"6",
")",
":",
"answer",
"=",
"[",
"]",
"for",
"n",
"in",
"range",
"(",
"2",
"**",
"N",
")",
":",
"s",
"=",
"dec_to_bin",
"(",
"n",
",",
"N",
")",
"(",
"w0",
",",
"w1",
")",
"=",
... | https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/block.py#L265-L284 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/ordered_set.py | python | OrderedSet.union | (self, *sets) | return cls(items) | Combines all unique items.
Each items order is defined by its first appearance.
Example:
>>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0])
>>> print(oset)
OrderedSet([3, 1, 4, 5, 2, 0])
>>> oset.union([8, 9])
OrderedSet(... | Combines all unique items.
Each items order is defined by its first appearance. | [
"Combines",
"all",
"unique",
"items",
".",
"Each",
"items",
"order",
"is",
"defined",
"by",
"its",
"first",
"appearance",
"."
] | def union(self, *sets):
"""
Combines all unique items.
Each items order is defined by its first appearance.
Example:
>>> oset = OrderedSet.union(OrderedSet([3, 1, 4, 1, 5]), [1, 3], [2, 0])
>>> print(oset)
OrderedSet([3, 1, 4, 5, 2, 0])
>>... | [
"def",
"union",
"(",
"self",
",",
"*",
"sets",
")",
":",
"cls",
"=",
"self",
".",
"__class__",
"if",
"isinstance",
"(",
"self",
",",
"OrderedSet",
")",
"else",
"OrderedSet",
"containers",
"=",
"map",
"(",
"list",
",",
"it",
".",
"chain",
"(",
"[",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/ordered_set.py#L310-L327 | |
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/seacas/scripts/exomerge2.py | python | ExodusModel.get_side_set_ids | (self) | return sorted(self.side_sets.keys()) | Return a list of all side set ids.
Example:
>>> model.get_side_set_ids() | Return a list of all side set ids. | [
"Return",
"a",
"list",
"of",
"all",
"side",
"set",
"ids",
"."
] | def get_side_set_ids(self):
"""
Return a list of all side set ids.
Example:
>>> model.get_side_set_ids()
"""
return sorted(self.side_sets.keys()) | [
"def",
"get_side_set_ids",
"(",
"self",
")",
":",
"return",
"sorted",
"(",
"self",
".",
"side_sets",
".",
"keys",
"(",
")",
")"
] | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exomerge2.py#L3310-L3318 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/http/server.py | python | BaseHTTPRequestHandler.handle_one_request | (self) | Handle a single HTTP request.
You normally don't need to override this method; see the class
__doc__ string for information on how to handle specific HTTP
commands such as GET and POST. | Handle a single HTTP request. | [
"Handle",
"a",
"single",
"HTTP",
"request",
"."
] | def handle_one_request(self):
"""Handle a single HTTP request.
You normally don't need to override this method; see the class
__doc__ string for information on how to handle specific HTTP
commands such as GET and POST.
"""
try:
self.raw_requestline = self.rf... | [
"def",
"handle_one_request",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"raw_requestline",
"=",
"self",
".",
"rfile",
".",
"readline",
"(",
"65537",
")",
"if",
"len",
"(",
"self",
".",
"raw_requestline",
")",
">",
"65536",
":",
"self",
".",
"reque... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/http/server.py#L386-L421 | ||
psi4/psi4 | be533f7f426b6ccc263904e55122899b16663395 | psi4/driver/qcdb/dbwrap.py | python | Database.compute_statistics | (self, modelchem, benchmark='default', sset='default',
failoninc=True, verbose=False, returnindiv=False) | Computes summary statistics and, if *returnindiv* True,
individual errors for single model chemistry *modelchem* versus
*benchmark* over subset *sset* over all component databases.
Particularly, imposes cross-database definitions for sset and
modelchem.
#Returns error if model ch... | Computes summary statistics and, if *returnindiv* True,
individual errors for single model chemistry *modelchem* versus
*benchmark* over subset *sset* over all component databases.
Particularly, imposes cross-database definitions for sset and
modelchem.
#Returns error if model ch... | [
"Computes",
"summary",
"statistics",
"and",
"if",
"*",
"returnindiv",
"*",
"True",
"individual",
"errors",
"for",
"single",
"model",
"chemistry",
"*",
"modelchem",
"*",
"versus",
"*",
"benchmark",
"*",
"over",
"subset",
"*",
"sset",
"*",
"over",
"all",
"comp... | def compute_statistics(self, modelchem, benchmark='default', sset='default',
failoninc=True, verbose=False, returnindiv=False):
"""Computes summary statistics and, if *returnindiv* True,
individual errors for single model chemistry *modelchem* versus
*benchmark* over s... | [
"def",
"compute_statistics",
"(",
"self",
",",
"modelchem",
",",
"benchmark",
"=",
"'default'",
",",
"sset",
"=",
"'default'",
",",
"failoninc",
"=",
"True",
",",
"verbose",
"=",
"False",
",",
"returnindiv",
"=",
"False",
")",
":",
"errors",
"=",
"OrderedD... | https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/dbwrap.py#L1659-L1690 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py | python | SBStream.write | (self, *args) | return _lldb.SBStream_write(self, *args) | write(self, str str) | write(self, str str) | [
"write",
"(",
"self",
"str",
"str",
")"
] | def write(self, *args):
"""write(self, str str)"""
return _lldb.SBStream_write(self, *args) | [
"def",
"write",
"(",
"self",
",",
"*",
"args",
")",
":",
"return",
"_lldb",
".",
"SBStream_write",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7965-L7967 | |
hpi-xnor/BMXNet-v2 | af2b1859eafc5c721b1397cef02f946aaf2ce20d | python/mxnet/contrib/onnx/mx2onnx/_op_translations.py | python | convert_concat | (node, **kwargs) | return [concat_node] | Map MXNet's Concat operator attributes to onnx's Concat operator
and return the created node. | Map MXNet's Concat operator attributes to onnx's Concat operator
and return the created node. | [
"Map",
"MXNet",
"s",
"Concat",
"operator",
"attributes",
"to",
"onnx",
"s",
"Concat",
"operator",
"and",
"return",
"the",
"created",
"node",
"."
] | def convert_concat(node, **kwargs):
"""Map MXNet's Concat operator attributes to onnx's Concat operator
and return the created node.
"""
name, input_nodes, attrs = get_inputs(node, kwargs)
axis = int(attrs.get("dim", 1))
concat_node = onnx.helper.make_node(
"Concat",
input_nodes... | [
"def",
"convert_concat",
"(",
"node",
",",
"*",
"*",
"kwargs",
")",
":",
"name",
",",
"input_nodes",
",",
"attrs",
"=",
"get_inputs",
"(",
"node",
",",
"kwargs",
")",
"axis",
"=",
"int",
"(",
"attrs",
".",
"get",
"(",
"\"dim\"",
",",
"1",
")",
")",... | https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py#L851-L865 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/platform.py | python | version | () | return uname().version | Returns the system's release version, e.g. '#3 on degas'
An empty string is returned if the value cannot be determined. | Returns the system's release version, e.g. '#3 on degas' | [
"Returns",
"the",
"system",
"s",
"release",
"version",
"e",
".",
"g",
".",
"#3",
"on",
"degas"
] | def version():
""" Returns the system's release version, e.g. '#3 on degas'
An empty string is returned if the value cannot be determined.
"""
return uname().version | [
"def",
"version",
"(",
")",
":",
"return",
"uname",
"(",
")",
".",
"version"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/platform.py#L1089-L1096 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/logging/__init__.py | python | _StderrHandler.__init__ | (self, level=NOTSET) | Initialize the handler. | Initialize the handler. | [
"Initialize",
"the",
"handler",
"."
] | def __init__(self, level=NOTSET):
"""
Initialize the handler.
"""
Handler.__init__(self, level) | [
"def",
"__init__",
"(",
"self",
",",
"level",
"=",
"NOTSET",
")",
":",
"Handler",
".",
"__init__",
"(",
"self",
",",
"level",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/logging/__init__.py#L1200-L1204 | ||
modm-io/modm | 845840ec08566a3aa9c04167b1a18a56255afa4f | tools/xpcc_generator/builder/generate_include_graph.py | python | IncludePathBuilder.find_includes | (self, file, include_path) | return files | Find include directives in an XML file | Find include directives in an XML file | [
"Find",
"include",
"directives",
"in",
"an",
"XML",
"file"
] | def find_includes(self, file, include_path):
""" Find include directives in an XML file """
includeExpression = re.compile(r'<include>(\S+)</include>', re.M)
files = []
line_count = 0
for line in open(file).readlines():
line_count = line_count + 1
match = includeExpression.search(line)
if match:
... | [
"def",
"find_includes",
"(",
"self",
",",
"file",
",",
"include_path",
")",
":",
"includeExpression",
"=",
"re",
".",
"compile",
"(",
"r'<include>(\\S+)</include>'",
",",
"re",
".",
"M",
")",
"files",
"=",
"[",
"]",
"line_count",
"=",
"0",
"for",
"line",
... | https://github.com/modm-io/modm/blob/845840ec08566a3aa9c04167b1a18a56255afa4f/tools/xpcc_generator/builder/generate_include_graph.py#L89-L108 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.