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
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
external/tools/build/v2/util/set.py
python
difference
(b, a)
return result
Returns the elements of B that are not in A.
Returns the elements of B that are not in A.
[ "Returns", "the", "elements", "of", "B", "that", "are", "not", "in", "A", "." ]
def difference (b, a): """ Returns the elements of B that are not in A. """ result = [] for element in b: if not element in a: result.append (element) return result
[ "def", "difference", "(", "b", ",", "a", ")", ":", "result", "=", "[", "]", "for", "element", "in", "b", ":", "if", "not", "element", "in", "a", ":", "result", ".", "append", "(", "element", ")", "return", "result" ]
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/external/tools/build/v2/util/set.py#L8-L16
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
RobotModelLink.getPointAcceleration
(self, plocal: "double const [3]", ddq: "doubleVector")
return _robotsim.RobotModelLink_getPointAcceleration(self, plocal, ddq)
r""" getPointAcceleration(RobotModelLink self, double const [3] plocal, doubleVector ddq) Computes the acceleration of the point given the robot's current joint configuration and velocities, and the joint accelerations ddq. Returns: list of 3 floats: the acceleration ...
r""" getPointAcceleration(RobotModelLink self, double const [3] plocal, doubleVector ddq)
[ "r", "getPointAcceleration", "(", "RobotModelLink", "self", "double", "const", "[", "3", "]", "plocal", "doubleVector", "ddq", ")" ]
def getPointAcceleration(self, plocal: "double const [3]", ddq: "doubleVector") -> "void": r""" getPointAcceleration(RobotModelLink self, double const [3] plocal, doubleVector ddq) Computes the acceleration of the point given the robot's current joint configuration and velocities, and ...
[ "def", "getPointAcceleration", "(", "self", ",", "plocal", ":", "\"double const [3]\"", ",", "ddq", ":", "\"doubleVector\"", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "RobotModelLink_getPointAcceleration", "(", "self", ",", "plocal", ",", "ddq", ")" ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L4457-L4471
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/audio/validators.py
python
check_biquad_sample_rate
(sample_rate)
Wrapper method to check the parameters of sample_rate.
Wrapper method to check the parameters of sample_rate.
[ "Wrapper", "method", "to", "check", "the", "parameters", "of", "sample_rate", "." ]
def check_biquad_sample_rate(sample_rate): """Wrapper method to check the parameters of sample_rate.""" type_check(sample_rate, (int,), "sample_rate") check_int32_not_zero(sample_rate, "sample_rate")
[ "def", "check_biquad_sample_rate", "(", "sample_rate", ")", ":", "type_check", "(", "sample_rate", ",", "(", "int", ",", ")", ",", "\"sample_rate\"", ")", "check_int32_not_zero", "(", "sample_rate", ",", "\"sample_rate\"", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/audio/validators.py#L53-L56
echronos/echronos
c996f1d2c8af6c6536205eb319c1bf1d4d84569c
pylib/release.py
python
release_test_one
(archive)
Test a single archive This is primarily a sanity check of the actual release file. Release files are only made after other testing has been successfully performed. Currently it simply does some sanitfy checking on the tar file to ensure it is consistent. In the future additional testing will be perfo...
Test a single archive
[ "Test", "a", "single", "archive" ]
def release_test_one(archive): """Test a single archive This is primarily a sanity check of the actual release file. Release files are only made after other testing has been successfully performed. Currently it simply does some sanitfy checking on the tar file to ensure it is consistent. In the f...
[ "def", "release_test_one", "(", "archive", ")", ":", "project_prj_template", "=", "\"\"\"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<project>\n<search-path>{}</search-path>\n</project>\n\"\"\"", "rel_file", "=", "os", ".", "path", ".", "abspath", "(", "archive", ")", "with", ...
https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/pylib/release.py#L471-L541
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/monitoring.py
python
APICallAttemptEvent.__init__
(self, service, operation, timestamp, latency=None, url=None, http_status_code=None, request_headers=None, response_headers=None, parsed_error=None, wire_exception=None)
Monitor event for a single API call attempt This event corresponds to a single HTTP request attempt in completing the entire client method call. :type service: str :param service: A string identifying the service associated to the event :type operation: str ...
Monitor event for a single API call attempt
[ "Monitor", "event", "for", "a", "single", "API", "call", "attempt" ]
def __init__(self, service, operation, timestamp, latency=None, url=None, http_status_code=None, request_headers=None, response_headers=None, parsed_error=None, wire_exception=None): """Monitor event for a single API call attempt This event corresponds...
[ "def", "__init__", "(", "self", ",", "service", ",", "operation", ",", "timestamp", ",", "latency", "=", "None", ",", "url", "=", "None", ",", "http_status_code", "=", "None", ",", "request_headers", "=", "None", ",", "response_headers", "=", "None", ",", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/monitoring.py#L239-L296
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/bindings/samples/metadata/plot_metadata.py
python
plot_exposure_data
(data_frame, iso_axes, shutter_time_axes, ev_axes, ev_diff_axes)
Interactive plot of ISO, shutter time, EV and the maximum EV diff to other sensors
Interactive plot of ISO, shutter time, EV and the maximum EV diff to other sensors
[ "Interactive", "plot", "of", "ISO", "shutter", "time", "EV", "and", "the", "maximum", "EV", "diff", "to", "other", "sensors" ]
def plot_exposure_data(data_frame, iso_axes, shutter_time_axes, ev_axes, ev_diff_axes): """ Interactive plot of ISO, shutter time, EV and the maximum EV diff to other sensors """ if len(data_frame.index) == 0: return df_time_normal, xmin, xmax = time_normalized_d...
[ "def", "plot_exposure_data", "(", "data_frame", ",", "iso_axes", ",", "shutter_time_axes", ",", "ev_axes", ",", "ev_diff_axes", ")", ":", "if", "len", "(", "data_frame", ".", "index", ")", "==", "0", ":", "return", "df_time_normal", ",", "xmin", ",", "xmax",...
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/metadata/plot_metadata.py#L119-L174
facebookresearch/habitat-sim
63b6c71d9ca8adaefb140b198196f5d0ca1f1e34
src_python/habitat_sim/robots/mobile_manipulator.py
python
MobileManipulator.gripper_joint_pos
(self, ctrl: List[float])
Kinematically sets the gripper joints and sets the motors to target.
Kinematically sets the gripper joints and sets the motors to target.
[ "Kinematically", "sets", "the", "gripper", "joints", "and", "sets", "the", "motors", "to", "target", "." ]
def gripper_joint_pos(self, ctrl: List[float]): """Kinematically sets the gripper joints and sets the motors to target.""" joint_positions = self.sim_obj.joint_positions for i, jidx in enumerate(self.params.gripper_joints): self._set_motor_pos(jidx, ctrl[i]) joint_positio...
[ "def", "gripper_joint_pos", "(", "self", ",", "ctrl", ":", "List", "[", "float", "]", ")", ":", "joint_positions", "=", "self", ".", "sim_obj", ".", "joint_positions", "for", "i", ",", "jidx", "in", "enumerate", "(", "self", ".", "params", ".", "gripper_...
https://github.com/facebookresearch/habitat-sim/blob/63b6c71d9ca8adaefb140b198196f5d0ca1f1e34/src_python/habitat_sim/robots/mobile_manipulator.py#L317-L323
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/_lsq/common.py
python
check_termination
(dF, F, dx_norm, x_norm, ratio, ftol, xtol)
Check termination condition for nonlinear least squares.
Check termination condition for nonlinear least squares.
[ "Check", "termination", "condition", "for", "nonlinear", "least", "squares", "." ]
def check_termination(dF, F, dx_norm, x_norm, ratio, ftol, xtol): """Check termination condition for nonlinear least squares.""" ftol_satisfied = dF < ftol * F and ratio > 0.25 xtol_satisfied = dx_norm < xtol * (xtol + x_norm) if ftol_satisfied and xtol_satisfied: return 4 elif ftol_satisfi...
[ "def", "check_termination", "(", "dF", ",", "F", ",", "dx_norm", ",", "x_norm", ",", "ratio", ",", "ftol", ",", "xtol", ")", ":", "ftol_satisfied", "=", "dF", "<", "ftol", "*", "F", "and", "ratio", ">", "0.25", "xtol_satisfied", "=", "dx_norm", "<", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_lsq/common.py#L709-L721
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/dask_cudf/dask_cudf/groupby.py
python
_var_agg
(df, col, count_name, sum_name, pow2_sum_name, ddof=1)
return var
Calculate variance (given count, sum, and sum-squared columns).
Calculate variance (given count, sum, and sum-squared columns).
[ "Calculate", "variance", "(", "given", "count", "sum", "and", "sum", "-", "squared", "columns", ")", "." ]
def _var_agg(df, col, count_name, sum_name, pow2_sum_name, ddof=1): """Calculate variance (given count, sum, and sum-squared columns).""" # Select count, sum, and sum-squared n = df[count_name] x = df[sum_name] x2 = df[pow2_sum_name] # Use sum-squared approach to get variance var = x2 - x ...
[ "def", "_var_agg", "(", "df", ",", "col", ",", "count_name", ",", "sum_name", ",", "pow2_sum_name", ",", "ddof", "=", "1", ")", ":", "# Select count, sum, and sum-squared", "n", "=", "df", "[", "count_name", "]", "x", "=", "df", "[", "sum_name", "]", "x2...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/dask_cudf/dask_cudf/groupby.py#L516-L534
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/stc.py
python
StyledTextCtrl.GetTextRangeRaw
(*args, **kwargs)
return _stc.StyledTextCtrl_GetTextRangeRaw(*args, **kwargs)
GetTextRangeRaw(self, int startPos, int endPos) -> wxCharBuffer Retrieve a range of text. The returned value is a utf-8 encoded string in unicode builds of wxPython, or raw 8-bit text otherwise.
GetTextRangeRaw(self, int startPos, int endPos) -> wxCharBuffer
[ "GetTextRangeRaw", "(", "self", "int", "startPos", "int", "endPos", ")", "-", ">", "wxCharBuffer" ]
def GetTextRangeRaw(*args, **kwargs): """ GetTextRangeRaw(self, int startPos, int endPos) -> wxCharBuffer Retrieve a range of text. The returned value is a utf-8 encoded string in unicode builds of wxPython, or raw 8-bit text otherwise. """ return _stc.StyledTextCtrl_...
[ "def", "GetTextRangeRaw", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_GetTextRangeRaw", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/stc.py#L6739-L6746
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/cmd.py
python
Cmd.preloop
(self)
Hook method executed once when the cmdloop() method is called.
Hook method executed once when the cmdloop() method is called.
[ "Hook", "method", "executed", "once", "when", "the", "cmdloop", "()", "method", "is", "called", "." ]
def preloop(self): """Hook method executed once when the cmdloop() method is called.""" pass
[ "def", "preloop", "(", "self", ")", ":", "pass" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/cmd.py#L161-L163
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
ortools/sat/python/cp_model.py
python
CpModel.ClearAssumptions
(self)
Remove all assumptions from the model.
Remove all assumptions from the model.
[ "Remove", "all", "assumptions", "from", "the", "model", "." ]
def ClearAssumptions(self): """Remove all assumptions from the model.""" self.__model.ClearField('assumptions')
[ "def", "ClearAssumptions", "(", "self", ")", ":", "self", ".", "__model", ".", "ClearField", "(", "'assumptions'", ")" ]
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/sat/python/cp_model.py#L2007-L2009
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/win_tool.py
python
WinTool.Dispatch
(self, args)
return getattr(self, method)(*args[1:])
Dispatches a string command to a method.
Dispatches a string command to a method.
[ "Dispatches", "a", "string", "command", "to", "a", "method", "." ]
def Dispatch(self, args): """Dispatches a string command to a method.""" if len(args) < 1: raise Exception("Not enough arguments") method = "Exec%s" % self._CommandifyName(args[0]) return getattr(self, method)(*args[1:])
[ "def", "Dispatch", "(", "self", ",", "args", ")", ":", "if", "len", "(", "args", ")", "<", "1", ":", "raise", "Exception", "(", "\"Not enough arguments\"", ")", "method", "=", "\"Exec%s\"", "%", "self", ".", "_CommandifyName", "(", "args", "[", "0", "]...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/win_tool.py#L48-L54
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/layers/layers.py
python
GlobalMaxPooling
(name='')
return _Pooling(PoolingType_Max, NDShape.unknown().dimensions(), pad=False, op_name='GlobalMaxPooling', name=name)
Layer factory function to create a global max-pooling layer. The global max-pooling operation computes the element-wise maximum over all items on an N-dimensional grid, such as an image. This operation is the same as applying ``reduce_max()`` to all grid dimensions. Example: >>> f = GlobalMaxPooling...
Layer factory function to create a global max-pooling layer.
[ "Layer", "factory", "function", "to", "create", "a", "global", "max", "-", "pooling", "layer", "." ]
def GlobalMaxPooling(name=''): ''' Layer factory function to create a global max-pooling layer. The global max-pooling operation computes the element-wise maximum over all items on an N-dimensional grid, such as an image. This operation is the same as applying ``reduce_max()`` to all grid dimensions. ...
[ "def", "GlobalMaxPooling", "(", "name", "=", "''", ")", ":", "return", "_Pooling", "(", "PoolingType_Max", ",", "NDShape", ".", "unknown", "(", ")", ".", "dimensions", "(", ")", ",", "pad", "=", "False", ",", "op_name", "=", "'GlobalMaxPooling'", ",", "n...
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/layers/layers.py#L1235-L1262
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/grid.py
python
Grid.SetLabelFont
(*args, **kwargs)
return _grid.Grid_SetLabelFont(*args, **kwargs)
SetLabelFont(self, Font ?)
SetLabelFont(self, Font ?)
[ "SetLabelFont", "(", "self", "Font", "?", ")" ]
def SetLabelFont(*args, **kwargs): """SetLabelFont(self, Font ?)""" return _grid.Grid_SetLabelFont(*args, **kwargs)
[ "def", "SetLabelFont", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_SetLabelFont", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L1562-L1564
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
isPubidChar
(ch)
return ret
This function is DEPRECATED. Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead
This function is DEPRECATED. Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead
[ "This", "function", "is", "DEPRECATED", ".", "Use", "xmlIsPubidChar_ch", "or", "xmlIsPubidCharQ", "instead" ]
def isPubidChar(ch): """This function is DEPRECATED. Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead """ ret = libxml2mod.xmlIsPubidChar(ch) return ret
[ "def", "isPubidChar", "(", "ch", ")", ":", "ret", "=", "libxml2mod", ".", "xmlIsPubidChar", "(", "ch", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L1011-L1015
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Node/__init__.py
python
Node.built
(self)
Called just after this node is successfully built.
Called just after this node is successfully built.
[ "Called", "just", "after", "this", "node", "is", "successfully", "built", "." ]
def built(self): """Called just after this node is successfully built.""" # Clear the implicit dependency caches of any Nodes # waiting for this Node to be built. for parent in self.waiting_parents: parent.implicit = None # Handle issue where builder emits more ...
[ "def", "built", "(", "self", ")", ":", "# Clear the implicit dependency caches of any Nodes", "# waiting for this Node to be built.", "for", "parent", "in", "self", ".", "waiting_parents", ":", "parent", ".", "implicit", "=", "None", "# Handle issue where builder emits more t...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/__init__.py#L761-L797
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/convert/entity_object/conversion/aoc/genie_unit.py
python
GenieBuildingLineGroup.get_gatherer_ids
(self)
return self.gatherer_ids
Returns gatherer unit IDs that drop off resources at this building.
Returns gatherer unit IDs that drop off resources at this building.
[ "Returns", "gatherer", "unit", "IDs", "that", "drop", "off", "resources", "at", "this", "building", "." ]
def get_gatherer_ids(self): """ Returns gatherer unit IDs that drop off resources at this building. """ return self.gatherer_ids
[ "def", "get_gatherer_ids", "(", "self", ")", ":", "return", "self", ".", "gatherer_ids" ]
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/convert/entity_object/conversion/aoc/genie_unit.py#L672-L676
apple/swift-clang
d7403439fc6641751840b723e7165fb02f52db95
tools/scan-build-py/libscanbuild/analyze.py
python
scan_build
()
Entry point for scan-build command.
Entry point for scan-build command.
[ "Entry", "point", "for", "scan", "-", "build", "command", "." ]
def scan_build(): """ Entry point for scan-build command. """ args = parse_args_for_scan_build() # will re-assign the report directory as new output with report_directory(args.output, args.keep_empty) as args.output: # Run against a build command. there are cases, when analyzer run # is...
[ "def", "scan_build", "(", ")", ":", "args", "=", "parse_args_for_scan_build", "(", ")", "# will re-assign the report directory as new output", "with", "report_directory", "(", "args", ".", "output", ",", "args", ".", "keep_empty", ")", "as", "args", ".", "output", ...
https://github.com/apple/swift-clang/blob/d7403439fc6641751840b723e7165fb02f52db95/tools/scan-build-py/libscanbuild/analyze.py#L49-L72
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/concat.py
python
combine_concat_plans
(plans, concat_axis)
Combine multiple concatenation plans into one. existing_plan is updated in-place.
Combine multiple concatenation plans into one.
[ "Combine", "multiple", "concatenation", "plans", "into", "one", "." ]
def combine_concat_plans(plans, concat_axis): """ Combine multiple concatenation plans into one. existing_plan is updated in-place. """ if len(plans) == 1: for p in plans[0]: yield p[0], [p[1]] elif concat_axis == 0: offset = 0 for plan in plans: ...
[ "def", "combine_concat_plans", "(", "plans", ",", "concat_axis", ")", ":", "if", "len", "(", "plans", ")", "==", "1", ":", "for", "p", "in", "plans", "[", "0", "]", ":", "yield", "p", "[", "0", "]", ",", "[", "p", "[", "1", "]", "]", "elif", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/internals/concat.py#L434-L493
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
configure.py
python
get_from_env_or_user_or_default
(environ_cp, var_name, ask_for_var, var_default)
return var
Get var_name either from env, or user or default. If var_name has been set as environment variable, use the preset value, else ask for user input. If no input is provided, the default is used. Args: environ_cp: copy of the os.environ. var_name: string for name of environment variable, e.g. "TF_NEED_CUDA...
Get var_name either from env, or user or default.
[ "Get", "var_name", "either", "from", "env", "or", "user", "or", "default", "." ]
def get_from_env_or_user_or_default(environ_cp, var_name, ask_for_var, var_default): """Get var_name either from env, or user or default. If var_name has been set as environment variable, use the preset value, else ask for user input. If no input is provided, the default is us...
[ "def", "get_from_env_or_user_or_default", "(", "environ_cp", ",", "var_name", ",", "ask_for_var", ",", "var_default", ")", ":", "var", "=", "environ_cp", ".", "get", "(", "var_name", ")", "if", "not", "var", ":", "var", "=", "get_input", "(", "ask_for_var", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/configure.py#L582-L604
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/widget_analysis_session.py
python
ConceptStateViewWidget._ipython_display_
(self)
Called when display() or pyout is used to display the session
Called when display() or pyout is used to display the session
[ "Called", "when", "display", "()", "or", "pyout", "is", "used", "to", "display", "the", "session" ]
def _ipython_display_(self): """Called when display() or pyout is used to display the session""" self.box._ipython_display_()
[ "def", "_ipython_display_", "(", "self", ")", ":", "self", ".", "box", ".", "_ipython_display_", "(", ")" ]
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/widget_analysis_session.py#L432-L434
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cgutils.py
python
_StructProxy._make_refs
(self, ref)
return ref, ref
Return an (outer ref, value ref) pair. By default, these are the same pointers, but a derived class may override this.
Return an (outer ref, value ref) pair. By default, these are the same pointers, but a derived class may override this.
[ "Return", "an", "(", "outer", "ref", "value", "ref", ")", "pair", ".", "By", "default", "these", "are", "the", "same", "pointers", "but", "a", "derived", "class", "may", "override", "this", "." ]
def _make_refs(self, ref): """ Return an (outer ref, value ref) pair. By default, these are the same pointers, but a derived class may override this. """ if ref is None: ref = alloca_once(self._builder, self._be_type, zfill=True) return ref, ref
[ "def", "_make_refs", "(", "self", ",", "ref", ")", ":", "if", "ref", "is", "None", ":", "ref", "=", "alloca_once", "(", "self", ".", "_builder", ",", "self", ".", "_be_type", ",", "zfill", "=", "True", ")", "return", "ref", ",", "ref" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cgutils.py#L125-L132
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/main.py
python
key_list_to_dict
(key_list)
Convert a list of strings of the form 'foo:bar' to a dictionary. Splits strings of the form 'foo:bar quux:quax' into separate entries.
Convert a list of strings of the form 'foo:bar' to a dictionary.
[ "Convert", "a", "list", "of", "strings", "of", "the", "form", "foo", ":", "bar", "to", "a", "dictionary", "." ]
def key_list_to_dict(key_list): """ Convert a list of strings of the form 'foo:bar' to a dictionary. Splits strings of the form 'foo:bar quux:quax' into separate entries. """ try: key_list = [key for s in key_list for key in s.split(' ')] return dict(map(lambda s: [t.strip() for t i...
[ "def", "key_list_to_dict", "(", "key_list", ")", ":", "try", ":", "key_list", "=", "[", "key", "for", "s", "in", "key_list", "for", "key", "in", "s", ".", "split", "(", "' '", ")", "]", "return", "dict", "(", "map", "(", "lambda", "s", ":", "[", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_aarch64/python2.7/dist-packages/rosdep2/main.py#L221-L231
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/utils/llvm-build/llvmbuild/componentinfo.py
python
ComponentInfo.get_parent_target_group
(self)
get_parent_target_group() -> ComponentInfo or None Return the nearest parent target group (if any), or None if the component is not part of any target group.
get_parent_target_group() -> ComponentInfo or None
[ "get_parent_target_group", "()", "-", ">", "ComponentInfo", "or", "None" ]
def get_parent_target_group(self): """get_parent_target_group() -> ComponentInfo or None Return the nearest parent target group (if any), or None if the component is not part of any target group. """ # If this is a target group, return it. if self.type_name == 'TargetGr...
[ "def", "get_parent_target_group", "(", "self", ")", ":", "# If this is a target group, return it.", "if", "self", ".", "type_name", "==", "'TargetGroup'", ":", "return", "self", "# Otherwise recurse on the parent, if any.", "if", "self", ".", "parent_instance", ":", "retu...
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/utils/llvm-build/llvmbuild/componentinfo.py#L74-L87
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/cubecolourdialog.py
python
DrawCheckerBoard
(dc, rect, checkColour, box=5)
Draws a checkerboard on a :class:`DC`. :param `dc`: an instance of :class:`DC`; :param `rect`: the client rectangle on which to draw the checkerboard; :param `checkColour`: the colour used for the dark checkerboards; :param `box`: the checkerboards box sizes. :note: Used for the Alpha channel ...
Draws a checkerboard on a :class:`DC`.
[ "Draws", "a", "checkerboard", "on", "a", ":", "class", ":", "DC", "." ]
def DrawCheckerBoard(dc, rect, checkColour, box=5): """ Draws a checkerboard on a :class:`DC`. :param `dc`: an instance of :class:`DC`; :param `rect`: the client rectangle on which to draw the checkerboard; :param `checkColour`: the colour used for the dark checkerboards; :param `box`: the chec...
[ "def", "DrawCheckerBoard", "(", "dc", ",", "rect", ",", "checkColour", ",", "box", "=", "5", ")", ":", "y", "=", "rect", ".", "y", "checkPen", "=", "wx", ".", "Pen", "(", "checkColour", ")", "checkBrush", "=", "wx", ".", "Brush", "(", "checkColour", ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/cubecolourdialog.py#L1441-L1466
moai/moai-dev
0ba7c678311d1fa9dbc091f60665e95e54169fdf
3rdparty/freetype-2.7/src/tools/docmaker/utils.py
python
make_file_list
( args = None )
return file_list
Build a list of input files from command-line arguments.
Build a list of input files from command-line arguments.
[ "Build", "a", "list", "of", "input", "files", "from", "command", "-", "line", "arguments", "." ]
def make_file_list( args = None ): """Build a list of input files from command-line arguments.""" file_list = [] # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' ) if not args: args = sys.argv[1:] for pathname in args: if string.find( pathname, '*' ) >= 0: newpath = gl...
[ "def", "make_file_list", "(", "args", "=", "None", ")", ":", "file_list", "=", "[", "]", "# sys.stderr.write( repr( sys.argv[1 :] ) + '\\n' )", "if", "not", "args", ":", "args", "=", "sys", ".", "argv", "[", "1", ":", "]", "for", "pathname", "in", "args", ...
https://github.com/moai/moai-dev/blob/0ba7c678311d1fa9dbc091f60665e95e54169fdf/3rdparty/freetype-2.7/src/tools/docmaker/utils.py#L101-L125
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/resource_variable_ops.py
python
ResourceVariable.to_proto
(self, export_scope=None)
Converts a `ResourceVariable` to a `VariableDef` protocol buffer. Args: export_scope: Optional `string`. Name scope to remove. Returns: A `VariableDef` protocol buffer, or `None` if the `Variable` is not in the specified name scope.
Converts a `ResourceVariable` to a `VariableDef` protocol buffer.
[ "Converts", "a", "ResourceVariable", "to", "a", "VariableDef", "protocol", "buffer", "." ]
def to_proto(self, export_scope=None): """Converts a `ResourceVariable` to a `VariableDef` protocol buffer. Args: export_scope: Optional `string`. Name scope to remove. Returns: A `VariableDef` protocol buffer, or `None` if the `Variable` is not in the specified name scope. """ i...
[ "def", "to_proto", "(", "self", ",", "export_scope", "=", "None", ")", ":", "if", "(", "export_scope", "is", "None", "or", "self", ".", "handle", ".", "name", ".", "startswith", "(", "export_scope", ")", ")", ":", "var_def", "=", "variable_pb2", ".", "...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/resource_variable_ops.py#L361-L387
bryanyzhu/Hidden-Two-Stream
f7f684adbdacb6df6b1cf196c3a476cd23484a0f
scripts/cpp_lint.py
python
UpdateIncludeState
(filename, include_state, io=codecs)
return True
Fill up the include_state with new includes found from the file. Args: filename: the name of the header to read. include_state: an _IncludeState instance in which the headers are inserted. io: The io factory to use to read the file. Provided for testability. Returns: True if a header was succesful...
Fill up the include_state with new includes found from the file.
[ "Fill", "up", "the", "include_state", "with", "new", "includes", "found", "from", "the", "file", "." ]
def UpdateIncludeState(filename, include_state, io=codecs): """Fill up the include_state with new includes found from the file. Args: filename: the name of the header to read. include_state: an _IncludeState instance in which the headers are inserted. io: The io factory to use to read the file. Provide...
[ "def", "UpdateIncludeState", "(", "filename", ",", "include_state", ",", "io", "=", "codecs", ")", ":", "headerfile", "=", "None", "try", ":", "headerfile", "=", "io", ".", "open", "(", "filename", ",", "'r'", ",", "'utf8'", ",", "'replace'", ")", "excep...
https://github.com/bryanyzhu/Hidden-Two-Stream/blob/f7f684adbdacb6df6b1cf196c3a476cd23484a0f/scripts/cpp_lint.py#L4454-L4480
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/ogr.py
python
Geometry.GetZ
(self, *args, **kwargs)
return _ogr.Geometry_GetZ(self, *args, **kwargs)
r"""GetZ(Geometry self, int point=0) -> double
r"""GetZ(Geometry self, int point=0) -> double
[ "r", "GetZ", "(", "Geometry", "self", "int", "point", "=", "0", ")", "-", ">", "double" ]
def GetZ(self, *args, **kwargs): r"""GetZ(Geometry self, int point=0) -> double""" return _ogr.Geometry_GetZ(self, *args, **kwargs)
[ "def", "GetZ", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_ogr", ".", "Geometry_GetZ", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L5982-L5984
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py
python
BucketizedColumn.parse_example_spec
(self)
return self.source_column.parse_example_spec
See `FeatureColumn` base class.
See `FeatureColumn` base class.
[ "See", "FeatureColumn", "base", "class", "." ]
def parse_example_spec(self): """See `FeatureColumn` base class.""" return self.source_column.parse_example_spec
[ "def", "parse_example_spec", "(", "self", ")", ":", "return", "self", ".", "source_column", ".", "parse_example_spec" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L2889-L2891
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_collections_abc.py
python
Set.isdisjoint
(self, other)
return True
Return True if two sets have a null intersection.
Return True if two sets have a null intersection.
[ "Return", "True", "if", "two", "sets", "have", "a", "null", "intersection", "." ]
def isdisjoint(self, other): 'Return True if two sets have a null intersection.' for value in other: if value in self: return False return True
[ "def", "isdisjoint", "(", "self", ",", "other", ")", ":", "for", "value", "in", "other", ":", "if", "value", "in", "self", ":", "return", "False", "return", "True" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/_collections_abc.py#L481-L486
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/tools/gyp/pylib/gyp/MSVSUtil.py
python
_GetPdbPath
(target_dict, config_name, vars)
return pdb_path
Returns the path to the PDB file that will be generated by a given configuration. The lookup proceeds as follows: - Look for an explicit path in the VCLinkerTool configuration block. - Look for an 'msvs_large_pdb_path' variable. - Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is ...
Returns the path to the PDB file that will be generated by a given configuration.
[ "Returns", "the", "path", "to", "the", "PDB", "file", "that", "will", "be", "generated", "by", "a", "given", "configuration", "." ]
def _GetPdbPath(target_dict, config_name, vars): """Returns the path to the PDB file that will be generated by a given configuration. The lookup proceeds as follows: - Look for an explicit path in the VCLinkerTool configuration block. - Look for an 'msvs_large_pdb_path' variable. - Use '<(PRODUCT_DIR...
[ "def", "_GetPdbPath", "(", "target_dict", ",", "config_name", ",", "vars", ")", ":", "config", "=", "target_dict", "[", "'configurations'", "]", "[", "config_name", "]", "msvs", "=", "config", ".", "setdefault", "(", "'msvs_settings'", ",", "{", "}", ")", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/tools/gyp/pylib/gyp/MSVSUtil.py#L129-L166
apache/incubator-weex
5c25f0b59f7ac90703c363e7261f60bd06356dbe
weex_core/tools/cpplint.py
python
ShouldCheckNamespaceIndentation
(nesting_state, is_namespace_indent_item, raw_lines_no_comments, linenum)
return IsBlockInNameSpace(nesting_state, is_forward_declaration)
This method determines if we should apply our namespace indentation check. Args: nesting_state: The current nesting state. is_namespace_indent_item: If we just put a new class on the stack, True. If the top of the stack is not a class, or we did not recently add the class, False. raw_lines_no...
This method determines if we should apply our namespace indentation check.
[ "This", "method", "determines", "if", "we", "should", "apply", "our", "namespace", "indentation", "check", "." ]
def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item, raw_lines_no_comments, linenum): """This method determines if we should apply our namespace indentation check. Args: nesting_state: The current nesting state. is_namespace_indent_item: If we jus...
[ "def", "ShouldCheckNamespaceIndentation", "(", "nesting_state", ",", "is_namespace_indent_item", ",", "raw_lines_no_comments", ",", "linenum", ")", ":", "is_forward_declaration", "=", "IsForwardClassDeclaration", "(", "raw_lines_no_comments", ",", "linenum", ")", "if", "not...
https://github.com/apache/incubator-weex/blob/5c25f0b59f7ac90703c363e7261f60bd06356dbe/weex_core/tools/cpplint.py#L5739-L5766
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/mesa/MesaLib/src/mesa/main/APIspecutil.py
python
ReturnType
(funcname)
return func.return_type
Return the C return type of named function.
Return the C return type of named function.
[ "Return", "the", "C", "return", "type", "of", "named", "function", "." ]
def ReturnType(funcname): """Return the C return type of named function.""" func = __functions[funcname] return func.return_type
[ "def", "ReturnType", "(", "funcname", ")", ":", "func", "=", "__functions", "[", "funcname", "]", "return", "func", ".", "return_type" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/mesa/MesaLib/src/mesa/main/APIspecutil.py#L97-L100
psnonis/FinBERT
c0c555d833a14e2316a3701e59c0b5156f804b4e
bert/tokenization.py
python
printable_text
(text)
Returns text encoded in a way suitable for print or `tf.logging`.
Returns text encoded in a way suitable for print or `tf.logging`.
[ "Returns", "text", "encoded", "in", "a", "way", "suitable", "for", "print", "or", "tf", ".", "logging", "." ]
def printable_text(text): """Returns text encoded in a way suitable for print or `tf.logging`.""" # These functions want `str` for both Python2 and Python3, but in one case # it's a Unicode string and in the other it's a byte string. if six.PY3: if isinstance(text, str): return text elif isinstan...
[ "def", "printable_text", "(", "text", ")", ":", "# These functions want `str` for both Python2 and Python3, but in one case", "# it's a Unicode string and in the other it's a byte string.", "if", "six", ".", "PY3", ":", "if", "isinstance", "(", "text", ",", "str", ")", ":", ...
https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/tokenization.py#L98-L118
milvus-io/milvus
3b1030de2b6c39e3512833e97f6044d63eb24237
internal/core/build-support/cpplint.py
python
FileInfo.IsSource
(self)
return _IsSourceExtension(self.Extension()[1:])
File has a source file extension.
File has a source file extension.
[ "File", "has", "a", "source", "file", "extension", "." ]
def IsSource(self): """File has a source file extension.""" return _IsSourceExtension(self.Extension()[1:])
[ "def", "IsSource", "(", "self", ")", ":", "return", "_IsSourceExtension", "(", "self", ".", "Extension", "(", ")", "[", "1", ":", "]", ")" ]
https://github.com/milvus-io/milvus/blob/3b1030de2b6c39e3512833e97f6044d63eb24237/internal/core/build-support/cpplint.py#L1650-L1652
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py
python
PhactoriOperationSpecifics.GetListOfInputOperationNamesForThisOperationType
(self)
return retList
operations which depend on additional inputs besides the default single\n input need to override this method and return their dependencies as a\n list of names
operations which depend on additional inputs besides the default single\n input need to override this method and return their dependencies as a\n list of names
[ "operations", "which", "depend", "on", "additional", "inputs", "besides", "the", "default", "single", "\\", "n", "input", "need", "to", "override", "this", "method", "and", "return", "their", "dependencies", "as", "a", "\\", "n", "list", "of", "names" ]
def GetListOfInputOperationNamesForThisOperationType(self): "operations which depend on additional inputs besides the default single\n input need to override this method and return their dependencies as a\n list of names" retList = [] return retList
[ "def", "GetListOfInputOperationNamesForThisOperationType", "(", "self", ")", ":", "retList", "=", "[", "]", "return", "retList" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/PhactoriDriver.py#L7216-L7219
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixer_util.py
python
ArgList
(args, lparen=LParen(), rparen=RParen())
return node
A parenthesised argument list, used by Call()
A parenthesised argument list, used by Call()
[ "A", "parenthesised", "argument", "list", "used", "by", "Call", "()" ]
def ArgList(args, lparen=LParen(), rparen=RParen()): """A parenthesised argument list, used by Call()""" node = Node(syms.trailer, [lparen.clone(), rparen.clone()]) if args: node.insert_child(1, Node(syms.arglist, args)) return node
[ "def", "ArgList", "(", "args", ",", "lparen", "=", "LParen", "(", ")", ",", "rparen", "=", "RParen", "(", ")", ")", ":", "node", "=", "Node", "(", "syms", ".", "trailer", ",", "[", "lparen", ".", "clone", "(", ")", ",", "rparen", ".", "clone", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib2to3/fixer_util.py#L54-L59
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
Caret.SetSize
(*args, **kwargs)
return _misc_.Caret_SetSize(*args, **kwargs)
SetSize(self, Size size)
SetSize(self, Size size)
[ "SetSize", "(", "self", "Size", "size", ")" ]
def SetSize(*args, **kwargs): """SetSize(self, Size size)""" return _misc_.Caret_SetSize(*args, **kwargs)
[ "def", "SetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Caret_SetSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L786-L788
sailing-pmls/pmls-caffe
49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a
scripts/cpp_lint.py
python
_CppLintState.SetVerboseLevel
(self, level)
return last_verbose_level
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def SetVerboseLevel(self, level): """Sets the module's verbosity, and returns the previous setting.""" last_verbose_level = self.verbose_level self.verbose_level = level return last_verbose_level
[ "def", "SetVerboseLevel", "(", "self", ",", "level", ")", ":", "last_verbose_level", "=", "self", ".", "verbose_level", "self", ".", "verbose_level", "=", "level", "return", "last_verbose_level" ]
https://github.com/sailing-pmls/pmls-caffe/blob/49e98bced9c6d5af7cd701d18ab235b5fd0e4b3a/scripts/cpp_lint.py#L707-L711
alexgkendall/caffe-posenet
62aafbd7c45df91acdba14f5d1406d8295c2bc6f
scripts/cpp_lint.py
python
_NestingState.CheckCompletedBlocks
(self, filename, error)
Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
Checks that all classes and namespaces have been completely parsed.
[ "Checks", "that", "all", "classes", "and", "namespaces", "have", "been", "completely", "parsed", "." ]
def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: Th...
[ "def", "CheckCompletedBlocks", "(", "self", ",", "filename", ",", "error", ")", ":", "# Note: This test can result in false positives if #ifdef constructs", "# get in the way of brace matching. See the testBuildClass test in", "# cpplint_unittest.py for an example of this.", "for", "obj"...
https://github.com/alexgkendall/caffe-posenet/blob/62aafbd7c45df91acdba14f5d1406d8295c2bc6f/scripts/cpp_lint.py#L2172-L2191
OSGeo/gdal
3748fc4ba4fba727492774b2b908a2130c864a83
swig/python/osgeo/ogr.py
python
DataSource.AbortSQL
(self, *args)
return _ogr.DataSource_AbortSQL(self, *args)
r"""AbortSQL(DataSource self) -> OGRErr
r"""AbortSQL(DataSource self) -> OGRErr
[ "r", "AbortSQL", "(", "DataSource", "self", ")", "-", ">", "OGRErr" ]
def AbortSQL(self, *args): r"""AbortSQL(DataSource self) -> OGRErr""" return _ogr.DataSource_AbortSQL(self, *args)
[ "def", "AbortSQL", "(", "self", ",", "*", "args", ")", ":", "return", "_ogr", ".", "DataSource_AbortSQL", "(", "self", ",", "*", "args", ")" ]
https://github.com/OSGeo/gdal/blob/3748fc4ba4fba727492774b2b908a2130c864a83/swig/python/osgeo/ogr.py#L885-L887
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/tools/jinja2/optimizer.py
python
optimize
(node, environment)
return optimizer.visit(node)
The context hint can be used to perform an static optimization based on the context given.
The context hint can be used to perform an static optimization based on the context given.
[ "The", "context", "hint", "can", "be", "used", "to", "perform", "an", "static", "optimization", "based", "on", "the", "context", "given", "." ]
def optimize(node, environment): """The context hint can be used to perform an static optimization based on the context given.""" optimizer = Optimizer(environment) return optimizer.visit(node)
[ "def", "optimize", "(", "node", ",", "environment", ")", ":", "optimizer", "=", "Optimizer", "(", "environment", ")", "return", "optimizer", ".", "visit", "(", "node", ")" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/jinja2/optimizer.py#L23-L27
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSUserFile.py
python
Writer.__init__
(self, user_file_path, version, name)
Initializes the user file. Args: user_file_path: Path to the user file. version: Version info. name: Name of the user file.
Initializes the user file.
[ "Initializes", "the", "user", "file", "." ]
def __init__(self, user_file_path, version, name): """Initializes the user file. Args: user_file_path: Path to the user file. version: Version info. name: Name of the user file. """ self.user_file_path = user_file_path self.version = version self.name = name self.configura...
[ "def", "__init__", "(", "self", ",", "user_file_path", ",", "version", ",", "name", ")", ":", "self", ".", "user_file_path", "=", "user_file_path", "self", ".", "version", "=", "version", "self", ".", "name", "=", "name", "self", ".", "configurations", "="...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/tools/gyp/pylib/gyp/MSVSUserFile.py#L57-L68
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_op_impl/tbe/expm1_ds.py
python
_expm1_ds_tbe
()
return
Expm1 TBE register
Expm1 TBE register
[ "Expm1", "TBE", "register" ]
def _expm1_ds_tbe(): """Expm1 TBE register""" return
[ "def", "_expm1_ds_tbe", "(", ")", ":", "return" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_op_impl/tbe/expm1_ds.py#L36-L38
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
LogWindow.GetOldLog
(*args, **kwargs)
return _misc_.LogWindow_GetOldLog(*args, **kwargs)
GetOldLog(self) -> Log
GetOldLog(self) -> Log
[ "GetOldLog", "(", "self", ")", "-", ">", "Log" ]
def GetOldLog(*args, **kwargs): """GetOldLog(self) -> Log""" return _misc_.LogWindow_GetOldLog(*args, **kwargs)
[ "def", "GetOldLog", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "LogWindow_GetOldLog", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L1778-L1780
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/tensorboard/backend/handler.py
python
TensorboardHandler._serve_scalars
(self, query_params)
Given a tag and single run, return array of ScalarEvents. Alternately, if both the tag and the run are omitted, returns JSON object where obj[run][tag] contains sample values for the given tag in the given run. Args: query_params: The query parameters as a dict.
Given a tag and single run, return array of ScalarEvents.
[ "Given", "a", "tag", "and", "single", "run", "return", "array", "of", "ScalarEvents", "." ]
def _serve_scalars(self, query_params): """Given a tag and single run, return array of ScalarEvents. Alternately, if both the tag and the run are omitted, returns JSON object where obj[run][tag] contains sample values for the given tag in the given run. Args: query_params: The query paramete...
[ "def", "_serve_scalars", "(", "self", ",", "query_params", ")", ":", "# TODO(cassandrax): return HTTP status code for malformed requests", "tag", "=", "query_params", ".", "get", "(", "'tag'", ")", "run", "=", "query_params", ".", "get", "(", "'run'", ")", "if", "...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/tensorboard/backend/handler.py#L249-L286
Tencent/Pebble
68315f176d9e328a233ace29b7579a829f89879f
tools/blade/src/blade/rules_generator.py
python
SconsFileHeaderGenerator.generate_builders
(self)
Generates common builders.
Generates common builders.
[ "Generates", "common", "builders", "." ]
def generate_builders(self): """Generates common builders. """ # Generates builders specified in blade bash at first self._generate_fast_link_builders() proto_config = configparse.blade_config.get_config('proto_library_config') protoc_bin = proto_config['protoc'] protobu...
[ "def", "generate_builders", "(", "self", ")", ":", "# Generates builders specified in blade bash at first", "self", ".", "_generate_fast_link_builders", "(", ")", "proto_config", "=", "configparse", ".", "blade_config", ".", "get_config", "(", "'proto_library_config'", ")",...
https://github.com/Tencent/Pebble/blob/68315f176d9e328a233ace29b7579a829f89879f/tools/blade/src/blade/rules_generator.py#L310-L431
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
GetDisplaySize
(*args)
return _misc_.GetDisplaySize(*args)
GetDisplaySize() -> Size
GetDisplaySize() -> Size
[ "GetDisplaySize", "()", "-", ">", "Size" ]
def GetDisplaySize(*args): """GetDisplaySize() -> Size""" return _misc_.GetDisplaySize(*args)
[ "def", "GetDisplaySize", "(", "*", "args", ")", ":", "return", "_misc_", ".", "GetDisplaySize", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L517-L519
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/elastic/multiprocessing/errors/error_handler.py
python
ErrorHandler.record_exception
(self, e: BaseException)
Writes a structured information about the exception into an error file in JSON format. If the error file cannot be determined, then logs the content that would have been written to the error file.
Writes a structured information about the exception into an error file in JSON format. If the error file cannot be determined, then logs the content that would have been written to the error file.
[ "Writes", "a", "structured", "information", "about", "the", "exception", "into", "an", "error", "file", "in", "JSON", "format", ".", "If", "the", "error", "file", "cannot", "be", "determined", "then", "logs", "the", "content", "that", "would", "have", "been"...
def record_exception(self, e: BaseException) -> None: """ Writes a structured information about the exception into an error file in JSON format. If the error file cannot be determined, then logs the content that would have been written to the error file. """ _write_error(...
[ "def", "record_exception", "(", "self", ",", "e", ":", "BaseException", ")", "->", "None", ":", "_write_error", "(", "e", ",", "self", ".", "_get_error_file_path", "(", ")", ")" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/multiprocessing/errors/error_handler.py#L80-L86
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/sndhdr.py
python
what
(filename)
return res
Guess the type of a sound file
Guess the type of a sound file
[ "Guess", "the", "type", "of", "a", "sound", "file" ]
def what(filename): """Guess the type of a sound file""" res = whathdr(filename) return res
[ "def", "what", "(", "filename", ")", ":", "res", "=", "whathdr", "(", "filename", ")", "return", "res" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/sndhdr.py#L35-L38
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/sets.py
python
Set.update
(self, iterable)
Add all values from an iterable (such as a list or file).
Add all values from an iterable (such as a list or file).
[ "Add", "all", "values", "from", "an", "iterable", "(", "such", "as", "a", "list", "or", "file", ")", "." ]
def update(self, iterable): """Add all values from an iterable (such as a list or file).""" self._update(iterable)
[ "def", "update", "(", "self", ",", "iterable", ")", ":", "self", ".", "_update", "(", "iterable", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/sets.py#L511-L513
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextAttr.Copy
(*args, **kwargs)
return _richtext.RichTextAttr_Copy(*args, **kwargs)
Copy(self, RichTextAttr attr)
Copy(self, RichTextAttr attr)
[ "Copy", "(", "self", "RichTextAttr", "attr", ")" ]
def Copy(*args, **kwargs): """Copy(self, RichTextAttr attr)""" return _richtext.RichTextAttr_Copy(*args, **kwargs)
[ "def", "Copy", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextAttr_Copy", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L869-L871
zeakey/DeepSkeleton
dc70170f8fd2ec8ca1157484ce66129981104486
python/caffe/io.py
python
Transformer.set_transpose
(self, in_, order)
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. Parameters ---------- in_ : which input to assign this channel order order : the order to transpose the dimensions
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model.
[ "Set", "the", "input", "channel", "order", "for", "e", ".", "g", ".", "RGB", "to", "BGR", "conversion", "as", "needed", "for", "the", "reference", "ImageNet", "model", "." ]
def set_transpose(self, in_, order): """ Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. Parameters ---------- in_ : which input to assign this channel order order : the order to transpose the dimensions ...
[ "def", "set_transpose", "(", "self", ",", "in_", ",", "order", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "if", "len", "(", "order", ")", "!=", "len", "(", "self", ".", "inputs", "[", "in_", "]", ")", "-", "1", ":", "raise", "Except...
https://github.com/zeakey/DeepSkeleton/blob/dc70170f8fd2ec8ca1157484ce66129981104486/python/caffe/io.py#L183-L197
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py
python
NDFrame._check_inplace_setting
(self, value)
return True
check whether we allow in-place setting with this type of value
check whether we allow in-place setting with this type of value
[ "check", "whether", "we", "allow", "in", "-", "place", "setting", "with", "this", "type", "of", "value" ]
def _check_inplace_setting(self, value) -> bool_t: """ check whether we allow in-place setting with this type of value """ if self._is_mixed_type: if not self._is_numeric_mixed_type: # allow an actual np.nan thru if is_float(value) and np.isnan(value): ...
[ "def", "_check_inplace_setting", "(", "self", ",", "value", ")", "->", "bool_t", ":", "if", "self", ".", "_is_mixed_type", ":", "if", "not", "self", ".", "_is_numeric_mixed_type", ":", "# allow an actual np.nan thru", "if", "is_float", "(", "value", ")", "and", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/generic.py#L5386-L5401
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/layers/nn.py
python
reduce_sum
(input, dim=None, keep_dim=False, name=None)
return out
Computes the sum of tensor elements over the given dimension. Args: input (Variable): The input variable which is a Tensor, the data type is float32, float64, int32, int64. dim (list|int, optional): The dimensions along which the sum is performed. If :attr:`None`, sum all el...
[]
def reduce_sum(input, dim=None, keep_dim=False, name=None): """ Computes the sum of tensor elements over the given dimension. Args: input (Variable): The input variable which is a Tensor, the data type is float32, float64, int32, int64. dim (list|int, optional): The dimensions ...
[ "def", "reduce_sum", "(", "input", ",", "dim", "=", "None", ",", "keep_dim", "=", "False", ",", "name", "=", "None", ")", ":", "if", "dim", "is", "not", "None", "and", "not", "isinstance", "(", "dim", ",", "list", ")", ":", "dim", "=", "[", "dim"...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/layers/nn.py#L4476-L4553
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py
python
Analysis.arcs_executed
(self)
return sorted(executed)
Returns a sorted list of the arcs actually executed in the code.
Returns a sorted list of the arcs actually executed in the code.
[ "Returns", "a", "sorted", "list", "of", "the", "arcs", "actually", "executed", "in", "the", "code", "." ]
def arcs_executed(self): """Returns a sorted list of the arcs actually executed in the code.""" executed = self.coverage.data.executed_arcs(self.filename) m2fl = self.parser.first_line executed = [(m2fl(l1), m2fl(l2)) for (l1,l2) in executed] return sorted(executed)
[ "def", "arcs_executed", "(", "self", ")", ":", "executed", "=", "self", ".", "coverage", ".", "data", ".", "executed_arcs", "(", "self", ".", "filename", ")", "m2fl", "=", "self", ".", "parser", ".", "first_line", "executed", "=", "[", "(", "m2fl", "("...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/results.py#L77-L82
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/tensor_array_ops.py
python
_EagerTensorArray.size
(self, name=None)
return constant_op.constant(len(self._tensor_array))
See TensorArray.
See TensorArray.
[ "See", "TensorArray", "." ]
def size(self, name=None): """See TensorArray.""" del name # not meaningful when executing eagerly. return constant_op.constant(len(self._tensor_array))
[ "def", "size", "(", "self", ",", "name", "=", "None", ")", ":", "del", "name", "# not meaningful when executing eagerly.", "return", "constant_op", ".", "constant", "(", "len", "(", "self", ".", "_tensor_array", ")", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/tensor_array_ops.py#L942-L945
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py
python
sparse_segment_mean_v2
(data, indices, segment_ids, num_segments=None, name=None)
return sparse_segment_mean( data, indices, segment_ids, name=name, num_segments=num_segments)
r"""Computes the mean along sparse segments of a tensor. Read [the section on segmentation](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/math#about_segmentation) for an explanation of segments. Like `tf.math.segment_mean`, but `segment_ids` can have rank less than `data`'s first dimension, se...
r"""Computes the mean along sparse segments of a tensor.
[ "r", "Computes", "the", "mean", "along", "sparse", "segments", "of", "a", "tensor", "." ]
def sparse_segment_mean_v2(data, indices, segment_ids, num_segments=None, name=None): r"""Computes the mean along sparse segments of a tensor. Read [the section on segmentation](https://www.tensorflow.org/...
[ "def", "sparse_segment_mean_v2", "(", "data", ",", "indices", ",", "segment_ids", ",", "num_segments", "=", "None", ",", "name", "=", "None", ")", ":", "return", "sparse_segment_mean", "(", "data", ",", "indices", ",", "segment_ids", ",", "name", "=", "name"...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/math_ops.py#L3801-L3835
strukturag/libheif
0082fea96ee70a20c8906a0373bedec0c01777bc
scripts/cpplint.py
python
_CppLintState.SetVerboseLevel
(self, level)
return last_verbose_level
Sets the module's verbosity, and returns the previous setting.
Sets the module's verbosity, and returns the previous setting.
[ "Sets", "the", "module", "s", "verbosity", "and", "returns", "the", "previous", "setting", "." ]
def SetVerboseLevel(self, level): """Sets the module's verbosity, and returns the previous setting.""" last_verbose_level = self.verbose_level self.verbose_level = level return last_verbose_level
[ "def", "SetVerboseLevel", "(", "self", ",", "level", ")", ":", "last_verbose_level", "=", "self", ".", "verbose_level", "self", ".", "verbose_level", "=", "level", "return", "last_verbose_level" ]
https://github.com/strukturag/libheif/blob/0082fea96ee70a20c8906a0373bedec0c01777bc/scripts/cpplint.py#L849-L853
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/fx/experimental/fx_acc/acc_normalizer.py
python
register_acc_op
(acc_op: Callable)
return acc_op
For a new acc op, add this as decorator to register it.
For a new acc op, add this as decorator to register it.
[ "For", "a", "new", "acc", "op", "add", "this", "as", "decorator", "to", "register", "it", "." ]
def register_acc_op(acc_op: Callable): """ For a new acc op, add this as decorator to register it. """ _acc_ops.add(acc_op) return acc_op
[ "def", "register_acc_op", "(", "acc_op", ":", "Callable", ")", ":", "_acc_ops", ".", "add", "(", "acc_op", ")", "return", "acc_op" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/fx/experimental/fx_acc/acc_normalizer.py#L155-L160
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/resolvelib/resolvers.py
python
Criterion.excluded_of
(self, candidates)
return type(self)(cands, list(self.information), incompats)
Build a new instance from this, but excluding specified candidates. Returns the new instance, or None if we still have no valid candidates.
Build a new instance from this, but excluding specified candidates.
[ "Build", "a", "new", "instance", "from", "this", "but", "excluding", "specified", "candidates", "." ]
def excluded_of(self, candidates): """Build a new instance from this, but excluding specified candidates. Returns the new instance, or None if we still have no valid candidates. """ cands = self.candidates.excluding(candidates) if not cands: return None incom...
[ "def", "excluded_of", "(", "self", ",", "candidates", ")", ":", "cands", "=", "self", ".", "candidates", ".", "excluding", "(", "candidates", ")", "if", "not", "cands", ":", "return", "None", "incompats", "=", "self", ".", "incompatibilities", "+", "candid...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/resolvelib/resolvers.py#L102-L111
geemaple/leetcode
68bc5032e1ee52c22ef2f2e608053484c487af54
leetcode/322.coin-change.py
python
Solution.coinChange
(self, coins, amount)
return table[amount] if table[amount] < float('inf') else -1
:type coins: List[int] :type amount: int :rtype: int
:type coins: List[int] :type amount: int :rtype: int
[ ":", "type", "coins", ":", "List", "[", "int", "]", ":", "type", "amount", ":", "int", ":", "rtype", ":", "int" ]
def coinChange(self, coins, amount): """ :type coins: List[int] :type amount: int :rtype: int """ table = [float('inf') for _ in range(amount + 1)] table[0] = 0 for i in range(1, amount + 1): for coin in coins: if i - coin >= ...
[ "def", "coinChange", "(", "self", ",", "coins", ",", "amount", ")", ":", "table", "=", "[", "float", "(", "'inf'", ")", "for", "_", "in", "range", "(", "amount", "+", "1", ")", "]", "table", "[", "0", "]", "=", "0", "for", "i", "in", "range", ...
https://github.com/geemaple/leetcode/blob/68bc5032e1ee52c22ef2f2e608053484c487af54/leetcode/322.coin-change.py#L38-L53
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/user_commissions_by_symbol.py
python
UserCommissionsBySymbol.to_str
(self)
return pprint.pformat(self.to_dict())
Returns the string representation of the model
Returns the string representation of the model
[ "Returns", "the", "string", "representation", "of", "the", "model" ]
def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict())
[ "def", "to_str", "(", "self", ")", ":", "return", "pprint", ".", "pformat", "(", "self", ".", "to_dict", "(", ")", ")" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/user_commissions_by_symbol.py#L70-L72
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/position.py
python
Position.pos_init
(self, pos_init)
Sets the pos_init of this Position. :param pos_init: The pos_init of this Position. # noqa: E501 :type: float
Sets the pos_init of this Position.
[ "Sets", "the", "pos_init", "of", "this", "Position", "." ]
def pos_init(self, pos_init): """Sets the pos_init of this Position. :param pos_init: The pos_init of this Position. # noqa: E501 :type: float """ self._pos_init = pos_init
[ "def", "pos_init", "(", "self", ",", "pos_init", ")", ":", "self", ".", "_pos_init", "=", "pos_init" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/position.py#L1606-L1614
mapsme/omim
1892903b63f2c85b16ed4966d21fe76aba06b9ba
3party/freetype/src/tools/docmaker/sources.py
python
SourceProcessor.dump
( self )
Print all blocks in a processor.
Print all blocks in a processor.
[ "Print", "all", "blocks", "in", "a", "processor", "." ]
def dump( self ): """Print all blocks in a processor.""" for b in self.blocks: b.dump()
[ "def", "dump", "(", "self", ")", ":", "for", "b", "in", "self", ".", "blocks", ":", "b", ".", "dump", "(", ")" ]
https://github.com/mapsme/omim/blob/1892903b63f2c85b16ed4966d21fe76aba06b9ba/3party/freetype/src/tools/docmaker/sources.py#L392-L395
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/lib/encoding.py
python
decode
(encoding=None, default_encoding='utf-8')
Replace or extend the list of charsets used to decode a request entity. Either argument may be a single string or a list of strings. encoding If not None, restricts the set of charsets attempted while decoding a request entity to the given set (even if a different charset is given in ...
Replace or extend the list of charsets used to decode a request entity. Either argument may be a single string or a list of strings. encoding If not None, restricts the set of charsets attempted while decoding a request entity to the given set (even if a different charset is given in ...
[ "Replace", "or", "extend", "the", "list", "of", "charsets", "used", "to", "decode", "a", "request", "entity", ".", "Either", "argument", "may", "be", "a", "single", "string", "or", "a", "list", "of", "strings", ".", "encoding", "If", "not", "None", "rest...
def decode(encoding=None, default_encoding='utf-8'): """Replace or extend the list of charsets used to decode a request entity. Either argument may be a single string or a list of strings. encoding If not None, restricts the set of charsets attempted while decoding a request entity...
[ "def", "decode", "(", "encoding", "=", "None", ",", "default_encoding", "=", "'utf-8'", ")", ":", "body", "=", "cherrypy", ".", "request", ".", "body", "if", "encoding", "is", "not", "None", ":", "if", "not", "isinstance", "(", "encoding", ",", "list", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/lib/encoding.py#L10-L34
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/core/platform/__init__.py
python
Platform.IsRawDisplayFrameRateSupported
(self)
return self._platform_backend.IsRawDisplayFrameRateSupported()
Platforms may be able to collect GL surface stats.
Platforms may be able to collect GL surface stats.
[ "Platforms", "may", "be", "able", "to", "collect", "GL", "surface", "stats", "." ]
def IsRawDisplayFrameRateSupported(self): """Platforms may be able to collect GL surface stats.""" return self._platform_backend.IsRawDisplayFrameRateSupported()
[ "def", "IsRawDisplayFrameRateSupported", "(", "self", ")", ":", "return", "self", ".", "_platform_backend", ".", "IsRawDisplayFrameRateSupported", "(", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/core/platform/__init__.py#L15-L17
dmlc/decord
96b750c7221322391969929e855b942d2fdcd06b
python/decord/_ffi/base.py
python
c_array
(ctype, values)
return (ctype * len(values))(*values)
Create ctypes array from a python array Parameters ---------- ctype : ctypes data type data type of the array we want to convert to values : tuple or list data content Returns ------- out : ctypes array Created ctypes array
Create ctypes array from a python array
[ "Create", "ctypes", "array", "from", "a", "python", "array" ]
def c_array(ctype, values): """Create ctypes array from a python array Parameters ---------- ctype : ctypes data type data type of the array we want to convert to values : tuple or list data content Returns ------- out : ctypes array Created ctypes array ""...
[ "def", "c_array", "(", "ctype", ",", "values", ")", ":", "return", "(", "ctype", "*", "len", "(", "values", ")", ")", "(", "*", "values", ")" ]
https://github.com/dmlc/decord/blob/96b750c7221322391969929e855b942d2fdcd06b/python/decord/_ffi/base.py#L96-L112
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/ops.py
python
_run_using_default_session
(operation, feed_dict, graph, session=None)
Uses the default session to run "operation". Args: operation: The Operation to be run. feed_dict: A dictionary that maps Tensor objects (or tensor names) to lists, numpy ndarrays, TensorProtos, or strings. graph: The graph in which "operation" is defined. session: (Optional) A different session...
Uses the default session to run "operation".
[ "Uses", "the", "default", "session", "to", "run", "operation", "." ]
def _run_using_default_session(operation, feed_dict, graph, session=None): """Uses the default session to run "operation". Args: operation: The Operation to be run. feed_dict: A dictionary that maps Tensor objects (or tensor names) to lists, numpy ndarrays, TensorProtos, or strings. graph: The gr...
[ "def", "_run_using_default_session", "(", "operation", ",", "feed_dict", ",", "graph", ",", "session", "=", "None", ")", ":", "if", "session", "is", "None", ":", "session", "=", "get_default_session", "(", ")", "if", "session", "is", "None", ":", "raise", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L3659-L3691
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
util/minorview/blobs.py
python
box
(cr, centre, size)
Draw a simple box
Draw a simple box
[ "Draw", "a", "simple", "box" ]
def box(cr, centre, size): """Draw a simple box""" (left, right, top, bottom) = centre_size_to_sides(centre, size) cr.move_to(left, top) cr.line_to(right, top) cr.line_to(right, bottom) cr.line_to(left, bottom) cr.close_path()
[ "def", "box", "(", "cr", ",", "centre", ",", "size", ")", ":", "(", "left", ",", "right", ",", "top", ",", "bottom", ")", "=", "centre_size_to_sides", "(", "centre", ",", "size", ")", "cr", ".", "move_to", "(", "left", ",", "top", ")", "cr", ".",...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/util/minorview/blobs.py#L66-L73
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/html.py
python
HtmlWinParser.CloseContainer
(*args, **kwargs)
return _html.HtmlWinParser_CloseContainer(*args, **kwargs)
CloseContainer(self) -> HtmlContainerCell
CloseContainer(self) -> HtmlContainerCell
[ "CloseContainer", "(", "self", ")", "-", ">", "HtmlContainerCell" ]
def CloseContainer(*args, **kwargs): """CloseContainer(self) -> HtmlContainerCell""" return _html.HtmlWinParser_CloseContainer(*args, **kwargs)
[ "def", "CloseContainer", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_html", ".", "HtmlWinParser_CloseContainer", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/html.py#L284-L286
ApolloAuto/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
cyber/python/cyber_py3/parameter.py
python
ParameterServer.get_paramslist
(self)
return param_list
get all params of this parameterserver.
get all params of this parameterserver.
[ "get", "all", "params", "of", "this", "parameterserver", "." ]
def get_paramslist(self): """ get all params of this parameterserver. """ pycapsulelist = _CYBER_PARAM.PyParameter_srv_get_parameter_list( self.param_srv) param_list = [] for capsuleobj in pycapsulelist: param_list.append(Parameter(capsuleobj)) ...
[ "def", "get_paramslist", "(", "self", ")", ":", "pycapsulelist", "=", "_CYBER_PARAM", ".", "PyParameter_srv_get_parameter_list", "(", "self", ".", "param_srv", ")", "param_list", "=", "[", "]", "for", "capsuleobj", "in", "pycapsulelist", ":", "param_list", ".", ...
https://github.com/ApolloAuto/apollo/blob/463fb82f9e979d02dcb25044e60931293ab2dba0/cyber/python/cyber_py3/parameter.py#L172-L181
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/learn/python/learn/monitors.py
python
StopAtStep.__init__
(self, num_steps=None, last_step=None)
Create a StopAtStep monitor. This monitor requests stop after either a number of steps have been executed or a last step has been reached. Only of the two options can be specified. if `num_steps` is specified, it indicates the number of steps to execute after `begin()` is called. If instead `las...
Create a StopAtStep monitor.
[ "Create", "a", "StopAtStep", "monitor", "." ]
def __init__(self, num_steps=None, last_step=None): """Create a StopAtStep monitor. This monitor requests stop after either a number of steps have been executed or a last step has been reached. Only of the two options can be specified. if `num_steps` is specified, it indicates the number of steps...
[ "def", "__init__", "(", "self", ",", "num_steps", "=", "None", ",", "last_step", "=", "None", ")", ":", "super", "(", "StopAtStep", ",", "self", ")", ".", "__init__", "(", ")", "if", "num_steps", "is", "None", "and", "last_step", "is", "None", ":", "...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/monitors.py#L375-L400
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/coremltools_wrap/coremltools/coremltools/converters/onnx/_operators_nd.py
python
_convert_atan
(builder, node, graph, err)
convert to CoreML Atan Layer: https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L3815
convert to CoreML Atan Layer: https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L3815
[ "convert", "to", "CoreML", "Atan", "Layer", ":", "https", ":", "//", "github", ".", "com", "/", "apple", "/", "coremltools", "/", "blob", "/", "655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492", "/", "mlmodel", "/", "format", "/", "NeuralNetwork", ".", "proto#L3815" ]
def _convert_atan(builder, node, graph, err): """ convert to CoreML Atan Layer: https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L3815 """ load_input_constants(builder, node, graph, err) builder.add_atan( name=node.name...
[ "def", "_convert_atan", "(", "builder", ",", "node", ",", "graph", ",", "err", ")", ":", "load_input_constants", "(", "builder", ",", "node", ",", "graph", ",", "err", ")", "builder", ".", "add_atan", "(", "name", "=", "node", ".", "name", ",", "input_...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/coremltools_wrap/coremltools/coremltools/converters/onnx/_operators_nd.py#L329-L337
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/xrc.py
python
XmlNode.GetNext
(*args, **kwargs)
return _xrc.XmlNode_GetNext(*args, **kwargs)
GetNext(self) -> XmlNode
GetNext(self) -> XmlNode
[ "GetNext", "(", "self", ")", "-", ">", "XmlNode" ]
def GetNext(*args, **kwargs): """GetNext(self) -> XmlNode""" return _xrc.XmlNode_GetNext(*args, **kwargs)
[ "def", "GetNext", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_xrc", ".", "XmlNode_GetNext", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/xrc.py#L414-L416
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/pot/openvino/tools/pot/graph/nx_model.py
python
CompressedModel.number_of_nodes
(self)
return sum([model_dict['model'].number_of_nodes() for model_dict in self._models])
Returns total number of nodes of all models
Returns total number of nodes of all models
[ "Returns", "total", "number", "of", "nodes", "of", "all", "models" ]
def number_of_nodes(self): """Returns total number of nodes of all models""" return sum([model_dict['model'].number_of_nodes() for model_dict in self._models])
[ "def", "number_of_nodes", "(", "self", ")", ":", "return", "sum", "(", "[", "model_dict", "[", "'model'", "]", ".", "number_of_nodes", "(", ")", "for", "model_dict", "in", "self", ".", "_models", "]", ")" ]
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/pot/openvino/tools/pot/graph/nx_model.py#L159-L162
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/req/req_set.py
python
RequirementSet._prepare_file
(self, finder, req_to_install)
return more_reqs
Prepare a single requirements files. :return: A list of addition InstallRequirements to also install.
Prepare a single requirements files.
[ "Prepare", "a", "single", "requirements", "files", "." ]
def _prepare_file(self, finder, req_to_install): """Prepare a single requirements files. :return: A list of addition InstallRequirements to also install. """ # Tell user what we are doing for this requirement: # obtain (editable), skipping, processing (local url), collecting ...
[ "def", "_prepare_file", "(", "self", ",", "finder", ",", "req_to_install", ")", ":", "# Tell user what we are doing for this requirement:", "# obtain (editable), skipping, processing (local url), collecting", "# (remote url or package name)", "if", "req_to_install", ".", "editable", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/req/req_set.py#L371-L562
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/ftplib.py
python
FTP.rename
(self, fromname, toname)
return self.voidcmd('RNTO ' + toname)
Rename a file.
Rename a file.
[ "Rename", "a", "file", "." ]
def rename(self, fromname, toname): '''Rename a file.''' resp = self.sendcmd('RNFR ' + fromname) if resp[0] != '3': raise error_reply(resp) return self.voidcmd('RNTO ' + toname)
[ "def", "rename", "(", "self", ",", "fromname", ",", "toname", ")", ":", "resp", "=", "self", ".", "sendcmd", "(", "'RNFR '", "+", "fromname", ")", "if", "resp", "[", "0", "]", "!=", "'3'", ":", "raise", "error_reply", "(", "resp", ")", "return", "s...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ftplib.py#L605-L610
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py
python
BahdanauAttention.__call__
(self, query, previous_alignments)
return alignments
Score the query based on the keys and values. Args: query: Tensor of dtype matching `self.values` and shape `[batch_size, query_depth]`. previous_alignments: Tensor of dtype matching `self.values` and shape `[batch_size, alignments_size]` (`alignments_size` is memory's `max_time...
Score the query based on the keys and values.
[ "Score", "the", "query", "based", "on", "the", "keys", "and", "values", "." ]
def __call__(self, query, previous_alignments): """Score the query based on the keys and values. Args: query: Tensor of dtype matching `self.values` and shape `[batch_size, query_depth]`. previous_alignments: Tensor of dtype matching `self.values` and shape `[batch_size, alignments_...
[ "def", "__call__", "(", "self", ",", "query", ",", "previous_alignments", ")", ":", "with", "variable_scope", ".", "variable_scope", "(", "None", ",", "\"bahdanau_attention\"", ",", "[", "query", "]", ")", ":", "processed_query", "=", "self", ".", "query_layer...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py#L516-L535
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/masked_softmax.py
python
np_masked_softmax
(logits, legal_actions_mask)
return exp_logit / np.sum(exp_logit, axis=-1, keepdims=True)
Returns the softmax over the valid actions defined by `legal_actions_mask`. Args: logits: A tensor [..., num_actions] (e.g. [num_actions] or [B, num_actions]) representing the logits to mask. legal_actions_mask: The legal action mask, same shape as logits. 1 means it's a legal action, 0 means it'...
Returns the softmax over the valid actions defined by `legal_actions_mask`.
[ "Returns", "the", "softmax", "over", "the", "valid", "actions", "defined", "by", "legal_actions_mask", "." ]
def np_masked_softmax(logits, legal_actions_mask): """Returns the softmax over the valid actions defined by `legal_actions_mask`. Args: logits: A tensor [..., num_actions] (e.g. [num_actions] or [B, num_actions]) representing the logits to mask. legal_actions_mask: The legal action mask, same shape a...
[ "def", "np_masked_softmax", "(", "logits", ",", "legal_actions_mask", ")", ":", "masked_logits", "=", "logits", "+", "np", ".", "log", "(", "legal_actions_mask", ")", "max_logit", "=", "np", ".", "amax", "(", "masked_logits", ",", "axis", "=", "-", "1", ",...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/masked_softmax.py#L51-L63
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
PlatformInformation.CheckToolkitVersion
(*args, **kwargs)
return _misc_.PlatformInformation_CheckToolkitVersion(*args, **kwargs)
CheckToolkitVersion(self, int major, int minor) -> bool
CheckToolkitVersion(self, int major, int minor) -> bool
[ "CheckToolkitVersion", "(", "self", "int", "major", "int", "minor", ")", "-", ">", "bool" ]
def CheckToolkitVersion(*args, **kwargs): """CheckToolkitVersion(self, int major, int minor) -> bool""" return _misc_.PlatformInformation_CheckToolkitVersion(*args, **kwargs)
[ "def", "CheckToolkitVersion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "PlatformInformation_CheckToolkitVersion", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1081-L1083
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py2/prompt_toolkit/document.py
python
Document.find_previous_word_beginning
(self, count=1, WORD=False)
Return an index relative to the cursor position pointing to the start of the previous word. Return `None` if nothing was found.
Return an index relative to the cursor position pointing to the start of the previous word. Return `None` if nothing was found.
[ "Return", "an", "index", "relative", "to", "the", "cursor", "position", "pointing", "to", "the", "start", "of", "the", "previous", "word", ".", "Return", "None", "if", "nothing", "was", "found", "." ]
def find_previous_word_beginning(self, count=1, WORD=False): """ Return an index relative to the cursor position pointing to the start of the previous word. Return `None` if nothing was found. """ if count < 0: return self.find_next_word_beginning(count=-count, WORD=W...
[ "def", "find_previous_word_beginning", "(", "self", ",", "count", "=", "1", ",", "WORD", "=", "False", ")", ":", "if", "count", "<", "0", ":", "return", "self", ".", "find_next_word_beginning", "(", "count", "=", "-", "count", ",", "WORD", "=", "WORD", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py2/prompt_toolkit/document.py#L529-L545
Alexhuszagh/rust-lexical
01fcdcf8efc8850edb35d8fc65fd5f31bd0981a0
lexical-benchmark/etc/plot.py
python
parse_args
(argv=None)
return parser.parse_args(argv)
Create and parse our command line arguments.
Create and parse our command line arguments.
[ "Create", "and", "parse", "our", "command", "line", "arguments", "." ]
def parse_args(argv=None): '''Create and parse our command line arguments.''' parser = argparse.ArgumentParser(description='Plot a benchmark.') parser.add_argument( '--benches', help='''name of benchmarks to run''', default='parse-float,parse-integer,write-float,write-integer', ...
[ "def", "parse_args", "(", "argv", "=", "None", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Plot a benchmark.'", ")", "parser", ".", "add_argument", "(", "'--benches'", ",", "help", "=", "'''name of benchmarks to run'''", ...
https://github.com/Alexhuszagh/rust-lexical/blob/01fcdcf8efc8850edb35d8fc65fd5f31bd0981a0/lexical-benchmark/etc/plot.py#L24-L43
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pydoc.py
python
classify_class_attrs
(object)
return map(fixup, inspect.classify_class_attrs(object))
Wrap inspect.classify_class_attrs, with fixup for data descriptors.
Wrap inspect.classify_class_attrs, with fixup for data descriptors.
[ "Wrap", "inspect", ".", "classify_class_attrs", "with", "fixup", "for", "data", "descriptors", "." ]
def classify_class_attrs(object): """Wrap inspect.classify_class_attrs, with fixup for data descriptors.""" def fixup(data): name, kind, cls, value = data if inspect.isdatadescriptor(value): kind = 'data descriptor' return name, kind, cls, value return map(fixup, inspect....
[ "def", "classify_class_attrs", "(", "object", ")", ":", "def", "fixup", "(", "data", ")", ":", "name", ",", "kind", ",", "cls", ",", "value", "=", "data", "if", "inspect", ".", "isdatadescriptor", "(", "value", ")", ":", "kind", "=", "'data descriptor'",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/pydoc.py#L176-L183
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
MemoryDC.SelectObjectAsSource
(*args, **kwargs)
return _gdi_.MemoryDC_SelectObjectAsSource(*args, **kwargs)
SelectObjectAsSource(self, Bitmap bmp)
SelectObjectAsSource(self, Bitmap bmp)
[ "SelectObjectAsSource", "(", "self", "Bitmap", "bmp", ")" ]
def SelectObjectAsSource(*args, **kwargs): """SelectObjectAsSource(self, Bitmap bmp)""" return _gdi_.MemoryDC_SelectObjectAsSource(*args, **kwargs)
[ "def", "SelectObjectAsSource", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "MemoryDC_SelectObjectAsSource", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L5173-L5175
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
clang/utils/check_cfc/obj_diff.py
python
compare_object_files
(objfilea, objfileb)
return first_diff(disa, disb, objfilea, objfileb)
Compare disassembly of two different files. Allowing unavoidable differences, such as filenames. Return the first difference if the disassembly differs, or None.
Compare disassembly of two different files. Allowing unavoidable differences, such as filenames. Return the first difference if the disassembly differs, or None.
[ "Compare", "disassembly", "of", "two", "different", "files", ".", "Allowing", "unavoidable", "differences", "such", "as", "filenames", ".", "Return", "the", "first", "difference", "if", "the", "disassembly", "differs", "or", "None", "." ]
def compare_object_files(objfilea, objfileb): """Compare disassembly of two different files. Allowing unavoidable differences, such as filenames. Return the first difference if the disassembly differs, or None. """ disa = disassemble(objfilea) disb = disassemble(objfileb) return first_...
[ "def", "compare_object_files", "(", "objfilea", ",", "objfileb", ")", ":", "disa", "=", "disassemble", "(", "objfilea", ")", "disb", "=", "disassemble", "(", "objfileb", ")", "return", "first_diff", "(", "disa", ",", "disb", ",", "objfilea", ",", "objfileb",...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/clang/utils/check_cfc/obj_diff.py#L67-L74
CoolProp/CoolProp
381c8535e5dec3eec27ad430ebbfff8bc9dfc008
dev/scripts/ideal_curves.py
python
CurveTracer.__init__
(self, backend, fluid, p0, T0)
p0 : Initial pressure [Pa] T0 : Initial temperatrure [K]
p0 : Initial pressure [Pa] T0 : Initial temperatrure [K]
[ "p0", ":", "Initial", "pressure", "[", "Pa", "]", "T0", ":", "Initial", "temperatrure", "[", "K", "]" ]
def __init__(self, backend, fluid, p0, T0): """ p0 : Initial pressure [Pa] T0 : Initial temperatrure [K] """ self.P = [p0] self.T = [] self.AS = CoolProp.AbstractState(backend, fluid) # Solve for Temperature for first point T = scipy.optimize.newt...
[ "def", "__init__", "(", "self", ",", "backend", ",", "fluid", ",", "p0", ",", "T0", ")", ":", "self", ".", "P", "=", "[", "p0", "]", "self", ".", "T", "=", "[", "]", "self", ".", "AS", "=", "CoolProp", ".", "AbstractState", "(", "backend", ",",...
https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/dev/scripts/ideal_curves.py#L8-L20
SFTtech/openage
d6a08c53c48dc1e157807471df92197f6ca9e04d
openage/nyan/nyan_structs.py
python
InheritedNyanMember.__init__
(self, name, member_type, parent, origin, value=None, operator=None, override_depth=0)
Initializes the member and does some correctness checks, for your convenience.
Initializes the member and does some correctness checks, for your convenience.
[ "Initializes", "the", "member", "and", "does", "some", "correctness", "checks", "for", "your", "convenience", "." ]
def __init__(self, name, member_type, parent, origin, value=None, operator=None, override_depth=0): """ Initializes the member and does some correctness checks, for your convenience. """ self._parent = parent # the direct parent of the object which contains the...
[ "def", "__init__", "(", "self", ",", "name", ",", "member_type", ",", "parent", ",", "origin", ",", "value", "=", "None", ",", "operator", "=", "None", ",", "override_depth", "=", "0", ")", ":", "self", ".", "_parent", "=", "parent", "# the direct parent...
https://github.com/SFTtech/openage/blob/d6a08c53c48dc1e157807471df92197f6ca9e04d/openage/nyan/nyan_structs.py#L1310-L1319
stitchEm/stitchEm
0f399501d41ab77933677f2907f41f80ceb704d7
lib/bindings/samples/server/server.py
python
Server.sighup
(self, signum=None, frame=None)
Restarts libvideostitch log
Restarts libvideostitch log
[ "Restarts", "libvideostitch", "log" ]
def sighup(self, signum=None, frame=None): """ Restarts libvideostitch log """ logging.info("SIGHUP received, restarting libvideostitch log") loglevel = SETTINGS.loglevel utils.log.set_vs_log(loglevel, True)
[ "def", "sighup", "(", "self", ",", "signum", "=", "None", ",", "frame", "=", "None", ")", ":", "logging", ".", "info", "(", "\"SIGHUP received, restarting libvideostitch log\"", ")", "loglevel", "=", "SETTINGS", ".", "loglevel", "utils", ".", "log", ".", "se...
https://github.com/stitchEm/stitchEm/blob/0f399501d41ab77933677f2907f41f80ceb704d7/lib/bindings/samples/server/server.py#L288-L293
MichalBusta/E2E-MLT
2f0b54e31ebb414cd2daad824d7d474062ebe834
eval.py
python
process_splits
(trans, word_splits, conf, splits, start, ctc_f, rot_mat, angle, box_points, w, h, draw, is_dict, debug=False)
return boxes_out
Summary : Split the transciption and corresponding bounding-box based on spaces predicted by recognizer FCN. Description : Parameters ---------- trans : string String containing the predicted transcription for the corresponding predicted bounding-box. conf : list List containing sum of confidence for all t...
Summary : Split the transciption and corresponding bounding-box based on spaces predicted by recognizer FCN. Description :
[ "Summary", ":", "Split", "the", "transciption", "and", "corresponding", "bounding", "-", "box", "based", "on", "spaces", "predicted", "by", "recognizer", "FCN", ".", "Description", ":" ]
def process_splits(trans, word_splits, conf, splits, start, ctc_f, rot_mat, angle, box_points, w, h, draw, is_dict, debug=False): ''' Summary : Split the transciption and corresponding bounding-box based on spaces predicted by recognizer FCN. Description : Parameters ---------- trans : string String containi...
[ "def", "process_splits", "(", "trans", ",", "word_splits", ",", "conf", ",", "splits", ",", "start", ",", "ctc_f", ",", "rot_mat", ",", "angle", ",", "box_points", ",", "w", ",", "h", ",", "draw", ",", "is_dict", ",", "debug", "=", "False", ")", ":",...
https://github.com/MichalBusta/E2E-MLT/blob/2f0b54e31ebb414cd2daad824d7d474062ebe834/eval.py#L303-L370
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/third_party/pyserial/serial/serialjava.py
python
JavaSerial.getRI
(self)
Read terminal status line: Ring Indicator
Read terminal status line: Ring Indicator
[ "Read", "terminal", "status", "line", ":", "Ring", "Indicator" ]
def getRI(self): """Read terminal status line: Ring Indicator""" if not self.sPort: raise portNotOpenError self.sPort.isRI()
[ "def", "getRI", "(", "self", ")", ":", "if", "not", "self", ".", "sPort", ":", "raise", "portNotOpenError", "self", ".", "sPort", ".", "isRI", "(", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/pyserial/serial/serialjava.py#L217-L220
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/pygauge.py
python
PyGauge.DoGetBestSize
(self)
return wx.Size(self._size[0], self._size[1])
Gets the size which best suits :class:`PyGauge`: for a control, it would be the minimal size which doesn't truncate the control, for a panel - the same size as it would have after a call to `Fit()`. :note: Overridden from :class:`PyWindow`.
Gets the size which best suits :class:`PyGauge`: for a control, it would be the minimal size which doesn't truncate the control, for a panel - the same size as it would have after a call to `Fit()`.
[ "Gets", "the", "size", "which", "best", "suits", ":", "class", ":", "PyGauge", ":", "for", "a", "control", "it", "would", "be", "the", "minimal", "size", "which", "doesn", "t", "truncate", "the", "control", "for", "a", "panel", "-", "the", "same", "siz...
def DoGetBestSize(self): """ Gets the size which best suits :class:`PyGauge`: for a control, it would be the minimal size which doesn't truncate the control, for a panel - the same size as it would have after a call to `Fit()`. :note: Overridden from :class:`PyWindow`. ...
[ "def", "DoGetBestSize", "(", "self", ")", ":", "return", "wx", ".", "Size", "(", "self", ".", "_size", "[", "0", "]", ",", "self", ".", "_size", "[", "1", "]", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/pygauge.py#L163-L172
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/buffer.py
python
Buffer.get_search_position
( self, search_state: SearchState, include_current_position: bool = True, count: int = 1, )
Get the cursor position for this search. (This operation won't change the `working_index`. It's won't go through the history. Vi text objects can't span multiple items.)
Get the cursor position for this search. (This operation won't change the `working_index`. It's won't go through the history. Vi text objects can't span multiple items.)
[ "Get", "the", "cursor", "position", "for", "this", "search", ".", "(", "This", "operation", "won", "t", "change", "the", "working_index", ".", "It", "s", "won", "t", "go", "through", "the", "history", ".", "Vi", "text", "objects", "can", "t", "span", "...
def get_search_position( self, search_state: SearchState, include_current_position: bool = True, count: int = 1, ) -> int: """ Get the cursor position for this search. (This operation won't change the `working_index`. It's won't go through the history....
[ "def", "get_search_position", "(", "self", ",", "search_state", ":", "SearchState", ",", "include_current_position", ":", "bool", "=", "True", ",", "count", ":", "int", "=", "1", ",", ")", "->", "int", ":", "search_result", "=", "self", ".", "_search", "("...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/buffer.py#L1500-L1519
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/inspect.py
python
isclass
(object)
return isinstance(object, (type, types.ClassType))
Return true if the object is a class. Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined
Return true if the object is a class.
[ "Return", "true", "if", "the", "object", "is", "a", "class", "." ]
def isclass(object): """Return true if the object is a class. Class objects provide these attributes: __doc__ documentation string __module__ name of module in which this class was defined""" return isinstance(object, (type, types.ClassType))
[ "def", "isclass", "(", "object", ")", ":", "return", "isinstance", "(", "object", ",", "(", "type", ",", "types", ".", "ClassType", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/inspect.py#L59-L65
musescore/MuseScore
a817fea23e3c2be30847b7fde5b01746222c252e
tools/crashdump/posix/generate_breakpad_symbols.py
python
GetBinaryInfoFromHeaderInfo
(header_info)
return BINARY_INFO(*info_split[1:])
Given a standard symbol header information line, returns BINARY_INFO.
Given a standard symbol header information line, returns BINARY_INFO.
[ "Given", "a", "standard", "symbol", "header", "information", "line", "returns", "BINARY_INFO", "." ]
def GetBinaryInfoFromHeaderInfo(header_info): """Given a standard symbol header information line, returns BINARY_INFO.""" # header info is of the form "MODULE $PLATFORM $ARCH $HASH $BINARY" info_split = header_info.strip().split(' ', 4) if len(info_split) != 5 or info_split[0] != 'MODULE': return None ret...
[ "def", "GetBinaryInfoFromHeaderInfo", "(", "header_info", ")", ":", "# header info is of the form \"MODULE $PLATFORM $ARCH $HASH $BINARY\"", "info_split", "=", "header_info", ".", "strip", "(", ")", ".", "split", "(", "' '", ",", "4", ")", "if", "len", "(", "info_spli...
https://github.com/musescore/MuseScore/blob/a817fea23e3c2be30847b7fde5b01746222c252e/tools/crashdump/posix/generate_breakpad_symbols.py#L275-L281
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/common.py
python
ExceptionAppend
(e, msg)
Append a message to the given exception's message.
Append a message to the given exception's message.
[ "Append", "a", "message", "to", "the", "given", "exception", "s", "message", "." ]
def ExceptionAppend(e, msg): """Append a message to the given exception's message.""" if not e.args: e.args = (msg,) elif len(e.args) == 1: e.args = (str(e.args[0]) + " " + msg,) else: e.args = (str(e.args[0]) + " " + msg,) + e.args[1:]
[ "def", "ExceptionAppend", "(", "e", ",", "msg", ")", ":", "if", "not", "e", ".", "args", ":", "e", ".", "args", "=", "(", "msg", ",", ")", "elif", "len", "(", "e", ".", "args", ")", "==", "1", ":", "e", ".", "args", "=", "(", "str", "(", ...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/common.py#L40-L47
ComputationalRadiationPhysics/picongpu
59e9b53605f9a5c1bf271eeb055bc74370a99052
lib/python/picongpu/plugins/jupyter_widgets/base_widget.py
python
BaseWidget._make_drop_val_compatible
(self, val)
return val
Depending on the type of self.sim_drop we have to assign a single value or a tuple to the self.sim_drop.value. This function converts the 'val' in a way to be compatible with the expected type.
Depending on the type of self.sim_drop we have to assign a single value or a tuple to the self.sim_drop.value. This function converts the 'val' in a way to be compatible with the expected type.
[ "Depending", "on", "the", "type", "of", "self", ".", "sim_drop", "we", "have", "to", "assign", "a", "single", "value", "or", "a", "tuple", "to", "the", "self", ".", "sim_drop", ".", "value", ".", "This", "function", "converts", "the", "val", "in", "a",...
def _make_drop_val_compatible(self, val): """ Depending on the type of self.sim_drop we have to assign a single value or a tuple to the self.sim_drop.value. This function converts the 'val' in a way to be compatible with the expected type. """ # handle conversion ...
[ "def", "_make_drop_val_compatible", "(", "self", ",", "val", ")", ":", "# handle conversion from SelectMultiple which expects", "# tuples to ordinary dropdown which accepts a single value", "if", "isinstance", "(", "self", ".", "sim_drop", ",", "widgets", ".", "Dropdown", ")"...
https://github.com/ComputationalRadiationPhysics/picongpu/blob/59e9b53605f9a5c1bf271eeb055bc74370a99052/lib/python/picongpu/plugins/jupyter_widgets/base_widget.py#L427-L445
rdiankov/openrave
d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7
python/examples/qtexampleselector.py
python
Server.__init__
(self)
Setup the shared memory data structure model and initialize the control parts.
Setup the shared memory data structure model and initialize the control parts.
[ "Setup", "the", "shared", "memory", "data", "structure", "model", "and", "initialize", "the", "control", "parts", "." ]
def __init__(self): ''' Setup the shared memory data structure model and initialize the control parts. ''' self.openRaveServers = [] self.running = True self.orgui = None self.qtgui = None (self.pipeQtControl, self.pipeORControl) = Pipe() (self.pip...
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "openRaveServers", "=", "[", "]", "self", ".", "running", "=", "True", "self", ".", "orgui", "=", "None", "self", ".", "qtgui", "=", "None", "(", "self", ".", "pipeQtControl", ",", "self", ".", ...
https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/examples/qtexampleselector.py#L133-L144