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
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/engine/training_v1.py
python
Model._prepare_sample_weights
(self, sample_weights=None)
Sets sample weight attribute on the model.
Sets sample weight attribute on the model.
[ "Sets", "sample", "weight", "attribute", "on", "the", "model", "." ]
def _prepare_sample_weights(self, sample_weights=None): """Sets sample weight attribute on the model.""" # List with the same length as model outputs. if sample_weights is not None: if len(sample_weights) != len(self._training_endpoints): raise ValueError('Provided sample weights must have sam...
[ "def", "_prepare_sample_weights", "(", "self", ",", "sample_weights", "=", "None", ")", ":", "# List with the same length as model outputs.", "if", "sample_weights", "is", "not", "None", ":", "if", "len", "(", "sample_weights", ")", "!=", "len", "(", "self", ".", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/engine/training_v1.py#L1774-L1786
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
current/deps/v8/third_party/jinja2/environment.py
python
Environment.call_test
(self, name, value, args=None, kwargs=None)
return func(value, *(args or ()), **(kwargs or {}))
Invokes a test on a value the same way the compiler does it. .. versionadded:: 2.7
Invokes a test on a value the same way the compiler does it.
[ "Invokes", "a", "test", "on", "a", "value", "the", "same", "way", "the", "compiler", "does", "it", "." ]
def call_test(self, name, value, args=None, kwargs=None): """Invokes a test on a value the same way the compiler does it. .. versionadded:: 2.7 """ func = self.tests.get(name) if func is None: fail_for_missing_callable('no test named %r', name) return func(va...
[ "def", "call_test", "(", "self", ",", "name", ",", "value", ",", "args", "=", "None", ",", "kwargs", "=", "None", ")", ":", "func", "=", "self", ".", "tests", ".", "get", "(", "name", ")", "if", "func", "is", "None", ":", "fail_for_missing_callable",...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/current/deps/v8/third_party/jinja2/environment.py#L469-L477
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py
python
getdata
(a, subok=True)
return data
Return the data of a masked array as an ndarray. Return the data of `a` (if any) as an ndarray if `a` is a ``MaskedArray``, else return `a` as a ndarray or subclass (depending on `subok`) if not. Parameters ---------- a : array_like Input ``MaskedArray``, alternatively a ndarray or a subcl...
Return the data of a masked array as an ndarray.
[ "Return", "the", "data", "of", "a", "masked", "array", "as", "an", "ndarray", "." ]
def getdata(a, subok=True): """ Return the data of a masked array as an ndarray. Return the data of `a` (if any) as an ndarray if `a` is a ``MaskedArray``, else return `a` as a ndarray or subclass (depending on `subok`) if not. Parameters ---------- a : array_like Input ``MaskedArr...
[ "def", "getdata", "(", "a", ",", "subok", "=", "True", ")", ":", "try", ":", "data", "=", "a", ".", "_data", "except", "AttributeError", ":", "data", "=", "np", ".", "array", "(", "a", ",", "copy", "=", "False", ",", "subok", "=", "subok", ")", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/ma/core.py#L677-L725
timi-liuliang/echo
40a5a24d430eee4118314459ab7e03afcb3b8719
thirdparty/protobuf/python/google/protobuf/descriptor_pool.py
python
DescriptorPool.FindFileContainingSymbol
(self, symbol)
return self._ConvertFileProtoToFileDescriptor(file_proto)
Gets the FileDescriptor for the file containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file can not be found in the pool.
Gets the FileDescriptor for the file containing the specified symbol.
[ "Gets", "the", "FileDescriptor", "for", "the", "file", "containing", "the", "specified", "symbol", "." ]
def FindFileContainingSymbol(self, symbol): """Gets the FileDescriptor for the file containing the specified symbol. Args: symbol: The name of the symbol to search for. Returns: A FileDescriptor that contains the specified symbol. Raises: KeyError: if the file can not be found in th...
[ "def", "FindFileContainingSymbol", "(", "self", ",", "symbol", ")", ":", "symbol", "=", "_NormalizeFullyQualifiedName", "(", "symbol", ")", "try", ":", "return", "self", ".", "_descriptors", "[", "symbol", "]", ".", "file", "except", "KeyError", ":", "pass", ...
https://github.com/timi-liuliang/echo/blob/40a5a24d430eee4118314459ab7e03afcb3b8719/thirdparty/protobuf/python/google/protobuf/descriptor_pool.py#L188-L222
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMS_CLOCK_INFO.toTpm
(self, buf)
TpmMarshaller method
TpmMarshaller method
[ "TpmMarshaller", "method" ]
def toTpm(self, buf): """ TpmMarshaller method """ buf.writeInt64(self.clock) buf.writeInt(self.resetCount) buf.writeInt(self.restartCount) buf.writeByte(self.safe)
[ "def", "toTpm", "(", "self", ",", "buf", ")", ":", "buf", ".", "writeInt64", "(", "self", ".", "clock", ")", "buf", ".", "writeInt", "(", "self", ".", "resetCount", ")", "buf", ".", "writeInt", "(", "self", ".", "restartCount", ")", "buf", ".", "wr...
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L4996-L5001
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py
python
Flag._WriteCustomInfoInXMLFormat
(self, outfile, indent)
Writes extra info about this flag, in XML format. "Extra" means "not already printed by WriteInfoInXMLFormat above." Args: outfile: File object we write to. indent: A string that is prepended to each generated line.
Writes extra info about this flag, in XML format.
[ "Writes", "extra", "info", "about", "this", "flag", "in", "XML", "format", "." ]
def _WriteCustomInfoInXMLFormat(self, outfile, indent): """Writes extra info about this flag, in XML format. "Extra" means "not already printed by WriteInfoInXMLFormat above." Args: outfile: File object we write to. indent: A string that is prepended to each generated line. """ # Usual...
[ "def", "_WriteCustomInfoInXMLFormat", "(", "self", ",", "outfile", ",", "indent", ")", ":", "# Usually, the parser knows the extra details about the flag, so", "# we just forward the call to it.", "self", ".", "parser", ".", "WriteCustomInfoInXMLFormat", "(", "outfile", ",", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py#L1978-L1989
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/jinja2/ext.py
python
Extension.parse
(self, parser)
If any of the :attr:`tags` matched this method is called with the parser as first argument. The token the parser stream is pointing at is the name token that matched. This method has to return one or a list of multiple nodes.
If any of the :attr:`tags` matched this method is called with the parser as first argument. The token the parser stream is pointing at is the name token that matched. This method has to return one or a list of multiple nodes.
[ "If", "any", "of", "the", ":", "attr", ":", "tags", "matched", "this", "method", "is", "called", "with", "the", "parser", "as", "first", "argument", ".", "The", "token", "the", "parser", "stream", "is", "pointing", "at", "is", "the", "name", "token", "...
def parse(self, parser): """If any of the :attr:`tags` matched this method is called with the parser as first argument. The token the parser stream is pointing at is the name token that matched. This method has to return one or a list of multiple nodes. """ raise NotImp...
[ "def", "parse", "(", "self", ",", "parser", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/jinja2/ext.py#L99-L105
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextCtrl.EndParagraphSpacing
(*args, **kwargs)
return _richtext.RichTextCtrl_EndParagraphSpacing(*args, **kwargs)
EndParagraphSpacing(self) -> bool End paragraph spacing
EndParagraphSpacing(self) -> bool
[ "EndParagraphSpacing", "(", "self", ")", "-", ">", "bool" ]
def EndParagraphSpacing(*args, **kwargs): """ EndParagraphSpacing(self) -> bool End paragraph spacing """ return _richtext.RichTextCtrl_EndParagraphSpacing(*args, **kwargs)
[ "def", "EndParagraphSpacing", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_EndParagraphSpacing", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L3491-L3497
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Window.SetClientSize
(*args, **kwargs)
return _core_.Window_SetClientSize(*args, **kwargs)
SetClientSize(self, Size size) This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to ...
SetClientSize(self, Size size)
[ "SetClientSize", "(", "self", "Size", "size", ")" ]
def SetClientSize(*args, **kwargs): """ SetClientSize(self, Size size) This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wx.Window.SetSize, since the application need not worry about what ...
[ "def", "SetClientSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_SetClientSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L9418-L9428
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/common.py
python
ExceptionAppend
(e, msg)
Append a message to the given exception's message.
Append a message to the given exception's message.
[ "Append", "a", "message", "to", "the", "given", "exception", "s", "message", "." ]
def ExceptionAppend(e, msg): """Append a message to the given exception's message.""" if not e.args: e.args = (msg,) elif len(e.args) == 1: e.args = (str(e.args[0]) + ' ' + msg,) else: e.args = (str(e.args[0]) + ' ' + msg,) + e.args[1:]
[ "def", "ExceptionAppend", "(", "e", ",", "msg", ")", ":", "if", "not", "e", ".", "args", ":", "e", ".", "args", "=", "(", "msg", ",", ")", "elif", "len", "(", "e", ".", "args", ")", "==", "1", ":", "e", ".", "args", "=", "(", "str", "(", ...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/common.py#L38-L45
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/plot.py
python
PolyMarker.getSymExtent
(self, printerScale)
return (s, s)
Width and Height of Marker
Width and Height of Marker
[ "Width", "and", "Height", "of", "Marker" ]
def getSymExtent(self, printerScale): """Width and Height of Marker""" s = 5 * self.attributes['size'] * printerScale * self._pointSize[0] return (s, s)
[ "def", "getSymExtent", "(", "self", ",", "printerScale", ")", ":", "s", "=", "5", "*", "self", ".", "attributes", "[", "'size'", "]", "*", "printerScale", "*", "self", ".", "_pointSize", "[", "0", "]", "return", "(", "s", ",", "s", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/plot.py#L383-L386
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/Maya_AnimationRiggingTools/ARTv1/MayaTools/General/Scripts/Modules/facial/face.py
python
FaceMask.snapMovers
(self, axis, mesh, debug=1)
for this system, in the tool UI itself that snaps the movers, I always bidirectionally cast against Y
[]
def snapMovers(self, axis, mesh, debug=1): ''' for this system, in the tool UI itself that snaps the movers, I always bidirectionally cast against Y ''' try: cmds.undoInfo(openChunk=True) #iterate through the *active* facial joint movers and snap them to the...
[ "def", "snapMovers", "(", "self", ",", "axis", ",", "mesh", ",", "debug", "=", "1", ")", ":", "try", ":", "cmds", ".", "undoInfo", "(", "openChunk", "=", "True", ")", "#iterate through the *active* facial joint movers and snap them to the surface", "if", "debug", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/Maya_AnimationRiggingTools/ARTv1/MayaTools/General/Scripts/Modules/facial/face.py#L197-L271
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
SizerFlags.DoubleBorder
(*args, **kwargs)
return _core_.SizerFlags_DoubleBorder(*args, **kwargs)
DoubleBorder(self, int direction=ALL) -> SizerFlags Sets the border in the given direction to twice the default border size.
DoubleBorder(self, int direction=ALL) -> SizerFlags
[ "DoubleBorder", "(", "self", "int", "direction", "=", "ALL", ")", "-", ">", "SizerFlags" ]
def DoubleBorder(*args, **kwargs): """ DoubleBorder(self, int direction=ALL) -> SizerFlags Sets the border in the given direction to twice the default border size. """ return _core_.SizerFlags_DoubleBorder(*args, **kwargs)
[ "def", "DoubleBorder", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "SizerFlags_DoubleBorder", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L13880-L13887
sit/dht
bab0bd7d81b0f04d1777ce30d21744bf481e77b3
tools/RPC.py
python
Server.__init__
(self, module, PROG, VERS, port, handlers, name=None)
If name is not None, Server prints debug messages prefixed by name.
If name is not None, Server prints debug messages prefixed by name.
[ "If", "name", "is", "not", "None", "Server", "prints", "debug", "messages", "prefixed", "by", "name", "." ]
def __init__(self, module, PROG, VERS, port, handlers, name=None): """If name is not None, Server prints debug messages prefixed by name.""" assert module is not None assert 'programs' in dir(module) assert PROG in module.programs assert VERS in module.programs[PROG] ...
[ "def", "__init__", "(", "self", ",", "module", ",", "PROG", ",", "VERS", ",", "port", ",", "handlers", ",", "name", "=", "None", ")", ":", "assert", "module", "is", "not", "None", "assert", "'programs'", "in", "dir", "(", "module", ")", "assert", "PR...
https://github.com/sit/dht/blob/bab0bd7d81b0f04d1777ce30d21744bf481e77b3/tools/RPC.py#L297-L353
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/dateutil/tz/_common.py
python
_validate_fromutc_inputs
(f)
return fromutc
The CPython version of ``fromutc`` checks that the input is a ``datetime`` object and that ``self`` is attached as its ``tzinfo``.
The CPython version of ``fromutc`` checks that the input is a ``datetime`` object and that ``self`` is attached as its ``tzinfo``.
[ "The", "CPython", "version", "of", "fromutc", "checks", "that", "the", "input", "is", "a", "datetime", "object", "and", "that", "self", "is", "attached", "as", "its", "tzinfo", "." ]
def _validate_fromutc_inputs(f): """ The CPython version of ``fromutc`` checks that the input is a ``datetime`` object and that ``self`` is attached as its ``tzinfo``. """ @wraps(f) def fromutc(self, dt): if not isinstance(dt, datetime): raise TypeError("fromutc() requires a ...
[ "def", "_validate_fromutc_inputs", "(", "f", ")", ":", "@", "wraps", "(", "f", ")", "def", "fromutc", "(", "self", ",", "dt", ")", ":", "if", "not", "isinstance", "(", "dt", ",", "datetime", ")", ":", "raise", "TypeError", "(", "\"fromutc() requires a da...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/dateutil/tz/_common.py#L98-L112
syoyo/tinygltf
e7f1ff5c59d3ca2489923beb239bdf93d863498f
deps/cpplint.py
python
PrintCategories
()
Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter.
Prints a list of all the error-categories used by error messages.
[ "Prints", "a", "list", "of", "all", "the", "error", "-", "categories", "used", "by", "error", "messages", "." ]
def PrintCategories(): """Prints a list of all the error-categories used by error messages. These are the categories used to filter messages via --filter. """ sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES)) sys.exit(0)
[ "def", "PrintCategories", "(", ")", ":", "sys", ".", "stderr", ".", "write", "(", "''", ".", "join", "(", "' %s\\n'", "%", "cat", "for", "cat", "in", "_ERROR_CATEGORIES", ")", ")", "sys", ".", "exit", "(", "0", ")" ]
https://github.com/syoyo/tinygltf/blob/e7f1ff5c59d3ca2489923beb239bdf93d863498f/deps/cpplint.py#L6225-L6231
quantumlib/qsim
8f7f94020c56ad6a8645313743d9985f7ea77808
qsimcirq/qsim_simulator.py
python
QSimSimulator.simulate_moment_expectation_values
( self, program: cirq.Circuit, indexed_observables: Union[ Dict[int, Union[cirq.PauliSumLike, List[cirq.PauliSumLike]]], cirq.PauliSumLike, List[cirq.PauliSumLike], ], param_resolver: cirq.ParamResolver, qubit_order: cirq.QubitOrderOrLi...
Calculates expectation values at each moment of a circuit. Args: program: The circuit to simulate. indexed_observables: A map of moment indices to an observable or list of observables to calculate after that moment. As a convenience, users can instead pas...
Calculates expectation values at each moment of a circuit.
[ "Calculates", "expectation", "values", "at", "each", "moment", "of", "a", "circuit", "." ]
def simulate_moment_expectation_values( self, program: cirq.Circuit, indexed_observables: Union[ Dict[int, Union[cirq.PauliSumLike, List[cirq.PauliSumLike]]], cirq.PauliSumLike, List[cirq.PauliSumLike], ], param_resolver: cirq.ParamResolver, ...
[ "def", "simulate_moment_expectation_values", "(", "self", ",", "program", ":", "cirq", ".", "Circuit", ",", "indexed_observables", ":", "Union", "[", "Dict", "[", "int", ",", "Union", "[", "cirq", ".", "PauliSumLike", ",", "List", "[", "cirq", ".", "PauliSum...
https://github.com/quantumlib/qsim/blob/8f7f94020c56ad6a8645313743d9985f7ea77808/qsimcirq/qsim_simulator.py#L711-L846
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
Clipboard_Get
(*args)
return _misc_.Clipboard_Get(*args)
Clipboard_Get() -> Clipboard Returns global instance (wxTheClipboard) of the object.
Clipboard_Get() -> Clipboard
[ "Clipboard_Get", "()", "-", ">", "Clipboard" ]
def Clipboard_Get(*args): """ Clipboard_Get() -> Clipboard Returns global instance (wxTheClipboard) of the object. """ return _misc_.Clipboard_Get(*args)
[ "def", "Clipboard_Get", "(", "*", "args", ")", ":", "return", "_misc_", ".", "Clipboard_Get", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L5922-L5928
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/inspect.py
python
_signature_bound_method
(sig)
return sig.replace(parameters=params)
Private helper to transform signatures for unbound functions to bound methods.
Private helper to transform signatures for unbound functions to bound methods.
[ "Private", "helper", "to", "transform", "signatures", "for", "unbound", "functions", "to", "bound", "methods", "." ]
def _signature_bound_method(sig): """Private helper to transform signatures for unbound functions to bound methods. """ params = tuple(sig.parameters.values()) if not params or params[0].kind in (_VAR_KEYWORD, _KEYWORD_ONLY): raise ValueError('invalid method signature') kind = params[...
[ "def", "_signature_bound_method", "(", "sig", ")", ":", "params", "=", "tuple", "(", "sig", ".", "parameters", ".", "values", "(", ")", ")", "if", "not", "params", "or", "params", "[", "0", "]", ".", "kind", "in", "(", "_VAR_KEYWORD", ",", "_KEYWORD_ON...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/inspect.py#L1799-L1822
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/skype.py
python
ISkypeEvents.GroupVisible
(self, Group, Visible)
This event is caused by a user hiding/showing a group in the contacts tab. @param Group: Group object. @type Group: L{IGroup} @param Visible: Tells if the group is visible or not. @type Visible: bool
This event is caused by a user hiding/showing a group in the contacts tab.
[ "This", "event", "is", "caused", "by", "a", "user", "hiding", "/", "showing", "a", "group", "in", "the", "contacts", "tab", "." ]
def GroupVisible(self, Group, Visible): '''This event is caused by a user hiding/showing a group in the contacts tab. @param Group: Group object. @type Group: L{IGroup} @param Visible: Tells if the group is visible or not. @type Visible: bool '''
[ "def", "GroupVisible", "(", "self", ",", "Group", ",", "Visible", ")", ":" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/skype.py#L1555-L1562
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/deep_cfr.py
python
ReservoirBuffer.add
(self, element)
Potentially adds `element` to the reservoir buffer. Args: element: data to be added to the reservoir buffer.
Potentially adds `element` to the reservoir buffer.
[ "Potentially", "adds", "element", "to", "the", "reservoir", "buffer", "." ]
def add(self, element): """Potentially adds `element` to the reservoir buffer. Args: element: data to be added to the reservoir buffer. """ if len(self._data) < self._reservoir_buffer_capacity: self._data.append(element) else: idx = np.random.randint(0, self._add_calls + 1) ...
[ "def", "add", "(", "self", ",", "element", ")", ":", "if", "len", "(", "self", ".", "_data", ")", "<", "self", ".", "_reservoir_buffer_capacity", ":", "self", ".", "_data", ".", "append", "(", "element", ")", "else", ":", "idx", "=", "np", ".", "ra...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/deep_cfr.py#L64-L76
SmileiPIC/Smilei
07dcb51200029e10f626e1546558c1ae7599c8b1
validation/easi/machines/llr.py
python
MachineLLR.compile
(self, dir)
Compile Smilei
Compile Smilei
[ "Compile", "Smilei" ]
def compile(self, dir): """ Compile Smilei """ with open(self.smilei_path.exec_script, 'w') as f: f.write( self.script.format(command=self.COMPILE_COMMAND, nodes=self.NODES, ppn=self.ppn, max_time=self.options.max_time, omp=self.options.omp, dir=dir) ) self.l...
[ "def", "compile", "(", "self", ",", "dir", ")", ":", "with", "open", "(", "self", ".", "smilei_path", ".", "exec_script", ",", "'w'", ")", "as", "f", ":", "f", ".", "write", "(", "self", ".", "script", ".", "format", "(", "command", "=", "self", ...
https://github.com/SmileiPIC/Smilei/blob/07dcb51200029e10f626e1546558c1ae7599c8b1/validation/easi/machines/llr.py#L61-L68
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/cygwinccompiler.py
python
get_msvcr
()
Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later.
Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later.
[ "Include", "the", "appropriate", "MSVC", "runtime", "library", "if", "Python", "was", "built", "with", "MSVC", "7", ".", "0", "or", "later", "." ]
def get_msvcr(): """Include the appropriate MSVC runtime library if Python was built with MSVC 7.0 or later. """ # FIXME: next code is from issue870382 # MS C-runtime libraries never support backward compatibility. # Linking to a different library without to specify correct runtime # version...
[ "def", "get_msvcr", "(", ")", ":", "# FIXME: next code is from issue870382", "# MS C-runtime libraries never support backward compatibility.", "# Linking to a different library without to specify correct runtime", "# version for the headers will link renamed functions to msvcrt.", "# See issue3308...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/distutils/cygwinccompiler.py#L59-L93
infinit/memo
3a8394d0f647efe03ccb8bfe885a7279cb8be8a6
elle/drake/src/drake/go/__init__.py
python
Config.add_ldflag
(self, flag)
return self.add_ldflags([flag])
Add a single ldflag at the end of the current ldflag. :param flag: An ldflag. :type flag: str :return: self
Add a single ldflag at the end of the current ldflag.
[ "Add", "a", "single", "ldflag", "at", "the", "end", "of", "the", "current", "ldflag", "." ]
def add_ldflag(self, flag): """ Add a single ldflag at the end of the current ldflag. :param flag: An ldflag. :type flag: str :return: self """ return self.add_ldflags([flag])
[ "def", "add_ldflag", "(", "self", ",", "flag", ")", ":", "return", "self", ".", "add_ldflags", "(", "[", "flag", "]", ")" ]
https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/go/__init__.py#L94-L103
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/nn_ops.py
python
AvgPool3D.__init__
(self, kernel_size=1, strides=1, pad_mode="valid", pad=0, ceil_mode=False, count_include_pad=True, divisor_override=0, data_format="NCDHW")
Initialize AvgPool3D
Initialize AvgPool3D
[ "Initialize", "AvgPool3D" ]
def __init__(self, kernel_size=1, strides=1, pad_mode="valid", pad=0, ceil_mode=False, count_include_pad=True, divisor_override=0, data_format="NCDHW"): """Initialize AvgPool3D""" self.init_prim_io_names(inputs=['input'], outputs=['output']) self.kernel_size = _check_3d_int_or_t...
[ "def", "__init__", "(", "self", ",", "kernel_size", "=", "1", ",", "strides", "=", "1", ",", "pad_mode", "=", "\"valid\"", ",", "pad", "=", "0", ",", "ceil_mode", "=", "False", ",", "count_include_pad", "=", "True", ",", "divisor_override", "=", "0", "...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/nn_ops.py#L7667-L7696
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/_abcoll.py
python
MutableSet.remove
(self, value)
Remove an element. If not a member, raise a KeyError.
Remove an element. If not a member, raise a KeyError.
[ "Remove", "an", "element", ".", "If", "not", "a", "member", "raise", "a", "KeyError", "." ]
def remove(self, value): """Remove an element. If not a member, raise a KeyError.""" if value not in self: raise KeyError(value) self.discard(value)
[ "def", "remove", "(", "self", ",", "value", ")", ":", "if", "value", "not", "in", "self", ":", "raise", "KeyError", "(", "value", ")", "self", ".", "discard", "(", "value", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/_abcoll.py#L285-L289
envoyproxy/envoy
65541accdafe255e72310b4298d646e091da2d80
tools/api_proto_plugin/utils.py
python
bazel_bin_path_for_output_artifact
(label, suffix, root='')
return os.path.join( root, 'bazel-bin/external/envoy_api', os.path.dirname(proto_file_path), 'pkg', proto_file_path + suffix)
Find the location in bazel-bin/ for an api_proto_plugin output file. Args: label: Bazel source proto label string. suffix: output suffix for the artifact from label, e.g. ".types.pb_text". root: location of bazel-bin/, if not specified, PWD. Returns: Path in bazel-bin/external/...
Find the location in bazel-bin/ for an api_proto_plugin output file.
[ "Find", "the", "location", "in", "bazel", "-", "bin", "/", "for", "an", "api_proto_plugin", "output", "file", "." ]
def bazel_bin_path_for_output_artifact(label, suffix, root=''): """Find the location in bazel-bin/ for an api_proto_plugin output file. Args: label: Bazel source proto label string. suffix: output suffix for the artifact from label, e.g. ".types.pb_text". root: location of bazel-bin/, i...
[ "def", "bazel_bin_path_for_output_artifact", "(", "label", ",", "suffix", ",", "root", "=", "''", ")", ":", "proto_file_path", "=", "proto_file_canonical_from_label", "(", "label", ")", "return", "os", ".", "path", ".", "join", "(", "root", ",", "'bazel-bin/exte...
https://github.com/envoyproxy/envoy/blob/65541accdafe255e72310b4298d646e091da2d80/tools/api_proto_plugin/utils.py#L18-L32
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column.py
python
_LazyBuilder.get
(self, key)
return transformed
Returns a `Tensor` for the given key. A `str` key is used to access a base feature (not-transformed). When a `_FeatureColumn` is passed, the transformed feature is returned if it already exists, otherwise the given `_FeatureColumn` is asked to provide its transformed output, which is then cached. ...
Returns a `Tensor` for the given key.
[ "Returns", "a", "Tensor", "for", "the", "given", "key", "." ]
def get(self, key): """Returns a `Tensor` for the given key. A `str` key is used to access a base feature (not-transformed). When a `_FeatureColumn` is passed, the transformed feature is returned if it already exists, otherwise the given `_FeatureColumn` is asked to provide its transformed output, ...
[ "def", "get", "(", "self", ",", "key", ")", ":", "if", "key", "in", "self", ".", "_feature_tensors", ":", "# FeatureColumn is already transformed or converted.", "return", "self", ".", "_feature_tensors", "[", "key", "]", "if", "key", "in", "self", ".", "_feat...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column.py#L2122-L2162
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudsearch2/search.py
python
SearchConnection.search
(self, q=None, parser=None, fq=None, rank=None, return_fields=None, size=10, start=0, facet=None, highlight=None, sort=None, partial=None, options=None)
return self(query)
Send a query to CloudSearch Each search query should use at least the q or bq argument to specify the search parameter. The other options are used to specify the criteria of the search. :type q: string :param q: A string to search the default search fields for. :type p...
Send a query to CloudSearch
[ "Send", "a", "query", "to", "CloudSearch" ]
def search(self, q=None, parser=None, fq=None, rank=None, return_fields=None, size=10, start=0, facet=None, highlight=None, sort=None, partial=None, options=None): """ Send a query to CloudSearch Each search query should use at least the q or bq argument to specify...
[ "def", "search", "(", "self", ",", "q", "=", "None", ",", "parser", "=", "None", ",", "fq", "=", "None", ",", "rank", "=", "None", ",", "return_fields", "=", "None", ",", "size", "=", "10", ",", "start", "=", "0", ",", "facet", "=", "None", ","...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudsearch2/search.py#L241-L336
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/xml/sax/handler.py
python
ErrorHandler.warning
(self, exception)
Handle a warning.
Handle a warning.
[ "Handle", "a", "warning", "." ]
def warning(self, exception): "Handle a warning." print exception
[ "def", "warning", "(", "self", ",", "exception", ")", ":", "print", "exception" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/xml/sax/handler.py#L40-L42
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
uCSIsHighSurrogates
(code)
return ret
Check whether the character is part of HighSurrogates UCS Block
Check whether the character is part of HighSurrogates UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "HighSurrogates", "UCS", "Block" ]
def uCSIsHighSurrogates(code): """Check whether the character is part of HighSurrogates UCS Block """ ret = libxml2mod.xmlUCSIsHighSurrogates(code) return ret
[ "def", "uCSIsHighSurrogates", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsHighSurrogates", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2602-L2606
Smorodov/Multitarget-tracker
bee300e8bfd660c86cbeb6892c65a5b7195c9381
thirdparty/pybind11/tools/clang/cindex.py
python
CursorKind.is_attribute
(self)
return conf.lib.clang_isAttribute(self)
Test if this is an attribute kind.
Test if this is an attribute kind.
[ "Test", "if", "this", "is", "an", "attribute", "kind", "." ]
def is_attribute(self): """Test if this is an attribute kind.""" return conf.lib.clang_isAttribute(self)
[ "def", "is_attribute", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isAttribute", "(", "self", ")" ]
https://github.com/Smorodov/Multitarget-tracker/blob/bee300e8bfd660c86cbeb6892c65a5b7195c9381/thirdparty/pybind11/tools/clang/cindex.py#L592-L594
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListMainWindow.GetImageSize
(self, index)
return width, height
Returns the image size for the item. :param `index`: the image index.
Returns the image size for the item.
[ "Returns", "the", "image", "size", "for", "the", "item", "." ]
def GetImageSize(self, index): """ Returns the image size for the item. :param `index`: the image index. """ width = height = 0 if self.HasAGWFlag(ULC_ICON) and self._normal_image_list: for indx in index: w, h = self._normal_image_list.GetS...
[ "def", "GetImageSize", "(", "self", ",", "index", ")", ":", "width", "=", "height", "=", "0", "if", "self", ".", "HasAGWFlag", "(", "ULC_ICON", ")", "and", "self", ".", "_normal_image_list", ":", "for", "indx", "in", "index", ":", "w", ",", "h", "=",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L8349-L8386
vnpy/vnpy
f50f2535ed39dd33272e0985ed40c7078e4c19f6
vnpy/trader/engine.py
python
LogEngine.add_console_handler
(self)
Add console output of log.
Add console output of log.
[ "Add", "console", "output", "of", "log", "." ]
def add_console_handler(self) -> None: """ Add console output of log. """ console_handler = logging.StreamHandler() console_handler.setLevel(self.level) console_handler.setFormatter(self.formatter) self.logger.addHandler(console_handler)
[ "def", "add_console_handler", "(", "self", ")", "->", "None", ":", "console_handler", "=", "logging", ".", "StreamHandler", "(", ")", "console_handler", ".", "setLevel", "(", "self", ".", "level", ")", "console_handler", ".", "setFormatter", "(", "self", ".", ...
https://github.com/vnpy/vnpy/blob/f50f2535ed39dd33272e0985ed40c7078e4c19f6/vnpy/trader/engine.py#L299-L306
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/aui.py
python
AuiToolBarItem.SetHoverBitmap
(*args, **kwargs)
return _aui.AuiToolBarItem_SetHoverBitmap(*args, **kwargs)
SetHoverBitmap(self, Bitmap bmp)
SetHoverBitmap(self, Bitmap bmp)
[ "SetHoverBitmap", "(", "self", "Bitmap", "bmp", ")" ]
def SetHoverBitmap(*args, **kwargs): """SetHoverBitmap(self, Bitmap bmp)""" return _aui.AuiToolBarItem_SetHoverBitmap(*args, **kwargs)
[ "def", "SetHoverBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBarItem_SetHoverBitmap", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L1793-L1795
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/sparse/linalg/matfuncs.py
python
_fragment_2_1
(X, T, s)
return X
A helper function for expm_2009. Notes ----- The argument X is modified in-place, but this modification is not the same as the returned value of the function. This function also takes pains to do things in ways that are compatible with sparse matrices, for example by avoiding fancy indexing ...
A helper function for expm_2009.
[ "A", "helper", "function", "for", "expm_2009", "." ]
def _fragment_2_1(X, T, s): """ A helper function for expm_2009. Notes ----- The argument X is modified in-place, but this modification is not the same as the returned value of the function. This function also takes pains to do things in ways that are compatible with sparse matrices, fo...
[ "def", "_fragment_2_1", "(", "X", ",", "T", ",", "s", ")", ":", "# Form X = r_m(2^-s T)", "# Replace diag(X) by exp(2^-s diag(T)).", "n", "=", "X", ".", "shape", "[", "0", "]", "diag_T", "=", "np", ".", "ravel", "(", "T", ".", "diagonal", "(", ")", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/sparse/linalg/matfuncs.py#L778-L824
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py
python
ConfigDialog.create_action_buttons
(self)
return outer
Return frame of action buttons for dialog. Methods: ok apply cancel help Widget Structure: outer: Frame buttons: Frame (no assignment): Button (ok) (no assignment): Button (apply) ...
Return frame of action buttons for dialog.
[ "Return", "frame", "of", "action", "buttons", "for", "dialog", "." ]
def create_action_buttons(self): """Return frame of action buttons for dialog. Methods: ok apply cancel help Widget Structure: outer: Frame buttons: Frame (no assignment): Button (ok) ...
[ "def", "create_action_buttons", "(", "self", ")", ":", "if", "macosx", ".", "isAquaTk", "(", ")", ":", "# Changing the default padding on OSX results in unreadable", "# text in the buttons.", "padding_args", "=", "{", "}", "else", ":", "padding_args", "=", "{", "'padd...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py#L127-L165
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/completer.py
python
IPCompleter.python_matches
(self, text)
return matches
Match attributes or global python names
Match attributes or global python names
[ "Match", "attributes", "or", "global", "python", "names" ]
def python_matches(self, text): """Match attributes or global python names""" if "." in text: try: matches = self.attr_matches(text) if text.endswith('.') and self.omit__names: if self.omit__names == 1: # true if txt...
[ "def", "python_matches", "(", "self", ",", "text", ")", ":", "if", "\".\"", "in", "text", ":", "try", ":", "matches", "=", "self", ".", "attr_matches", "(", "text", ")", "if", "text", ".", "endswith", "(", "'.'", ")", "and", "self", ".", "omit__names...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/completer.py#L1432-L1452
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
src/python/grpcio/grpc/aio/_base_channel.py
python
UnaryUnaryMultiCallable.__call__
( self, request: Any, *, timeout: Optional[float] = None, metadata: Optional[MetadataType] = None, credentials: Optional[grpc.CallCredentials] = None, wait_for_ready: Optional[bool] = None, compression: Optional[grpc.Compression] = None )
Asynchronously invokes the underlying RPC. Args: request: The request value for the RPC. timeout: An optional duration of time in seconds to allow for the RPC. metadata: Optional :term:`metadata` to be transmitted to the service-side of the RPC. c...
Asynchronously invokes the underlying RPC.
[ "Asynchronously", "invokes", "the", "underlying", "RPC", "." ]
def __call__( self, request: Any, *, timeout: Optional[float] = None, metadata: Optional[MetadataType] = None, credentials: Optional[grpc.CallCredentials] = None, wait_for_ready: Optional[bool] = None, compression: Optional[grpc.Compression] = None ) -...
[ "def", "__call__", "(", "self", ",", "request", ":", "Any", ",", "*", ",", "timeout", ":", "Optional", "[", "float", "]", "=", "None", ",", "metadata", ":", "Optional", "[", "MetadataType", "]", "=", "None", ",", "credentials", ":", "Optional", "[", ...
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/aio/_base_channel.py#L32-L64
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
GridTableBase.GetView
(*args, **kwargs)
return _grid.GridTableBase_GetView(*args, **kwargs)
GetView(self) -> Grid
GetView(self) -> Grid
[ "GetView", "(", "self", ")", "-", ">", "Grid" ]
def GetView(*args, **kwargs): """GetView(self) -> Grid""" return _grid.GridTableBase_GetView(*args, **kwargs)
[ "def", "GetView", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridTableBase_GetView", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L786-L788
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/text.py
python
VocabularyProcessor.restore
(cls, filename)
Restores vocabulary processor from given file. Args: filename: Path to file to load from. Returns: VocabularyProcessor object.
Restores vocabulary processor from given file.
[ "Restores", "vocabulary", "processor", "from", "given", "file", "." ]
def restore(cls, filename): """Restores vocabulary processor from given file. Args: filename: Path to file to load from. Returns: VocabularyProcessor object. """ with gfile.Open(filename, 'rb') as f: return pickle.loads(f.read())
[ "def", "restore", "(", "cls", ",", "filename", ")", ":", "with", "gfile", ".", "Open", "(", "filename", ",", "'rb'", ")", "as", "f", ":", "return", "pickle", ".", "loads", "(", "f", ".", "read", "(", ")", ")" ]
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/preprocessing/text.py#L216-L226
ucsb-seclab/difuze
bb59a12ff87ad5ae45d9c60e349891bf80d72877
helper_scripts/components/bear_llvm_build.py
python
_get_llvm_link_str
(llvm_link_path, src_root_dir, input_files, input_bc_map, output_file, work_dir, llvm_bit_code_out)
return work_dir, output_file, curr_output_file, ' '.join(modified_build_args)
Given a linker command from the json, this function converts it into corresponding llvm-link command with all the correct parameters. :param llvm_link_path: Path to llvm-link :param src_root_dir: Path to the kernel source directory. :param input_files: input files for the linker. :param input_bc...
Given a linker command from the json, this function converts it into corresponding llvm-link command with all the correct parameters. :param llvm_link_path: Path to llvm-link :param src_root_dir: Path to the kernel source directory. :param input_files: input files for the linker. :param input_bc...
[ "Given", "a", "linker", "command", "from", "the", "json", "this", "function", "converts", "it", "into", "corresponding", "llvm", "-", "link", "command", "with", "all", "the", "correct", "parameters", ".", ":", "param", "llvm_link_path", ":", "Path", "to", "l...
def _get_llvm_link_str(llvm_link_path, src_root_dir, input_files, input_bc_map, output_file, work_dir, llvm_bit_code_out): """ Given a linker command from the json, this function converts it into corresponding llvm-link command with all the correct parameters. :param llvm_...
[ "def", "_get_llvm_link_str", "(", "llvm_link_path", ",", "src_root_dir", ",", "input_files", ",", "input_bc_map", ",", "output_file", ",", "work_dir", ",", "llvm_bit_code_out", ")", ":", "modified_build_args", "=", "list", "(", ")", "modified_build_args", ".", "appe...
https://github.com/ucsb-seclab/difuze/blob/bb59a12ff87ad5ae45d9c60e349891bf80d72877/helper_scripts/components/bear_llvm_build.py#L207-L252
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/glcanvas.py
python
GLCanvasWithContext
(*args, **kwargs)
return val
GLCanvasWithContext(Window parent, GLContext shared=None, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=GLCanvasNameStr, int attribList=None, Palette palette=wxNullPalette) -> GLCanvas
GLCanvasWithContext(Window parent, GLContext shared=None, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=GLCanvasNameStr, int attribList=None, Palette palette=wxNullPalette) -> GLCanvas
[ "GLCanvasWithContext", "(", "Window", "parent", "GLContext", "shared", "=", "None", "int", "id", "=", "-", "1", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "0", "String", "name", "=", "GLCanvasNameStr", "...
def GLCanvasWithContext(*args, **kwargs): """ GLCanvasWithContext(Window parent, GLContext shared=None, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=0, String name=GLCanvasNameStr, int attribList=None, Palette palette=wxNullPalette) -> GLCanvas """ v...
[ "def", "GLCanvasWithContext", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "val", "=", "_glcanvas", ".", "new_GLCanvasWithContext", "(", "*", "args", ",", "*", "*", "kwargs", ")", "val", ".", "_setOORInfo", "(", "val", ")", "return", "val" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/glcanvas.py#L155-L164
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
samples/culling/portal_culling.py
python
Game.update
(self, task)
return task.cont
Updates the camera based on the keyboard input. Once this is done, then the CellManager's update function is called.
Updates the camera based on the keyboard input. Once this is done, then the CellManager's update function is called.
[ "Updates", "the", "camera", "based", "on", "the", "keyboard", "input", ".", "Once", "this", "is", "done", "then", "the", "CellManager", "s", "update", "function", "is", "called", "." ]
def update(self, task): """Updates the camera based on the keyboard input. Once this is done, then the CellManager's update function is called.""" delta = base.clock.dt move_x = delta * 3 * -self.keys['a'] + delta * 3 * self.keys['d'] move_z = delta * 3 * self.keys['s'] + delta *...
[ "def", "update", "(", "self", ",", "task", ")", ":", "delta", "=", "base", ".", "clock", ".", "dt", "move_x", "=", "delta", "*", "3", "*", "-", "self", ".", "keys", "[", "'a'", "]", "+", "delta", "*", "3", "*", "self", ".", "keys", "[", "'d'"...
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/samples/culling/portal_culling.py#L135-L149
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py
python
GmmAlgorithm.assignments
(self)
return ret
Returns a list of Tensors with the matrix of assignments per shard.
Returns a list of Tensors with the matrix of assignments per shard.
[ "Returns", "a", "list", "of", "Tensors", "with", "the", "matrix", "of", "assignments", "per", "shard", "." ]
def assignments(self): """Returns a list of Tensors with the matrix of assignments per shard.""" ret = [] for w in self._w: ret.append(tf.argmax(w, 1)) return ret
[ "def", "assignments", "(", "self", ")", ":", "ret", "=", "[", "]", "for", "w", "in", "self", ".", "_w", ":", "ret", ".", "append", "(", "tf", ".", "argmax", "(", "w", ",", "1", ")", ")", "return", "ret" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L187-L192
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/imaplib.py
python
IMAP4.store
(self, message_set, command, flags)
return self._untagged_response(typ, dat, 'FETCH')
Alters flag dispositions for messages in mailbox. (typ, [data]) = <instance>.store(message_set, command, flags)
Alters flag dispositions for messages in mailbox.
[ "Alters", "flag", "dispositions", "for", "messages", "in", "mailbox", "." ]
def store(self, message_set, command, flags): """Alters flag dispositions for messages in mailbox. (typ, [data]) = <instance>.store(message_set, command, flags) """ if (flags[0],flags[-1]) != ('(',')'): flags = '(%s)' % flags # Avoid quoting the flags typ, dat = sel...
[ "def", "store", "(", "self", ",", "message_set", ",", "command", ",", "flags", ")", ":", "if", "(", "flags", "[", "0", "]", ",", "flags", "[", "-", "1", "]", ")", "!=", "(", "'('", ",", "')'", ")", ":", "flags", "=", "'(%s)'", "%", "flags", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/imaplib.py#L833-L841
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
driver/python/pysequoiadb/collection.py
python
collection.split_by_condition
(self, source_group_name, target_group_name, split_condition, split_end_condition=None)
Split the specified collection from source replica group to target replica group by range. Parameters: Name Type Info: source_group_name str The source replica group name. target_group_name str The target replica group name. ...
Split the specified collection from source replica group to target replica group by range.
[ "Split", "the", "specified", "collection", "from", "source", "replica", "group", "to", "target", "replica", "group", "by", "range", "." ]
def split_by_condition(self, source_group_name, target_group_name, split_condition, split_end_condition=None): """Split the specified collection from source replica group to target replica group by range. Parameters: Name ...
[ "def", "split_by_condition", "(", "self", ",", "source_group_name", ",", "target_group_name", ",", "split_condition", ",", "split_end_condition", "=", "None", ")", ":", "if", "not", "isinstance", "(", "source_group_name", ",", "str_type", ")", ":", "raise", "SDBTy...
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/driver/python/pysequoiadb/collection.py#L122-L171
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
com/win32com/client/__init__.py
python
Moniker
(Pathname, clsctx=pythoncom.CLSCTX_ALL)
return __WrapDispatch(dispatch, Pathname, clsctx=clsctx)
Python friendly version of GetObject's moniker functionality.
Python friendly version of GetObject's moniker functionality.
[ "Python", "friendly", "version", "of", "GetObject", "s", "moniker", "functionality", "." ]
def Moniker(Pathname, clsctx=pythoncom.CLSCTX_ALL): """ Python friendly version of GetObject's moniker functionality. """ moniker, i, bindCtx = pythoncom.MkParseDisplayName(Pathname) dispatch = moniker.BindToObject(bindCtx, None, pythoncom.IID_IDispatch) return __WrapDispatch(dispatch, Pathname,...
[ "def", "Moniker", "(", "Pathname", ",", "clsctx", "=", "pythoncom", ".", "CLSCTX_ALL", ")", ":", "moniker", ",", "i", ",", "bindCtx", "=", "pythoncom", ".", "MkParseDisplayName", "(", "Pathname", ")", "dispatch", "=", "moniker", ".", "BindToObject", "(", "...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32com/client/__init__.py#L98-L104
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus2.in.py
python
exodus.put_elem_blk_info
(self, elem_blk_id, elem_type, num_blk_elems, num_elem_nodes, num_elem_attrs)
exo.put_elem_blk_info(elem_blk_id, \\ elem_type, \\ num_blk_elems, \\ num_elem_nodes, \\ num_elem_attrs) -> store the element block *ID* and element block info input value(s): <int> elem_blk_id element block *ID* (not *INDEX*) ...
exo.put_elem_blk_info(elem_blk_id, \\ elem_type, \\ num_blk_elems, \\ num_elem_nodes, \\ num_elem_attrs)
[ "exo", ".", "put_elem_blk_info", "(", "elem_blk_id", "\\\\", "elem_type", "\\\\", "num_blk_elems", "\\\\", "num_elem_nodes", "\\\\", "num_elem_attrs", ")" ]
def put_elem_blk_info(self, elem_blk_id, elem_type, num_blk_elems, num_elem_nodes, num_elem_attrs): """ exo.put_elem_blk_info(elem_blk_id, \\ elem_type, \\ num_blk_elems, \\ num_elem_nodes, \\ num_elem_attrs) -> store the eleme...
[ "def", "put_elem_blk_info", "(", "self", ",", "elem_blk_id", ",", "elem_type", ",", "num_blk_elems", ",", "num_elem_nodes", ",", "num_elem_attrs", ")", ":", "self", ".", "__ex_put_elem_block", "(", "elem_blk_id", ",", "elem_type", ",", "num_blk_elems", ",", "num_e...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus2.in.py#L1318-L1337
nnrg/opennero
43e12a1bcba6e228639db3886fec1dc47ddc24cb
mods/Roomba/RTNEATAgent.py
python
RTNEATAgent.start
(self, time, sensors)
return self.network_action(sensors)
start of an episode
start of an episode
[ "start", "of", "an", "episode" ]
def start(self, time, sensors): """ start of an episode """ return self.network_action(sensors)
[ "def", "start", "(", "self", ",", "time", ",", "sensors", ")", ":", "return", "self", ".", "network_action", "(", "sensors", ")" ]
https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Roomba/RTNEATAgent.py#L26-L30
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/propgrid.py
python
PropertyGrid.GetLabelEditor
(*args, **kwargs)
return _propgrid.PropertyGrid_GetLabelEditor(*args, **kwargs)
GetLabelEditor(self) -> wxTextCtrl
GetLabelEditor(self) -> wxTextCtrl
[ "GetLabelEditor", "(", "self", ")", "-", ">", "wxTextCtrl" ]
def GetLabelEditor(*args, **kwargs): """GetLabelEditor(self) -> wxTextCtrl""" return _propgrid.PropertyGrid_GetLabelEditor(*args, **kwargs)
[ "def", "GetLabelEditor", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_GetLabelEditor", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2223-L2225
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/scripts/exodus3.in.py
python
exodus.version_num
(self)
return "%1.2f" % self.version.value
get exodus version number used to create the database >>> version = exo.version_num() Returns ------- version : string representation of version number
get exodus version number used to create the database
[ "get", "exodus", "version", "number", "used", "to", "create", "the", "database" ]
def version_num(self): """ get exodus version number used to create the database >>> version = exo.version_num() Returns ------- version : string representation of version number """ return "%1.2f" % self.version.value
[ "def", "version_num", "(", "self", ")", ":", "return", "\"%1.2f\"", "%", "self", ".", "version", ".", "value" ]
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/scripts/exodus3.in.py#L867-L878
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/cmd.py
python
Command.make_file
(self, infiles, outfile, func, args, exec_msg=None, skip_msg=None, level=1)
Special case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a different message printed if 'outfile' already exists and is newer than all files listed in 'infiles'. If the...
Special case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a different message printed if 'outfile' already exists and is newer than all files listed in 'infiles'. If the...
[ "Special", "case", "of", "execute", "()", "for", "operations", "that", "process", "one", "or", "more", "input", "files", "and", "generate", "one", "output", "file", ".", "Works", "just", "like", "execute", "()", "except", "the", "operation", "is", "skipped",...
def make_file(self, infiles, outfile, func, args, exec_msg=None, skip_msg=None, level=1): """Special case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a differe...
[ "def", "make_file", "(", "self", ",", "infiles", ",", "outfile", ",", "func", ",", "args", ",", "exec_msg", "=", "None", ",", "skip_msg", "=", "None", ",", "level", "=", "1", ")", ":", "if", "skip_msg", "is", "None", ":", "skip_msg", "=", "\"skipping...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/cmd.py#L394-L426
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/eager/monitoring.py
python
Metric.__init__
(self, metric_name, metric_methods, label_length, *args)
Creates a new metric. Args: metric_name: name of the metric class. metric_methods: list of swig metric methods. label_length: length of label args. *args: the arguments to call create method.
Creates a new metric.
[ "Creates", "a", "new", "metric", "." ]
def __init__(self, metric_name, metric_methods, label_length, *args): """Creates a new metric. Args: metric_name: name of the metric class. metric_methods: list of swig metric methods. label_length: length of label args. *args: the arguments to call create method. """ self._metr...
[ "def", "__init__", "(", "self", ",", "metric_name", ",", "metric_methods", ",", "label_length", ",", "*", "args", ")", ":", "self", ".", "_metric_name", "=", "metric_name", "self", ".", "_metric_methods", "=", "metric_methods", "self", ".", "_label_length", "=...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/eager/monitoring.py#L114-L131
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/util/timeout.py
python
Timeout.read_timeout
(self)
Get the value for the read timeout. This assumes some time has elapsed in the connection timeout and computes the read timeout appropriately. If self.total is set, the read timeout is dependent on the amount of time taken by the connect timeout. If the connection time has not been ...
Get the value for the read timeout.
[ "Get", "the", "value", "for", "the", "read", "timeout", "." ]
def read_timeout(self): """ Get the value for the read timeout. This assumes some time has elapsed in the connection timeout and computes the read timeout appropriately. If self.total is set, the read timeout is dependent on the amount of time taken by the connect timeout. If t...
[ "def", "read_timeout", "(", "self", ")", ":", "if", "(", "self", ".", "total", "is", "not", "None", "and", "self", ".", "total", "is", "not", "self", ".", "DEFAULT_TIMEOUT", "and", "self", ".", "_read", "is", "not", "None", "and", "self", ".", "_read...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/urllib3/util/timeout.py#L229-L258
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/timeline/trace_data.py
python
TraceData.Serialize
(self, f, gzip_result=False)
Serializes the trace result to a file-like object. Write in trace container format if gzip_result=False. Writes to a .zip file if gzip_result=True.
Serializes the trace result to a file-like object.
[ "Serializes", "the", "trace", "result", "to", "a", "file", "-", "like", "object", "." ]
def Serialize(self, f, gzip_result=False): """Serializes the trace result to a file-like object. Write in trace container format if gzip_result=False. Writes to a .zip file if gzip_result=True. """ if gzip_result: zip_file = zipfile.ZipFile(f, mode='w') try: for part in self.act...
[ "def", "Serialize", "(", "self", ",", "f", ",", "gzip_result", "=", "False", ")", ":", "if", "gzip_result", ":", "zip_file", "=", "zipfile", ".", "ZipFile", "(", "f", ",", "mode", "=", "'w'", ")", "try", ":", "for", "part", "in", "self", ".", "acti...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/timeline/trace_data.py#L154-L173
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/cluster/_kmeans.py
python
_mini_batch_convergence
(model, iteration_idx, n_iter, tol, n_samples, centers_squared_diff, batch_inertia, context, verbose=0)
return False
Helper function to encapsulate the early stopping logic
Helper function to encapsulate the early stopping logic
[ "Helper", "function", "to", "encapsulate", "the", "early", "stopping", "logic" ]
def _mini_batch_convergence(model, iteration_idx, n_iter, tol, n_samples, centers_squared_diff, batch_inertia, context, verbose=0): """Helper function to encapsulate the early stopping logic""" # Normalize inertia to be able to compare values when # ba...
[ "def", "_mini_batch_convergence", "(", "model", ",", "iteration_idx", ",", "n_iter", ",", "tol", ",", "n_samples", ",", "centers_squared_diff", ",", "batch_inertia", ",", "context", ",", "verbose", "=", "0", ")", ":", "# Normalize inertia to be able to compare values ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/cluster/_kmeans.py#L1264-L1327
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/syntax/_haskell.py
python
SyntaxData.GetCommentPattern
(self)
return [u'--']
Returns a list of characters used to comment a block of code
Returns a list of characters used to comment a block of code
[ "Returns", "a", "list", "of", "characters", "used", "to", "comment", "a", "block", "of", "code" ]
def GetCommentPattern(self): """Returns a list of characters used to comment a block of code """ return [u'--']
[ "def", "GetCommentPattern", "(", "self", ")", ":", "return", "[", "u'--'", "]" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/syntax/_haskell.py#L82-L84
livecode/livecode
4606a10ea10b16d5071d0f9f263ccdd7ede8b31d
gyp/pylib/gyp/xcodeproj_file.py
python
PBXProject.AddOrGetFileInRootGroup
(self, path)
return group.AddOrGetFileByPath(path, hierarchical)
Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics. If an existing PBXFileReference for path exists, it will be returned. Otherwise, one will be created and returned.
Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics.
[ "Returns", "a", "PBXFileReference", "corresponding", "to", "path", "in", "the", "correct", "group", "according", "to", "RootGroupForPath", "s", "heuristics", "." ]
def AddOrGetFileInRootGroup(self, path): """Returns a PBXFileReference corresponding to path in the correct group according to RootGroupForPath's heuristics. If an existing PBXFileReference for path exists, it will be returned. Otherwise, one will be created and returned. """ (group, hierarchi...
[ "def", "AddOrGetFileInRootGroup", "(", "self", ",", "path", ")", ":", "(", "group", ",", "hierarchical", ")", "=", "self", ".", "RootGroupForPath", "(", "path", ")", "return", "group", ".", "AddOrGetFileByPath", "(", "path", ",", "hierarchical", ")" ]
https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/gyp/pylib/gyp/xcodeproj_file.py#L2617-L2626
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py
python
ParserElement.__mul__
(self,other)
return ret
Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as in: - C{expr*(n,None)} or C{expr*(n,)} is ...
Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as in: - C{expr*(n,None)} or C{expr*(n,)} is ...
[ "Implementation", "of", "*", "operator", "allows", "use", "of", "C", "{", "expr", "*", "3", "}", "in", "place", "of", "C", "{", "expr", "+", "expr", "+", "expr", "}", ".", "Expressions", "may", "also", "me", "multiplied", "by", "a", "2", "-", "inte...
def __mul__(self,other): """ Implementation of * operator, allows use of C{expr * 3} in place of C{expr + expr + expr}. Expressions may also me multiplied by a 2-integer tuple, similar to C{{min,max}} multipliers in regular expressions. Tuples may also include C{None} as in: ...
[ "def", "__mul__", "(", "self", ",", "other", ")", ":", "if", "isinstance", "(", "other", ",", "int", ")", ":", "minElements", ",", "optElements", "=", "other", ",", "0", "elif", "isinstance", "(", "other", ",", "tuple", ")", ":", "other", "=", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py#L1877-L1943
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/png/png.py
python
Test.testPackedIter
(self)
Test iterator for row when using write_packed. Indicative for Issue 47.
Test iterator for row when using write_packed.
[ "Test", "iterator", "for", "row", "when", "using", "write_packed", "." ]
def testPackedIter(self): """Test iterator for row when using write_packed. Indicative for Issue 47. """ w = Writer(16, 2, greyscale=True, alpha=False, bitdepth=1) o = BytesIO() w.write_packed(o, [itertools.chain([0x0a], [0xaa]), itertools.chai...
[ "def", "testPackedIter", "(", "self", ")", ":", "w", "=", "Writer", "(", "16", ",", "2", ",", "greyscale", "=", "True", ",", "alpha", "=", "False", ",", "bitdepth", "=", "1", ")", "o", "=", "BytesIO", "(", ")", "w", ".", "write_packed", "(", "o",...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/png/png.py#L2767-L2780
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
uCSIsByzantineMusicalSymbols
(code)
return ret
Check whether the character is part of ByzantineMusicalSymbols UCS Block
Check whether the character is part of ByzantineMusicalSymbols UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "ByzantineMusicalSymbols", "UCS", "Block" ]
def uCSIsByzantineMusicalSymbols(code): """Check whether the character is part of ByzantineMusicalSymbols UCS Block """ ret = libxml2mod.xmlUCSIsByzantineMusicalSymbols(code) return ret
[ "def", "uCSIsByzantineMusicalSymbols", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsByzantineMusicalSymbols", "(", "code", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2131-L2135
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.AcceptsFocusFromKeyboard
(*args, **kwargs)
return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
AcceptsFocusFromKeyboard(self) -> bool Can this window be given focus by keyboard navigation? if not, the only way to give it focus (provided it accepts it at all) is to click it.
AcceptsFocusFromKeyboard(self) -> bool
[ "AcceptsFocusFromKeyboard", "(", "self", ")", "-", ">", "bool" ]
def AcceptsFocusFromKeyboard(*args, **kwargs): """ AcceptsFocusFromKeyboard(self) -> bool Can this window be given focus by keyboard navigation? if not, the only way to give it focus (provided it accepts it at all) is to click it. """ return _core_.Window_Accepts...
[ "def", "AcceptsFocusFromKeyboard", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_AcceptsFocusFromKeyboard", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10174-L10182
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/training/supervisor.py
python
Supervisor.__init__
(self, graph=None, ready_op=USE_DEFAULT, is_chief=True, init_op=USE_DEFAULT, init_feed_dict=None, local_init_op=USE_DEFAULT, logdir=None, summary_op=USE_DEFAULT, saver=USE_DEFAULT, global_step=USE_DEFAULT, save_summaries_secs=120, save_model_sec...
Create a `Supervisor`. Args: graph: A `Graph`. The graph that the model will use. Defaults to the default `Graph`. The supervisor may add operations to the graph before creating a session, but the graph should not be modified by the caller after passing it to the supervisor. ...
Create a `Supervisor`.
[ "Create", "a", "Supervisor", "." ]
def __init__(self, graph=None, ready_op=USE_DEFAULT, is_chief=True, init_op=USE_DEFAULT, init_feed_dict=None, local_init_op=USE_DEFAULT, logdir=None, summary_op=USE_DEFAULT, saver=USE_DEFAULT, global_step=USE_DEFAULT, save_summaries_secs=120, sa...
[ "def", "__init__", "(", "self", ",", "graph", "=", "None", ",", "ready_op", "=", "USE_DEFAULT", ",", "is_chief", "=", "True", ",", "init_op", "=", "USE_DEFAULT", ",", "init_feed_dict", "=", "None", ",", "local_init_op", "=", "USE_DEFAULT", ",", "logdir", "...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/supervisor.py#L213-L328
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/subgraph.py
python
_finalize_indices
(list_of_index_or_t, ts)
return [_finalize_index(index_or_t, ts) for index_or_t in list_of_index_or_t]
Returns index in `indices` as is or replace with tensor's index.
Returns index in `indices` as is or replace with tensor's index.
[ "Returns", "index", "in", "indices", "as", "is", "or", "replace", "with", "tensor", "s", "index", "." ]
def _finalize_indices(list_of_index_or_t, ts): """Returns index in `indices` as is or replace with tensor's index.""" return [_finalize_index(index_or_t, ts) for index_or_t in list_of_index_or_t]
[ "def", "_finalize_indices", "(", "list_of_index_or_t", ",", "ts", ")", ":", "return", "[", "_finalize_index", "(", "index_or_t", ",", "ts", ")", "for", "index_or_t", "in", "list_of_index_or_t", "]" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/graph_editor/subgraph.py#L47-L49
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
MenuBar.Append
(*args, **kwargs)
return _core_.MenuBar_Append(*args, **kwargs)
Append(self, Menu menu, String title) -> bool
Append(self, Menu menu, String title) -> bool
[ "Append", "(", "self", "Menu", "menu", "String", "title", ")", "-", ">", "bool" ]
def Append(*args, **kwargs): """Append(self, Menu menu, String title) -> bool""" return _core_.MenuBar_Append(*args, **kwargs)
[ "def", "Append", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "MenuBar_Append", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L12272-L12274
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/pyserial/serial/serialutil.py
python
FileLike.readlines
(self, sizehint=None, eol=LF)
return lines
read a list of lines, until timeout. sizehint is ignored.
read a list of lines, until timeout. sizehint is ignored.
[ "read", "a", "list", "of", "lines", "until", "timeout", ".", "sizehint", "is", "ignored", "." ]
def readlines(self, sizehint=None, eol=LF): """read a list of lines, until timeout. sizehint is ignored.""" if self.timeout is None: raise ValueError("Serial port MUST have enabled timeout for this function!") leneol = len(eol) lines = [] while True: ...
[ "def", "readlines", "(", "self", ",", "sizehint", "=", "None", ",", "eol", "=", "LF", ")", ":", "if", "self", ".", "timeout", "is", "None", ":", "raise", "ValueError", "(", "\"Serial port MUST have enabled timeout for this function!\"", ")", "leneol", "=", "le...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/pyserial/serial/serialutil.py#L179-L194
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/difference_table_widget/difference_table_widget_view.py
python
DifferenceTableView.on_item_changed
(self)
Not yet implemented.
Not yet implemented.
[ "Not", "yet", "implemented", "." ]
def on_item_changed(self): """Not yet implemented.""" if not self._updating: pass
[ "def", "on_item_changed", "(", "self", ")", ":", "if", "not", "self", ".", "_updating", ":", "pass" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/difference_table_widget/difference_table_widget_view.py#L203-L206
hakuna-m/wubiuefi
caec1af0a09c78fd5a345180ada1fe45e0c63493
src/wubi/application.py
python
Wubi.set_logger
(self, log_to_console=True)
Adjust the application root logger settings
Adjust the application root logger settings
[ "Adjust", "the", "application", "root", "logger", "settings" ]
def set_logger(self, log_to_console=True): ''' Adjust the application root logger settings ''' # file logging if not self.info.log_file or self.info.log_file.lower() != "none": if not self.info.log_file: fname = self.info.full_application_name + ".log"...
[ "def", "set_logger", "(", "self", ",", "log_to_console", "=", "True", ")", ":", "# file logging", "if", "not", "self", ".", "info", ".", "log_file", "or", "self", ".", "info", ".", "log_file", ".", "lower", "(", ")", "!=", "\"none\"", ":", "if", "not",...
https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/wubi/application.py#L292-L319
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/core/oinspect.py
python
get_encoding
(obj)
Get encoding for python source file defining obj Returns None if obj is not defined in a sourcefile.
Get encoding for python source file defining obj
[ "Get", "encoding", "for", "python", "source", "file", "defining", "obj" ]
def get_encoding(obj): """Get encoding for python source file defining obj Returns None if obj is not defined in a sourcefile. """ ofile = find_file(obj) # run contents of file through pager starting at line where the object # is defined, as long as the file isn't binary and is actually on the ...
[ "def", "get_encoding", "(", "obj", ")", ":", "ofile", "=", "find_file", "(", "obj", ")", "# run contents of file through pager starting at line where the object", "# is defined, as long as the file isn't binary and is actually on the", "# filesystem.", "if", "ofile", "is", "None"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/core/oinspect.py#L97-L118
lighttransport/nanort
74063967336311f54ede5dffdfa242123825033b
deps/cpplint.py
python
CloseExpression
(clean_lines, linenum, pos)
return (line, clean_lines.NumLines(), -1)
If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. TODO(unknown): cpplint spends a fair bit of time matching parentheses. Ideally we would want to index all...
If input points to ( or { or [ or <, finds the position that closes it.
[ "If", "input", "points", "to", "(", "or", "{", "or", "[", "or", "<", "finds", "the", "position", "that", "closes", "it", "." ]
def CloseExpression(clean_lines, linenum, pos): """If input points to ( or { or [ or <, finds the position that closes it. If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the linenum/pos that correspond to the closing of the expression. TODO(unknown): cpplint spends a fair bit of time match...
[ "def", "CloseExpression", "(", "clean_lines", ",", "linenum", ",", "pos", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "(", "line", "[", "pos", "]", "not", "in", "'({[<'", ")", "or", "Match", "(", "r'<[<=]'", ",", "...
https://github.com/lighttransport/nanort/blob/74063967336311f54ede5dffdfa242123825033b/deps/cpplint.py#L1463-L1504
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
onnxruntime/python/tools/transformers/float16.py
python
convert_np_to_float16
(np_array, min_positive_val=1e-7, max_finite_val=1e4)
return np.float16(np_array)
Convert float32 numpy array to float16 without changing sign or finiteness. Positive values less than min_positive_val are mapped to min_positive_val. Positive finite values greater than max_finite_val are mapped to max_finite_val. Similar for negative values. NaN, 0, inf, and -inf are unchanged.
Convert float32 numpy array to float16 without changing sign or finiteness. Positive values less than min_positive_val are mapped to min_positive_val. Positive finite values greater than max_finite_val are mapped to max_finite_val. Similar for negative values. NaN, 0, inf, and -inf are unchanged.
[ "Convert", "float32", "numpy", "array", "to", "float16", "without", "changing", "sign", "or", "finiteness", ".", "Positive", "values", "less", "than", "min_positive_val", "are", "mapped", "to", "min_positive_val", ".", "Positive", "finite", "values", "greater", "t...
def convert_np_to_float16(np_array, min_positive_val=1e-7, max_finite_val=1e4): ''' Convert float32 numpy array to float16 without changing sign or finiteness. Positive values less than min_positive_val are mapped to min_positive_val. Positive finite values greater than max_finite_val are mapped to max_...
[ "def", "convert_np_to_float16", "(", "np_array", ",", "min_positive_val", "=", "1e-7", ",", "max_finite_val", "=", "1e4", ")", ":", "def", "between", "(", "a", ",", "b", ",", "c", ")", ":", "return", "np", ".", "logical_and", "(", "a", "<", "b", ",", ...
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/onnxruntime/python/tools/transformers/float16.py#L31-L45
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_snapper.py
python
Snapper.getPerpendicular
(self, edge, pt)
return np
Return a point on an edge, perpendicular to the given point.
Return a point on an edge, perpendicular to the given point.
[ "Return", "a", "point", "on", "an", "edge", "perpendicular", "to", "the", "given", "point", "." ]
def getPerpendicular(self, edge, pt): """Return a point on an edge, perpendicular to the given point.""" dv = pt.sub(edge.Vertexes[0].Point) nv = DraftVecUtils.project(dv, DraftGeomUtils.vec(edge)) np = (edge.Vertexes[0].Point).add(nv) return np
[ "def", "getPerpendicular", "(", "self", ",", "edge", ",", "pt", ")", ":", "dv", "=", "pt", ".", "sub", "(", "edge", ".", "Vertexes", "[", "0", "]", ".", "Point", ")", "nv", "=", "DraftVecUtils", ".", "project", "(", "dv", ",", "DraftGeomUtils", "."...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_snapper.py#L1109-L1114
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/all-oone-data-structure.py
python
AllOne.inc
(self, key)
Inserts a new key <Key> with value 1. Or increments an existing key by 1. :type key: str :rtype: void
Inserts a new key <Key> with value 1. Or increments an existing key by 1. :type key: str :rtype: void
[ "Inserts", "a", "new", "key", "<Key", ">", "with", "value", "1", ".", "Or", "increments", "an", "existing", "key", "by", "1", ".", ":", "type", "key", ":", "str", ":", "rtype", ":", "void" ]
def inc(self, key): """ Inserts a new key <Key> with value 1. Or increments an existing key by 1. :type key: str :rtype: void """ if key not in self.bucket_of_key: self.bucket_of_key[key] = self.buckets.insert(self.buckets.begin(), Node(0, set([key]))) ...
[ "def", "inc", "(", "self", ",", "key", ")", ":", "if", "key", "not", "in", "self", ".", "bucket_of_key", ":", "self", ".", "bucket_of_key", "[", "key", "]", "=", "self", ".", "buckets", ".", "insert", "(", "self", ".", "buckets", ".", "begin", "(",...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/all-oone-data-structure.py#L54-L71
esa/pagmo
80281d549c8f1b470e1489a5d37c8f06b2e429c0
PyGMO/util/_analysis.py
python
analysis.f_linearity_convexity
(self, n_pairs=0, tol=10 ** (-8), round_to=3)
This function gives the user information about the probability of linearity and convexity of the fitness function(s). See analysis._p_lin_conv for a more thorough description of these tests. All properties are shown per objective. **USAGE:** analysis.f_linearity_convexity([n_pairs=1000...
This function gives the user information about the probability of linearity and convexity of the fitness function(s). See analysis._p_lin_conv for a more thorough description of these tests. All properties are shown per objective.
[ "This", "function", "gives", "the", "user", "information", "about", "the", "probability", "of", "linearity", "and", "convexity", "of", "the", "fitness", "function", "(", "s", ")", ".", "See", "analysis", ".", "_p_lin_conv", "for", "a", "more", "thorough", "d...
def f_linearity_convexity(self, n_pairs=0, tol=10 ** (-8), round_to=3): """ This function gives the user information about the probability of linearity and convexity of the fitness function(s). See analysis._p_lin_conv for a more thorough description of these tests. All properties are sh...
[ "def", "f_linearity_convexity", "(", "self", ",", "n_pairs", "=", "0", ",", "tol", "=", "10", "**", "(", "-", "8", ")", ",", "round_to", "=", "3", ")", ":", "if", "self", ".", "dir", "is", "None", ":", "output", "=", "None", "else", ":", "output"...
https://github.com/esa/pagmo/blob/80281d549c8f1b470e1489a5d37c8f06b2e429c0/PyGMO/util/_analysis.py#L544-L590
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py3/google/protobuf/descriptor_pool.py
python
DescriptorPool.AddSerializedFile
(self, serialized_file_desc_proto)
Adds the FileDescriptorProto and its types to this pool. Args: serialized_file_desc_proto (bytes): A bytes string, serialization of the :class:`FileDescriptorProto` to add.
Adds the FileDescriptorProto and its types to this pool.
[ "Adds", "the", "FileDescriptorProto", "and", "its", "types", "to", "this", "pool", "." ]
def AddSerializedFile(self, serialized_file_desc_proto): """Adds the FileDescriptorProto and its types to this pool. Args: serialized_file_desc_proto (bytes): A bytes string, serialization of the :class:`FileDescriptorProto` to add. """ # pylint: disable=g-import-not-at-top from goog...
[ "def", "AddSerializedFile", "(", "self", ",", "serialized_file_desc_proto", ")", ":", "# pylint: disable=g-import-not-at-top", "from", "google", ".", "protobuf", "import", "descriptor_pb2", "file_desc_proto", "=", "descriptor_pb2", ".", "FileDescriptorProto", ".", "FromStri...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py3/google/protobuf/descriptor_pool.py#L204-L216
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py2/numpy/lib/nanfunctions.py
python
nanvar
(a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue)
return var
Compute the variance along the specified axis, while ignoring NaNs. Returns the variance of the array elements, a measure of the spread of a distribution. The variance is computed for the flattened array by default, otherwise over the specified axis. For all-NaN slices or slices with zero degrees of ...
Compute the variance along the specified axis, while ignoring NaNs.
[ "Compute", "the", "variance", "along", "the", "specified", "axis", "while", "ignoring", "NaNs", "." ]
def nanvar(a, axis=None, dtype=None, out=None, ddof=0, keepdims=np._NoValue): """ Compute the variance along the specified axis, while ignoring NaNs. Returns the variance of the array elements, a measure of the spread of a distribution. The variance is computed for the flattened array by default, ...
[ "def", "nanvar", "(", "a", ",", "axis", "=", "None", ",", "dtype", "=", "None", ",", "out", "=", "None", ",", "ddof", "=", "0", ",", "keepdims", "=", "np", ".", "_NoValue", ")", ":", "arr", ",", "mask", "=", "_replace_nan", "(", "a", ",", "0", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py2/numpy/lib/nanfunctions.py#L1386-L1524
bcrusco/Forward-Plus-Renderer
1f130f1ae58882f651d94695823044f9833cfa30
Forward-Plus/Forward-Plus/external/assimp-3.1.1/port/PyAssimp/pyassimp/helper.py
python
hasattr_silent
(object, name)
Calls hasttr() with the given parameters and preserves the legacy (pre-Python 3.2) functionality of silently catching exceptions. Returns the result of hasatter() or False if an exception was raised.
Calls hasttr() with the given parameters and preserves the legacy (pre-Python 3.2) functionality of silently catching exceptions. Returns the result of hasatter() or False if an exception was raised.
[ "Calls", "hasttr", "()", "with", "the", "given", "parameters", "and", "preserves", "the", "legacy", "(", "pre", "-", "Python", "3", ".", "2", ")", "functionality", "of", "silently", "catching", "exceptions", ".", "Returns", "the", "result", "of", "hasatter",...
def hasattr_silent(object, name): """ Calls hasttr() with the given parameters and preserves the legacy (pre-Python 3.2) functionality of silently catching exceptions. Returns the result of hasatter() or False if an exception was raised. """ try: return hasattr(...
[ "def", "hasattr_silent", "(", "object", ",", "name", ")", ":", "try", ":", "return", "hasattr", "(", "object", ",", "name", ")", "except", ":", "return", "False" ]
https://github.com/bcrusco/Forward-Plus-Renderer/blob/1f130f1ae58882f651d94695823044f9833cfa30/Forward-Plus/Forward-Plus/external/assimp-3.1.1/port/PyAssimp/pyassimp/helper.py#L163-L174
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/builder.py
python
IRBuilder.mul
(self, lhs, rhs, name='')
Integer multiplication: name = lhs * rhs
Integer multiplication: name = lhs * rhs
[ "Integer", "multiplication", ":", "name", "=", "lhs", "*", "rhs" ]
def mul(self, lhs, rhs, name=''): """ Integer multiplication: name = lhs * rhs """
[ "def", "mul", "(", "self", ",", "lhs", ",", "rhs", ",", "name", "=", "''", ")", ":" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/builder.py#L388-L392
facebook/fbthrift
fb9c8562aba04c4fd9b17716eb5d970cc88a75bb
build/fbcode_builder/shell_quoting.py
python
ShellQuoted.format
(self, **kwargs)
return ShellQuoted( self.do_not_use_raw_str.format( **dict( (k, shell_quote(v).do_not_use_raw_str) for k, v in kwargs.items() ) ) )
Use instead of str.format() when the arguments are either `ShellQuoted()` or raw strings needing to be `shell_quote()`d. Positional args are deliberately not supported since they are more error-prone.
[]
def format(self, **kwargs): """ Use instead of str.format() when the arguments are either `ShellQuoted()` or raw strings needing to be `shell_quote()`d. Positional args are deliberately not supported since they are more error-prone. """ return ShellQuoted( ...
[ "def", "format", "(", "self", ",", "*", "*", "kwargs", ")", ":", "return", "ShellQuoted", "(", "self", ".", "do_not_use_raw_str", ".", "format", "(", "*", "*", "dict", "(", "(", "k", ",", "shell_quote", "(", "v", ")", ".", "do_not_use_raw_str", ")", ...
https://github.com/facebook/fbthrift/blob/fb9c8562aba04c4fd9b17716eb5d970cc88a75bb/build/fbcode_builder/shell_quoting.py#L49-L65
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/bindings/python/llvm/object.py
python
Symbol.name
(self)
return lib.LLVMGetSymbolName(self)
The str name of the symbol. This is often a function or variable name. Keep in mind that name mangling could be in effect.
The str name of the symbol.
[ "The", "str", "name", "of", "the", "symbol", "." ]
def name(self): """The str name of the symbol. This is often a function or variable name. Keep in mind that name mangling could be in effect. """ if self.expired: raise Exception('Symbol instance has expired.') return lib.LLVMGetSymbolName(self)
[ "def", "name", "(", "self", ")", ":", "if", "self", ".", "expired", ":", "raise", "Exception", "(", "'Symbol instance has expired.'", ")", "return", "lib", ".", "LLVMGetSymbolName", "(", "self", ")" ]
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/bindings/python/llvm/object.py#L302-L311
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunlink.py
python
generate
(env)
Add Builders and construction variables for Forte to an Environment.
Add Builders and construction variables for Forte to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "Forte", "to", "an", "Environment", "." ]
def generate(env): """Add Builders and construction variables for Forte to an Environment.""" link.generate(env) env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -G') env['RPATHPREFIX'] = '-R' env['RPATHSUFFIX'] = '' env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}' ...
[ "def", "generate", "(", "env", ")", ":", "link", ".", "generate", "(", "env", ")", "env", "[", "'SHLINKFLAGS'", "]", "=", "SCons", ".", "Util", ".", "CLVar", "(", "'$LINKFLAGS -G'", ")", "env", "[", "'RPATHPREFIX'", "]", "=", "'-R'", "env", "[", "'RP...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/sunlink.py#L59-L71
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/instrument.py
python
Instrument.position_currency
(self, position_currency)
Sets the position_currency of this Instrument. :param position_currency: The position_currency of this Instrument. # noqa: E501 :type: str
Sets the position_currency of this Instrument.
[ "Sets", "the", "position_currency", "of", "this", "Instrument", "." ]
def position_currency(self, position_currency): """Sets the position_currency of this Instrument. :param position_currency: The position_currency of this Instrument. # noqa: E501 :type: str """ self._position_currency = position_currency
[ "def", "position_currency", "(", "self", ",", "position_currency", ")", ":", "self", ".", "_position_currency", "=", "position_currency" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L908-L916
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/models/image/mnist/convolutional.py
python
data_type
()
Return the type of the activations, weights, and placeholder variables.
Return the type of the activations, weights, and placeholder variables.
[ "Return", "the", "type", "of", "the", "activations", "weights", "and", "placeholder", "variables", "." ]
def data_type(): """Return the type of the activations, weights, and placeholder variables.""" if FLAGS.use_fp16: return tf.float16 else: return tf.float32
[ "def", "data_type", "(", ")", ":", "if", "FLAGS", ".", "use_fp16", ":", "return", "tf", ".", "float16", "else", ":", "return", "tf", ".", "float32" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/models/image/mnist/convolutional.py#L54-L59
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/reshape.py
python
merge_sorted
( objs, keys=None, by_index=False, ignore_index=False, ascending=True, na_position="last", )
return result
Merge a list of sorted DataFrame or Series objects. Dataframes/Series in objs list MUST be pre-sorted by columns listed in `keys`, or by the index (if `by_index=True`). Parameters ---------- objs : list of DataFrame, Series, or Index keys : list, default None List of Column names to so...
Merge a list of sorted DataFrame or Series objects.
[ "Merge", "a", "list", "of", "sorted", "DataFrame", "or", "Series", "objects", "." ]
def merge_sorted( objs, keys=None, by_index=False, ignore_index=False, ascending=True, na_position="last", ): """Merge a list of sorted DataFrame or Series objects. Dataframes/Series in objs list MUST be pre-sorted by columns listed in `keys`, or by the index (if `by_index=True`). ...
[ "def", "merge_sorted", "(", "objs", ",", "keys", "=", "None", ",", "by_index", "=", "False", ",", "ignore_index", "=", "False", ",", "ascending", "=", "True", ",", "na_position", "=", "\"last\"", ",", ")", ":", "if", "not", "pd", ".", "api", ".", "ty...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/reshape.py#L755-L815
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/control/robotinterface.py
python
RobotInterfaceBase.sensorUpdateTime
(self, name: str)
Returns the clock time of the last sensor update.
Returns the clock time of the last sensor update.
[ "Returns", "the", "clock", "time", "of", "the", "last", "sensor", "update", "." ]
def sensorUpdateTime(self, name: str) -> float: """Returns the clock time of the last sensor update.""" raise NotImplementedError()
[ "def", "sensorUpdateTime", "(", "self", ",", "name", ":", "str", ")", "->", "float", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterface.py#L413-L415
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
RobotModelLink.isRevolute
(self)
return _robotsim.RobotModelLink_isRevolute(self)
isRevolute(RobotModelLink self) -> bool Returns whether the joint is revolute.
isRevolute(RobotModelLink self) -> bool
[ "isRevolute", "(", "RobotModelLink", "self", ")", "-", ">", "bool" ]
def isRevolute(self): """ isRevolute(RobotModelLink self) -> bool Returns whether the joint is revolute. """ return _robotsim.RobotModelLink_isRevolute(self)
[ "def", "isRevolute", "(", "self", ")", ":", "return", "_robotsim", ".", "RobotModelLink_isRevolute", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L3887-L3896
polyworld/polyworld
eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26
scripts/agent/plot/movie.py
python
compress_clusters
(clusters, min_size=700)
return new_clusters
Takes a set of clusters and collapses all clusters below min_size members into a single miscellaneous cluster. Returns the new list of clusters.
Takes a set of clusters and collapses all clusters below min_size members into a single miscellaneous cluster. Returns the new list of clusters.
[ "Takes", "a", "set", "of", "clusters", "and", "collapses", "all", "clusters", "below", "min_size", "members", "into", "a", "single", "miscellaneous", "cluster", ".", "Returns", "the", "new", "list", "of", "clusters", "." ]
def compress_clusters(clusters, min_size=700): """ Takes a set of clusters and collapses all clusters below min_size members into a single miscellaneous cluster. Returns the new list of clusters. """ # initialize new cluster list and misc cluster new_clusters = [] misc_cluster = [] # ap...
[ "def", "compress_clusters", "(", "clusters", ",", "min_size", "=", "700", ")", ":", "# initialize new cluster list and misc cluster", "new_clusters", "=", "[", "]", "misc_cluster", "=", "[", "]", "# append cluster to new cluster if over threshold, otherwise extend misc", "for...
https://github.com/polyworld/polyworld/blob/eb7e6bbc82fe77ba79e3bc48c3da2ad8c8238c26/scripts/agent/plot/movie.py#L70-L89
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/eager/context.py
python
Context.in_eager_mode
(self)
return self._eager_context.mode == EAGER_MODE
Returns True if current thread is in EAGER mode.
Returns True if current thread is in EAGER mode.
[ "Returns", "True", "if", "current", "thread", "is", "in", "EAGER", "mode", "." ]
def in_eager_mode(self): """Returns True if current thread is in EAGER mode.""" return self._eager_context.mode == EAGER_MODE
[ "def", "in_eager_mode", "(", "self", ")", ":", "return", "self", ".", "_eager_context", ".", "mode", "==", "EAGER_MODE" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/eager/context.py#L195-L197
gromacs/gromacs
7dec3a3f99993cf5687a122de3e12de31c21c399
docs/doxygen/doxygenxml.py
python
DocumentationSet.load_details
(self)
Load detailed XML files for each compound.
Load detailed XML files for each compound.
[ "Load", "detailed", "XML", "files", "for", "each", "compound", "." ]
def load_details(self): """Load detailed XML files for each compound.""" for compound in self._compounds.values(): compound.load_details() if isinstance(compound, File): self._files[compound.get_path()] = compound
[ "def", "load_details", "(", "self", ")", ":", "for", "compound", "in", "self", ".", "_compounds", ".", "values", "(", ")", ":", "compound", ".", "load_details", "(", ")", "if", "isinstance", "(", "compound", ",", "File", ")", ":", "self", ".", "_files"...
https://github.com/gromacs/gromacs/blob/7dec3a3f99993cf5687a122de3e12de31c21c399/docs/doxygen/doxygenxml.py#L1164-L1169
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py
python
IConversion.TextToOnlineStatus
(self, Text)
return self._TextTo('ols', Text)
Returns online status code. @param Text: Text, one of L{Online status<enums.olsUnknown>}. @type Text: unicode @return: Online status. @rtype: L{Online status<enums.olsUnknown>} @note: Currently, this method only checks if the given string is one of the allowed ones and r...
Returns online status code.
[ "Returns", "online", "status", "code", "." ]
def TextToOnlineStatus(self, Text): '''Returns online status code. @param Text: Text, one of L{Online status<enums.olsUnknown>}. @type Text: unicode @return: Online status. @rtype: L{Online status<enums.olsUnknown>} @note: Currently, this method only checks if the given ...
[ "def", "TextToOnlineStatus", "(", "self", ",", "Text", ")", ":", "return", "self", ".", "_TextTo", "(", "'ols'", ",", "Text", ")" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/conversion.py#L329-L339
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
boringssl/util/bot/go/bootstrap.py
python
check_hello_world
(toolset_root)
Compiles and runs 'hello world' program to verify that toolset works.
Compiles and runs 'hello world' program to verify that toolset works.
[ "Compiles", "and", "runs", "hello", "world", "program", "to", "verify", "that", "toolset", "works", "." ]
def check_hello_world(toolset_root): """Compiles and runs 'hello world' program to verify that toolset works.""" with temp_dir(toolset_root) as tmp: path = os.path.join(tmp, 'hello.go') write_file([path], r""" package main func main() { println("hello, world\n") } """) out = subproce...
[ "def", "check_hello_world", "(", "toolset_root", ")", ":", "with", "temp_dir", "(", "toolset_root", ")", "as", "tmp", ":", "path", "=", "os", ".", "path", ".", "join", "(", "tmp", ",", "'hello.go'", ")", "write_file", "(", "[", "path", "]", ",", "r\"\"...
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/boringssl/util/bot/go/bootstrap.py#L166-L181
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/dirichlet.py
python
Dirichlet.batch_shape
(self, name="batch_shape")
Batch dimensions of this instance as a 1-D int32 `Tensor`. The product of the dimensions of the `batch_shape` is the number of independent distributions of this kind the instance represents. Args: name: name to give to the op Returns: `Tensor` `batch_shape`
Batch dimensions of this instance as a 1-D int32 `Tensor`.
[ "Batch", "dimensions", "of", "this", "instance", "as", "a", "1", "-", "D", "int32", "Tensor", "." ]
def batch_shape(self, name="batch_shape"): """Batch dimensions of this instance as a 1-D int32 `Tensor`. The product of the dimensions of the `batch_shape` is the number of independent distributions of this kind the instance represents. Args: name: name to give to the op Returns: `Ten...
[ "def", "batch_shape", "(", "self", ",", "name", "=", "\"batch_shape\"", ")", ":", "with", "ops", ".", "name_scope", "(", "self", ".", "name", ")", ":", "with", "ops", ".", "op_scope", "(", "[", "self", ".", "_alpha", "]", ",", "name", ")", ":", "re...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/dirichlet.py#L181-L195
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/Resources/Python/Override/Lib/multiprocessing/__init__.py
python
Pool
(processes=None, initializer=None, initargs=(), maxtasksperchild=None)
return Pool(processes, initializer, initargs, maxtasksperchild)
Returns a process pool object
Returns a process pool object
[ "Returns", "a", "process", "pool", "object" ]
def Pool(processes=None, initializer=None, initargs=(), maxtasksperchild=None): ''' Returns a process pool object ''' from multiprocessing.pool import Pool return Pool(processes, initializer, initargs, maxtasksperchild)
[ "def", "Pool", "(", "processes", "=", "None", ",", "initializer", "=", "None", ",", "initargs", "=", "(", ")", ",", "maxtasksperchild", "=", "None", ")", ":", "from", "multiprocessing", ".", "pool", "import", "Pool", "return", "Pool", "(", "processes", "...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/Resources/Python/Override/Lib/multiprocessing/__init__.py#L227-L232
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/genericpath.py
python
samestat
(s1, s2)
return (s1.st_ino == s2.st_ino and s1.st_dev == s2.st_dev)
Test whether two stat buffers reference the same file
Test whether two stat buffers reference the same file
[ "Test", "whether", "two", "stat", "buffers", "reference", "the", "same", "file" ]
def samestat(s1, s2): """Test whether two stat buffers reference the same file""" return (s1.st_ino == s2.st_ino and s1.st_dev == s2.st_dev)
[ "def", "samestat", "(", "s1", ",", "s2", ")", ":", "return", "(", "s1", ".", "st_ino", "==", "s2", ".", "st_ino", "and", "s1", ".", "st_dev", "==", "s2", ".", "st_dev", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/genericpath.py#L87-L90
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/_feature_engineering/_autovectorizer.py
python
_interpretations_class.numerical__int
(self, column_name, output_column_prefix)
return self.__get_copy_transform(column_name, output_column_prefix)
Interprets an integer column as numerical.
Interprets an integer column as numerical.
[ "Interprets", "an", "integer", "column", "as", "numerical", "." ]
def numerical__int(self, column_name, output_column_prefix): """ Interprets an integer column as numerical. """ return self.__get_copy_transform(column_name, output_column_prefix)
[ "def", "numerical__int", "(", "self", ",", "column_name", ",", "output_column_prefix", ")", ":", "return", "self", ".", "__get_copy_transform", "(", "column_name", ",", "output_column_prefix", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/_feature_engineering/_autovectorizer.py#L388-L393
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/third_party/jinja2/environment.py
python
copy_cache
(cache)
return LRUCache(cache.capacity)
Create an empty copy of the given cache.
Create an empty copy of the given cache.
[ "Create", "an", "empty", "copy", "of", "the", "given", "cache", "." ]
def copy_cache(cache): """Create an empty copy of the given cache.""" if cache is None: return None elif type(cache) is dict: return {} return LRUCache(cache.capacity)
[ "def", "copy_cache", "(", "cache", ")", ":", "if", "cache", "is", "None", ":", "return", "None", "elif", "type", "(", "cache", ")", "is", "dict", ":", "return", "{", "}", "return", "LRUCache", "(", "cache", ".", "capacity", ")" ]
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/third_party/jinja2/environment.py#L69-L75
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
base/android/jni_generator/jni_generator.py
python
InlHeaderFileGenerator.GetLazyCalledByNativeMethodStub
(self, called_by_native)
return template.substitute(values)
Returns a string.
Returns a string.
[ "Returns", "a", "string", "." ]
def GetLazyCalledByNativeMethodStub(self, called_by_native): """Returns a string.""" function_signature_template = Template("""\ static ${RETURN_TYPE} Java_${JAVA_CLASS}_${METHOD_ID_VAR_NAME}(\ JNIEnv* env${FIRST_PARAM_IN_DECLARATION}${PARAMS_IN_DECLARATION})""") function_header_template = Template("""\ ${F...
[ "def", "GetLazyCalledByNativeMethodStub", "(", "self", ",", "called_by_native", ")", ":", "function_signature_template", "=", "Template", "(", "\"\"\"\\\nstatic ${RETURN_TYPE} Java_${JAVA_CLASS}_${METHOD_ID_VAR_NAME}(\\\nJNIEnv* env${FIRST_PARAM_IN_DECLARATION}${PARAMS_IN_DECLARATION})\"\"\"...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/base/android/jni_generator/jni_generator.py#L1108-L1139
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
TreeCtrl.Create
(*args, **kwargs)
return _controls_.TreeCtrl_Create(*args, **kwargs)
Create(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=TR_DEFAULT_STYLE, Validator validator=DefaultValidator, String name=TreeCtrlNameStr) -> bool Do the 2nd phase and create the GUI control.
Create(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=TR_DEFAULT_STYLE, Validator validator=DefaultValidator, String name=TreeCtrlNameStr) -> bool
[ "Create", "(", "self", "Window", "parent", "int", "id", "=", "-", "1", "Point", "pos", "=", "DefaultPosition", "Size", "size", "=", "DefaultSize", "long", "style", "=", "TR_DEFAULT_STYLE", "Validator", "validator", "=", "DefaultValidator", "String", "name", "=...
def Create(*args, **kwargs): """ Create(self, Window parent, int id=-1, Point pos=DefaultPosition, Size size=DefaultSize, long style=TR_DEFAULT_STYLE, Validator validator=DefaultValidator, String name=TreeCtrlNameStr) -> bool Do the 2nd phase and create th...
[ "def", "Create", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeCtrl_Create", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L5194-L5203
trailofbits/sienna-locomotive
09bc1a0bea7d7a33089422c62e0d3c715ecb7ce0
sl2/harness/config.py
python
update_config_from_args
()
Supplements the global configuration with command-line arguments passed by the user.
Supplements the global configuration with command-line arguments passed by the user.
[ "Supplements", "the", "global", "configuration", "with", "command", "-", "line", "arguments", "passed", "by", "the", "user", "." ]
def update_config_from_args(): """ Supplements the global configuration with command-line arguments passed by the user. """ global config # Convert numeric arguments into ints. for opt in INT_KEYS: if opt in config: config[opt] = int(config[opt]) # Convert command li...
[ "def", "update_config_from_args", "(", ")", ":", "global", "config", "# Convert numeric arguments into ints.", "for", "opt", "in", "INT_KEYS", ":", "if", "opt", "in", "config", ":", "config", "[", "opt", "]", "=", "int", "(", "config", "[", "opt", "]", ")", ...
https://github.com/trailofbits/sienna-locomotive/blob/09bc1a0bea7d7a33089422c62e0d3c715ecb7ce0/sl2/harness/config.py#L325-L368