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
nsnam/ns-3-dev-git
efdb2e21f45c0a87a60b47c547b68fa140a7b686
utils/grid.py
python
Colors.__init__
(self)
! Initializer @param self this object
! Initializer
[ "!", "Initializer" ]
def __init__(self): """! Initializer @param self this object """ self.__colors = {}
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "__colors", "=", "{", "}" ]
https://github.com/nsnam/ns-3-dev-git/blob/efdb2e21f45c0a87a60b47c547b68fa140a7b686/utils/grid.py#L467-L471
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
media/tools/constrained_network_server/cns.py
python
ConstrainedNetworkServer.Cleanup
(self)
Cleans up all the ports allocated using the request IP address. When requesting a constrained port, the cherrypy.request.remote.ip is used as a key for that port (in addition to other request parameters). Such ports created for the same IP address are removed.
Cleans up all the ports allocated using the request IP address.
[ "Cleans", "up", "all", "the", "ports", "allocated", "using", "the", "request", "IP", "address", "." ]
def Cleanup(self): """Cleans up all the ports allocated using the request IP address. When requesting a constrained port, the cherrypy.request.remote.ip is used as a key for that port (in addition to other request parameters). Such ports created for the same IP address are removed. """ cherryp...
[ "def", "Cleanup", "(", "self", ")", ":", "cherrypy", ".", "log", "(", "'Cleaning up ports allocated by %s.'", "%", "cherrypy", ".", "request", ".", "remote", ".", "ip", ")", "self", ".", "_port_allocator", ".", "Cleanup", "(", "all_ports", "=", "False", ",",...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/media/tools/constrained_network_server/cns.py#L182-L192
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/constants/constants.py
python
nu2lambda
(nu)
return c / _np.asanyarray(nu)
Convert optical frequency to wavelength. Parameters ---------- nu : array_like Optical frequency to be converted. Returns ------- lambda : float or array of floats Equivalent wavelength(s). Notes ----- Computes ``lambda = c / nu`` where c = 299792458.0, i.e., the ...
Convert optical frequency to wavelength.
[ "Convert", "optical", "frequency", "to", "wavelength", "." ]
def nu2lambda(nu): """ Convert optical frequency to wavelength. Parameters ---------- nu : array_like Optical frequency to be converted. Returns ------- lambda : float or array of floats Equivalent wavelength(s). Notes ----- Computes ``lambda = c / nu`` whe...
[ "def", "nu2lambda", "(", "nu", ")", ":", "return", "c", "/", "_np", ".", "asanyarray", "(", "nu", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/constants/constants.py#L281-L307
lballabio/quantlib-old
136336947ed4fea9ecc1da6edad188700e821739
gensrc/gensrc/utilities/buffer.py
python
Buffer.text
(self)
return self.buffer_
Return the text of this buffer.
Return the text of this buffer.
[ "Return", "the", "text", "of", "this", "buffer", "." ]
def text(self): """Return the text of this buffer.""" return self.buffer_
[ "def", "text", "(", "self", ")", ":", "return", "self", ".", "buffer_" ]
https://github.com/lballabio/quantlib-old/blob/136336947ed4fea9ecc1da6edad188700e821739/gensrc/gensrc/utilities/buffer.py#L55-L57
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/easy_install.py
python
CommandSpec.from_param
(cls, param)
return cls.from_string(param)
Construct a CommandSpec from a parameter to build_scripts, which may be None.
Construct a CommandSpec from a parameter to build_scripts, which may be None.
[ "Construct", "a", "CommandSpec", "from", "a", "parameter", "to", "build_scripts", "which", "may", "be", "None", "." ]
def from_param(cls, param): """ Construct a CommandSpec from a parameter to build_scripts, which may be None. """ if isinstance(param, cls): return param if isinstance(param, list): return cls(param) if param is None: return cls...
[ "def", "from_param", "(", "cls", ",", "param", ")", ":", "if", "isinstance", "(", "param", ",", "cls", ")", ":", "return", "param", "if", "isinstance", "(", "param", ",", "list", ")", ":", "return", "cls", "(", "param", ")", "if", "param", "is", "N...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/setuptools/command/easy_install.py#L1983-L1995
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/function.py
python
ConcreteFunction._structured_signature_check_missing_args
(self, args, kwargs)
Raises a TypeError if any args are missing.
Raises a TypeError if any args are missing.
[ "Raises", "a", "TypeError", "if", "any", "args", "are", "missing", "." ]
def _structured_signature_check_missing_args(self, args, kwargs): """Raises a TypeError if any args are missing.""" arg_specs, kwarg_specs = self.structured_input_signature missing_arguments = [] for i, (arg, spec) in enumerate(zip(args, arg_specs)): if arg is _BOUND_VALUE and _contains_type_spec(...
[ "def", "_structured_signature_check_missing_args", "(", "self", ",", "args", ",", "kwargs", ")", ":", "arg_specs", ",", "kwarg_specs", "=", "self", ".", "structured_input_signature", "missing_arguments", "=", "[", "]", "for", "i", ",", "(", "arg", ",", "spec", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/function.py#L1698-L1711
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/model/create/pile.py
python
xy_randomize
(obj,bmin,bmax)
Randomizes the xy position and z orientation of an object inside of a bounding box bmin->bmax. Assumes the bounding box is large enough to hold the object in any orientation.
Randomizes the xy position and z orientation of an object inside of a bounding box bmin->bmax. Assumes the bounding box is large enough to hold the object in any orientation.
[ "Randomizes", "the", "xy", "position", "and", "z", "orientation", "of", "an", "object", "inside", "of", "a", "bounding", "box", "bmin", "-", ">", "bmax", ".", "Assumes", "the", "bounding", "box", "is", "large", "enough", "to", "hold", "the", "object", "i...
def xy_randomize(obj,bmin,bmax): """Randomizes the xy position and z orientation of an object inside of a bounding box bmin->bmax. Assumes the bounding box is large enough to hold the object in any orientation. """ R,t = obj.getTransform() R = so3.mul(so3.rotation([0,0,1],random.uniform(0,math.pi*2)...
[ "def", "xy_randomize", "(", "obj", ",", "bmin", ",", "bmax", ")", ":", "R", ",", "t", "=", "obj", ".", "getTransform", "(", ")", "R", "=", "so3", ".", "mul", "(", "so3", ".", "rotation", "(", "[", "0", ",", "0", ",", "1", "]", ",", "random", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/model/create/pile.py#L24-L36
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
ToolBarBase.GetToolByPos
(*args, **kwargs)
return _controls_.ToolBarBase_GetToolByPos(*args, **kwargs)
GetToolByPos(self, int pos) -> ToolBarToolBase
GetToolByPos(self, int pos) -> ToolBarToolBase
[ "GetToolByPos", "(", "self", "int", "pos", ")", "-", ">", "ToolBarToolBase" ]
def GetToolByPos(*args, **kwargs): """GetToolByPos(self, int pos) -> ToolBarToolBase""" return _controls_.ToolBarBase_GetToolByPos(*args, **kwargs)
[ "def", "GetToolByPos", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ToolBarBase_GetToolByPos", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L3915-L3917
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/input.py
python
RemoveDuplicateDependencies
(targets)
Makes sure every dependency appears only once in all targets's dependency lists.
Makes sure every dependency appears only once in all targets's dependency lists.
[ "Makes", "sure", "every", "dependency", "appears", "only", "once", "in", "all", "targets", "s", "dependency", "lists", "." ]
def RemoveDuplicateDependencies(targets): """Makes sure every dependency appears only once in all targets's dependency lists.""" for target_name, target_dict in targets.iteritems(): for dependency_key in dependency_sections: dependencies = target_dict.get(dependency_key, []) if dependencies: ...
[ "def", "RemoveDuplicateDependencies", "(", "targets", ")", ":", "for", "target_name", ",", "target_dict", "in", "targets", ".", "iteritems", "(", ")", ":", "for", "dependency_key", "in", "dependency_sections", ":", "dependencies", "=", "target_dict", ".", "get", ...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/input.py#L1472-L1479
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewRenderer.GetEllipsizeMode
(*args, **kwargs)
return _dataview.DataViewRenderer_GetEllipsizeMode(*args, **kwargs)
GetEllipsizeMode(self) -> int
GetEllipsizeMode(self) -> int
[ "GetEllipsizeMode", "(", "self", ")", "-", ">", "int" ]
def GetEllipsizeMode(*args, **kwargs): """GetEllipsizeMode(self) -> int""" return _dataview.DataViewRenderer_GetEllipsizeMode(*args, **kwargs)
[ "def", "GetEllipsizeMode", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewRenderer_GetEllipsizeMode", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1205-L1207
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Cipher/_mode_eax.py
python
EaxMode.decrypt
(self, ciphertext, output=None)
return self._cipher.decrypt(ciphertext, output=output)
Decrypt data with the key and the parameters set at initialization. A cipher object is stateful: once you have decrypted a message you cannot decrypt (or encrypt) another message with the same object. The data to decrypt can be broken up in two or more pieces and `decrypt` can ...
Decrypt data with the key and the parameters set at initialization.
[ "Decrypt", "data", "with", "the", "key", "and", "the", "parameters", "set", "at", "initialization", "." ]
def decrypt(self, ciphertext, output=None): """Decrypt data with the key and the parameters set at initialization. A cipher object is stateful: once you have decrypted a message you cannot decrypt (or encrypt) another message with the same object. The data to decrypt can be bro...
[ "def", "decrypt", "(", "self", ",", "ciphertext", ",", "output", "=", "None", ")", ":", "if", "self", ".", "decrypt", "not", "in", "self", ".", "_next", ":", "raise", "TypeError", "(", "\"decrypt() can only be called\"", "\" after initialization or an update()\"",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/ResourceManager/lib/Crypto/Cipher/_mode_eax.py#L202-L240
GrammaTech/gtirb
415dd72e1e3c475004d013723c16cdcb29c0826e
python/gtirb/offset.py
python
Offset._from_protobuf
( cls, offset: Offset_pb2.Offset, ir: Optional["IR"] )
return cls(element, offset.displacement)
Decode a Protobuf object to an offset. :param offset: The Protobuf object.
Decode a Protobuf object to an offset.
[ "Decode", "a", "Protobuf", "object", "to", "an", "offset", "." ]
def _from_protobuf( cls, offset: Offset_pb2.Offset, ir: Optional["IR"] ) -> "Offset": """Decode a Protobuf object to an offset. :param offset: The Protobuf object. """ assert ir element_id = UUID(bytes=offset.element_id) element = ir.get_by_uuid(element_id) ...
[ "def", "_from_protobuf", "(", "cls", ",", "offset", ":", "Offset_pb2", ".", "Offset", ",", "ir", ":", "Optional", "[", "\"IR\"", "]", ")", "->", "\"Offset\"", ":", "assert", "ir", "element_id", "=", "UUID", "(", "bytes", "=", "offset", ".", "element_id",...
https://github.com/GrammaTech/gtirb/blob/415dd72e1e3c475004d013723c16cdcb29c0826e/python/gtirb/offset.py#L29-L44
nileshkulkarni/csm
0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc
csm/nnutils/net_blocks.py
python
decoder2d
(nlayers, nz_shape, nc_input, use_bn=True, nc_final=1, nc_min=8, nc_step=1, init_fc=True, use_deconv=False, upconv_mode='bilinear')
return decoder
Simple 3D encoder with nlayers. Args: nlayers: number of decoder layers nz_shape: number of bottleneck nc_input: number of channels to start upconvolution from use_bn: whether to use batch_norm nc_final: number of output channels nc_min: number of min channels ...
Simple 3D encoder with nlayers. Args: nlayers: number of decoder layers nz_shape: number of bottleneck nc_input: number of channels to start upconvolution from use_bn: whether to use batch_norm nc_final: number of output channels nc_min: number of min channels ...
[ "Simple", "3D", "encoder", "with", "nlayers", ".", "Args", ":", "nlayers", ":", "number", "of", "decoder", "layers", "nz_shape", ":", "number", "of", "bottleneck", "nc_input", ":", "number", "of", "channels", "to", "start", "upconvolution", "from", "use_bn", ...
def decoder2d(nlayers, nz_shape, nc_input, use_bn=True, nc_final=1, nc_min=8, nc_step=1, init_fc=True, use_deconv=False, upconv_mode='bilinear'): ''' Simple 3D encoder with nlayers. Args: nlayers: number of decoder layers nz_shape: number of bottleneck nc_input: number of channels t...
[ "def", "decoder2d", "(", "nlayers", ",", "nz_shape", ",", "nc_input", ",", "use_bn", "=", "True", ",", "nc_final", "=", "1", ",", "nc_min", "=", "8", ",", "nc_step", "=", "1", ",", "init_fc", "=", "True", ",", "use_deconv", "=", "False", ",", "upconv...
https://github.com/nileshkulkarni/csm/blob/0e6e0e7d4f725fd36f2414c0be4b9d83197aa1fc/csm/nnutils/net_blocks.py#L200-L235
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/optparse.py
python
OptionParser.print_help
(self, file=None)
print_help(file : file = stdout) Print an extended help message, listing all options and any help text provided with them, to 'file' (default stdout).
print_help(file : file = stdout)
[ "print_help", "(", "file", ":", "file", "=", "stdout", ")" ]
def print_help(self, file=None): """print_help(file : file = stdout) Print an extended help message, listing all options and any help text provided with them, to 'file' (default stdout). """ if file is None: file = sys.stdout file.write(self.format_help())
[ "def", "print_help", "(", "self", ",", "file", "=", "None", ")", ":", "if", "file", "is", "None", ":", "file", "=", "sys", ".", "stdout", "file", ".", "write", "(", "self", ".", "format_help", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/optparse.py#L1639-L1647
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/cli/base_command.py
python
Command.handle_pip_version_check
(self, options)
This is a no-op so that commands by default do not do the pip version check.
[]
def handle_pip_version_check(self, options): # type: (Values) -> None """ This is a no-op so that commands by default do not do the pip version check. """ # Make sure we do the pip version check if the index_group options # are present. assert not ...
[ "def", "handle_pip_version_check", "(", "self", ",", "options", ")", ":", "# type: (Values) -> None", "# Make sure we do the pip version check if the index_group options", "# are present.", "assert", "not", "hasattr", "(", "options", ",", "'no_index'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_internal/cli/base_command.py#L175-L191
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/dataset/callback/ds_callback.py
python
WaitedDSCallback.step_end
(self, run_context)
Internal method, do not call/override. Defines step_end of Callback to release the wait in ds_step_begin. Args: run_context: Include some information of the model.
Internal method, do not call/override. Defines step_end of Callback to release the wait in ds_step_begin.
[ "Internal", "method", "do", "not", "call", "/", "override", ".", "Defines", "step_end", "of", "Callback", "to", "release", "the", "wait", "in", "ds_step_begin", "." ]
def step_end(self, run_context): """ Internal method, do not call/override. Defines step_end of Callback to release the wait in ds_step_begin. Args: run_context: Include some information of the model. """ self.step_run_context = run_context self.step_event.set(...
[ "def", "step_end", "(", "self", ",", "run_context", ")", ":", "self", ".", "step_run_context", "=", "run_context", "self", ".", "step_event", ".", "set", "(", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/dataset/callback/ds_callback.py#L200-L208
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/sets.py
python
BaseSet.__sub__
(self, other)
return self.difference(other)
Return the difference of two sets as a new Set. (I.e. all elements that are in this set and not in the other.)
Return the difference of two sets as a new Set.
[ "Return", "the", "difference", "of", "two", "sets", "as", "a", "new", "Set", "." ]
def __sub__(self, other): """Return the difference of two sets as a new Set. (I.e. all elements that are in this set and not in the other.) """ if not isinstance(other, BaseSet): return NotImplemented return self.difference(other)
[ "def", "__sub__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "BaseSet", ")", ":", "return", "NotImplemented", "return", "self", ".", "difference", "(", "other", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/sets.py#L269-L276
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/calltip_w.py
python
CalltipWindow.checkhide_event
(self, event=None)
return None
Handle CHECK_HIDE_EVENT: call hidetip or reschedule.
Handle CHECK_HIDE_EVENT: call hidetip or reschedule.
[ "Handle", "CHECK_HIDE_EVENT", ":", "call", "hidetip", "or", "reschedule", "." ]
def checkhide_event(self, event=None): """Handle CHECK_HIDE_EVENT: call hidetip or reschedule.""" if not self.tipwindow: # If the event was triggered by the same event that unbound # this function, the function will be called nevertheless, # so do nothing in this case...
[ "def", "checkhide_event", "(", "self", ",", "event", "=", "None", ")", ":", "if", "not", "self", ".", "tipwindow", ":", "# If the event was triggered by the same event that unbound", "# this function, the function will be called nevertheless,", "# so do nothing in this case.", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/calltip_w.py#L88-L113
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_core.py
python
SetCursorEvent.GetCursor
(*args, **kwargs)
return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
GetCursor(self) -> Cursor Returns a reference to the cursor specified by this event.
GetCursor(self) -> Cursor
[ "GetCursor", "(", "self", ")", "-", ">", "Cursor" ]
def GetCursor(*args, **kwargs): """ GetCursor(self) -> Cursor Returns a reference to the cursor specified by this event. """ return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
[ "def", "GetCursor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SetCursorEvent_GetCursor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_core.py#L5899-L5905
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewListCtrl.GetItemData
(*args, **kwargs)
return _dataview.DataViewListCtrl_GetItemData(*args, **kwargs)
GetItemData(self, DataViewItem item) -> UIntPtr
GetItemData(self, DataViewItem item) -> UIntPtr
[ "GetItemData", "(", "self", "DataViewItem", "item", ")", "-", ">", "UIntPtr" ]
def GetItemData(*args, **kwargs): """GetItemData(self, DataViewItem item) -> UIntPtr""" return _dataview.DataViewListCtrl_GetItemData(*args, **kwargs)
[ "def", "GetItemData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewListCtrl_GetItemData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L2204-L2206
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
GraphicsPath.GetCurrentPoint
(*args, **kwargs)
return _gdi_.GraphicsPath_GetCurrentPoint(*args, **kwargs)
GetCurrentPoint(self) -> Point2D Gets the last point of the current path, (0,0) if not yet set
GetCurrentPoint(self) -> Point2D
[ "GetCurrentPoint", "(", "self", ")", "-", ">", "Point2D" ]
def GetCurrentPoint(*args, **kwargs): """ GetCurrentPoint(self) -> Point2D Gets the last point of the current path, (0,0) if not yet set """ return _gdi_.GraphicsPath_GetCurrentPoint(*args, **kwargs)
[ "def", "GetCurrentPoint", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsPath_GetCurrentPoint", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L5920-L5926
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/searchbase.py
python
SearchDialogBase.create_other_buttons
(self)
return frame, others
Return (frame, others) for testing. Others is a list of value, label pairs. A gridded frame from make_frame is filled with radio buttons.
Return (frame, others) for testing.
[ "Return", "(", "frame", "others", ")", "for", "testing", "." ]
def create_other_buttons(self): '''Return (frame, others) for testing. Others is a list of value, label pairs. A gridded frame from make_frame is filled with radio buttons. ''' frame = self.make_frame("Direction")[0] var = self.engine.backvar others = [(1, 'Up'),...
[ "def", "create_other_buttons", "(", "self", ")", ":", "frame", "=", "self", ".", "make_frame", "(", "\"Direction\"", ")", "[", "0", "]", "var", "=", "self", ".", "engine", ".", "backvar", "others", "=", "[", "(", "1", ",", "'Up'", ")", ",", "(", "0...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/searchbase.py#L148-L160
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/database.py
python
get_required_dists
(dists, dist)
return req
Recursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested
Recursively generate a list of distributions from *dists* that are required by *dist*.
[ "Recursively", "generate", "a", "list", "of", "distributions", "from", "*", "dists", "*", "that", "are", "required", "by", "*", "dist", "*", "." ]
def get_required_dists(dists, dist): """Recursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested """ if dist not in dists: raise DistlibExceptio...
[ "def", "get_required_dists", "(", "dists", ",", "dist", ")", ":", "if", "dist", "not", "in", "dists", ":", "raise", "DistlibException", "(", "'given distribution %r is not a member '", "'of the list'", "%", "dist", ".", "name", ")", "graph", "=", "make_graph", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/database.py#L1305-L1327
KhronosGroup/SPIRV-LLVM
1eb85593f3fe2c39379b9a9b088d51eda4f42b8b
bindings/python/llvm/common.py
python
LLVMObject.take_ownership
(self, obj)
Take ownership of another object. When you take ownership of another object, you are responsible for destroying that object. In addition, a reference to that object is placed inside this object so the Python garbage collector will not collect the object while it is still alive in libLLV...
Take ownership of another object.
[ "Take", "ownership", "of", "another", "object", "." ]
def take_ownership(self, obj): """Take ownership of another object. When you take ownership of another object, you are responsible for destroying that object. In addition, a reference to that object is placed inside this object so the Python garbage collector will not collect th...
[ "def", "take_ownership", "(", "self", ",", "obj", ")", ":", "assert", "isinstance", "(", "obj", ",", "LLVMObject", ")", "self", ".", "_owned_objects", ".", "append", "(", "obj", ")", "obj", ".", "_self_owned", "=", "False" ]
https://github.com/KhronosGroup/SPIRV-LLVM/blob/1eb85593f3fe2c39379b9a9b088d51eda4f42b8b/bindings/python/llvm/common.py#L44-L58
eclipse/omr
056e7c9ce9d503649190bc5bd9931fac30b4e4bc
jitbuilder/apigen/cppgen.py
python
CppGenerator.get_class_name
(self, c)
return "::".join(c.containing_classes() + [c.name()])
Returns the name of a given class in the client API implementation. If the class is a nested class, then the name is prefixed with name of all containing classes, separated by the scope resolution operator.
Returns the name of a given class in the client API implementation.
[ "Returns", "the", "name", "of", "a", "given", "class", "in", "the", "client", "API", "implementation", "." ]
def get_class_name(self, c): """ Returns the name of a given class in the client API implementation. If the class is a nested class, then the name is prefixed with name of all containing classes, separated by the scope resolution operator. """ return "::".join(c.containi...
[ "def", "get_class_name", "(", "self", ",", "c", ")", ":", "return", "\"::\"", ".", "join", "(", "c", ".", "containing_classes", "(", ")", "+", "[", "c", ".", "name", "(", ")", "]", ")" ]
https://github.com/eclipse/omr/blob/056e7c9ce9d503649190bc5bd9931fac30b4e4bc/jitbuilder/apigen/cppgen.py#L124-L131
MythTV/mythtv
d282a209cb8be85d036f85a62a8ec971b67d45f4
mythtv/programs/scripts/internetcontent/nv_python_libs/vimeo/oauth/oauth_api.py
python
OAuthDataStore.fetch_access_token
(self, oauth_consumer, oauth_token, oauth_verifier)
-> OAuthToken.
-> OAuthToken.
[ "-", ">", "OAuthToken", "." ]
def fetch_access_token(self, oauth_consumer, oauth_token, oauth_verifier): """-> OAuthToken.""" raise NotImplementedError
[ "def", "fetch_access_token", "(", "self", ",", "oauth_consumer", ",", "oauth_token", ",", "oauth_verifier", ")", ":", "raise", "NotImplementedError" ]
https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/vimeo/oauth/oauth_api.py#L576-L578
0ad/0ad
f58db82e0e925016d83f4e3fa7ca599e3866e2af
source/tools/i18n/extractors/jslexer.py
python
tokenize
(source)
Tokenize a JavaScript source. :return: generator of `Token`\s
Tokenize a JavaScript source.
[ "Tokenize", "a", "JavaScript", "source", "." ]
def tokenize(source): """Tokenize a JavaScript source. :return: generator of `Token`\s """ may_divide = False pos = 0 lineno = 1 end = len(source) while pos < end: # handle regular rules first for token_type, rule in rules: match = rule.match(source, pos) ...
[ "def", "tokenize", "(", "source", ")", ":", "may_divide", "=", "False", "pos", "=", "0", "lineno", "=", "1", "end", "=", "len", "(", "source", ")", "while", "pos", "<", "end", ":", "# handle regular rules first", "for", "token_type", ",", "rule", "in", ...
https://github.com/0ad/0ad/blob/f58db82e0e925016d83f4e3fa7ca599e3866e2af/source/tools/i18n/extractors/jslexer.py#L150-L188
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/shutil.py
python
copy
(src, dst)
Copy data and mode bits ("cp src dst"). The destination may be a directory.
Copy data and mode bits ("cp src dst").
[ "Copy", "data", "and", "mode", "bits", "(", "cp", "src", "dst", ")", "." ]
def copy(src, dst): """Copy data and mode bits ("cp src dst"). The destination may be a directory. """ if os.path.isdir(dst): dst = os.path.join(dst, os.path.basename(src)) copyfile(src, dst) copymode(src, dst)
[ "def", "copy", "(", "src", ",", "dst", ")", ":", "if", "os", ".", "path", ".", "isdir", "(", "dst", ")", ":", "dst", "=", "os", ".", "path", ".", "join", "(", "dst", ",", "os", ".", "path", ".", "basename", "(", "src", ")", ")", "copyfile", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/_backport/shutil.py#L133-L142
PX4/PX4-Autopilot
0b9f60a0370be53d683352c63fd92db3d6586e18
Tools/mavlink_px4.py
python
MAVLink.heartbeat_encode
(self, type, autopilot, base_mode, custom_mode, system_status, mavlink_version=3)
return msg
The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot)...
The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot)...
[ "The", "heartbeat", "message", "shows", "that", "a", "system", "is", "present", "and", "responding", ".", "The", "type", "of", "the", "MAV", "and", "Autopilot", "hardware", "allow", "the", "receiving", "system", "to", "treat", "further", "messages", "from", ...
def heartbeat_encode(self, type, autopilot, base_mode, custom_mode, system_status, mavlink_version=3): ''' The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat f...
[ "def", "heartbeat_encode", "(", "self", ",", "type", ",", "autopilot", ",", "base_mode", ",", "custom_mode", ",", "system_status", ",", "mavlink_version", "=", "3", ")", ":", "msg", "=", "MAVLink_heartbeat_message", "(", "type", ",", "autopilot", ",", "base_mo...
https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/mavlink_px4.py#L2389-L2407
zju3dv/clean-pvnet
5870c509e3cc205e1bb28910a7b1a9a3c8add9a8
lib/utils/meshrenderer/pysixd/transform.py
python
projection_matrix
(point, normal, direction=None, perspective=None, pseudo=False)
return M
Return matrix to project onto plane defined by point and normal. Using either perspective point, projection direction, or none of both. If pseudo is True, perspective projections will preserve relative depth such that Perspective = dot(Orthogonal, PseudoPerspective). >>> P = projection_matrix([0, 0, ...
Return matrix to project onto plane defined by point and normal.
[ "Return", "matrix", "to", "project", "onto", "plane", "defined", "by", "point", "and", "normal", "." ]
def projection_matrix(point, normal, direction=None, perspective=None, pseudo=False): """Return matrix to project onto plane defined by point and normal. Using either perspective point, projection direction, or none of both. If pseudo is True, perspective projections will preserve re...
[ "def", "projection_matrix", "(", "point", ",", "normal", ",", "direction", "=", "None", ",", "perspective", "=", "None", ",", "pseudo", "=", "False", ")", ":", "M", "=", "numpy", ".", "identity", "(", "4", ")", "point", "=", "numpy", ".", "array", "(...
https://github.com/zju3dv/clean-pvnet/blob/5870c509e3cc205e1bb28910a7b1a9a3c8add9a8/lib/utils/meshrenderer/pysixd/transform.py#L461-L520
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/handlers.py
python
BaseRotatingHandler.emit
(self, record)
Emit a record. Output the record to the file, catering for rollover as described in doRollover().
Emit a record.
[ "Emit", "a", "record", "." ]
def emit(self, record): """ Emit a record. Output the record to the file, catering for rollover as described in doRollover(). """ try: if self.shouldRollover(record): self.doRollover() logging.FileHandler.emit(self, record) ...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "try", ":", "if", "self", ".", "shouldRollover", "(", "record", ")", ":", "self", ".", "doRollover", "(", ")", "logging", ".", "FileHandler", ".", "emit", "(", "self", ",", "record", ")", "except",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/handlers.py#L68-L82
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/internal/decoder.py
python
EnumDecoder
(field_number, is_repeated, is_packed, key, new_default, clear_if_default=False)
Returns a decoder for enum field.
Returns a decoder for enum field.
[ "Returns", "a", "decoder", "for", "enum", "field", "." ]
def EnumDecoder(field_number, is_repeated, is_packed, key, new_default, clear_if_default=False): """Returns a decoder for enum field.""" enum_type = key.enum_type if is_packed: local_DecodeVarint = _DecodeVarint def DecodePackedField(buffer, pos, end, message, field_dict): """Decode ...
[ "def", "EnumDecoder", "(", "field_number", ",", "is_repeated", ",", "is_packed", ",", "key", ",", "new_default", ",", "clear_if_default", "=", "False", ")", ":", "enum_type", "=", "key", ".", "enum_type", "if", "is_packed", ":", "local_DecodeVarint", "=", "_De...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/internal/decoder.py#L390-L526
pirobot/rbx2
2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a
rbx2_utils/src/rbx2_utils/srv/_OldLaunchProcess.py
python
OldLaunchProcessResponse.deserialize
(self, str)
unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str``
unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str``
[ "unpack", "serialized", "message", "in", "str", "into", "this", "message", "instance", ":", "param", "str", ":", "byte", "array", "of", "serialized", "message", "str" ]
def deserialize(self, str): """ unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str`` """ try: end = 0 start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if ...
[ "def", "deserialize", "(", "self", ",", "str", ")", ":", "try", ":", "end", "=", "0", "start", "=", "end", "end", "+=", "4", "(", "length", ",", ")", "=", "_struct_I", ".", "unpack", "(", "str", "[", "start", ":", "end", "]", ")", "start", "=",...
https://github.com/pirobot/rbx2/blob/2a6544799fcf062e7b6bd5cf2981b2a84c0c7d2a/rbx2_utils/src/rbx2_utils/srv/_OldLaunchProcess.py#L283-L301
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
com/win32comext/ifilter/demo/filterDemo.py
python
FileParser._get_properties
(self, properties)
Use OLE property sets to get base properties
Use OLE property sets to get base properties
[ "Use", "OLE", "property", "sets", "to", "get", "base", "properties" ]
def _get_properties(self, properties): """ Use OLE property sets to get base properties """ try: pss = self.stg.QueryInterface(pythoncom.IID_IPropertySetStorage) except pythoncom.com_error as e: self._trace("No Property information could be retrieved", e) ...
[ "def", "_get_properties", "(", "self", ",", "properties", ")", ":", "try", ":", "pss", "=", "self", ".", "stg", ".", "QueryInterface", "(", "pythoncom", ".", "IID_IPropertySetStorage", ")", "except", "pythoncom", ".", "com_error", "as", "e", ":", "self", "...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32comext/ifilter/demo/filterDemo.py#L188-L218
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/timeline/importer.py
python
TimelineImporter.ImportEvents
(self)
Processes the event data in the wrapper and creates and adds new timeline events to the model
Processes the event data in the wrapper and creates and adds new timeline events to the model
[ "Processes", "the", "event", "data", "in", "the", "wrapper", "and", "creates", "and", "adds", "new", "timeline", "events", "to", "the", "model" ]
def ImportEvents(self): """Processes the event data in the wrapper and creates and adds new timeline events to the model""" raise NotImplementedError
[ "def", "ImportEvents", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/timeline/importer.py#L17-L20
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/encodings/hex_codec.py
python
hex_decode
(input,errors='strict')
return (output, len(input))
Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing this slot. errors defines the error hand...
Decodes the object input and returns a tuple (output object, length consumed).
[ "Decodes", "the", "object", "input", "and", "returns", "a", "tuple", "(", "output", "object", "length", "consumed", ")", "." ]
def hex_decode(input,errors='strict'): """ Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing t...
[ "def", "hex_decode", "(", "input", ",", "errors", "=", "'strict'", ")", ":", "assert", "errors", "==", "'strict'", "output", "=", "binascii", ".", "a2b_hex", "(", "input", ")", "return", "(", "output", ",", "len", "(", "input", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/encodings/hex_codec.py#L27-L43
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/tools/common/public_api.py
python
PublicAPIVisitor.private_map
(self)
return self._private_map
A map from parents to symbols that should not be included at all. This map can be edited, but it should not be edited once traversal has begun. Returns: The map marking symbols to not include.
A map from parents to symbols that should not be included at all.
[ "A", "map", "from", "parents", "to", "symbols", "that", "should", "not", "be", "included", "at", "all", "." ]
def private_map(self): """A map from parents to symbols that should not be included at all. This map can be edited, but it should not be edited once traversal has begun. Returns: The map marking symbols to not include. """ return self._private_map
[ "def", "private_map", "(", "self", ")", ":", "return", "self", ".", "_private_map" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/tools/common/public_api.py#L75-L84
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/package_index.py
python
_encode_auth
(auth)
return encoded.replace('\n', '')
A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:' + 'password'*10 >>> chr(10) in...
A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ='
[ "A", "function", "compatible", "with", "Python", "2", ".", "3", "-", "3", ".", "3", "that", "will", "encode", "auth", "from", "a", "URL", "suitable", "for", "an", "HTTP", "header", ".", ">>>", "str", "(", "_encode_auth", "(", "username%3Apassword", "))",...
def _encode_auth(auth): """ A function compatible with Python 2.3-3.3 that will encode auth from a URL suitable for an HTTP header. >>> str(_encode_auth('username%3Apassword')) 'dXNlcm5hbWU6cGFzc3dvcmQ=' Long auth strings should not cause a newline to be inserted. >>> long_auth = 'username:...
[ "def", "_encode_auth", "(", "auth", ")", ":", "auth_s", "=", "urllib", ".", "parse", ".", "unquote", "(", "auth", ")", "# convert to bytes", "auth_bytes", "=", "auth_s", ".", "encode", "(", ")", "encoded_bytes", "=", "base64", ".", "b64encode", "(", "auth_...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/package_index.py#L973-L992
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py
python
Style.lookup
(self, style, option, state=None, default=None)
return self.tk.call(self._name, "lookup", style, '-%s' % option, state, default)
Returns the value specified for option in style. If state is specified it is expected to be a sequence of one or more states. If the default argument is set, it is used as a fallback value in case no specification for option is found.
Returns the value specified for option in style.
[ "Returns", "the", "value", "specified", "for", "option", "in", "style", "." ]
def lookup(self, style, option, state=None, default=None): """Returns the value specified for option in style. If state is specified it is expected to be a sequence of one or more states. If the default argument is set, it is used as a fallback value in case no specification for option ...
[ "def", "lookup", "(", "self", ",", "style", ",", "option", ",", "state", "=", "None", ",", "default", "=", "None", ")", ":", "state", "=", "' '", ".", "join", "(", "state", ")", "if", "state", "else", "''", "return", "self", ".", "tk", ".", "call...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/ttk.py#L409-L418
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/layer2.py
python
TableGenerator.consumed_units
(self)
return self._consumed_units
Returns a float representing the ConsumedCapacityUnits accumulated.
Returns a float representing the ConsumedCapacityUnits accumulated.
[ "Returns", "a", "float", "representing", "the", "ConsumedCapacityUnits", "accumulated", "." ]
def consumed_units(self): """ Returns a float representing the ConsumedCapacityUnits accumulated. """ self.response return self._consumed_units
[ "def", "consumed_units", "(", "self", ")", ":", "self", ".", "response", "return", "self", ".", "_consumed_units" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/dynamodb/layer2.py#L80-L85
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
TextAttr.HasTextColour
(*args, **kwargs)
return _controls_.TextAttr_HasTextColour(*args, **kwargs)
HasTextColour(self) -> bool
HasTextColour(self) -> bool
[ "HasTextColour", "(", "self", ")", "-", ">", "bool" ]
def HasTextColour(*args, **kwargs): """HasTextColour(self) -> bool""" return _controls_.TextAttr_HasTextColour(*args, **kwargs)
[ "def", "HasTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TextAttr_HasTextColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1768-L1770
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
BoolArgument.GetValidGLArg
(self, func, offset, index)
return 'true'
Gets a valid GL value for this argument.
Gets a valid GL value for this argument.
[ "Gets", "a", "valid", "GL", "value", "for", "this", "argument", "." ]
def GetValidGLArg(self, func, offset, index): """Gets a valid GL value for this argument.""" return 'true'
[ "def", "GetValidGLArg", "(", "self", ",", "func", ",", "offset", ",", "index", ")", ":", "return", "'true'" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L5879-L5881
lilypond/lilypond
2a14759372979f5b796ee802b0ee3bc15d28b06b
release/binaries/lib/config.py
python
Config.is_mingw
(self)
return self.platform == Platform.MINGW
Return True if this config is for platform mingw
Return True if this config is for platform mingw
[ "Return", "True", "if", "this", "config", "is", "for", "platform", "mingw" ]
def is_mingw(self) -> bool: """Return True if this config is for platform mingw""" return self.platform == Platform.MINGW
[ "def", "is_mingw", "(", "self", ")", "->", "bool", ":", "return", "self", ".", "platform", "==", "Platform", ".", "MINGW" ]
https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/release/binaries/lib/config.py#L129-L131
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ScrollBar.GetRange
(*args, **kwargs)
return _controls_.ScrollBar_GetRange(*args, **kwargs)
GetRange(self) -> int
GetRange(self) -> int
[ "GetRange", "(", "self", ")", "-", ">", "int" ]
def GetRange(*args, **kwargs): """GetRange(self) -> int""" return _controls_.ScrollBar_GetRange(*args, **kwargs)
[ "def", "GetRange", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ScrollBar_GetRange", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2168-L2170
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/report.py
python
Reporter.find_code_units
(self, morfs, config)
Find the code units we'll report on. `morfs` is a list of modules or filenames. `config` is a CoverageConfig instance.
Find the code units we'll report on.
[ "Find", "the", "code", "units", "we", "ll", "report", "on", "." ]
def find_code_units(self, morfs, config): """Find the code units we'll report on. `morfs` is a list of modules or filenames. `config` is a CoverageConfig instance. """ morfs = morfs or self.coverage.data.measured_files() file_locator = self.coverage.file_locator ...
[ "def", "find_code_units", "(", "self", ",", "morfs", ",", "config", ")", ":", "morfs", "=", "morfs", "or", "self", ".", "coverage", ".", "data", ".", "measured_files", "(", ")", "file_locator", "=", "self", ".", "coverage", ".", "file_locator", "self", "...
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/report.py#L27-L59
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/tooltip.py
python
TooltipBase.hidetip
(self)
hide the tooltip
hide the tooltip
[ "hide", "the", "tooltip" ]
def hidetip(self): """hide the tooltip""" # Note: This is called by __del__, so careful when overriding/extending tw = self.tipwindow self.tipwindow = None if tw: try: tw.destroy() except TclError: # pragma: no cover pass
[ "def", "hidetip", "(", "self", ")", ":", "# Note: This is called by __del__, so careful when overriding/extending", "tw", "=", "self", ".", "tipwindow", "self", ".", "tipwindow", "=", "None", "if", "tw", ":", "try", ":", "tw", ".", "destroy", "(", ")", "except",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/tooltip.py#L70-L79
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/lib/debug_events_reader.py
python
DebugEventsReader.read_execution_event
(self, offset)
return debug_event_pb2.DebugEvent.FromString(proto_string)
Read a DebugEvent proto at a given offset from the .execution file. Args: offset: Offset to read the DebugEvent proto from. Returns: A DebugEventProto. Raises: `errors.DataLossError` if offset is at a wrong location. `IndexError` if offset is out of range of the file.
Read a DebugEvent proto at a given offset from the .execution file.
[ "Read", "a", "DebugEvent", "proto", "at", "a", "given", "offset", "from", "the", ".", "execution", "file", "." ]
def read_execution_event(self, offset): """Read a DebugEvent proto at a given offset from the .execution file. Args: offset: Offset to read the DebugEvent proto from. Returns: A DebugEventProto. Raises: `errors.DataLossError` if offset is at a wrong location. `IndexError` if o...
[ "def", "read_execution_event", "(", "self", ",", "offset", ")", ":", "with", "self", ".", "_reader_read_locks", "[", "self", ".", "_execution_path", "]", ":", "proto_string", "=", "self", ".", "_get_reader", "(", "self", ".", "_execution_path", ")", ".", "re...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/lib/debug_events_reader.py#L266-L281
telefonicaid/fiware-orion
27c3202b9ddcfb9e3635a0af8d373f76e89b1d24
scripts/cpplint.py
python
_SetVerboseLevel
(level)
return _cpplint_state.SetVerboseLevel(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(level): """Sets the module's verbosity, and returns the previous setting.""" return _cpplint_state.SetVerboseLevel(level)
[ "def", "_SetVerboseLevel", "(", "level", ")", ":", "return", "_cpplint_state", ".", "SetVerboseLevel", "(", "level", ")" ]
https://github.com/telefonicaid/fiware-orion/blob/27c3202b9ddcfb9e3635a0af8d373f76e89b1d24/scripts/cpplint.py#L586-L588
apache/parquet-cpp
642da055adf009652689b20e68a198cffb857651
build-support/cpplint.py
python
CheckAccess
(filename, clean_lines, linenum, nesting_state, error)
Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState instance which maintains information about the current stack...
Checks for improper use of DISALLOW* macros.
[ "Checks", "for", "improper", "use", "of", "DISALLOW", "*", "macros", "." ]
def CheckAccess(filename, clean_lines, linenum, nesting_state, error): """Checks for improper use of DISALLOW* macros. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. nesting_state: A NestingState ins...
[ "def", "CheckAccess", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "matched", "=", "Match", "(", "(", "r'...
https://github.com/apache/parquet-cpp/blob/642da055adf009652689b20e68a198cffb857651/build-support/cpplint.py#L2969-L2996
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/daveplugin.py
python
DAVEPlugin.get_runflags
(self, mode, interactive, scripted)
return (waitmode,newconsole)
Return the following boolean flags: newconsole - the plugin should execute in a new console waitmode - Execution should wait for the plugin to finish executing
Return the following boolean flags:
[ "Return", "the", "following", "boolean", "flags", ":" ]
def get_runflags(self, mode, interactive, scripted): """ Return the following boolean flags: newconsole - the plugin should execute in a new console waitmode - Execution should wait for the plugin to finish executing """ if int...
[ "def", "get_runflags", "(", "self", ",", "mode", ",", "interactive", ",", "scripted", ")", ":", "if", "interactive", ":", "if", "not", "mode", ":", "# Use the plugin's settings", "mode", "=", "self", ".", "getConsoleMode", "(", ")", "else", ":", "# Non-inter...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/daveplugin.py#L451-L479
bareos/bareos
56a10bb368b0a81e977bb51304033fe49d59efb0
restapi/bareos_restapi/__init__.py
python
rerun_Job
( *, job_range: jobRange = Body(..., title="Job range to rerun"), response: Response, current_user: User = Depends(get_current_user), )
Rerun jobs given by the following parameters (at least one) - **since_jobid**=_jobid_ rerun failed jobs since this jobid - **until_jobid**=_jobid_ - in conjunction with _since_jobid_ - **days**=_nr_days_ - since a number of days - **hours**=_nr_hours_ - since a number of hours Built on console com...
Rerun jobs given by the following parameters (at least one)
[ "Rerun", "jobs", "given", "by", "the", "following", "parameters", "(", "at", "least", "one", ")" ]
def rerun_Job( *, job_range: jobRange = Body(..., title="Job range to rerun"), response: Response, current_user: User = Depends(get_current_user), ): """ Rerun jobs given by the following parameters (at least one) - **since_jobid**=_jobid_ rerun failed jobs since this jobid - **until_jo...
[ "def", "rerun_Job", "(", "*", ",", "job_range", ":", "jobRange", "=", "Body", "(", "...", ",", "title", "=", "\"Job range to rerun\"", ")", ",", "response", ":", "Response", ",", "current_user", ":", "User", "=", "Depends", "(", "get_current_user", ")", ",...
https://github.com/bareos/bareos/blob/56a10bb368b0a81e977bb51304033fe49d59efb0/restapi/bareos_restapi/__init__.py#L700-L736
p4lang/behavioral-model
81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9
tools/cpplint.py
python
CheckOperatorSpacing
(filename, clean_lines, linenum, error)
Checks for horizontal spacing around operators. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Checks for horizontal spacing around operators.
[ "Checks", "for", "horizontal", "spacing", "around", "operators", "." ]
def CheckOperatorSpacing(filename, clean_lines, linenum, error): """Checks for horizontal spacing around operators. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any...
[ "def", "CheckOperatorSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Don't try to do spacing checks for operator methods. Do this by", "# replacing the troublesome cha...
https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/cpplint.py#L3796-L3908
musescore/MuseScore
a817fea23e3c2be30847b7fde5b01746222c252e
tools/crashdump/posix/generate_breakpad_symbols.py
python
GetTransitiveDependencies
(options)
Return absolute paths to the transitive closure of all shared library dependencies of the binary, along with the binary itself.
Return absolute paths to the transitive closure of all shared library dependencies of the binary, along with the binary itself.
[ "Return", "absolute", "paths", "to", "the", "transitive", "closure", "of", "all", "shared", "library", "dependencies", "of", "the", "binary", "along", "with", "the", "binary", "itself", "." ]
def GetTransitiveDependencies(options): """Return absolute paths to the transitive closure of all shared library dependencies of the binary, along with the binary itself.""" binary = os.path.abspath(options.binary) exe_path = os.path.dirname(binary) if options.platform == 'linux2': # 'ldd' returns all ...
[ "def", "GetTransitiveDependencies", "(", "options", ")", ":", "binary", "=", "os", ".", "path", ".", "abspath", "(", "options", ".", "binary", ")", "exe_path", "=", "os", ".", "path", ".", "dirname", "(", "binary", ")", "if", "options", ".", "platform", ...
https://github.com/musescore/MuseScore/blob/a817fea23e3c2be30847b7fde5b01746222c252e/tools/crashdump/posix/generate_breakpad_symbols.py#L241-L262
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/yapf/yapf/yapflib/pytree_unwrapper.py
python
_MatchBrackets
(uwline)
Visit the node and match the brackets. For every open bracket ('[', '{', or '('), find the associated closing bracket and "match" them up. I.e., save in the token a pointer to its associated open or close bracket. Arguments: uwline: (UnwrappedLine) An unwrapped line.
Visit the node and match the brackets.
[ "Visit", "the", "node", "and", "match", "the", "brackets", "." ]
def _MatchBrackets(uwline): """Visit the node and match the brackets. For every open bracket ('[', '{', or '('), find the associated closing bracket and "match" them up. I.e., save in the token a pointer to its associated open or close bracket. Arguments: uwline: (UnwrappedLine) An unwrapped line. """...
[ "def", "_MatchBrackets", "(", "uwline", ")", ":", "bracket_stack", "=", "[", "]", "for", "token", "in", "uwline", ".", "tokens", ":", "if", "token", ".", "value", "in", "pytree_utils", ".", "OPENING_BRACKETS", ":", "bracket_stack", ".", "append", "(", "tok...
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/yapf/yapf/yapflib/pytree_unwrapper.py#L295-L312
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Window.Fit
(*args, **kwargs)
return _core_.Window_Fit(*args, **kwargs)
Fit(self) Sizes the window so that it fits around its subwindows. This function won't do anything if there are no subwindows and will only really work correctly if sizers are used for the subwindows layout. Also, if the window has exactly one subwindow it is better (faster and the resul...
Fit(self)
[ "Fit", "(", "self", ")" ]
def Fit(*args, **kwargs): """ Fit(self) Sizes the window so that it fits around its subwindows. This function won't do anything if there are no subwindows and will only really work correctly if sizers are used for the subwindows layout. Also, if the window has exactly on...
[ "def", "Fit", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_Fit", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L9678-L9690
RLBot/RLBot
34332b12cf158b3ef8dbf174ae67c53683368a9d
src/main/python/rlbot/matchcomms/common_uses/reply.py
python
add_reply_field
(outgoing_msg: JSON)
return reply_id
Mutates outgoing_msg to gain a reply_id and returns the reply_id.
Mutates outgoing_msg to gain a reply_id and returns the reply_id.
[ "Mutates", "outgoing_msg", "to", "gain", "a", "reply_id", "and", "returns", "the", "reply_id", "." ]
def add_reply_field(outgoing_msg: JSON) -> ReplyId: """ Mutates outgoing_msg to gain a reply_id and returns the reply_id. """ assert not hasattr(outgoing_msg, MESSAGE_KEY), "Message contents conflict with reply MESSAGE_KEY." reply_id = generate_random_reply_id() outgoing_msg[MESSAGE_KEY] = reply...
[ "def", "add_reply_field", "(", "outgoing_msg", ":", "JSON", ")", "->", "ReplyId", ":", "assert", "not", "hasattr", "(", "outgoing_msg", ",", "MESSAGE_KEY", ")", ",", "\"Message contents conflict with reply MESSAGE_KEY.\"", "reply_id", "=", "generate_random_reply_id", "(...
https://github.com/RLBot/RLBot/blob/34332b12cf158b3ef8dbf174ae67c53683368a9d/src/main/python/rlbot/matchcomms/common_uses/reply.py#L17-L24
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
Viewport.setModelviewMatrix
(self, M: Sequence[float])
return _robotsim.Viewport_setModelviewMatrix(self, M)
r""" Args: M (:obj:`double [16]`)
r""" Args: M (:obj:`double [16]`)
[ "r", "Args", ":", "M", "(", ":", "obj", ":", "double", "[", "16", "]", ")" ]
def setModelviewMatrix(self, M: Sequence[float]) ->None: r""" Args: M (:obj:`double [16]`) """ return _robotsim.Viewport_setModelviewMatrix(self, M)
[ "def", "setModelviewMatrix", "(", "self", ",", "M", ":", "Sequence", "[", "float", "]", ")", "->", "None", ":", "return", "_robotsim", ".", "Viewport_setModelviewMatrix", "(", "self", ",", "M", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L3256-L3261
TGAC/KAT
e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216
deps/jellyfish-2.2.0/swig/python/jellyfish.py
python
MerDNA.__lshift__
(self, *args)
return _jellyfish.MerDNA___lshift__(self, *args)
Shift a base to the left and return the mer
Shift a base to the left and return the mer
[ "Shift", "a", "base", "to", "the", "left", "and", "return", "the", "mer" ]
def __lshift__(self, *args): """Shift a base to the left and return the mer""" return _jellyfish.MerDNA___lshift__(self, *args)
[ "def", "__lshift__", "(", "self", ",", "*", "args", ")", ":", "return", "_jellyfish", ".", "MerDNA___lshift__", "(", "self", ",", "*", "args", ")" ]
https://github.com/TGAC/KAT/blob/e8870331de2b4bb0a1b3b91c6afb8fb9d59e9216/deps/jellyfish-2.2.0/swig/python/jellyfish.py#L181-L183
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/codecs.py
python
Codec.decode
(self, input, errors='strict')
Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing this slot. errors de...
Decodes the object input and returns a tuple (output object, length consumed).
[ "Decodes", "the", "object", "input", "and", "returns", "a", "tuple", "(", "output", "object", "length", "consumed", ")", "." ]
def decode(self, input, errors='strict'): """ Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples...
[ "def", "decode", "(", "self", ",", "input", ",", "errors", "=", "'strict'", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/codecs.py#L157-L178
xhzdeng/crpn
a5aef0f80dbe486103123f740c634fb01e6cc9a1
caffe-fast-rcnn/scripts/cpp_lint.py
python
_CppLintState.PrintErrorCounts
(self)
Print a summary of errors by category, and the total.
Print a summary of errors by category, and the total.
[ "Print", "a", "summary", "of", "errors", "by", "category", "and", "the", "total", "." ]
def PrintErrorCounts(self): """Print a summary of errors by category, and the total.""" for category, count in iteritems(self.errors_by_category): sys.stderr.write('Category \'%s\' errors found: %d\n' % (category, count)) sys.stderr.write('Total errors found: %d\n' % self.error_...
[ "def", "PrintErrorCounts", "(", "self", ")", ":", "for", "category", ",", "count", "in", "iteritems", "(", "self", ".", "errors_by_category", ")", ":", "sys", ".", "stderr", ".", "write", "(", "'Category \\'%s\\' errors found: %d\\n'", "%", "(", "category", ",...
https://github.com/xhzdeng/crpn/blob/a5aef0f80dbe486103123f740c634fb01e6cc9a1/caffe-fast-rcnn/scripts/cpp_lint.py#L761-L766
luliyucoordinate/Leetcode
96afcdc54807d1d184e881a075d1dbf3371e31fb
src/0016-3Sum-Closest/0016.py
python
Solution.threeSumClosest
(self, nums, target)
return result[0]
:type nums: List[int] :type target: int :rtype: int
:type nums: List[int] :type target: int :rtype: int
[ ":", "type", "nums", ":", "List", "[", "int", "]", ":", "type", "target", ":", "int", ":", "rtype", ":", "int" ]
def threeSumClosest(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ result = list() nums.sort() for i,num in enumerate(nums[0:-2]): l, r = i + 1, len(nums) - 1 if nums[l] + nums[l + 1] + num > target...
[ "def", "threeSumClosest", "(", "self", ",", "nums", ",", "target", ")", ":", "result", "=", "list", "(", ")", "nums", ".", "sort", "(", ")", "for", "i", ",", "num", "in", "enumerate", "(", "nums", "[", "0", ":", "-", "2", "]", ")", ":", "l", ...
https://github.com/luliyucoordinate/Leetcode/blob/96afcdc54807d1d184e881a075d1dbf3371e31fb/src/0016-3Sum-Closest/0016.py#L2-L27
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/polynomial/hermite.py
python
hermvander3d
(x, y, z, deg)
return v.reshape(v.shape[:-3] + (-1,))
Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees `deg` and sample points `(x, y, z)`. If `l, m, n` are the given degrees in `x, y, z`, then The pseudo-Vandermonde matrix is defined by .. math:: V[..., (m+1)(n+1)i + (n+1)j + k] = H_i(x)*H_j(y)*H_k(z), wh...
Pseudo-Vandermonde matrix of given degrees.
[ "Pseudo", "-", "Vandermonde", "matrix", "of", "given", "degrees", "." ]
def hermvander3d(x, y, z, deg): """Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees `deg` and sample points `(x, y, z)`. If `l, m, n` are the given degrees in `x, y, z`, then The pseudo-Vandermonde matrix is defined by .. math:: V[..., (m+1)(n+1)i + (n+1...
[ "def", "hermvander3d", "(", "x", ",", "y", ",", "z", ",", "deg", ")", ":", "ideg", "=", "[", "int", "(", "d", ")", "for", "d", "in", "deg", "]", "is_valid", "=", "[", "id", "==", "d", "and", "id", ">=", "0", "for", "id", ",", "d", "in", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/polynomial/hermite.py#L1307-L1369
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
tools/doc/rename_folders.py
python
rename_folder
(root)
return renamed
Renames all folder starting with `_`. Returns the list of renamed folders.
Renames all folder starting with `_`. Returns the list of renamed folders.
[ "Renames", "all", "folder", "starting", "with", "_", ".", "Returns", "the", "list", "of", "renamed", "folders", "." ]
def rename_folder(root): """ Renames all folder starting with `_`. Returns the list of renamed folders. """ found = [] for r, dirs, files in os.walk(root): for name in dirs: if name.startswith('_'): found.append((r, name)) renamed = [] for r, name in f...
[ "def", "rename_folder", "(", "root", ")", ":", "found", "=", "[", "]", "for", "r", ",", "dirs", ",", "files", "in", "os", ".", "walk", "(", "root", ")", ":", "for", "name", "in", "dirs", ":", "if", "name", ".", "startswith", "(", "'_'", ")", ":...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/tools/doc/rename_folders.py#L10-L31
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/code_coverage/process_coverage.py
python
AddResults
(results, location, lines_total, lines_executed)
Add resulting line tallies to a location's total. Args: results: Map of node location to corresponding coverage data. location: Source node string. lines_total: Number of lines to add to the total count for this node. lines_executed: Number of lines to add to the executed count for this node.
Add resulting line tallies to a location's total.
[ "Add", "resulting", "line", "tallies", "to", "a", "location", "s", "total", "." ]
def AddResults(results, location, lines_total, lines_executed): """Add resulting line tallies to a location's total. Args: results: Map of node location to corresponding coverage data. location: Source node string. lines_total: Number of lines to add to the total count for this node. lines_executed...
[ "def", "AddResults", "(", "results", ",", "location", ",", "lines_total", ",", "lines_executed", ")", ":", "if", "results", ".", "has_key", "(", "location", ")", ":", "(", "i", ",", "e", ")", "=", "results", "[", "location", "]", "results", "[", "locat...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/code_coverage/process_coverage.py#L274-L287
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/util/response.py
python
assert_header_parsing
(headers)
Asserts whether all headers have been successfully parsed. Extracts encountered errors from the result of parsing headers. Only works on Python 3. :param http.client.HTTPMessage headers: Headers to verify. :raises urllib3.exceptions.HeaderParsingError: If parsing errors are found.
[]
def assert_header_parsing(headers): """ Asserts whether all headers have been successfully parsed. Extracts encountered errors from the result of parsing headers. Only works on Python 3. :param http.client.HTTPMessage headers: Headers to verify. :raises urllib3.exceptions.HeaderParsi...
[ "def", "assert_header_parsing", "(", "headers", ")", ":", "# This will fail silently if we pass in the wrong kind of parameter.", "# To make debugging easier add an explicit check.", "if", "not", "isinstance", "(", "headers", ",", "httplib", ".", "HTTPMessage", ")", ":", "raise...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/util/response.py#L79-L181
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/findertools.py
python
copy
(src, dstdir)
return finder.duplicate(src_fss, to=dst_fss)
Copy a file to a folder
Copy a file to a folder
[ "Copy", "a", "file", "to", "a", "folder" ]
def copy(src, dstdir): """Copy a file to a folder""" finder = _getfinder() if type(src) == type([]): src_fss = [] for s in src: src_fss.append(Carbon.File.FSSpec(s)) else: src_fss = Carbon.File.FSSpec(src) dst_fss = Carbon.File.FSSpec(dstdir) return finder.dup...
[ "def", "copy", "(", "src", ",", "dstdir", ")", ":", "finder", "=", "_getfinder", "(", ")", "if", "type", "(", "src", ")", "==", "type", "(", "[", "]", ")", ":", "src_fss", "=", "[", "]", "for", "s", "in", "src", ":", "src_fss", ".", "append", ...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/findertools.py#L57-L67
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
example/gluon/kaggle_k_fold_cross_validation.py
python
get_net
()
return net
Gets a neural network. Better results are obtained with modifications.
Gets a neural network. Better results are obtained with modifications.
[ "Gets", "a", "neural", "network", ".", "Better", "results", "are", "obtained", "with", "modifications", "." ]
def get_net(): """Gets a neural network. Better results are obtained with modifications.""" net = gluon.nn.Sequential() with net.name_scope(): net.add(gluon.nn.Dense(50, activation="relu")) net.add(gluon.nn.Dense(1)) net.initialize() return net
[ "def", "get_net", "(", ")", ":", "net", "=", "gluon", ".", "nn", ".", "Sequential", "(", ")", "with", "net", ".", "name_scope", "(", ")", ":", "net", ".", "add", "(", "gluon", ".", "nn", ".", "Dense", "(", "50", ",", "activation", "=", "\"relu\""...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/example/gluon/kaggle_k_fold_cross_validation.py#L73-L80
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/protobuf/python/mox.py
python
SameElementsAs.equals
(self, actual_seq)
return expected == actual
Check to see whether actual_seq has same elements as expected_seq. Args: actual_seq: sequence Returns: bool
Check to see whether actual_seq has same elements as expected_seq.
[ "Check", "to", "see", "whether", "actual_seq", "has", "same", "elements", "as", "expected_seq", "." ]
def equals(self, actual_seq): """Check to see whether actual_seq has same elements as expected_seq. Args: actual_seq: sequence Returns: bool """ try: expected = dict([(element, None) for element in self._expected_seq]) actual = dict([(element, None) for element in actual_s...
[ "def", "equals", "(", "self", ",", "actual_seq", ")", ":", "try", ":", "expected", "=", "dict", "(", "[", "(", "element", ",", "None", ")", "for", "element", "in", "self", ".", "_expected_seq", "]", ")", "actual", "=", "dict", "(", "[", "(", "eleme...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/protobuf/python/mox.py#L1021-L1040
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TUInt_GetUIntFromIpStr
(*args)
return _snap.TUInt_GetUIntFromIpStr(*args)
GetUIntFromIpStr(TStr IpStr, char const & SplitCh='.') -> uint Parameters: IpStr: TStr const & SplitCh: char const & TUInt_GetUIntFromIpStr(TStr IpStr) -> uint Parameters: IpStr: TStr const &
GetUIntFromIpStr(TStr IpStr, char const & SplitCh='.') -> uint
[ "GetUIntFromIpStr", "(", "TStr", "IpStr", "char", "const", "&", "SplitCh", "=", ".", ")", "-", ">", "uint" ]
def TUInt_GetUIntFromIpStr(*args): """ GetUIntFromIpStr(TStr IpStr, char const & SplitCh='.') -> uint Parameters: IpStr: TStr const & SplitCh: char const & TUInt_GetUIntFromIpStr(TStr IpStr) -> uint Parameters: IpStr: TStr const & """ return _snap.TUInt_GetUIntFromIpS...
[ "def", "TUInt_GetUIntFromIpStr", "(", "*", "args", ")", ":", "return", "_snap", ".", "TUInt_GetUIntFromIpStr", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L13931-L13945
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/xgboost/python-package/xgboost/plotting.py
python
to_graphviz
(booster, num_trees=0, rankdir='UT', yes_color='#0000FF', no_color='#FF0000', **kwargs)
return graph
Convert specified tree to graphviz instance. IPython can automatically plot the returned graphiz instance. Otherwise, you shoud call .render() method of the returned graphiz instance. Parameters ---------- booster : Booster, XGBModel Booster or XGBModel instance num_trees : int, default...
Convert specified tree to graphviz instance. IPython can automatically plot the returned graphiz instance. Otherwise, you shoud call .render() method of the returned graphiz instance.
[ "Convert", "specified", "tree", "to", "graphviz", "instance", ".", "IPython", "can", "automatically", "plot", "the", "returned", "graphiz", "instance", ".", "Otherwise", "you", "shoud", "call", ".", "render", "()", "method", "of", "the", "returned", "graphiz", ...
def to_graphviz(booster, num_trees=0, rankdir='UT', yes_color='#0000FF', no_color='#FF0000', **kwargs): """Convert specified tree to graphviz instance. IPython can automatically plot the returned graphiz instance. Otherwise, you shoud call .render() method of the returned graphiz instance. ...
[ "def", "to_graphviz", "(", "booster", ",", "num_trees", "=", "0", ",", "rankdir", "=", "'UT'", ",", "yes_color", "=", "'#0000FF'", ",", "no_color", "=", "'#FF0000'", ",", "*", "*", "kwargs", ")", ":", "try", ":", "from", "graphviz", "import", "Digraph", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/xgboost/python-package/xgboost/plotting.py#L148-L203
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ssl.py
python
SSLSocket.read
(self, len=1024, buffer=None)
Read up to LEN bytes and return them. Return zero-length string on EOF.
Read up to LEN bytes and return them. Return zero-length string on EOF.
[ "Read", "up", "to", "LEN", "bytes", "and", "return", "them", ".", "Return", "zero", "-", "length", "string", "on", "EOF", "." ]
def read(self, len=1024, buffer=None): """Read up to LEN bytes and return them. Return zero-length string on EOF.""" self._checkClosed() if self._sslobj is None: raise ValueError("Read on closed or unwrapped SSL socket.") try: if buffer is not None: ...
[ "def", "read", "(", "self", ",", "len", "=", "1024", ",", "buffer", "=", "None", ")", ":", "self", ".", "_checkClosed", "(", ")", "if", "self", ".", "_sslobj", "is", "None", ":", "raise", "ValueError", "(", "\"Read on closed or unwrapped SSL socket.\"", ")...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ssl.py#L920-L939
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
python
NinjaWriter.WriteWinIdlFiles
(self, spec, prebuild)
return outputs
Writes rules to match MSVS's implicit idl handling.
Writes rules to match MSVS's implicit idl handling.
[ "Writes", "rules", "to", "match", "MSVS", "s", "implicit", "idl", "handling", "." ]
def WriteWinIdlFiles(self, spec, prebuild): """Writes rules to match MSVS's implicit idl handling.""" assert self.flavor == 'win' if self.msvs_settings.HasExplicitIdlRulesOrActions(spec): return [] outputs = [] for source in filter(lambda x: x.endswith('.idl'), spec['sources']): self._Wi...
[ "def", "WriteWinIdlFiles", "(", "self", ",", "spec", ",", "prebuild", ")", ":", "assert", "self", ".", "flavor", "==", "'win'", "if", "self", ".", "msvs_settings", ".", "HasExplicitIdlRulesOrActions", "(", "spec", ")", ":", "return", "[", "]", "outputs", "...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L528-L536
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py
python
ShapeEquivSet._get_shape
(self, name)
return tuple(shape)
Return a tuple of variables that corresponds to the shape of the given array, or raise GuardException if not found.
Return a tuple of variables that corresponds to the shape of the given array, or raise GuardException if not found.
[ "Return", "a", "tuple", "of", "variables", "that", "corresponds", "to", "the", "shape", "of", "the", "given", "array", "or", "raise", "GuardException", "if", "not", "found", "." ]
def _get_shape(self, name): """Return a tuple of variables that corresponds to the shape of the given array, or raise GuardException if not found. """ inds = self.get_shape_classes(name) require (inds != ()) shape = [] for i in inds: require(i in self....
[ "def", "_get_shape", "(", "self", ",", "name", ")", ":", "inds", "=", "self", ".", "get_shape_classes", "(", "name", ")", "require", "(", "inds", "!=", "(", ")", ")", "shape", "=", "[", "]", "for", "i", "in", "inds", ":", "require", "(", "i", "in...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/array_analysis.py#L539-L555
potassco/clingo
e0c91d8f95cc28de1c480a871f9c97c30de83d40
libpyclingo/clingo/propagator.py
python
Assignment.is_total
(self)
return _lib.clingo_assignment_is_total(self._rep)
Whether the assignment is total.
Whether the assignment is total.
[ "Whether", "the", "assignment", "is", "total", "." ]
def is_total(self) -> bool: ''' Whether the assignment is total. ''' return _lib.clingo_assignment_is_total(self._rep)
[ "def", "is_total", "(", "self", ")", "->", "bool", ":", "return", "_lib", ".", "clingo_assignment_is_total", "(", "self", ".", "_rep", ")" ]
https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/propagator.py#L250-L254
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextParagraph.ClearUnusedLines
(*args, **kwargs)
return _richtext.RichTextParagraph_ClearUnusedLines(*args, **kwargs)
ClearUnusedLines(self, int lineCount) -> bool
ClearUnusedLines(self, int lineCount) -> bool
[ "ClearUnusedLines", "(", "self", "int", "lineCount", ")", "-", ">", "bool" ]
def ClearUnusedLines(*args, **kwargs): """ClearUnusedLines(self, int lineCount) -> bool""" return _richtext.RichTextParagraph_ClearUnusedLines(*args, **kwargs)
[ "def", "ClearUnusedLines", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextParagraph_ClearUnusedLines", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L2039-L2041
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/peakmeter.py
python
PeakMeterCtrl.IsStarted
(self)
return self._timer.IsRunning()
Check if animation is active.
Check if animation is active.
[ "Check", "if", "animation", "is", "active", "." ]
def IsStarted(self): """ Check if animation is active. """ return self._timer.IsRunning()
[ "def", "IsStarted", "(", "self", ")", ":", "return", "self", ".", "_timer", ".", "IsRunning", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/peakmeter.py#L580-L583
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/index.py
python
RangeIndex.get_slice_bound
(self, label, side, kind=None)
return pos
Calculate slice bound that corresponds to given label. Returns leftmost (one-past-the-rightmost if ``side=='right'``) position of given label. Parameters ---------- label : int A valid value in the ``RangeIndex`` side : {'left', 'right'} kind : Unused...
Calculate slice bound that corresponds to given label. Returns leftmost (one-past-the-rightmost if ``side=='right'``) position of given label.
[ "Calculate", "slice", "bound", "that", "corresponds", "to", "given", "label", ".", "Returns", "leftmost", "(", "one", "-", "past", "-", "the", "-", "rightmost", "if", "side", "==", "right", ")", "position", "of", "given", "label", "." ]
def get_slice_bound(self, label, side, kind=None): """ Calculate slice bound that corresponds to given label. Returns leftmost (one-past-the-rightmost if ``side=='right'``) position of given label. Parameters ---------- label : int A valid value in th...
[ "def", "get_slice_bound", "(", "self", ",", "label", ",", "side", ",", "kind", "=", "None", ")", ":", "if", "side", "not", "in", "{", "\"left\"", ",", "\"right\"", "}", ":", "raise", "ValueError", "(", "f\"Unrecognized side parameter: {side}\"", ")", "if", ...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/index.py#L451-L483
QMCPACK/qmcpack
d0948ab455e38364458740cc8e2239600a14c5cd
nexus/lib/grid_functions.py
python
ParallelotopeGrid.points_from_unit
(self,upoints)
return points
(`External API`) Map points from the unit space back into the full space. Parameters ---------- upoints : `array_like, float, shape (N,dg), optional` Array of points in the unit coordinate space. `N` is the number of points and `dg` must be equal to `grid_dim`. ...
(`External API`) Map points from the unit space back into the full space.
[ "(", "External", "API", ")", "Map", "points", "from", "the", "unit", "space", "back", "into", "the", "full", "space", "." ]
def points_from_unit(self,upoints): """ (`External API`) Map points from the unit space back into the full space. Parameters ---------- upoints : `array_like, float, shape (N,dg), optional` Array of points in the unit coordinate space. `N` is the number ...
[ "def", "points_from_unit", "(", "self", ",", "upoints", ")", ":", "points", "=", "np", ".", "dot", "(", "upoints", ",", "self", ".", "axes", ")", "+", "self", ".", "corner", "return", "points" ]
https://github.com/QMCPACK/qmcpack/blob/d0948ab455e38364458740cc8e2239600a14c5cd/nexus/lib/grid_functions.py#L2328-L2345
trailofbits/llvm-sanitizer-tutorial
d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99
llvm/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
IsBlankLine
(line)
return not line or line.isspace()
Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank.
Returns true if the given line is blank.
[ "Returns", "true", "if", "the", "given", "line", "is", "blank", "." ]
def IsBlankLine(line): """Returns true if the given line is blank. We consider a line to be blank if the line is empty or consists of only white spaces. Args: line: A line of a string. Returns: True, if the given line is blank. """ return not line or line.isspace()
[ "def", "IsBlankLine", "(", "line", ")", ":", "return", "not", "line", "or", "line", ".", "isspace", "(", ")" ]
https://github.com/trailofbits/llvm-sanitizer-tutorial/blob/d29dfeec7f51fbf234fd0080f28f2b30cd0b6e99/llvm/projects/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1924-L1936
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/parallel.py
python
build_gufunc_kernel
(library, ctx, info, sig, inner_ndim)
return _wrapper_info(library=wrapperlib, name=lfunc.name, env=info.env)
Wrap the original CPU ufunc/gufunc with a parallel dispatcher. This function will wrap gufuncs and ufuncs something like. Args ---- ctx numba's codegen context info: (library, env, name) inner function info sig type signature of the gufunc inner_ndim inner...
Wrap the original CPU ufunc/gufunc with a parallel dispatcher. This function will wrap gufuncs and ufuncs something like.
[ "Wrap", "the", "original", "CPU", "ufunc", "/", "gufunc", "with", "a", "parallel", "dispatcher", ".", "This", "function", "will", "wrap", "gufuncs", "and", "ufuncs", "something", "like", "." ]
def build_gufunc_kernel(library, ctx, info, sig, inner_ndim): """Wrap the original CPU ufunc/gufunc with a parallel dispatcher. This function will wrap gufuncs and ufuncs something like. Args ---- ctx numba's codegen context info: (library, env, name) inner function info s...
[ "def", "build_gufunc_kernel", "(", "library", ",", "ctx", ",", "info", ",", "sig", ",", "inner_ndim", ")", ":", "assert", "isinstance", "(", "info", ",", "tuple", ")", "# guard against old usage", "# Declare types and function", "byte_t", "=", "lc", ".", "Type",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/parallel.py#L45-L161
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/status/module.py
python
Module.handle_osd_status
(self, bucket: Optional[str] = None)
return 0, osd_table.get_string(), ""
Show the status of OSDs within a bucket, or all
Show the status of OSDs within a bucket, or all
[ "Show", "the", "status", "of", "OSDs", "within", "a", "bucket", "or", "all" ]
def handle_osd_status(self, bucket: Optional[str] = None) -> Tuple[int, str, str]: """ Show the status of OSDs within a bucket, or all """ osd_table = PrettyTable(['ID', 'HOST', 'USED', 'AVAIL', 'WR OPS', 'WR DATA', 'RD OPS', 'RD DATA', 'STATE'], ...
[ "def", "handle_osd_status", "(", "self", ",", "bucket", ":", "Optional", "[", "str", "]", "=", "None", ")", "->", "Tuple", "[", "int", ",", "str", ",", "str", "]", ":", "osd_table", "=", "PrettyTable", "(", "[", "'ID'", ",", "'HOST'", ",", "'USED'", ...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/status/module.py#L282-L353
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/core.py
python
Net.__init__
(self, name_or_proto, inplace=False)
Create a Net. Args: name_or_proto: If a NetDef is provided, clone it (or take ownership, depending on the value of `inplace`). Otherwise, create an empty net with the given name. inplace: If a NetDef is provided, take ownership whe...
Create a Net. Args: name_or_proto: If a NetDef is provided, clone it (or take ownership, depending on the value of `inplace`). Otherwise, create an empty net with the given name. inplace: If a NetDef is provided, take ownership whe...
[ "Create", "a", "Net", ".", "Args", ":", "name_or_proto", ":", "If", "a", "NetDef", "is", "provided", "clone", "it", "(", "or", "take", "ownership", "depending", "on", "the", "value", "of", "inplace", ")", ".", "Otherwise", "create", "an", "empty", "net",...
def __init__(self, name_or_proto, inplace=False): """ Create a Net. Args: name_or_proto: If a NetDef is provided, clone it (or take ownership, depending on the value of `inplace`). Otherwise, create an empty net with the given ...
[ "def", "__init__", "(", "self", ",", "name_or_proto", ",", "inplace", "=", "False", ")", ":", "self", ".", "_input_record", "=", "None", "self", ".", "_output_record", "=", "None", "# Register blobs so that it's guaranteed that different calls to", "# NextBlob/NextScope...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/core.py#L1472-L1537
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/aui/auibar.py
python
AuiToolBar.FindToolForPosition
(self, x, y)
return None
Finds a tool for the given mouse position. :param integer `x`: mouse `x` position; :param integer `y`: mouse `y` position. :returns: a pointer to a :class:`AuiToolBarItem` if a tool is found, or ``None`` otherwise.
Finds a tool for the given mouse position.
[ "Finds", "a", "tool", "for", "the", "given", "mouse", "position", "." ]
def FindToolForPosition(self, x, y): """ Finds a tool for the given mouse position. :param integer `x`: mouse `x` position; :param integer `y`: mouse `y` position. :returns: a pointer to a :class:`AuiToolBarItem` if a tool is found, or ``None`` otherwise. """ f...
[ "def", "FindToolForPosition", "(", "self", ",", "x", ",", "y", ")", ":", "for", "i", ",", "item", "in", "enumerate", "(", "self", ".", "_items", ")", ":", "if", "not", "item", ".", "sizer_item", ":", "continue", "rect", "=", "item", ".", "sizer_item"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/aui/auibar.py#L2106-L2129
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/slot_creator.py
python
_create_slot_var
(primary, val, scope)
return slot
Helper function for creating a slot variable.
Helper function for creating a slot variable.
[ "Helper", "function", "for", "creating", "a", "slot", "variable", "." ]
def _create_slot_var(primary, val, scope): """Helper function for creating a slot variable.""" slot = variables.Variable(val, name=scope, trainable=False) # pylint: disable=protected-access if isinstance(primary, variables.Variable) and primary._save_slice_info: # Primary is a partitioned variable, so we n...
[ "def", "_create_slot_var", "(", "primary", ",", "val", ",", "scope", ")", ":", "slot", "=", "variables", ".", "Variable", "(", "val", ",", "name", "=", "scope", ",", "trainable", "=", "False", ")", "# pylint: disable=protected-access", "if", "isinstance", "(...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/slot_creator.py#L47-L64
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
TerrainModel.getID
(self)
return _robotsim.TerrainModel_getID(self)
r""" Returns the ID of the terrain in its world. .. note:: The world ID is not the same as the terrain index.
r""" Returns the ID of the terrain in its world.
[ "r", "Returns", "the", "ID", "of", "the", "terrain", "in", "its", "world", "." ]
def getID(self) ->int: r""" Returns the ID of the terrain in its world. .. note:: The world ID is not the same as the terrain index. """ return _robotsim.TerrainModel_getID(self)
[ "def", "getID", "(", "self", ")", "->", "int", ":", "return", "_robotsim", ".", "TerrainModel_getID", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L5518-L5526
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distribution/kl.py
python
_kl_expfamily_expfamily
(p, q)
return kl
Compute kl-divergence using `Bregman divergences <https://www.lix.polytechnique.fr/~nielsen/EntropyEF-ICIP2010.pdf>`_
Compute kl-divergence using `Bregman divergences <https://www.lix.polytechnique.fr/~nielsen/EntropyEF-ICIP2010.pdf>`_
[ "Compute", "kl", "-", "divergence", "using", "Bregman", "divergences", "<https", ":", "//", "www", ".", "lix", ".", "polytechnique", ".", "fr", "/", "~nielsen", "/", "EntropyEF", "-", "ICIP2010", ".", "pdf", ">", "_" ]
def _kl_expfamily_expfamily(p, q): """Compute kl-divergence using `Bregman divergences <https://www.lix.polytechnique.fr/~nielsen/EntropyEF-ICIP2010.pdf>`_ """ if not type(p) == type(q): raise NotImplementedError p_natural_params = [] for param in p._natural_parameters: param = para...
[ "def", "_kl_expfamily_expfamily", "(", "p", ",", "q", ")", ":", "if", "not", "type", "(", "p", ")", "==", "type", "(", "q", ")", ":", "raise", "NotImplementedError", "p_natural_params", "=", "[", "]", "for", "param", "in", "p", ".", "_natural_parameters"...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distribution/kl.py#L172-L206
root-project/root
fcd3583bb14852bf2e8cd2415717cbaac0e75896
interpreter/llvm/src/tools/clang/bindings/python/clang/cindex.py
python
Cursor.is_pure_virtual_method
(self)
return conf.lib.clang_CXXMethod_isPureVirtual(self)
Returns True if the cursor refers to a C++ member function or member function template that is declared pure virtual.
Returns True if the cursor refers to a C++ member function or member function template that is declared pure virtual.
[ "Returns", "True", "if", "the", "cursor", "refers", "to", "a", "C", "++", "member", "function", "or", "member", "function", "template", "that", "is", "declared", "pure", "virtual", "." ]
def is_pure_virtual_method(self): """Returns True if the cursor refers to a C++ member function or member function template that is declared pure virtual. """ return conf.lib.clang_CXXMethod_isPureVirtual(self)
[ "def", "is_pure_virtual_method", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_CXXMethod_isPureVirtual", "(", "self", ")" ]
https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/interpreter/llvm/src/tools/clang/bindings/python/clang/cindex.py#L1482-L1486
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/profiler/model_analyzer.py
python
_build_advisor_options
(options)
return opts
Build tfprof.AdvisorOptionsProto. Args: options: A dictionary of options. See ALL_ADVICE example. Returns: tfprof.AdvisorOptionsProto.
Build tfprof.AdvisorOptionsProto.
[ "Build", "tfprof", ".", "AdvisorOptionsProto", "." ]
def _build_advisor_options(options): """Build tfprof.AdvisorOptionsProto. Args: options: A dictionary of options. See ALL_ADVICE example. Returns: tfprof.AdvisorOptionsProto. """ opts = tfprof_options_pb2.AdvisorOptionsProto() if options is None: return opts for checker, checker_opts in six.i...
[ "def", "_build_advisor_options", "(", "options", ")", ":", "opts", "=", "tfprof_options_pb2", ".", "AdvisorOptionsProto", "(", ")", "if", "options", "is", "None", ":", "return", "opts", "for", "checker", ",", "checker_opts", "in", "six", ".", "iteritems", "(",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/profiler/model_analyzer.py#L93-L109
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/deps/v8/third_party/jinja2/lexer.py
python
Lexer.tokenize
(self, source, name=None, filename=None, state=None)
return TokenStream(self.wrap(stream, name, filename), name, filename)
Calls tokeniter + tokenize and wraps it in a token stream.
Calls tokeniter + tokenize and wraps it in a token stream.
[ "Calls", "tokeniter", "+", "tokenize", "and", "wraps", "it", "in", "a", "token", "stream", "." ]
def tokenize(self, source, name=None, filename=None, state=None): """Calls tokeniter + tokenize and wraps it in a token stream. """ stream = self.tokeniter(source, name, filename, state) return TokenStream(self.wrap(stream, name, filename), name, filename)
[ "def", "tokenize", "(", "self", ",", "source", ",", "name", "=", "None", ",", "filename", "=", "None", ",", "state", "=", "None", ")", ":", "stream", "=", "self", ".", "tokeniter", "(", "source", ",", "name", ",", "filename", ",", "state", ")", "re...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/lexer.py#L552-L556
borglab/gtsam
a5bee157efce6a0563704bce6a5d188c29817f39
gtsam/3rdparty/GeographicLib/python/geographiclib/geomath.py
python
Math.atan2d
(y, x)
return ang
compute atan2(y, x) with the result in degrees
compute atan2(y, x) with the result in degrees
[ "compute", "atan2", "(", "y", "x", ")", "with", "the", "result", "in", "degrees" ]
def atan2d(y, x): """compute atan2(y, x) with the result in degrees""" if abs(y) > abs(x): q = 2; x, y = y, x else: q = 0 if x < 0: q += 1; x = -x ang = math.degrees(math.atan2(y, x)) if q == 1: ang = (180 if y >= 0 else -180) - ang elif q == 2: ang = 90 - ang...
[ "def", "atan2d", "(", "y", ",", "x", ")", ":", "if", "abs", "(", "y", ")", ">", "abs", "(", "x", ")", ":", "q", "=", "2", "x", ",", "y", "=", "y", ",", "x", "else", ":", "q", "=", "0", "if", "x", "<", "0", ":", "q", "+=", "1", "x", ...
https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/gtsam/3rdparty/GeographicLib/python/geographiclib/geomath.py#L177-L193
pyne/pyne
0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3
pyne/xs/data_source.py
python
EAFDataSource._load_reaction
(self, nuc, rx, temp=300.0)
return rxdata
Loads reaction specific data for EAF. Parameters ---------- nuc : int Nuclide id. rx : int Reaction id. temp : float, optional The material temperature Notes ----- EAF data does not use temperature information (temp).
Loads reaction specific data for EAF.
[ "Loads", "reaction", "specific", "data", "for", "EAF", "." ]
def _load_reaction(self, nuc, rx, temp=300.0): """Loads reaction specific data for EAF. Parameters ---------- nuc : int Nuclide id. rx : int Reaction id. temp : float, optional The material temperature Notes ----- ...
[ "def", "_load_reaction", "(", "self", ",", "nuc", ",", "rx", ",", "temp", "=", "300.0", ")", ":", "absrx", "=", "rxname", ".", "id", "(", "'absorption'", ")", "if", "rx", "in", "self", ".", "_rx_avail", ":", "if", "py3k", "is", "True", ":", "cond",...
https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/xs/data_source.py#L641-L688
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/idl_parser/idl_parser.py
python
IDLParser.p_ExtendedAttributeList
(self, p)
ExtendedAttributeList : Comments '[' ExtendedAttribute ExtendedAttributes ']' | Comments
ExtendedAttributeList : Comments '[' ExtendedAttribute ExtendedAttributes ']' | Comments
[ "ExtendedAttributeList", ":", "Comments", "[", "ExtendedAttribute", "ExtendedAttributes", "]", "|", "Comments" ]
def p_ExtendedAttributeList(self, p): """ExtendedAttributeList : Comments '[' ExtendedAttribute ExtendedAttributes ']' | Comments """ if len(p) > 2: items = ListFromConcat(p[3], p[4]) attribs = self.BuildProduction('ExtAttributes', p, 2, items) p[0] = ListFromConca...
[ "def", "p_ExtendedAttributeList", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", ">", "2", ":", "items", "=", "ListFromConcat", "(", "p", "[", "3", "]", ",", "p", "[", "4", "]", ")", "attribs", "=", "self", ".", "BuildProduction", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/idl_parser/idl_parser.py#L597-L605
Tau-Coin/tautcoin
b40dd5ebae49ccecbbf77cc0289b747fd1764219
contrib/devtools/security-check.py
python
check_PE_PIE
(executable)
return bool(get_PE_dll_characteristics(executable) & 0x40)
PIE: DllCharacteristics bit 0x40 signifies dynamicbase (ASLR)
PIE: DllCharacteristics bit 0x40 signifies dynamicbase (ASLR)
[ "PIE", ":", "DllCharacteristics", "bit", "0x40", "signifies", "dynamicbase", "(", "ASLR", ")" ]
def check_PE_PIE(executable): '''PIE: DllCharacteristics bit 0x40 signifies dynamicbase (ASLR)''' return bool(get_PE_dll_characteristics(executable) & 0x40)
[ "def", "check_PE_PIE", "(", "executable", ")", ":", "return", "bool", "(", "get_PE_dll_characteristics", "(", "executable", ")", "&", "0x40", ")" ]
https://github.com/Tau-Coin/tautcoin/blob/b40dd5ebae49ccecbbf77cc0289b747fd1764219/contrib/devtools/security-check.py#L130-L132
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
Alignment/MuonAlignment/python/svgfig.py
python
window
(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
return output
Creates and returns a coordinate transformation (a function that accepts two arguments and returns two values) that transforms from (xmin, ymin), (xmax, ymax) to (x, y), (x + width, y + height). xlogbase, ylogbase default=None, None if a number, transform ...
Creates and returns a coordinate transformation (a function that accepts two arguments and returns two values) that transforms from (xmin, ymin), (xmax, ymax) to (x, y), (x + width, y + height).
[ "Creates", "and", "returns", "a", "coordinate", "transformation", "(", "a", "function", "that", "accepts", "two", "arguments", "and", "returns", "two", "values", ")", "that", "transforms", "from", "(", "xmin", "ymin", ")", "(", "xmax", "ymax", ")", "to", "...
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True): """Creates and returns a coordinate transformation (a function that accepts two arguments and returns two values) that transforms from (xmin, ymin), (xmax, ymax) t...
[ "def", "window", "(", "xmin", ",", "xmax", ",", "ymin", ",", "ymax", ",", "x", "=", "0", ",", "y", "=", "0", ",", "width", "=", "100", ",", "height", "=", "100", ",", "xlogbase", "=", "None", ",", "ylogbase", "=", "None", ",", "minusInfinity", ...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/Alignment/MuonAlignment/python/svgfig.py#L643-L703
cmu-db/noisepage
79276e68fe83322f1249e8a8be96bd63c583ae56
script/self_driving/model_server.py
python
ModelServer._infer
(self, data: Dict)
return result
Do inference on the model :param data: { type: model type model_path: model path ... } :return: {List of predictions, if inference succeeds, error message}
Do inference on the model :param data: { type: model type model_path: model path ... } :return: {List of predictions, if inference succeeds, error message}
[ "Do", "inference", "on", "the", "model", ":", "param", "data", ":", "{", "type", ":", "model", "type", "model_path", ":", "model", "path", "...", "}", ":", "return", ":", "{", "List", "of", "predictions", "if", "inference", "succeeds", "error", "message"...
def _infer(self, data: Dict) -> Tuple[List, bool, str]: """ Do inference on the model :param data: { type: model type model_path: model path ... } :return: {List of predictions, if inference succeeds, error message} """ model_ty...
[ "def", "_infer", "(", "self", ",", "data", ":", "Dict", ")", "->", "Tuple", "[", "List", ",", "bool", ",", "str", "]", ":", "model_type", "=", "data", "[", "\"type\"", "]", "result", "=", "self", ".", "model_managers", "[", "ModelType", "[", "model_t...
https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/script/self_driving/model_server.py#L714-L726
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Build.py
python
BuildContext.__copy__
(self)
Build contexts cannot be copied :raises: :py:class:`waflib.Errors.WafError`
Build contexts cannot be copied
[ "Build", "contexts", "cannot", "be", "copied" ]
def __copy__(self): """ Build contexts cannot be copied :raises: :py:class:`waflib.Errors.WafError` """ raise Errors.WafError('build contexts cannot be copied')
[ "def", "__copy__", "(", "self", ")", ":", "raise", "Errors", ".", "WafError", "(", "'build contexts cannot be copied'", ")" ]
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Build.py#L178-L184
sphinxsearch/sphinx
409f2c2b5b2ff70b04e38f92b6b1a890326bad65
api/sphinxapi.py
python
SphinxClient._Send
( self, sock, req )
return total
INTERNAL METHOD, DO NOT CALL. send request to searchd server.
INTERNAL METHOD, DO NOT CALL. send request to searchd server.
[ "INTERNAL", "METHOD", "DO", "NOT", "CALL", ".", "send", "request", "to", "searchd", "server", "." ]
def _Send ( self, sock, req ): """ INTERNAL METHOD, DO NOT CALL. send request to searchd server. """ total = 0 while True: sent = sock.send ( req[total:] ) if sent<=0: break total = total + sent return total
[ "def", "_Send", "(", "self", ",", "sock", ",", "req", ")", ":", "total", "=", "0", "while", "True", ":", "sent", "=", "sock", ".", "send", "(", "req", "[", "total", ":", "]", ")", "if", "sent", "<=", "0", ":", "break", "total", "=", "total", ...
https://github.com/sphinxsearch/sphinx/blob/409f2c2b5b2ff70b04e38f92b6b1a890326bad65/api/sphinxapi.py#L327-L339
omnisci/omniscidb
b9c95f1bd602b4ffc8b0edf18bfad61031e08d86
Benchmarks/run_benchmark.py
python
get_gpu_info
(**kwargs)
return gpu_info
Gets run machine GPU info Kwargs: gpu_name(str): GPU name from input param no_gather_conn_gpu_info(bool): Gather GPU info fields con(class 'pymapd.connection.Connection'): Mapd connection conn_machine_name(str): Name of run machine no_gather_nvml_gpu_info(bool): Do not gat...
Gets run machine GPU info
[ "Gets", "run", "machine", "GPU", "info" ]
def get_gpu_info(**kwargs): """ Gets run machine GPU info Kwargs: gpu_name(str): GPU name from input param no_gather_conn_gpu_info(bool): Gather GPU info fields con(class 'pymapd.connection.Connection'): Mapd connection conn_machine_name(str): Name of run machine ...
[ "def", "get_gpu_info", "(", "*", "*", "kwargs", ")", ":", "# Set GPU info fields", "conn_gpu_count", "=", "None", "source_db_gpu_count", "=", "None", "source_db_gpu_mem", "=", "None", "source_db_gpu_driver_ver", "=", "\"\"", "source_db_gpu_name", "=", "\"\"", "if", ...
https://github.com/omnisci/omniscidb/blob/b9c95f1bd602b4ffc8b0edf18bfad61031e08d86/Benchmarks/run_benchmark.py#L134-L232
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
build/pymake/pymake/data.py
python
Target.resolveimplicitrule
(self, makefile, targetstack, rulestack)
Try to resolve an implicit rule to build this target.
Try to resolve an implicit rule to build this target.
[ "Try", "to", "resolve", "an", "implicit", "rule", "to", "build", "this", "target", "." ]
def resolveimplicitrule(self, makefile, targetstack, rulestack): """ Try to resolve an implicit rule to build this target. """ # The steps in the GNU make manual Implicit-Rule-Search.html are very detailed. I hope they can be trusted. indent = getindent(targetstack) _lo...
[ "def", "resolveimplicitrule", "(", "self", ",", "makefile", ",", "targetstack", ",", "rulestack", ")", ":", "# The steps in the GNU make manual Implicit-Rule-Search.html are very detailed. I hope they can be trusted.", "indent", "=", "getindent", "(", "targetstack", ")", "_log"...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/pymake/pymake/data.py#L1015-L1087
Floydlang/floyd
b7070c73d58d3caf15bbcedf3d4f882db893917b
compiler/libs/benchmark/tools/gbench/report.py
python
find_longest_name
(benchmark_list)
return longest_name
Return the length of the longest benchmark name in a given list of benchmark JSON objects
Return the length of the longest benchmark name in a given list of benchmark JSON objects
[ "Return", "the", "length", "of", "the", "longest", "benchmark", "name", "in", "a", "given", "list", "of", "benchmark", "JSON", "objects" ]
def find_longest_name(benchmark_list): """ Return the length of the longest benchmark name in a given list of benchmark JSON objects """ longest_name = 1 for bc in benchmark_list: if len(bc['name']) > longest_name: longest_name = len(bc['name']) return longest_name
[ "def", "find_longest_name", "(", "benchmark_list", ")", ":", "longest_name", "=", "1", "for", "bc", "in", "benchmark_list", ":", "if", "len", "(", "bc", "[", "'name'", "]", ")", ">", "longest_name", ":", "longest_name", "=", "len", "(", "bc", "[", "'name...
https://github.com/Floydlang/floyd/blob/b7070c73d58d3caf15bbcedf3d4f882db893917b/compiler/libs/benchmark/tools/gbench/report.py#L59-L68