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
PixarAnimationStudios/USD
faed18ce62c8736b02413635b584a2f637156bad
pxr/usdImaging/usdviewq/selectionDataModel.py
python
SelectionDataModel.clearComputedProps
(self)
Clear the computed property selection.
Clear the computed property selection.
[ "Clear", "the", "computed", "property", "selection", "." ]
def clearComputedProps(self): """Clear the computed property selection.""" self._computedPropSelection.clear() self._computedPropSelectionChanged()
[ "def", "clearComputedProps", "(", "self", ")", ":", "self", ".", "_computedPropSelection", ".", "clear", "(", ")", "self", ".", "_computedPropSelectionChanged", "(", ")" ]
https://github.com/PixarAnimationStudios/USD/blob/faed18ce62c8736b02413635b584a2f637156bad/pxr/usdImaging/usdviewq/selectionDataModel.py#L967-L971
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/column_accessor.py
python
ColumnAccessor.set_by_label
(self, key: Any, value: Any, validate: bool = True)
Add (or modify) column by name. Parameters ---------- key name of the column value : column-like The value to insert into the column. validate : bool If True, the provided value will be coerced to a column and validated before sett...
Add (or modify) column by name.
[ "Add", "(", "or", "modify", ")", "column", "by", "name", "." ]
def set_by_label(self, key: Any, value: Any, validate: bool = True): """ Add (or modify) column by name. Parameters ---------- key name of the column value : column-like The value to insert into the column. validate : bool If T...
[ "def", "set_by_label", "(", "self", ",", "key", ":", "Any", ",", "value", ":", "Any", ",", "validate", ":", "bool", "=", "True", ")", ":", "key", "=", "self", ".", "_pad_key", "(", "key", ")", "if", "validate", ":", "value", "=", "column", ".", "...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/column_accessor.py#L371-L395
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/resmokelib/run/__init__.py
python
TestRunner.generate_multiversion_exclude_tags
(self)
Generate multiversion exclude tags file.
Generate multiversion exclude tags file.
[ "Generate", "multiversion", "exclude", "tags", "file", "." ]
def generate_multiversion_exclude_tags(self): """Generate multiversion exclude tags file.""" generate_multiversion_exclude_tags.generate_exclude_yaml( config.MULTIVERSION_BIN_VERSION, config.EXCLUDE_TAGS_FILE_PATH, self._resmoke_logger)
[ "def", "generate_multiversion_exclude_tags", "(", "self", ")", ":", "generate_multiversion_exclude_tags", ".", "generate_exclude_yaml", "(", "config", ".", "MULTIVERSION_BIN_VERSION", ",", "config", ".", "EXCLUDE_TAGS_FILE_PATH", ",", "self", ".", "_resmoke_logger", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/resmokelib/run/__init__.py#L186-L189
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPMT_KEYEDHASH_SCHEME.__init__
(self, details = None)
This structure is used for a hash signing object. Attributes: details (TPMU_SCHEME_KEYEDHASH): The scheme parameters One of: TPMS_SCHEME_HMAC, TPMS_SCHEME_XOR, TPMS_NULL_SCHEME_KEYEDHASH.
This structure is used for a hash signing object.
[ "This", "structure", "is", "used", "for", "a", "hash", "signing", "object", "." ]
def __init__(self, details = None): """ This structure is used for a hash signing object. Attributes: details (TPMU_SCHEME_KEYEDHASH): The scheme parameters One of: TPMS_SCHEME_HMAC, TPMS_SCHEME_XOR, TPMS_NULL_SCHEME_KEYEDHASH. """ self.details = details
[ "def", "__init__", "(", "self", ",", "details", "=", "None", ")", ":", "self", ".", "details", "=", "details" ]
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L6359-L6366
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py
python
_singlefileMailbox.flush
(self)
Write any pending changes to disk.
Write any pending changes to disk.
[ "Write", "any", "pending", "changes", "to", "disk", "." ]
def flush(self): """Write any pending changes to disk.""" if not self._pending: if self._pending_sync: # Messages have only been added, so syncing the file # is enough. _sync_flush(self._file) self._pending_sync = False ...
[ "def", "flush", "(", "self", ")", ":", "if", "not", "self", ".", "_pending", ":", "if", "self", ".", "_pending_sync", ":", "# Messages have only been added, so syncing the file", "# is enough.", "_sync_flush", "(", "self", ".", "_file", ")", "self", ".", "_pendi...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L634-L700
AMReX-Astro/Castro
5bf85dc1fe41909206d80ff71463f2baad22dab5
Util/scripts/write_probdata.py
python
write_probin
(prob_param_files, cxx_prefix)
write_probin will read through the list of parameter files and C++ header and source files to manage the runtime parameters
write_probin will read through the list of parameter files and C++ header and source files to manage the runtime parameters
[ "write_probin", "will", "read", "through", "the", "list", "of", "parameter", "files", "and", "C", "++", "header", "and", "source", "files", "to", "manage", "the", "runtime", "parameters" ]
def write_probin(prob_param_files, cxx_prefix): """write_probin will read through the list of parameter files and C++ header and source files to manage the runtime parameters""" params = [] print(" ") print(f"write_probdata.py: creating prob_param C++ files") # read the parameters defined in ...
[ "def", "write_probin", "(", "prob_param_files", ",", "cxx_prefix", ")", ":", "params", "=", "[", "]", "print", "(", "\" \"", ")", "print", "(", "f\"write_probdata.py: creating prob_param C++ files\"", ")", "# read the parameters defined in the parameter files", "for", "f"...
https://github.com/AMReX-Astro/Castro/blob/5bf85dc1fe41909206d80ff71463f2baad22dab5/Util/scripts/write_probdata.py#L150-L254
qboticslabs/mastering_ros
d83e78f30acc45b0f18522c1d5fae3a7f52974b9
chapter_10_codes/seven_dof_arm_gazebo/scripts/pick_and_place_working_1.py
python
CokeCanPickAndPlace._pickup
(self, group, target, width)
return True
Pick up a target using the planning group
Pick up a target using the planning group
[ "Pick", "up", "a", "target", "using", "the", "planning", "group" ]
def _pickup(self, group, target, width): """ Pick up a target using the planning group """ # Obtain possible grasps from the grasp generator server: grasps = self._generate_grasps(self._pose_coke_can, width) # Create and send Pickup goal: goal = self._create_pic...
[ "def", "_pickup", "(", "self", ",", "group", ",", "target", ",", "width", ")", ":", "# Obtain possible grasps from the grasp generator server:", "grasps", "=", "self", ".", "_generate_grasps", "(", "self", ".", "_pose_coke_can", ",", "width", ")", "# Create and send...
https://github.com/qboticslabs/mastering_ros/blob/d83e78f30acc45b0f18522c1d5fae3a7f52974b9/chapter_10_codes/seven_dof_arm_gazebo/scripts/pick_and_place_working_1.py#L297-L322
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
DC.MaxX
(*args, **kwargs)
return _gdi_.DC_MaxX(*args, **kwargs)
MaxX(self) -> int Gets the maximum horizontal extent used in drawing commands so far.
MaxX(self) -> int
[ "MaxX", "(", "self", ")", "-", ">", "int" ]
def MaxX(*args, **kwargs): """ MaxX(self) -> int Gets the maximum horizontal extent used in drawing commands so far. """ return _gdi_.DC_MaxX(*args, **kwargs)
[ "def", "MaxX", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_MaxX", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L4676-L4682
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/mailbox.py
python
_singlefileMailbox._post_message_hook
(self, f)
return
Called after writing each message to file f.
Called after writing each message to file f.
[ "Called", "after", "writing", "each", "message", "to", "file", "f", "." ]
def _post_message_hook(self, f): """Called after writing each message to file f.""" return
[ "def", "_post_message_hook", "(", "self", ",", "f", ")", ":", "return" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mailbox.py#L640-L642
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/skia_gold_common/skia_gold_session.py
python
SkiaGoldSession.Initialize
(self)
return rc, stdout
Initializes the working directory if necessary. This can technically be skipped if the same information is passed to the command used for image comparison, but that is less efficient under the hood. Doing it that way effectively requires an initialization for every comparison (~250 ms) instead of once ...
Initializes the working directory if necessary.
[ "Initializes", "the", "working", "directory", "if", "necessary", "." ]
def Initialize(self): """Initializes the working directory if necessary. This can technically be skipped if the same information is passed to the command used for image comparison, but that is less efficient under the hood. Doing it that way effectively requires an initialization for every comparis...
[ "def", "Initialize", "(", "self", ")", ":", "if", "self", ".", "_initialized", ":", "return", "0", ",", "None", "if", "self", ".", "_gold_properties", ".", "bypass_skia_gold_functionality", ":", "logging", ".", "warning", "(", "'Not actually initializing Gold due ...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/skia_gold_common/skia_gold_session.py#L194-L251
google-ar/WebARonTango
e86965d2cbc652156b480e0fcf77c716745578cd
chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py
python
ImmediateFunction.WriteCmdInit
(self, f)
Overridden from Function
Overridden from Function
[ "Overridden", "from", "Function" ]
def WriteCmdInit(self, f): """Overridden from Function""" self.type_handler.WriteImmediateCmdInit(self, f)
[ "def", "WriteCmdInit", "(", "self", ",", "f", ")", ":", "self", ".", "type_handler", ".", "WriteImmediateCmdInit", "(", "self", ",", "f", ")" ]
https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L9767-L9769
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Build.py
python
BuildContext.get_variant_dir
(self)
return os.path.join(self.out_dir, self.variant)
Getter for the variant_dir attribute
Getter for the variant_dir attribute
[ "Getter", "for", "the", "variant_dir", "attribute" ]
def get_variant_dir(self): """Getter for the variant_dir attribute""" if not self.variant: return self.out_dir return os.path.join(self.out_dir, self.variant)
[ "def", "get_variant_dir", "(", "self", ")", ":", "if", "not", "self", ".", "variant", ":", "return", "self", ".", "out_dir", "return", "os", ".", "path", ".", "join", "(", "self", ".", "out_dir", ",", "self", ".", "variant", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Build.py#L128-L132
apache/impala
8ddac48f3428c86f2cbd037ced89cfb903298b12
shell/shell_output.py
python
DelimitedOutputFormatter.format
(self, rows)
return rows
Returns string containing UTF-8-encoded representation of the table data.
Returns string containing UTF-8-encoded representation of the table data.
[ "Returns", "string", "containing", "UTF", "-", "8", "-", "encoded", "representation", "of", "the", "table", "data", "." ]
def format(self, rows): """Returns string containing UTF-8-encoded representation of the table data.""" # csv.writer expects a file handle to the input. temp_buffer = StringIO() if sys.version_info.major == 2: # csv.writer in python2 requires an ascii string delimiter delim = self.field_deli...
[ "def", "format", "(", "self", ",", "rows", ")", ":", "# csv.writer expects a file handle to the input.", "temp_buffer", "=", "StringIO", "(", ")", "if", "sys", ".", "version_info", ".", "major", "==", "2", ":", "# csv.writer in python2 requires an ascii string delimiter...
https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/shell_output.py#L77-L95
lagadic/visp
e14e125ccc2d7cf38f3353efa01187ef782fbd0b
modules/java/generator/gen_java.py
python
JavaWrapperGenerator.isSmartClass
(self, ci)
return ci.smart
Check if class stores Ptr<T>* instead of T* in nativeObj field
Check if class stores Ptr<T>* instead of T* in nativeObj field
[ "Check", "if", "class", "stores", "Ptr<T", ">", "*", "instead", "of", "T", "*", "in", "nativeObj", "field" ]
def isSmartClass(self, ci): ''' Check if class stores Ptr<T>* instead of T* in nativeObj field ''' if ci.smart != None: return ci.smart # if parents are smart (we hope) then children are! # if not we believe the class is smart if it has "create" method ...
[ "def", "isSmartClass", "(", "self", ",", "ci", ")", ":", "if", "ci", ".", "smart", "!=", "None", ":", "return", "ci", ".", "smart", "# if parents are smart (we hope) then children are!", "# if not we believe the class is smart if it has \"create\" method", "ci", ".", "s...
https://github.com/lagadic/visp/blob/e14e125ccc2d7cf38f3353efa01187ef782fbd0b/modules/java/generator/gen_java.py#L1184-L1202
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/framework/ops.py
python
Tensor.eval
(self, feed_dict=None, session=None)
return _eval_using_default_session(self, feed_dict, self.graph, session)
Evaluates this tensor in a `Session`. Calling this method will execute all preceding operations that produce the inputs needed for the operation that produces this tensor. *N.B.* Before invoking `Tensor.eval()`, its graph must have been launched in a session, and either a default session must be ...
Evaluates this tensor in a `Session`.
[ "Evaluates", "this", "tensor", "in", "a", "Session", "." ]
def eval(self, feed_dict=None, session=None): """Evaluates this tensor in a `Session`. Calling this method will execute all preceding operations that produce the inputs needed for the operation that produces this tensor. *N.B.* Before invoking `Tensor.eval()`, its graph must have been launched...
[ "def", "eval", "(", "self", ",", "feed_dict", "=", "None", ",", "session", "=", "None", ")", ":", "return", "_eval_using_default_session", "(", "self", ",", "feed_dict", ",", "self", ".", "graph", ",", "session", ")" ]
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/framework/ops.py#L537-L559
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/models.py
python
Response.links
(self)
return l
Returns the parsed header links of the response, if any.
Returns the parsed header links of the response, if any.
[ "Returns", "the", "parsed", "header", "links", "of", "the", "response", "if", "any", "." ]
def links(self): """Returns the parsed header links of the response, if any.""" header = self.headers.get('link') # l = MultiDict() l = {} if header: links = parse_header_links(header) for link in links: key = link.get('rel') or link.ge...
[ "def", "links", "(", "self", ")", ":", "header", "=", "self", ".", "headers", ".", "get", "(", "'link'", ")", "# l = MultiDict()", "l", "=", "{", "}", "if", "header", ":", "links", "=", "parse_header_links", "(", "header", ")", "for", "link", "in", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/requests/models.py#L901-L916
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Utilities/Templates/Modules/ScriptedSegmentEditorEffect/SegmentEditorTemplateKey.py
python
SegmentEditorTemplateKeyTest.setUp
(self)
Do whatever is needed to reset the state - typically a scene clear will be enough.
Do whatever is needed to reset the state - typically a scene clear will be enough.
[ "Do", "whatever", "is", "needed", "to", "reset", "the", "state", "-", "typically", "a", "scene", "clear", "will", "be", "enough", "." ]
def setUp(self): """ Do whatever is needed to reset the state - typically a scene clear will be enough. """ slicer.mrmlScene.Clear(0)
[ "def", "setUp", "(", "self", ")", ":", "slicer", ".", "mrmlScene", ".", "Clear", "(", "0", ")" ]
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Utilities/Templates/Modules/ScriptedSegmentEditorEffect/SegmentEditorTemplateKey.py#L39-L42
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/learn/python/learn/preprocessing/categorical_vocabulary.py
python
CategoricalVocabulary.reverse
(self, class_id)
return self._reverse_mapping[class_id]
Given class id reverse to original class name. Args: class_id: Id of the class. Returns: Class name. Raises: ValueError: if this vocabulary wasn't initalized with support_reverse.
Given class id reverse to original class name.
[ "Given", "class", "id", "reverse", "to", "original", "class", "name", "." ]
def reverse(self, class_id): """Given class id reverse to original class name. Args: class_id: Id of the class. Returns: Class name. Raises: ValueError: if this vocabulary wasn't initalized with support_reverse. """ if not self._support_reverse: raise ValueError("This ...
[ "def", "reverse", "(", "self", ",", "class_id", ")", ":", "if", "not", "self", ".", "_support_reverse", ":", "raise", "ValueError", "(", "\"This vocabulary wasn't initalized with \"", "\"support_reverse to support reverse() function.\"", ")", "return", "self", ".", "_re...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/learn/python/learn/preprocessing/categorical_vocabulary.py#L121-L136
tiny-dnn/tiny-dnn
c0f576f5cb7b35893f62127cb7aec18f77a3bcc5
third_party/gemmlowp/meta/generators/gemm_MxNxK.py
python
GenerateFullTempsCountersAndConsts
(emitter, result_type, rows)
Generates all the boilerplate variables for the int32 and float gemms.
Generates all the boilerplate variables for the int32 and float gemms.
[ "Generates", "all", "the", "boilerplate", "variables", "for", "the", "int32", "and", "float", "gemms", "." ]
def GenerateFullTempsCountersAndConsts(emitter, result_type, rows): """Generates all the boilerplate variables for the int32 and float gemms.""" GenerateCommonTempsCountersAndConsts(emitter, rows) emitter.EmitDeclare('const std::int32_t', 'const_offset', 'lhs_offset * rhs_offset * k') emit...
[ "def", "GenerateFullTempsCountersAndConsts", "(", "emitter", ",", "result_type", ",", "rows", ")", ":", "GenerateCommonTempsCountersAndConsts", "(", "emitter", ",", "rows", ")", "emitter", ".", "EmitDeclare", "(", "'const std::int32_t'", ",", "'const_offset'", ",", "'...
https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/gemmlowp/meta/generators/gemm_MxNxK.py#L65-L74
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Util.py
python
flatten
(obj, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes=SequenceTypes, do_flatten=do_flatten)
return result
Flatten a sequence to a non-nested list. Flatten() converts either a single scalar or a nested sequence to a non-nested list. Note that flatten() considers strings to be scalars instead of sequences like Python would.
Flatten a sequence to a non-nested list.
[ "Flatten", "a", "sequence", "to", "a", "non", "-", "nested", "list", "." ]
def flatten(obj, isinstance=isinstance, StringTypes=StringTypes, SequenceTypes=SequenceTypes, do_flatten=do_flatten): """Flatten a sequence to a non-nested list. Flatten() converts either a single scalar or a nested sequence to a non-nested list. Note that flatten() considers strings to be ...
[ "def", "flatten", "(", "obj", ",", "isinstance", "=", "isinstance", ",", "StringTypes", "=", "StringTypes", ",", "SequenceTypes", "=", "SequenceTypes", ",", "do_flatten", "=", "do_flatten", ")", ":", "if", "isinstance", "(", "obj", ",", "StringTypes", ")", "...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Util.py#L427-L443
tiny-dnn/tiny-dnn
c0f576f5cb7b35893f62127cb7aec18f77a3bcc5
third_party/cpplint.py
python
NestingState.UpdatePreprocessor
(self, line)
Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the following assumptions (good enough for most...
Update preprocessor stack.
[ "Update", "preprocessor", "stack", "." ]
def UpdatePreprocessor(self, line): """Update preprocessor stack. We need to handle preprocessors due to classes like this: #ifdef SWIG struct ResultDetailsPageElementExtensionPoint { #else struct ResultDetailsPageElementExtensionPoint : public Extension { #endif We make the ...
[ "def", "UpdatePreprocessor", "(", "self", ",", "line", ")", ":", "if", "Match", "(", "r'^\\s*#\\s*(if|ifdef|ifndef)\\b'", ",", "line", ")", ":", "# Beginning of #if block, save the nesting stack here. The saved", "# stack will allow us to restore the parsing state in the #else cas...
https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/cpplint.py#L2633-L2687
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
PrintDialogData.GetFromPage
(*args, **kwargs)
return _windows_.PrintDialogData_GetFromPage(*args, **kwargs)
GetFromPage(self) -> int
GetFromPage(self) -> int
[ "GetFromPage", "(", "self", ")", "-", ">", "int" ]
def GetFromPage(*args, **kwargs): """GetFromPage(self) -> int""" return _windows_.PrintDialogData_GetFromPage(*args, **kwargs)
[ "def", "GetFromPage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "PrintDialogData_GetFromPage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L5042-L5044
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/pydoc.py
python
Doc.document
(self, object, name=None, *args)
return self.docother(*args)
Generate documentation for an object.
Generate documentation for an object.
[ "Generate", "documentation", "for", "an", "object", "." ]
def document(self, object, name=None, *args): """Generate documentation for an object.""" args = (object, name) + args # 'try' clause is to attempt to handle the possibility that inspect # identifies something in a way that pydoc itself has issues handling; # think 'super' and ho...
[ "def", "document", "(", "self", ",", "object", ",", "name", "=", "None", ",", "*", "args", ")", ":", "args", "=", "(", "object", ",", "name", ")", "+", "args", "# 'try' clause is to attempt to handle the possibility that inspect", "# identifies something in a way th...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pydoc.py#L464-L478
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/xml/sax/xmlreader.py
python
XMLReader.getContentHandler
(self)
return self._cont_handler
Returns the current ContentHandler.
Returns the current ContentHandler.
[ "Returns", "the", "current", "ContentHandler", "." ]
def getContentHandler(self): "Returns the current ContentHandler." return self._cont_handler
[ "def", "getContentHandler", "(", "self", ")", ":", "return", "self", ".", "_cont_handler" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/sax/xmlreader.py#L34-L36
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/evaluation.py
python
recall
(targets, predictions, average="macro")
return _turicreate.extensions._supervised_streaming_evaluator( targets, predictions, "recall", opts )
r""" Compute the recall score for classification tasks. The recall score quantifies the ability of a classifier to predict `positive` examples. Recall can be interpreted as the probability that a randomly selected `positive` example is correctly identified by the classifier. The score is in the rang...
r""" Compute the recall score for classification tasks. The recall score quantifies the ability of a classifier to predict `positive` examples. Recall can be interpreted as the probability that a randomly selected `positive` example is correctly identified by the classifier. The score is in the rang...
[ "r", "Compute", "the", "recall", "score", "for", "classification", "tasks", ".", "The", "recall", "score", "quantifies", "the", "ability", "of", "a", "classifier", "to", "predict", "positive", "examples", ".", "Recall", "can", "be", "interpreted", "as", "the",...
def recall(targets, predictions, average="macro"): r""" Compute the recall score for classification tasks. The recall score quantifies the ability of a classifier to predict `positive` examples. Recall can be interpreted as the probability that a randomly selected `positive` example is correctly ide...
[ "def", "recall", "(", "targets", ",", "predictions", ",", "average", "=", "\"macro\"", ")", ":", "_supervised_evaluation_error_checking", "(", "targets", ",", "predictions", ")", "_check_categorical_option_type", "(", "\"average\"", ",", "average", ",", "[", "\"micr...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/evaluation.py#L869-L982
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/setitem_impl.py
python
_tensor_setitem_by_none_with_tensor
(data, index, value)
return compile_utils.tensor_setitem_by_ellipsis_with_tensor(data, value)
Tensor assignment. Note: Syntax support: A[...] = u Restraint condition: A is a Tensor. u is a Tensor. Inputs: data (Tensor): Assigned tensor. index (None): Index is ``...``. value (Tensor): Assignment value. Outputs: Tensor, ele...
Tensor assignment.
[ "Tensor", "assignment", "." ]
def _tensor_setitem_by_none_with_tensor(data, index, value): """ Tensor assignment. Note: Syntax support: A[...] = u Restraint condition: A is a Tensor. u is a Tensor. Inputs: data (Tensor): Assigned tensor. index (None): Index is ``...``. ...
[ "def", "_tensor_setitem_by_none_with_tensor", "(", "data", ",", "index", ",", "value", ")", ":", "return", "compile_utils", ".", "tensor_setitem_by_ellipsis_with_tensor", "(", "data", ",", "value", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/setitem_impl.py#L598-L614
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
scripts/cpp_lint.py
python
CheckIncludeLine
(filename, clean_lines, linenum, include_state, error)
Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here. Args: filename: The name of the current file. clean_l...
Check rules that are applicable to #include lines.
[ "Check", "rules", "that", "are", "applicable", "to", "#include", "lines", "." ]
def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage m...
[ "def", "CheckIncludeLine", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "include_state", ",", "error", ")", ":", "fileinfo", "=", "FileInfo", "(", "filename", ")", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "# \"include\" shoul...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/scripts/cpp_lint.py#L3684-L3753
psnonis/FinBERT
c0c555d833a14e2316a3701e59c0b5156f804b4e
bert-gpu/run_classifier_with_tfhub.py
python
create_model
(is_training, input_ids, input_mask, segment_ids, labels, num_labels, bert_hub_module_handle)
Creates a classification model.
Creates a classification model.
[ "Creates", "a", "classification", "model", "." ]
def create_model(is_training, input_ids, input_mask, segment_ids, labels, num_labels, bert_hub_module_handle): """Creates a classification model.""" tags = set() if is_training: tags.add("train") bert_module = hub.Module(bert_hub_module_handle, tags=tags, trainable=True) bert_inputs = dic...
[ "def", "create_model", "(", "is_training", ",", "input_ids", ",", "input_mask", ",", "segment_ids", ",", "labels", ",", "num_labels", ",", "bert_hub_module_handle", ")", ":", "tags", "=", "set", "(", ")", "if", "is_training", ":", "tags", ".", "add", "(", ...
https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert-gpu/run_classifier_with_tfhub.py#L37-L84
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/base/android/jni_generator/jni_registration_generator.py
python
HeaderGenerator._AddRegisterNativesFunctions
(self)
Returns the code for RegisterNatives.
Returns the code for RegisterNatives.
[ "Returns", "the", "code", "for", "RegisterNatives", "." ]
def _AddRegisterNativesFunctions(self): """Returns the code for RegisterNatives.""" natives = self._GetRegisterNativesImplString() if not natives: return '' template = string.Template("""\ JNI_REGISTRATION_EXPORT bool ${REGISTER_NAME}(JNIEnv* env) { ${NATIVES}\ return true; } """) values = ...
[ "def", "_AddRegisterNativesFunctions", "(", "self", ")", ":", "natives", "=", "self", ".", "_GetRegisterNativesImplString", "(", ")", "if", "not", "natives", ":", "return", "''", "template", "=", "string", ".", "Template", "(", "\"\"\"\\\nJNI_REGISTRATION_EXPORT boo...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/base/android/jni_generator/jni_registration_generator.py#L498-L516
doyubkim/fluid-engine-dev
45b4bdbdb4c6d8c0beebc682180469198203b0ef
scripts/utils.py
python
is_linux
()
return guess_os() == 'linux'
Returns True if you are using Linux.
Returns True if you are using Linux.
[ "Returns", "True", "if", "you", "are", "using", "Linux", "." ]
def is_linux(): """ Returns True if you are using Linux. """ return guess_os() == 'linux'
[ "def", "is_linux", "(", ")", ":", "return", "guess_os", "(", ")", "==", "'linux'" ]
https://github.com/doyubkim/fluid-engine-dev/blob/45b4bdbdb4c6d8c0beebc682180469198203b0ef/scripts/utils.py#L148-L152
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/os.py
python
execlpe
(file, *args)
execlpe(file, *args, env) Execute the executable file (which is searched for along $PATH) with argument list args and environment env, replacing the current process.
execlpe(file, *args, env)
[ "execlpe", "(", "file", "*", "args", "env", ")" ]
def execlpe(file, *args): """execlpe(file, *args, env) Execute the executable file (which is searched for along $PATH) with argument list args and environment env, replacing the current process. """ env = args[-1] execvpe(file, args[:-1], env)
[ "def", "execlpe", "(", "file", ",", "*", "args", ")", ":", "env", "=", "args", "[", "-", "1", "]", "execvpe", "(", "file", ",", "args", "[", ":", "-", "1", "]", ",", "env", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/os.py#L331-L338
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/trade_bin.py
python
TradeBin.trades
(self, trades)
Sets the trades of this TradeBin. :param trades: The trades of this TradeBin. # noqa: E501 :type: float
Sets the trades of this TradeBin.
[ "Sets", "the", "trades", "of", "this", "TradeBin", "." ]
def trades(self, trades): """Sets the trades of this TradeBin. :param trades: The trades of this TradeBin. # noqa: E501 :type: float """ self._trades = trades
[ "def", "trades", "(", "self", ",", "trades", ")", ":", "self", ".", "_trades", "=", "trades" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/trade_bin.py#L249-L257
verilog-to-routing/vtr-verilog-to-routing
d9719cf7374821156c3cee31d66991cb85578562
vtr_flow/scripts/python_libs/vtr/task.py
python
Job.circuit
(self)
return self._circuit
return the circuit file name of the job
return the circuit file name of the job
[ "return", "the", "circuit", "file", "name", "of", "the", "job" ]
def circuit(self): """ return the circuit file name of the job """ return self._circuit
[ "def", "circuit", "(", "self", ")", ":", "return", "self", ".", "_circuit" ]
https://github.com/verilog-to-routing/vtr-verilog-to-routing/blob/d9719cf7374821156c3cee31d66991cb85578562/vtr_flow/scripts/python_libs/vtr/task.py#L120-L124
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/series.py
python
Series.__matmul__
(self, other)
return self.dot(other)
Matrix multiplication using binary `@` operator in Python>=3.5.
Matrix multiplication using binary `
[ "Matrix", "multiplication", "using", "binary" ]
def __matmul__(self, other): """ Matrix multiplication using binary `@` operator in Python>=3.5. """ return self.dot(other)
[ "def", "__matmul__", "(", "self", ",", "other", ")", ":", "return", "self", ".", "dot", "(", "other", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/series.py#L2484-L2488
gnina/gnina
b9ae032f52fc7a8153987bde09c0efa3620d8bb6
caffe/scripts/cpp_lint.py
python
ResetNolintSuppressions
()
Resets the set of NOLINT suppressions to empty.
Resets the set of NOLINT suppressions to empty.
[ "Resets", "the", "set", "of", "NOLINT", "suppressions", "to", "empty", "." ]
def ResetNolintSuppressions(): "Resets the set of NOLINT suppressions to empty." _error_suppressions.clear()
[ "def", "ResetNolintSuppressions", "(", ")", ":", "_error_suppressions", ".", "clear", "(", ")" ]
https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/scripts/cpp_lint.py#L499-L501
CaoWGG/TensorRT-CenterNet
f949252e37b51e60f873808f46d3683f15735e79
onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py
python
TokenKind.__init__
(self, value, name)
Create a new TokenKind instance from a numeric value and a name.
Create a new TokenKind instance from a numeric value and a name.
[ "Create", "a", "new", "TokenKind", "instance", "from", "a", "numeric", "value", "and", "a", "name", "." ]
def __init__(self, value, name): """Create a new TokenKind instance from a numeric value and a name.""" self.value = value self.name = name
[ "def", "__init__", "(", "self", ",", "value", ",", "name", ")", ":", "self", ".", "value", "=", "value", "self", ".", "name", "=", "name" ]
https://github.com/CaoWGG/TensorRT-CenterNet/blob/f949252e37b51e60f873808f46d3683f15735e79/onnx-tensorrt/third_party/onnx/third_party/pybind11/tools/clang/cindex.py#L483-L486
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/pydoc.py
python
Doc.getdocloc
(self, object, basedir=os.path.join(sys.exec_prefix, "lib", "python"+sys.version[0:3]))
return docloc
Return the location of module docs or None
Return the location of module docs or None
[ "Return", "the", "location", "of", "module", "docs", "or", "None" ]
def getdocloc(self, object, basedir=os.path.join(sys.exec_prefix, "lib", "python"+sys.version[0:3])): """Return the location of module docs or None""" try: file = inspect.getabsfile(object) except TypeError: file =...
[ "def", "getdocloc", "(", "self", ",", "object", ",", "basedir", "=", "os", ".", "path", ".", "join", "(", "sys", ".", "exec_prefix", ",", "\"lib\"", ",", "\"python\"", "+", "sys", ".", "version", "[", "0", ":", "3", "]", ")", ")", ":", "try", ":"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/pydoc.py#L377-L403
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/multiprocessing/managers.py
python
BaseManager.join
(self, timeout=None)
Join the manager process (if it has been spawned)
Join the manager process (if it has been spawned)
[ "Join", "the", "manager", "process", "(", "if", "it", "has", "been", "spawned", ")" ]
def join(self, timeout=None): ''' Join the manager process (if it has been spawned) ''' self._process.join(timeout)
[ "def", "join", "(", "self", ",", "timeout", "=", "None", ")", ":", "self", ".", "_process", ".", "join", "(", "timeout", ")" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/multiprocessing/managers.py#L539-L543
9miao/CrossApp
1f5375e061bf69841eb19728598f5ae3f508d620
tools/bindings-generator/generator.py
python
Generator.sorted_classes
(self)
return no_dupes
sorted classes in order of inheritance
sorted classes in order of inheritance
[ "sorted", "classes", "in", "order", "of", "inheritance" ]
def sorted_classes(self): ''' sorted classes in order of inheritance ''' sorted_list = [] for class_name in self.generated_classes.iterkeys(): nclass = self.generated_classes[class_name] sorted_list += self._sorted_parents(nclass) # remove dupes fr...
[ "def", "sorted_classes", "(", "self", ")", ":", "sorted_list", "=", "[", "]", "for", "class_name", "in", "self", ".", "generated_classes", ".", "iterkeys", "(", ")", ":", "nclass", "=", "self", ".", "generated_classes", "[", "class_name", "]", "sorted_list",...
https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/generator.py#L1158-L1169
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/msvc.py
python
msvc14_get_vc_env
(plat_spec)
Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict environment
Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers.
[ "Patched", "distutils", ".", "_msvccompiler", ".", "_get_vc_env", "for", "support", "extra", "Microsoft", "Visual", "C", "++", "14", ".", "X", "compilers", "." ]
def msvc14_get_vc_env(plat_spec): """ Patched "distutils._msvccompiler._get_vc_env" for support extra Microsoft Visual C++ 14.X compilers. Set environment without use of "vcvarsall.bat". Parameters ---------- plat_spec: str Target architecture. Return ------ dict ...
[ "def", "msvc14_get_vc_env", "(", "plat_spec", ")", ":", "# Always use backport from CPython 3.8", "try", ":", "return", "_msvc14_get_vc_env", "(", "plat_spec", ")", "except", "distutils", ".", "errors", ".", "DistutilsPlatformError", "as", "exc", ":", "_augment_exceptio...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/msvc.py#L294-L317
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/dashboard/tools.py
python
NotificationQueue.register
(cls, func, n_types=None, priority=1)
Registers function to listen for notifications If the second parameter `n_types` is omitted, the function in `func` parameter will be called for any type of notifications. Args: func (function): python function ex: def foo(val) n_types (str|list): the single type to lis...
Registers function to listen for notifications
[ "Registers", "function", "to", "listen", "for", "notifications" ]
def register(cls, func, n_types=None, priority=1): """Registers function to listen for notifications If the second parameter `n_types` is omitted, the function in `func` parameter will be called for any type of notifications. Args: func (function): python function ex: def f...
[ "def", "register", "(", "cls", ",", "func", ",", "n_types", "=", "None", ",", "priority", "=", "1", ")", ":", "with", "cls", ".", "_lock", ":", "if", "not", "n_types", ":", "n_types", "=", "[", "cls", ".", "_ALL_TYPES_", "]", "elif", "isinstance", ...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/dashboard/tools.py#L301-L325
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/ops/variables.py
python
Variable._OverloadOperator
(operator)
Register _RunOp as the implementation of 'operator'. Args: operator: string. The operator name.
Register _RunOp as the implementation of 'operator'.
[ "Register", "_RunOp", "as", "the", "implementation", "of", "operator", "." ]
def _OverloadOperator(operator): """Register _RunOp as the implementation of 'operator'. Args: operator: string. The operator name. """ if operator in ["__invert__", "__neg__", "__abs__"]: setattr(Variable, operator, lambda a: Variable._RunOp(operator, a, None)) else: setattr(Vari...
[ "def", "_OverloadOperator", "(", "operator", ")", ":", "if", "operator", "in", "[", "\"__invert__\"", ",", "\"__neg__\"", ",", "\"__abs__\"", "]", ":", "setattr", "(", "Variable", ",", "operator", ",", "lambda", "a", ":", "Variable", ".", "_RunOp", "(", "o...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/ops/variables.py#L606-L615
deepmind/streetlearn
ccf1d60b9c45154894d45a897748aee85d7eb69b
streetlearn/python/environment/observations.py
python
reshape_hwc
(array, c, w, h)
return np.ravel((arr[0], arr[1], arr[2]), order='F').reshape(h, w, 3)
Turn a planar RGB array into an interleaved one. Args: array: An array of bytes consisting the planar RGB image of size (c, w, h). c: Number of channels in the image. w: Width of the image. h: Height of the image. Returns: An interleaved array of bytes shape shaped (h, w, c).
Turn a planar RGB array into an interleaved one.
[ "Turn", "a", "planar", "RGB", "array", "into", "an", "interleaved", "one", "." ]
def reshape_hwc(array, c, w, h): """Turn a planar RGB array into an interleaved one. Args: array: An array of bytes consisting the planar RGB image of size (c, w, h). c: Number of channels in the image. w: Width of the image. h: Height of the image. Returns: An interleaved array of bytes shap...
[ "def", "reshape_hwc", "(", "array", ",", "c", ",", "w", ",", "h", ")", ":", "arr", "=", "array", ".", "reshape", "(", "c", ",", "w", "*", "h", ")", "return", "np", ".", "ravel", "(", "(", "arr", "[", "0", "]", ",", "arr", "[", "1", "]", "...
https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/environment/observations.py#L30-L43
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/EditorWindow.py
python
EditorWindow.ResetFont
(self)
Update the text widgets' font if it is changed
Update the text widgets' font if it is changed
[ "Update", "the", "text", "widgets", "font", "if", "it", "is", "changed" ]
def ResetFont(self): "Update the text widgets' font if it is changed" # Called from configDialog.py fontWeight='normal' if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'): fontWeight='bold' self.text.config(font=(idleConf.GetOption('main','EditorWind...
[ "def", "ResetFont", "(", "self", ")", ":", "# Called from configDialog.py", "fontWeight", "=", "'normal'", "if", "idleConf", ".", "GetOption", "(", "'main'", ",", "'EditorWindow'", ",", "'font-bold'", ",", "type", "=", "'bool'", ")", ":", "fontWeight", "=", "'...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/idlelib/EditorWindow.py#L766-L775
aimerykong/Low-Rank-Bilinear-Pooling
487eb2c857fd9c95357a5166b0c15ad0fe135b28
demo3_modelVisualization/vlfeat/docsrc/webdoc.py
python
DocNode.adopt
(self, orfan)
Adds ORFAN to the node children and make the node the parent of ORFAN. ORFAN can also be a sequence of orfans.
Adds ORFAN to the node children and make the node the parent of ORFAN. ORFAN can also be a sequence of orfans.
[ "Adds", "ORFAN", "to", "the", "node", "children", "and", "make", "the", "node", "the", "parent", "of", "ORFAN", ".", "ORFAN", "can", "also", "be", "a", "sequence", "of", "orfans", "." ]
def adopt(self, orfan): """ Adds ORFAN to the node children and make the node the parent of ORFAN. ORFAN can also be a sequence of orfans. """ self.children.append(orfan) orfan.setParent(self)
[ "def", "adopt", "(", "self", ",", "orfan", ")", ":", "self", ".", "children", ".", "append", "(", "orfan", ")", "orfan", ".", "setParent", "(", "self", ")" ]
https://github.com/aimerykong/Low-Rank-Bilinear-Pooling/blob/487eb2c857fd9c95357a5166b0c15ad0fe135b28/demo3_modelVisualization/vlfeat/docsrc/webdoc.py#L326-L332
microsoft/ELL
a1d6bacc37a14879cc025d9be2ba40b1a0632315
tools/importers/CNTK/lib/cntk_utilities.py
python
Utilities.get_model_nodes
(root)
return nodes
Returns a list of the high-level nodes (i.e. function blocks) that make up the CNTK model
Returns a list of the high-level nodes (i.e. function blocks) that make up the CNTK model
[ "Returns", "a", "list", "of", "the", "high", "-", "level", "nodes", "(", "i", ".", "e", ".", "function", "blocks", ")", "that", "make", "up", "the", "CNTK", "model" ]
def get_model_nodes(root): """Returns a list of the high-level nodes (i.e. function blocks) that make up the CNTK model """ stack = [root.root_function] # node nodes = [] # final result, list of all relevant layers visited = set() while stack: node = stack.p...
[ "def", "get_model_nodes", "(", "root", ")", ":", "stack", "=", "[", "root", ".", "root_function", "]", "# node", "nodes", "=", "[", "]", "# final result, list of all relevant layers", "visited", "=", "set", "(", ")", "while", "stack", ":", "node", "=", "stac...
https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/CNTK/lib/cntk_utilities.py#L214-L251
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/third_party/davclient/davclient.py
python
DAVClient.propfind
(self, path, properties='allprop', namespace='DAV:', depth=None, headers=None)
Property find. If properties arg is unspecified it defaults to 'allprop
Property find. If properties arg is unspecified it defaults to 'allprop
[ "Property", "find", ".", "If", "properties", "arg", "is", "unspecified", "it", "defaults", "to", "allprop" ]
def propfind(self, path, properties='allprop', namespace='DAV:', depth=None, headers=None): """Property find. If properties arg is unspecified it defaults to 'allprop'""" # Build propfind xml root = ElementTree.Element('{DAV:}propfind') if type(properties) is str: ElementTree...
[ "def", "propfind", "(", "self", ",", "path", ",", "properties", "=", "'allprop'", ",", "namespace", "=", "'DAV:'", ",", "depth", "=", "None", ",", "headers", "=", "None", ")", ":", "# Build propfind xml", "root", "=", "ElementTree", ".", "Element", "(", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/third_party/davclient/davclient.py#L195-L243
microsoft/AirSim
8057725712c0cd46979135396381784075ffc0f3
PythonClient/airsim/client.py
python
VehicleClient.simGetDistortionParams
(self, camera_name, vehicle_name = '', external = False)
return self.client.call('simGetDistortionParams', str(camera_name), vehicle_name, external)
Get camera distortion parameters Args: camera_name (str): Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used vehicle_name (str, optional): Vehicle which the camera is associated with external (bool, optional): Whether the camera is ...
Get camera distortion parameters
[ "Get", "camera", "distortion", "parameters" ]
def simGetDistortionParams(self, camera_name, vehicle_name = '', external = False): """ Get camera distortion parameters Args: camera_name (str): Name of the camera, for backwards compatibility, ID numbers such as 0,1,etc. can also be used vehicle_name (str, optional): V...
[ "def", "simGetDistortionParams", "(", "self", ",", "camera_name", ",", "vehicle_name", "=", "''", ",", "external", "=", "False", ")", ":", "return", "self", ".", "client", ".", "call", "(", "'simGetDistortionParams'", ",", "str", "(", "camera_name", ")", ","...
https://github.com/microsoft/AirSim/blob/8057725712c0cd46979135396381784075ffc0f3/PythonClient/airsim/client.py#L723-L736
nyuwireless-unipd/ns3-mmwave
4ff9e87e8079764e04cbeccd8e85bff15ae16fb3
src/visualizer/visualizer/core.py
python
Visualizer._panning_motion
(self, widget, event)
return True
! Panning motion function. @param self: class object. @param widget: widget. @param event: event. @return true if successful
! Panning motion function.
[ "!", "Panning", "motion", "function", "." ]
def _panning_motion(self, widget, event): """! Panning motion function. @param self: class object. @param widget: widget. @param event: event. @return true if successful """ assert self._panning_state is not None if event.is_hint: pos ...
[ "def", "_panning_motion", "(", "self", ",", "widget", ",", "event", ")", ":", "assert", "self", ".", "_panning_state", "is", "not", "None", "if", "event", ".", "is_hint", ":", "pos", "=", "widget", ".", "get_window", "(", ")", ".", "get_device_position", ...
https://github.com/nyuwireless-unipd/ns3-mmwave/blob/4ff9e87e8079764e04cbeccd8e85bff15ae16fb3/src/visualizer/visualizer/core.py#L924-L949
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/amp/grad_scaler.py
python
GradScaler.load_state_dict
(self, state_dict)
Loads the scaler state. Args: state_dict(dict): scaler state. Should be an object returned from a call to `GradScaler.state_dict()`. Examples: .. code-block:: python # required: gpu,xpu import paddle sca...
Loads the scaler state. Args: state_dict(dict): scaler state. Should be an object returned from a call to `GradScaler.state_dict()`. Examples:
[ "Loads", "the", "scaler", "state", ".", "Args", ":", "state_dict", "(", "dict", ")", ":", "scaler", "state", ".", "Should", "be", "an", "object", "returned", "from", "a", "call", "to", "GradScaler", ".", "state_dict", "()", ".", "Examples", ":" ]
def load_state_dict(self, state_dict): """ Loads the scaler state. Args: state_dict(dict): scaler state. Should be an object returned from a call to `GradScaler.state_dict()`. Examples: .. code-block:: python # required:...
[ "def", "load_state_dict", "(", "self", ",", "state_dict", ")", ":", "super", "(", "GradScaler", ",", "self", ")", ".", "load_state_dict", "(", "state_dict", ")" ]
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/amp/grad_scaler.py#L610-L634
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/problems/problem.py
python
Problem.is_dcp
(self, dpp: bool = False)
return all( expr.is_dcp(dpp) for expr in self.constraints + [self.objective])
Does the problem satisfy DCP rules? Arguments --------- dpp : bool, optional If True, enforce the disciplined parametrized programming (DPP) ruleset; only relevant when the problem involves Parameters. DPP is a mild restriction of DCP. When a problem involvin...
Does the problem satisfy DCP rules?
[ "Does", "the", "problem", "satisfy", "DCP", "rules?" ]
def is_dcp(self, dpp: bool = False) -> bool: """Does the problem satisfy DCP rules? Arguments --------- dpp : bool, optional If True, enforce the disciplined parametrized programming (DPP) ruleset; only relevant when the problem involves Parameters. D...
[ "def", "is_dcp", "(", "self", ",", "dpp", ":", "bool", "=", "False", ")", "->", "bool", ":", "return", "all", "(", "expr", ".", "is_dcp", "(", "dpp", ")", "for", "expr", "in", "self", ".", "constraints", "+", "[", "self", ".", "objective", "]", "...
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/problems/problem.py#L222-L242
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
clang/bindings/python/clang/cindex.py
python
Cursor.availability
(self)
return AvailabilityKind.from_id(self._availability)
Retrieves the availability of the entity pointed at by the cursor.
Retrieves the availability of the entity pointed at by the cursor.
[ "Retrieves", "the", "availability", "of", "the", "entity", "pointed", "at", "by", "the", "cursor", "." ]
def availability(self): """ Retrieves the availability of the entity pointed at by the cursor. """ if not hasattr(self, '_availability'): self._availability = conf.lib.clang_getCursorAvailability(self) return AvailabilityKind.from_id(self._availability)
[ "def", "availability", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_availability'", ")", ":", "self", ".", "_availability", "=", "conf", ".", "lib", ".", "clang_getCursorAvailability", "(", "self", ")", "return", "AvailabilityKind", "....
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/clang/bindings/python/clang/cindex.py#L1623-L1630
neopenx/Dragon
0e639a7319035ddc81918bd3df059230436ee0a1
Dragon/python/dragon/vm/theano/tensor/extra_ops.py
python
cumprod
(x, axis=None)
Compute the cumulative product along the given axis. Parameters ---------- x : Tensor The input tensor. axis : int The axis to sum. Default is ``None`` (Along all axes).
Compute the cumulative product along the given axis.
[ "Compute", "the", "cumulative", "product", "along", "the", "given", "axis", "." ]
def cumprod(x, axis=None): """Compute the cumulative product along the given axis. Parameters ---------- x : Tensor The input tensor. axis : int The axis to sum. Default is ``None`` (Along all axes). """ raise NotImplementedError()
[ "def", "cumprod", "(", "x", ",", "axis", "=", "None", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/vm/theano/tensor/extra_ops.py#L24-L35
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
python
logical_or
(attrs, inputs, proto_obj)
return 'broadcast_logical_or', attrs, inputs
Logical or of two input arrays.
Logical or of two input arrays.
[ "Logical", "or", "of", "two", "input", "arrays", "." ]
def logical_or(attrs, inputs, proto_obj): """Logical or of two input arrays.""" return 'broadcast_logical_or', attrs, inputs
[ "def", "logical_or", "(", "attrs", ",", "inputs", ",", "proto_obj", ")", ":", "return", "'broadcast_logical_or'", ",", "attrs", ",", "inputs" ]
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/onnx/onnx2mx/_op_translations.py#L121-L123
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/third_party/jinja2/environment.py
python
Template.is_up_to_date
(self)
return self._uptodate()
If this variable is `False` there is a newer version available.
If this variable is `False` there is a newer version available.
[ "If", "this", "variable", "is", "False", "there", "is", "a", "newer", "version", "available", "." ]
def is_up_to_date(self): """If this variable is `False` there is a newer version available.""" if self._uptodate is None: return True return self._uptodate()
[ "def", "is_up_to_date", "(", "self", ")", ":", "if", "self", ".", "_uptodate", "is", "None", ":", "return", "True", "return", "self", ".", "_uptodate", "(", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/environment.py#L1118-L1122
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/parfor.py
python
compute_def_once_internal
(loop_body, def_once, def_more, getattr_taken, typemap, module_assigns)
Compute the set of variables defined exactly once in the given set of blocks and use the given sets for storing which variables are defined once, more than once and which have had a getattr call on them.
Compute the set of variables defined exactly once in the given set of blocks and use the given sets for storing which variables are defined once, more than once and which have had a getattr call on them.
[ "Compute", "the", "set", "of", "variables", "defined", "exactly", "once", "in", "the", "given", "set", "of", "blocks", "and", "use", "the", "given", "sets", "for", "storing", "which", "variables", "are", "defined", "once", "more", "than", "once", "and", "w...
def compute_def_once_internal(loop_body, def_once, def_more, getattr_taken, typemap, module_assigns): '''Compute the set of variables defined exactly once in the given set of blocks and use the given sets for storing which variables are defined once, more than once and which have had a getattr call on...
[ "def", "compute_def_once_internal", "(", "loop_body", ",", "def_once", ",", "def_more", ",", "getattr_taken", ",", "typemap", ",", "module_assigns", ")", ":", "# For each block...", "for", "label", ",", "block", "in", "loop_body", ".", "items", "(", ")", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/npyufunc/parfor.py#L601-L617
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Menu.insert_radiobutton
(self, index, cnf={}, **kw)
Addd radio menu item at INDEX.
Addd radio menu item at INDEX.
[ "Addd", "radio", "menu", "item", "at", "INDEX", "." ]
def insert_radiobutton(self, index, cnf={}, **kw): """Addd radio menu item at INDEX.""" self.insert(index, 'radiobutton', cnf or kw)
[ "def", "insert_radiobutton", "(", "self", ",", "index", ",", "cnf", "=", "{", "}", ",", "*", "*", "kw", ")", ":", "self", ".", "insert", "(", "index", ",", "'radiobutton'", ",", "cnf", "or", "kw", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L2703-L2705
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py
python
WorldWideWeb_suite_Events.get_window_info
(self, _object=None, _attributes={}, **_arguments)
get window info: Returns the information about the window as a list. Currently the list contains the window title and the URL. You can get the same information using standard Apple Event GetProperty. Required argument: window ID Keyword argument _attributes: AppleEvent attribute dictionary Retur...
get window info: Returns the information about the window as a list. Currently the list contains the window title and the URL. You can get the same information using standard Apple Event GetProperty. Required argument: window ID Keyword argument _attributes: AppleEvent attribute dictionary Retur...
[ "get", "window", "info", ":", "Returns", "the", "information", "about", "the", "window", "as", "a", "list", ".", "Currently", "the", "list", "contains", "the", "window", "title", "and", "the", "URL", ".", "You", "can", "get", "the", "same", "information", ...
def get_window_info(self, _object=None, _attributes={}, **_arguments): """get window info: Returns the information about the window as a list. Currently the list contains the window title and the URL. You can get the same information using standard Apple Event GetProperty. Required argument: window ID ...
[ "def", "get_window_info", "(", "self", ",", "_object", "=", "None", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'WWW!'", "_subcode", "=", "'WNFO'", "if", "_arguments", ":", "raise", "TypeError", ",", "'No opti...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/lib-scriptpackages/Netscape/WorldWideWeb_suite.py#L127-L146
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
GetEigVec
(*args)
return _snap.GetEigVec(*args)
GetEigVec(PUNGraph const & Graph, TFltV & EigVecV) Parameters: Graph: PUNGraph const & EigVecV: TFltV & GetEigVec(PUNGraph const & Graph, int const & EigVecs, TFltV & EigValV, TVec< TFltV > & EigVecV) Parameters: Graph: PUNGraph const & EigVecs: int const & EigValV...
GetEigVec(PUNGraph const & Graph, TFltV & EigVecV)
[ "GetEigVec", "(", "PUNGraph", "const", "&", "Graph", "TFltV", "&", "EigVecV", ")" ]
def GetEigVec(*args): """ GetEigVec(PUNGraph const & Graph, TFltV & EigVecV) Parameters: Graph: PUNGraph const & EigVecV: TFltV & GetEigVec(PUNGraph const & Graph, int const & EigVecs, TFltV & EigValV, TVec< TFltV > & EigVecV) Parameters: Graph: PUNGraph const & EigV...
[ "def", "GetEigVec", "(", "*", "args", ")", ":", "return", "_snap", ".", "GetEigVec", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L5599-L5616
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py
python
Image.reduce
(self, factor, box=None)
return self._new(self.im.reduce(factor, box))
Returns a copy of the image reduced by `factor` times. If the size of the image is not dividable by the `factor`, the resulting size will be rounded up. :param factor: A greater than 0 integer or tuple of two integers for width and height separately. :param box: An optional 4...
Returns a copy of the image reduced by `factor` times. If the size of the image is not dividable by the `factor`, the resulting size will be rounded up.
[ "Returns", "a", "copy", "of", "the", "image", "reduced", "by", "factor", "times", ".", "If", "the", "size", "of", "the", "image", "is", "not", "dividable", "by", "the", "factor", "the", "resulting", "size", "will", "be", "rounded", "up", "." ]
def reduce(self, factor, box=None): """ Returns a copy of the image reduced by `factor` times. If the size of the image is not dividable by the `factor`, the resulting size will be rounded up. :param factor: A greater than 0 integer or tuple of two integers for width ...
[ "def", "reduce", "(", "self", ",", "factor", ",", "box", "=", "None", ")", ":", "if", "not", "isinstance", "(", "factor", ",", "(", "list", ",", "tuple", ")", ")", ":", "factor", "=", "(", "factor", ",", "factor", ")", "if", "box", "is", "None", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Lib/PIL/Image.py#L1907-L1938
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Validator.Validate
(*args, **kwargs)
return _core_.Validator_Validate(*args, **kwargs)
Validate(self, Window parent) -> bool
Validate(self, Window parent) -> bool
[ "Validate", "(", "self", "Window", "parent", ")", "-", ">", "bool" ]
def Validate(*args, **kwargs): """Validate(self, Window parent) -> bool""" return _core_.Validator_Validate(*args, **kwargs)
[ "def", "Validate", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Validator_Validate", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L11880-L11882
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_overheadwire.py
python
OverheadWireDomain.getName
(self, stopID)
return self._getUniversal(tc.VAR_NAME, stopID)
getName(string) -> string Returns the name of this stop
getName(string) -> string
[ "getName", "(", "string", ")", "-", ">", "string" ]
def getName(self, stopID): """getName(string) -> string Returns the name of this stop """ return self._getUniversal(tc.VAR_NAME, stopID)
[ "def", "getName", "(", "self", ",", "stopID", ")", ":", "return", "self", ".", "_getUniversal", "(", "tc", ".", "VAR_NAME", ",", "stopID", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_overheadwire.py#L50-L55
apache/singa
93fd9da72694e68bfe3fb29d0183a65263d238a1
python/singa/utils.py
python
post_order_recursive
(root, root_t)
return nodes, weights, inputs
return a list by the topological ordering (postorder of Depth-first search) Args: root: singa operator root_t: tensor Returns: deque[int]
return a list by the topological ordering (postorder of Depth-first search) Args: root: singa operator root_t: tensor Returns: deque[int]
[ "return", "a", "list", "by", "the", "topological", "ordering", "(", "postorder", "of", "Depth", "-", "first", "search", ")", "Args", ":", "root", ":", "singa", "operator", "root_t", ":", "tensor", "Returns", ":", "deque", "[", "int", "]" ]
def post_order_recursive(root, root_t): """ return a list by the topological ordering (postorder of Depth-first search) Args: root: singa operator root_t: tensor Returns: deque[int] """ def recursive(root, yid, root_t): if root: # srcop: operator for...
[ "def", "post_order_recursive", "(", "root", ",", "root_t", ")", ":", "def", "recursive", "(", "root", ",", "yid", ",", "root_t", ")", ":", "if", "root", ":", "# srcop: operator for a input of root", "# yid: id(output of this operator)", "# y: output of this operator", ...
https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/python/singa/utils.py#L234-L267
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/reshape/tile.py
python
_coerce_to_type
(x)
return x, dtype
if the passed data is of datetime/timedelta, bool or nullable int type, this method converts it to numeric so that cut or qcut method can handle it
if the passed data is of datetime/timedelta, bool or nullable int type, this method converts it to numeric so that cut or qcut method can handle it
[ "if", "the", "passed", "data", "is", "of", "datetime", "/", "timedelta", "bool", "or", "nullable", "int", "type", "this", "method", "converts", "it", "to", "numeric", "so", "that", "cut", "or", "qcut", "method", "can", "handle", "it" ]
def _coerce_to_type(x): """ if the passed data is of datetime/timedelta, bool or nullable int type, this method converts it to numeric so that cut or qcut method can handle it """ dtype = None if is_datetime64tz_dtype(x): dtype = x.dtype elif is_datetime64_dtype(x): x = ...
[ "def", "_coerce_to_type", "(", "x", ")", ":", "dtype", "=", "None", "if", "is_datetime64tz_dtype", "(", "x", ")", ":", "dtype", "=", "x", ".", "dtype", "elif", "is_datetime64_dtype", "(", "x", ")", ":", "x", "=", "to_datetime", "(", "x", ")", "dtype", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/reshape/tile.py#L429-L459
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/gtk+/gtk/compose-parse.py
python
download_hook
(blocks_transferred, block_size, file_size)
A download hook to provide some feedback when downloading
A download hook to provide some feedback when downloading
[ "A", "download", "hook", "to", "provide", "some", "feedback", "when", "downloading" ]
def download_hook(blocks_transferred, block_size, file_size): """ A download hook to provide some feedback when downloading """ if blocks_transferred == 0: if file_size > 0: if opt_verbose: print "Downloading", file_size, "bytes: ", else: if opt_verbose: print "Downloading: ", sys.stdout.write('#'...
[ "def", "download_hook", "(", "blocks_transferred", ",", "block_size", ",", "file_size", ")", ":", "if", "blocks_transferred", "==", "0", ":", "if", "file_size", ">", "0", ":", "if", "opt_verbose", ":", "print", "\"Downloading\"", ",", "file_size", ",", "\"byte...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/gtk+/gtk/compose-parse.py#L206-L216
google-ar/WebARonTango
e86965d2cbc652156b480e0fcf77c716745578cd
chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py
python
StateSetFrontBackSeparateHandler.WriteHandlerImplementation
(self, func, f)
Overrriden from TypeHandler.
Overrriden from TypeHandler.
[ "Overrriden", "from", "TypeHandler", "." ]
def WriteHandlerImplementation(self, func, f): """Overrriden from TypeHandler.""" state_name = func.GetInfo('state') state = _STATES[state_name] states = state['states'] args = func.GetOriginalArgs() face = args[0].name num_args = len(args) f.write(" bool changed = false;\n") for gr...
[ "def", "WriteHandlerImplementation", "(", "self", ",", "func", ",", "f", ")", ":", "state_name", "=", "func", ".", "GetInfo", "(", "'state'", ")", "state", "=", "_STATES", "[", "state_name", "]", "states", "=", "state", "[", "'states'", "]", "args", "=",...
https://github.com/google-ar/WebARonTango/blob/e86965d2cbc652156b480e0fcf77c716745578cd/chromium/src/gpu/command_buffer/build_gles2_cmd_buffer.py#L5575-L5605
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/framework/ops.py
python
name_scope
(name, default_name=None, values=None)
Returns a context manager for use when defining a Python op. This context manager validates that the given `values` are from the same graph, makes that graph the default graph, and pushes a name scope in that graph (see @{tf.Graph.name_scope} for more details on that). For example, to define a new Python ...
Returns a context manager for use when defining a Python op.
[ "Returns", "a", "context", "manager", "for", "use", "when", "defining", "a", "Python", "op", "." ]
def name_scope(name, default_name=None, values=None): """Returns a context manager for use when defining a Python op. This context manager validates that the given `values` are from the same graph, makes that graph the default graph, and pushes a name scope in that graph (see @{tf.Graph.name_scope} for mor...
[ "def", "name_scope", "(", "name", ",", "default_name", "=", "None", ",", "values", "=", "None", ")", ":", "n", "=", "default_name", "if", "name", "is", "None", "else", "name", "if", "n", "is", "None", "and", "values", "is", "not", "None", ":", "# We ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/framework/ops.py#L4478-L4523
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
parserCtxt.parseStartTag
(self)
return ret
parse a start of tag either for rule element or EmptyElement. In both case we don't parse the tag closing chars. [40] STag ::= '<' Name (S Attribute)* S? '>' [ WFC: Unique Att Spec ] No attribute name may appear more than once in the same start-tag or empty-element tag. [44] ...
parse a start of tag either for rule element or EmptyElement. In both case we don't parse the tag closing chars. [40] STag ::= '<' Name (S Attribute)* S? '>' [ WFC: Unique Att Spec ] No attribute name may appear more than once in the same start-tag or empty-element tag. [44] ...
[ "parse", "a", "start", "of", "tag", "either", "for", "rule", "element", "or", "EmptyElement", ".", "In", "both", "case", "we", "don", "t", "parse", "the", "tag", "closing", "chars", ".", "[", "40", "]", "STag", "::", "=", "<", "Name", "(", "S", "At...
def parseStartTag(self): """parse a start of tag either for rule element or EmptyElement. In both case we don't parse the tag closing chars. [40] STag ::= '<' Name (S Attribute)* S? '>' [ WFC: Unique Att Spec ] No attribute name may appear more than once in the same sta...
[ "def", "parseStartTag", "(", "self", ")", ":", "ret", "=", "libxml2mod", ".", "xmlParseStartTag", "(", "self", ".", "_o", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L5388-L5400
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/ops/array_ops.py
python
concat
(concat_dim, values, name="concat")
return gen_array_ops._concat(concat_dim=concat_dim, values=values, name=name)
Concatenates tensors along one dimension. Concatenates the list of tensors `values` along dimension `concat_dim`. If `values[i].shape = [D0, D1, ... Dconcat_dim(i), ...Dn]`, the concatenated result has shape [D0, D1, ... Rconcat_dim, ...Dn] where Rconcat_dim = sum(Dconcat_dim(i)) That is, th...
Concatenates tensors along one dimension.
[ "Concatenates", "tensors", "along", "one", "dimension", "." ]
def concat(concat_dim, values, name="concat"): """Concatenates tensors along one dimension. Concatenates the list of tensors `values` along dimension `concat_dim`. If `values[i].shape = [D0, D1, ... Dconcat_dim(i), ...Dn]`, the concatenated result has shape [D0, D1, ... Rconcat_dim, ...Dn] where ...
[ "def", "concat", "(", "concat_dim", ",", "values", ",", "name", "=", "\"concat\"", ")", ":", "if", "not", "isinstance", "(", "values", ",", "(", "list", ",", "tuple", ")", ")", ":", "values", "=", "[", "values", "]", "# TODO(mrry): Change to return values?...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/ops/array_ops.py#L627-L697
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/reshape/reshape.py
python
stack
(frame, level=-1, dropna=True)
return frame._constructor_sliced(new_values, index=new_index)
Convert DataFrame to Series with multi-level Index. Columns become the second level of the resulting hierarchical index Returns ------- stacked : Series
Convert DataFrame to Series with multi-level Index. Columns become the second level of the resulting hierarchical index
[ "Convert", "DataFrame", "to", "Series", "with", "multi", "-", "level", "Index", ".", "Columns", "become", "the", "second", "level", "of", "the", "resulting", "hierarchical", "index" ]
def stack(frame, level=-1, dropna=True): """ Convert DataFrame to Series with multi-level Index. Columns become the second level of the resulting hierarchical index Returns ------- stacked : Series """ def factorize(index): if index.is_unique: return index, np.arang...
[ "def", "stack", "(", "frame", ",", "level", "=", "-", "1", ",", "dropna", "=", "True", ")", ":", "def", "factorize", "(", "index", ")", ":", "if", "index", ".", "is_unique", ":", "return", "index", ",", "np", ".", "arange", "(", "len", "(", "inde...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/reshape/reshape.py#L509-L580
utilForever/RosettaStone
80a409e35749116b8da87034ea7b4825421f37cc
Scripts/utils.py
python
is64
()
return guess_word_size() == '64'
Returns True if running on 64-bit machine
Returns True if running on 64-bit machine
[ "Returns", "True", "if", "running", "on", "64", "-", "bit", "machine" ]
def is64(): """ Returns True if running on 64-bit machine """ return guess_word_size() == '64'
[ "def", "is64", "(", ")", ":", "return", "guess_word_size", "(", ")", "==", "'64'" ]
https://github.com/utilForever/RosettaStone/blob/80a409e35749116b8da87034ea7b4825421f37cc/Scripts/utils.py#L156-L160
RapidsAtHKUST/CommunityDetectionCodes
23dbafd2e57ab0f5f0528b1322c4a409f21e5892
Algorithms/2015-LEMON/python_yche_refactor/io_helper.py
python
read_edge_list
(filename, delimiter=None, nodetype=int)
return graph_linklist, node_number, edge_number, degree
Generate the adjacent matrix of a graph with overlapping communities. Input: A two-clumn edgelist Return: An adjacency matrix in the form of ndarray corresponding to the given edge list.
Generate the adjacent matrix of a graph with overlapping communities. Input: A two-clumn edgelist Return: An adjacency matrix in the form of ndarray corresponding to the given edge list.
[ "Generate", "the", "adjacent", "matrix", "of", "a", "graph", "with", "overlapping", "communities", ".", "Input", ":", "A", "two", "-", "clumn", "edgelist", "Return", ":", "An", "adjacency", "matrix", "in", "the", "form", "of", "ndarray", "corresponding", "to...
def read_edge_list(filename, delimiter=None, nodetype=int): """Generate the adjacent matrix of a graph with overlapping communities. Input: A two-clumn edgelist Return: An adjacency matrix in the form of ndarray corresponding to the given edge list. """ edgeset = set() nodeset = set() ...
[ "def", "read_edge_list", "(", "filename", ",", "delimiter", "=", "None", ",", "nodetype", "=", "int", ")", ":", "edgeset", "=", "set", "(", ")", "nodeset", "=", "set", "(", ")", "print", "\"Reading the edgelist...\"", "with", "open", "(", "filename", ")", ...
https://github.com/RapidsAtHKUST/CommunityDetectionCodes/blob/23dbafd2e57ab0f5f0528b1322c4a409f21e5892/Algorithms/2015-LEMON/python_yche_refactor/io_helper.py#L14-L61
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/setuptools/msvc.py
python
msvc9_query_vcvarsall
(ver, arch='x86', *args, **kwargs)
Patched "distutils.msvc9compiler.query_vcvarsall" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) Microsoft Windows S...
Patched "distutils.msvc9compiler.query_vcvarsall" for support extra compilers.
[ "Patched", "distutils", ".", "msvc9compiler", ".", "query_vcvarsall", "for", "support", "extra", "compilers", "." ]
def msvc9_query_vcvarsall(ver, arch='x86', *args, **kwargs): """ Patched "distutils.msvc9compiler.query_vcvarsall" for support extra compilers. Set environment without use of "vcvarsall.bat". Known supported compilers ------------------------- Microsoft Visual C++ 9.0: Microsoft Vi...
[ "def", "msvc9_query_vcvarsall", "(", "ver", ",", "arch", "=", "'x86'", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Try to get environement from vcvarsall.bat (Classical way)", "try", ":", "orig", "=", "get_unpatched", "(", "msvc9_query_vcvarsall", ")", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/setuptools/msvc.py#L106-L150
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_common.py
python
wrap_numbers
(input_dict, name)
Given an `input_dict` and a function `name`, adjust the numbers which "wrap" (restart from zero) across different calls by adding "old value" to "new value" and return an updated dict.
Given an `input_dict` and a function `name`, adjust the numbers which "wrap" (restart from zero) across different calls by adding "old value" to "new value" and return an updated dict.
[ "Given", "an", "input_dict", "and", "a", "function", "name", "adjust", "the", "numbers", "which", "wrap", "(", "restart", "from", "zero", ")", "across", "different", "calls", "by", "adding", "old", "value", "to", "new", "value", "and", "return", "an", "upd...
def wrap_numbers(input_dict, name): """Given an `input_dict` and a function `name`, adjust the numbers which "wrap" (restart from zero) across different calls by adding "old value" to "new value" and return an updated dict. """ with _wn.lock: return _wn.run(input_dict, name)
[ "def", "wrap_numbers", "(", "input_dict", ",", "name", ")", ":", "with", "_wn", ".", "lock", ":", "return", "_wn", ".", "run", "(", "input_dict", ",", "name", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/_common.py#L698-L704
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pickletools.py
python
genops
(pickle)
return _genops(pickle)
Generate all the opcodes in a pickle. 'pickle' is a file-like object, or string, containing the pickle. Each opcode in the pickle is generated, from the current pickle position, stopping after a STOP opcode is delivered. A triple is generated for each opcode: opcode, arg, pos opcode is ...
Generate all the opcodes in a pickle.
[ "Generate", "all", "the", "opcodes", "in", "a", "pickle", "." ]
def genops(pickle): """Generate all the opcodes in a pickle. 'pickle' is a file-like object, or string, containing the pickle. Each opcode in the pickle is generated, from the current pickle position, stopping after a STOP opcode is delivered. A triple is generated for each opcode: opcod...
[ "def", "genops", "(", "pickle", ")", ":", "return", "_genops", "(", "pickle", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/pickletools.py#L2222-L2245
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pexpect/pexpect/screen.py
python
screen.lf
(self)
This moves the cursor down with scrolling.
This moves the cursor down with scrolling.
[ "This", "moves", "the", "cursor", "down", "with", "scrolling", "." ]
def lf (self): '''This moves the cursor down with scrolling. ''' old_r = self.cur_r self.cursor_down() if old_r == self.cur_r: self.scroll_up () self.erase_line()
[ "def", "lf", "(", "self", ")", ":", "old_r", "=", "self", ".", "cur_r", "self", ".", "cursor_down", "(", ")", "if", "old_r", "==", "self", ".", "cur_r", ":", "self", ".", "scroll_up", "(", ")", "self", ".", "erase_line", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pexpect/pexpect/screen.py#L176-L184
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mimetypes.py
python
MimeTypes.readfp
(self, fp, strict=True)
Read a single mime.types-format file. If strict is true, information will be added to list of standard types, else to the list of non-standard types.
Read a single mime.types-format file.
[ "Read", "a", "single", "mime", ".", "types", "-", "format", "file", "." ]
def readfp(self, fp, strict=True): """ Read a single mime.types-format file. If strict is true, information will be added to list of standard types, else to the list of non-standard types. """ while 1: line = fp.readline() if not line: ...
[ "def", "readfp", "(", "self", ",", "fp", ",", "strict", "=", "True", ")", ":", "while", "1", ":", "line", "=", "fp", ".", "readline", "(", ")", "if", "not", "line", ":", "break", "words", "=", "line", ".", "split", "(", ")", "for", "i", "in", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mimetypes.py#L208-L229
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/filterdlg.py
python
FilterPanel.SetIncludes
(self, items)
return self._right.SetItems(items)
Set the items in the includes list @param items: list of strings
Set the items in the includes list @param items: list of strings
[ "Set", "the", "items", "in", "the", "includes", "list", "@param", "items", ":", "list", "of", "strings" ]
def SetIncludes(self, items): """Set the items in the includes list @param items: list of strings """ return self._right.SetItems(items)
[ "def", "SetIncludes", "(", "self", ",", "items", ")", ":", "return", "self", ".", "_right", ".", "SetItems", "(", "items", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/filterdlg.py#L110-L115
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/metrics_impl.py
python
_expand_and_tile
(tensor, multiple, dim=0, name=None)
Slice `tensor` shape in 2, then tile along the sliced dimension. A new dimension is inserted in shape of `tensor` before `dim`, then values are tiled `multiple` times along the new dimension. Args: tensor: Input `Tensor` or `SparseTensor`. multiple: Integer, number of times to tile. dim: Integer, di...
Slice `tensor` shape in 2, then tile along the sliced dimension.
[ "Slice", "tensor", "shape", "in", "2", "then", "tile", "along", "the", "sliced", "dimension", "." ]
def _expand_and_tile(tensor, multiple, dim=0, name=None): """Slice `tensor` shape in 2, then tile along the sliced dimension. A new dimension is inserted in shape of `tensor` before `dim`, then values are tiled `multiple` times along the new dimension. Args: tensor: Input `Tensor` or `SparseTensor`. m...
[ "def", "_expand_and_tile", "(", "tensor", ",", "multiple", ",", "dim", "=", "0", ",", "name", "=", "None", ")", ":", "if", "multiple", "<", "1", ":", "raise", "ValueError", "(", "'Invalid multiple %s, must be > 0.'", "%", "multiple", ")", "with", "ops", "....
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/metrics_impl.py#L2233-L2284
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_misc.py
python
Clipboard.Clear
(*args, **kwargs)
return _misc_.Clipboard_Clear(*args, **kwargs)
Clear(self) Clears data from the clipboard object and also the system's clipboard if possible.
Clear(self)
[ "Clear", "(", "self", ")" ]
def Clear(*args, **kwargs): """ Clear(self) Clears data from the clipboard object and also the system's clipboard if possible. """ return _misc_.Clipboard_Clear(*args, **kwargs)
[ "def", "Clear", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Clipboard_Clear", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L5865-L5872
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/logging/__init__.py
python
Handler.emit
(self, record)
Do whatever it takes to actually log the specified logging record. This version is intended to be implemented by subclasses and so raises a NotImplementedError.
Do whatever it takes to actually log the specified logging record.
[ "Do", "whatever", "it", "takes", "to", "actually", "log", "the", "specified", "logging", "record", "." ]
def emit(self, record): """ Do whatever it takes to actually log the specified logging record. This version is intended to be implemented by subclasses and so raises a NotImplementedError. """ raise NotImplementedError, 'emit must be implemented '\ ...
[ "def", "emit", "(", "self", ",", "record", ")", ":", "raise", "NotImplementedError", ",", "'emit must be implemented '", "'by Handler subclasses'" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/logging/__init__.py#L650-L658
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
CommandEvent.__init__
(self, *args, **kwargs)
__init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent This event class contains information about command events, which originate from a variety of simple controls, as well as menus and toolbars.
__init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
[ "__init__", "(", "self", "EventType", "commandType", "=", "wxEVT_NULL", "int", "winid", "=", "0", ")", "-", ">", "CommandEvent" ]
def __init__(self, *args, **kwargs): """ __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent This event class contains information about command events, which originate from a variety of simple controls, as well as menus and toolbars. """ ...
[ "def", "__init__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "_core_", ".", "CommandEvent_swiginit", "(", "self", ",", "_core_", ".", "new_CommandEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L5203-L5211
leela-zero/leela-zero
e3ed6310d33d75078ba74c3adf887d18439fc2e3
scripts/cpplint.py
python
CheckInvalidIncrement
(filename, clean_lines, linenum, error)
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the current file. ...
Checks for invalid increment *count++.
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ ...
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
https://github.com/leela-zero/leela-zero/blob/e3ed6310d33d75078ba74c3adf887d18439fc2e3/scripts/cpplint.py#L1961-L1980
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/control/robotinterface.py
python
RobotInterfaceBase.reset
(self)
If the robot has a non-normal status code, attempt to reset it to normal operation. The caller should poll until status()=='ok'
If the robot has a non-normal status code, attempt to reset it to normal operation. The caller should poll until status()=='ok'
[ "If", "the", "robot", "has", "a", "non", "-", "normal", "status", "code", "attempt", "to", "reset", "it", "to", "normal", "operation", ".", "The", "caller", "should", "poll", "until", "status", "()", "==", "ok" ]
def reset(self) -> None: """If the robot has a non-normal status code, attempt to reset it to normal operation. The caller should poll until status()=='ok' """ raise NotImplementedError("Reset is not implemented")
[ "def", "reset", "(", "self", ")", "->", "None", ":", "raise", "NotImplementedError", "(", "\"Reset is not implemented\"", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterface.py#L369-L373
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/array_algos/replace.py
python
compare_or_regex_search
( a: ArrayLike, b: Scalar | Pattern, regex: bool, mask: np.ndarray )
return result
Compare two array-like inputs of the same shape or two scalar values Calls operator.eq or re.search, depending on regex argument. If regex is True, perform an element-wise regex matching. Parameters ---------- a : array-like b : scalar or regex pattern regex : bool mask : np.ndarray[bo...
Compare two array-like inputs of the same shape or two scalar values
[ "Compare", "two", "array", "-", "like", "inputs", "of", "the", "same", "shape", "or", "two", "scalar", "values" ]
def compare_or_regex_search( a: ArrayLike, b: Scalar | Pattern, regex: bool, mask: np.ndarray ) -> ArrayLike | bool: """ Compare two array-like inputs of the same shape or two scalar values Calls operator.eq or re.search, depending on regex argument. If regex is True, perform an element-wise regex ...
[ "def", "compare_or_regex_search", "(", "a", ":", "ArrayLike", ",", "b", ":", "Scalar", "|", "Pattern", ",", "regex", ":", "bool", ",", "mask", ":", "np", ".", "ndarray", ")", "->", "ArrayLike", "|", "bool", ":", "if", "isna", "(", "b", ")", ":", "r...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/array_algos/replace.py#L44-L115
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
src/python/grpcio/grpc/framework/interfaces/face/face.py
python
Call.terminal_metadata
(self)
Accesses the terminal metadata from the service-side of the RPC. This method blocks until the value is available or is known not to have been emitted from the service-side of the RPC. Returns: The terminal metadata object emitted by the service-side of the RPC, or None if there was no such v...
Accesses the terminal metadata from the service-side of the RPC.
[ "Accesses", "the", "terminal", "metadata", "from", "the", "service", "-", "side", "of", "the", "RPC", "." ]
def terminal_metadata(self): """Accesses the terminal metadata from the service-side of the RPC. This method blocks until the value is available or is known not to have been emitted from the service-side of the RPC. Returns: The terminal metadata object emitted by the service-side of the RPC...
[ "def", "terminal_metadata", "(", "self", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/src/python/grpcio/grpc/framework/interfaces/face/face.py#L210-L220
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/linear_model/base.py
python
_rescale_data
(X, y, sample_weight)
return X, y
Rescale data so as to support sample_weight
Rescale data so as to support sample_weight
[ "Rescale", "data", "so", "as", "to", "support", "sample_weight" ]
def _rescale_data(X, y, sample_weight): """Rescale data so as to support sample_weight""" n_samples = X.shape[0] sample_weight = sample_weight * np.ones(n_samples) sample_weight = np.sqrt(sample_weight) sw_matrix = sparse.dia_matrix((sample_weight, 0), shape=(n_samp...
[ "def", "_rescale_data", "(", "X", ",", "y", ",", "sample_weight", ")", ":", "n_samples", "=", "X", ".", "shape", "[", "0", "]", "sample_weight", "=", "sample_weight", "*", "np", ".", "ones", "(", "n_samples", ")", "sample_weight", "=", "np", ".", "sqrt...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/linear_model/base.py#L213-L222
neoml-lib/neoml
a0d370fba05269a1b2258cef126f77bbd2054a3e
NeoML/Python/neoml/Dnn/Crf.py
python
Crf.dropout_rate
(self, dropout_rate)
Sets the variational dropout rate.
Sets the variational dropout rate.
[ "Sets", "the", "variational", "dropout", "rate", "." ]
def dropout_rate(self, dropout_rate): """Sets the variational dropout rate. """ if float(dropout_rate) < 0 or float(dropout_rate) >= 1: raise ValueError('The `dropout_rate` must be in [0, 1).') self._internal.set_dropout_rate(float(dropout_rate))
[ "def", "dropout_rate", "(", "self", ",", "dropout_rate", ")", ":", "if", "float", "(", "dropout_rate", ")", "<", "0", "or", "float", "(", "dropout_rate", ")", ">=", "1", ":", "raise", "ValueError", "(", "'The `dropout_rate` must be in [0, 1).'", ")", "self", ...
https://github.com/neoml-lib/neoml/blob/a0d370fba05269a1b2258cef126f77bbd2054a3e/NeoML/Python/neoml/Dnn/Crf.py#L138-L144
scribusproject/scribus
41ec7c775a060912cf251682a8b1437f753f80f4
codegen/cheetah/Cheetah/Tools/MondoReport.py
python
RecordStats.__call__
(self)
This instance is not callable, so we override the super method.
This instance is not callable, so we override the super method.
[ "This", "instance", "is", "not", "callable", "so", "we", "override", "the", "super", "method", "." ]
def __call__(self): # Overrides IndexFormats.__call__ """This instance is not callable, so we override the super method. """ raise NotImplementedError()
[ "def", "__call__", "(", "self", ")", ":", "# Overrides IndexFormats.__call__", "raise", "NotImplementedError", "(", ")" ]
https://github.com/scribusproject/scribus/blob/41ec7c775a060912cf251682a8b1437f753f80f4/codegen/cheetah/Cheetah/Tools/MondoReport.py#L240-L243
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_windows.py
python
Dialog.ShowWindowModal
(*args, **kwargs)
return _windows_.Dialog_ShowWindowModal(*args, **kwargs)
ShowWindowModal(self)
ShowWindowModal(self)
[ "ShowWindowModal", "(", "self", ")" ]
def ShowWindowModal(*args, **kwargs): """ShowWindowModal(self)""" return _windows_.Dialog_ShowWindowModal(*args, **kwargs)
[ "def", "ShowWindowModal", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "Dialog_ShowWindowModal", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_windows.py#L811-L813
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/cephadm/box/util.py
python
Target.set_args
(self)
adding the required arguments of the target should go here, example: self.parser.add_argument(..)
adding the required arguments of the target should go here, example: self.parser.add_argument(..)
[ "adding", "the", "required", "arguments", "of", "the", "target", "should", "go", "here", "example", ":", "self", ".", "parser", ".", "add_argument", "(", "..", ")" ]
def set_args(self): """ adding the required arguments of the target should go here, example: self.parser.add_argument(..) """ raise NotImplementedError()
[ "def", "set_args", "(", "self", ")", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/cephadm/box/util.py#L36-L41
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
GraphicsGradientStops.__len__
(*args, **kwargs)
return _gdi_.GraphicsGradientStops___len__(*args, **kwargs)
__len__(self) -> unsigned int
__len__(self) -> unsigned int
[ "__len__", "(", "self", ")", "-", ">", "unsigned", "int" ]
def __len__(*args, **kwargs): """__len__(self) -> unsigned int""" return _gdi_.GraphicsGradientStops___len__(*args, **kwargs)
[ "def", "__len__", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsGradientStops___len__", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L5957-L5959
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/ops/io_tensor.py
python
IOTensor.from_csv
(cls, filename, **kwargs)
Creates an `IOTensor` from an csv file. Args: filename: A string, the filename of an csv file. name: A name prefix for the IOTensor (optional). Returns: A `IOTensor`.
Creates an `IOTensor` from an csv file.
[ "Creates", "an", "IOTensor", "from", "an", "csv", "file", "." ]
def from_csv(cls, filename, **kwargs): """Creates an `IOTensor` from an csv file. Args: filename: A string, the filename of an csv file. name: A name prefix for the IOTensor (optional). Returns: A `IOTensor`. """ with tf.name_scope(kwargs.get("nam...
[ "def", "from_csv", "(", "cls", ",", "filename", ",", "*", "*", "kwargs", ")", ":", "with", "tf", ".", "name_scope", "(", "kwargs", ".", "get", "(", "\"name\"", ",", "\"IOFromCSV\"", ")", ")", ":", "return", "csv_io_tensor_ops", ".", "CSVIOTensor", "(", ...
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/io_tensor.py#L381-L393
OpenNI/OpenNI
1e9524ffd759841789dadb4ca19fb5d4ac5820e7
Platform/Win32/Driver/Build/UpdateVersion.py
python
regx_replace
(findStr,repStr,filePath)
replaces all findStr by repStr in file filePath using regualr expression
replaces all findStr by repStr in file filePath using regualr expression
[ "replaces", "all", "findStr", "by", "repStr", "in", "file", "filePath", "using", "regualr", "expression" ]
def regx_replace(findStr,repStr,filePath): "replaces all findStr by repStr in file filePath using regualr expression" findStrRegx = re.compile(findStr) tempName=filePath+'~~~' os.system("attrib -r " + filePath) input = open(filePath) output = open(tempName,'w') for s in input: output.write(findStrRegx.sub(repS...
[ "def", "regx_replace", "(", "findStr", ",", "repStr", ",", "filePath", ")", ":", "findStrRegx", "=", "re", ".", "compile", "(", "findStr", ")", "tempName", "=", "filePath", "+", "'~~~'", "os", ".", "system", "(", "\"attrib -r \"", "+", "filePath", ")", "...
https://github.com/OpenNI/OpenNI/blob/1e9524ffd759841789dadb4ca19fb5d4ac5820e7/Platform/Win32/Driver/Build/UpdateVersion.py#L35-L47
papyrussolution/OpenPapyrus
bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91
Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py
python
Timestamp.FromDatetime
(self, dt)
Converts datetime to Timestamp.
Converts datetime to Timestamp.
[ "Converts", "datetime", "to", "Timestamp", "." ]
def FromDatetime(self, dt): """Converts datetime to Timestamp.""" # Using this guide: http://wiki.python.org/moin/WorkingWithTime # And this conversion guide: http://docs.python.org/library/time.html # Turn the date parameter into a tuple (struct_time) that can then be # manipulated into a long val...
[ "def", "FromDatetime", "(", "self", ",", "dt", ")", ":", "# Using this guide: http://wiki.python.org/moin/WorkingWithTime", "# And this conversion guide: http://docs.python.org/library/time.html", "# Turn the date parameter into a tuple (struct_time) that can then be", "# manipulated into a lo...
https://github.com/papyrussolution/OpenPapyrus/blob/bbfb5ec2ea2109b8e2f125edd838e12eaf7b8b91/Src/OSF/protobuf-3.19.1/python/google/protobuf/internal/well_known_types.py#L240-L250
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mimetypes.py
python
guess_extension
(type, strict=True)
return _db.guess_extension(type, strict)
Guess the extension for a file based on its MIME type. Return value is a string giving a filename extension, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no ext...
Guess the extension for a file based on its MIME type.
[ "Guess", "the", "extension", "for", "a", "file", "based", "on", "its", "MIME", "type", "." ]
def guess_extension(type, strict=True): """Guess the extension for a file based on its MIME type. Return value is a string giving a filename extension, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the ...
[ "def", "guess_extension", "(", "type", ",", "strict", "=", "True", ")", ":", "if", "_db", "is", "None", ":", "init", "(", ")", "return", "_db", ".", "guess_extension", "(", "type", ",", "strict", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mimetypes.py#L312-L326
linyouhappy/kongkongxiyou
7a69b2913eb29f4be77f9a62fb90cdd72c4160f1
cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py
python
Cursor.is_static_method
(self)
return conf.lib.clang_CXXMethod_isStatic(self)
Returns True if the cursor refers to a C++ member function or member function template that is declared 'static'.
Returns True if the cursor refers to a C++ member function or member function template that is declared 'static'.
[ "Returns", "True", "if", "the", "cursor", "refers", "to", "a", "C", "++", "member", "function", "or", "member", "function", "template", "that", "is", "declared", "static", "." ]
def is_static_method(self): """Returns True if the cursor refers to a C++ member function or member function template that is declared 'static'. """ return conf.lib.clang_CXXMethod_isStatic(self)
[ "def", "is_static_method", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_CXXMethod_isStatic", "(", "self", ")" ]
https://github.com/linyouhappy/kongkongxiyou/blob/7a69b2913eb29f4be77f9a62fb90cdd72c4160f1/cocosjs/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L1219-L1223
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
Treebook.ExpandNode
(*args, **kwargs)
return _controls_.Treebook_ExpandNode(*args, **kwargs)
ExpandNode(self, size_t pos, bool expand=True) -> bool
ExpandNode(self, size_t pos, bool expand=True) -> bool
[ "ExpandNode", "(", "self", "size_t", "pos", "bool", "expand", "=", "True", ")", "-", ">", "bool" ]
def ExpandNode(*args, **kwargs): """ExpandNode(self, size_t pos, bool expand=True) -> bool""" return _controls_.Treebook_ExpandNode(*args, **kwargs)
[ "def", "ExpandNode", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Treebook_ExpandNode", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L3327-L3329
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
scripts/image_tools/images/regular_image.py
python
RegularImage.create_black_image
(cls, width, height)
return ri
Create an black image.
Create an black image.
[ "Create", "an", "black", "image", "." ]
def create_black_image(cls, width, height): """Create an black image.""" ri = RegularImage() ri.im = Image.new('RGB', (width, height)) ri.width = width ri.height = height return ri
[ "def", "create_black_image", "(", "cls", ",", "width", ",", "height", ")", ":", "ri", "=", "RegularImage", "(", ")", "ri", ".", "im", "=", "Image", ".", "new", "(", "'RGB'", ",", "(", "width", ",", "height", ")", ")", "ri", ".", "width", "=", "wi...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/scripts/image_tools/images/regular_image.py#L28-L34
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/third_party/jinja2/filters.py
python
do_replace
(eval_ctx, s, old, new, count=None)
return s.replace(soft_unicode(old), soft_unicode(new), count)
Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument ``count`` is given, only the first ``count`` occurrences are replaced: .. sourcec...
Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument ``count`` is given, only the first ``count`` occurrences are replaced:
[ "Return", "a", "copy", "of", "the", "value", "with", "all", "occurrences", "of", "a", "substring", "replaced", "with", "a", "new", "one", ".", "The", "first", "argument", "is", "the", "substring", "that", "should", "be", "replaced", "the", "second", "is", ...
def do_replace(eval_ctx, s, old, new, count=None): """Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument ``count`` is given, only the fir...
[ "def", "do_replace", "(", "eval_ctx", ",", "s", ",", "old", ",", "new", ",", "count", "=", "None", ")", ":", "if", "count", "is", "None", ":", "count", "=", "-", "1", "if", "not", "eval_ctx", ".", "autoescape", ":", "return", "text_type", "(", "s",...
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/filters.py#L116-L140