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/lite/python/tflite_keras_util.py
python
_create_pseudo_names
(tensors, prefix)
return names
Creates pseudo {input | output} names for subclassed Models. Warning: this function should only be used to define default names for `Metics` and `SavedModel`. No other use cases should rely on a `Model`'s input or output names. Example with dict: `{'a': [x1, x2], 'b': x3}` becomes: `['a_1', 'a_2', 'b']` ...
Creates pseudo {input | output} names for subclassed Models.
[ "Creates", "pseudo", "{", "input", "|", "output", "}", "names", "for", "subclassed", "Models", "." ]
def _create_pseudo_names(tensors, prefix): """Creates pseudo {input | output} names for subclassed Models. Warning: this function should only be used to define default names for `Metics` and `SavedModel`. No other use cases should rely on a `Model`'s input or output names. Example with dict: `{'a': [x1, ...
[ "def", "_create_pseudo_names", "(", "tensors", ",", "prefix", ")", ":", "def", "one_index", "(", "ele", ")", ":", "# Start with \"output_1\" instead of \"output_0\".", "if", "isinstance", "(", "ele", ",", "int", ")", ":", "return", "ele", "+", "1", "return", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/lite/python/tflite_keras_util.py#L107-L149
kiwix/kiwix-xulrunner
38f4a10ae4b1585c16cb11730bb0dcc4924ae19f
android/gen-custom-android-build.py
python
step_move_apk_to_destination
(jsdata, **options)
place and rename built APKs to main output directory
place and rename built APKs to main output directory
[ "place", "and", "rename", "built", "APKs", "to", "main", "output", "directory" ]
def step_move_apk_to_destination(jsdata, **options): """ place and rename built APKs to main output directory """ move_to_current_folder() # ensure target directory exists (might not if kiwix was not built) try: os.makedirs(os.path.join(CURRENT_PATH, 'build', 'outputs', 'apk')) except OSEr...
[ "def", "step_move_apk_to_destination", "(", "jsdata", ",", "*", "*", "options", ")", ":", "move_to_current_folder", "(", ")", "# ensure target directory exists (might not if kiwix was not built)", "try", ":", "os", ".", "makedirs", "(", "os", ".", "path", ".", "join",...
https://github.com/kiwix/kiwix-xulrunner/blob/38f4a10ae4b1585c16cb11730bb0dcc4924ae19f/android/gen-custom-android-build.py#L528-L545
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/cpp_message.py
python
RepeatedScalarProperty
(cdescriptor)
return property(Getter, Setter, doc=doc)
Returns a Python property the given repeated scalar field.
Returns a Python property the given repeated scalar field.
[ "Returns", "a", "Python", "property", "the", "given", "repeated", "scalar", "field", "." ]
def RepeatedScalarProperty(cdescriptor): """Returns a Python property the given repeated scalar field.""" def Getter(self): container = self._composite_fields.get(cdescriptor.name, None) if container is None: container = RepeatedScalarContainer(self, cdescriptor) self._composite_fields[cdescrip...
[ "def", "RepeatedScalarProperty", "(", "cdescriptor", ")", ":", "def", "Getter", "(", "self", ")", ":", "container", "=", "self", ".", "_composite_fields", ".", "get", "(", "cdescriptor", ".", "name", ",", "None", ")", "if", "container", "is", "None", ":", ...
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/internal/cpp_message.py#L165-L180
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/WANDPowderReduction.py
python
WANDPowderReduction._expand_groups
(self)
return input_workspaces
expand workspace groups
expand workspace groups
[ "expand", "workspace", "groups" ]
def _expand_groups(self): """expand workspace groups""" workspaces = self.getProperty("InputWorkspace").value input_workspaces = [] for wsname in workspaces: wks = AnalysisDataService.retrieve(wsname) if isinstance(wks, WorkspaceGroup): input_works...
[ "def", "_expand_groups", "(", "self", ")", ":", "workspaces", "=", "self", ".", "getProperty", "(", "\"InputWorkspace\"", ")", ".", "value", "input_workspaces", "=", "[", "]", "for", "wsname", "in", "workspaces", ":", "wks", "=", "AnalysisDataService", ".", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/WANDPowderReduction.py#L277-L288
facebookarchive/LogDevice
ce7726050edc49a1e15d9160e81c890736b779e2
logdevice/ops/ldops/cluster.py
python
get_node_by_name
(client: AdminAPI, name: str)
return _get_node_by_node_config(resp.nodes[0])
Returns Node by node name Raises: logdevice.admin.exceptions.types.NodeNotReady: if node client is connected to is not ready yet to process request thrift.py3.TransportError: if there's network error while communicating with Thrift ldops.exceptions.NodeNotFoundError:...
Returns Node by node name
[ "Returns", "Node", "by", "node", "name" ]
async def get_node_by_name(client: AdminAPI, name: str) -> Node: """ Returns Node by node name Raises: logdevice.admin.exceptions.types.NodeNotReady: if node client is connected to is not ready yet to process request thrift.py3.TransportError: if there's network error while ...
[ "async", "def", "get_node_by_name", "(", "client", ":", "AdminAPI", ",", "name", ":", "str", ")", "->", "Node", ":", "resp", ":", "NodesConfigResponse", "=", "await", "admin_api", ".", "get_nodes_config", "(", "client", "=", "client", ",", "req", "=", "Nod...
https://github.com/facebookarchive/LogDevice/blob/ce7726050edc49a1e15d9160e81c890736b779e2/logdevice/ops/ldops/cluster.py#L103-L123
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/debug/framework.py
python
OnSessionInitResponse.__init__
(self, action)
Constructor. Args: action: (OnSessionInitAction) Debugger action to take on session init.
Constructor.
[ "Constructor", "." ]
def __init__(self, action): """Constructor. Args: action: (OnSessionInitAction) Debugger action to take on session init. """ _check_type(action, str) self.action = action
[ "def", "__init__", "(", "self", ",", "action", ")", ":", "_check_type", "(", "action", ",", "str", ")", "self", ".", "action", "=", "action" ]
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/debug/framework.py#L173-L180
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/sans/algorithm_detail/calibration.py
python
has_calibration_already_been_applied
(workspace, full_file_path)
return has_calibration_applied
Checks if particular calibration, defined by the file path has been applied to a workspace. :param workspace: The workspace which might have been calibrated :param full_file_path: An absolute file path to the calibration file. :return: True if the calibration has been applied else False
Checks if particular calibration, defined by the file path has been applied to a workspace.
[ "Checks", "if", "particular", "calibration", "defined", "by", "the", "file", "path", "has", "been", "applied", "to", "a", "workspace", "." ]
def has_calibration_already_been_applied(workspace, full_file_path): """ Checks if particular calibration, defined by the file path has been applied to a workspace. :param workspace: The workspace which might have been calibrated :param full_file_path: An absolute file path to the calibration file. ...
[ "def", "has_calibration_already_been_applied", "(", "workspace", ",", "full_file_path", ")", ":", "has_calibration_applied", "=", "False", "if", "has_tag", "(", "CALIBRATION_WORKSPACE_TAG", ",", "workspace", ")", ":", "value", "=", "get_tag", "(", "CALIBRATION_WORKSPACE...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/sans/algorithm_detail/calibration.py#L136-L148
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
lldb/examples/python/bsd.py
python
Object.save
(self, path=None, overwrite=False)
Save the contents of the object to disk using 'path' argument as the path, or save it to the current working directory using the object name.
Save the contents of the object to disk using 'path' argument as the path, or save it to the current working directory using the object name.
[ "Save", "the", "contents", "of", "the", "object", "to", "disk", "using", "path", "argument", "as", "the", "path", "or", "save", "it", "to", "the", "current", "working", "directory", "using", "the", "object", "name", "." ]
def save(self, path=None, overwrite=False): ''' Save the contents of the object to disk using 'path' argument as the path, or save it to the current working directory using the object name. ''' if path is None: path = self.name if not over...
[ "def", "save", "(", "self", ",", "path", "=", "None", ",", "overwrite", "=", "False", ")", ":", "if", "path", "is", "None", ":", "path", "=", "self", ".", "name", "if", "not", "overwrite", "and", "os", ".", "path", ".", "exists", "(", "path", ")"...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/lldb/examples/python/bsd.py#L81-L95
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
uCSIsVariationSelectorsSupplement
(code)
return ret
Check whether the character is part of VariationSelectorsSupplement UCS Block
Check whether the character is part of VariationSelectorsSupplement UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "VariationSelectorsSupplement", "UCS", "Block" ]
def uCSIsVariationSelectorsSupplement(code): """Check whether the character is part of VariationSelectorsSupplement UCS Block """ ret = libxml2mod.xmlUCSIsVariationSelectorsSupplement(code) return ret
[ "def", "uCSIsVariationSelectorsSupplement", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsVariationSelectorsSupplement", "(", "code", ")", "return", "ret" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L2973-L2977
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/ir_utils.py
python
convert_code_obj_to_function
(code_obj, caller_ir)
return _create_function_from_code_obj(fcode, func_env, func_arg, func_clo, glbls)
Converts a code object from a `make_function.code` attr in the IR into a python function, caller_ir is the FunctionIR of the caller and is used for the resolution of freevars.
Converts a code object from a `make_function.code` attr in the IR into a python function, caller_ir is the FunctionIR of the caller and is used for the resolution of freevars.
[ "Converts", "a", "code", "object", "from", "a", "make_function", ".", "code", "attr", "in", "the", "IR", "into", "a", "python", "function", "caller_ir", "is", "the", "FunctionIR", "of", "the", "caller", "and", "is", "used", "for", "the", "resolution", "of"...
def convert_code_obj_to_function(code_obj, caller_ir): """ Converts a code object from a `make_function.code` attr in the IR into a python function, caller_ir is the FunctionIR of the caller and is used for the resolution of freevars. """ fcode = code_obj.code nfree = len(fcode.co_freevars) ...
[ "def", "convert_code_obj_to_function", "(", "code_obj", ",", "caller_ir", ")", ":", "fcode", "=", "code_obj", ".", "code", "nfree", "=", "len", "(", "fcode", ".", "co_freevars", ")", "# try and resolve freevars if they are consts in the caller's IR", "# these can be baked...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/ir_utils.py#L2096-L2161
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/upgrade_arch.py
python
upgrade_device_layout
(arch)
return changed
Upgrades the legacy <gridlocation> specifications (on each pb_type) to the new format placed under the <layout> tag.
Upgrades the legacy <gridlocation> specifications (on each pb_type) to the new format placed under the <layout> tag.
[ "Upgrades", "the", "legacy", "<gridlocation", ">", "specifications", "(", "on", "each", "pb_type", ")", "to", "the", "new", "format", "placed", "under", "the", "<layout", ">", "tag", "." ]
def upgrade_device_layout(arch): """ Upgrades the legacy <gridlocation> specifications (on each pb_type) to the new format placed under the <layout> tag. """ changed = False # Get the layout tag layout = arch.find("./layout") # Find all the top level pb_types top_pb_types = arch.fi...
[ "def", "upgrade_device_layout", "(", "arch", ")", ":", "changed", "=", "False", "# Get the layout tag", "layout", "=", "arch", ".", "find", "(", "\"./layout\"", ")", "# Find all the top level pb_types", "top_pb_types", "=", "arch", ".", "findall", "(", "\"./complexb...
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/upgrade_arch.py#L331-L553
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/html5lib/html5parser.py
python
HTMLParser.parse
(self, stream, *args, **kwargs)
return self.tree.getDocument()
Parse a HTML document into a well-formed tree :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or l...
Parse a HTML document into a well-formed tree
[ "Parse", "a", "HTML", "document", "into", "a", "well", "-", "formed", "tree" ]
def parse(self, stream, *args, **kwargs): """Parse a HTML document into a well-formed tree :arg stream: a file-like object or string containing the HTML to be parsed The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding...
[ "def", "parse", "(", "self", ",", "stream", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_parse", "(", "stream", ",", "False", ",", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", "return", "self", ".", "tree", "."...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/html5lib/html5parser.py#L523-L569
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py
python
QueueBase._dequeue_return_value
(self, tensors)
Return the value to return from a dequeue op. If the queue has names, return a dictionary with the names as keys. Otherwise return either a single tensor or a list of tensors depending on the length of `tensors`. Args: tensors: List of tensors from the dequeue op. Returns: A single t...
Return the value to return from a dequeue op.
[ "Return", "the", "value", "to", "return", "from", "a", "dequeue", "op", "." ]
def _dequeue_return_value(self, tensors): """Return the value to return from a dequeue op. If the queue has names, return a dictionary with the names as keys. Otherwise return either a single tensor or a list of tensors depending on the length of `tensors`. Args: tensors: List of tensors fr...
[ "def", "_dequeue_return_value", "(", "self", ",", "tensors", ")", ":", "if", "self", ".", "_names", ":", "# The returned values in `tensors` are in the same order as", "# the names in `self._names`.", "return", "{", "n", ":", "tensors", "[", "i", "]", "for", "i", ",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/data_flow_ops.py#L350-L371
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/inplace_ops.py
python
inplace_add
(x, i, v)
return alias_inplace_add(gen_array_ops.deep_copy(x), i, v)
Applies an inplace add on input x at index i with value v. Note that this function is not actually inplace - it allocates a copy of x. The utility is not avoiding memory copies but rather specifying a sparse update. If i is None, x and v must be the same shape. Computes y = x; y += v; If i is a scalar,...
Applies an inplace add on input x at index i with value v.
[ "Applies", "an", "inplace", "add", "on", "input", "x", "at", "index", "i", "with", "value", "v", "." ]
def inplace_add(x, i, v): """Applies an inplace add on input x at index i with value v. Note that this function is not actually inplace - it allocates a copy of x. The utility is not avoiding memory copies but rather specifying a sparse update. If i is None, x and v must be the same shape. Computes y =...
[ "def", "inplace_add", "(", "x", ",", "i", ",", "v", ")", ":", "return", "alias_inplace_add", "(", "gen_array_ops", ".", "deep_copy", "(", "x", ")", ",", "i", ",", "v", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/inplace_ops.py#L198-L221
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
chrome/tools/build/win/resedit.py
python
_ResourceEditor.__init__
(self, input_file, output_file)
Create a new editor. Args: input_file: path to the input file. output_file: (optional) path to the output file.
Create a new editor.
[ "Create", "a", "new", "editor", "." ]
def __init__(self, input_file, output_file): """Create a new editor. Args: input_file: path to the input file. output_file: (optional) path to the output file. """ self._input_file = input_file self._output_file = output_file self._modified = False self._module = None se...
[ "def", "__init__", "(", "self", ",", "input_file", ",", "output_file", ")", ":", "self", ".", "_input_file", "=", "input_file", "self", ".", "_output_file", "=", "output_file", "self", ".", "_modified", "=", "False", "self", ".", "_module", "=", "None", "s...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/tools/build/win/resedit.py#L52-L65
apple/swift-lldb
d74be846ef3e62de946df343e8c234bde93a8912
scripts/Python/static-binding/lldb.py
python
SBModule.FindCompileUnits
(self, sb_file_spec)
return _lldb.SBModule_FindCompileUnits(self, sb_file_spec)
FindCompileUnits(SBModule self, SBFileSpec sb_file_spec) -> SBSymbolContextList Find compile units related to *this module and passed source file. @param[in] sb_file_spec A lldb::SBFileSpec object that contains source file specification. @return A ...
FindCompileUnits(SBModule self, SBFileSpec sb_file_spec) -> SBSymbolContextList
[ "FindCompileUnits", "(", "SBModule", "self", "SBFileSpec", "sb_file_spec", ")", "-", ">", "SBSymbolContextList" ]
def FindCompileUnits(self, sb_file_spec): """ FindCompileUnits(SBModule self, SBFileSpec sb_file_spec) -> SBSymbolContextList Find compile units related to *this module and passed source file. @param[in] sb_file_spec A lldb::SBFileSpec object that contains source f...
[ "def", "FindCompileUnits", "(", "self", ",", "sb_file_spec", ")", ":", "return", "_lldb", ".", "SBModule_FindCompileUnits", "(", "self", ",", "sb_file_spec", ")" ]
https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L7283-L7299
shogun-toolbox/shogun
9b8d856971af5a295dd6ad70623ae45647a6334c
examples/meta/generator/parse.py
python
FastParser.p_objectType
(self, p)
objecttype : IDENTIFIER
objecttype : IDENTIFIER
[ "objecttype", ":", "IDENTIFIER" ]
def p_objectType(self, p): "objecttype : IDENTIFIER" p[0] = {"ObjectType": p[1]}
[ "def", "p_objectType", "(", "self", ",", "p", ")", ":", "p", "[", "0", "]", "=", "{", "\"ObjectType\"", ":", "p", "[", "1", "]", "}" ]
https://github.com/shogun-toolbox/shogun/blob/9b8d856971af5a295dd6ad70623ae45647a6334c/examples/meta/generator/parse.py#L186-L188
sfzhang15/FaceBoxes
b52cc92f9362d3adc08d54666aeb9ebb62fdb7da
scripts/cpp_lint.py
python
FileInfo.FullName
(self)
return os.path.abspath(self._filename).replace('\\', '/')
Make Windows paths like Unix.
Make Windows paths like Unix.
[ "Make", "Windows", "paths", "like", "Unix", "." ]
def FullName(self): """Make Windows paths like Unix.""" return os.path.abspath(self._filename).replace('\\', '/')
[ "def", "FullName", "(", "self", ")", ":", "return", "os", ".", "path", ".", "abspath", "(", "self", ".", "_filename", ")", ".", "replace", "(", "'\\\\'", ",", "'/'", ")" ]
https://github.com/sfzhang15/FaceBoxes/blob/b52cc92f9362d3adc08d54666aeb9ebb62fdb7da/scripts/cpp_lint.py#L881-L883
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/util/android_chrome_version.py
python
GenerateVersionCodes
(version_values, arch, is_next_build)
return version_codes
Build dict of version codes for the specified build architecture. Eg: { 'CHROME_VERSION_CODE': '378100010', 'MONOCHROME_VERSION_CODE': '378100013', ... } versionCode values are built like this: {full BUILD int}{3 digits: PATCH}{1 digit: package}{1 digit: ABIs}. MAJOR and MINOR values are not us...
Build dict of version codes for the specified build architecture. Eg:
[ "Build", "dict", "of", "version", "codes", "for", "the", "specified", "build", "architecture", ".", "Eg", ":" ]
def GenerateVersionCodes(version_values, arch, is_next_build): """Build dict of version codes for the specified build architecture. Eg: { 'CHROME_VERSION_CODE': '378100010', 'MONOCHROME_VERSION_CODE': '378100013', ... } versionCode values are built like this: {full BUILD int}{3 digits: PATCH}{1 ...
[ "def", "GenerateVersionCodes", "(", "version_values", ",", "arch", ",", "is_next_build", ")", ":", "base_version_code", "=", "int", "(", "'%s%03d00'", "%", "(", "version_values", "[", "'BUILD'", "]", ",", "int", "(", "version_values", "[", "'PATCH'", "]", ")",...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/util/android_chrome_version.py#L172-L214
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
PrintData.__init__
(self, *args)
__init__(self) -> PrintData __init__(self, PrintData data) -> PrintData
__init__(self) -> PrintData __init__(self, PrintData data) -> PrintData
[ "__init__", "(", "self", ")", "-", ">", "PrintData", "__init__", "(", "self", "PrintData", "data", ")", "-", ">", "PrintData" ]
def __init__(self, *args): """ __init__(self) -> PrintData __init__(self, PrintData data) -> PrintData """ _windows_.PrintData_swiginit(self,_windows_.new_PrintData(*args))
[ "def", "__init__", "(", "self", ",", "*", "args", ")", ":", "_windows_", ".", "PrintData_swiginit", "(", "self", ",", "_windows_", ".", "new_PrintData", "(", "*", "args", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L4702-L4707
facebookresearch/ELF
1f790173095cd910976d9f651b80beb872ec5d12
vendor/pybind11/tools/clang/cindex.py
python
CursorKind.is_translation_unit
(self)
return conf.lib.clang_isTranslationUnit(self)
Test if this is a translation unit kind.
Test if this is a translation unit kind.
[ "Test", "if", "this", "is", "a", "translation", "unit", "kind", "." ]
def is_translation_unit(self): """Test if this is a translation unit kind.""" return conf.lib.clang_isTranslationUnit(self)
[ "def", "is_translation_unit", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_isTranslationUnit", "(", "self", ")" ]
https://github.com/facebookresearch/ELF/blob/1f790173095cd910976d9f651b80beb872ec5d12/vendor/pybind11/tools/clang/cindex.py#L600-L602
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
iOHTTPMatch
(filename)
return ret
check if the URI matches an HTTP one
check if the URI matches an HTTP one
[ "check", "if", "the", "URI", "matches", "an", "HTTP", "one" ]
def iOHTTPMatch(filename): """check if the URI matches an HTTP one """ ret = libxml2mod.xmlIOHTTPMatch(filename) return ret
[ "def", "iOHTTPMatch", "(", "filename", ")", ":", "ret", "=", "libxml2mod", ".", "xmlIOHTTPMatch", "(", "filename", ")", "return", "ret" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L1893-L1896
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/more-itertools/py3/more_itertools/recipes.py
python
first_true
(iterable, default=None, pred=None)
return next(filter(pred, iterable), default)
Returns the first true value in the iterable. If no true value is found, returns *default* If *pred* is not None, returns the first item for which ``pred(item) == True`` . >>> first_true(range(10)) 1 >>> first_true(range(10), pred=lambda x: x > 5) 6 >>> first_true(...
Returns the first true value in the iterable.
[ "Returns", "the", "first", "true", "value", "in", "the", "iterable", "." ]
def first_true(iterable, default=None, pred=None): """ Returns the first true value in the iterable. If no true value is found, returns *default* If *pred* is not None, returns the first item for which ``pred(item) == True`` . >>> first_true(range(10)) 1 >>> first_true(ran...
[ "def", "first_true", "(", "iterable", ",", "default", "=", "None", ",", "pred", "=", "None", ")", ":", "return", "next", "(", "filter", "(", "pred", ",", "iterable", ")", ",", "default", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/more-itertools/py3/more_itertools/recipes.py#L468-L485
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.SetPrintColourMode
(*args, **kwargs)
return _stc.StyledTextCtrl_SetPrintColourMode(*args, **kwargs)
SetPrintColourMode(self, int mode) Modify colours when printing for clearer printed text.
SetPrintColourMode(self, int mode)
[ "SetPrintColourMode", "(", "self", "int", "mode", ")" ]
def SetPrintColourMode(*args, **kwargs): """ SetPrintColourMode(self, int mode) Modify colours when printing for clearer printed text. """ return _stc.StyledTextCtrl_SetPrintColourMode(*args, **kwargs)
[ "def", "SetPrintColourMode", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_SetPrintColourMode", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3480-L3486
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/xml/sax/handler.py
python
ContentHandler.startPrefixMapping
(self, prefix, uri)
Begin the scope of a prefix-URI Namespace mapping. The information from this event is not necessary for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the http://xml.org/sax/features/namespaces feature is true (th...
Begin the scope of a prefix-URI Namespace mapping.
[ "Begin", "the", "scope", "of", "a", "prefix", "-", "URI", "Namespace", "mapping", "." ]
def startPrefixMapping(self, prefix, uri): """Begin the scope of a prefix-URI Namespace mapping. The information from this event is not necessary for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the http...
[ "def", "startPrefixMapping", "(", "self", ",", "prefix", ",", "uri", ")", ":" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/sax/handler.py#L96-L117
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/base_widget.py
python
BaseWidget.data_save_dialog
(self, data_type=None, title=None)
return QFileInfo(fname).filePath()
Pop up a save file dialog box. @param data_type: string used to filter the files @param title: string to use as title
Pop up a save file dialog box.
[ "Pop", "up", "a", "save", "file", "dialog", "box", "." ]
def data_save_dialog(self, data_type=None, title=None): """ Pop up a save file dialog box. @param data_type: string used to filter the files @param title: string to use as title """ if data_type is None: data_type = self._data_type if title...
[ "def", "data_save_dialog", "(", "self", ",", "data_type", "=", "None", ",", "title", "=", "None", ")", ":", "if", "data_type", "is", "None", ":", "data_type", "=", "self", ".", "_data_type", "if", "title", "is", "None", ":", "title", "=", "\"Save file - ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/base_widget.py#L160-L175
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Scripting.py
python
Dist.get_arch_name
(self)
return self.arch_name
Returns the archive file name. Set the attribute *arch_name* to change the default value:: def dist(ctx): ctx.arch_name = 'ctx.tar.bz2' :rtype: string
Returns the archive file name. Set the attribute *arch_name* to change the default value::
[ "Returns", "the", "archive", "file", "name", ".", "Set", "the", "attribute", "*", "arch_name", "*", "to", "change", "the", "default", "value", "::" ]
def get_arch_name(self): """ Returns the archive file name. Set the attribute *arch_name* to change the default value:: def dist(ctx): ctx.arch_name = 'ctx.tar.bz2' :rtype: string """ try: self.arch_name except AttributeError: self.arch_name = self.get_base_name() + '.' + self.ext_algo.get(...
[ "def", "get_arch_name", "(", "self", ")", ":", "try", ":", "self", ".", "arch_name", "except", "AttributeError", ":", "self", ".", "arch_name", "=", "self", ".", "get_base_name", "(", ")", "+", "'.'", "+", "self", ".", "ext_algo", ".", "get", "(", "sel...
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Scripting.py#L438-L452
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/optimize/minpack.py
python
curve_fit
(f, xdata, ydata, p0=None, sigma=None, absolute_sigma=False, check_finite=True, bounds=(-np.inf, np.inf), method=None, jac=None, **kwargs)
Use non-linear least squares to fit a function, f, to data. Assumes ``ydata = f(xdata, *params) + eps`` Parameters ---------- f : callable The model function, f(x, ...). It must take the independent variable as the first argument and the parameters to fit as separate remaining...
Use non-linear least squares to fit a function, f, to data.
[ "Use", "non", "-", "linear", "least", "squares", "to", "fit", "a", "function", "f", "to", "data", "." ]
def curve_fit(f, xdata, ydata, p0=None, sigma=None, absolute_sigma=False, check_finite=True, bounds=(-np.inf, np.inf), method=None, jac=None, **kwargs): """ Use non-linear least squares to fit a function, f, to data. Assumes ``ydata = f(xdata, *params) + eps`` Parameters ...
[ "def", "curve_fit", "(", "f", ",", "xdata", ",", "ydata", ",", "p0", "=", "None", ",", "sigma", "=", "None", ",", "absolute_sigma", "=", "False", ",", "check_finite", "=", "True", ",", "bounds", "=", "(", "-", "np", ".", "inf", ",", "np", ".", "i...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/optimize/minpack.py#L504-L796
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/MooseDocs/base/renderers.py
python
LatexRenderer.addPreamble
(self, node)
Add a string to the preamble (see pdf.py).
Add a string to the preamble (see pdf.py).
[ "Add", "a", "string", "to", "the", "preamble", "(", "see", "pdf", ".", "py", ")", "." ]
def addPreamble(self, node): """ Add a string to the preamble (see pdf.py). """ self._preamble.append(node)
[ "def", "addPreamble", "(", "self", ",", "node", ")", ":", "self", ".", "_preamble", ".", "append", "(", "node", ")" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/MooseDocs/base/renderers.py#L421-L425
rbgirshick/caffe-fast-rcnn
28a579eaf0668850705598b3075b8969f22226d9
scripts/cpp_lint.py
python
FindStartOfExpressionInLine
(line, endpos, depth, startchar, endchar)
return (-1, depth)
Find position at the matching startchar. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching at this position. depth: nesting level at endpos. startchar: expression...
Find position at the matching startchar.
[ "Find", "position", "at", "the", "matching", "startchar", "." ]
def FindStartOfExpressionInLine(line, endpos, depth, startchar, endchar): """Find position at the matching startchar. This is almost the reverse of FindEndOfExpressionInLine, but note that the input position and returned position differs by 1. Args: line: a CleansedLines line. endpos: start searching ...
[ "def", "FindStartOfExpressionInLine", "(", "line", ",", "endpos", ",", "depth", ",", "startchar", ",", "endchar", ")", ":", "for", "i", "in", "xrange", "(", "endpos", ",", "-", "1", ",", "-", "1", ")", ":", "if", "line", "[", "i", "]", "==", "endch...
https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/scripts/cpp_lint.py#L1300-L1324
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/android/loading/common_util.py
python
GetCommandLineForLogging
(cmd, env_diff=None)
return cmd_str + subprocess.list2cmdline(cmd)
Get command line string. Args: cmd: Command line argument env_diff: Environment modification for the command line. Returns: Command line string.
Get command line string.
[ "Get", "command", "line", "string", "." ]
def GetCommandLineForLogging(cmd, env_diff=None): """Get command line string. Args: cmd: Command line argument env_diff: Environment modification for the command line. Returns: Command line string. """ cmd_str = '' if env_diff: for key, value in env_diff.iteritems(): cmd_str += '{}={...
[ "def", "GetCommandLineForLogging", "(", "cmd", ",", "env_diff", "=", "None", ")", ":", "cmd_str", "=", "''", "if", "env_diff", ":", "for", "key", ",", "value", "in", "env_diff", ".", "iteritems", "(", ")", ":", "cmd_str", "+=", "'{}={} '", ".", "format",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/loading/common_util.py#L103-L117
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/stc.py
python
StyledTextCtrl.AutoCompStops
(*args, **kwargs)
return _stc.StyledTextCtrl_AutoCompStops(*args, **kwargs)
AutoCompStops(self, String characterSet) Define a set of character that when typed cancel the auto-completion list.
AutoCompStops(self, String characterSet)
[ "AutoCompStops", "(", "self", "String", "characterSet", ")" ]
def AutoCompStops(*args, **kwargs): """ AutoCompStops(self, String characterSet) Define a set of character that when typed cancel the auto-completion list. """ return _stc.StyledTextCtrl_AutoCompStops(*args, **kwargs)
[ "def", "AutoCompStops", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_AutoCompStops", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/stc.py#L3070-L3076
NREL/EnergyPlus
fadc5973b85c70e8cc923efb69c144e808a26078
src/EnergyPlus/api/func.py
python
Functional.callback_error
(self, state, f: FunctionType)
This function allows a client to register a function to be called back by EnergyPlus when an error message is added to the error file. The user can then detect specific error messages or whatever. :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()...
This function allows a client to register a function to be called back by EnergyPlus when an error message is added to the error file. The user can then detect specific error messages or whatever.
[ "This", "function", "allows", "a", "client", "to", "register", "a", "function", "to", "be", "called", "back", "by", "EnergyPlus", "when", "an", "error", "message", "is", "added", "to", "the", "error", "file", ".", "The", "user", "can", "then", "detect", ...
def callback_error(self, state, f: FunctionType) -> None: """ This function allows a client to register a function to be called back by EnergyPlus when an error message is added to the error file. The user can then detect specific error messages or whatever. :param state: An active Ene...
[ "def", "callback_error", "(", "self", ",", "state", ",", "f", ":", "FunctionType", ")", "->", "None", ":", "cb_ptr", "=", "self", ".", "py_error_callback_type", "(", "f", ")", "error_callbacks", ".", "append", "(", "cb_ptr", ")", "self", ".", "api", ".",...
https://github.com/NREL/EnergyPlus/blob/fadc5973b85c70e8cc923efb69c144e808a26078/src/EnergyPlus/api/func.py#L644-L655
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/pipeline/sync/skip/portal.py
python
Portal.copy
(self, prev_stream: AbstractStream, next_stream: AbstractStream, phony: Tensor,)
return PortalCopy.apply(self, prev_stream, next_stream, phony)
Copies the hidden tensor by a :class:`PortalCopy`. Give a phony and use the returning phony to keep backpropagation:: +-- PortalCopy --+ | | -- Fork ---------- Join --
Copies the hidden tensor by a :class:`PortalCopy`.
[ "Copies", "the", "hidden", "tensor", "by", "a", ":", "class", ":", "PortalCopy", "." ]
def copy(self, prev_stream: AbstractStream, next_stream: AbstractStream, phony: Tensor,) -> Tensor: """Copies the hidden tensor by a :class:`PortalCopy`. Give a phony and use the returning phony to keep backpropagation:: +-- PortalCopy --+ | | ...
[ "def", "copy", "(", "self", ",", "prev_stream", ":", "AbstractStream", ",", "next_stream", ":", "AbstractStream", ",", "phony", ":", "Tensor", ",", ")", "->", "Tensor", ":", "if", "self", ".", "tensor", "is", "None", ":", "return", "get_phony", "(", "tor...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/pipeline/sync/skip/portal.py#L73-L86
google/flatbuffers
b3006913369e0a7550795e477011ac5bebb93497
python/flatbuffers/flexbuffers.py
python
Builder.IndirectUInt
(self, value, byte_width=0)
Encodes unsigned integer value indirectly. Args: value: An unsigned integer value. byte_width: Number of bytes to use: 1, 2, 4, or 8.
Encodes unsigned integer value indirectly.
[ "Encodes", "unsigned", "integer", "value", "indirectly", "." ]
def IndirectUInt(self, value, byte_width=0): """Encodes unsigned integer value indirectly. Args: value: An unsigned integer value. byte_width: Number of bytes to use: 1, 2, 4, or 8. """ bit_width = BitWidth.U(value) if byte_width == 0 else BitWidth.B(byte_width) self._PushIndirect(value...
[ "def", "IndirectUInt", "(", "self", ",", "value", ",", "byte_width", "=", "0", ")", ":", "bit_width", "=", "BitWidth", ".", "U", "(", "value", ")", "if", "byte_width", "==", "0", "else", "BitWidth", ".", "B", "(", "byte_width", ")", "self", ".", "_Pu...
https://github.com/google/flatbuffers/blob/b3006913369e0a7550795e477011ac5bebb93497/python/flatbuffers/flexbuffers.py#L1264-L1272
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/signal/filter_design.py
python
_zpklp2lp
(z, p, k, wo=1.0)
return z_lp, p_lp, k_lp
r""" Transform a lowpass filter prototype to a different frequency. Return an analog low-pass filter with cutoff frequency `wo` from an analog low-pass filter prototype with unity cutoff frequency, using zeros, poles, and gain ('zpk') representation. Parameters ---------- z : array_like ...
r""" Transform a lowpass filter prototype to a different frequency.
[ "r", "Transform", "a", "lowpass", "filter", "prototype", "to", "a", "different", "frequency", "." ]
def _zpklp2lp(z, p, k, wo=1.0): r""" Transform a lowpass filter prototype to a different frequency. Return an analog low-pass filter with cutoff frequency `wo` from an analog low-pass filter prototype with unity cutoff frequency, using zeros, poles, and gain ('zpk') representation. Parameters ...
[ "def", "_zpklp2lp", "(", "z", ",", "p", ",", "k", ",", "wo", "=", "1.0", ")", ":", "z", "=", "atleast_1d", "(", "z", ")", "p", "=", "atleast_1d", "(", "p", ")", "wo", "=", "float", "(", "wo", ")", "# Avoid int wraparound", "degree", "=", "_relati...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/filter_design.py#L1786-L1836
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/internal/backends/android_app_backend.py
python
AndroidAppBackend.Start
(self)
Start an Android app and wait for it to finish launching. If the app has webviews, the app is launched with the suitable command line arguments. AppStory derivations can customize the wait-for-ready-state to wait for a more specific event if needed.
Start an Android app and wait for it to finish launching.
[ "Start", "an", "Android", "app", "and", "wait", "for", "it", "to", "finish", "launching", "." ]
def Start(self): """Start an Android app and wait for it to finish launching. If the app has webviews, the app is launched with the suitable command line arguments. AppStory derivations can customize the wait-for-ready-state to wait for a more specific event if needed. """ if self._app_has...
[ "def", "Start", "(", "self", ")", ":", "if", "self", ".", "_app_has_webviews", ":", "webview_startup_args", "=", "self", ".", "GetWebviewStartupArgs", "(", ")", "backend_settings", "=", "(", "android_browser_backend_settings", ".", "WebviewBackendSettings", "(", "'a...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/backends/android_app_backend.py#L58-L77
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
TextCtrl.IsMultiLine
(*args, **kwargs)
return _controls_.TextCtrl_IsMultiLine(*args, **kwargs)
IsMultiLine(self) -> bool
IsMultiLine(self) -> bool
[ "IsMultiLine", "(", "self", ")", "-", ">", "bool" ]
def IsMultiLine(*args, **kwargs): """IsMultiLine(self) -> bool""" return _controls_.TextCtrl_IsMultiLine(*args, **kwargs)
[ "def", "IsMultiLine", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TextCtrl_IsMultiLine", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L2035-L2037
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/training/momentum.py
python
MomentumOptimizer.__init__
(self, learning_rate, momentum, use_locking=False, name="Momentum", use_nesterov=False)
Construct a new Momentum optimizer. Args: learning_rate: A `Tensor` or a floating point value. The learning rate. momentum: A `Tensor` or a floating point value. The momentum. use_locking: If `True` use locks for update operations. name: Optional name prefix for the operations created whe...
Construct a new Momentum optimizer.
[ "Construct", "a", "new", "Momentum", "optimizer", "." ]
def __init__(self, learning_rate, momentum, use_locking=False, name="Momentum", use_nesterov=False): """Construct a new Momentum optimizer. Args: learning_rate: A `Tensor` or a floating point value. The learning rate. momentum: A `Tensor` or a floating point value. The momentum. ...
[ "def", "__init__", "(", "self", ",", "learning_rate", ",", "momentum", ",", "use_locking", "=", "False", ",", "name", "=", "\"Momentum\"", ",", "use_nesterov", "=", "False", ")", ":", "super", "(", "MomentumOptimizer", ",", "self", ")", ".", "__init__", "(...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/momentum.py#L33-L47
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py
python
Distribution.load_entry_point
(self, group, name)
return ep.load()
Return the `name` entry point of `group` or raise ImportError
Return the `name` entry point of `group` or raise ImportError
[ "Return", "the", "name", "entry", "point", "of", "group", "or", "raise", "ImportError" ]
def load_entry_point(self, group, name): """Return the `name` entry point of `group` or raise ImportError""" ep = self.get_entry_info(group, name) if ep is None: raise ImportError("Entry point %r not found" % ((group, name),)) return ep.load()
[ "def", "load_entry_point", "(", "self", ",", "group", ",", "name", ")", ":", "ep", "=", "self", ".", "get_entry_info", "(", "group", ",", "name", ")", "if", "ep", "is", "None", ":", "raise", "ImportError", "(", "\"Entry point %r not found\"", "%", "(", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py#L5693-L5703
chanyn/3Dpose_ssl
585696676279683a279b1ecca136c0e0d02aef2a
tensorflow/m_refine_v2.py
python
kaiming
(shape, dtype, partition_info=None)
return(tf.truncated_normal(shape, dtype=dtype)*tf.sqrt(2/float(shape[0])))
Kaiming initialization as described in https://arxiv.org/pdf/1502.01852.pdf Args shape: dimensions of the tf array to initialize dtype: data type of the array partition_info: (Optional) info about how the variable is partitioned. See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/p...
Kaiming initialization as described in https://arxiv.org/pdf/1502.01852.pdf
[ "Kaiming", "initialization", "as", "described", "in", "https", ":", "//", "arxiv", ".", "org", "/", "pdf", "/", "1502", ".", "01852", ".", "pdf" ]
def kaiming(shape, dtype, partition_info=None): """Kaiming initialization as described in https://arxiv.org/pdf/1502.01852.pdf Args shape: dimensions of the tf array to initialize dtype: data type of the array partition_info: (Optional) info about how the variable is partitioned. See https://gith...
[ "def", "kaiming", "(", "shape", ",", "dtype", ",", "partition_info", "=", "None", ")", ":", "return", "(", "tf", ".", "truncated_normal", "(", "shape", ",", "dtype", "=", "dtype", ")", "*", "tf", ".", "sqrt", "(", "2", "/", "float", "(", "shape", "...
https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/tensorflow/m_refine_v2.py#L16-L28
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
protobuf/python/google/protobuf/internal/_parameterized.py
python
NamedParameters
(*testcases)
return _ParameterDecorator(_FIRST_ARG, testcases)
A decorator for creating parameterized tests. See the module docstring for a usage example. The first element of each parameter tuple should be a string and will be appended to the name of the test method. Args: *testcases: Parameters for the decorated method, either a single iterable, or ...
A decorator for creating parameterized tests.
[ "A", "decorator", "for", "creating", "parameterized", "tests", "." ]
def NamedParameters(*testcases): """A decorator for creating parameterized tests. See the module docstring for a usage example. The first element of each parameter tuple should be a string and will be appended to the name of the test method. Args: *testcases: Parameters for the decorated method, either ...
[ "def", "NamedParameters", "(", "*", "testcases", ")", ":", "return", "_ParameterDecorator", "(", "_FIRST_ARG", ",", "testcases", ")" ]
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/internal/_parameterized.py#L317-L331
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/subprocess_main.py
python
check_python_version
()
Checks python version to be greater or equal than 3.4 :return: exit code (1 - error, None - successful)
Checks python version to be greater or equal than 3.4 :return: exit code (1 - error, None - successful)
[ "Checks", "python", "version", "to", "be", "greater", "or", "equal", "than", "3", ".", "4", ":", "return", ":", "exit", "code", "(", "1", "-", "error", "None", "-", "successful", ")" ]
def check_python_version(): """ Checks python version to be greater or equal than 3.4 :return: exit code (1 - error, None - successful) """ if sys.version_info < (3, 4): print('Python version should be of version 3.4 or newer') return 1
[ "def", "check_python_version", "(", ")", ":", "if", "sys", ".", "version_info", "<", "(", "3", ",", "4", ")", ":", "print", "(", "'Python version should be of version 3.4 or newer'", ")", "return", "1" ]
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/subprocess_main.py#L10-L17
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/boosted_trees/estimator_batch/custom_loss_head.py
python
CustomLossHead.__init__
(self, loss_fn, link_fn, logit_dimension, head_name=None, weight_column_name=None, metrics_fn=None)
`Head` for specifying arbitrary loss function. Args: loss_fn: Loss function. link_fn: Function that converts logits to prediction. logit_dimension: Number of dimensions for the logits. head_name: name of the head. Predictions, summary, metrics keys are suffixed by `"/" + head_name` ...
`Head` for specifying arbitrary loss function.
[ "Head", "for", "specifying", "arbitrary", "loss", "function", "." ]
def __init__(self, loss_fn, link_fn, logit_dimension, head_name=None, weight_column_name=None, metrics_fn=None): """`Head` for specifying arbitrary loss function. Args: loss_fn: Loss function. link_fn: Functio...
[ "def", "__init__", "(", "self", ",", "loss_fn", ",", "link_fn", ",", "logit_dimension", ",", "head_name", "=", "None", ",", "weight_column_name", "=", "None", ",", "metrics_fn", "=", "None", ")", ":", "def", "loss_wrapper", "(", "labels", ",", "logits", ",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/boosted_trees/estimator_batch/custom_loss_head.py#L30-L69
larroy/clearskies_core
3574ddf0edc8555454c7044126e786a6c29444dc
tools/gyp/pylib/gyp/win_tool.py
python
WinTool.ExecAsmWrapper
(self, arch, *args)
return popen.returncode
Filter logo banner from invocations of asm.exe.
Filter logo banner from invocations of asm.exe.
[ "Filter", "logo", "banner", "from", "invocations", "of", "asm", ".", "exe", "." ]
def ExecAsmWrapper(self, arch, *args): """Filter logo banner from invocations of asm.exe.""" env = self._GetEnv(arch) # MSVS doesn't assemble x64 asm files. if arch == 'environment.x64': return 0 popen = subprocess.Popen(args, shell=True, env=env, stdout=subprocess...
[ "def", "ExecAsmWrapper", "(", "self", ",", "arch", ",", "*", "args", ")", ":", "env", "=", "self", ".", "_GetEnv", "(", "arch", ")", "# MSVS doesn't assemble x64 asm files.", "if", "arch", "==", "'environment.x64'", ":", "return", "0", "popen", "=", "subproc...
https://github.com/larroy/clearskies_core/blob/3574ddf0edc8555454c7044126e786a6c29444dc/tools/gyp/pylib/gyp/win_tool.py#L247-L262
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/__init__.py
python
convert_directive_function
(directive_fn)
return FunctionalDirective
Define & return a directive class generated from `directive_fn`. `directive_fn` uses the old-style, functional interface.
Define & return a directive class generated from `directive_fn`.
[ "Define", "&", "return", "a", "directive", "class", "generated", "from", "directive_fn", "." ]
def convert_directive_function(directive_fn): """ Define & return a directive class generated from `directive_fn`. `directive_fn` uses the old-style, functional interface. """ class FunctionalDirective(Directive): option_spec = getattr(directive_fn, 'options', None) has_content = ...
[ "def", "convert_directive_function", "(", "directive_fn", ")", ":", "class", "FunctionalDirective", "(", "Directive", ")", ":", "option_spec", "=", "getattr", "(", "directive_fn", ",", "'options'", ",", "None", ")", "has_content", "=", "getattr", "(", "directive_f...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/__init__.py#L391-L413
facebookresearch/faiss
eb8781557f556505ca93f6f21fff932e17f0d9e0
contrib/evaluation.py
python
test_ref_knn_with_draws
(Dref, Iref, Dnew, Inew)
test that knn search results are identical, raise if not
test that knn search results are identical, raise if not
[ "test", "that", "knn", "search", "results", "are", "identical", "raise", "if", "not" ]
def test_ref_knn_with_draws(Dref, Iref, Dnew, Inew): """ test that knn search results are identical, raise if not """ np.testing.assert_array_almost_equal(Dref, Dnew, decimal=5) # here we have to be careful because of draws testcase = unittest.TestCase() # because it makes nice error messages for ...
[ "def", "test_ref_knn_with_draws", "(", "Dref", ",", "Iref", ",", "Dnew", ",", "Inew", ")", ":", "np", ".", "testing", ".", "assert_array_almost_equal", "(", "Dref", ",", "Dnew", ",", "decimal", "=", "5", ")", "# here we have to be careful because of draws", "tes...
https://github.com/facebookresearch/faiss/blob/eb8781557f556505ca93f6f21fff932e17f0d9e0/contrib/evaluation.py#L227-L241
tensorflow/minigo
6d89c202cdceaf449aefc3149ab2110d44f1a6a4
ml_perf/utils.py
python
copy_tree
(src, dst, verbose=False)
Copies everything under src to dst.
Copies everything under src to dst.
[ "Copies", "everything", "under", "src", "to", "dst", "." ]
def copy_tree(src, dst, verbose=False): """Copies everything under src to dst.""" print('Copying {} to {}'.format(src, dst)) for src_dir, sub_dirs, basenames in tf.io.gfile.walk(src): rel_dir = os.path.relpath(src_dir, src) dst_dir = os.path.join(dst, rel_dir) for sub_dir in sorted(...
[ "def", "copy_tree", "(", "src", ",", "dst", ",", "verbose", "=", "False", ")", ":", "print", "(", "'Copying {} to {}'", ".", "format", "(", "src", ",", "dst", ")", ")", "for", "src_dir", ",", "sub_dirs", ",", "basenames", "in", "tf", ".", "io", ".", ...
https://github.com/tensorflow/minigo/blob/6d89c202cdceaf449aefc3149ab2110d44f1a6a4/ml_perf/utils.py#L112-L131
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/tools/saved_model_cli.py
python
get_meta_graph_def
(saved_model_dir, tag_set)
return saved_model_utils.get_meta_graph_def(saved_model_dir, tag_set)
DEPRECATED: Use saved_model_utils.get_meta_graph_def instead. Gets MetaGraphDef from SavedModel. Returns the MetaGraphDef for the given tag-set and SavedModel directory. Args: saved_model_dir: Directory containing the SavedModel to inspect or execute. tag_set: Group of tag(s) of the MetaGraphDef to load...
DEPRECATED: Use saved_model_utils.get_meta_graph_def instead.
[ "DEPRECATED", ":", "Use", "saved_model_utils", ".", "get_meta_graph_def", "instead", "." ]
def get_meta_graph_def(saved_model_dir, tag_set): """DEPRECATED: Use saved_model_utils.get_meta_graph_def instead. Gets MetaGraphDef from SavedModel. Returns the MetaGraphDef for the given tag-set and SavedModel directory. Args: saved_model_dir: Directory containing the SavedModel to inspect or execute. ...
[ "def", "get_meta_graph_def", "(", "saved_model_dir", ",", "tag_set", ")", ":", "return", "saved_model_utils", ".", "get_meta_graph_def", "(", "saved_model_dir", ",", "tag_set", ")" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/tools/saved_model_cli.py#L188-L207
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextCtrl.IsSelectionBold
(*args, **kwargs)
return _richtext.RichTextCtrl_IsSelectionBold(*args, **kwargs)
IsSelectionBold(self) -> bool Is all of the selection bold?
IsSelectionBold(self) -> bool
[ "IsSelectionBold", "(", "self", ")", "-", ">", "bool" ]
def IsSelectionBold(*args, **kwargs): """ IsSelectionBold(self) -> bool Is all of the selection bold? """ return _richtext.RichTextCtrl_IsSelectionBold(*args, **kwargs)
[ "def", "IsSelectionBold", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_IsSelectionBold", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L3919-L3925
Ford/AVData
2fdb17f236966a560c8c5c4f3976886d2dc3cab5
ford_demo/scripts/extrinsics_broadcaster.py
python
main
()
Main function. Reading transform info from a yaml file and publish to tf2
Main function. Reading transform info from a yaml file and publish to tf2
[ "Main", "function", ".", "Reading", "transform", "info", "from", "a", "yaml", "file", "and", "publish", "to", "tf2" ]
def main(): """Main function. Reading transform info from a yaml file and publish to tf2 """ if len(sys.argv) == 1: print("error: no extrinsics yaml file given") print("usage: python extrinsics_broadcaster.py extrinsic_example.yaml") return file_path = open(sys.argv[1]) ...
[ "def", "main", "(", ")", ":", "if", "len", "(", "sys", ".", "argv", ")", "==", "1", ":", "print", "(", "\"error: no extrinsics yaml file given\"", ")", "print", "(", "\"usage: python extrinsics_broadcaster.py extrinsic_example.yaml\"", ")", "return", "file_path", "=...
https://github.com/Ford/AVData/blob/2fdb17f236966a560c8c5c4f3976886d2dc3cab5/ford_demo/scripts/extrinsics_broadcaster.py#L11-L36
Ubpa/RenderLab
71db49aa03de4fb258f9171691c8d570216e5e05
bin/NN_Trainer/NN_Trainer.py
python
TrainModel
(trainX, trainY, batchSize, patience)
return model
用提供的数据,训练模型 @param trainX: 输入数据 trainY: 输出数据 batchSize: 批大小 patience: 用于 EarlyStopping @return model: 模型
用提供的数据,训练模型
[ "用提供的数据,训练模型" ]
def TrainModel(trainX, trainY, batchSize, patience): """ 用提供的数据,训练模型 @param trainX: 输入数据 trainY: 输出数据 batchSize: 批大小 patience: 用于 EarlyStopping @return model: 模型 """ print("training model ...") model = keras.Sequential([ layers.Dense(hi...
[ "def", "TrainModel", "(", "trainX", ",", "trainY", ",", "batchSize", ",", "patience", ")", ":", "print", "(", "\"training model ...\"", ")", "model", "=", "keras", ".", "Sequential", "(", "[", "layers", ".", "Dense", "(", "hiddenUnit0", ",", "activation", ...
https://github.com/Ubpa/RenderLab/blob/71db49aa03de4fb258f9171691c8d570216e5e05/bin/NN_Trainer/NN_Trainer.py#L208-L244
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PGProperty.SetValueInEvent
(*args, **kwargs)
return _propgrid.PGProperty_SetValueInEvent(*args, **kwargs)
SetValueInEvent(self, wxVariant value)
SetValueInEvent(self, wxVariant value)
[ "SetValueInEvent", "(", "self", "wxVariant", "value", ")" ]
def SetValueInEvent(*args, **kwargs): """SetValueInEvent(self, wxVariant value)""" return _propgrid.PGProperty_SetValueInEvent(*args, **kwargs)
[ "def", "SetValueInEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGProperty_SetValueInEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L719-L721
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/_lobpcg.py
python
lobpcg
(A: Tensor, k: Optional[int] = None, B: Optional[Tensor] = None, X: Optional[Tensor] = None, n: Optional[int] = None, iK: Optional[Tensor] = None, niter: Optional[int] = None, tol: Optional[float] = None, largest: Optional[bool] = N...
return _lobpcg( A, k, B, X, n, iK, niter, tol, largest, method, tracker, ortho_iparams, ortho_fparams, ortho_bparams )
Find the k largest (or smallest) eigenvalues and the corresponding eigenvectors of a symmetric positive definite generalized eigenvalue problem using matrix-free LOBPCG methods. This function is a front-end to the following LOBPCG algorithms selectable via `method` argument: `method="basic"` - t...
Find the k largest (or smallest) eigenvalues and the corresponding eigenvectors of a symmetric positive definite generalized eigenvalue problem using matrix-free LOBPCG methods.
[ "Find", "the", "k", "largest", "(", "or", "smallest", ")", "eigenvalues", "and", "the", "corresponding", "eigenvectors", "of", "a", "symmetric", "positive", "definite", "generalized", "eigenvalue", "problem", "using", "matrix", "-", "free", "LOBPCG", "methods", ...
def lobpcg(A: Tensor, k: Optional[int] = None, B: Optional[Tensor] = None, X: Optional[Tensor] = None, n: Optional[int] = None, iK: Optional[Tensor] = None, niter: Optional[int] = None, tol: Optional[float] = None, largest: Optional...
[ "def", "lobpcg", "(", "A", ":", "Tensor", ",", "k", ":", "Optional", "[", "int", "]", "=", "None", ",", "B", ":", "Optional", "[", "Tensor", "]", "=", "None", ",", "X", ":", "Optional", "[", "Tensor", "]", "=", "None", ",", "n", ":", "Optional"...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/_lobpcg.py#L340-L538
H-uru/Plasma
c2140ea046e82e9c199e257a7f2e7edb42602871
Scripts/Python/grsnWallImagerDisplayS.py
python
grsnWallImagerDisplayS.__init__
(self)
construction
construction
[ "construction" ]
def __init__(self): "construction" PtDebugPrint("grsnWallImagerDisplayS::init begin") ptResponder.__init__(self) self.id = 52397 self.version = 1 PtDebugPrint("grsnWallImagerDisplayS::init end")
[ "def", "__init__", "(", "self", ")", ":", "PtDebugPrint", "(", "\"grsnWallImagerDisplayS::init begin\"", ")", "ptResponder", ".", "__init__", "(", "self", ")", "self", ".", "id", "=", "52397", "self", ".", "version", "=", "1", "PtDebugPrint", "(", "\"grsnWallI...
https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/grsnWallImagerDisplayS.py#L85-L91
ros-perception/vision_opencv
c791220cefd0abf02c6719e2ce0fea465857a88e
image_geometry/src/image_geometry/cameramodels.py
python
StereoCameraModel.project3dToPixel
(self, point)
return (l, r)
:param point: 3D point :type point: (x, y, z) Returns the rectified pixel coordinates (u, v) of the 3D point, for each camera, as ((u_left, v_left), (u_right, v_right)) using the cameras' :math:`P` matrices. This is the inverse of :meth:`projectPixelTo3d`.
:param point: 3D point :type point: (x, y, z)
[ ":", "param", "point", ":", "3D", "point", ":", "type", "point", ":", "(", "x", "y", "z", ")" ]
def project3dToPixel(self, point): """ :param point: 3D point :type point: (x, y, z) Returns the rectified pixel coordinates (u, v) of the 3D point, for each camera, as ((u_left, v_left), (u_right, v_right)) using the cameras' :math:`P` matrices. This is the inv...
[ "def", "project3dToPixel", "(", "self", ",", "point", ")", ":", "l", "=", "self", ".", "left", ".", "project3dToPixel", "(", "point", ")", "r", "=", "self", ".", "right", ".", "project3dToPixel", "(", "point", ")", "return", "(", "l", ",", "r", ")" ]
https://github.com/ros-perception/vision_opencv/blob/c791220cefd0abf02c6719e2ce0fea465857a88e/image_geometry/src/image_geometry/cameramodels.py#L310-L321
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py
python
VarTrace.attach
(self)
Attach callback to all vars that are not traced.
Attach callback to all vars that are not traced.
[ "Attach", "callback", "to", "all", "vars", "that", "are", "not", "traced", "." ]
def attach(self): "Attach callback to all vars that are not traced." while self.untraced: var, callback = self.untraced.pop() var.trace_add('write', callback) self.traced.append((var, callback))
[ "def", "attach", "(", "self", ")", ":", "while", "self", ".", "untraced", ":", "var", ",", "callback", "=", "self", ".", "untraced", ".", "pop", "(", ")", "var", ".", "trace_add", "(", "'write'", ",", "callback", ")", "self", ".", "traced", ".", "a...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/idlelib/configdialog.py#L2243-L2248
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/CallTipWindow.py
python
CallTip.position_window
(self)
Check if needs to reposition the window, and if so - do it.
Check if needs to reposition the window, and if so - do it.
[ "Check", "if", "needs", "to", "reposition", "the", "window", "and", "if", "so", "-", "do", "it", "." ]
def position_window(self): """Check if needs to reposition the window, and if so - do it.""" curline = int(self.widget.index("insert").split('.')[0]) if curline == self.lastline: return self.lastline = curline self.widget.see("insert") if curline == self.paren...
[ "def", "position_window", "(", "self", ")", ":", "curline", "=", "int", "(", "self", ".", "widget", ".", "index", "(", "\"insert\"", ")", ".", "split", "(", "'.'", ")", "[", "0", "]", ")", "if", "curline", "==", "self", ".", "lastline", ":", "retur...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/CallTipWindow.py#L27-L46
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/polynomial/legendre.py
python
legmul
(c1, c2)
return legadd(c0, legmulx(c1))
Multiply one Legendre series by another. Returns the product of two Legendre series `c1` * `c2`. The arguments are sequences of coefficients, from lowest order "term" to highest, e.g., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 : array_like 1-D...
Multiply one Legendre series by another.
[ "Multiply", "one", "Legendre", "series", "by", "another", "." ]
def legmul(c1, c2): """ Multiply one Legendre series by another. Returns the product of two Legendre series `c1` * `c2`. The arguments are sequences of coefficients, from lowest order "term" to highest, e.g., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- ...
[ "def", "legmul", "(", "c1", ",", "c2", ")", ":", "# s1, s2 are trimmed copies", "[", "c1", ",", "c2", "]", "=", "pu", ".", "as_series", "(", "[", "c1", ",", "c2", "]", ")", "if", "len", "(", "c1", ")", ">", "len", "(", "c2", ")", ":", "c", "=...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/polynomial/legendre.py#L464-L529
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py
python
_find_adapter
(registry, ob)
Return an adapter factory for `ob` from `registry`
Return an adapter factory for `ob` from `registry`
[ "Return", "an", "adapter", "factory", "for", "ob", "from", "registry" ]
def _find_adapter(registry, ob): """Return an adapter factory for `ob` from `registry`""" types = _always_object(inspect.getmro(getattr(ob, '__class__', type(ob)))) for t in types: if t in registry: return registry[t]
[ "def", "_find_adapter", "(", "registry", ",", "ob", ")", ":", "types", "=", "_always_object", "(", "inspect", ".", "getmro", "(", "getattr", "(", "ob", ",", "'__class__'", ",", "type", "(", "ob", ")", ")", ")", ")", "for", "t", "in", "types", ":", ...
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L3037-L3042
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/strings.py
python
cat_core
(list_of_columns: List, sep: str)
return np.sum(arr_with_sep, axis=0)
Auxiliary function for :meth:`str.cat` Parameters ---------- list_of_columns : list of numpy arrays List of arrays to be concatenated with sep; these arrays may not contain NaNs! sep : string The separator string for concatenating the columns. Returns ------- nd.arr...
Auxiliary function for :meth:`str.cat`
[ "Auxiliary", "function", "for", ":", "meth", ":", "str", ".", "cat" ]
def cat_core(list_of_columns: List, sep: str): """ Auxiliary function for :meth:`str.cat` Parameters ---------- list_of_columns : list of numpy arrays List of arrays to be concatenated with sep; these arrays may not contain NaNs! sep : string The separator string for con...
[ "def", "cat_core", "(", "list_of_columns", ":", "List", ",", "sep", ":", "str", ")", ":", "if", "sep", "==", "\"\"", ":", "# no need to interleave sep if it is empty", "arr_of_cols", "=", "np", ".", "asarray", "(", "list_of_columns", ",", "dtype", "=", "object...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/strings.py#L59-L83
cvmfs/cvmfs
4637bdb5153178eadf885c1acf37bdc5c685bf8a
cpplint.py
python
_CppLintState.SetCountingStyle
(self, counting_style)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style
[ "def", "SetCountingStyle", "(", "self", ",", "counting_style", ")", ":", "self", ".", "counting", "=", "counting_style" ]
https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L785-L787
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/MSVS/MSVSVersion.py
python
VisualStudioVersion.ToolPath
(self, tool)
return os.path.normpath(os.path.join(self.path, "VC", "bin", tool))
Returns the path to a given compiler tool.
Returns the path to a given compiler tool.
[ "Returns", "the", "path", "to", "a", "given", "compiler", "tool", "." ]
def ToolPath(self, tool): """Returns the path to a given compiler tool. """ return os.path.normpath(os.path.join(self.path, "VC", "bin", tool))
[ "def", "ToolPath", "(", "self", ",", "tool", ")", ":", "return", "os", ".", "path", ".", "normpath", "(", "os", ".", "path", ".", "join", "(", "self", ".", "path", ",", "\"VC\"", ",", "\"bin\"", ",", "tool", ")", ")" ]
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/MSVS/MSVSVersion.py#L65-L67
lmb-freiburg/ogn
974f72ef4bf840d6f6693d22d1843a79223e77ce
scripts/cpp_lint.py
python
CheckSpacing
(filename, clean_lines, linenum, nesting_state, error)
Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't start a block with a blank line, don't end a function with a blank line, don't ...
Checks for the correctness of various spacing issues in the code.
[ "Checks", "for", "the", "correctness", "of", "various", "spacing", "issues", "in", "the", "code", "." ]
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. Things we check for: spaces around operators, spaces after if/for/while/switch, no spaces around parens in function calls, two spaces between code and comment, don't star...
[ "def", "CheckSpacing", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "nesting_state", ",", "error", ")", ":", "# Don't use \"elided\" lines here, otherwise we can't check commented lines.", "# Don't want to use \"raw\" either, because we don't want to check inside C++11", ...
https://github.com/lmb-freiburg/ogn/blob/974f72ef4bf840d6f6693d22d1843a79223e77ce/scripts/cpp_lint.py#L2643-L2988
tum-vision/fusenet
a1451be2971b348a01b0f525c2a3a7a0e215a591
scripts/cpp_lint.py
python
CheckForNewlineAtEOF
(filename, lines, error)
Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found.
Logs an error if there is no newline char at the end of the file.
[ "Logs", "an", "error", "if", "there", "is", "no", "newline", "char", "at", "the", "end", "of", "the", "file", "." ]
def CheckForNewlineAtEOF(filename, lines, error): """Logs an error if there is no newline char at the end of the file. Args: filename: The name of the current file. lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ # The array ...
[ "def", "CheckForNewlineAtEOF", "(", "filename", ",", "lines", ",", "error", ")", ":", "# The array lines() was created by adding two newlines to the", "# original file (go figure), then splitting on \\n.", "# To verify that the file ends in \\n, we just have to make sure the", "# last-but-...
https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/scripts/cpp_lint.py#L1508-L1523
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Environment.py
python
SubstitutionEnvironment.subst_path
(self, path, target=None, source=None)
return r
Substitute a path list, turning EntryProxies into Nodes and leaving Nodes (and other objects) as-is.
Substitute a path list, turning EntryProxies into Nodes and leaving Nodes (and other objects) as-is.
[ "Substitute", "a", "path", "list", "turning", "EntryProxies", "into", "Nodes", "and", "leaving", "Nodes", "(", "and", "other", "objects", ")", "as", "-", "is", "." ]
def subst_path(self, path, target=None, source=None): """Substitute a path list, turning EntryProxies into Nodes and leaving Nodes (and other objects) as-is.""" if not is_List(path): path = [path] def s(obj): """This is the "string conversion" routine that we ha...
[ "def", "subst_path", "(", "self", ",", "path", ",", "target", "=", "None", ",", "source", "=", "None", ")", ":", "if", "not", "is_List", "(", "path", ")", ":", "path", "=", "[", "path", "]", "def", "s", "(", "obj", ")", ":", "\"\"\"This is the \"st...
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Environment.py#L526-L563
hpi-xnor/BMXNet
ed0b201da6667887222b8e4b5f997c4f6b61943d
benchmark/python/sparse/dot.py
python
measure_cost
(repeat, scipy_trans_lhs, scipy_dns_lhs, func_name, *args, **kwargs)
return diff / repeat
Measure time cost of running a function
Measure time cost of running a function
[ "Measure", "time", "cost", "of", "running", "a", "function" ]
def measure_cost(repeat, scipy_trans_lhs, scipy_dns_lhs, func_name, *args, **kwargs): """Measure time cost of running a function """ mx.nd.waitall() args_list = [] for arg in args: args_list.append(arg) start = time.time() if scipy_trans_lhs: args_list[0] = np.transpose(args_...
[ "def", "measure_cost", "(", "repeat", ",", "scipy_trans_lhs", ",", "scipy_dns_lhs", ",", "func_name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "mx", ".", "nd", ".", "waitall", "(", ")", "args_list", "=", "[", "]", "for", "arg", "in", "arg...
https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/benchmark/python/sparse/dot.py#L110-L125
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
grc/gui/Application.py
python
Application.__init__
(self, file_paths, platform)
Application constructor. Create the main window, setup the message handler, import the preferences, and connect all of the action handlers. Finally, enter the gtk main loop and block. Args: file_paths: a list of flow graph file passed from command line platform: platform...
Application constructor. Create the main window, setup the message handler, import the preferences, and connect all of the action handlers. Finally, enter the gtk main loop and block.
[ "Application", "constructor", ".", "Create", "the", "main", "window", "setup", "the", "message", "handler", "import", "the", "preferences", "and", "connect", "all", "of", "the", "action", "handlers", ".", "Finally", "enter", "the", "gtk", "main", "loop", "and"...
def __init__(self, file_paths, platform): Gtk.Application.__init__(self) """ Application constructor. Create the main window, setup the message handler, import the preferences, and connect all of the action handlers. Finally, enter the gtk main loop and block. Args: ...
[ "def", "__init__", "(", "self", ",", "file_paths", ",", "platform", ")", ":", "Gtk", ".", "Application", ".", "__init__", "(", "self", ")", "self", ".", "clipboard", "=", "None", "self", ".", "dialog", "=", "None", "# Setup the main window", "self", ".", ...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/gui/Application.py#L35-L69
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/pkg_resources/__init__.py
python
_ReqExtras.markers_pass
(self, req, extras=None)
return not req.marker or any(extra_evals)
Evaluate markers for req against each extra that demanded it. Return False if the req has a marker and fails evaluation. Otherwise, return True.
Evaluate markers for req against each extra that demanded it.
[ "Evaluate", "markers", "for", "req", "against", "each", "extra", "that", "demanded", "it", "." ]
def markers_pass(self, req, extras=None): """ Evaluate markers for req against each extra that demanded it. Return False if the req has a marker and fails evaluation. Otherwise, return True. """ extra_evals = ( req.marker.evaluate({'extra': extra}) ...
[ "def", "markers_pass", "(", "self", ",", "req", ",", "extras", "=", "None", ")", ":", "extra_evals", "=", "(", "req", ".", "marker", ".", "evaluate", "(", "{", "'extra'", ":", "extra", "}", ")", "for", "extra", "in", "self", ".", "get", "(", "req",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/__init__.py#L944-L956
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/posixpath.py
python
normcase
(s)
return s
Normalize case of pathname. Has no effect under Posix
Normalize case of pathname. Has no effect under Posix
[ "Normalize", "case", "of", "pathname", ".", "Has", "no", "effect", "under", "Posix" ]
def normcase(s): """Normalize case of pathname. Has no effect under Posix""" return s
[ "def", "normcase", "(", "s", ")", ":", "return", "s" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/posixpath.py#L51-L53
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/agilepy/lib_wx/objpanel.py
python
ScalarPanel.restore
(self)
Object values are copied into widgets.
Object values are copied into widgets.
[ "Object", "values", "are", "copied", "into", "widgets", "." ]
def restore(self): """ Object values are copied into widgets. """ for widgetcontainer in self.widgetcontainers: widgetcontainer.apply_obj_to_valuewidget()
[ "def", "restore", "(", "self", ")", ":", "for", "widgetcontainer", "in", "self", ".", "widgetcontainers", ":", "widgetcontainer", ".", "apply_obj_to_valuewidget", "(", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py#L1847-L1852
indutny/candor
48e7260618f5091c80a3416828e2808cad3ea22e
tools/gyp/pylib/gyp/input.py
python
ValidateRulesInTarget
(target, target_dict, extra_sources_for_rules)
Ensures that the rules sections in target_dict are valid and consistent, and determines which sources they apply to. Arguments: target: string, name of target. target_dict: dict, target spec containing "rules" and "sources" lists. extra_sources_for_rules: a list of keys to scan for rule matches in ...
Ensures that the rules sections in target_dict are valid and consistent, and determines which sources they apply to.
[ "Ensures", "that", "the", "rules", "sections", "in", "target_dict", "are", "valid", "and", "consistent", "and", "determines", "which", "sources", "they", "apply", "to", "." ]
def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules): """Ensures that the rules sections in target_dict are valid and consistent, and determines which sources they apply to. Arguments: target: string, name of target. target_dict: dict, target spec containing "rules" and "sources" lists...
[ "def", "ValidateRulesInTarget", "(", "target", ",", "target_dict", ",", "extra_sources_for_rules", ")", ":", "# Dicts to map between values found in rules' 'rule_name' and 'extension'", "# keys and the rule dicts themselves.", "rule_names", "=", "{", "}", "rule_extensions", "=", ...
https://github.com/indutny/candor/blob/48e7260618f5091c80a3416828e2808cad3ea22e/tools/gyp/pylib/gyp/input.py#L2171-L2225
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
grc/core/blocks/block.py
python
Block.import_data
(self, name, states, parameters, **_)
Import this block's params from nested data. Any param keys that do not exist will be ignored. Since params can be dynamically created based another param, call rewrite, and repeat the load until the params stick.
Import this block's params from nested data. Any param keys that do not exist will be ignored. Since params can be dynamically created based another param, call rewrite, and repeat the load until the params stick.
[ "Import", "this", "block", "s", "params", "from", "nested", "data", ".", "Any", "param", "keys", "that", "do", "not", "exist", "will", "be", "ignored", ".", "Since", "params", "can", "be", "dynamically", "created", "based", "another", "param", "call", "rew...
def import_data(self, name, states, parameters, **_): """ Import this block's params from nested data. Any param keys that do not exist will be ignored. Since params can be dynamically created based another param, call rewrite, and repeat the load until the params stick. ...
[ "def", "import_data", "(", "self", ",", "name", ",", "states", ",", "parameters", ",", "*", "*", "_", ")", ":", "self", ".", "params", "[", "'id'", "]", ".", "value", "=", "name", "self", ".", "states", ".", "update", "(", "states", ")", "def", "...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/grc/core/blocks/block.py#L668-L690
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py
python
Connection.set_session
(self, session)
Set the session to be used when the TLS/SSL connection is established. :param session: A Session instance representing the session to use. :returns: None .. versionadded:: 0.14
Set the session to be used when the TLS/SSL connection is established.
[ "Set", "the", "session", "to", "be", "used", "when", "the", "TLS", "/", "SSL", "connection", "is", "established", "." ]
def set_session(self, session): """ Set the session to be used when the TLS/SSL connection is established. :param session: A Session instance representing the session to use. :returns: None .. versionadded:: 0.14 """ if not isinstance(session, Session): ...
[ "def", "set_session", "(", "self", ",", "session", ")", ":", "if", "not", "isinstance", "(", "session", ",", "Session", ")", ":", "raise", "TypeError", "(", "\"session must be a Session instance\"", ")", "result", "=", "_lib", ".", "SSL_set_session", "(", "sel...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/OpenSSL/SSL.py#L2301-L2315
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/agents/tools/in_graph_env.py
python
InGraphEnv.done
(self)
return self._done
Access the variable indicating whether the episode is done.
Access the variable indicating whether the episode is done.
[ "Access", "the", "variable", "indicating", "whether", "the", "episode", "is", "done", "." ]
def done(self): """Access the variable indicating whether the episode is done.""" return self._done
[ "def", "done", "(", "self", ")", ":", "return", "self", ".", "_done" ]
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/tools/in_graph_env.py#L123-L125
p4lang/behavioral-model
81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9
tools/runtime_CLI.py
python
RuntimeAPI.do_meter_set_rates
(self, line)
Configure rates for a meter: meter_set_rates <name> <index> <rate_1>:<burst_1> <rate_2>:<burst_2> ...\nRate uses units/microsecond and burst uses units where units is bytes or packets
Configure rates for a meter: meter_set_rates <name> <index> <rate_1>:<burst_1> <rate_2>:<burst_2> ...\nRate uses units/microsecond and burst uses units where units is bytes or packets
[ "Configure", "rates", "for", "a", "meter", ":", "meter_set_rates", "<name", ">", "<index", ">", "<rate_1", ">", ":", "<burst_1", ">", "<rate_2", ">", ":", "<burst_2", ">", "...", "\\", "nRate", "uses", "units", "/", "microsecond", "and", "burst", "uses", ...
def do_meter_set_rates(self, line): "Configure rates for a meter: meter_set_rates <name> <index> <rate_1>:<burst_1> <rate_2>:<burst_2> ...\nRate uses units/microsecond and burst uses units where units is bytes or packets" args = line.split() self.at_least_n_args(args, 2) meter_name = arg...
[ "def", "do_meter_set_rates", "(", "self", ",", "line", ")", ":", "args", "=", "line", ".", "split", "(", ")", "self", ".", "at_least_n_args", "(", "args", ",", "2", ")", "meter_name", "=", "args", "[", "0", "]", "meter", "=", "self", ".", "get_res", ...
https://github.com/p4lang/behavioral-model/blob/81ce0163f0770c6b9d6056a28ce2e0cc035bb6e9/tools/runtime_CLI.py#L1956-L1985
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py
python
makeHTMLTags
(tagStr)
return _makeTags( tagStr, False )
Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = '<td>More info at the <a href="http://pyparsing.wikispaces.com">pyparsing</a> wiki page</td>' ...
Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values.
[ "Helper", "to", "construct", "opening", "and", "closing", "tag", "expressions", "for", "HTML", "given", "a", "tag", "name", ".", "Matches", "tags", "in", "either", "upper", "or", "lower", "case", "attributes", "with", "namespaces", "and", "with", "quoted", "...
def makeHTMLTags(tagStr): """ Helper to construct opening and closing tag expressions for HTML, given a tag name. Matches tags in either upper or lower case, attributes with namespaces and with quoted or unquoted values. Example:: text = '<td>More info at the <a href="http://pyparsing.wikispace...
[ "def", "makeHTMLTags", "(", "tagStr", ")", ":", "return", "_makeTags", "(", "tagStr", ",", "False", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/pkg_resources/_vendor/pyparsing.py#L4904-L4921
moai/moai-dev
0ba7c678311d1fa9dbc091f60665e95e54169fdf
3rdparty/libwebp-0.4.1/swig/libwebp.py
python
WebPEncodeBGRA
(rgb, width, height, stride, quality_factor)
return webp[0]
WebPEncodeBGRA(uint8_t rgb, int width, int height, int stride, float quality_factor) -> lossy_webp
WebPEncodeBGRA(uint8_t rgb, int width, int height, int stride, float quality_factor) -> lossy_webp
[ "WebPEncodeBGRA", "(", "uint8_t", "rgb", "int", "width", "int", "height", "int", "stride", "float", "quality_factor", ")", "-", ">", "lossy_webp" ]
def WebPEncodeBGRA(rgb, width, height, stride, quality_factor): """WebPEncodeBGRA(uint8_t rgb, int width, int height, int stride, float quality_factor) -> lossy_webp""" webp = wrap_WebPEncodeBGRA( rgb, _UNUSED, _UNUSED, width, height, stride, quality_factor) if len(webp[0]) == 0: return None return we...
[ "def", "WebPEncodeBGRA", "(", "rgb", ",", "width", ",", "height", ",", "stride", ",", "quality_factor", ")", ":", "webp", "=", "wrap_WebPEncodeBGRA", "(", "rgb", ",", "_UNUSED", ",", "_UNUSED", ",", "width", ",", "height", ",", "stride", ",", "quality_fact...
https://github.com/moai/moai-dev/blob/0ba7c678311d1fa9dbc091f60665e95e54169fdf/3rdparty/libwebp-0.4.1/swig/libwebp.py#L160-L166
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/processing/modeler/ModelerGraphicItem.py
python
ModelerInputGraphicItem.create_widget_context
(self)
return widget_context
Returns a new widget context for use in the model editor
Returns a new widget context for use in the model editor
[ "Returns", "a", "new", "widget", "context", "for", "use", "in", "the", "model", "editor" ]
def create_widget_context(self): """ Returns a new widget context for use in the model editor """ widget_context = QgsProcessingParameterWidgetContext() widget_context.setProject(QgsProject.instance()) if iface is not None: widget_context.setMapCanvas(iface.ma...
[ "def", "create_widget_context", "(", "self", ")", ":", "widget_context", "=", "QgsProcessingParameterWidgetContext", "(", ")", "widget_context", ".", "setProject", "(", "QgsProject", ".", "instance", "(", ")", ")", "if", "iface", "is", "not", "None", ":", "widge...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/processing/modeler/ModelerGraphicItem.py#L68-L79
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/easy_install.py
python
ScriptWriter.get_args
(cls, dist, header=None)
Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points.
Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points.
[ "Yield", "write_script", "()", "argument", "tuples", "for", "a", "distribution", "s", "console_scripts", "and", "gui_scripts", "entry", "points", "." ]
def get_args(cls, dist, header=None): """ Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. """ if header is None: header = cls.get_header() spec = str(dist.as_requirement()) for type_ in 'console',...
[ "def", "get_args", "(", "cls", ",", "dist", ",", "header", "=", "None", ")", ":", "if", "header", "is", "None", ":", "header", "=", "cls", ".", "get_header", "(", ")", "spec", "=", "str", "(", "dist", ".", "as_requirement", "(", ")", ")", "for", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/command/easy_install.py#L2107-L2122
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/training/saving/saveable_object.py
python
SaveableObject.device
(self)
return self.specs[0].device
The device for SaveSpec Tensors.
The device for SaveSpec Tensors.
[ "The", "device", "for", "SaveSpec", "Tensors", "." ]
def device(self): """The device for SaveSpec Tensors.""" return self.specs[0].device
[ "def", "device", "(", "self", ")", ":", "return", "self", ".", "specs", "[", "0", "]", ".", "device" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/saving/saveable_object.py#L73-L75
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npdatetime.py
python
get_datetime_timedelta_conversion
(datetime_unit, timedelta_unit)
Compute a possible conversion for combining *datetime_unit* and *timedelta_unit* (presumably for adding or subtracting). Return (result unit, integer datetime multiplier, integer timedelta multiplier). RuntimeError is raised if the combination is impossible.
Compute a possible conversion for combining *datetime_unit* and *timedelta_unit* (presumably for adding or subtracting). Return (result unit, integer datetime multiplier, integer timedelta multiplier). RuntimeError is raised if the combination is impossible.
[ "Compute", "a", "possible", "conversion", "for", "combining", "*", "datetime_unit", "*", "and", "*", "timedelta_unit", "*", "(", "presumably", "for", "adding", "or", "subtracting", ")", ".", "Return", "(", "result", "unit", "integer", "datetime", "multiplier", ...
def get_datetime_timedelta_conversion(datetime_unit, timedelta_unit): """ Compute a possible conversion for combining *datetime_unit* and *timedelta_unit* (presumably for adding or subtracting). Return (result unit, integer datetime multiplier, integer timedelta multiplier). RuntimeError is raised i...
[ "def", "get_datetime_timedelta_conversion", "(", "datetime_unit", ",", "timedelta_unit", ")", ":", "# XXX now unused (I don't know where / how Numpy uses this)", "dt_unit_code", "=", "DATETIME_UNITS", "[", "datetime_unit", "]", "td_unit_code", "=", "DATETIME_UNITS", "[", "timed...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npdatetime.py#L120-L169
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pydoc.py
python
stripid
(text)
return _re_stripid.sub(r'\1', text)
Remove the hexadecimal id from a Python object representation.
Remove the hexadecimal id from a Python object representation.
[ "Remove", "the", "hexadecimal", "id", "from", "a", "Python", "object", "representation", "." ]
def stripid(text): """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent in terms of case. return _re_stripid.sub(r'\1', text)
[ "def", "stripid", "(", "text", ")", ":", "# The behaviour of %p is implementation-dependent in terms of case.", "return", "_re_stripid", ".", "sub", "(", "r'\\1'", ",", "text", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/pydoc.py#L124-L127
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pydoc.py
python
HTMLDoc.docother
(self, object, name=None, mod=None, *ignored)
return lhs + self.repr(object)
Produce HTML documentation for a data object.
Produce HTML documentation for a data object.
[ "Produce", "HTML", "documentation", "for", "a", "data", "object", "." ]
def docother(self, object, name=None, mod=None, *ignored): """Produce HTML documentation for a data object.""" lhs = name and '<strong>%s</strong> = ' % name or '' return lhs + self.repr(object)
[ "def", "docother", "(", "self", ",", "object", ",", "name", "=", "None", ",", "mod", "=", "None", ",", "*", "ignored", ")", ":", "lhs", "=", "name", "and", "'<strong>%s</strong> = '", "%", "name", "or", "''", "return", "lhs", "+", "self", ".", "repr"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pydoc.py#L1013-L1016
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
Display.GetCount
(*args, **kwargs)
return _misc_.Display_GetCount(*args, **kwargs)
GetCount() -> unsigned int Return the number of available displays.
GetCount() -> unsigned int
[ "GetCount", "()", "-", ">", "unsigned", "int" ]
def GetCount(*args, **kwargs): """ GetCount() -> unsigned int Return the number of available displays. """ return _misc_.Display_GetCount(*args, **kwargs)
[ "def", "GetCount", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Display_GetCount", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L6092-L6098
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/stc.py
python
StyledTextCtrl.CallTipPosAtStart
(*args, **kwargs)
return _stc.StyledTextCtrl_CallTipPosAtStart(*args, **kwargs)
CallTipPosAtStart(self) -> int Retrieve the position where the caret was before displaying the call tip.
CallTipPosAtStart(self) -> int
[ "CallTipPosAtStart", "(", "self", ")", "-", ">", "int" ]
def CallTipPosAtStart(*args, **kwargs): """ CallTipPosAtStart(self) -> int Retrieve the position where the caret was before displaying the call tip. """ return _stc.StyledTextCtrl_CallTipPosAtStart(*args, **kwargs)
[ "def", "CallTipPosAtStart", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_CallTipPosAtStart", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/stc.py#L3820-L3826
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/grid.py
python
GridTableBase.SetView
(*args, **kwargs)
return _grid.GridTableBase_SetView(*args, **kwargs)
SetView(self, Grid grid)
SetView(self, Grid grid)
[ "SetView", "(", "self", "Grid", "grid", ")" ]
def SetView(*args, **kwargs): """SetView(self, Grid grid)""" return _grid.GridTableBase_SetView(*args, **kwargs)
[ "def", "SetView", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "GridTableBase_SetView", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L782-L784
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py
python
have_gui
()
return int(vim.eval("has('gui_running')")) == 1
Returns True if vim is in a gui (Gvim/MacVim), False otherwise.
Returns True if vim is in a gui (Gvim/MacVim), False otherwise.
[ "Returns", "True", "if", "vim", "is", "in", "a", "gui", "(", "Gvim", "/", "MacVim", ")", "False", "otherwise", "." ]
def have_gui(): """ Returns True if vim is in a gui (Gvim/MacVim), False otherwise. """ return int(vim.eval("has('gui_running')")) == 1
[ "def", "have_gui", "(", ")", ":", "return", "int", "(", "vim", ".", "eval", "(", "\"has('gui_running')\"", ")", ")", "==", "1" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py#L140-L142
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/dataview.py
python
DataViewCtrl_GetClassDefaultAttributes
(*args, **kwargs)
return _dataview.DataViewCtrl_GetClassDefaultAttributes(*args, **kwargs)
DataViewCtrl_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colou...
DataViewCtrl_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "DataViewCtrl_GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def DataViewCtrl_GetClassDefaultAttributes(*args, **kwargs): """ DataViewCtrl_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard con...
[ "def", "DataViewCtrl_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewCtrl_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L1875-L1890
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py
python
TimeSeriesReader.read_full
(self)
Return the full dataset. Largely for interactive use/plotting (or evaluation on small datasets). Generally not very efficient. Not recommended for training. Returns: Same return type as `read`, but with the full dataset rather than an arbitrary chunk of it. A dictionary mapping feature names t...
Return the full dataset.
[ "Return", "the", "full", "dataset", "." ]
def read_full(self): """Return the full dataset. Largely for interactive use/plotting (or evaluation on small datasets). Generally not very efficient. Not recommended for training. Returns: Same return type as `read`, but with the full dataset rather than an arbitrary chunk of it. A dictio...
[ "def", "read_full", "(", "self", ")", ":", "pass" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py#L200-L215
google/tink
59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14
python/tink/streaming_aead/_encrypting_stream.py
python
RawEncryptingStream.__init__
(self, stream_aead: tink_bindings.StreamingAead, ciphertext_destination: BinaryIO, associated_data: bytes)
Create a new RawEncryptingStream. Args: stream_aead: C++ StreamingAead primitive from which a C++ EncryptingStream will be obtained. ciphertext_destination: A writable file-like object to which ciphertext bytes will be written. associated_data: The associated data to use for encry...
Create a new RawEncryptingStream.
[ "Create", "a", "new", "RawEncryptingStream", "." ]
def __init__(self, stream_aead: tink_bindings.StreamingAead, ciphertext_destination: BinaryIO, associated_data: bytes): """Create a new RawEncryptingStream. Args: stream_aead: C++ StreamingAead primitive from which a C++ EncryptingStream will be obtained. ciphertext_destinati...
[ "def", "__init__", "(", "self", ",", "stream_aead", ":", "tink_bindings", ".", "StreamingAead", ",", "ciphertext_destination", ":", "BinaryIO", ",", "associated_data", ":", "bytes", ")", ":", "super", "(", ")", ".", "__init__", "(", ")", "if", "not", "cipher...
https://github.com/google/tink/blob/59bb34495d1cb8f9d9dbc0f0a52c4f9e21491a14/python/tink/streaming_aead/_encrypting_stream.py#L45-L63
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/debug/cli/profile_analyzer_cli.py
python
ProfileAnalyzer._render_normalized_cost_bar
(self, cost, max_cost, length)
return output
Render a text bar representing a normalized cost. Args: cost: the absolute value of the cost. max_cost: the maximum cost value to normalize the absolute cost with. length: (int) length of the cost bar, in number of characters, excluding the brackets on the two ends. Returns: An...
Render a text bar representing a normalized cost.
[ "Render", "a", "text", "bar", "representing", "a", "normalized", "cost", "." ]
def _render_normalized_cost_bar(self, cost, max_cost, length): """Render a text bar representing a normalized cost. Args: cost: the absolute value of the cost. max_cost: the maximum cost value to normalize the absolute cost with. length: (int) length of the cost bar, in number of characters, ...
[ "def", "_render_normalized_cost_bar", "(", "self", ",", "cost", ",", "max_cost", ",", "length", ")", ":", "num_ticks", "=", "int", "(", "np", ".", "ceil", "(", "float", "(", "cost", ")", "/", "max_cost", "*", "length", ")", ")", "num_ticks", "=", "num_...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/debug/cli/profile_analyzer_cli.py#L740-L758
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlNode.getBase
(self, doc)
return ret
Searches for the BASE URL. The code should work on both XML and HTML document even if base mechanisms are completely different. It returns the base as defined in RFC 2396 sections 5.1.1. Base URI within Document Content and 5.1.2. Base URI from the Encapsulating Entity However it...
Searches for the BASE URL. The code should work on both XML and HTML document even if base mechanisms are completely different. It returns the base as defined in RFC 2396 sections 5.1.1. Base URI within Document Content and 5.1.2. Base URI from the Encapsulating Entity However it...
[ "Searches", "for", "the", "BASE", "URL", ".", "The", "code", "should", "work", "on", "both", "XML", "and", "HTML", "document", "even", "if", "base", "mechanisms", "are", "completely", "different", ".", "It", "returns", "the", "base", "as", "defined", "in",...
def getBase(self, doc): """Searches for the BASE URL. The code should work on both XML and HTML document even if base mechanisms are completely different. It returns the base as defined in RFC 2396 sections 5.1.1. Base URI within Document Content and 5.1.2. Base URI from ...
[ "def", "getBase", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlNodeGetBase", "(", "doc__o", ",", "self", ".", "_o", ")", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L3236-L3246
openmm/openmm
cb293447c4fc8b03976dfe11399f107bab70f3d9
wrappers/python/openmm/app/gromacstopfile.py
python
GromacsTopFile._processDihedralType
(self, line)
Process a line in the [ dihedraltypes ] category.
Process a line in the [ dihedraltypes ] category.
[ "Process", "a", "line", "in", "the", "[", "dihedraltypes", "]", "category", "." ]
def _processDihedralType(self, line): """Process a line in the [ dihedraltypes ] category.""" fields = line.split() if len(fields) < 7: raise ValueError('Too few fields in [ dihedraltypes ] line: '+line) if fields[4] not in ('1', '2', '3', '4', '5', '9'): raise Va...
[ "def", "_processDihedralType", "(", "self", ",", "line", ")", ":", "fields", "=", "line", ".", "split", "(", ")", "if", "len", "(", "fields", ")", "<", "7", ":", "raise", "ValueError", "(", "'Too few fields in [ dihedraltypes ] line: '", "+", "line", ")", ...
https://github.com/openmm/openmm/blob/cb293447c4fc8b03976dfe11399f107bab70f3d9/wrappers/python/openmm/app/gromacstopfile.py#L418-L430
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/cross_device_utils.py
python
split_by_sparsity
(values)
return dense_values, dense_indices, sparse_values, sparse_indices
Split values into dense and sparse values. Args: values: a list of tensors or `PerReplica`s. Returns: Four lists: a list of dense values, a list of their indices in `values` and a list of sparse values, a list of their indices in `values`.
Split values into dense and sparse values.
[ "Split", "values", "into", "dense", "and", "sparse", "values", "." ]
def split_by_sparsity(values): """Split values into dense and sparse values. Args: values: a list of tensors or `PerReplica`s. Returns: Four lists: a list of dense values, a list of their indices in `values` and a list of sparse values, a list of their indices in `values`. """ dense_valu...
[ "def", "split_by_sparsity", "(", "values", ")", ":", "dense_values", "=", "[", "]", "dense_indices", "=", "[", "]", "sparse_values", "=", "[", "]", "sparse_indices", "=", "[", "]", "for", "i", ",", "v", "in", "enumerate", "(", "values", ")", ":", "if",...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/distribute/cross_device_utils.py#L725-L747
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/generic.py
python
NDFrame._AXIS_NUMBERS
(self)
return {"index": 0}
.. deprecated:: 1.1.0
.. deprecated:: 1.1.0
[ "..", "deprecated", "::", "1", ".", "1", ".", "0" ]
def _AXIS_NUMBERS(self) -> dict[str, int]: """.. deprecated:: 1.1.0""" level = self.ndim + 1 warnings.warn( "_AXIS_NUMBERS has been deprecated.", FutureWarning, stacklevel=level ) return {"index": 0}
[ "def", "_AXIS_NUMBERS", "(", "self", ")", "->", "dict", "[", "str", ",", "int", "]", ":", "level", "=", "self", ".", "ndim", "+", "1", "warnings", ".", "warn", "(", "\"_AXIS_NUMBERS has been deprecated.\"", ",", "FutureWarning", ",", "stacklevel", "=", "le...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/generic.py#L486-L492
Smorodov/Multitarget-tracker
bee300e8bfd660c86cbeb6892c65a5b7195c9381
thirdparty/pybind11/tools/clang/cindex.py
python
SourceLocation.from_offset
(tu, file, offset)
return conf.lib.clang_getLocationForOffset(tu, file, offset)
Retrieve a SourceLocation from a given character offset. tu -- TranslationUnit file belongs to file -- File instance to obtain offset from offset -- Integer character offset within file
Retrieve a SourceLocation from a given character offset.
[ "Retrieve", "a", "SourceLocation", "from", "a", "given", "character", "offset", "." ]
def from_offset(tu, file, offset): """Retrieve a SourceLocation from a given character offset. tu -- TranslationUnit file belongs to file -- File instance to obtain offset from offset -- Integer character offset within file """ return conf.lib.clang_getLocationForOffset(...
[ "def", "from_offset", "(", "tu", ",", "file", ",", "offset", ")", ":", "return", "conf", ".", "lib", ".", "clang_getLocationForOffset", "(", "tu", ",", "file", ",", "offset", ")" ]
https://github.com/Smorodov/Multitarget-tracker/blob/bee300e8bfd660c86cbeb6892c65a5b7195c9381/thirdparty/pybind11/tools/clang/cindex.py#L188-L195
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatmenu.py
python
FMRendererMSOffice2007.DrawMenuBarBackground
(self, dc, rect)
Draws the menu bar background according to the active theme. :param `dc`: an instance of :class:`DC`; :param `rect`: an instance of :class:`Rect`, representing the menubar client rectangle.
Draws the menu bar background according to the active theme.
[ "Draws", "the", "menu", "bar", "background", "according", "to", "the", "active", "theme", "." ]
def DrawMenuBarBackground(self, dc, rect): """ Draws the menu bar background according to the active theme. :param `dc`: an instance of :class:`DC`; :param `rect`: an instance of :class:`Rect`, representing the menubar client rectangle. """ # Keep old pen and brush ...
[ "def", "DrawMenuBarBackground", "(", "self", ",", "dc", ",", "rect", ")", ":", "# Keep old pen and brush", "dcsaver", "=", "DCSaver", "(", "dc", ")", "artMgr", "=", "ArtManager", ".", "Get", "(", ")", "baseColour", "=", "self", ".", "menuBarFaceColour", "dc"...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatmenu.py#L1533-L1600
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2_extras/appengine/auth/models.py
python
User.validate_token
(cls, user_id, subject, token)
return cls.token_model.get(user=user_id, subject=subject, token=token) is not None
Checks for existence of a token, given user_id, subject and token. :param user_id: User unique ID. :param subject: The subject of the key. Examples: - 'auth' - 'signup' :param token: The token string to be validated. :returns:...
Checks for existence of a token, given user_id, subject and token.
[ "Checks", "for", "existence", "of", "a", "token", "given", "user_id", "subject", "and", "token", "." ]
def validate_token(cls, user_id, subject, token): """Checks for existence of a token, given user_id, subject and token. :param user_id: User unique ID. :param subject: The subject of the key. Examples: - 'auth' - 'signup' :param token: ...
[ "def", "validate_token", "(", "cls", ",", "user_id", ",", "subject", ",", "token", ")", ":", "return", "cls", ".", "token_model", ".", "get", "(", "user", "=", "user_id", ",", "subject", "=", "subject", ",", "token", "=", "token", ")", "is", "not", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2_extras/appengine/auth/models.py#L306-L322
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/training/saving/saveable_hook.py
python
SaveableHook.__init__
(self, name)
Creates a `SaveableHook` object. Args: name: the name to save the object under.
Creates a `SaveableHook` object.
[ "Creates", "a", "SaveableHook", "object", "." ]
def __init__(self, name): """Creates a `SaveableHook` object. Args: name: the name to save the object under. """ super(SaveableHook, self).__init__( tensor=constant_op.constant(0), name=name, )
[ "def", "__init__", "(", "self", ",", "name", ")", ":", "super", "(", "SaveableHook", ",", "self", ")", ".", "__init__", "(", "tensor", "=", "constant_op", ".", "constant", "(", "0", ")", ",", "name", "=", "name", ",", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/training/saving/saveable_hook.py#L34-L43