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
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py
python
RSTState.nested_list_parse
(self, block, input_offset, node, initial_state, blank_finish, blank_finish_state=None, extra_settings={}, match_titles=False, state_machine_class=None, state_machi...
return state_machine.abs_line_offset(), blank_finish
Create a new StateMachine rooted at `node` and run it over the input `block`. Also keep track of optional intermediate blank lines and the required final one.
Create a new StateMachine rooted at `node` and run it over the input `block`. Also keep track of optional intermediate blank lines and the required final one.
[ "Create", "a", "new", "StateMachine", "rooted", "at", "node", "and", "run", "it", "over", "the", "input", "block", ".", "Also", "keep", "track", "of", "optional", "intermediate", "blank", "lines", "and", "the", "required", "final", "one", "." ]
def nested_list_parse(self, block, input_offset, node, initial_state, blank_finish, blank_finish_state=None, extra_settings={}, match_titles=False, state_machine_class=None, ...
[ "def", "nested_list_parse", "(", "self", ",", "block", ",", "input_offset", ",", "node", ",", "initial_state", ",", "blank_finish", ",", "blank_finish_state", "=", "None", ",", "extra_settings", "=", "{", "}", ",", "match_titles", "=", "False", ",", "state_mac...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/parsers/rst/states.py#L294-L322
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py
python
FetchSpreadsheetFeeds
(client, key, sheets, cols)
return worksheets_data
Fetch feeds from the spreadsheet. Args: client: A spreadsheet client to be used for fetching data. key: A key string of the spreadsheet to be fetched. sheets: A list of the sheet names to read data from. cols: A list of columns to read data from.
Fetch feeds from the spreadsheet.
[ "Fetch", "feeds", "from", "the", "spreadsheet", "." ]
def FetchSpreadsheetFeeds(client, key, sheets, cols): """Fetch feeds from the spreadsheet. Args: client: A spreadsheet client to be used for fetching data. key: A key string of the spreadsheet to be fetched. sheets: A list of the sheet names to read data from. cols: A list of columns to read data f...
[ "def", "FetchSpreadsheetFeeds", "(", "client", ",", "key", ",", "sheets", ",", "cols", ")", ":", "worksheets_feed", "=", "client", ".", "GetWorksheetsFeed", "(", "key", ")", "print", "'Fetching data from the worksheet: %s'", "%", "worksheets_feed", ".", "title", "...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py#L301-L334
BlazingDB/blazingsql
a35643d4c983334757eee96d5b9005b8b9fbd21b
pyblazing/pyblazing/apiv2/context.py
python
BlazingContext.s3
(self, prefix, **kwargs)
return self.fs.s3(self.dask_client, prefix, **kwargs)
Register an AWS S3 bucket. returns a boolean meaning True when Registered Successfully Parameters ---------- name : string that represents the name with which you will refer to your S3 bucket. bucket_name : string name of your S3 bucket. access_key_id : stri...
Register an AWS S3 bucket. returns a boolean meaning True when Registered Successfully
[ "Register", "an", "AWS", "S3", "bucket", ".", "returns", "a", "boolean", "meaning", "True", "when", "Registered", "Successfully" ]
def s3(self, prefix, **kwargs): """ Register an AWS S3 bucket. returns a boolean meaning True when Registered Successfully Parameters ---------- name : string that represents the name with which you will refer to your S3 bucket. bucket_name : string ...
[ "def", "s3", "(", "self", ",", "prefix", ",", "*", "*", "kwargs", ")", ":", "kwargs_validation", "(", "kwargs", ",", "\"s3\"", ")", "return", "self", ".", "fs", ".", "s3", "(", "self", ".", "dask_client", ",", "prefix", ",", "*", "*", "kwargs", ")"...
https://github.com/BlazingDB/blazingsql/blob/a35643d4c983334757eee96d5b9005b8b9fbd21b/pyblazing/pyblazing/apiv2/context.py#L1744-L1792
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/media.py
python
MediaCtrl.LoadURI
(*args, **kwargs)
return _media.MediaCtrl_LoadURI(*args, **kwargs)
LoadURI(self, String fileName) -> bool
LoadURI(self, String fileName) -> bool
[ "LoadURI", "(", "self", "String", "fileName", ")", "-", ">", "bool" ]
def LoadURI(*args, **kwargs): """LoadURI(self, String fileName) -> bool""" return _media.MediaCtrl_LoadURI(*args, **kwargs)
[ "def", "LoadURI", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_media", ".", "MediaCtrl_LoadURI", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/media.py#L161-L163
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/paginate.py
python
TokenEncoder._encode_bytes
(self, data, path)
return base64.b64encode(data).decode('utf-8'), [path]
Base64 encode a byte string.
Base64 encode a byte string.
[ "Base64", "encode", "a", "byte", "string", "." ]
def _encode_bytes(self, data, path): """Base64 encode a byte string.""" return base64.b64encode(data).decode('utf-8'), [path]
[ "def", "_encode_bytes", "(", "self", ",", "data", ",", "path", ")", ":", "return", "base64", ".", "b64encode", "(", "data", ")", ".", "decode", "(", "'utf-8'", ")", ",", "[", "path", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/paginate.py#L103-L105
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/gyp/util/md5_check.py
python
_Metadata.GetTag
(self, path, subpath=None)
return ret and ret['tag']
Returns the tag for the given path / subpath.
Returns the tag for the given path / subpath.
[ "Returns", "the", "tag", "for", "the", "given", "path", "/", "subpath", "." ]
def GetTag(self, path, subpath=None): """Returns the tag for the given path / subpath.""" ret = self._GetEntry(path, subpath) return ret and ret['tag']
[ "def", "GetTag", "(", "self", ",", "path", ",", "subpath", "=", "None", ")", ":", "ret", "=", "self", ".", "_GetEntry", "(", "path", ",", "subpath", ")", "return", "ret", "and", "ret", "[", "'tag'", "]" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/gyp/util/md5_check.py#L420-L423
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/Direct/RunDescriptor.py
python
build_run_file_name
(run_num,inst,file_path='',fext='')
return fname
Build the full name of a runfile from all possible components
Build the full name of a runfile from all possible components
[ "Build", "the", "full", "name", "of", "a", "runfile", "from", "all", "possible", "components" ]
def build_run_file_name(run_num,inst,file_path='',fext=''): """Build the full name of a runfile from all possible components""" if fext is None: fext = '' if isinstance(run_num, str): run_num_str = run_num else: #pylint: disable=protected-access fac = RunDescriptor._holder.facili...
[ "def", "build_run_file_name", "(", "run_num", ",", "inst", ",", "file_path", "=", "''", ",", "fext", "=", "''", ")", ":", "if", "fext", "is", "None", ":", "fext", "=", "''", "if", "isinstance", "(", "run_num", ",", "str", ")", ":", "run_num_str", "="...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/RunDescriptor.py#L1821-L1837
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/rnn.py
python
static_bidirectional_rnn
(cell_fw, cell_bw, inputs, initial_state_fw=None, initial_state_bw=None, dtype=None, sequence_length=None, scope=None...
return (outputs, output_state_fw, output_state_bw)
Creates a bidirectional recurrent neural network. Similar to the unidirectional case above (rnn) but takes input and builds independent forward and backward RNNs with the final forward and backward outputs depth-concatenated, such that the output will have the format [time][batch][cell_fw.output_size + cell_bw...
Creates a bidirectional recurrent neural network.
[ "Creates", "a", "bidirectional", "recurrent", "neural", "network", "." ]
def static_bidirectional_rnn(cell_fw, cell_bw, inputs, initial_state_fw=None, initial_state_bw=None, dtype=None, sequence_length=None, ...
[ "def", "static_bidirectional_rnn", "(", "cell_fw", ",", "cell_bw", ",", "inputs", ",", "initial_state_fw", "=", "None", ",", "initial_state_bw", "=", "None", ",", "dtype", "=", "None", ",", "sequence_length", "=", "None", ",", "scope", "=", "None", ")", ":",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/rnn.py#L1364-L1457
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/feature_extraction/image.py
python
_compute_n_patches
(i_h, i_w, p_h, p_w, max_patches=None)
Compute the number of patches that will be extracted in an image. Read more in the :ref:`User Guide <image_feature_extraction>`. Parameters ---------- i_h : int The image height i_w : int The image with p_h : int The height of a patch p_w : int The width of ...
Compute the number of patches that will be extracted in an image.
[ "Compute", "the", "number", "of", "patches", "that", "will", "be", "extracted", "in", "an", "image", "." ]
def _compute_n_patches(i_h, i_w, p_h, p_w, max_patches=None): """Compute the number of patches that will be extracted in an image. Read more in the :ref:`User Guide <image_feature_extraction>`. Parameters ---------- i_h : int The image height i_w : int The image with p_h : ...
[ "def", "_compute_n_patches", "(", "i_h", ",", "i_w", ",", "p_h", ",", "p_w", ",", "max_patches", "=", "None", ")", ":", "n_h", "=", "i_h", "-", "p_h", "+", "1", "n_w", "=", "i_w", "-", "p_w", "+", "1", "all_patches", "=", "n_h", "*", "n_w", "if",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/feature_extraction/image.py#L204-L241
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/diffraction/diffraction_adv_setup.py
python
AdvancedSetupWidget._cache_dir_browse_3
(self)
r"""Event handling for browsing the cache directory
r"""Event handling for browsing the cache directory
[ "r", "Event", "handling", "for", "browsing", "the", "cache", "directory" ]
def _cache_dir_browse_3(self): r"""Event handling for browsing the cache directory""" dir_path = self.dir_browse_dialog(title='Select the Cache Directory (scan only)') if dir_path: self._content.cache_dir_edit_3.setText(dir_path)
[ "def", "_cache_dir_browse_3", "(", "self", ")", ":", "dir_path", "=", "self", ".", "dir_browse_dialog", "(", "title", "=", "'Select the Cache Directory (scan only)'", ")", "if", "dir_path", ":", "self", ".", "_content", ".", "cache_dir_edit_3", ".", "setText", "("...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/reduction_gui/widgets/diffraction/diffraction_adv_setup.py#L310-L314
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py
python
Decimal.__pow__
(self, other, modulo=None, context=None)
return ans
Return self ** other [ % modulo]. With two arguments, compute self**other. With three arguments, compute (self**other) % modulo. For the three argument form, the following restrictions on the arguments hold: - all three arguments must be integral - other must be non...
Return self ** other [ % modulo].
[ "Return", "self", "**", "other", "[", "%", "modulo", "]", "." ]
def __pow__(self, other, modulo=None, context=None): """Return self ** other [ % modulo]. With two arguments, compute self**other. With three arguments, compute (self**other) % modulo. For the three argument form, the following restrictions on the arguments hold: - a...
[ "def", "__pow__", "(", "self", ",", "other", ",", "modulo", "=", "None", ",", "context", "=", "None", ")", ":", "if", "modulo", "is", "not", "None", ":", "return", "self", ".", "_power_modulo", "(", "other", ",", "modulo", ",", "context", ")", "other...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/decimal.py#L2174-L2388
BestSonny/SSTD
174d452189f6bf9cf4b6957719392008bd974069
python/caffe/io.py
python
Transformer.set_channel_swap
(self, in_, order)
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose. Parameters ---------- in_ : which input to assign this channel order order : the order to take t...
Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose.
[ "Set", "the", "input", "channel", "order", "for", "e", ".", "g", ".", "RGB", "to", "BGR", "conversion", "as", "needed", "for", "the", "reference", "ImageNet", "model", ".", "N", ".", "B", ".", "this", "assumes", "the", "channels", "are", "the", "first"...
def set_channel_swap(self, in_, order): """ Set the input channel order for e.g. RGB to BGR conversion as needed for the reference ImageNet model. N.B. this assumes the channels are the first dimension AFTER transpose. Parameters ---------- in_ : which input to a...
[ "def", "set_channel_swap", "(", "self", ",", "in_", ",", "order", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "if", "len", "(", "order", ")", "!=", "self", ".", "inputs", "[", "in_", "]", "[", "1", "]", ":", "raise", "Exception", "(", ...
https://github.com/BestSonny/SSTD/blob/174d452189f6bf9cf4b6957719392008bd974069/python/caffe/io.py#L203-L219
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/api.py
python
deregister
(*args)
Deregister data from the HSA system
Deregister data from the HSA system
[ "Deregister", "data", "from", "the", "HSA", "system" ]
def deregister(*args): """Deregister data from the HSA system """ for data in args: if isinstance(data, np.ndarray): _hsadrv.hsa_memory_deregister(data.ctypes.data, data.nbytes) else: raise TypeError(type(data))
[ "def", "deregister", "(", "*", "args", ")", ":", "for", "data", "in", "args", ":", "if", "isinstance", "(", "data", ",", "np", ".", "ndarray", ")", ":", "_hsadrv", ".", "hsa_memory_deregister", "(", "data", ".", "ctypes", ".", "data", ",", "data", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/roc/api.py#L71-L78
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/init_ops_v2.py
python
lecun_uniform
(seed=None)
return VarianceScaling( scale=1., mode="fan_in", distribution="uniform", seed=seed)
LeCun uniform initializer. It draws samples from a uniform distribution within [-limit, limit] where `limit` is `sqrt(3 / fan_in)` where `fan_in` is the number of input units in the weight tensor. Arguments: seed: A Python integer. Used to seed the random generator. Returns: An initializer. Refe...
LeCun uniform initializer.
[ "LeCun", "uniform", "initializer", "." ]
def lecun_uniform(seed=None): """LeCun uniform initializer. It draws samples from a uniform distribution within [-limit, limit] where `limit` is `sqrt(3 / fan_in)` where `fan_in` is the number of input units in the weight tensor. Arguments: seed: A Python integer. Used to seed the random generator. R...
[ "def", "lecun_uniform", "(", "seed", "=", "None", ")", ":", "return", "VarianceScaling", "(", "scale", "=", "1.", ",", "mode", "=", "\"fan_in\"", ",", "distribution", "=", "\"uniform\"", ",", "seed", "=", "seed", ")" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/init_ops_v2.py#L657-L678
xbmc/xbmc
091211a754589fc40a2a1f239b0ce9f4ee138268
addons/metadata.themoviedb.org.python/python/lib/tmdbscraper/tmdbapi.py
python
get_movie
(mid, language=None, append_to_response=None)
return api_utils.load_info(theurl, params=_set_params(append_to_response, language))
Get movie details :param mid: TMDb movie ID :param language: the language filter for TMDb (optional) :append_to_response: the additional data to get from TMDb (optional) :return: the movie or error
Get movie details
[ "Get", "movie", "details" ]
def get_movie(mid, language=None, append_to_response=None): # type: (Text) -> List[InfoType] """ Get movie details :param mid: TMDb movie ID :param language: the language filter for TMDb (optional) :append_to_response: the additional data to get from TMDb (optional) :return: the movie or er...
[ "def", "get_movie", "(", "mid", ",", "language", "=", "None", ",", "append_to_response", "=", "None", ")", ":", "# type: (Text) -> List[InfoType]", "xbmc", ".", "log", "(", "'using movie id of %s to get movie details'", "%", "mid", ",", "xbmc", ".", "LOGDEBUG", ")...
https://github.com/xbmc/xbmc/blob/091211a754589fc40a2a1f239b0ce9f4ee138268/addons/metadata.themoviedb.org.python/python/lib/tmdbscraper/tmdbapi.py#L81-L93
tensorflow/minigo
6d89c202cdceaf449aefc3149ab2110d44f1a6a4
minigo_model.py
python
read_model
(path)
return metadata, model_bytes
Reads a serialized model & metadata in Minigo format. Args: path: the model path. Returns: A (metadata, model_bytes) pair of the model's metadata as a dictionary and the serialized model as bytes.
Reads a serialized model & metadata in Minigo format.
[ "Reads", "a", "serialized", "model", "&", "metadata", "in", "Minigo", "format", "." ]
def read_model(path): """Reads a serialized model & metadata in Minigo format. Args: path: the model path. Returns: A (metadata, model_bytes) pair of the model's metadata as a dictionary and the serialized model as bytes. """ with tf.io.gfile.GFile(path, 'rb') as f: magi...
[ "def", "read_model", "(", "path", ")", ":", "with", "tf", ".", "io", ".", "gfile", ".", "GFile", "(", "path", ",", "'rb'", ")", "as", "f", ":", "magic", "=", "f", ".", "read", "(", "MAGIC_SIZE", ")", ".", "decode", "(", "'utf-8'", ")", "if", "m...
https://github.com/tensorflow/minigo/blob/6d89c202cdceaf449aefc3149ab2110d44f1a6a4/minigo_model.py#L94-L130
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/tkSimpleDialog.py
python
askfloat
(title, prompt, **kw)
return d.result
get a float from the user Arguments: title -- the dialog title prompt -- the label text **kw -- see SimpleDialog class Return value is a float
get a float from the user
[ "get", "a", "float", "from", "the", "user" ]
def askfloat(title, prompt, **kw): '''get a float from the user Arguments: title -- the dialog title prompt -- the label text **kw -- see SimpleDialog class Return value is a float ''' d = _QueryFloat(title, prompt, **kw) return d.result
[ "def", "askfloat", "(", "title", ",", "prompt", ",", "*", "*", "kw", ")", ":", "d", "=", "_QueryFloat", "(", "title", ",", "prompt", ",", "*", "*", "kw", ")", "return", "d", ".", "result" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/tkSimpleDialog.py#L270-L282
cyberbotics/webots
af7fa7d68dcf7b4550f1f2e132092b41e83698fc
resources/web/server/simulation_server.py
python
Client.on_exit
(self)
Callback issued when Webots quits.
Callback issued when Webots quits.
[ "Callback", "issued", "when", "Webots", "quits", "." ]
def on_exit(self): """Callback issued when Webots quits.""" if self.webots_process: logging.warning('[%d] Webots [%d] exited' % (id(self), self.webots_process.pid)) self.webots_process.wait() self.webots_process = None self.on_webots_quit()
[ "def", "on_exit", "(", "self", ")", ":", "if", "self", ".", "webots_process", ":", "logging", ".", "warning", "(", "'[%d] Webots [%d] exited'", "%", "(", "id", "(", "self", ")", ",", "self", ".", "webots_process", ".", "pid", ")", ")", "self", ".", "we...
https://github.com/cyberbotics/webots/blob/af7fa7d68dcf7b4550f1f2e132092b41e83698fc/resources/web/server/simulation_server.py#L327-L333
openbabel/openbabel
f3ed2a9a5166dbd3b9ce386e636a176074a6c34c
scripts/python/openbabel/pybel.py
python
Molecule.calcfp
(self, fptype="FP2")
return Fingerprint(fp)
Calculate a molecular fingerprint. Optional parameters: fptype -- the fingerprint type (default is "FP2"). See the fps variable for a list of of available fingerprint types.
Calculate a molecular fingerprint.
[ "Calculate", "a", "molecular", "fingerprint", "." ]
def calcfp(self, fptype="FP2"): """Calculate a molecular fingerprint. Optional parameters: fptype -- the fingerprint type (default is "FP2"). See the fps variable for a list of of available fingerprint types. """ if sys.platform[:3] =...
[ "def", "calcfp", "(", "self", ",", "fptype", "=", "\"FP2\"", ")", ":", "if", "sys", ".", "platform", "[", ":", "3", "]", "==", "\"cli\"", ":", "fp", "=", "ob", ".", "VectorUInt", "(", ")", "else", ":", "fp", "=", "ob", ".", "vectorUnsignedInt", "...
https://github.com/openbabel/openbabel/blob/f3ed2a9a5166dbd3b9ce386e636a176074a6c34c/scripts/python/openbabel/pybel.py#L472-L491
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py
python
ParserElement.parseFile
( self, file_or_filename, parseAll=False )
Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing.
Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing.
[ "Execute", "the", "parse", "expression", "on", "the", "given", "file", "or", "filename", ".", "If", "a", "filename", "is", "specified", "(", "instead", "of", "a", "file", "object", ")", "the", "entire", "file", "is", "opened", "read", "and", "closed", "b...
def parseFile( self, file_or_filename, parseAll=False ): """ Execute the parse expression on the given file or filename. If a filename is specified (instead of a file object), the entire file is opened, read, and closed before parsing. """ try: file_contents =...
[ "def", "parseFile", "(", "self", ",", "file_or_filename", ",", "parseAll", "=", "False", ")", ":", "try", ":", "file_contents", "=", "file_or_filename", ".", "read", "(", ")", "except", "AttributeError", ":", "with", "open", "(", "file_or_filename", ",", "\"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/setuptools/_vendor/pyparsing.py#L2173-L2191
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/fluid/contrib/sparsity/utils.py
python
CheckMethod.get_checking_method
(mask_algo)
r""" Get sparsity checking method by mask generating algorithm. Args: mask_algo (MaskAlgo): The algorithm of mask generating. Returns: CheckMethod: The corresponded sparsity checking method. Examples: .. code-block:: python import numpy a...
r""" Get sparsity checking method by mask generating algorithm.
[ "r", "Get", "sparsity", "checking", "method", "by", "mask", "generating", "algorithm", "." ]
def get_checking_method(mask_algo): r""" Get sparsity checking method by mask generating algorithm. Args: mask_algo (MaskAlgo): The algorithm of mask generating. Returns: CheckMethod: The corresponded sparsity checking method. Examples: .. cod...
[ "def", "get_checking_method", "(", "mask_algo", ")", ":", "assert", "isinstance", "(", "mask_algo", ",", "MaskAlgo", ")", ",", "\"mask_algo should be MaskAlgo type\"", "if", "mask_algo", "==", "MaskAlgo", ".", "MASK_1D", ":", "return", "CheckMethod", ".", "CHECK_1D"...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/sparsity/utils.py#L55-L84
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
build/pymake/pymake/data.py
python
Target.searchinlocs
(self, makefile, locs)
return None
Look in the given locations relative to the makefile working directory for a file. Return a pair of the target and the mtime if found, None if not.
Look in the given locations relative to the makefile working directory for a file. Return a pair of the target and the mtime if found, None if not.
[ "Look", "in", "the", "given", "locations", "relative", "to", "the", "makefile", "working", "directory", "for", "a", "file", ".", "Return", "a", "pair", "of", "the", "target", "and", "the", "mtime", "if", "found", "None", "if", "not", "." ]
def searchinlocs(self, makefile, locs): """ Look in the given locations relative to the makefile working directory for a file. Return a pair of the target and the mtime if found, None if not. """ for t in locs: fspath = util.normaljoin(makefile.workdir, t).rep...
[ "def", "searchinlocs", "(", "self", ",", "makefile", ",", "locs", ")", ":", "for", "t", "in", "locs", ":", "fspath", "=", "util", ".", "normaljoin", "(", "makefile", ".", "workdir", ",", "t", ")", ".", "replace", "(", "'\\\\'", ",", "'/'", ")", "mt...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/build/pymake/pymake/data.py#L1207-L1220
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/packaging/py3/packaging/version.py
python
_parse_local_version
(local: str)
return None
Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
[ "Takes", "a", "string", "like", "abc", ".", "1", ".", "twelve", "and", "turns", "it", "into", "(", "abc", "1", "twelve", ")", "." ]
def _parse_local_version(local: str) -> Optional[LocalType]: """ Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve"). """ if local is not None: return tuple( part.lower() if not part.isdigit() else int(part) for part in _local_version_separators.split(...
[ "def", "_parse_local_version", "(", "local", ":", "str", ")", "->", "Optional", "[", "LocalType", "]", ":", "if", "local", "is", "not", "None", ":", "return", "tuple", "(", "part", ".", "lower", "(", ")", "if", "not", "part", ".", "isdigit", "(", ")"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/packaging/py3/packaging/version.py#L432-L441
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/packager.py
python
crossproduct
(*seqs)
Provide a generator for iterating all the tuples consisting of elements of seqs.
Provide a generator for iterating all the tuples consisting of elements of seqs.
[ "Provide", "a", "generator", "for", "iterating", "all", "the", "tuples", "consisting", "of", "elements", "of", "seqs", "." ]
def crossproduct(*seqs): """Provide a generator for iterating all the tuples consisting of elements of seqs.""" num_seqs = len(seqs) if num_seqs == 0: pass elif num_seqs == 1: for idx in seqs[0]: yield [idx] else: for lst in crossproduct(*seqs[:-1]): f...
[ "def", "crossproduct", "(", "*", "seqs", ")", ":", "num_seqs", "=", "len", "(", "seqs", ")", "if", "num_seqs", "==", "0", ":", "pass", "elif", "num_seqs", "==", "1", ":", "for", "idx", "in", "seqs", "[", "0", "]", ":", "yield", "[", "idx", "]", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/packager.py#L443-L456
TimoSaemann/caffe-segnet-cudnn5
abcf30dca449245e101bf4ced519f716177f0885
scripts/cpp_lint.py
python
CheckCaffeDataLayerSetUp
(filename, clean_lines, linenum, error)
Except the base classes, Caffe DataLayer should define DataLayerSetUp instead of LayerSetUp. The base DataLayers define common SetUp steps, the subclasses should not override them. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. li...
Except the base classes, Caffe DataLayer should define DataLayerSetUp instead of LayerSetUp. The base DataLayers define common SetUp steps, the subclasses should not override them. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. li...
[ "Except", "the", "base", "classes", "Caffe", "DataLayer", "should", "define", "DataLayerSetUp", "instead", "of", "LayerSetUp", ".", "The", "base", "DataLayers", "define", "common", "SetUp", "steps", "the", "subclasses", "should", "not", "override", "them", ".", ...
def CheckCaffeDataLayerSetUp(filename, clean_lines, linenum, error): """Except the base classes, Caffe DataLayer should define DataLayerSetUp instead of LayerSetUp. The base DataLayers define common SetUp steps, the subclasses should not override them. Args: filename: The name of the current f...
[ "def", "CheckCaffeDataLayerSetUp", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "ix", "=", "line", ".", "find", "(", "'DataLayer<Dtype>::LayerSetUp'", ")", "if", ...
https://github.com/TimoSaemann/caffe-segnet-cudnn5/blob/abcf30dca449245e101bf4ced519f716177f0885/scripts/cpp_lint.py#L1595-L1631
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cgutils.py
python
snprintf_stackbuffer
(builder, bufsz, format, *args)
return buffer
Similar to `snprintf()` but the buffer is stack allocated to size *bufsz*. Returns the buffer pointer as i8*.
Similar to `snprintf()` but the buffer is stack allocated to size *bufsz*.
[ "Similar", "to", "snprintf", "()", "but", "the", "buffer", "is", "stack", "allocated", "to", "size", "*", "bufsz", "*", "." ]
def snprintf_stackbuffer(builder, bufsz, format, *args): """Similar to `snprintf()` but the buffer is stack allocated to size *bufsz*. Returns the buffer pointer as i8*. """ assert isinstance(bufsz, int) spacety = ir.ArrayType(ir.IntType(8), bufsz) space = alloca_once(builder, spacety, zfill=Tr...
[ "def", "snprintf_stackbuffer", "(", "builder", ",", "bufsz", ",", "format", ",", "*", "args", ")", ":", "assert", "isinstance", "(", "bufsz", ",", "int", ")", "spacety", "=", "ir", ".", "ArrayType", "(", "ir", ".", "IntType", "(", "8", ")", ",", "buf...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/cgutils.py#L1088-L1098
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/variables.py
python
VariableMetaclass._variable_v1_call
(cls, initial_value=None, trainable=None, collections=None, validate_shape=True, caching_device=None, name=None, variable_def=None, ...
return previous_getter( initial_value=initial_value, trainable=trainable, collections=collections, validate_shape=validate_shape, caching_device=caching_device, name=name, variable_def=variable_def, dtype=dtype, expected_shape=expected_shape, ...
Call on Variable class. Useful to force the signature.
Call on Variable class. Useful to force the signature.
[ "Call", "on", "Variable", "class", ".", "Useful", "to", "force", "the", "signature", "." ]
def _variable_v1_call(cls, initial_value=None, trainable=None, collections=None, validate_shape=True, caching_device=None, name=None, variable_def=None,...
[ "def", "_variable_v1_call", "(", "cls", ",", "initial_value", "=", "None", ",", "trainable", "=", "None", ",", "collections", "=", "None", ",", "validate_shape", "=", "True", ",", "caching_device", "=", "None", ",", "name", "=", "None", ",", "variable_def", ...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/variables.py#L185-L224
HackWebRTC/webrtc
7abfc990c00ab35090fff285fcf635d1d7892433
tools_webrtc/network_emulator/network_emulator.py
python
_RunIpfwCommand
(command, fail_msg=None)
return output.strip()
Executes a command and prefixes the appropriate command for Windows or Linux/UNIX. Args: command: Command list to execute. fail_msg: Message describing the error in case the command fails. Raises: NetworkEmulatorError: If command fails a message is set by the fail_msg parameter.
Executes a command and prefixes the appropriate command for Windows or Linux/UNIX.
[ "Executes", "a", "command", "and", "prefixes", "the", "appropriate", "command", "for", "Windows", "or", "Linux", "/", "UNIX", "." ]
def _RunIpfwCommand(command, fail_msg=None): """Executes a command and prefixes the appropriate command for Windows or Linux/UNIX. Args: command: Command list to execute. fail_msg: Message describing the error in case the command fails. Raises: NetworkEmulatorError: If command fails a message i...
[ "def", "_RunIpfwCommand", "(", "command", ",", "fail_msg", "=", "None", ")", ":", "if", "sys", ".", "platform", "==", "'win32'", ":", "ipfw_command", "=", "[", "'ipfw.exe'", "]", "else", ":", "ipfw_command", "=", "[", "'sudo'", ",", "'-n'", ",", "'ipfw'"...
https://github.com/HackWebRTC/webrtc/blob/7abfc990c00ab35090fff285fcf635d1d7892433/tools_webrtc/network_emulator/network_emulator.py#L163-L189
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/mesa/MesaLib/src/gallium/auxiliary/util/u_format_pack.py
python
generate_format_type
(format)
Generate a structure that describes the format.
Generate a structure that describes the format.
[ "Generate", "a", "structure", "that", "describes", "the", "format", "." ]
def generate_format_type(format): '''Generate a structure that describes the format.''' assert format.layout == PLAIN print 'union util_format_%s {' % format.short_name() if format.block_size() in (8, 16, 32, 64): print ' uint%u_t value;' % (format.block_size(),) use_bitfields ...
[ "def", "generate_format_type", "(", "format", ")", ":", "assert", "format", ".", "layout", "==", "PLAIN", "print", "'union util_format_%s {'", "%", "format", ".", "short_name", "(", ")", "if", "format", ".", "block_size", "(", ")", "in", "(", "8", ",", "16...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/mesa/MesaLib/src/gallium/auxiliary/util/u_format_pack.py#L43-L99
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/lin_ops/lin_utils.py
python
replace_new_vars
(expr, id_to_new_var)
Replaces the given variables in the expression. Parameters ---------- expr : LinOp The expression to replace variables in. id_to_new_var : dict A map of id to new variable. Returns ------- LinOp An LinOp identical to expr, but with the given variables replaced.
Replaces the given variables in the expression.
[ "Replaces", "the", "given", "variables", "in", "the", "expression", "." ]
def replace_new_vars(expr, id_to_new_var): """Replaces the given variables in the expression. Parameters ---------- expr : LinOp The expression to replace variables in. id_to_new_var : dict A map of id to new variable. Returns ------- LinOp An LinOp identical to...
[ "def", "replace_new_vars", "(", "expr", ",", "id_to_new_var", ")", ":", "if", "expr", ".", "type", "==", "lo", ".", "VARIABLE", "and", "expr", ".", "data", "in", "id_to_new_var", ":", "return", "id_to_new_var", "[", "expr", ".", "data", "]", "else", ":",...
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/lin_ops/lin_utils.py#L698-L721
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextCtrl.KeyboardNavigate
(*args, **kwargs)
return _richtext.RichTextCtrl_KeyboardNavigate(*args, **kwargs)
KeyboardNavigate(self, int keyCode, int flags) -> bool
KeyboardNavigate(self, int keyCode, int flags) -> bool
[ "KeyboardNavigate", "(", "self", "int", "keyCode", "int", "flags", ")", "-", ">", "bool" ]
def KeyboardNavigate(*args, **kwargs): """KeyboardNavigate(self, int keyCode, int flags) -> bool""" return _richtext.RichTextCtrl_KeyboardNavigate(*args, **kwargs)
[ "def", "KeyboardNavigate", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_KeyboardNavigate", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L4052-L4054
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
python/mozbuild/mozpack/chrome/manifest.py
python
ManifestEntry.__init__
(self, base, *flags)
Initialize a manifest entry with the given base path and flags.
Initialize a manifest entry with the given base path and flags.
[ "Initialize", "a", "manifest", "entry", "with", "the", "given", "base", "path", "and", "flags", "." ]
def __init__(self, base, *flags): ''' Initialize a manifest entry with the given base path and flags. ''' self.base = base self.flags = Flags(*flags) if not all(f in self.allowed_flags for f in self.flags): errors.fatal('%s unsupported for %s manifest entries'...
[ "def", "__init__", "(", "self", ",", "base", ",", "*", "flags", ")", ":", "self", ".", "base", "=", "base", "self", ".", "flags", "=", "Flags", "(", "*", "flags", ")", "if", "not", "all", "(", "f", "in", "self", ".", "allowed_flags", "for", "f", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/python/mozbuild/mozpack/chrome/manifest.py#L40-L49
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/traci/_vehicle.py
python
VehicleDomain.setMaxSpeed
(self, vehID, speed)
setMaxSpeed(string, double) -> None Sets the maximum speed in m/s for this vehicle.
setMaxSpeed(string, double) -> None
[ "setMaxSpeed", "(", "string", "double", ")", "-", ">", "None" ]
def setMaxSpeed(self, vehID, speed): """setMaxSpeed(string, double) -> None Sets the maximum speed in m/s for this vehicle. """ self._setCmd(tc.VAR_MAXSPEED, vehID, "d", speed)
[ "def", "setMaxSpeed", "(", "self", ",", "vehID", ",", "speed", ")", ":", "self", ".", "_setCmd", "(", "tc", ".", "VAR_MAXSPEED", ",", "vehID", ",", "\"d\"", ",", "speed", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_vehicle.py#L1030-L1035
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/cmd.py
python
Cmd.__init__
(self, completekey='tab', stdin=None, stdout=None)
Instantiate a line-oriented interpreter framework. The optional argument 'completekey' is the readline name of a completion key; it defaults to the Tab key. If completekey is not None and the readline module is available, command completion is done automatically. The optional arguments ...
Instantiate a line-oriented interpreter framework.
[ "Instantiate", "a", "line", "-", "oriented", "interpreter", "framework", "." ]
def __init__(self, completekey='tab', stdin=None, stdout=None): """Instantiate a line-oriented interpreter framework. The optional argument 'completekey' is the readline name of a completion key; it defaults to the Tab key. If completekey is not None and the readline module is available...
[ "def", "__init__", "(", "self", ",", "completekey", "=", "'tab'", ",", "stdin", "=", "None", ",", "stdout", "=", "None", ")", ":", "import", "sys", "if", "stdin", "is", "not", "None", ":", "self", ".", "stdin", "=", "stdin", "else", ":", "self", "....
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/cmd.py#L79-L100
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
RichTextPrinting.SetFooterText
(*args, **kwargs)
return _richtext.RichTextPrinting_SetFooterText(*args, **kwargs)
SetFooterText(self, String text, int page=RICHTEXT_PAGE_ALL, int location=RICHTEXT_PAGE_CENTRE)
SetFooterText(self, String text, int page=RICHTEXT_PAGE_ALL, int location=RICHTEXT_PAGE_CENTRE)
[ "SetFooterText", "(", "self", "String", "text", "int", "page", "=", "RICHTEXT_PAGE_ALL", "int", "location", "=", "RICHTEXT_PAGE_CENTRE", ")" ]
def SetFooterText(*args, **kwargs): """SetFooterText(self, String text, int page=RICHTEXT_PAGE_ALL, int location=RICHTEXT_PAGE_CENTRE)""" return _richtext.RichTextPrinting_SetFooterText(*args, **kwargs)
[ "def", "SetFooterText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextPrinting_SetFooterText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L4520-L4522
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TCnCom.SaveTxt
(*args)
return _snap.TCnCom_SaveTxt(*args)
SaveTxt(TCnComV const & CnComV, TStr FNm, TStr Desc=TStr()) Parameters: CnComV: TCnComV const & FNm: TStr const & Desc: TStr const & SaveTxt(TCnComV const & CnComV, TStr FNm) Parameters: CnComV: TCnComV const & FNm: TStr const &
SaveTxt(TCnComV const & CnComV, TStr FNm, TStr Desc=TStr())
[ "SaveTxt", "(", "TCnComV", "const", "&", "CnComV", "TStr", "FNm", "TStr", "Desc", "=", "TStr", "()", ")" ]
def SaveTxt(*args): """ SaveTxt(TCnComV const & CnComV, TStr FNm, TStr Desc=TStr()) Parameters: CnComV: TCnComV const & FNm: TStr const & Desc: TStr const & SaveTxt(TCnComV const & CnComV, TStr FNm) Parameters: CnComV: TCnComV co...
[ "def", "SaveTxt", "(", "*", "args", ")", ":", "return", "_snap", ".", "TCnCom_SaveTxt", "(", "*", "args", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L909-L925
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/closure_linter/closure_linter/tokenutil.py
python
InsertTokensAfter
(new_tokens, token)
Insert multiple tokens after token. Args: new_tokens: An array of tokens to be added to the stream token: A token already in the stream
Insert multiple tokens after token.
[ "Insert", "multiple", "tokens", "after", "token", "." ]
def InsertTokensAfter(new_tokens, token): """Insert multiple tokens after token. Args: new_tokens: An array of tokens to be added to the stream token: A token already in the stream """ # TODO(user): It would be nicer to have InsertTokenAfter defer to here # instead of vice-versa. current_token = to...
[ "def", "InsertTokensAfter", "(", "new_tokens", ",", "token", ")", ":", "# TODO(user): It would be nicer to have InsertTokenAfter defer to here", "# instead of vice-versa.", "current_token", "=", "token", "for", "new_token", "in", "new_tokens", ":", "InsertTokenAfter", "(", "n...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/closure_linter/closure_linter/tokenutil.py#L278-L290
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Rect2D.GetRightBottom
(*args, **kwargs)
return _core_.Rect2D_GetRightBottom(*args, **kwargs)
GetRightBottom(self) -> Point2D
GetRightBottom(self) -> Point2D
[ "GetRightBottom", "(", "self", ")", "-", ">", "Point2D" ]
def GetRightBottom(*args, **kwargs): """GetRightBottom(self) -> Point2D""" return _core_.Rect2D_GetRightBottom(*args, **kwargs)
[ "def", "GetRightBottom", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Rect2D_GetRightBottom", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L1939-L1941
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
python
Tool.__init__
(self, name, attrs=None)
Initializes the tool. Args: name: Tool name. attrs: Dict of tool attributes; may be None.
Initializes the tool.
[ "Initializes", "the", "tool", "." ]
def __init__(self, name, attrs=None): """Initializes the tool. Args: name: Tool name. attrs: Dict of tool attributes; may be None. """ self._attrs = attrs or {} self._attrs["Name"] = name
[ "def", "__init__", "(", "self", ",", "name", ",", "attrs", "=", "None", ")", ":", "self", ".", "_attrs", "=", "attrs", "or", "{", "}", "self", ".", "_attrs", "[", "\"Name\"", "]", "=", "name" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py#L15-L23
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/subscribe.py
python
_scoped_subscribe
(tensor, side_effects, control_cache)
Helper method that subscribes a single tensor to a list of side_effects. This is a thin wrapper around `_subscribe` and ensures that the side effect ops are added within the same device and control flow context of the subscribed tensor. Args: tensor: The `tf.Tensor` to be subscribed. side_effects: Lis...
Helper method that subscribes a single tensor to a list of side_effects.
[ "Helper", "method", "that", "subscribes", "a", "single", "tensor", "to", "a", "list", "of", "side_effects", "." ]
def _scoped_subscribe(tensor, side_effects, control_cache): """Helper method that subscribes a single tensor to a list of side_effects. This is a thin wrapper around `_subscribe` and ensures that the side effect ops are added within the same device and control flow context of the subscribed tensor. Args: ...
[ "def", "_scoped_subscribe", "(", "tensor", ",", "side_effects", ",", "control_cache", ")", ":", "with", "ops", ".", "device", "(", "tensor", ".", "device", ")", ":", "with", "_preserve_control_flow_context", "(", "tensor", ")", ":", "return", "_subscribe", "("...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/subscribe.py#L290-L309
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/ao/quantization/fx/lower_to_qnnpack.py
python
lower_to_qnnpack
(model: QuantizedGraphModule)
return _lower_to_native_backend(model)
Lower a quantized reference model (with reference quantized operator patterns) to qnnpack
Lower a quantized reference model (with reference quantized operator patterns) to qnnpack
[ "Lower", "a", "quantized", "reference", "model", "(", "with", "reference", "quantized", "operator", "patterns", ")", "to", "qnnpack" ]
def lower_to_qnnpack(model: QuantizedGraphModule) -> QuantizedGraphModule: """ Lower a quantized reference model (with reference quantized operator patterns) to qnnpack """ return _lower_to_native_backend(model)
[ "def", "lower_to_qnnpack", "(", "model", ":", "QuantizedGraphModule", ")", "->", "QuantizedGraphModule", ":", "return", "_lower_to_native_backend", "(", "model", ")" ]
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/ao/quantization/fx/lower_to_qnnpack.py#L4-L8
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
ListCtrl.GetItemFont
(*args, **kwargs)
return _controls_.ListCtrl_GetItemFont(*args, **kwargs)
GetItemFont(self, long item) -> Font
GetItemFont(self, long item) -> Font
[ "GetItemFont", "(", "self", "long", "item", ")", "-", ">", "Font" ]
def GetItemFont(*args, **kwargs): """GetItemFont(self, long item) -> Font""" return _controls_.ListCtrl_GetItemFont(*args, **kwargs)
[ "def", "GetItemFont", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListCtrl_GetItemFont", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L4756-L4758
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/build/waf-1.7.13/waflib/Tools/c_config.py
python
check_cc
(self, *k, **kw)
return self.check(*k, **kw)
Same as :py:func:`waflib.Tools.c_config.check` but default to the *c* programming language
Same as :py:func:`waflib.Tools.c_config.check` but default to the *c* programming language
[ "Same", "as", ":", "py", ":", "func", ":", "waflib", ".", "Tools", ".", "c_config", ".", "check", "but", "default", "to", "the", "*", "c", "*", "programming", "language" ]
def check_cc(self, *k, **kw): """ Same as :py:func:`waflib.Tools.c_config.check` but default to the *c* programming language """ kw['compiler'] = 'c' return self.check(*k, **kw)
[ "def", "check_cc", "(", "self", ",", "*", "k", ",", "*", "*", "kw", ")", ":", "kw", "[", "'compiler'", "]", "=", "'c'", "return", "self", ".", "check", "(", "*", "k", ",", "*", "*", "kw", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/build/waf-1.7.13/waflib/Tools/c_config.py#L793-L798
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Misc.selection_own
(self, **kw)
Become owner of X selection. A keyword parameter selection specifies the name of the selection (default PRIMARY).
Become owner of X selection.
[ "Become", "owner", "of", "X", "selection", "." ]
def selection_own(self, **kw): """Become owner of X selection. A keyword parameter selection specifies the name of the selection (default PRIMARY).""" self.tk.call(('selection', 'own') + self._options(kw) + (self._w,))
[ "def", "selection_own", "(", "self", ",", "*", "*", "kw", ")", ":", "self", ".", "tk", ".", "call", "(", "(", "'selection'", ",", "'own'", ")", "+", "self", ".", "_options", "(", "kw", ")", "+", "(", "self", ".", "_w", ",", ")", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L693-L699
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py
python
FlagValues.FindModuleIdDefiningFlag
(self, flagname, default=None)
return default
Return the ID of the module defining this flag, or default. Args: flagname: Name of the flag to lookup. default: Value to return if flagname is not defined. Defaults to None. Returns: The ID of the module which registered the flag with this name. If no such module exists (i.e...
Return the ID of the module defining this flag, or default.
[ "Return", "the", "ID", "of", "the", "module", "defining", "this", "flag", "or", "default", "." ]
def FindModuleIdDefiningFlag(self, flagname, default=None): """Return the ID of the module defining this flag, or default. Args: flagname: Name of the flag to lookup. default: Value to return if flagname is not defined. Defaults to None. Returns: The ID of the module which regi...
[ "def", "FindModuleIdDefiningFlag", "(", "self", ",", "flagname", ",", "default", "=", "None", ")", ":", "for", "module_id", ",", "flags", "in", "self", ".", "FlagsByModuleIdDict", "(", ")", ".", "iteritems", "(", ")", ":", "for", "flag", "in", "flags", "...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/external/bazel_tools/third_party/py/gflags/__init__.py#L973-L990
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/fixer_util.py
python
find_binding
(name, node, package=None)
return None
Returns the node which binds variable name, otherwise None. If optional argument package is supplied, only imports will be returned. See test cases for examples.
Returns the node which binds variable name, otherwise None. If optional argument package is supplied, only imports will be returned. See test cases for examples.
[ "Returns", "the", "node", "which", "binds", "variable", "name", "otherwise", "None", ".", "If", "optional", "argument", "package", "is", "supplied", "only", "imports", "will", "be", "returned", ".", "See", "test", "cases", "for", "examples", "." ]
def find_binding(name, node, package=None): """ Returns the node which binds variable name, otherwise None. If optional argument package is supplied, only imports will be returned. See test cases for examples.""" for child in node.children: ret = None if child.type == sym...
[ "def", "find_binding", "(", "name", ",", "node", ",", "package", "=", "None", ")", ":", "for", "child", "in", "node", ".", "children", ":", "ret", "=", "None", "if", "child", ".", "type", "==", "syms", ".", "for_stmt", ":", "if", "_find", "(", "nam...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib2to3/fixer_util.py#L340-L380
0vercl0k/blazefox
0ffeddfc1de3acb2254c505388e4cf9ab9d1f0a7
src/js/util/make_unicode.py
python
read_unicode_data
(unicode_data)
If you want to understand how this wonderful file format works checkout Unicode Standard Annex #44 - Unicode Character Database http://www.unicode.org/reports/tr44/
If you want to understand how this wonderful file format works checkout Unicode Standard Annex #44 - Unicode Character Database http://www.unicode.org/reports/tr44/
[ "If", "you", "want", "to", "understand", "how", "this", "wonderful", "file", "format", "works", "checkout", "Unicode", "Standard", "Annex", "#44", "-", "Unicode", "Character", "Database", "http", ":", "//", "www", ".", "unicode", ".", "org", "/", "reports", ...
def read_unicode_data(unicode_data): """ If you want to understand how this wonderful file format works checkout Unicode Standard Annex #44 - Unicode Character Database http://www.unicode.org/reports/tr44/ """ reader = csv.reader(unicode_data, delimiter=str(';')) while True...
[ "def", "read_unicode_data", "(", "unicode_data", ")", ":", "reader", "=", "csv", ".", "reader", "(", "unicode_data", ",", "delimiter", "=", "str", "(", "';'", ")", ")", "while", "True", ":", "row", "=", "next", "(", "reader", ")", "name", "=", "row", ...
https://github.com/0vercl0k/blazefox/blob/0ffeddfc1de3acb2254c505388e4cf9ab9d1f0a7/src/js/util/make_unicode.py#L110-L134
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_trackers.py
python
gridTracker.update
(self)
Redraw the grid.
Redraw the grid.
[ "Redraw", "the", "grid", "." ]
def update(self): """Redraw the grid.""" # Resize the grid to make sure it fits # an exact pair number of main lines numlines = self.numlines // self.mainlines // 2 * 2 * self.mainlines bound = (numlines // 2) * self.space border = (numlines//2 + self.mainlines/2) * self....
[ "def", "update", "(", "self", ")", ":", "# Resize the grid to make sure it fits", "# an exact pair number of main lines", "numlines", "=", "self", ".", "numlines", "//", "self", ".", "mainlines", "//", "2", "*", "2", "*", "self", ".", "mainlines", "bound", "=", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_trackers.py#L1057-L1131
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/command/install.py
python
install.convert_paths
(self, *names)
Call `convert_path` over `names`.
Call `convert_path` over `names`.
[ "Call", "convert_path", "over", "names", "." ]
def convert_paths(self, *names): """Call `convert_path` over `names`.""" for name in names: attr = "install_" + name setattr(self, attr, convert_path(getattr(self, attr)))
[ "def", "convert_paths", "(", "self", ",", "*", "names", ")", ":", "for", "name", "in", "names", ":", "attr", "=", "\"install_\"", "+", "name", "setattr", "(", "self", ",", "attr", ",", "convert_path", "(", "getattr", "(", "self", ",", "attr", ")", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/command/install.py#L548-L552
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_grad.py
python
_XLog1pyGrad
(op, grad)
Returns gradient of xlog1py(x, y) with respect to x and y.
Returns gradient of xlog1py(x, y) with respect to x and y.
[ "Returns", "gradient", "of", "xlog1py", "(", "x", "y", ")", "with", "respect", "to", "x", "and", "y", "." ]
def _XLog1pyGrad(op, grad): """Returns gradient of xlog1py(x, y) with respect to x and y.""" x = op.inputs[0] y = op.inputs[1] sx = array_ops.shape(x) sy = array_ops.shape(y) rx, ry = gen_array_ops.broadcast_gradient_args(sx, sy) with ops.control_dependencies([grad]): not_zero_x = math_ops.cast( ...
[ "def", "_XLog1pyGrad", "(", "op", ",", "grad", ")", ":", "x", "=", "op", ".", "inputs", "[", "0", "]", "y", "=", "op", ".", "inputs", "[", "1", "]", "sx", "=", "array_ops", ".", "shape", "(", "x", ")", "sy", "=", "array_ops", ".", "shape", "(...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_grad.py#L727-L740
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_processor.py
python
KeyProcessor.feed_multiple
(self, key_presses: List[KeyPress], first: bool = False)
:param first: If true, insert before everything else.
:param first: If true, insert before everything else.
[ ":", "param", "first", ":", "If", "true", "insert", "before", "everything", "else", "." ]
def feed_multiple(self, key_presses: List[KeyPress], first: bool = False) -> None: """ :param first: If true, insert before everything else. """ if first: self.input_queue.extendleft(reversed(key_presses)) else: self.input_queue.extend(key_presses)
[ "def", "feed_multiple", "(", "self", ",", "key_presses", ":", "List", "[", "KeyPress", "]", ",", "first", ":", "bool", "=", "False", ")", "->", "None", ":", "if", "first", ":", "self", ".", "input_queue", ".", "extendleft", "(", "reversed", "(", "key_p...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/key_binding/key_processor.py#L218-L225
ROCmSoftwarePlatform/hipCaffe
4ec5d482515cce532348553b6db6d00d015675d5
python/caffe/io.py
python
Transformer.set_raw_scale
(self, in_, scale)
Set the scale of raw features s.t. the input blob = input * scale. While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale of these models must be 255. Parameters ---------- in_ : which input ...
Set the scale of raw features s.t. the input blob = input * scale. While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale of these models must be 255.
[ "Set", "the", "scale", "of", "raw", "features", "s", ".", "t", ".", "the", "input", "blob", "=", "input", "*", "scale", ".", "While", "Python", "represents", "images", "in", "[", "0", "1", "]", "certain", "Caffe", "models", "like", "CaffeNet", "and", ...
def set_raw_scale(self, in_, scale): """ Set the scale of raw features s.t. the input blob = input * scale. While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale of these models must be 255. ...
[ "def", "set_raw_scale", "(", "self", ",", "in_", ",", "scale", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "self", ".", "raw_scale", "[", "in_", "]", "=", "scale" ]
https://github.com/ROCmSoftwarePlatform/hipCaffe/blob/4ec5d482515cce532348553b6db6d00d015675d5/python/caffe/io.py#L221-L234
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/internal/well_known_types.py
python
_FieldMaskTree.IntersectPath
(self, path, intersection)
Calculates the intersection part of a field path with this tree. Args: path: The field path to calculates. intersection: The out tree to record the intersection part.
Calculates the intersection part of a field path with this tree.
[ "Calculates", "the", "intersection", "part", "of", "a", "field", "path", "with", "this", "tree", "." ]
def IntersectPath(self, path, intersection): """Calculates the intersection part of a field path with this tree. Args: path: The field path to calculates. intersection: The out tree to record the intersection part. """ node = self._root for name in path.split('.'): if name not in ...
[ "def", "IntersectPath", "(", "self", ",", "path", ",", "intersection", ")", ":", "node", "=", "self", ".", "_root", "for", "name", "in", "path", ".", "split", "(", "'.'", ")", ":", "if", "name", "not", "in", "node", ":", "return", "elif", "not", "n...
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/well_known_types.py#L529-L544
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Builder.py
python
_node_errors
(builder, env, tlist, slist)
Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate.
Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate.
[ "Validate", "that", "the", "lists", "of", "target", "and", "source", "nodes", "are", "legal", "for", "this", "builder", "and", "environment", ".", "Raise", "errors", "or", "issue", "warnings", "as", "appropriate", "." ]
def _node_errors(builder, env, tlist, slist): """Validate that the lists of target and source nodes are legal for this builder and environment. Raise errors or issue warnings as appropriate. """ # First, figure out if there are any errors in the way the targets # were specified. for t in t...
[ "def", "_node_errors", "(", "builder", ",", "env", ",", "tlist", ",", "slist", ")", ":", "# First, figure out if there are any errors in the way the targets", "# were specified.", "for", "t", "in", "tlist", ":", "if", "t", ".", "side_effect", ":", "raise", "UserErro...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Builder.py#L281-L318
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/core/additions/qgssettings.py
python
_qgssettings_enum_value
(self, key, enumDefaultValue, section=QgsSettings.NoSection)
return enu_val
Return the setting value for a setting based on an enum. This forces the output to be a valid and existing entry of the enum. Hence if the setting value is incorrect, the given default value is returned. :param self: the QgsSettings object :param key: the setting key :param enumDefaultValue: the de...
Return the setting value for a setting based on an enum. This forces the output to be a valid and existing entry of the enum. Hence if the setting value is incorrect, the given default value is returned.
[ "Return", "the", "setting", "value", "for", "a", "setting", "based", "on", "an", "enum", ".", "This", "forces", "the", "output", "to", "be", "a", "valid", "and", "existing", "entry", "of", "the", "enum", ".", "Hence", "if", "the", "setting", "value", "...
def _qgssettings_enum_value(self, key, enumDefaultValue, section=QgsSettings.NoSection): """ Return the setting value for a setting based on an enum. This forces the output to be a valid and existing entry of the enum. Hence if the setting value is incorrect, the given default value is returned. :p...
[ "def", "_qgssettings_enum_value", "(", "self", ",", "key", ",", "enumDefaultValue", ",", "section", "=", "QgsSettings", ".", "NoSection", ")", ":", "meta_enum", "=", "metaEnumFromValue", "(", "enumDefaultValue", ")", "if", "meta_enum", "is", "None", "or", "not",...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/core/additions/qgssettings.py#L25-L58
eyllanesc/stackoverflow
3837cc9ff94541bf5a500aac1b6182f53669537d
questions/55241644/fakeuic/__init__.py
python
compileUi
(uifile, pyfile, execute=False, indent=4, from_imports=False, resource_suffix='_rc', import_from='.')
compileUi(uifile, pyfile, execute=False, indent=4, from_imports=False, resource_suffix='_rc', import_from='.') Creates a Python module from a Qt Designer .ui file. uifile is a file name or file-like object containing the .ui file. pyfile is the file-like object to which the Python code will be written...
compileUi(uifile, pyfile, execute=False, indent=4, from_imports=False, resource_suffix='_rc', import_from='.')
[ "compileUi", "(", "uifile", "pyfile", "execute", "=", "False", "indent", "=", "4", "from_imports", "=", "False", "resource_suffix", "=", "_rc", "import_from", "=", ".", ")" ]
def compileUi(uifile, pyfile, execute=False, indent=4, from_imports=False, resource_suffix='_rc', import_from='.'): """compileUi(uifile, pyfile, execute=False, indent=4, from_imports=False, resource_suffix='_rc', import_from='.') Creates a Python module from a Qt Designer .ui file. uifile is a file na...
[ "def", "compileUi", "(", "uifile", ",", "pyfile", ",", "execute", "=", "False", ",", "indent", "=", "4", ",", "from_imports", "=", "False", ",", "resource_suffix", "=", "'_rc'", ",", "import_from", "=", "'.'", ")", ":", "from", "PySide2", ".", "QtCore", ...
https://github.com/eyllanesc/stackoverflow/blob/3837cc9ff94541bf5a500aac1b6182f53669537d/questions/55241644/fakeuic/__init__.py#L131-L167
microsoft/TSS.MSR
0f2516fca2cd9929c31d5450e39301c9bde43688
TSS.Py/src/TpmTypes.py
python
TPM2_SequenceComplete_REQUEST.__init__
(self, sequenceHandle = TPM_HANDLE(), buffer = None, hierarchy = TPM_HANDLE())
This command adds the last part of data, if any, to a hash/HMAC sequence and returns the result. Attributes: sequenceHandle (TPM_HANDLE): Authorization for the sequence Auth Index: 1 Auth Role: USER buffer (bytes): Data to be added to the hash/HMA...
This command adds the last part of data, if any, to a hash/HMAC sequence and returns the result.
[ "This", "command", "adds", "the", "last", "part", "of", "data", "if", "any", "to", "a", "hash", "/", "HMAC", "sequence", "and", "returns", "the", "result", "." ]
def __init__(self, sequenceHandle = TPM_HANDLE(), buffer = None, hierarchy = TPM_HANDLE()): """ This command adds the last part of data, if any, to a hash/HMAC sequence and returns the result. Attributes: sequenceHandle (TPM_HANDLE): Authorization for the sequence Au...
[ "def", "__init__", "(", "self", ",", "sequenceHandle", "=", "TPM_HANDLE", "(", ")", ",", "buffer", "=", "None", ",", "hierarchy", "=", "TPM_HANDLE", "(", ")", ")", ":", "self", ".", "sequenceHandle", "=", "sequenceHandle", "self", ".", "buffer", "=", "bu...
https://github.com/microsoft/TSS.MSR/blob/0f2516fca2cd9929c31d5450e39301c9bde43688/TSS.Py/src/TpmTypes.py#L12198-L12211
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/dataview.py
python
DataViewCtrl.EnsureVisible
(*args, **kwargs)
return _dataview.DataViewCtrl_EnsureVisible(*args, **kwargs)
EnsureVisible(self, DataViewItem item, DataViewColumn column=None)
EnsureVisible(self, DataViewItem item, DataViewColumn column=None)
[ "EnsureVisible", "(", "self", "DataViewItem", "item", "DataViewColumn", "column", "=", "None", ")" ]
def EnsureVisible(*args, **kwargs): """EnsureVisible(self, DataViewItem item, DataViewColumn column=None)""" return _dataview.DataViewCtrl_EnsureVisible(*args, **kwargs)
[ "def", "EnsureVisible", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewCtrl_EnsureVisible", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1811-L1813
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/util/ssl_.py
python
create_urllib3_context
( ssl_version=None, cert_reqs=None, options=None, ciphers=None )
return context
All arguments have the same meaning as ``ssl_wrap_socket``. By default, this function does a lot of the same work that ``ssl.create_default_context`` does on Python 3.4+. It: - Disables SSLv2, SSLv3, and compression - Sets a restricted set of server ciphers If you wish to enable SSLv3, yo...
All arguments have the same meaning as ``ssl_wrap_socket``.
[ "All", "arguments", "have", "the", "same", "meaning", "as", "ssl_wrap_socket", "." ]
def create_urllib3_context( ssl_version=None, cert_reqs=None, options=None, ciphers=None ): """All arguments have the same meaning as ``ssl_wrap_socket``. By default, this function does a lot of the same work that ``ssl.create_default_context`` does on Python 3.4+. It: - Disables SSLv2, SS...
[ "def", "create_urllib3_context", "(", "ssl_version", "=", "None", ",", "cert_reqs", "=", "None", ",", "options", "=", "None", ",", "ciphers", "=", "None", ")", ":", "context", "=", "SSLContext", "(", "ssl_version", "or", "PROTOCOL_TLS", ")", "context", ".", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/pip/_vendor/urllib3/util/ssl_.py#L489-L661
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/models.py
python
Response.is_permanent_redirect
(self)
return ('location' in self.headers and self.status_code in (codes.moved_permanently, codes.permanent_redirect))
True if this Response one of the permanant versions of redirect
True if this Response one of the permanant versions of redirect
[ "True", "if", "this", "Response", "one", "of", "the", "permanant", "versions", "of", "redirect" ]
def is_permanent_redirect(self): """True if this Response one of the permanant versions of redirect""" return ('location' in self.headers and self.status_code in (codes.moved_permanently, codes.permanent_redirect))
[ "def", "is_permanent_redirect", "(", "self", ")", ":", "return", "(", "'location'", "in", "self", ".", "headers", "and", "self", ".", "status_code", "in", "(", "codes", ".", "moved_permanently", ",", "codes", ".", "permanent_redirect", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/botocore/vendored/requests/models.py#L650-L652
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/robotsim.py
python
RobotModel.velocityFromDrivers
(self, driverVelocities: Vector)
return _robotsim.RobotModel_velocityFromDrivers(self, driverVelocities)
r""" Converts a list of driver velocities (length numDrivers()) to a full velocity vector (length numLinks()). Args: driverVelocities (:obj:`list of floats`)
r""" Converts a list of driver velocities (length numDrivers()) to a full velocity vector (length numLinks()).
[ "r", "Converts", "a", "list", "of", "driver", "velocities", "(", "length", "numDrivers", "()", ")", "to", "a", "full", "velocity", "vector", "(", "length", "numLinks", "()", ")", "." ]
def velocityFromDrivers(self, driverVelocities: Vector) ->None: r""" Converts a list of driver velocities (length numDrivers()) to a full velocity vector (length numLinks()). Args: driverVelocities (:obj:`list of floats`) """ return _robotsim.RobotModel_vel...
[ "def", "velocityFromDrivers", "(", "self", ",", "driverVelocities", ":", "Vector", ")", "->", "None", ":", "return", "_robotsim", ".", "RobotModel_velocityFromDrivers", "(", "self", ",", "driverVelocities", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/robotsim.py#L5155-L5163
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/optimize/optimize.py
python
rosen_der
(x)
return der
The derivative (i.e. gradient) of the Rosenbrock function. Parameters ---------- x : array_like 1-D array of points at which the derivative is to be computed. Returns ------- rosen_der : (N,) ndarray The gradient of the Rosenbrock function at `x`. See Also -------- ...
The derivative (i.e. gradient) of the Rosenbrock function.
[ "The", "derivative", "(", "i", ".", "e", ".", "gradient", ")", "of", "the", "Rosenbrock", "function", "." ]
def rosen_der(x): """ The derivative (i.e. gradient) of the Rosenbrock function. Parameters ---------- x : array_like 1-D array of points at which the derivative is to be computed. Returns ------- rosen_der : (N,) ndarray The gradient of the Rosenbrock function at `x`. ...
[ "def", "rosen_der", "(", "x", ")", ":", "x", "=", "asarray", "(", "x", ")", "xm", "=", "x", "[", "1", ":", "-", "1", "]", "xm_m1", "=", "x", "[", ":", "-", "2", "]", "xm_p1", "=", "x", "[", "2", ":", "]", "der", "=", "numpy", ".", "zero...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/optimize/optimize.py#L193-L221
rtbkit/rtbkit
502d06acc3f8d90438946b6ae742190f2f4b4fbb
jml-build/jmlbuild.py
python
next_line
(stream)
return result
Returns the next line that needs parsing. The returned line is guaranteed to be striped of leading and trailing white spaces. We also ensure that a line broken up by the \ character will be returned as a single line.
Returns the next line that needs parsing. The returned line is guaranteed to be striped of leading and trailing white spaces. We also ensure that a line broken up by the \ character will be returned as a single line.
[ "Returns", "the", "next", "line", "that", "needs", "parsing", ".", "The", "returned", "line", "is", "guaranteed", "to", "be", "striped", "of", "leading", "and", "trailing", "white", "spaces", ".", "We", "also", "ensure", "that", "a", "line", "broken", "up"...
def next_line(stream): """ Returns the next line that needs parsing. The returned line is guaranteed to be striped of leading and trailing white spaces. We also ensure that a line broken up by the \ character will be returned as a single line. """ result = "" while True: line = strea...
[ "def", "next_line", "(", "stream", ")", ":", "result", "=", "\"\"", "while", "True", ":", "line", "=", "stream", ".", "readline", "(", ")", "if", "len", "(", "line", ")", "==", "0", ":", "break", "line", "=", "strip_line", "(", "line", ")", "# Cont...
https://github.com/rtbkit/rtbkit/blob/502d06acc3f8d90438946b6ae742190f2f4b4fbb/jml-build/jmlbuild.py#L171-L207
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
RichTextCtrl.SetInternalSelectionRange
(*args, **kwargs)
return _richtext.RichTextCtrl_SetInternalSelectionRange(*args, **kwargs)
SetInternalSelectionRange(self, RichTextRange range) Set the selection range in character positions. The range is in internal format, i.e. a single character selection is denoted by (n,n).
SetInternalSelectionRange(self, RichTextRange range)
[ "SetInternalSelectionRange", "(", "self", "RichTextRange", "range", ")" ]
def SetInternalSelectionRange(*args, **kwargs): """ SetInternalSelectionRange(self, RichTextRange range) Set the selection range in character positions. The range is in internal format, i.e. a single character selection is denoted by (n,n). """ return _richtext.RichTextC...
[ "def", "SetInternalSelectionRange", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextCtrl_SetInternalSelectionRange", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L3682-L3689
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/mo/openvino/tools/mo/utils/model_analysis.py
python
AnalyzeAction.run_after
(self)
return [LoadFinish]
Returns list of replacer classes which this replacer must be run after. :return: list of classes
Returns list of replacer classes which this replacer must be run after. :return: list of classes
[ "Returns", "list", "of", "replacer", "classes", "which", "this", "replacer", "must", "be", "run", "after", ".", ":", "return", ":", "list", "of", "classes" ]
def run_after(self): """ Returns list of replacer classes which this replacer must be run after. :return: list of classes """ return [LoadFinish]
[ "def", "run_after", "(", "self", ")", ":", "return", "[", "LoadFinish", "]" ]
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/mo/openvino/tools/mo/utils/model_analysis.py#L90-L95
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListTextCtrl.AcceptChanges
(self)
return True
Accepts/refuses the changes made by the user.
Accepts/refuses the changes made by the user.
[ "Accepts", "/", "refuses", "the", "changes", "made", "by", "the", "user", "." ]
def AcceptChanges(self): """ Accepts/refuses the changes made by the user. """ value = self.GetValue() if value == self._startValue: # nothing changed, always accept # when an item remains unchanged, the owner # needs to be notified that the user decided ...
[ "def", "AcceptChanges", "(", "self", ")", ":", "value", "=", "self", ".", "GetValue", "(", ")", "if", "value", "==", "self", ".", "_startValue", ":", "# nothing changed, always accept", "# when an item remains unchanged, the owner", "# needs to be notified that the user d...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L5815-L5840
learnforpractice/pyeos
4f04eb982c86c1fdb413084af77c713a6fda3070
libraries/vm/vm_cpython_ss/lib/codecs.py
python
Codec.decode
(self, input, errors='strict')
Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples of objects providing this slot. errors de...
Decodes the object input and returns a tuple (output object, length consumed).
[ "Decodes", "the", "object", "input", "and", "returns", "a", "tuple", "(", "output", "object", "length", "consumed", ")", "." ]
def decode(self, input, errors='strict'): """ Decodes the object input and returns a tuple (output object, length consumed). input must be an object which provides the bf_getreadbuf buffer slot. Python strings, buffer objects and memory mapped files are examples...
[ "def", "decode", "(", "self", ",", "input", ",", "errors", "=", "'strict'", ")", ":", "raise", "NotImplementedError" ]
https://github.com/learnforpractice/pyeos/blob/4f04eb982c86c1fdb413084af77c713a6fda3070/libraries/vm/vm_cpython_ss/lib/codecs.py#L156-L177
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/supervisor.py
python
Supervisor.start_queue_runners
(self, sess, queue_runners=None)
return threads
Start threads for `QueueRunners`. Note that the queue runners collected in the graph key `QUEUE_RUNNERS` are already started automatically when you create a session with the supervisor, so unless you have non-collected queue runners to start you do not need to call this explicitly. Args: ses...
Start threads for `QueueRunners`.
[ "Start", "threads", "for", "QueueRunners", "." ]
def start_queue_runners(self, sess, queue_runners=None): """Start threads for `QueueRunners`. Note that the queue runners collected in the graph key `QUEUE_RUNNERS` are already started automatically when you create a session with the supervisor, so unless you have non-collected queue runners to start ...
[ "def", "start_queue_runners", "(", "self", ",", "sess", ",", "queue_runners", "=", "None", ")", ":", "if", "queue_runners", "is", "None", ":", "queue_runners", "=", "self", ".", "_graph", ".", "get_collection", "(", "ops", ".", "GraphKeys", ".", "QUEUE_RUNNE...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/supervisor.py#L732-L755
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/summary_ops_v2.py
python
audio
(name, tensor, sample_rate, max_outputs, family=None, step=None)
return summary_writer_function(name, tensor, function, family=family)
Writes an audio summary if possible.
Writes an audio summary if possible.
[ "Writes", "an", "audio", "summary", "if", "possible", "." ]
def audio(name, tensor, sample_rate, max_outputs, family=None, step=None): """Writes an audio summary if possible.""" def function(tag, scope): # Note the identity to move the tensor to the CPU. return gen_summary_ops.write_audio_summary( _summary_state.writer._resource, # pylint: disable=protecte...
[ "def", "audio", "(", "name", ",", "tensor", ",", "sample_rate", ",", "max_outputs", ",", "family", "=", "None", ",", "step", "=", "None", ")", ":", "def", "function", "(", "tag", ",", "scope", ")", ":", "# Note the identity to move the tensor to the CPU.", "...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/summary_ops_v2.py#L948-L962
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py
python
Trace.error
(cls, message)
Show an error message
Show an error message
[ "Show", "an", "error", "message" ]
def error(cls, message): "Show an error message" message = '* ' + message if Trace.prefix and Trace.showlinesmode: message = Trace.prefix + message Trace.show(message, sys.stderr)
[ "def", "error", "(", "cls", ",", "message", ")", ":", "message", "=", "'* '", "+", "message", "if", "Trace", ".", "prefix", "and", "Trace", ".", "showlinesmode", ":", "message", "=", "Trace", ".", "prefix", "+", "message", "Trace", ".", "show", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/utils/math/math2html.py#L51-L56
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/sparse_grad.py
python
_SparseSoftmaxGrad
(op, grad)
return [None, grad_x, None]
Gradients for SparseSoftmax. The calculation is the same as SoftmaxGrad: grad_x = grad_softmax * softmax - sum(grad_softmax * softmax) * softmax where we now only operate on the non-zero values present in the SparseTensors. Args: op: the SparseSoftmax op. grad: the upstream gradient w.r.t. the non...
Gradients for SparseSoftmax.
[ "Gradients", "for", "SparseSoftmax", "." ]
def _SparseSoftmaxGrad(op, grad): """Gradients for SparseSoftmax. The calculation is the same as SoftmaxGrad: grad_x = grad_softmax * softmax - sum(grad_softmax * softmax) * softmax where we now only operate on the non-zero values present in the SparseTensors. Args: op: the SparseSoftmax op. gra...
[ "def", "_SparseSoftmaxGrad", "(", "op", ",", "grad", ")", ":", "indices", ",", "shape", "=", "op", ".", "inputs", "[", "0", "]", ",", "op", ".", "inputs", "[", "2", "]", "out_vals", "=", "op", ".", "outputs", "[", "0", "]", "sp_output", "=", "spa...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/sparse_grad.py#L284-L314
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/linear_model/_omp.py
python
OrthogonalMatchingPursuit.fit
(self, X, y)
return self
Fit the model using X, y as training data. Parameters ---------- X : array-like, shape (n_samples, n_features) Training data. y : array-like, shape (n_samples,) or (n_samples, n_targets) Target values. Will be cast to X's dtype if necessary Returns ...
Fit the model using X, y as training data.
[ "Fit", "the", "model", "using", "X", "y", "as", "training", "data", "." ]
def fit(self, X, y): """Fit the model using X, y as training data. Parameters ---------- X : array-like, shape (n_samples, n_features) Training data. y : array-like, shape (n_samples,) or (n_samples, n_targets) Target values. Will be cast to X's dtype if...
[ "def", "fit", "(", "self", ",", "X", ",", "y", ")", ":", "X", ",", "y", "=", "check_X_y", "(", "X", ",", "y", ",", "multi_output", "=", "True", ",", "y_numeric", "=", "True", ")", "n_features", "=", "X", ".", "shape", "[", "1", "]", "X", ",",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/linear_model/_omp.py#L627-L676
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/framework/meta_graph.py
python
read_meta_graph_file
(filename)
return meta_graph_def
Reads a file containing `MetaGraphDef` and returns the protocol buffer. Args: filename: `meta_graph_def` filename including the path. Returns: A `MetaGraphDef` protocol buffer. Raises: IOError: If the file doesn't exist, or cannot be successfully parsed.
Reads a file containing `MetaGraphDef` and returns the protocol buffer.
[ "Reads", "a", "file", "containing", "MetaGraphDef", "and", "returns", "the", "protocol", "buffer", "." ]
def read_meta_graph_file(filename): """Reads a file containing `MetaGraphDef` and returns the protocol buffer. Args: filename: `meta_graph_def` filename including the path. Returns: A `MetaGraphDef` protocol buffer. Raises: IOError: If the file doesn't exist, or cannot be successfully parsed. "...
[ "def", "read_meta_graph_file", "(", "filename", ")", ":", "meta_graph_def", "=", "meta_graph_pb2", ".", "MetaGraphDef", "(", ")", "if", "not", "file_io", ".", "file_exists", "(", "filename", ")", ":", "raise", "IOError", "(", "\"File %s does not exist.\"", "%", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/framework/meta_graph.py#L541-L570
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/smtplib.py
python
SMTP.help
(self, args='')
return self.getreply()[1]
SMTP 'help' command. Returns help text from server.
SMTP 'help' command. Returns help text from server.
[ "SMTP", "help", "command", ".", "Returns", "help", "text", "from", "server", "." ]
def help(self, args=''): """SMTP 'help' command. Returns help text from server.""" self.putcmd("help", args) return self.getreply()[1]
[ "def", "help", "(", "self", ",", "args", "=", "''", ")", ":", "self", ".", "putcmd", "(", "\"help\"", ",", "args", ")", "return", "self", ".", "getreply", "(", ")", "[", "1", "]" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/smtplib.py#L453-L457
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
com/win32com/client/__init__.py
python
GetActiveObject
(Class, clsctx=pythoncom.CLSCTX_ALL)
return __WrapDispatch(dispatch, Class, resultCLSID=resultCLSID, clsctx=clsctx)
Python friendly version of GetObject's ProgID/CLSID functionality.
Python friendly version of GetObject's ProgID/CLSID functionality.
[ "Python", "friendly", "version", "of", "GetObject", "s", "ProgID", "/", "CLSID", "functionality", "." ]
def GetActiveObject(Class, clsctx=pythoncom.CLSCTX_ALL): """ Python friendly version of GetObject's ProgID/CLSID functionality. """ resultCLSID = pywintypes.IID(Class) dispatch = pythoncom.GetActiveObject(resultCLSID) dispatch = dispatch.QueryInterface(pythoncom.IID_IDispatch) return __WrapD...
[ "def", "GetActiveObject", "(", "Class", ",", "clsctx", "=", "pythoncom", ".", "CLSCTX_ALL", ")", ":", "resultCLSID", "=", "pywintypes", ".", "IID", "(", "Class", ")", "dispatch", "=", "pythoncom", ".", "GetActiveObject", "(", "resultCLSID", ")", "dispatch", ...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/com/win32com/client/__init__.py#L88-L95
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/build/lib.linux-x86_64-2.7/mxnet/kvstore.py
python
_ctype_key_value
(keys, vals)
Return ctype arrays for the key-value args, for internal use
Return ctype arrays for the key-value args, for internal use
[ "Return", "ctype", "arrays", "for", "the", "key", "-", "value", "args", "for", "internal", "use" ]
def _ctype_key_value(keys, vals): """ Return ctype arrays for the key-value args, for internal use """ if isinstance(keys, int): if isinstance(vals, NDArray): return (c_array(ctypes.c_int, [keys]), c_array(NDArrayHandle, [vals.handle])) else: f...
[ "def", "_ctype_key_value", "(", "keys", ",", "vals", ")", ":", "if", "isinstance", "(", "keys", ",", "int", ")", ":", "if", "isinstance", "(", "vals", ",", "NDArray", ")", ":", "return", "(", "c_array", "(", "ctypes", ".", "c_int", ",", "[", "keys", ...
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/build/lib.linux-x86_64-2.7/mxnet/kvstore.py#L13-L36
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py
python
_Quiet
()
return _cpplint_state.quiet
Return's the module's quiet setting.
Return's the module's quiet setting.
[ "Return", "s", "the", "module", "s", "quiet", "setting", "." ]
def _Quiet(): """Return's the module's quiet setting.""" return _cpplint_state.quiet
[ "def", "_Quiet", "(", ")", ":", "return", "_cpplint_state", ".", "quiet" ]
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/SystemManagement/json_request_response_lib/src/third_party/nlohmann_json/third_party/cpplint/cpplint.py#L1171-L1173
qgis/QGIS
15a77662d4bb712184f6aa60d0bd663010a76a75
python/plugins/db_manager/dlg_create_table.py
python
DlgCreateTable.updatePkeyCombo
(self, selRow=None)
called when list of columns changes. if 'sel' is None, it keeps current index
called when list of columns changes. if 'sel' is None, it keeps current index
[ "called", "when", "list", "of", "columns", "changes", ".", "if", "sel", "is", "None", "it", "keeps", "current", "index" ]
def updatePkeyCombo(self, selRow=None): """ called when list of columns changes. if 'sel' is None, it keeps current index """ if selRow is None: selRow = self.cboPrimaryKey.currentIndex() self.cboPrimaryKey.clear() m = self.fields.model() for row in range(m.rowCoun...
[ "def", "updatePkeyCombo", "(", "self", ",", "selRow", "=", "None", ")", ":", "if", "selRow", "is", "None", ":", "selRow", "=", "self", ".", "cboPrimaryKey", ".", "currentIndex", "(", ")", "self", ".", "cboPrimaryKey", ".", "clear", "(", ")", "m", "=", ...
https://github.com/qgis/QGIS/blob/15a77662d4bb712184f6aa60d0bd663010a76a75/python/plugins/db_manager/dlg_create_table.py#L160-L173
bh107/bohrium
5b83e7117285fefc7779ed0e9acb0f8e74c7e068
bridge/bh107/bh107/random.py
python
RandomState.rand
(self, *shape)
return self.random_sample(shape)
Random values in a given shape. Create an array of the given shape and propagate it with random samples from a uniform distribution over ``[0, 1)``. Parameters ---------- d0, d1, ..., dn : int, optional The dimensions of the returned array, should all be pos...
Random values in a given shape.
[ "Random", "values", "in", "a", "given", "shape", "." ]
def rand(self, *shape): """Random values in a given shape. Create an array of the given shape and propagate it with random samples from a uniform distribution over ``[0, 1)``. Parameters ---------- d0, d1, ..., dn : int, optional The dimensions of th...
[ "def", "rand", "(", "self", ",", "*", "shape", ")", ":", "return", "self", ".", "random_sample", "(", "shape", ")" ]
https://github.com/bh107/bohrium/blob/5b83e7117285fefc7779ed0e9acb0f8e74c7e068/bridge/bh107/bh107/random.py#L320-L356
KhronosGroup/Vulkan-Samples
11a0eeffa223e3c049780fd783900da0bfe50431
.github/docker/scripts/run-clang-tidy.py
python
apply_fixes
(args, tmpdir)
Calls clang-apply-fixes on a given directory.
Calls clang-apply-fixes on a given directory.
[ "Calls", "clang", "-", "apply", "-", "fixes", "on", "a", "given", "directory", "." ]
def apply_fixes(args, tmpdir): """Calls clang-apply-fixes on a given directory.""" invocation = [args.clang_apply_replacements_binary] if args.format: invocation.append('-format') if args.style: invocation.append('-style=' + args.style) invocation.append(tmpdir) subprocess.call(invocation)
[ "def", "apply_fixes", "(", "args", ",", "tmpdir", ")", ":", "invocation", "=", "[", "args", ".", "clang_apply_replacements_binary", "]", "if", "args", ".", "format", ":", "invocation", ".", "append", "(", "'-format'", ")", "if", "args", ".", "style", ":", ...
https://github.com/KhronosGroup/Vulkan-Samples/blob/11a0eeffa223e3c049780fd783900da0bfe50431/.github/docker/scripts/run-clang-tidy.py#L144-L152
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pdfviewer/viewer.py
python
pdfViewer.UsePrintDirect
(self)
return self._usePrintDirect
Property to control to use either Cairo (via a page buffer) or dcGraphicsContext depending.
Property to control to use either Cairo (via a page buffer) or dcGraphicsContext depending.
[ "Property", "to", "control", "to", "use", "either", "Cairo", "(", "via", "a", "page", "buffer", ")", "or", "dcGraphicsContext", "depending", "." ]
def UsePrintDirect(self): """ Property to control to use either Cairo (via a page buffer) or dcGraphicsContext depending. """ return self._usePrintDirect
[ "def", "UsePrintDirect", "(", "self", ")", ":", "return", "self", ".", "_usePrintDirect" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pdfviewer/viewer.py#L289-L294
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.MarkerNext
(*args, **kwargs)
return _stc.StyledTextCtrl_MarkerNext(*args, **kwargs)
MarkerNext(self, int lineStart, int markerMask) -> int Find the next line after lineStart that includes a marker in mask.
MarkerNext(self, int lineStart, int markerMask) -> int
[ "MarkerNext", "(", "self", "int", "lineStart", "int", "markerMask", ")", "-", ">", "int" ]
def MarkerNext(*args, **kwargs): """ MarkerNext(self, int lineStart, int markerMask) -> int Find the next line after lineStart that includes a marker in mask. """ return _stc.StyledTextCtrl_MarkerNext(*args, **kwargs)
[ "def", "MarkerNext", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_MarkerNext", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L2394-L2400
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/animate.py
python
AnimationCtrlBase.Stop
(*args, **kwargs)
return _animate.AnimationCtrlBase_Stop(*args, **kwargs)
Stop(self)
Stop(self)
[ "Stop", "(", "self", ")" ]
def Stop(*args, **kwargs): """Stop(self)""" return _animate.AnimationCtrlBase_Stop(*args, **kwargs)
[ "def", "Stop", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_animate", ".", "AnimationCtrlBase_Stop", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/animate.py#L169-L171
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/pydoc.py
python
writedoc
(thing, forceload=0)
Write HTML documentation to a file in the current directory.
Write HTML documentation to a file in the current directory.
[ "Write", "HTML", "documentation", "to", "a", "file", "in", "the", "current", "directory", "." ]
def writedoc(thing, forceload=0): """Write HTML documentation to a file in the current directory.""" try: object, name = resolve(thing, forceload) page = html.page(describe(object), html.document(object, name)) with open(name + '.html', 'w', encoding='utf-8') as file: file.wr...
[ "def", "writedoc", "(", "thing", ",", "forceload", "=", "0", ")", ":", "try", ":", "object", ",", "name", "=", "resolve", "(", "thing", ",", "forceload", ")", "page", "=", "html", ".", "page", "(", "describe", "(", "object", ")", ",", "html", ".", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pydoc.py#L1786-L1795
D-X-Y/caffe-faster-rcnn
eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb
python/caffe/draw.py
python
get_layer_label
(layer, rankdir)
return node_label
Define node label based on layer type. Parameters ---------- layer : ? rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. Returns ------- string : A label for the current layer
Define node label based on layer type.
[ "Define", "node", "label", "based", "on", "layer", "type", "." ]
def get_layer_label(layer, rankdir): """Define node label based on layer type. Parameters ---------- layer : ? rankdir : {'LR', 'TB', 'BT'} Direction of graph layout. Returns ------- string : A label for the current layer """ if rankdir in ('TB', 'BT'): ...
[ "def", "get_layer_label", "(", "layer", ",", "rankdir", ")", ":", "if", "rankdir", "in", "(", "'TB'", ",", "'BT'", ")", ":", "# If graph orientation is vertical, horizontal space is free and", "# vertical space is not; separate words with spaces", "separator", "=", "' '", ...
https://github.com/D-X-Y/caffe-faster-rcnn/blob/eb50c97ff48f3df115d0e85fe0a32b0c7e2aa4cb/python/caffe/draw.py#L62-L114
carla-simulator/carla
8854804f4d7748e14d937ec763a2912823a7e5f5
PythonAPI/docs/doc_gen.py
python
Documentation.gen_body
(self)
return md.data().strip()
Generates the documentation body
Generates the documentation body
[ "Generates", "the", "documentation", "body" ]
def gen_body(self): """Generates the documentation body""" md = MarkdownFile() md.first_title() md.textn( "This reference contains all the details the Python API. To consult a previous reference for a specific CARLA release, change the documentation version using the panel in the...
[ "def", "gen_body", "(", "self", ")", ":", "md", "=", "MarkdownFile", "(", ")", "md", ".", "first_title", "(", ")", "md", ".", "textn", "(", "\"This reference contains all the details the Python API. To consult a previous reference for a specific CARLA release, change the docu...
https://github.com/carla-simulator/carla/blob/8854804f4d7748e14d937ec763a2912823a7e5f5/PythonAPI/docs/doc_gen.py#L652-L715
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pyparsing/py3/pyparsing/helpers.py
python
match_previous_expr
(expr: ParserElement)
return rep
Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = match_previous_expr(first) match_expr = first + ":" + second will match ...
Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example::
[ "Helper", "to", "define", "an", "expression", "that", "is", "indirectly", "defined", "from", "the", "tokens", "matched", "in", "a", "previous", "expression", "that", "is", "it", "looks", "for", "a", "repeat", "of", "a", "previous", "expression", ".", "For", ...
def match_previous_expr(expr: ParserElement) -> ParserElement: """Helper to define an expression that is indirectly defined from the tokens matched in a previous expression, that is, it looks for a 'repeat' of a previous expression. For example:: first = Word(nums) second = match_previous_...
[ "def", "match_previous_expr", "(", "expr", ":", "ParserElement", ")", "->", "ParserElement", ":", "rep", "=", "Forward", "(", ")", "e2", "=", "expr", ".", "copy", "(", ")", "rep", "<<=", "e2", "def", "copy_token_to_repeater", "(", "s", ",", "l", ",", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pyparsing/py3/pyparsing/helpers.py#L163-L194
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/escape-the-ghosts.py
python
Solution.escapeGhosts
(self, ghosts, target)
return all(total < abs(target[0]-i)+abs(target[1]-j) for i, j in ghosts)
:type ghosts: List[List[int]] :type target: List[int] :rtype: bool
:type ghosts: List[List[int]] :type target: List[int] :rtype: bool
[ ":", "type", "ghosts", ":", "List", "[", "List", "[", "int", "]]", ":", "type", "target", ":", "List", "[", "int", "]", ":", "rtype", ":", "bool" ]
def escapeGhosts(self, ghosts, target): """ :type ghosts: List[List[int]] :type target: List[int] :rtype: bool """ total = abs(target[0])+abs(target[1]) return all(total < abs(target[0]-i)+abs(target[1]-j) for i, j in ghosts)
[ "def", "escapeGhosts", "(", "self", ",", "ghosts", ",", "target", ")", ":", "total", "=", "abs", "(", "target", "[", "0", "]", ")", "+", "abs", "(", "target", "[", "1", "]", ")", "return", "all", "(", "total", "<", "abs", "(", "target", "[", "0...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/escape-the-ghosts.py#L5-L12
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
llvm/utils/llvm-build/llvmbuild/main.py
python
LLVMProjectInfo.write_cmake_exports_fragment
(self, output_path, enabled_optional_components)
write_cmake_exports_fragment(output_path) -> None Generate a CMake fragment which includes LLVMBuild library dependencies expressed similarly to how CMake would write them via install(EXPORT).
write_cmake_exports_fragment(output_path) -> None
[ "write_cmake_exports_fragment", "(", "output_path", ")", "-", ">", "None" ]
def write_cmake_exports_fragment(self, output_path, enabled_optional_components): """ write_cmake_exports_fragment(output_path) -> None Generate a CMake fragment which includes LLVMBuild library dependencies expressed similarly to how CMake would write them via install(EXPORT). ...
[ "def", "write_cmake_exports_fragment", "(", "self", ",", "output_path", ",", "enabled_optional_components", ")", ":", "dependencies", "=", "list", "(", "self", ".", "get_fragment_dependencies", "(", ")", ")", "# Write out the CMake exports fragment.", "make_install_dir", ...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/llvm/utils/llvm-build/llvmbuild/main.py#L595-L629
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/function_base.py
python
unique
(x)
This function is deprecated. Use numpy.lib.arraysetops.unique() instead.
This function is deprecated. Use numpy.lib.arraysetops.unique() instead.
[ "This", "function", "is", "deprecated", ".", "Use", "numpy", ".", "lib", ".", "arraysetops", ".", "unique", "()", "instead", "." ]
def unique(x): """ This function is deprecated. Use numpy.lib.arraysetops.unique() instead. """ try: tmp = x.flatten() if tmp.size == 0: return tmp tmp.sort() idx = concatenate(([True], tmp[1:]!=tmp[:-1])) return tmp[idx] except AttributeError...
[ "def", "unique", "(", "x", ")", ":", "try", ":", "tmp", "=", "x", ".", "flatten", "(", ")", "if", "tmp", ".", "size", "==", "0", ":", "return", "tmp", "tmp", ".", "sort", "(", ")", "idx", "=", "concatenate", "(", "(", "[", "True", "]", ",", ...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/lib/function_base.py#L1262-L1276
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/distributed/auto_parallel/operators/dist_reshape.py
python
DistributedReshapeImpl0.forward
(ctx, *args, **kwargs)
kwargs: inputname_mapping & outputname_mapping
kwargs: inputname_mapping & outputname_mapping
[ "kwargs", ":", "inputname_mapping", "&", "outputname_mapping" ]
def forward(ctx, *args, **kwargs): """ kwargs: inputname_mapping & outputname_mapping """ dist_op_context = ctx.dist_op_context main_block = dist_op_context.get_dst_main_program().global_block() src_op = dist_op_context.get_cur_src_op() rank_id = dist_op_context....
[ "def", "forward", "(", "ctx", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "dist_op_context", "=", "ctx", ".", "dist_op_context", "main_block", "=", "dist_op_context", ".", "get_dst_main_program", "(", ")", ".", "global_block", "(", ")", "src_op", ...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/distributed/auto_parallel/operators/dist_reshape.py#L127-L188
NVIDIAGameWorks/kaolin
e5148d05e9c1e2ce92a07881ce3593b1c5c3f166
kaolin/render/mesh/deftet.py
python
_base_naive_deftet_render
( pixel_coords, # (2,) render_range, # (2,) face_vertices_z, # (num_faces, 3) face_vertices_min, # (num_faces, 2) face_vertices_max, # (num_faces, 2) ax, ay, m, p, n, q, k3)
return in_bbox_idx[selected_mask][in_render_range_mask][order]
Base function for :func:`_naive_deftet_sparse_render` non-batched and for a single pixel This is because most operations are vectorized on faces but then only few outputs of those vectorized operations are used (so it's the memory is only used temporarily).
Base function for :func:`_naive_deftet_sparse_render` non-batched and for a single pixel
[ "Base", "function", "for", ":", "func", ":", "_naive_deftet_sparse_render", "non", "-", "batched", "and", "for", "a", "single", "pixel" ]
def _base_naive_deftet_render( pixel_coords, # (2,) render_range, # (2,) face_vertices_z, # (num_faces, 3) face_vertices_min, # (num_faces, 2) face_vertices_max, # (num_faces, 2) ax, ay, m, p, n, q, k3): # int """B...
[ "def", "_base_naive_deftet_render", "(", "pixel_coords", ",", "# (2,)", "render_range", ",", "# (2,)", "face_vertices_z", ",", "# (num_faces, 3)", "face_vertices_min", ",", "# (num_faces, 2)", "face_vertices_max", ",", "# (num_faces, 2)", "ax", ",", "ay", ",", "m", ",",...
https://github.com/NVIDIAGameWorks/kaolin/blob/e5148d05e9c1e2ce92a07881ce3593b1c5c3f166/kaolin/render/mesh/deftet.py#L27-L74
turi-code/SFrame
796b9bdfb2fa1b881d82080754643c7e68629cd2
oss_src/unity/python/sframe/data_structures/sketch.py
python
Sketch.num_elements_processed
(self)
Returns the number of elements processed so far. If the sketch is created with background == False (default), this will always return the length of the input array. Otherwise, this will return the number of elements processed so far.
Returns the number of elements processed so far. If the sketch is created with background == False (default), this will always return the length of the input array. Otherwise, this will return the number of elements processed so far.
[ "Returns", "the", "number", "of", "elements", "processed", "so", "far", ".", "If", "the", "sketch", "is", "created", "with", "background", "==", "False", "(", "default", ")", "this", "will", "always", "return", "the", "length", "of", "the", "input", "array...
def num_elements_processed(self): """ Returns the number of elements processed so far. If the sketch is created with background == False (default), this will always return the length of the input array. Otherwise, this will return the number of elements processed so far. ...
[ "def", "num_elements_processed", "(", "self", ")", ":", "with", "cython_context", "(", ")", ":", "return", "self", ".", "__proxy__", ".", "num_elements_processed", "(", ")" ]
https://github.com/turi-code/SFrame/blob/796b9bdfb2fa1b881d82080754643c7e68629cd2/oss_src/unity/python/sframe/data_structures/sketch.py#L499-L507
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
Pythonwin/pywin/framework/app.py
python
CApp.OnRClick
(self, params)
return 0
Handle right click message
Handle right click message
[ "Handle", "right", "click", "message" ]
def OnRClick(self, params): "Handle right click message" # put up the entire FILE menu! menu = win32ui.LoadMenu(win32ui.IDR_TEXTTYPE).GetSubMenu(0) menu.TrackPopupMenu(params[5]) # track at mouse position. return 0
[ "def", "OnRClick", "(", "self", ",", "params", ")", ":", "# put up the entire FILE menu!", "menu", "=", "win32ui", ".", "LoadMenu", "(", "win32ui", ".", "IDR_TEXTTYPE", ")", ".", "GetSubMenu", "(", "0", ")", "menu", ".", "TrackPopupMenu", "(", "params", "[",...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/Pythonwin/pywin/framework/app.py#L278-L283
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/calendar.py
python
HTMLCalendar.formatmonthname
(self, theyear, themonth, withyear=True)
return '<tr><th colspan="7" class="month">%s</th></tr>' % s
Return a month name as a table row.
Return a month name as a table row.
[ "Return", "a", "month", "name", "as", "a", "table", "row", "." ]
def formatmonthname(self, theyear, themonth, withyear=True): """ Return a month name as a table row. """ if withyear: s = '%s %s' % (month_name[themonth], theyear) else: s = '%s' % month_name[themonth] return '<tr><th colspan="7" class="month">%s</...
[ "def", "formatmonthname", "(", "self", ",", "theyear", ",", "themonth", ",", "withyear", "=", "True", ")", ":", "if", "withyear", ":", "s", "=", "'%s %s'", "%", "(", "month_name", "[", "themonth", "]", ",", "theyear", ")", "else", ":", "s", "=", "'%s...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/calendar.py#L414-L422
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.SetColMinimalAcceptableWidth
(*args, **kwargs)
return _grid.Grid_SetColMinimalAcceptableWidth(*args, **kwargs)
SetColMinimalAcceptableWidth(self, int width)
SetColMinimalAcceptableWidth(self, int width)
[ "SetColMinimalAcceptableWidth", "(", "self", "int", "width", ")" ]
def SetColMinimalAcceptableWidth(*args, **kwargs): """SetColMinimalAcceptableWidth(self, int width)""" return _grid.Grid_SetColMinimalAcceptableWidth(*args, **kwargs)
[ "def", "SetColMinimalAcceptableWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_SetColMinimalAcceptableWidth", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1918-L1920
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_impl.py
python
sufficient_statistics_v2
(x, axes, shift=None, keepdims=False, name=None)
return sufficient_statistics( x=x, axes=axes, shift=shift, keep_dims=keepdims, name=name)
Calculate the sufficient statistics for the mean and variance of `x`. These sufficient statistics are computed using the one pass algorithm on an input that's optionally shifted. See: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Computing_shifted_data Args: x: A `Tensor`. axes: Ar...
Calculate the sufficient statistics for the mean and variance of `x`.
[ "Calculate", "the", "sufficient", "statistics", "for", "the", "mean", "and", "variance", "of", "x", "." ]
def sufficient_statistics_v2(x, axes, shift=None, keepdims=False, name=None): """Calculate the sufficient statistics for the mean and variance of `x`. These sufficient statistics are computed using the one pass algorithm on an input that's optionally shifted. See: https://en.wikipedia.org/wiki/Algorithms_for_c...
[ "def", "sufficient_statistics_v2", "(", "x", ",", "axes", ",", "shift", "=", "None", ",", "keepdims", "=", "False", ",", "name", "=", "None", ")", ":", "return", "sufficient_statistics", "(", "x", "=", "x", ",", "axes", "=", "axes", ",", "shift", "=", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_impl.py#L1111-L1136
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/DraftGui.py
python
DraftToolBar.getDefaultColor
(self,type,rgb=False)
gets color from the preferences or toolbar
gets color from the preferences or toolbar
[ "gets", "color", "from", "the", "preferences", "or", "toolbar" ]
def getDefaultColor(self,type,rgb=False): """gets color from the preferences or toolbar""" r = 0 g = 0 b = 0 if type == "snap": color = Draft.getParam("snapcolor",4294967295) r = ((color>>24)&0xFF)/255 g = ((color>>16)&0xFF)/255 b =...
[ "def", "getDefaultColor", "(", "self", ",", "type", ",", "rgb", "=", "False", ")", ":", "r", "=", "0", "g", "=", "0", "b", "=", "0", "if", "type", "==", "\"snap\"", ":", "color", "=", "Draft", ".", "getParam", "(", "\"snapcolor\"", ",", "4294967295...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/DraftGui.py#L1841-L1884
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/tensor_spec.py
python
BoundedTensorSpec.__init__
(self, shape, dtype, minimum, maximum, name=None)
Initializes a new `BoundedTensorSpec`. Args: shape: Value convertible to `tf.TensorShape`. The shape of the tensor. dtype: Value convertible to `tf.DType`. The type of the tensor values. minimum: Number or sequence specifying the minimum element bounds (inclusive). Must be broadcastable t...
Initializes a new `BoundedTensorSpec`.
[ "Initializes", "a", "new", "BoundedTensorSpec", "." ]
def __init__(self, shape, dtype, minimum, maximum, name=None): """Initializes a new `BoundedTensorSpec`. Args: shape: Value convertible to `tf.TensorShape`. The shape of the tensor. dtype: Value convertible to `tf.DType`. The type of the tensor values. minimum: Number or sequence specifying t...
[ "def", "__init__", "(", "self", ",", "shape", ",", "dtype", ",", "minimum", ",", "maximum", ",", "name", "=", "None", ")", ":", "super", "(", "BoundedTensorSpec", ",", "self", ")", ".", "__init__", "(", "shape", ",", "dtype", ",", "name", ")", "if", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/framework/tensor_spec.py#L208-L253
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/route53/zone.py
python
Zone.get_records
(self)
return self.route53connection.get_all_rrsets(self.id)
Return a ResourceRecordsSets for all of the records in this zone.
Return a ResourceRecordsSets for all of the records in this zone.
[ "Return", "a", "ResourceRecordsSets", "for", "all", "of", "the", "records", "in", "this", "zone", "." ]
def get_records(self): """ Return a ResourceRecordsSets for all of the records in this zone. """ return self.route53connection.get_all_rrsets(self.id)
[ "def", "get_records", "(", "self", ")", ":", "return", "self", ".", "route53connection", ".", "get_all_rrsets", "(", "self", ".", "id", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/route53/zone.py#L402-L406