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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
openbabel/openbabel | f3ed2a9a5166dbd3b9ce386e636a176074a6c34c | scripts/python/openbabel/pybel.py | python | Molecule.localopt | (self, forcefield="mmff94", steps=500) | Locally optimize the coordinates.
Optional parameters:
forcefield -- default is "mmff94". See the forcefields variable
for a list of available forcefields.
steps -- default is 500
If the molecule does not have any coordinates, make3D() is
called b... | Locally optimize the coordinates. | [
"Locally",
"optimize",
"the",
"coordinates",
"."
] | def localopt(self, forcefield="mmff94", steps=500):
"""Locally optimize the coordinates.
Optional parameters:
forcefield -- default is "mmff94". See the forcefields variable
for a list of available forcefields.
steps -- default is 500
If the molec... | [
"def",
"localopt",
"(",
"self",
",",
"forcefield",
"=",
"\"mmff94\"",
",",
"steps",
"=",
"500",
")",
":",
"forcefield",
"=",
"forcefield",
".",
"lower",
"(",
")",
"if",
"self",
".",
"dim",
"!=",
"3",
":",
"self",
".",
"make3D",
"(",
"forcefield",
")"... | https://github.com/openbabel/openbabel/blob/f3ed2a9a5166dbd3b9ce386e636a176074a6c34c/scripts/python/openbabel/pybel.py#L564-L584 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/combo.py | python | OwnerDrawnComboBox.OnMeasureItem | (*args, **kwargs) | return _combo.OwnerDrawnComboBox_OnMeasureItem(*args, **kwargs) | OnMeasureItem(self, size_t item) -> int
The derived class may implement this method to return the height of
the specified item (in pixels). The default implementation returns
text height, as if this control was a normal combobox. | OnMeasureItem(self, size_t item) -> int | [
"OnMeasureItem",
"(",
"self",
"size_t",
"item",
")",
"-",
">",
"int"
] | def OnMeasureItem(*args, **kwargs):
"""
OnMeasureItem(self, size_t item) -> int
The derived class may implement this method to return the height of
the specified item (in pixels). The default implementation returns
text height, as if this control was a normal combobox.
... | [
"def",
"OnMeasureItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_combo",
".",
"OwnerDrawnComboBox_OnMeasureItem",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/combo.py#L894-L902 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/f2py/rules.py | python | buildmodule | (m, um) | return ret | Return | Return | [
"Return"
] | def buildmodule(m, um):
"""
Return
"""
global f2py_version, options
outmess('\tBuilding module "%s"...\n'%(m['name']))
ret = {}
mod_rules=defmod_rules[:]
vrd=modsign2map(m)
rd=dictappend({'f2py_version':f2py_version}, vrd)
funcwrappers = []
funcwrappers2 = [] # F90 codes
... | [
"def",
"buildmodule",
"(",
"m",
",",
"um",
")",
":",
"global",
"f2py_version",
",",
"options",
"outmess",
"(",
"'\\tBuilding module \"%s\"...\\n'",
"%",
"(",
"m",
"[",
"'name'",
"]",
")",
")",
"ret",
"=",
"{",
"}",
"mod_rules",
"=",
"defmod_rules",
"[",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/f2py/rules.py#L1159-L1321 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py | python | _UnixDefaultEventLoopPolicy.set_child_watcher | (self, watcher) | Set the watcher for child processes. | Set the watcher for child processes. | [
"Set",
"the",
"watcher",
"for",
"child",
"processes",
"."
] | def set_child_watcher(self, watcher):
"""Set the watcher for child processes."""
assert watcher is None or isinstance(watcher, AbstractChildWatcher)
if self._watcher is not None:
self._watcher.close()
self._watcher = watcher | [
"def",
"set_child_watcher",
"(",
"self",
",",
"watcher",
")",
":",
"assert",
"watcher",
"is",
"None",
"or",
"isinstance",
"(",
"watcher",
",",
"AbstractChildWatcher",
")",
"if",
"self",
".",
"_watcher",
"is",
"not",
"None",
":",
"self",
".",
"_watcher",
".... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/unix_events.py#L1146-L1154 | ||
DaFuCoding/MTCNN_Caffe | 09c30c3ff391bd9cb6b249c1910afaf147767ab3 | examples/pycaffe/tools.py | python | CaffeSolver.write | (self, filepath) | Export solver parameters to INPUT "filepath". Sorted alphabetically. | Export solver parameters to INPUT "filepath". Sorted alphabetically. | [
"Export",
"solver",
"parameters",
"to",
"INPUT",
"filepath",
".",
"Sorted",
"alphabetically",
"."
] | def write(self, filepath):
"""
Export solver parameters to INPUT "filepath". Sorted alphabetically.
"""
f = open(filepath, 'w')
for key, value in sorted(self.sp.items()):
if not(type(value) is str):
raise TypeError('All solver parameters must be string... | [
"def",
"write",
"(",
"self",
",",
"filepath",
")",
":",
"f",
"=",
"open",
"(",
"filepath",
",",
"'w'",
")",
"for",
"key",
",",
"value",
"in",
"sorted",
"(",
"self",
".",
"sp",
".",
"items",
"(",
")",
")",
":",
"if",
"not",
"(",
"type",
"(",
"... | https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/examples/pycaffe/tools.py#L113-L121 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_core.py | python | Position.GetCol | (*args, **kwargs) | return _core_.Position_GetCol(*args, **kwargs) | GetCol(self) -> int | GetCol(self) -> int | [
"GetCol",
"(",
"self",
")",
"-",
">",
"int"
] | def GetCol(*args, **kwargs):
"""GetCol(self) -> int"""
return _core_.Position_GetCol(*args, **kwargs) | [
"def",
"GetCol",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"Position_GetCol",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L2094-L2096 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Required.py | python | Required_Events.open | (self, _object, _attributes={}, **_arguments) | open: Open the specified object(s)
Required argument: list of objects to open
Keyword argument converting: Whether to convert project to latest version (yes/no; default is ask).
Keyword argument _attributes: AppleEvent attribute dictionary | open: Open the specified object(s)
Required argument: list of objects to open
Keyword argument converting: Whether to convert project to latest version (yes/no; default is ask).
Keyword argument _attributes: AppleEvent attribute dictionary | [
"open",
":",
"Open",
"the",
"specified",
"object",
"(",
"s",
")",
"Required",
"argument",
":",
"list",
"of",
"objects",
"to",
"open",
"Keyword",
"argument",
"converting",
":",
"Whether",
"to",
"convert",
"project",
"to",
"latest",
"version",
"(",
"yes",
"/... | def open(self, _object, _attributes={}, **_arguments):
"""open: Open the specified object(s)
Required argument: list of objects to open
Keyword argument converting: Whether to convert project to latest version (yes/no; default is ask).
Keyword argument _attributes: AppleEvent attribute d... | [
"def",
"open",
"(",
"self",
",",
"_object",
",",
"_attributes",
"=",
"{",
"}",
",",
"*",
"*",
"_arguments",
")",
":",
"_code",
"=",
"'aevt'",
"_subcode",
"=",
"'odoc'",
"aetools",
".",
"keysubst",
"(",
"_arguments",
",",
"self",
".",
"_argmap_open",
")... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/CodeWarrior/Required.py#L20-L40 | ||
wujian16/Cornell-MOE | df299d1be882d2af9796d7a68b3f9505cac7a53e | moe/optimal_learning/python/cpp_wrappers/domain.py | python | SimplexIntersectTensorProductDomain.check_point_inside | (self, point) | r"""Check if a point is inside the domain/on its boundary or outside.
We do not currently expose a C++ endpoint for this call; see :mod:`moe.optimal_learning.python.interfaces.domain_interface` for interface specification. | r"""Check if a point is inside the domain/on its boundary or outside. | [
"r",
"Check",
"if",
"a",
"point",
"is",
"inside",
"the",
"domain",
"/",
"on",
"its",
"boundary",
"or",
"outside",
"."
] | def check_point_inside(self, point):
r"""Check if a point is inside the domain/on its boundary or outside.
We do not currently expose a C++ endpoint for this call; see :mod:`moe.optimal_learning.python.interfaces.domain_interface` for interface specification.
"""
raise NotImplementedEr... | [
"def",
"check_point_inside",
"(",
"self",
",",
"point",
")",
":",
"raise",
"NotImplementedError",
"(",
"\"C++ wrapper currently does not support domain member functions.\"",
")"
] | https://github.com/wujian16/Cornell-MOE/blob/df299d1be882d2af9796d7a68b3f9505cac7a53e/moe/optimal_learning/python/cpp_wrappers/domain.py#L151-L157 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/model/trajectory.py | python | SO3HermiteTrajectory.deriv_angvel | (self, t: float, endBehavior: str = 'halt') | return so3.deskew(dR) | Returns the derivative at t, in angular velocity form | Returns the derivative at t, in angular velocity form | [
"Returns",
"the",
"derivative",
"at",
"t",
"in",
"angular",
"velocity",
"form"
] | def deriv_angvel(self, t: float, endBehavior: str = 'halt') -> Vector3:
"""Returns the derivative at t, in angular velocity form"""
dR = GeodesicHermiteTrajectory.eval_velocity(self,t,endBehavior)
return so3.deskew(dR) | [
"def",
"deriv_angvel",
"(",
"self",
",",
"t",
":",
"float",
",",
"endBehavior",
":",
"str",
"=",
"'halt'",
")",
"->",
"Vector3",
":",
"dR",
"=",
"GeodesicHermiteTrajectory",
".",
"eval_velocity",
"(",
"self",
",",
"t",
",",
"endBehavior",
")",
"return",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/trajectory.py#L1376-L1379 | |
arangodb/arangodb | 0d658689c7d1b721b314fa3ca27d38303e1570c8 | 3rdParty/V8/gyp/xcode_emulation.py | python | XcodeArchsVariableMapping | (archs, archs_including_64_bit=None) | return mapping | Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable,
and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT). | Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable,
and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT). | [
"Constructs",
"a",
"dictionary",
"with",
"expansion",
"for",
"$",
"(",
"ARCHS_STANDARD",
")",
"variable",
"and",
"optionally",
"for",
"$",
"(",
"ARCHS_STANDARD_INCLUDING_64_BIT",
")",
"."
] | def XcodeArchsVariableMapping(archs, archs_including_64_bit=None):
"""Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable,
and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT)."""
mapping = {'$(ARCHS_STANDARD)': archs}
if archs_including_64_bit:
mapping['$(ARCHS_STANDARD_INCLUDING_64_BIT)... | [
"def",
"XcodeArchsVariableMapping",
"(",
"archs",
",",
"archs_including_64_bit",
"=",
"None",
")",
":",
"mapping",
"=",
"{",
"'$(ARCHS_STANDARD)'",
":",
"archs",
"}",
"if",
"archs_including_64_bit",
":",
"mapping",
"[",
"'$(ARCHS_STANDARD_INCLUDING_64_BIT)'",
"]",
"="... | https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/xcode_emulation.py#L35-L41 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/FrequencyDomainAnalysis/FFT/fft_model.py | python | FFTModel.PhaseQuad | (self, inputs) | do the phaseQuad algorithm
groups data into a single set | do the phaseQuad algorithm
groups data into a single set | [
"do",
"the",
"phaseQuad",
"algorithm",
"groups",
"data",
"into",
"a",
"single",
"set"
] | def PhaseQuad(self, inputs):
"""
do the phaseQuad algorithm
groups data into a single set
"""
cloned_workspace = mantid.CloneWorkspace(InputWorkspace=inputs["InputWorkspace"], StoreInADS=False)
mantid.MaskDetectors(Workspace=cloned_workspace, DetectorList=inputs['MaskedDe... | [
"def",
"PhaseQuad",
"(",
"self",
",",
"inputs",
")",
":",
"cloned_workspace",
"=",
"mantid",
".",
"CloneWorkspace",
"(",
"InputWorkspace",
"=",
"inputs",
"[",
"\"InputWorkspace\"",
"]",
",",
"StoreInADS",
"=",
"False",
")",
"mantid",
".",
"MaskDetectors",
"(",... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/FrequencyDomainAnalysis/FFT/fft_model.py#L138-L158 | ||
google/syzygy | 8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5 | syzygy/py/etw_db/etw_db/module.py | python | ModuleDatabase.GetProcessModuleAt | (self, process_id, addr) | return None | Get the module loaded at a given address in a process.
Args:
process_id: the id of the process in question.
addr: the address we're interested in.
Returns:
A _Module object for the found module, or None if no module
is loaded at that address. | Get the module loaded at a given address in a process. | [
"Get",
"the",
"module",
"loaded",
"at",
"a",
"given",
"address",
"in",
"a",
"process",
"."
] | def GetProcessModuleAt(self, process_id, addr):
"""Get the module loaded at a given address in a process.
Args:
process_id: the id of the process in question.
addr: the address we're interested in.
Returns:
A _Module object for the found module, or None if no module
is loaded at th... | [
"def",
"GetProcessModuleAt",
"(",
"self",
",",
"process_id",
",",
"addr",
")",
":",
"proc",
"=",
"self",
".",
"_processes",
".",
"get",
"(",
"process_id",
")",
"if",
"proc",
":",
"return",
"proc",
".",
"FindModuleAt",
"(",
"addr",
")",
"return",
"None"
] | https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/syzygy/py/etw_db/etw_db/module.py#L102-L117 | |
turi-code/SFrame | 796b9bdfb2fa1b881d82080754643c7e68629cd2 | oss_src/unity/python/sframe/util/__init__.py | python | get_archive_type | (path) | Returns the contents type for the provided archive path.
Parameters
----------
path : string
Directory to evaluate.
Returns
-------
Returns a string of: sframe, sgraph, raises TypeError for anything else | Returns the contents type for the provided archive path. | [
"Returns",
"the",
"contents",
"type",
"for",
"the",
"provided",
"archive",
"path",
"."
] | def get_archive_type(path):
"""
Returns the contents type for the provided archive path.
Parameters
----------
path : string
Directory to evaluate.
Returns
-------
Returns a string of: sframe, sgraph, raises TypeError for anything else
"""
if not is_directory_archive(pa... | [
"def",
"get_archive_type",
"(",
"path",
")",
":",
"if",
"not",
"is_directory_archive",
"(",
"path",
")",
":",
"raise",
"TypeError",
"(",
"'Unable to determine the type of archive at path: %s'",
"%",
"path",
")",
"try",
":",
"ini_path",
"=",
"'/'",
".",
"join",
"... | https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/util/__init__.py#L292-L316 | ||
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py | python | _get_dynamic_rnn_model_fn | (
cell_type,
num_units,
target_column,
problem_type,
prediction_type,
optimizer,
sequence_feature_columns,
context_feature_columns=None,
predict_probabilities=False,
learning_rate=None,
gradient_clipping_norm=None,
dropout_keep_probabilities=None,
sequence_length_key=... | return _dynamic_rnn_model_fn | Creates an RNN model function for an `Estimator`.
The model function returns an instance of `ModelFnOps`. When
`problem_type == ProblemType.CLASSIFICATION` and
`predict_probabilities == True`, the returned `ModelFnOps` includes an output
alternative containing the classes and their associated probabilities. Wh... | Creates an RNN model function for an `Estimator`. | [
"Creates",
"an",
"RNN",
"model",
"function",
"for",
"an",
"Estimator",
"."
] | def _get_dynamic_rnn_model_fn(
cell_type,
num_units,
target_column,
problem_type,
prediction_type,
optimizer,
sequence_feature_columns,
context_feature_columns=None,
predict_probabilities=False,
learning_rate=None,
gradient_clipping_norm=None,
dropout_keep_probabilities=N... | [
"def",
"_get_dynamic_rnn_model_fn",
"(",
"cell_type",
",",
"num_units",
",",
"target_column",
",",
"problem_type",
",",
"prediction_type",
",",
"optimizer",
",",
"sequence_feature_columns",
",",
"context_feature_columns",
"=",
"None",
",",
"predict_probabilities",
"=",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator.py#L379-L539 | |
PyMesh/PyMesh | 384ba882b7558ba6e8653ed263c419226c22bddf | python/pymesh/wires/Inflator.py | python | Inflator.set_refinement | (self, order=1, method="loop") | Refine the output mesh using subdivision.
Arguments:
order: how many times to subdivide.
mehtod: which subdivision scheme to use.
Options are ``loop`` and ``simple``. | Refine the output mesh using subdivision. | [
"Refine",
"the",
"output",
"mesh",
"using",
"subdivision",
"."
] | def set_refinement(self, order=1, method="loop"):
""" Refine the output mesh using subdivision.
Arguments:
order: how many times to subdivide.
mehtod: which subdivision scheme to use.
Options are ``loop`` and ``simple``.
"""
if not isinstance(... | [
"def",
"set_refinement",
"(",
"self",
",",
"order",
"=",
"1",
",",
"method",
"=",
"\"loop\"",
")",
":",
"if",
"not",
"isinstance",
"(",
"order",
",",
"int",
")",
"or",
"order",
"<",
"0",
":",
"raise",
"RuntimeError",
"(",
"\"Invalid subdivision order: {}\"... | https://github.com/PyMesh/PyMesh/blob/384ba882b7558ba6e8653ed263c419226c22bddf/python/pymesh/wires/Inflator.py#L46-L61 | ||
bulletphysics/bullet3 | f0f2a952e146f016096db6f85cf0c44ed75b0b9a | examples/pybullet/gym/pybullet_envs/agents/tools/in_graph_batch_env.py | python | InGraphBatchEnv._parse_dtype | (self, space) | Get a tensor dtype from a OpenAI Gym space.
Args:
space: Gym space.
Returns:
TensorFlow data type. | Get a tensor dtype from a OpenAI Gym space. | [
"Get",
"a",
"tensor",
"dtype",
"from",
"a",
"OpenAI",
"Gym",
"space",
"."
] | def _parse_dtype(self, space):
"""Get a tensor dtype from a OpenAI Gym space.
Args:
space: Gym space.
Returns:
TensorFlow data type.
"""
if isinstance(space, gym.spaces.Discrete):
return tf.int32
if isinstance(space, gym.spaces.Box):
return tf.float32
raise NotImple... | [
"def",
"_parse_dtype",
"(",
"self",
",",
"space",
")",
":",
"if",
"isinstance",
"(",
"space",
",",
"gym",
".",
"spaces",
".",
"Discrete",
")",
":",
"return",
"tf",
".",
"int32",
"if",
"isinstance",
"(",
"space",
",",
"gym",
".",
"spaces",
".",
"Box",... | https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/tools/in_graph_batch_env.py#L164-L177 | ||
trilinos/Trilinos | 6168be6dd51e35e1cd681e9c4b24433e709df140 | packages/kokkos-kernels/scripts/analysis/batched/pd.py | python | flop_tridiag_factor | (n, b) | return n*flop_lu(b) + (n-1)*flop_bothtrsm(b, b) + (n-1)*flop_gemm(b, b) | #FLOP for block tridiag factorization. Block size is b. There are n block
rows. | #FLOP for block tridiag factorization. Block size is b. There are n block
rows. | [
"#FLOP",
"for",
"block",
"tridiag",
"factorization",
".",
"Block",
"size",
"is",
"b",
".",
"There",
"are",
"n",
"block",
"rows",
"."
] | def flop_tridiag_factor(n, b):
"""#FLOP for block tridiag factorization. Block size is b. There are n block
rows."""
return n*flop_lu(b) + (n-1)*flop_bothtrsm(b, b) + (n-1)*flop_gemm(b, b) | [
"def",
"flop_tridiag_factor",
"(",
"n",
",",
"b",
")",
":",
"return",
"n",
"*",
"flop_lu",
"(",
"b",
")",
"+",
"(",
"n",
"-",
"1",
")",
"*",
"flop_bothtrsm",
"(",
"b",
",",
"b",
")",
"+",
"(",
"n",
"-",
"1",
")",
"*",
"flop_gemm",
"(",
"b",
... | https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/kokkos-kernels/scripts/analysis/batched/pd.py#L102-L105 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/inspect.py | python | formatargvalues | (args, varargs, varkw, locals,
formatarg=str,
formatvarargs=lambda name: '*' + name,
formatvarkw=lambda name: '**' + name,
formatvalue=lambda value: '=' + repr(value),
join=joinseq) | return '(' + string.join(specs, ', ') + ')' | Format an argument spec from the 4 values returned by getargvalues.
The first four arguments are (args, varargs, varkw, locals). The
next four arguments are the corresponding optional formatting functions
that are called to turn names and values into strings. The ninth
argument is an optional functio... | Format an argument spec from the 4 values returned by getargvalues. | [
"Format",
"an",
"argument",
"spec",
"from",
"the",
"4",
"values",
"returned",
"by",
"getargvalues",
"."
] | def formatargvalues(args, varargs, varkw, locals,
formatarg=str,
formatvarargs=lambda name: '*' + name,
formatvarkw=lambda name: '**' + name,
formatvalue=lambda value: '=' + repr(value),
join=joinseq):
"""Format an a... | [
"def",
"formatargvalues",
"(",
"args",
",",
"varargs",
",",
"varkw",
",",
"locals",
",",
"formatarg",
"=",
"str",
",",
"formatvarargs",
"=",
"lambda",
"name",
":",
"'*'",
"+",
"name",
",",
"formatvarkw",
"=",
"lambda",
"name",
":",
"'**'",
"+",
"name",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/inspect.py#L870-L892 | |
microsoft/onnxruntime | f92e47e95b13a240e37caf7b36577983544f98fc | orttraining/orttraining/python/training/ortmodule/_inference_manager.py | python | InferenceManager.forward | (self, *inputs, **kwargs) | Forward pass of the inference model
ONNX model is exported the first time this method is executed.
Next, we build an optimized inference graph with module_graph_builder.
Finally, we instantiate the ONNX Runtime InferenceSession through the InferenceAgent. | Forward pass of the inference model | [
"Forward",
"pass",
"of",
"the",
"inference",
"model"
] | def forward(self, *inputs, **kwargs):
'''Forward pass of the inference model
ONNX model is exported the first time this method is executed.
Next, we build an optimized inference graph with module_graph_builder.
Finally, we instantiate the ONNX Runtime InferenceSession through the Infere... | [
"def",
"forward",
"(",
"self",
",",
"*",
"inputs",
",",
"*",
"*",
"kwargs",
")",
":",
"# Fallback to PyTorch due to failures *external* to forward(),",
"# typically from initialization",
"if",
"self",
".",
"_fallback_manager",
".",
"is_pending",
"(",
")",
":",
"retur... | https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/ortmodule/_inference_manager.py#L60-L148 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py | python | IRBuilder.ctlz | (self, cond, flag) | Counts leading zero bits in *value*. Boolean *flag* indicates whether
the result is defined for ``0``. | Counts leading zero bits in *value*. Boolean *flag* indicates whether
the result is defined for ``0``. | [
"Counts",
"leading",
"zero",
"bits",
"in",
"*",
"value",
"*",
".",
"Boolean",
"*",
"flag",
"*",
"indicates",
"whether",
"the",
"result",
"is",
"defined",
"for",
"0",
"."
] | def ctlz(self, cond, flag):
"""
Counts leading zero bits in *value*. Boolean *flag* indicates whether
the result is defined for ``0``.
""" | [
"def",
"ctlz",
"(",
"self",
",",
"cond",
",",
"flag",
")",
":"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/llvmlite/ir/builder.py#L1019-L1023 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_gdi.py | python | GraphicsContext.StrokeLineSegements | (*args, **kwargs) | return _gdi_.GraphicsContext_StrokeLineSegements(*args, **kwargs) | StrokeLineSegments(self, List beginPoints, List endPoints)
Stroke disconnected lines from begin to end points | StrokeLineSegments(self, List beginPoints, List endPoints) | [
"StrokeLineSegments",
"(",
"self",
"List",
"beginPoints",
"List",
"endPoints",
")"
] | def StrokeLineSegements(*args, **kwargs):
"""
StrokeLineSegments(self, List beginPoints, List endPoints)
Stroke disconnected lines from begin to end points
"""
return _gdi_.GraphicsContext_StrokeLineSegements(*args, **kwargs) | [
"def",
"StrokeLineSegements",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"GraphicsContext_StrokeLineSegements",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_gdi.py#L6466-L6472 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/robotsim.py | python | IKObjective.__init__ | (self, *args) | __init__(IKObjective self) -> IKObjective
__init__(IKObjective self, IKObjective arg2) -> IKObjective
With no arguments, constructs a blank IKObjective. Given an IKObjective, acts as
a copy constructor. | __init__(IKObjective self) -> IKObjective
__init__(IKObjective self, IKObjective arg2) -> IKObjective | [
"__init__",
"(",
"IKObjective",
"self",
")",
"-",
">",
"IKObjective",
"__init__",
"(",
"IKObjective",
"self",
"IKObjective",
"arg2",
")",
"-",
">",
"IKObjective"
] | def __init__(self, *args):
"""
__init__(IKObjective self) -> IKObjective
__init__(IKObjective self, IKObjective arg2) -> IKObjective
With no arguments, constructs a blank IKObjective. Given an IKObjective, acts as
a copy constructor.
"""
this = _robotsim.new... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
")",
":",
"this",
"=",
"_robotsim",
".",
"new_IKObjective",
"(",
"*",
"args",
")",
"try",
":",
"self",
".",
"this",
".",
"append",
"(",
"this",
")",
"except",
"Exception",
":",
"self",
".",
"this",
... | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L6155-L6170 | ||
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py | python | xmlNode.addChild | (self, cur) | return __tmp | Add a new node to @parent, at the end of the child (or
property) list merging adjacent TEXT nodes (in which case
@cur is freed) If the new node is ATTRIBUTE, it is added
into properties instead of children. If there is an
attribute with equal name, it is first destroyed. | Add a new node to | [
"Add",
"a",
"new",
"node",
"to"
] | def addChild(self, cur):
"""Add a new node to @parent, at the end of the child (or
property) list merging adjacent TEXT nodes (in which case
@cur is freed) If the new node is ATTRIBUTE, it is added
into properties instead of children. If there is an
attribute with equal ... | [
"def",
"addChild",
"(",
"self",
",",
"cur",
")",
":",
"if",
"cur",
"is",
"None",
":",
"cur__o",
"=",
"None",
"else",
":",
"cur__o",
"=",
"cur",
".",
"_o",
"ret",
"=",
"libxml2mod",
".",
"xmlAddChild",
"(",
"self",
".",
"_o",
",",
"cur__o",
")",
"... | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L2289-L2300 | |
mongodb/mongo | d8ff665343ad29cf286ee2cf4a1960d29371937b | src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py | python | Base.get_labspath | (self) | return self.dir.entry_labspath(self.name) | Get the absolute path of the file. | Get the absolute path of the file. | [
"Get",
"the",
"absolute",
"path",
"of",
"the",
"file",
"."
] | def get_labspath(self):
"""Get the absolute path of the file."""
return self.dir.entry_labspath(self.name) | [
"def",
"get_labspath",
"(",
"self",
")",
":",
"return",
"self",
".",
"dir",
".",
"entry_labspath",
"(",
"self",
".",
"name",
")"
] | https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py#L813-L815 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/srv/_UpdateGeographicMap.py | python | UpdateGeographicMapResponse.serialize_numpy | (self, buff, numpy) | serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module | serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module | [
"serialize",
"message",
"with",
"numpy",
"array",
"types",
"into",
"buffer",
":",
"param",
"buff",
":",
"buffer",
"StringIO",
":",
"param",
"numpy",
":",
"numpy",
"python",
"module"
] | def serialize_numpy(self, buff, numpy):
"""
serialize message with numpy array types into buffer
:param buff: buffer, ``StringIO``
:param numpy: numpy python module
"""
try:
buff.write(_struct_B.pack(self.success))
_x = self.status
length = len(_x)
if python3 or type(_x) ... | [
"def",
"serialize_numpy",
"(",
"self",
",",
"buff",
",",
"numpy",
")",
":",
"try",
":",
"buff",
".",
"write",
"(",
"_struct_B",
".",
"pack",
"(",
"self",
".",
"success",
")",
")",
"_x",
"=",
"self",
".",
"status",
"length",
"=",
"len",
"(",
"_x",
... | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/geographic_msgs/srv/_UpdateGeographicMap.py#L896-L914 | ||
Cisco-Talos/moflow | ed71dfb0540d9e0d7a4c72f0881b58958d573728 | BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/cpp_message.py | python | RepeatedCompositeContainer.extend | (self, elem_seq) | Extends by appending the given sequence of elements of the same type
as this one, copying each individual message. | Extends by appending the given sequence of elements of the same type
as this one, copying each individual message. | [
"Extends",
"by",
"appending",
"the",
"given",
"sequence",
"of",
"elements",
"of",
"the",
"same",
"type",
"as",
"this",
"one",
"copying",
"each",
"individual",
"message",
"."
] | def extend(self, elem_seq):
"""Extends by appending the given sequence of elements of the same type
as this one, copying each individual message.
"""
for message in elem_seq:
self.add().MergeFrom(message) | [
"def",
"extend",
"(",
"self",
",",
"elem_seq",
")",
":",
"for",
"message",
"in",
"elem_seq",
":",
"self",
".",
"add",
"(",
")",
".",
"MergeFrom",
"(",
"message",
")"
] | https://github.com/Cisco-Talos/moflow/blob/ed71dfb0540d9e0d7a4c72f0881b58958d573728/BAP-0.7-moflow/libtracewrap/libtrace/protobuf/python/google/protobuf/internal/cpp_message.py#L198-L203 | ||
swift/swift | 12d031cf8177fdec0137f9aa7e2912fa23c4416b | 3rdParty/SCons/scons-3.0.1/engine/SCons/Node/FS.py | python | FS.chdir | (self, dir, change_os_dir=0) | Change the current working directory for lookups.
If change_os_dir is true, we will also change the "real" cwd
to match. | Change the current working directory for lookups.
If change_os_dir is true, we will also change the "real" cwd
to match. | [
"Change",
"the",
"current",
"working",
"directory",
"for",
"lookups",
".",
"If",
"change_os_dir",
"is",
"true",
"we",
"will",
"also",
"change",
"the",
"real",
"cwd",
"to",
"match",
"."
] | def chdir(self, dir, change_os_dir=0):
"""Change the current working directory for lookups.
If change_os_dir is true, we will also change the "real" cwd
to match.
"""
curr=self._cwd
try:
if dir is not None:
self._cwd = dir
if ch... | [
"def",
"chdir",
"(",
"self",
",",
"dir",
",",
"change_os_dir",
"=",
"0",
")",
":",
"curr",
"=",
"self",
".",
"_cwd",
"try",
":",
"if",
"dir",
"is",
"not",
"None",
":",
"self",
".",
"_cwd",
"=",
"dir",
"if",
"change_os_dir",
":",
"os",
".",
"chdir... | https://github.com/swift/swift/blob/12d031cf8177fdec0137f9aa7e2912fa23c4416b/3rdParty/SCons/scons-3.0.1/engine/SCons/Node/FS.py#L1169-L1182 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/keras_tensor.py | python | keras_tensor_from_tensor | (tensor) | return out | Convert a traced (composite)tensor to a representative KerasTensor. | Convert a traced (composite)tensor to a representative KerasTensor. | [
"Convert",
"a",
"traced",
"(",
"composite",
")",
"tensor",
"to",
"a",
"representative",
"KerasTensor",
"."
] | def keras_tensor_from_tensor(tensor):
"""Convert a traced (composite)tensor to a representative KerasTensor."""
# Create a specialized KerasTensor that supports instance methods,
# operators, and additional value inference if possible
keras_tensor_cls = None
for tensor_type, cls in keras_tensor_classes:
i... | [
"def",
"keras_tensor_from_tensor",
"(",
"tensor",
")",
":",
"# Create a specialized KerasTensor that supports instance methods,",
"# operators, and additional value inference if possible",
"keras_tensor_cls",
"=",
"None",
"for",
"tensor_type",
",",
"cls",
"in",
"keras_tensor_classes"... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/keras_tensor.py#L584-L598 | |
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | native_client_sdk/src/build_tools/sdk_tools/update_manifest.py | python | GsUtil.Run | (self, command) | return subprocess.call(args) | Runs gsutil with a given argument list and returns exit status | Runs gsutil with a given argument list and returns exit status | [
"Runs",
"gsutil",
"with",
"a",
"given",
"argument",
"list",
"and",
"returns",
"exit",
"status"
] | def Run(self, command):
'''Runs gsutil with a given argument list and returns exit status'''
args = [self.gsutil] + command
print 'GSUtil.Run(%s)' % args
sys.stdout.flush()
return subprocess.call(args) | [
"def",
"Run",
"(",
"self",
",",
"command",
")",
":",
"args",
"=",
"[",
"self",
".",
"gsutil",
"]",
"+",
"command",
"print",
"'GSUtil.Run(%s)'",
"%",
"args",
"sys",
".",
"stdout",
".",
"flush",
"(",
")",
"return",
"subprocess",
".",
"call",
"(",
"args... | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/native_client_sdk/src/build_tools/sdk_tools/update_manifest.py#L211-L216 | |
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | interpreter/llvm/src/tools/clang/tools/scan-build-py/libscanbuild/__init__.py | python | run_build | (command, *args, **kwargs) | return exit_code | Run and report build command execution
:param command: array of tokens
:return: exit code of the process | Run and report build command execution | [
"Run",
"and",
"report",
"build",
"command",
"execution"
] | def run_build(command, *args, **kwargs):
""" Run and report build command execution
:param command: array of tokens
:return: exit code of the process
"""
environment = kwargs.get('env', os.environ)
logging.debug('run build %s, in environment: %s', command, environment)
exit_code = subproces... | [
"def",
"run_build",
"(",
"command",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"environment",
"=",
"kwargs",
".",
"get",
"(",
"'env'",
",",
"os",
".",
"environ",
")",
"logging",
".",
"debug",
"(",
"'run build %s, in environment: %s'",
",",
"com... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/tools/scan-build-py/libscanbuild/__init__.py#L46-L56 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/message.py | python | Message.set_payload | (self, payload, charset=None) | Set the payload to the given value.
Optional charset sets the message's default character set. See
set_charset() for details. | Set the payload to the given value. | [
"Set",
"the",
"payload",
"to",
"the",
"given",
"value",
"."
] | def set_payload(self, payload, charset=None):
"""Set the payload to the given value.
Optional charset sets the message's default character set. See
set_charset() for details.
"""
if hasattr(payload, 'encode'):
if charset is None:
self._payload = payl... | [
"def",
"set_payload",
"(",
"self",
",",
"payload",
",",
"charset",
"=",
"None",
")",
":",
"if",
"hasattr",
"(",
"payload",
",",
"'encode'",
")",
":",
"if",
"charset",
"is",
"None",
":",
"self",
".",
"_payload",
"=",
"payload",
"return",
"if",
"not",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/email/message.py#L303-L321 | ||
NASA-SW-VnV/ikos | 71325dfb94737332542caa708d7537752021522d | analyzer/python/ikos/scan.py | python | build_bitcode | (mode, parser, src_path, bc_path) | Compile the given source file to llvm bitcode | Compile the given source file to llvm bitcode | [
"Compile",
"the",
"given",
"source",
"file",
"to",
"llvm",
"bitcode"
] | def build_bitcode(mode, parser, src_path, bc_path):
''' Compile the given source file to llvm bitcode '''
cmd = [compiler(mode)]
cmd += analyzer.clang_emit_llvm_flags()
cmd += parser.compile_args
cmd += analyzer.clang_ikos_flags()
cmd += [src_path,
'-o',
bc_path]
run(... | [
"def",
"build_bitcode",
"(",
"mode",
",",
"parser",
",",
"src_path",
",",
"bc_path",
")",
":",
"cmd",
"=",
"[",
"compiler",
"(",
"mode",
")",
"]",
"cmd",
"+=",
"analyzer",
".",
"clang_emit_llvm_flags",
"(",
")",
"cmd",
"+=",
"parser",
".",
"compile_args"... | https://github.com/NASA-SW-VnV/ikos/blob/71325dfb94737332542caa708d7537752021522d/analyzer/python/ikos/scan.py#L457-L466 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/parallel_for/control_flow_ops.py | python | pfor | (loop_fn, iters, parallel_iterations=None) | return f() | Equivalent to running `loop_fn` `iters` times and stacking the outputs.
`pfor` has functionality similar to `for_loop`, i.e. running `loop_fn` `iters`
times, with input from 0 to `iters - 1`, and stacking corresponding output of
each iteration. However the implementation does not use a tf.while_loop.
Instead i... | Equivalent to running `loop_fn` `iters` times and stacking the outputs. | [
"Equivalent",
"to",
"running",
"loop_fn",
"iters",
"times",
"and",
"stacking",
"the",
"outputs",
"."
] | def pfor(loop_fn, iters, parallel_iterations=None):
"""Equivalent to running `loop_fn` `iters` times and stacking the outputs.
`pfor` has functionality similar to `for_loop`, i.e. running `loop_fn` `iters`
times, with input from 0 to `iters - 1`, and stacking corresponding output of
each iteration. However the... | [
"def",
"pfor",
"(",
"loop_fn",
",",
"iters",
",",
"parallel_iterations",
"=",
"None",
")",
":",
"def",
"f",
"(",
")",
":",
"return",
"_pfor_impl",
"(",
"loop_fn",
",",
"iters",
",",
"parallel_iterations",
"=",
"parallel_iterations",
")",
"# Note that we wrap i... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/parallel_for/control_flow_ops.py#L136-L190 | |
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py | python | _IsPresent | (item) | Given a (FieldDescriptor, value) tuple from _fields, return true if the
value should be included in the list returned by ListFields(). | Given a (FieldDescriptor, value) tuple from _fields, return true if the
value should be included in the list returned by ListFields(). | [
"Given",
"a",
"(",
"FieldDescriptor",
"value",
")",
"tuple",
"from",
"_fields",
"return",
"true",
"if",
"the",
"value",
"should",
"be",
"included",
"in",
"the",
"list",
"returned",
"by",
"ListFields",
"()",
"."
] | def _IsPresent(item):
"""Given a (FieldDescriptor, value) tuple from _fields, return true if the
value should be included in the list returned by ListFields()."""
if item[0].label == _FieldDescriptor.LABEL_REPEATED:
return bool(item[1])
elif item[0].cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
return ... | [
"def",
"_IsPresent",
"(",
"item",
")",
":",
"if",
"item",
"[",
"0",
"]",
".",
"label",
"==",
"_FieldDescriptor",
".",
"LABEL_REPEATED",
":",
"return",
"bool",
"(",
"item",
"[",
"1",
"]",
")",
"elif",
"item",
"[",
"0",
"]",
".",
"cpp_type",
"==",
"_... | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/google/protobuf-py/google/protobuf/internal/python_message.py#L537-L546 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/ccompiler.py | python | CCompiler.library_dir_option | (self, dir) | Return the compiler option to add 'dir' to the list of
directories searched for libraries. | Return the compiler option to add 'dir' to the list of
directories searched for libraries. | [
"Return",
"the",
"compiler",
"option",
"to",
"add",
"dir",
"to",
"the",
"list",
"of",
"directories",
"searched",
"for",
"libraries",
"."
] | def library_dir_option(self, dir):
"""Return the compiler option to add 'dir' to the list of
directories searched for libraries.
"""
raise NotImplementedError | [
"def",
"library_dir_option",
"(",
"self",
",",
"dir",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/distutils/ccompiler.py#L742-L746 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/headers.py | python | Headers.__delitem__ | (self,name) | Delete all occurrences of a header, if present.
Does *not* raise an exception if the header is missing. | Delete all occurrences of a header, if present. | [
"Delete",
"all",
"occurrences",
"of",
"a",
"header",
"if",
"present",
"."
] | def __delitem__(self,name):
"""Delete all occurrences of a header, if present.
Does *not* raise an exception if the header is missing.
"""
name = self._convert_string_type(name.lower())
self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] | [
"def",
"__delitem__",
"(",
"self",
",",
"name",
")",
":",
"name",
"=",
"self",
".",
"_convert_string_type",
"(",
"name",
".",
"lower",
"(",
")",
")",
"self",
".",
"_headers",
"[",
":",
"]",
"=",
"[",
"kv",
"for",
"kv",
"in",
"self",
".",
"_headers"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/wsgiref/headers.py#L58-L64 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/customtreectrl.py | python | CustomTreeCtrl.SetSpacing | (self, spacing) | Sets the spacing between items in :class:`CustomTreeCtrl`.
:param integer `spacing`: an integer representing the spacing between items in the tree. | Sets the spacing between items in :class:`CustomTreeCtrl`. | [
"Sets",
"the",
"spacing",
"between",
"items",
"in",
":",
"class",
":",
"CustomTreeCtrl",
"."
] | def SetSpacing(self, spacing):
"""
Sets the spacing between items in :class:`CustomTreeCtrl`.
:param integer `spacing`: an integer representing the spacing between items in the tree.
"""
self._spacing = spacing
self._dirty = True | [
"def",
"SetSpacing",
"(",
"self",
",",
"spacing",
")",
":",
"self",
".",
"_spacing",
"=",
"spacing",
"self",
".",
"_dirty",
"=",
"True"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/customtreectrl.py#L3426-L3434 | ||
mamedev/mame | 02cd26d37ee11191f3e311e19e805d872cb1e3a4 | scripts/build/png.py | python | Reader.asRGB | (self) | return width,height,iterrgb(),meta | Return image as RGB pixels. RGB colour images are passed
through unchanged; greyscales are expanded into RGB
triplets (there is a small speed overhead for doing this).
An alpha channel in the source image will raise an
exception.
The return values are as for the :meth:`read` m... | Return image as RGB pixels. RGB colour images are passed
through unchanged; greyscales are expanded into RGB
triplets (there is a small speed overhead for doing this). | [
"Return",
"image",
"as",
"RGB",
"pixels",
".",
"RGB",
"colour",
"images",
"are",
"passed",
"through",
"unchanged",
";",
"greyscales",
"are",
"expanded",
"into",
"RGB",
"triplets",
"(",
"there",
"is",
"a",
"small",
"speed",
"overhead",
"for",
"doing",
"this",... | def asRGB(self):
"""Return image as RGB pixels. RGB colour images are passed
through unchanged; greyscales are expanded into RGB
triplets (there is a small speed overhead for doing this).
An alpha channel in the source image will raise an
exception.
The return values a... | [
"def",
"asRGB",
"(",
"self",
")",
":",
"width",
",",
"height",
",",
"pixels",
",",
"meta",
"=",
"self",
".",
"asDirect",
"(",
")",
"if",
"meta",
"[",
"'alpha'",
"]",
":",
"raise",
"Error",
"(",
"\"will not convert image with alpha channel to RGB\"",
")",
"... | https://github.com/mamedev/mame/blob/02cd26d37ee11191f3e311e19e805d872cb1e3a4/scripts/build/png.py#L2180-L2207 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/glcanvas.py | python | GLCanvas.SetCurrent | (*args) | return _glcanvas.GLCanvas_SetCurrent(*args) | SetCurrent(self, GLContext context) -> bool
SetCurrent(self) | SetCurrent(self, GLContext context) -> bool
SetCurrent(self) | [
"SetCurrent",
"(",
"self",
"GLContext",
"context",
")",
"-",
">",
"bool",
"SetCurrent",
"(",
"self",
")"
] | def SetCurrent(*args):
"""
SetCurrent(self, GLContext context) -> bool
SetCurrent(self)
"""
return _glcanvas.GLCanvas_SetCurrent(*args) | [
"def",
"SetCurrent",
"(",
"*",
"args",
")",
":",
"return",
"_glcanvas",
".",
"GLCanvas_SetCurrent",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/glcanvas.py#L135-L140 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/mantid/py36compat/_dataclasses/dataclasses.py | python | replace | (obj, **changes) | return obj.__class__(**changes) | Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@dataclass(frozen=True)
class C:
x: int
y: int
c = C(1, 2)
c1 = replace(c, x=3)
assert c1.x == 3 and c1.y == 2 | Return a new object replacing specified fields with new values. | [
"Return",
"a",
"new",
"object",
"replacing",
"specified",
"fields",
"with",
"new",
"values",
"."
] | def replace(obj, **changes):
"""Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@dataclass(frozen=True)
class C:
x: int
y: int
c = C(1, 2)
c1 = replace(c, x=3)
assert c1.x == 3 and ... | [
"def",
"replace",
"(",
"obj",
",",
"*",
"*",
"changes",
")",
":",
"# We're going to mutate 'changes', but that's okay because it's a",
"# new dict, even if called with 'replace(obj, **my_changes)'.",
"if",
"not",
"_is_dataclass_instance",
"(",
"obj",
")",
":",
"raise",
"TypeE... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/py36compat/_dataclasses/dataclasses.py#L1149-L1197 | |
Slicer/SlicerGitSVNArchive | 65e92bb16c2b32ea47a1a66bee71f238891ee1ca | Modules/Scripted/Endoscopy/Endoscopy.py | python | EndoscopyWidget.setCameraNode | (self, newCameraNode) | Allow to set the current camera node.
Connected to signal 'currentNodeChanged()' emitted by camera node selector. | Allow to set the current camera node.
Connected to signal 'currentNodeChanged()' emitted by camera node selector. | [
"Allow",
"to",
"set",
"the",
"current",
"camera",
"node",
".",
"Connected",
"to",
"signal",
"currentNodeChanged",
"()",
"emitted",
"by",
"camera",
"node",
"selector",
"."
] | def setCameraNode(self, newCameraNode):
"""Allow to set the current camera node.
Connected to signal 'currentNodeChanged()' emitted by camera node selector."""
# Remove previous observer
if self.cameraNode and self.cameraNodeObserverTag:
self.cameraNode.RemoveObserver(self.cameraNodeObserverTag)... | [
"def",
"setCameraNode",
"(",
"self",
",",
"newCameraNode",
")",
":",
"# Remove previous observer",
"if",
"self",
".",
"cameraNode",
"and",
"self",
".",
"cameraNodeObserverTag",
":",
"self",
".",
"cameraNode",
".",
"RemoveObserver",
"(",
"self",
".",
"cameraNodeOb... | https://github.com/Slicer/SlicerGitSVNArchive/blob/65e92bb16c2b32ea47a1a66bee71f238891ee1ca/Modules/Scripted/Endoscopy/Endoscopy.py#L173-L195 | ||
KratosMultiphysics/Kratos | 0000833054ed0503424eb28205d6508d9ca6cbbc | applications/PfemFluidDynamicsApplication/python_scripts/pfem_fluid_dynamics_analysis.py | python | PfemFluidDynamicsAnalysis.SetParallelSize | (self, num_threads) | This function sets the number of threads | This function sets the number of threads | [
"This",
"function",
"sets",
"the",
"number",
"of",
"threads"
] | def SetParallelSize(self, num_threads):
"""This function sets the number of threads
"""
KratosMultiphysics.ParallelUtilities.SetNumThreads(int(num_threads)) | [
"def",
"SetParallelSize",
"(",
"self",
",",
"num_threads",
")",
":",
"KratosMultiphysics",
".",
"ParallelUtilities",
".",
"SetNumThreads",
"(",
"int",
"(",
"num_threads",
")",
")"
] | https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/PfemFluidDynamicsApplication/python_scripts/pfem_fluid_dynamics_analysis.py#L304-L307 | ||
mindspore-ai/mindspore | fb8fd3338605bb34fa5cea054e535a8b1d753fab | mindspore/python/mindspore/ops/_op_impl/_custom_op/fake_quant_perchannel.py | python | fake_quant_perchannel_param | (x, min_val, max_val, channel_axis,
kernel_name="fake_quant_perchannel") | return x_shape, shape_c, x_dtype | Get and check fake_quant_perchannel parameters | Get and check fake_quant_perchannel parameters | [
"Get",
"and",
"check",
"fake_quant_perchannel",
"parameters"
] | def fake_quant_perchannel_param(x, min_val, max_val, channel_axis,
kernel_name="fake_quant_perchannel"):
"""Get and check fake_quant_perchannel parameters"""
x_shape = x.get("shape")
x_shape_ = x.get("ori_shape")
x_format = x.get("format")
x_dtype = x.get("dtype")
... | [
"def",
"fake_quant_perchannel_param",
"(",
"x",
",",
"min_val",
",",
"max_val",
",",
"channel_axis",
",",
"kernel_name",
"=",
"\"fake_quant_perchannel\"",
")",
":",
"x_shape",
"=",
"x",
".",
"get",
"(",
"\"shape\"",
")",
"x_shape_",
"=",
"x",
".",
"get",
"("... | https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/_custom_op/fake_quant_perchannel.py#L89-L125 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_common.py | python | supports_ipv6 | () | Return True if IPv6 is supported on this platform. | Return True if IPv6 is supported on this platform. | [
"Return",
"True",
"if",
"IPv6",
"is",
"supported",
"on",
"this",
"platform",
"."
] | def supports_ipv6():
"""Return True if IPv6 is supported on this platform."""
if not socket.has_ipv6 or AF_INET6 is None:
return False
try:
sock = socket.socket(AF_INET6, socket.SOCK_STREAM)
with contextlib.closing(sock):
sock.bind(("::1", 0))
return True
exce... | [
"def",
"supports_ipv6",
"(",
")",
":",
"if",
"not",
"socket",
".",
"has_ipv6",
"or",
"AF_INET6",
"is",
"None",
":",
"return",
"False",
"try",
":",
"sock",
"=",
"socket",
".",
"socket",
"(",
"AF_INET6",
",",
"socket",
".",
"SOCK_STREAM",
")",
"with",
"c... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/psutil/_common.py#L507-L517 | ||
kevinlin311tw/caffe-cvprw15 | 45c2a1bf0368569c54e0be4edf8d34285cf79e70 | scripts/cpp_lint.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/kevinlin311tw/caffe-cvprw15/blob/45c2a1bf0368569c54e0be4edf8d34285cf79e70/scripts/cpp_lint.py#L861-L863 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/_gdi.py | python | DC.DrawEllipticArc | (*args, **kwargs) | return _gdi_.DC_DrawEllipticArc(*args, **kwargs) | DrawEllipticArc(self, int x, int y, int w, int h, double start, double end)
Draws an arc of an ellipse, with the given rectangle defining the
bounds of the ellipse. The current pen is used for drawing the arc and
the current brush is used for drawing the pie.
The *start* and *end* para... | DrawEllipticArc(self, int x, int y, int w, int h, double start, double end) | [
"DrawEllipticArc",
"(",
"self",
"int",
"x",
"int",
"y",
"int",
"w",
"int",
"h",
"double",
"start",
"double",
"end",
")"
] | def DrawEllipticArc(*args, **kwargs):
"""
DrawEllipticArc(self, int x, int y, int w, int h, double start, double end)
Draws an arc of an ellipse, with the given rectangle defining the
bounds of the ellipse. The current pen is used for drawing the arc and
the current brush is use... | [
"def",
"DrawEllipticArc",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"DC_DrawEllipticArc",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L3490-L3504 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/build/waf-1.7.13/lmbrwaflib/qt5.py | python | qm2rcc.run | (self) | Create a qrc file including the inputs | Create a qrc file including the inputs | [
"Create",
"a",
"qrc",
"file",
"including",
"the",
"inputs"
] | def run(self):
"""Create a qrc file including the inputs"""
txt = '\n'.join(['<file>%s</file>' % k.path_from(self.outputs[0].parent) for k in self.inputs])
code = '<!DOCTYPE RCC><RCC version="1.0">\n<qresource>\n%s\n</qresource>\n</RCC>' % txt
self.outputs[0].write(code) | [
"def",
"run",
"(",
"self",
")",
":",
"txt",
"=",
"'\\n'",
".",
"join",
"(",
"[",
"'<file>%s</file>'",
"%",
"k",
".",
"path_from",
"(",
"self",
".",
"outputs",
"[",
"0",
"]",
".",
"parent",
")",
"for",
"k",
"in",
"self",
".",
"inputs",
"]",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/lmbrwaflib/qt5.py#L917-L921 | ||
greenheartgames/greenworks | 3ea4ab490b56676de3f0a237c74bcfdb17323e60 | deps/cpplint/cpplint.py | python | ProcessLine | (filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]) | Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (dot not included) of the file.
clean_lines: An array of strings, each representing a line of the file,
with comments stripped.
line: Number of line being ... | Processes a single line in the file. | [
"Processes",
"a",
"single",
"line",
"in",
"the",
"file",
"."
] | def ProcessLine(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions=[]):
"""Processes a single line in the file.
Args:
filename: Filename of the file that is being processed.
file_extension: The extension (d... | [
"def",
"ProcessLine",
"(",
"filename",
",",
"file_extension",
",",
"clean_lines",
",",
"line",
",",
"include_state",
",",
"function_state",
",",
"nesting_state",
",",
"error",
",",
"extra_check_functions",
"=",
"[",
"]",
")",
":",
"raw_lines",
"=",
"clean_lines"... | https://github.com/greenheartgames/greenworks/blob/3ea4ab490b56676de3f0a237c74bcfdb17323e60/deps/cpplint/cpplint.py#L5705-L5747 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/ftplib.py | python | parse227 | (resp) | return host, port | Parse the '227' response for a PASV request.
Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
Return ('host.addr.as.numbers', port#) tuple. | Parse the '227' response for a PASV request.
Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
Return ('host.addr.as.numbers', port#) tuple. | [
"Parse",
"the",
"227",
"response",
"for",
"a",
"PASV",
"request",
".",
"Raises",
"error_proto",
"if",
"it",
"does",
"not",
"contain",
"(",
"h1",
"h2",
"h3",
"h4",
"p1",
"p2",
")",
"Return",
"(",
"host",
".",
"addr",
".",
"as",
".",
"numbers",
"port#"... | def parse227(resp):
'''Parse the '227' response for a PASV request.
Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
Return ('host.addr.as.numbers', port#) tuple.'''
if resp[:3] != '227':
raise error_reply(resp)
global _227_re
if _227_re is None:
import re
... | [
"def",
"parse227",
"(",
"resp",
")",
":",
"if",
"resp",
"[",
":",
"3",
"]",
"!=",
"'227'",
":",
"raise",
"error_reply",
"(",
"resp",
")",
"global",
"_227_re",
"if",
"_227_re",
"is",
"None",
":",
"import",
"re",
"_227_re",
"=",
"re",
".",
"compile",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ftplib.py#L839-L856 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/groupby.py | python | GroupBy.sem | (self, ddof: int = 1) | return self.std(ddof=ddof) / np.sqrt(self.count()) | Compute standard error of the mean of groups, excluding missing values.
For multiple groupings, the result index will be a MultiIndex.
Parameters
----------
ddof : int, default 1
Degrees of freedom.
Returns
-------
Series or DataFrame
St... | Compute standard error of the mean of groups, excluding missing values. | [
"Compute",
"standard",
"error",
"of",
"the",
"mean",
"of",
"groups",
"excluding",
"missing",
"values",
"."
] | def sem(self, ddof: int = 1):
"""
Compute standard error of the mean of groups, excluding missing values.
For multiple groupings, the result index will be a MultiIndex.
Parameters
----------
ddof : int, default 1
Degrees of freedom.
Returns
... | [
"def",
"sem",
"(",
"self",
",",
"ddof",
":",
"int",
"=",
"1",
")",
":",
"return",
"self",
".",
"std",
"(",
"ddof",
"=",
"ddof",
")",
"/",
"np",
".",
"sqrt",
"(",
"self",
".",
"count",
"(",
")",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/groupby/groupby.py#L1300-L1316 | |
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/ply/example/ansic/cparse.py | python | p_jump_statement_2 | (t) | jump_statement : CONTINUE SEMI | jump_statement : CONTINUE SEMI | [
"jump_statement",
":",
"CONTINUE",
"SEMI"
] | def p_jump_statement_2(t):
'jump_statement : CONTINUE SEMI'
pass | [
"def",
"p_jump_statement_2",
"(",
"t",
")",
":",
"pass"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/ply/example/ansic/cparse.py#L545-L547 | ||
NREL/EnergyPlus | fadc5973b85c70e8cc923efb69c144e808a26078 | third_party/fmt-8.0.1/support/docopt.py | python | transform | (pattern) | return Either(*[Required(*e) for e in result]) | Expand pattern into an (almost) equivalent one, but with single Either.
Example: ((-a | -b) (-c | -d)) => (-a -c | -a -d | -b -c | -b -d)
Quirks: [-a] => (-a), (-a...) => (-a -a) | Expand pattern into an (almost) equivalent one, but with single Either. | [
"Expand",
"pattern",
"into",
"an",
"(",
"almost",
")",
"equivalent",
"one",
"but",
"with",
"single",
"Either",
"."
] | def transform(pattern):
"""Expand pattern into an (almost) equivalent one, but with single Either.
Example: ((-a | -b) (-c | -d)) => (-a -c | -a -d | -b -c | -b -d)
Quirks: [-a] => (-a), (-a...) => (-a -a)
"""
result = []
groups = [[pattern]]
while groups:
children = groups.pop(0)
... | [
"def",
"transform",
"(",
"pattern",
")",
":",
"result",
"=",
"[",
"]",
"groups",
"=",
"[",
"[",
"pattern",
"]",
"]",
"while",
"groups",
":",
"children",
"=",
"groups",
".",
"pop",
"(",
"0",
")",
"parents",
"=",
"[",
"Required",
",",
"Optional",
","... | https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/third_party/fmt-8.0.1/support/docopt.py#L72-L96 | |
trailofbits/llvm-sanitizer-tutorial | d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99 | llvm/bindings/python/llvm/object.py | python | Symbol.size | (self) | return lib.LLVMGetSymbolSize(self) | The size of the symbol, in long bytes. | The size of the symbol, in long bytes. | [
"The",
"size",
"of",
"the",
"symbol",
"in",
"long",
"bytes",
"."
] | def size(self):
"""The size of the symbol, in long bytes."""
if self.expired:
raise Exception('Symbol instance has expired.')
return lib.LLVMGetSymbolSize(self) | [
"def",
"size",
"(",
"self",
")",
":",
"if",
"self",
".",
"expired",
":",
"raise",
"Exception",
"(",
"'Symbol instance has expired.'",
")",
"return",
"lib",
".",
"LLVMGetSymbolSize",
"(",
"self",
")"
] | https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/bindings/python/llvm/object.py#L322-L327 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/generator.py | python | CssItem.SetFontSize | (self, size_str) | Sets the Font Point Size
@param size_str: point size to use for font in style | Sets the Font Point Size
@param size_str: point size to use for font in style | [
"Sets",
"the",
"Font",
"Point",
"Size",
"@param",
"size_str",
":",
"point",
"size",
"to",
"use",
"for",
"font",
"in",
"style"
] | def SetFontSize(self, size_str):
"""Sets the Font Point Size
@param size_str: point size to use for font in style
"""
self._size = size_str | [
"def",
"SetFontSize",
"(",
"self",
",",
"size_str",
")",
":",
"self",
".",
"_size",
"=",
"size_str"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/generator.py#L487-L492 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_windows.py | python | VarHVScrollHelper.GetRowColumnCount | (*args, **kwargs) | return _windows_.VarHVScrollHelper_GetRowColumnCount(*args, **kwargs) | GetRowColumnCount(self) -> Size | GetRowColumnCount(self) -> Size | [
"GetRowColumnCount",
"(",
"self",
")",
"-",
">",
"Size"
] | def GetRowColumnCount(*args, **kwargs):
"""GetRowColumnCount(self) -> Size"""
return _windows_.VarHVScrollHelper_GetRowColumnCount(*args, **kwargs) | [
"def",
"GetRowColumnCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"VarHVScrollHelper_GetRowColumnCount",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_windows.py#L2395-L2397 | |
su2code/SU2 | 72b2fa977b64b9683a388920f05298a40d39e5c5 | SU2_PY/SU2/io/tools.py | python | get_dvMap | () | return dv_map | get dictionary that maps design variable
kind id number to name | get dictionary that maps design variable
kind id number to name | [
"get",
"dictionary",
"that",
"maps",
"design",
"variable",
"kind",
"id",
"number",
"to",
"name"
] | def get_dvMap():
""" get dictionary that maps design variable
kind id number to name """
dv_map = { 0 : "NO_DEFORMATION" ,
1 : "TRANSLATION" ,
2 : "ROTATION" ,
3 : "SCALE" ,
10 : "FFD_SETT... | [
"def",
"get_dvMap",
"(",
")",
":",
"dv_map",
"=",
"{",
"0",
":",
"\"NO_DEFORMATION\"",
",",
"1",
":",
"\"TRANSLATION\"",
",",
"2",
":",
"\"ROTATION\"",
",",
"3",
":",
"\"SCALE\"",
",",
"10",
":",
"\"FFD_SETTING\"",
",",
"11",
":",
"\"FFD_CONTROL_POINT\"",
... | https://github.com/su2code/SU2/blob/72b2fa977b64b9683a388920f05298a40d39e5c5/SU2_PY/SU2/io/tools.py#L516-L554 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/device/cuda/__init__.py | python | get_device_properties | (device=None) | return core.get_device_properties(device_id) | Return the properties of given device.
Args:
device(paddle.CUDAPlace or int or str): The device, the id of the device or
the string name of device like 'gpu:x' which to get the properties of the
device from. If device is None, the device is the current device.
Default... | Return the properties of given device. | [
"Return",
"the",
"properties",
"of",
"given",
"device",
"."
] | def get_device_properties(device=None):
'''
Return the properties of given device.
Args:
device(paddle.CUDAPlace or int or str): The device, the id of the device or
the string name of device like 'gpu:x' which to get the properties of the
device from. If device is None, th... | [
"def",
"get_device_properties",
"(",
"device",
"=",
"None",
")",
":",
"if",
"not",
"core",
".",
"is_compiled_with_cuda",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"The API paddle.device.cuda.get_device_properties is not supported in \"",
"\"CPU-only PaddlePaddle. Please re... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/device/cuda/__init__.py#L212-L275 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py | python | CudnnParamsFormatConverterGRU._cudnn_to_tf_weights | (self, *cu_weights) | return (array_ops.transpose(array_ops.concat([W_i, W_r], axis=0)),
array_ops.transpose(w_h), array_ops.transpose(r_h)) | r"""Stitching cudnn canonical weights to generate tf canonical weights. | r"""Stitching cudnn canonical weights to generate tf canonical weights. | [
"r",
"Stitching",
"cudnn",
"canonical",
"weights",
"to",
"generate",
"tf",
"canonical",
"weights",
"."
] | def _cudnn_to_tf_weights(self, *cu_weights):
r"""Stitching cudnn canonical weights to generate tf canonical weights."""
w_i, w_r, w_h, r_i, r_r, r_h = cu_weights
# pylint: disable=invalid-name
W_i = array_ops.concat([w_i, r_i], axis=1)
W_r = array_ops.concat([w_r, r_r], axis=1)
# pylint: enable... | [
"def",
"_cudnn_to_tf_weights",
"(",
"self",
",",
"*",
"cu_weights",
")",
":",
"w_i",
",",
"w_r",
",",
"w_h",
",",
"r_i",
",",
"r_r",
",",
"r_h",
"=",
"cu_weights",
"# pylint: disable=invalid-name",
"W_i",
"=",
"array_ops",
".",
"concat",
"(",
"[",
"w_i",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L592-L601 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/refactor.py | python | RefactoringTool.gen_lines | (self, block, indent) | Generates lines as expected by tokenize from a list of lines.
This strips the first len(indent + self.PS1) characters off each line. | Generates lines as expected by tokenize from a list of lines. | [
"Generates",
"lines",
"as",
"expected",
"by",
"tokenize",
"from",
"a",
"list",
"of",
"lines",
"."
] | def gen_lines(self, block, indent):
"""Generates lines as expected by tokenize from a list of lines.
This strips the first len(indent + self.PS1) characters off each line.
"""
prefix1 = indent + self.PS1
prefix2 = indent + self.PS2
prefix = prefix1
for line in bl... | [
"def",
"gen_lines",
"(",
"self",
",",
"block",
",",
"indent",
")",
":",
"prefix1",
"=",
"indent",
"+",
"self",
".",
"PS1",
"prefix2",
"=",
"indent",
"+",
"self",
".",
"PS2",
"prefix",
"=",
"prefix1",
"for",
"line",
"in",
"block",
":",
"if",
"line",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/refactor.py#L671-L688 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/engine/training_utils_v1.py | python | standardize_single_array | (x, expected_shape=None) | return x | Expand data of shape (x,) to (x, 1), unless len(expected_shape)==1. | Expand data of shape (x,) to (x, 1), unless len(expected_shape)==1. | [
"Expand",
"data",
"of",
"shape",
"(",
"x",
")",
"to",
"(",
"x",
"1",
")",
"unless",
"len",
"(",
"expected_shape",
")",
"==",
"1",
"."
] | def standardize_single_array(x, expected_shape=None):
"""Expand data of shape (x,) to (x, 1), unless len(expected_shape)==1."""
if x is None:
return None
if is_composite_or_composite_value(x):
return x
if isinstance(x, int):
raise ValueError(
'Expected an array data type but received an in... | [
"def",
"standardize_single_array",
"(",
"x",
",",
"expected_shape",
"=",
"None",
")",
":",
"if",
"x",
"is",
"None",
":",
"return",
"None",
"if",
"is_composite_or_composite_value",
"(",
"x",
")",
":",
"return",
"x",
"if",
"isinstance",
"(",
"x",
",",
"int",... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/training_utils_v1.py#L514-L532 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/cython/Cython/Plex/DFA.py | python | set_epsilon_closure | (state_set) | return result | Given a set of states, return the union of the epsilon
closures of its member states. | Given a set of states, return the union of the epsilon
closures of its member states. | [
"Given",
"a",
"set",
"of",
"states",
"return",
"the",
"union",
"of",
"the",
"epsilon",
"closures",
"of",
"its",
"member",
"states",
"."
] | def set_epsilon_closure(state_set):
"""
Given a set of states, return the union of the epsilon
closures of its member states.
"""
result = {}
for state1 in state_set:
for state2 in epsilon_closure(state1):
result[state2] = 1
return result | [
"def",
"set_epsilon_closure",
"(",
"state_set",
")",
":",
"result",
"=",
"{",
"}",
"for",
"state1",
"in",
"state_set",
":",
"for",
"state2",
"in",
"epsilon_closure",
"(",
"state1",
")",
":",
"result",
"[",
"state2",
"]",
"=",
"1",
"return",
"result"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/cython/Cython/Plex/DFA.py#L54-L63 | |
openbabel/openbabel | f3ed2a9a5166dbd3b9ce386e636a176074a6c34c | scripts/python/openbabel/pybel.py | python | Outputfile.write | (self, molecule) | Write a molecule to the output file.
Required parameters:
molecule | Write a molecule to the output file. | [
"Write",
"a",
"molecule",
"to",
"the",
"output",
"file",
"."
] | def write(self, molecule):
"""Write a molecule to the output file.
Required parameters:
molecule
"""
if not self.filename:
raise IOError("Outputfile instance is closed.")
if self.total == 0:
self.obConversion.WriteFile(molecule.OBMol, self.fil... | [
"def",
"write",
"(",
"self",
",",
"molecule",
")",
":",
"if",
"not",
"self",
".",
"filename",
":",
"raise",
"IOError",
"(",
"\"Outputfile instance is closed.\"",
")",
"if",
"self",
".",
"total",
"==",
"0",
":",
"self",
".",
"obConversion",
".",
"WriteFile"... | https://github.com/openbabel/openbabel/blob/f3ed2a9a5166dbd3b9ce386e636a176074a6c34c/scripts/python/openbabel/pybel.py#L268-L281 | ||
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/server.py | python | WebTestHttpd.start | (self, block=False) | Start the server.
:param block: True to run the server on the current thread, blocking,
False to run on a separate thread. | Start the server. | [
"Start",
"the",
"server",
"."
] | def start(self, block=False):
"""Start the server.
:param block: True to run the server on the current thread, blocking,
False to run on a separate thread."""
self.logger.info("Starting http server on %s:%s" % (self.host, self.port))
self.started = True
if ... | [
"def",
"start",
"(",
"self",
",",
"block",
"=",
"False",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Starting http server on %s:%s\"",
"%",
"(",
"self",
".",
"host",
",",
"self",
".",
"port",
")",
")",
"self",
".",
"started",
"=",
"True",
"... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/server.py#L418-L430 | ||
rootm0s/Protectors | 5b3f4d11687a5955caf9c3af30666c4bfc2c19ab | OWASP-ZSC/module/readline_windows/pyreadline/rlmain.py | python | BaseReadline.clear_history | (self) | Clear readline history | Clear readline history | [
"Clear",
"readline",
"history"
] | def clear_history(self):
'''Clear readline history'''
self.mode._history.clear_history() | [
"def",
"clear_history",
"(",
"self",
")",
":",
"self",
".",
"mode",
".",
"_history",
".",
"clear_history",
"(",
")"
] | https://github.com/rootm0s/Protectors/blob/5b3f4d11687a5955caf9c3af30666c4bfc2c19ab/OWASP-ZSC/module/readline_windows/pyreadline/rlmain.py#L162-L164 | ||
jackaudio/jack2 | 21b293dbc37d42446141a08922cdec0d2550c6a0 | waflib/Utils.py | python | quote_define_name | (s) | return fu | Converts a string into an identifier suitable for C defines.
:type s: string
:param s: String to convert
:rtype: string
:return: Identifier suitable for C defines | Converts a string into an identifier suitable for C defines. | [
"Converts",
"a",
"string",
"into",
"an",
"identifier",
"suitable",
"for",
"C",
"defines",
"."
] | def quote_define_name(s):
"""
Converts a string into an identifier suitable for C defines.
:type s: string
:param s: String to convert
:rtype: string
:return: Identifier suitable for C defines
"""
fu = re.sub('[^a-zA-Z0-9]', '_', s)
fu = re.sub('_+', '_', fu)
fu = fu.upper()
return fu | [
"def",
"quote_define_name",
"(",
"s",
")",
":",
"fu",
"=",
"re",
".",
"sub",
"(",
"'[^a-zA-Z0-9]'",
",",
"'_'",
",",
"s",
")",
"fu",
"=",
"re",
".",
"sub",
"(",
"'_+'",
",",
"'_'",
",",
"fu",
")",
"fu",
"=",
"fu",
".",
"upper",
"(",
")",
"ret... | https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Utils.py#L558-L570 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | xpcom/idl-parser/xpidl.py | python | IDLParser.p_moreparams_start | (self, p) | moreparams : | moreparams : | [
"moreparams",
":"
] | def p_moreparams_start(self, p):
"""moreparams :"""
p[0] = [] | [
"def",
"p_moreparams_start",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"[",
"]"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/xpcom/idl-parser/xpidl.py#L1327-L1329 | ||
google/llvm-propeller | 45c226984fe8377ebfb2ad7713c680d652ba678d | clang/bindings/python/clang/cindex.py | python | Type.get_align | (self) | return conf.lib.clang_Type_getAlignOf(self) | Retrieve the alignment of the record. | Retrieve the alignment of the record. | [
"Retrieve",
"the",
"alignment",
"of",
"the",
"record",
"."
] | def get_align(self):
"""
Retrieve the alignment of the record.
"""
return conf.lib.clang_Type_getAlignOf(self) | [
"def",
"get_align",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_Type_getAlignOf",
"(",
"self",
")"
] | https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/bindings/python/clang/cindex.py#L2378-L2382 | |
evpo/EncryptPad | 156904860aaba8e7e8729b44e269b2992f9fe9f4 | deps/libencryptmsg/configure.py | python | CompilerInfo.binary_link_command_for | (self, osname, options) | return '$(LINKER)' | Return the command needed to link an app/test object | Return the command needed to link an app/test object | [
"Return",
"the",
"command",
"needed",
"to",
"link",
"an",
"app",
"/",
"test",
"object"
] | def binary_link_command_for(self, osname, options):
"""
Return the command needed to link an app/test object
"""
for s in self._so_link_search(osname, options.with_debug_info):
if s in self.binary_link_commands:
return self.binary_link_commands[s]
re... | [
"def",
"binary_link_command_for",
"(",
"self",
",",
"osname",
",",
"options",
")",
":",
"for",
"s",
"in",
"self",
".",
"_so_link_search",
"(",
"osname",
",",
"options",
".",
"with_debug_info",
")",
":",
"if",
"s",
"in",
"self",
".",
"binary_link_commands",
... | https://github.com/evpo/EncryptPad/blob/156904860aaba8e7e8729b44e269b2992f9fe9f4/deps/libencryptmsg/configure.py#L1117-L1126 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/memory_inspector/memory_inspector/core/backends.py | python | Process.Unfreeze | (self) | Resumes the process. | Resumes the process. | [
"Resumes",
"the",
"process",
"."
] | def Unfreeze(self):
"""Resumes the process."""
raise NotImplementedError() | [
"def",
"Unfreeze",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/memory_inspector/memory_inspector/core/backends.py#L141-L143 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/xrc.py | python | XmlResource.LoadOnDialog | (*args, **kwargs) | return _xrc.XmlResource_LoadOnDialog(*args, **kwargs) | LoadOnDialog(self, wxDialog dlg, Window parent, String name) -> bool | LoadOnDialog(self, wxDialog dlg, Window parent, String name) -> bool | [
"LoadOnDialog",
"(",
"self",
"wxDialog",
"dlg",
"Window",
"parent",
"String",
"name",
")",
"-",
">",
"bool"
] | def LoadOnDialog(*args, **kwargs):
"""LoadOnDialog(self, wxDialog dlg, Window parent, String name) -> bool"""
return _xrc.XmlResource_LoadOnDialog(*args, **kwargs) | [
"def",
"LoadOnDialog",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_xrc",
".",
"XmlResource_LoadOnDialog",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L139-L141 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/agw/aui/framemanager.py | python | AuiSingleDockingGuide.IsValid | (self) | return self._valid | Returns whether the docking direction is valid. | Returns whether the docking direction is valid. | [
"Returns",
"whether",
"the",
"docking",
"direction",
"is",
"valid",
"."
] | def IsValid(self):
""" Returns whether the docking direction is valid. """
return self._valid | [
"def",
"IsValid",
"(",
"self",
")",
":",
"return",
"self",
".",
"_valid"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/aui/framemanager.py#L2348-L2351 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/protobuf/python/google/protobuf/descriptor_pool.py | python | DescriptorPool.FindMessageTypeByName | (self, full_name) | return self._descriptors[full_name] | Loads the named descriptor from the pool.
Args:
full_name: The full name of the descriptor to load.
Returns:
The descriptor for the named type. | Loads the named descriptor from the pool. | [
"Loads",
"the",
"named",
"descriptor",
"from",
"the",
"pool",
"."
] | def FindMessageTypeByName(self, full_name):
"""Loads the named descriptor from the pool.
Args:
full_name: The full name of the descriptor to load.
Returns:
The descriptor for the named type.
"""
full_name = full_name.lstrip('.') # fix inconsistent qualified name formats
if full_n... | [
"def",
"FindMessageTypeByName",
"(",
"self",
",",
"full_name",
")",
":",
"full_name",
"=",
"full_name",
".",
"lstrip",
"(",
"'.'",
")",
"# fix inconsistent qualified name formats",
"if",
"full_name",
"not",
"in",
"self",
".",
"_descriptors",
":",
"self",
".",
"F... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/protobuf/python/google/protobuf/descriptor_pool.py#L140-L153 | |
apache/arrow | af33dd1157eb8d7d9bfac25ebf61445b793b7943 | dev/archery/archery/cli.py | python | release_changelog_add | (obj, version) | Prepend the changelog with the current release | Prepend the changelog with the current release | [
"Prepend",
"the",
"changelog",
"with",
"the",
"current",
"release"
] | def release_changelog_add(obj, version):
"""Prepend the changelog with the current release"""
from .release import Release
jira, repo = obj['jira'], obj['repo']
# just handle the current version
release = Release.from_jira(version, jira=jira, repo=repo)
if release.is_released:
raise Va... | [
"def",
"release_changelog_add",
"(",
"obj",
",",
"version",
")",
":",
"from",
".",
"release",
"import",
"Release",
"jira",
",",
"repo",
"=",
"obj",
"[",
"'jira'",
"]",
",",
"obj",
"[",
"'repo'",
"]",
"# just handle the current version",
"release",
"=",
"Rele... | https://github.com/apache/arrow/blob/af33dd1157eb8d7d9bfac25ebf61445b793b7943/dev/archery/archery/cli.py#L821-L839 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/ipython/py2/IPython/sphinxext/ipython_directive.py | python | EmbeddedSphinxShell.process_pure_python | (self, content) | return output | content is a list of strings. it is unedited directive content
This runs it line by line in the InteractiveShell, prepends
prompts as needed capturing stderr and stdout, then returns
the content as a list as if it were ipython code | content is a list of strings. it is unedited directive content | [
"content",
"is",
"a",
"list",
"of",
"strings",
".",
"it",
"is",
"unedited",
"directive",
"content"
] | def process_pure_python(self, content):
"""
content is a list of strings. it is unedited directive content
This runs it line by line in the InteractiveShell, prepends
prompts as needed capturing stderr and stdout, then returns
the content as a list as if it were ipython code
... | [
"def",
"process_pure_python",
"(",
"self",
",",
"content",
")",
":",
"output",
"=",
"[",
"]",
"savefig",
"=",
"False",
"# keep up with this to clear figure",
"multiline",
"=",
"False",
"# to handle line continuation",
"multiline_start",
"=",
"None",
"fmtin",
"=",
"s... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/sphinxext/ipython_directive.py#L728-L804 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/import_pb_to_tensorboard.py | python | import_to_tensorboard | (model_dir, log_dir) | View an imported protobuf model (`.pb` file) as a graph in Tensorboard.
Args:
model_dir: The location of the protobuf (`pb`) model to visualize
log_dir: The location for the Tensorboard log to begin visualization from.
Usage:
Call this function with your model location and desired log directory.
L... | View an imported protobuf model (`.pb` file) as a graph in Tensorboard. | [
"View",
"an",
"imported",
"protobuf",
"model",
"(",
".",
"pb",
"file",
")",
"as",
"a",
"graph",
"in",
"Tensorboard",
"."
] | def import_to_tensorboard(model_dir, log_dir):
"""View an imported protobuf model (`.pb` file) as a graph in Tensorboard.
Args:
model_dir: The location of the protobuf (`pb`) model to visualize
log_dir: The location for the Tensorboard log to begin visualization from.
Usage:
Call this function with ... | [
"def",
"import_to_tensorboard",
"(",
"model_dir",
",",
"log_dir",
")",
":",
"with",
"session",
".",
"Session",
"(",
"graph",
"=",
"ops",
".",
"Graph",
"(",
")",
")",
"as",
"sess",
":",
"with",
"gfile",
".",
"GFile",
"(",
"model_dir",
",",
"\"rb\"",
")"... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/tools/import_pb_to_tensorboard.py#L43-L64 | ||
nasa/trick | 7b85aa66329d62fe8816462627c09a353aac8299 | share/trick/trickops/WorkflowCommon.py | python | Job._failed_string | (self) | return self._done_string() | Get a string to display when this Job has failed.
Returns
-------
str
A string to be displayed when in the FAILED state. | Get a string to display when this Job has failed. | [
"Get",
"a",
"string",
"to",
"display",
"when",
"this",
"Job",
"has",
"failed",
"."
] | def _failed_string(self):
"""
Get a string to display when this Job has failed.
Returns
-------
str
A string to be displayed when in the FAILED state.
"""
return self._done_string() | [
"def",
"_failed_string",
"(",
"self",
")",
":",
"return",
"self",
".",
"_done_string",
"(",
")"
] | https://github.com/nasa/trick/blob/7b85aa66329d62fe8816462627c09a353aac8299/share/trick/trickops/WorkflowCommon.py#L358-L367 | |
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/build/android/pylib/debug_info.py | python | GTestDebugInfo.TakeScreenshot | (self, identifier_mark) | return None | Takes a screen shot from current specified device.
Args:
identifier_mark: A string to identify the screen shot DebugInfo will take.
It will be part of filename of the screen shot. Empty
string is acceptable.
Returns:
Returns the file name on the host of... | Takes a screen shot from current specified device. | [
"Takes",
"a",
"screen",
"shot",
"from",
"current",
"specified",
"device",
"."
] | def TakeScreenshot(self, identifier_mark):
"""Takes a screen shot from current specified device.
Args:
identifier_mark: A string to identify the screen shot DebugInfo will take.
It will be part of filename of the screen shot. Empty
string is acceptable.
R... | [
"def",
"TakeScreenshot",
"(",
"self",
",",
"identifier_mark",
")",
":",
"assert",
"isinstance",
"(",
"identifier_mark",
",",
"str",
")",
"screenshot_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"getenv",
"(",
"'ANDROID_HOST_OUT'",
",",
"''",
... | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/pylib/debug_info.py#L119-L146 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/contrib/slim/python/slim/nets/resnet_utils.py | python | conv2d_same | (inputs, num_outputs, kernel_size, stride, rate=1, scope=None) | Strided 2-D convolution with 'SAME' padding.
When stride > 1, then we do explicit zero-padding, followed by conv2d with
'VALID' padding.
Note that
net = conv2d_same(inputs, num_outputs, 3, stride=stride)
is equivalent to
net = tf.contrib.layers.conv2d(inputs, num_outputs, 3, stride=1,
paddin... | Strided 2-D convolution with 'SAME' padding. | [
"Strided",
"2",
"-",
"D",
"convolution",
"with",
"SAME",
"padding",
"."
] | def conv2d_same(inputs, num_outputs, kernel_size, stride, rate=1, scope=None):
"""Strided 2-D convolution with 'SAME' padding.
When stride > 1, then we do explicit zero-padding, followed by conv2d with
'VALID' padding.
Note that
net = conv2d_same(inputs, num_outputs, 3, stride=stride)
is equivalent t... | [
"def",
"conv2d_same",
"(",
"inputs",
",",
"num_outputs",
",",
"kernel_size",
",",
"stride",
",",
"rate",
"=",
"1",
",",
"scope",
"=",
"None",
")",
":",
"if",
"stride",
"==",
"1",
":",
"return",
"layers_lib",
".",
"conv2d",
"(",
"inputs",
",",
"num_outp... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/slim/python/slim/nets/resnet_utils.py#L88-L147 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py | python | QErrorCorrectionForMergedWorkspaces.correct_q_resolution_for_merged | (self, count_ws_front, count_ws_rear,
output_ws, scale) | We need to transfer the DX error values from the original workspaces to the merged worksapce.
We have:
C(Q) = Sum_all_lambda_for_particular_Q(Counts(lambda))
weightedQRes(Q) = Sum_all_lambda_for_particular_Q(Counts(lambda)* qRes(lambda))
ResQ(Q) = weightedQRes(Q)/C(Q)
Richard sug... | We need to transfer the DX error values from the original workspaces to the merged worksapce.
We have:
C(Q) = Sum_all_lambda_for_particular_Q(Counts(lambda))
weightedQRes(Q) = Sum_all_lambda_for_particular_Q(Counts(lambda)* qRes(lambda))
ResQ(Q) = weightedQRes(Q)/C(Q)
Richard sug... | [
"We",
"need",
"to",
"transfer",
"the",
"DX",
"error",
"values",
"from",
"the",
"original",
"workspaces",
"to",
"the",
"merged",
"worksapce",
".",
"We",
"have",
":",
"C",
"(",
"Q",
")",
"=",
"Sum_all_lambda_for_particular_Q",
"(",
"Counts",
"(",
"lambda",
"... | def correct_q_resolution_for_merged(self, count_ws_front, count_ws_rear,
output_ws, scale):
"""
We need to transfer the DX error values from the original workspaces to the merged worksapce.
We have:
C(Q) = Sum_all_lambda_for_particular_Q(Counts(lam... | [
"def",
"correct_q_resolution_for_merged",
"(",
"self",
",",
"count_ws_front",
",",
"count_ws_rear",
",",
"output_ws",
",",
"scale",
")",
":",
"self",
".",
"_comment",
"(",
"output_ws",
",",
"'Internal Step: q-resolution transferred from input workspaces'",
")",
"if",
"c... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANSStitch.py#L474-L527 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/richtext.py | python | TextAttrBorders.GetTop | (*args) | return _richtext.TextAttrBorders_GetTop(*args) | GetTop(self) -> TextAttrBorder
GetTop(self) -> TextAttrBorder | GetTop(self) -> TextAttrBorder
GetTop(self) -> TextAttrBorder | [
"GetTop",
"(",
"self",
")",
"-",
">",
"TextAttrBorder",
"GetTop",
"(",
"self",
")",
"-",
">",
"TextAttrBorder"
] | def GetTop(*args):
"""
GetTop(self) -> TextAttrBorder
GetTop(self) -> TextAttrBorder
"""
return _richtext.TextAttrBorders_GetTop(*args) | [
"def",
"GetTop",
"(",
"*",
"args",
")",
":",
"return",
"_richtext",
".",
"TextAttrBorders_GetTop",
"(",
"*",
"args",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L498-L503 | |
ap--/python-seabreeze | 86e9145edf7a30cedd4dffd4658a142aeab2d2fc | src/seabreeze/_cli.py | python | ls | () | INTERNAL ONLY: print connected spectrometers | INTERNAL ONLY: print connected spectrometers | [
"INTERNAL",
"ONLY",
":",
"print",
"connected",
"spectrometers"
] | def ls() -> None:
"""INTERNAL ONLY: print connected spectrometers"""
connected = []
for backend in ("cseabreeze", "pyseabreeze"):
try:
# noinspection PyTypeChecker,PydanticTypeChecker
sb_backend: SeaBreezeBackend = import_module(f"seabreeze.{backend}")
except ImportEr... | [
"def",
"ls",
"(",
")",
"->",
"None",
":",
"connected",
"=",
"[",
"]",
"for",
"backend",
"in",
"(",
"\"cseabreeze\"",
",",
"\"pyseabreeze\"",
")",
":",
"try",
":",
"# noinspection PyTypeChecker,PydanticTypeChecker",
"sb_backend",
":",
"SeaBreezeBackend",
"=",
"im... | https://github.com/ap--/python-seabreeze/blob/86e9145edf7a30cedd4dffd4658a142aeab2d2fc/src/seabreeze/_cli.py#L28-L54 | ||
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/utils/token-delta.py | python | DeltaAlgorithm.split | (self, S) | split(set) -> [sets]
Partition a set into one or two pieces. | split(set) -> [sets] | [
"split",
"(",
"set",
")",
"-",
">",
"[",
"sets",
"]"
] | def split(self, S):
"""split(set) -> [sets]
Partition a set into one or two pieces.
"""
# There are many ways to split, we could do a better job with more
# context information (but then the API becomes grosser).
L = list(S)
mid = len(L)//2
if mid==0:
... | [
"def",
"split",
"(",
"self",
",",
"S",
")",
":",
"# There are many ways to split, we could do a better job with more",
"# context information (but then the API becomes grosser).",
"L",
"=",
"list",
"(",
"S",
")",
"mid",
"=",
"len",
"(",
"L",
")",
"//",
"2",
"if",
"m... | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/utils/token-delta.py#L49-L62 | ||
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/ansic/cparse.py | python | p_type_qualifier_list_1 | (t) | type_qualifier_list : type_qualifier | type_qualifier_list : type_qualifier | [
"type_qualifier_list",
":",
"type_qualifier"
] | def p_type_qualifier_list_1(t):
'type_qualifier_list : type_qualifier'
pass | [
"def",
"p_type_qualifier_list_1",
"(",
"t",
")",
":",
"pass"
] | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/ansic/cparse.py#L316-L318 | ||
google/earthenterprise | 0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9 | earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py | python | Globe.ReadMapVectorPacket | (self, qtpath, channel, layer_id) | return self.ReadMapDataPacket(
qtpath, glc_unpacker.kVectorPacket, channel, layer_id) | Returns vector packet at given address and channel.
If vector packet is not found, throws an exception.
Args:
qtpath: the quadtree node of the map vector packet.
channel: the channel of the map vector packet.
layer_id: id of layer in the composite globe.
Returns:
The map vector pac... | Returns vector packet at given address and channel. | [
"Returns",
"vector",
"packet",
"at",
"given",
"address",
"and",
"channel",
"."
] | def ReadMapVectorPacket(self, qtpath, channel, layer_id):
"""Returns vector packet at given address and channel.
If vector packet is not found, throws an exception.
Args:
qtpath: the quadtree node of the map vector packet.
channel: the channel of the map vector packet.
layer_id: id of la... | [
"def",
"ReadMapVectorPacket",
"(",
"self",
",",
"qtpath",
",",
"channel",
",",
"layer_id",
")",
":",
"return",
"self",
".",
"ReadMapDataPacket",
"(",
"qtpath",
",",
"glc_unpacker",
".",
"kVectorPacket",
",",
"channel",
",",
"layer_id",
")"
] | https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/common/portable_globe.py#L415-L428 | |
sdhash/sdhash | b9eff63e4e5867e910f41fd69032bbb1c94a2a5e | sdhash-ui/cherrypy/_cprequest.py | python | Response.collapse_body | (self) | return newbody | Collapse self.body to a single string; replace it and return it. | Collapse self.body to a single string; replace it and return it. | [
"Collapse",
"self",
".",
"body",
"to",
"a",
"single",
"string",
";",
"replace",
"it",
"and",
"return",
"it",
"."
] | def collapse_body(self):
"""Collapse self.body to a single string; replace it and return it."""
if isinstance(self.body, basestring):
return self.body
newbody = []
for chunk in self.body:
if py3k and not isinstance(chunk, bytes):
raise Typ... | [
"def",
"collapse_body",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"body",
",",
"basestring",
")",
":",
"return",
"self",
".",
"body",
"newbody",
"=",
"[",
"]",
"for",
"chunk",
"in",
"self",
".",
"body",
":",
"if",
"py3k",
"and",
... | https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/_cprequest.py#L884-L897 | |
eric612/MobileNet-YOLO | 69b4441cb3ec8d553fbdef788ad033e246f901bd | scripts/cpp_lint.py | python | _IncludeState.IsInAlphabeticalOrder | (self, clean_lines, linenum, header_path) | return True | Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be checked.
Returns:
Returns true if the header is in alphabetical order. | Check if a header is in alphabetical order with the previous header. | [
"Check",
"if",
"a",
"header",
"is",
"in",
"alphabetical",
"order",
"with",
"the",
"previous",
"header",
"."
] | def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
"""Check if a header is in alphabetical order with the previous header.
Args:
clean_lines: A CleansedLines instance containing the file.
linenum: The number of the line to check.
header_path: Canonicalized header to be checke... | [
"def",
"IsInAlphabeticalOrder",
"(",
"self",
",",
"clean_lines",
",",
"linenum",
",",
"header_path",
")",
":",
"# If previous section is different from current section, _last_header will",
"# be reset to empty string, so it's always less than current header.",
"#",
"# If previous line ... | https://github.com/eric612/MobileNet-YOLO/blob/69b4441cb3ec8d553fbdef788ad033e246f901bd/scripts/cpp_lint.py#L616-L635 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | SettableHeaderColumn.SetHidden | (*args, **kwargs) | return _core_.SettableHeaderColumn_SetHidden(*args, **kwargs) | SetHidden(self, bool hidden) | SetHidden(self, bool hidden) | [
"SetHidden",
"(",
"self",
"bool",
"hidden",
")"
] | def SetHidden(*args, **kwargs):
"""SetHidden(self, bool hidden)"""
return _core_.SettableHeaderColumn_SetHidden(*args, **kwargs) | [
"def",
"SetHidden",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"SettableHeaderColumn_SetHidden",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L16512-L16514 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py | python | TNavigator.circle | (self, radius, extent = None, steps = None) | Draw a circle with given radius.
Arguments:
radius -- a number
extent (optional) -- a number
steps (optional) -- an integer
Draw a circle with given radius. The center is radius units left
of the turtle; extent - an angle - determines which part of the
circle is... | Draw a circle with given radius. | [
"Draw",
"a",
"circle",
"with",
"given",
"radius",
"."
] | def circle(self, radius, extent = None, steps = None):
""" Draw a circle with given radius.
Arguments:
radius -- a number
extent (optional) -- a number
steps (optional) -- an integer
Draw a circle with given radius. The center is radius units left
of the turtle;... | [
"def",
"circle",
"(",
"self",
",",
"radius",
",",
"extent",
"=",
"None",
",",
"steps",
"=",
"None",
")",
":",
"if",
"self",
".",
"undobuffer",
":",
"self",
".",
"undobuffer",
".",
"push",
"(",
"[",
"\"seq\"",
"]",
")",
"self",
".",
"undobuffer",
".... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/turtle.py#L1938-L1999 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/propgrid.py | python | PropertyGridInterface.RegisterAdditionalEditors | (*args, **kwargs) | return _propgrid.PropertyGridInterface_RegisterAdditionalEditors(*args, **kwargs) | RegisterAdditionalEditors() | RegisterAdditionalEditors() | [
"RegisterAdditionalEditors",
"()"
] | def RegisterAdditionalEditors(*args, **kwargs):
"""RegisterAdditionalEditors()"""
return _propgrid.PropertyGridInterface_RegisterAdditionalEditors(*args, **kwargs) | [
"def",
"RegisterAdditionalEditors",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PropertyGridInterface_RegisterAdditionalEditors",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/propgrid.py#L1340-L1342 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/prompt-toolkit/py2/prompt_toolkit/contrib/telnet/protocol.py | python | TelnetProtocolParser.naws | (self, data) | Received NAWS. (Window dimensions.) | Received NAWS. (Window dimensions.) | [
"Received",
"NAWS",
".",
"(",
"Window",
"dimensions",
".",
")"
] | def naws(self, data):
"""
Received NAWS. (Window dimensions.)
"""
if len(data) == 4:
# NOTE: the first parameter of struct.unpack should be
# a 'str' object. Both on Py2/py3. This crashes on OSX
# otherwise.
columns, rows = struct.unpack(st... | [
"def",
"naws",
"(",
"self",
",",
"data",
")",
":",
"if",
"len",
"(",
"data",
")",
"==",
"4",
":",
"# NOTE: the first parameter of struct.unpack should be",
"# a 'str' object. Both on Py2/py3. This crashes on OSX",
"# otherwise.",
"columns",
",",
"rows",
"=",
"struct",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/contrib/telnet/protocol.py#L102-L113 | ||
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/klampt/src/robotsim.py | python | Appearance.setDraw | (self, *args) | return _robotsim.Appearance_setDraw(self, *args) | r"""
setDraw(Appearance self, bool draw)
setDraw(Appearance self, int feature, bool draw)
Turns on/off visibility of the object or a feature.
If one argument is given, turns the object visibility on or off
If two arguments are given, turns the feature (first int argument)... | r"""
setDraw(Appearance self, bool draw)
setDraw(Appearance self, int feature, bool draw) | [
"r",
"setDraw",
"(",
"Appearance",
"self",
"bool",
"draw",
")",
"setDraw",
"(",
"Appearance",
"self",
"int",
"feature",
"bool",
"draw",
")"
] | def setDraw(self, *args) -> "void":
r"""
setDraw(Appearance self, bool draw)
setDraw(Appearance self, int feature, bool draw)
Turns on/off visibility of the object or a feature.
If one argument is given, turns the object visibility on or off
If two arguments are g... | [
"def",
"setDraw",
"(",
"self",
",",
"*",
"args",
")",
"->",
"\"void\"",
":",
"return",
"_robotsim",
".",
"Appearance_setDraw",
"(",
"self",
",",
"*",
"args",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L2839-L2853 | |
tiann/android-native-debug | 198903ed9346dc4a74327a63cb98d449b97d8047 | app/source/art/tools/cpplint.py | python | IsErrorSuppressedByNolint | (category, linenum) | return (linenum in _error_suppressions.get(category, set()) or
linenum in _error_suppressions.get(None, set())) | Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the current line number.
Returns:
bool, True iff the error... | Returns true if the specified error category is suppressed on this line. | [
"Returns",
"true",
"if",
"the",
"specified",
"error",
"category",
"is",
"suppressed",
"on",
"this",
"line",
"."
] | def IsErrorSuppressedByNolint(category, linenum):
"""Returns true if the specified error category is suppressed on this line.
Consults the global error_suppressions map populated by
ParseNolintSuppressions/ResetNolintSuppressions.
Args:
category: str, the category of the error.
linenum: int, the curre... | [
"def",
"IsErrorSuppressedByNolint",
"(",
"category",
",",
"linenum",
")",
":",
"return",
"(",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"category",
",",
"set",
"(",
")",
")",
"or",
"linenum",
"in",
"_error_suppressions",
".",
"get",
"(",
"None... | https://github.com/tiann/android-native-debug/blob/198903ed9346dc4a74327a63cb98d449b97d8047/app/source/art/tools/cpplint.py#L394-L407 | |
BitMEX/api-connectors | 37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812 | auto-generated/python/swagger_client/models/announcement.py | python | Announcement.__init__ | (self, id=None, link=None, title=None, content=None, _date=None) | Announcement - a model defined in Swagger | Announcement - a model defined in Swagger | [
"Announcement",
"-",
"a",
"model",
"defined",
"in",
"Swagger"
] | def __init__(self, id=None, link=None, title=None, content=None, _date=None): # noqa: E501
"""Announcement - a model defined in Swagger""" # noqa: E501
self._id = None
self._link = None
self._title = None
self._content = None
self.__date = None
self.discriminat... | [
"def",
"__init__",
"(",
"self",
",",
"id",
"=",
"None",
",",
"link",
"=",
"None",
",",
"title",
"=",
"None",
",",
"content",
"=",
"None",
",",
"_date",
"=",
"None",
")",
":",
"# noqa: E501",
"# noqa: E501",
"self",
".",
"_id",
"=",
"None",
"self",
... | https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/announcement.py#L49-L67 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | Gauge.SetShadowWidth | (*args, **kwargs) | return _controls_.Gauge_SetShadowWidth(*args, **kwargs) | SetShadowWidth(self, int w) | SetShadowWidth(self, int w) | [
"SetShadowWidth",
"(",
"self",
"int",
"w",
")"
] | def SetShadowWidth(*args, **kwargs):
"""SetShadowWidth(self, int w)"""
return _controls_.Gauge_SetShadowWidth(*args, **kwargs) | [
"def",
"SetShadowWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"Gauge_SetShadowWidth",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L771-L773 | |
GeometryCollective/boundary-first-flattening | 8250e5a0e85980ec50b5e8aa8f49dd6519f915cd | deps/nanogui/ext/pybind11/tools/clang/cindex.py | python | Cursor.canonical | (self) | return self._canonical | Return the canonical Cursor corresponding to this Cursor.
The canonical cursor is the cursor which is representative for the
underlying entity. For example, if you have multiple forward
declarations for the same class, the canonical cursor for the forward
declarations will be identical. | Return the canonical Cursor corresponding to this Cursor. | [
"Return",
"the",
"canonical",
"Cursor",
"corresponding",
"to",
"this",
"Cursor",
"."
] | def canonical(self):
"""Return the canonical Cursor corresponding to this Cursor.
The canonical cursor is the cursor which is representative for the
underlying entity. For example, if you have multiple forward
declarations for the same class, the canonical cursor for the forward
... | [
"def",
"canonical",
"(",
"self",
")",
":",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_canonical'",
")",
":",
"self",
".",
"_canonical",
"=",
"conf",
".",
"lib",
".",
"clang_getCanonicalCursor",
"(",
"self",
")",
"return",
"self",
".",
"_canonical"
] | https://github.com/GeometryCollective/boundary-first-flattening/blob/8250e5a0e85980ec50b5e8aa8f49dd6519f915cd/deps/nanogui/ext/pybind11/tools/clang/cindex.py#L1358-L1369 | |
pybox2d/pybox2d | 09643321fd363f0850087d1bde8af3f4afd82163 | library/Box2D/examples/backends/pyglet_framework.py | python | PygletDraw.DrawPolygon | (self, vertices, color) | Draw a wireframe polygon given the world vertices (tuples) with the specified color. | Draw a wireframe polygon given the world vertices (tuples) with the specified color. | [
"Draw",
"a",
"wireframe",
"polygon",
"given",
"the",
"world",
"vertices",
"(",
"tuples",
")",
"with",
"the",
"specified",
"color",
"."
] | def DrawPolygon(self, vertices, color):
"""
Draw a wireframe polygon given the world vertices (tuples) with the specified color.
"""
if len(vertices) == 2:
p1, p2 = vertices
self.batch.add(2, gl.GL_LINES, None,
('v2f', (p1[0], p1[1], p2[... | [
"def",
"DrawPolygon",
"(",
"self",
",",
"vertices",
",",
"color",
")",
":",
"if",
"len",
"(",
"vertices",
")",
"==",
"2",
":",
"p1",
",",
"p2",
"=",
"vertices",
"self",
".",
"batch",
".",
"add",
"(",
"2",
",",
"gl",
".",
"GL_LINES",
",",
"None",
... | https://github.com/pybox2d/pybox2d/blob/09643321fd363f0850087d1bde8af3f4afd82163/library/Box2D/examples/backends/pyglet_framework.py#L272-L286 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/function_base.py | python | hamming | (M) | return 0.54 - 0.46*cos(2.0*pi*n/(M-1)) | Return the Hamming window.
The Hamming window is a taper formed by using a weighted cosine.
Parameters
----------
M : int
Number of points in the output window. If zero or less, an
empty array is returned.
Returns
-------
out : ndarray
The window, with the maximum ... | Return the Hamming window. | [
"Return",
"the",
"Hamming",
"window",
"."
] | def hamming(M):
"""
Return the Hamming window.
The Hamming window is a taper formed by using a weighted cosine.
Parameters
----------
M : int
Number of points in the output window. If zero or less, an
empty array is returned.
Returns
-------
out : ndarray
T... | [
"def",
"hamming",
"(",
"M",
")",
":",
"if",
"M",
"<",
"1",
":",
"return",
"array",
"(",
"[",
"]",
")",
"if",
"M",
"==",
"1",
":",
"return",
"ones",
"(",
"1",
",",
"float",
")",
"n",
"=",
"arange",
"(",
"0",
",",
"M",
")",
"return",
"0.54",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/lib/function_base.py#L2861-L2957 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_core.py | python | MenuItem.GetAccel | (*args, **kwargs) | return _core_.MenuItem_GetAccel(*args, **kwargs) | GetAccel(self) -> AcceleratorEntry | GetAccel(self) -> AcceleratorEntry | [
"GetAccel",
"(",
"self",
")",
"-",
">",
"AcceleratorEntry"
] | def GetAccel(*args, **kwargs):
"""GetAccel(self) -> AcceleratorEntry"""
return _core_.MenuItem_GetAccel(*args, **kwargs) | [
"def",
"GetAccel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_core_",
".",
"MenuItem_GetAccel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L12541-L12543 | |
weolar/miniblink49 | 1c4678db0594a4abde23d3ebbcc7cd13c3170777 | third_party/WebKit/Tools/Scripts/webkitpy/common/system/platforminfo.py | python | PlatformInfo.terminal_width | (self) | Returns sys.maxint if the width cannot be determined. | Returns sys.maxint if the width cannot be determined. | [
"Returns",
"sys",
".",
"maxint",
"if",
"the",
"width",
"cannot",
"be",
"determined",
"."
] | def terminal_width(self):
"""Returns sys.maxint if the width cannot be determined."""
try:
if self.is_win():
# From http://code.activestate.com/recipes/440694-determine-size-of-console-window-on-windows/
from ctypes import windll, create_string_buffer
... | [
"def",
"terminal_width",
"(",
"self",
")",
":",
"try",
":",
"if",
"self",
".",
"is_win",
"(",
")",
":",
"# From http://code.activestate.com/recipes/440694-determine-size-of-console-window-on-windows/",
"from",
"ctypes",
"import",
"windll",
",",
"create_string_buffer",
"ha... | https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/common/system/platforminfo.py#L98-L121 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_controls.py | python | PreInfoBar | (*args, **kwargs) | return val | PreInfoBar() -> InfoBar
An info bar is a transient window shown at top or bottom of its parent
window to display non-critical information to the user. It works
similarly to message bars in current web browsers. | PreInfoBar() -> InfoBar | [
"PreInfoBar",
"()",
"-",
">",
"InfoBar"
] | def PreInfoBar(*args, **kwargs):
"""
PreInfoBar() -> InfoBar
An info bar is a transient window shown at top or bottom of its parent
window to display non-critical information to the user. It works
similarly to message bars in current web browsers.
"""
val = _controls_.new_PreInfoBar(*args,... | [
"def",
"PreInfoBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"val",
"=",
"_controls_",
".",
"new_PreInfoBar",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"return",
"val"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L7846-L7855 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.