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
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/build/android/pylib/local/emulator/avd.py
python
_AvdManagerAgent.Create
(self, avd_name, system_image, force=False)
Call `avdmanager create`. Args: avd_name: name of the AVD to create. system_image: system image to use for the AVD. force: whether to force creation, overwriting any existing AVD with the same name.
Call `avdmanager create`.
[ "Call", "avdmanager", "create", "." ]
def Create(self, avd_name, system_image, force=False): """Call `avdmanager create`. Args: avd_name: name of the AVD to create. system_image: system image to use for the AVD. force: whether to force creation, overwriting any existing AVD with the same name. """ create_cmd = [ ...
[ "def", "Create", "(", "self", ",", "avd_name", ",", "system_image", ",", "force", "=", "False", ")", ":", "create_cmd", "=", "[", "_DEFAULT_AVDMANAGER_PATH", ",", "'-v'", ",", "'create'", ",", "'avd'", ",", "'-n'", ",", "avd_name", ",", "'-k'", ",", "sys...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/android/pylib/local/emulator/avd.py#L102-L139
cmu-db/noisepage
79276e68fe83322f1249e8a8be96bd63c583ae56
build-support/cpplint.py
python
RemoveMultiLineComments
(filename, lines, error)
Removes multiline (c-style) comments from lines.
Removes multiline (c-style) comments from lines.
[ "Removes", "multiline", "(", "c", "-", "style", ")", "comments", "from", "lines", "." ]
def RemoveMultiLineComments(filename, lines, error): """Removes multiline (c-style) comments from lines.""" lineix = 0 while lineix < len(lines): lineix_begin = FindNextMultiLineCommentStart(lines, lineix) if lineix_begin >= len(lines): return lineix_end = FindNextMultiLi...
[ "def", "RemoveMultiLineComments", "(", "filename", ",", "lines", ",", "error", ")", ":", "lineix", "=", "0", "while", "lineix", "<", "len", "(", "lines", ")", ":", "lineix_begin", "=", "FindNextMultiLineCommentStart", "(", "lines", ",", "lineix", ")", "if", ...
https://github.com/cmu-db/noisepage/blob/79276e68fe83322f1249e8a8be96bd63c583ae56/build-support/cpplint.py#L1617-L1630
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_controls.py
python
TreeCtrl.ItemHasChildren
(*args, **kwargs)
return _controls_.TreeCtrl_ItemHasChildren(*args, **kwargs)
ItemHasChildren(self, TreeItemId item) -> bool
ItemHasChildren(self, TreeItemId item) -> bool
[ "ItemHasChildren", "(", "self", "TreeItemId", "item", ")", "-", ">", "bool" ]
def ItemHasChildren(*args, **kwargs): """ItemHasChildren(self, TreeItemId item) -> bool""" return _controls_.TreeCtrl_ItemHasChildren(*args, **kwargs)
[ "def", "ItemHasChildren", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "TreeCtrl_ItemHasChildren", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L5335-L5337
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_core.py
python
Sizer.Clear
(*args, **kwargs)
return _core_.Sizer_Clear(*args, **kwargs)
Clear(self, bool deleteWindows=False) Clear all items from the sizer, optionally destroying the window items as well.
Clear(self, bool deleteWindows=False)
[ "Clear", "(", "self", "bool", "deleteWindows", "=", "False", ")" ]
def Clear(*args, **kwargs): """ Clear(self, bool deleteWindows=False) Clear all items from the sizer, optionally destroying the window items as well. """ return _core_.Sizer_Clear(*args, **kwargs)
[ "def", "Clear", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Sizer_Clear", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_core.py#L14930-L14937
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/training/supervisor.py
python
Supervisor._init_summary_op
(self, summary_op=USE_DEFAULT)
Initializes summary_op. Args: summary_op: An Operation that returns a Summary for the event logs. If set to USE_DEFAULT, create an op that merges all the summaries.
Initializes summary_op.
[ "Initializes", "summary_op", "." ]
def _init_summary_op(self, summary_op=USE_DEFAULT): """Initializes summary_op. Args: summary_op: An Operation that returns a Summary for the event logs. If set to USE_DEFAULT, create an op that merges all the summaries. """ if summary_op is Supervisor.USE_DEFAULT: summary_op = self....
[ "def", "_init_summary_op", "(", "self", ",", "summary_op", "=", "USE_DEFAULT", ")", ":", "if", "summary_op", "is", "Supervisor", ".", "USE_DEFAULT", ":", "summary_op", "=", "self", ".", "_get_first_op_from_collection", "(", "ops", ".", "GraphKeys", ".", "SUMMARY...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/training/supervisor.py#L464-L477
NVIDIA/TensorRT
42805f078052daad1a98bc5965974fcffaad0960
demo/BERT/inference.py
python
parse_args
()
return args
Parse command line arguments
Parse command line arguments
[ "Parse", "command", "line", "arguments" ]
def parse_args(): """ Parse command line arguments """ parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('-e', '--engine', help='Path to BERT TensorRT engine') parser.add_argument("-b", "--batch-size", default=1, help="Batch size for inference.", type=int) ...
[ "def", "parse_args", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "__doc__", ")", "parser", ".", "add_argument", "(", "'-e'", ",", "'--engine'", ",", "help", "=", "'Path to BERT TensorRT engine'", ")", "parser", "."...
https://github.com/NVIDIA/TensorRT/blob/42805f078052daad1a98bc5965974fcffaad0960/demo/BERT/inference.py#L39-L83
gnina/gnina
b9ae032f52fc7a8153987bde09c0efa3620d8bb6
caffe/examples/pycaffe/layers/pascal_multilabel_datalayers.py
python
PascalMultilabelDataLayerSync.backward
(self, top, propagate_down, bottom)
These layers does not back propagate
These layers does not back propagate
[ "These", "layers", "does", "not", "back", "propagate" ]
def backward(self, top, propagate_down, bottom): """ These layers does not back propagate """ pass
[ "def", "backward", "(", "self", ",", "top", ",", "propagate_down", ",", "bottom", ")", ":", "pass" ]
https://github.com/gnina/gnina/blob/b9ae032f52fc7a8153987bde09c0efa3620d8bb6/caffe/examples/pycaffe/layers/pascal_multilabel_datalayers.py#L74-L78
yue/yue
619d62c191b13c51c01be451dc48917c34a5aefc
building/tools/cpplint.py
python
_CppLintState.IncrementErrorCount
(self, category)
Bumps the module's error statistic.
Bumps the module's error statistic.
[ "Bumps", "the", "module", "s", "error", "statistic", "." ]
def IncrementErrorCount(self, category): """Bumps the module's error statistic.""" self.error_count += 1 if self.counting in ('toplevel', 'detailed'): if self.counting != 'detailed': category = category.split('/')[0] if category not in self.errors_by_category: self.errors_by_cate...
[ "def", "IncrementErrorCount", "(", "self", ",", "category", ")", ":", "self", ".", "error_count", "+=", "1", "if", "self", ".", "counting", "in", "(", "'toplevel'", ",", "'detailed'", ")", ":", "if", "self", ".", "counting", "!=", "'detailed'", ":", "cat...
https://github.com/yue/yue/blob/619d62c191b13c51c01be451dc48917c34a5aefc/building/tools/cpplint.py#L937-L945
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/propgrid.py
python
PGMultiButton.GetPrimarySize
(*args, **kwargs)
return _propgrid.PGMultiButton_GetPrimarySize(*args, **kwargs)
GetPrimarySize(self) -> Size
GetPrimarySize(self) -> Size
[ "GetPrimarySize", "(", "self", ")", "-", ">", "Size" ]
def GetPrimarySize(*args, **kwargs): """GetPrimarySize(self) -> Size""" return _propgrid.PGMultiButton_GetPrimarySize(*args, **kwargs)
[ "def", "GetPrimarySize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGMultiButton_GetPrimarySize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/propgrid.py#L2843-L2845
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/spatial/distance.py
python
euclidean
(u, v, w=None)
return minkowski(u, v, p=2, w=w)
Computes the Euclidean distance between two 1-D arrays. The Euclidean distance between 1-D arrays `u` and `v`, is defined as .. math:: {||u-v||}_2 \\left(\\sum{(w_i |(u_i - v_i)|^2)}\\right)^{1/2} Parameters ---------- u : (N,) array_like Input array. v : (N,) array_li...
Computes the Euclidean distance between two 1-D arrays.
[ "Computes", "the", "Euclidean", "distance", "between", "two", "1", "-", "D", "arrays", "." ]
def euclidean(u, v, w=None): """ Computes the Euclidean distance between two 1-D arrays. The Euclidean distance between 1-D arrays `u` and `v`, is defined as .. math:: {||u-v||}_2 \\left(\\sum{(w_i |(u_i - v_i)|^2)}\\right)^{1/2} Parameters ---------- u : (N,) array_like ...
[ "def", "euclidean", "(", "u", ",", "v", ",", "w", "=", "None", ")", ":", "return", "minkowski", "(", "u", ",", "v", ",", "p", "=", "2", ",", "w", "=", "w", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/spatial/distance.py#L566-L602
kushview/Element
1cc16380caa2ab79461246ba758b9de1f46db2a5
waflib/extras/fc_xlf.py
python
get_xlf_version
(conf, fc)
Get the compiler version
Get the compiler version
[ "Get", "the", "compiler", "version" ]
def get_xlf_version(conf, fc): """Get the compiler version""" cmd = fc + ['-qversion'] try: out, err = conf.cmd_and_log(cmd, output=0) except Errors.WafError: conf.fatal('Could not find xlf %r' % cmd) for v in (r"IBM XL Fortran.* V(?P<major>\d*)\.(?P<minor>\d*)",): version_re = re.compile(v, re.I).search ...
[ "def", "get_xlf_version", "(", "conf", ",", "fc", ")", ":", "cmd", "=", "fc", "+", "[", "'-qversion'", "]", "try", ":", "out", ",", "err", "=", "conf", ".", "cmd_and_log", "(", "cmd", ",", "output", "=", "0", ")", "except", "Errors", ".", "WafError...
https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/extras/fc_xlf.py#L37-L54
BVLC/caffe
9b891540183ddc834a02b2bd81b31afae71b2153
python/caffe/draw.py
python
get_edge_label
(layer)
return edge_label
Define edge label based on layer type.
Define edge label based on layer type.
[ "Define", "edge", "label", "based", "on", "layer", "type", "." ]
def get_edge_label(layer): """Define edge label based on layer type. """ if layer.type == 'Data': edge_label = 'Batch ' + str(layer.data_param.batch_size) elif layer.type == 'Convolution' or layer.type == 'Deconvolution': edge_label = str(layer.convolution_param.num_output) elif lay...
[ "def", "get_edge_label", "(", "layer", ")", ":", "if", "layer", ".", "type", "==", "'Data'", ":", "edge_label", "=", "'Batch '", "+", "str", "(", "layer", ".", "data_param", ".", "batch_size", ")", "elif", "layer", ".", "type", "==", "'Convolution'", "or...
https://github.com/BVLC/caffe/blob/9b891540183ddc834a02b2bd81b31afae71b2153/python/caffe/draw.py#L46-L59
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/losses/python/losses/loss_ops.py
python
_scale_losses
(losses, weights)
return math_ops.reduce_sum(reduced_losses)
Computes the scaled loss. Args: losses: A `Tensor` of size [batch_size, d1, ... dN]. weights: A `Tensor` of size [1], [batch_size] or [batch_size, d1, ... dN]. The `losses` are reduced (tf.reduce_sum) until its dimension matches that of `weights` at which point the reduced `losses` are element-wi...
Computes the scaled loss.
[ "Computes", "the", "scaled", "loss", "." ]
def _scale_losses(losses, weights): """Computes the scaled loss. Args: losses: A `Tensor` of size [batch_size, d1, ... dN]. weights: A `Tensor` of size [1], [batch_size] or [batch_size, d1, ... dN]. The `losses` are reduced (tf.reduce_sum) until its dimension matches that of `weights` at which ...
[ "def", "_scale_losses", "(", "losses", ",", "weights", ")", ":", "# First, compute the sum of the losses over all elements:", "start_index", "=", "max", "(", "0", ",", "weights", ".", "get_shape", "(", ")", ".", "ndims", ")", "reduction_indices", "=", "list", "(",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/losses/python/losses/loss_ops.py#L49-L72
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py
python
obj_argument.remove_name
(self)
return name
Remove and return the name value.
Remove and return the name value.
[ "Remove", "and", "return", "the", "name", "value", "." ]
def remove_name(self): """ Remove and return the name value. """ name = self.type.get_name() self.type.name = None return name
[ "def", "remove_name", "(", "self", ")", ":", "name", "=", "self", ".", "type", ".", "get_name", "(", ")", "self", ".", "type", ".", "name", "=", "None", "return", "name" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/CEF3/pristine/cef_source/tools/cef_parser.py#L1315-L1319
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/system_info.py
python
fftw_info.calc_ver_info
(self, ver_param)
Returns True on successful version detection, else False
Returns True on successful version detection, else False
[ "Returns", "True", "on", "successful", "version", "detection", "else", "False" ]
def calc_ver_info(self, ver_param): """Returns True on successful version detection, else False""" lib_dirs = self.get_lib_dirs() incl_dirs = self.get_include_dirs() incl_dir = None libs = self.get_libs(self.section + '_libs', ver_param['libs']) info = self.check_libs(lib...
[ "def", "calc_ver_info", "(", "self", ",", "ver_param", ")", ":", "lib_dirs", "=", "self", ".", "get_lib_dirs", "(", ")", "incl_dirs", "=", "self", ".", "get_include_dirs", "(", ")", "incl_dir", "=", "None", "libs", "=", "self", ".", "get_libs", "(", "sel...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/distutils/system_info.py#L759-L784
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_windows.py
python
StatusBar.GetBorderY
(*args, **kwargs)
return _windows_.StatusBar_GetBorderY(*args, **kwargs)
GetBorderY(self) -> int
GetBorderY(self) -> int
[ "GetBorderY", "(", "self", ")", "-", ">", "int" ]
def GetBorderY(*args, **kwargs): """GetBorderY(self) -> int""" return _windows_.StatusBar_GetBorderY(*args, **kwargs)
[ "def", "GetBorderY", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_windows_", ".", "StatusBar_GetBorderY", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L1291-L1293
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py
python
is_object_dtype
(arr_or_dtype)
return _is_dtype_type(arr_or_dtype, classes(np.object_))
Check whether an array-like or dtype is of the object dtype. Parameters ---------- arr_or_dtype : array-like The array-like or dtype to check. Returns ------- boolean Whether or not the array-like or dtype is of the object dtype. Examples -------- >>> is_object_dty...
Check whether an array-like or dtype is of the object dtype.
[ "Check", "whether", "an", "array", "-", "like", "or", "dtype", "is", "of", "the", "object", "dtype", "." ]
def is_object_dtype(arr_or_dtype) -> bool: """ Check whether an array-like or dtype is of the object dtype. Parameters ---------- arr_or_dtype : array-like The array-like or dtype to check. Returns ------- boolean Whether or not the array-like or dtype is of the object ...
[ "def", "is_object_dtype", "(", "arr_or_dtype", ")", "->", "bool", ":", "return", "_is_dtype_type", "(", "arr_or_dtype", ",", "classes", "(", "np", ".", "object_", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/dtypes/common.py#L222-L249
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-time.py
python
SConsTimer.profile_name
(self, invocation)
return os.path.join(self.outdir, name)
Returns the absolute path of a profile file for the specified invocation number.
Returns the absolute path of a profile file for the specified invocation number.
[ "Returns", "the", "absolute", "path", "of", "a", "profile", "file", "for", "the", "specified", "invocation", "number", "." ]
def profile_name(self, invocation): """ Returns the absolute path of a profile file for the specified invocation number. """ name = self.prefix_run + '-%d.prof' % invocation return os.path.join(self.outdir, name)
[ "def", "profile_name", "(", "self", ",", "invocation", ")", ":", "name", "=", "self", ".", "prefix_run", "+", "'-%d.prof'", "%", "invocation", "return", "os", ".", "path", ".", "join", "(", "self", ".", "outdir", ",", "name", ")" ]
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-time.py#L602-L608
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/nntplib.py
python
NNTP._putcmd
(self, line)
Internal: send one command to the server (through _putline()). The `line` must be a unicode string.
Internal: send one command to the server (through _putline()). The `line` must be a unicode string.
[ "Internal", ":", "send", "one", "command", "to", "the", "server", "(", "through", "_putline", "()", ")", ".", "The", "line", "must", "be", "a", "unicode", "string", "." ]
def _putcmd(self, line): """Internal: send one command to the server (through _putline()). The `line` must be a unicode string.""" if self.debugging: print('*cmd*', repr(line)) line = line.encode(self.encoding, self.errors) self._putline(line)
[ "def", "_putcmd", "(", "self", ",", "line", ")", ":", "if", "self", ".", "debugging", ":", "print", "(", "'*cmd*'", ",", "repr", "(", "line", ")", ")", "line", "=", "line", ".", "encode", "(", "self", ".", "encoding", ",", "self", ".", "errors", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/nntplib.py#L450-L455
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/libmintsmolecule.py
python
compute_atom_map
(mol, tol=0.05)
return atom_map
Computes atom mappings during symmetry operations. Useful in generating SO information and Cartesian displacement SALCs. param mol Molecule to form mapping matrix from. returns Integer matrix of dimension natoms X nirreps.
Computes atom mappings during symmetry operations. Useful in generating SO information and Cartesian displacement SALCs. param mol Molecule to form mapping matrix from. returns Integer matrix of dimension natoms X nirreps.
[ "Computes", "atom", "mappings", "during", "symmetry", "operations", ".", "Useful", "in", "generating", "SO", "information", "and", "Cartesian", "displacement", "SALCs", ".", "param", "mol", "Molecule", "to", "form", "mapping", "matrix", "from", ".", "returns", "...
def compute_atom_map(mol, tol=0.05): """Computes atom mappings during symmetry operations. Useful in generating SO information and Cartesian displacement SALCs. param mol Molecule to form mapping matrix from. returns Integer matrix of dimension natoms X nirreps. """ # create the character table...
[ "def", "compute_atom_map", "(", "mol", ",", "tol", "=", "0.05", ")", ":", "# create the character table for the point group", "ct", "=", "mol", ".", "point_group", "(", ")", ".", "char_table", "(", ")", "natom", "=", "mol", ".", "natom", "(", ")", "ng", "=...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsmolecule.py#L3249-L3289
mavlink/mavros
a32232d57a5e91abf6737e454d4199cae29b369c
mavros/mavros/cmd/ftp.py
python
reset
(client)
Reset ftp server.
Reset ftp server.
[ "Reset", "ftp", "server", "." ]
def reset(client): """Reset ftp server.""" client.ftp.reset_server()
[ "def", "reset", "(", "client", ")", ":", "client", ".", "ftp", ".", "reset_server", "(", ")" ]
https://github.com/mavlink/mavros/blob/a32232d57a5e91abf6737e454d4199cae29b369c/mavros/mavros/cmd/ftp.py#L147-L149
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tix.py
python
Grid.anchor_get
(self)
return self._getints(self.tk.call(self, 'anchor', 'get'))
Get the (x,y) coordinate of the current anchor cell
Get the (x,y) coordinate of the current anchor cell
[ "Get", "the", "(", "x", "y", ")", "coordinate", "of", "the", "current", "anchor", "cell" ]
def anchor_get(self): "Get the (x,y) coordinate of the current anchor cell" return self._getints(self.tk.call(self, 'anchor', 'get'))
[ "def", "anchor_get", "(", "self", ")", ":", "return", "self", ".", "_getints", "(", "self", ".", "tk", ".", "call", "(", "self", ",", "'anchor'", ",", "'get'", ")", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tix.py#L1805-L1807
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/bayesflow/python/ops/hmc_impl.py
python
chain
(n_iterations, step_size, n_leapfrog_steps, initial_x, target_log_prob_fn, event_dims=(), name=None)
Runs multiple iterations of one or more Hamiltonian Monte Carlo chains. Hamiltonian Monte Carlo (HMC) is a Markov chain Monte Carlo (MCMC) algorithm that takes a series of gradient-informed steps to produce a Metropolis proposal. This function samples from an HMC Markov chain whose initial state is `initial_x`...
Runs multiple iterations of one or more Hamiltonian Monte Carlo chains.
[ "Runs", "multiple", "iterations", "of", "one", "or", "more", "Hamiltonian", "Monte", "Carlo", "chains", "." ]
def chain(n_iterations, step_size, n_leapfrog_steps, initial_x, target_log_prob_fn, event_dims=(), name=None): """Runs multiple iterations of one or more Hamiltonian Monte Carlo chains. Hamiltonian Monte Carlo (HMC) is a Markov chain Monte Carlo (MCMC) algorithm that takes a series of gradient-informed...
[ "def", "chain", "(", "n_iterations", ",", "step_size", ",", "n_leapfrog_steps", ",", "initial_x", ",", "target_log_prob_fn", ",", "event_dims", "=", "(", ")", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "'hmc_cha...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/bayesflow/python/ops/hmc_impl.py#L57-L179
msftguy/ssh-rd
a5f3a79daeac5844edebf01916c9613563f1c390
_3rd/boost_1_48_0/tools/build/v2/build/generators.py
python
Generator.convert_to_consumable_types
(self, project, name, prop_set, sources, only_one=False)
return (consumed, bypassed)
Attempts to convert 'source' to the types that this generator can handle. The intention is to produce the set of targets can should be used when generator is run. only_one: convert 'source' to only one of source types if there's more that one possibility, re...
Attempts to convert 'source' to the types that this generator can handle. The intention is to produce the set of targets can should be used when generator is run. only_one: convert 'source' to only one of source types if there's more that one possibility, re...
[ "Attempts", "to", "convert", "source", "to", "the", "types", "that", "this", "generator", "can", "handle", ".", "The", "intention", "is", "to", "produce", "the", "set", "of", "targets", "can", "should", "be", "used", "when", "generator", "is", "run", ".", ...
def convert_to_consumable_types (self, project, name, prop_set, sources, only_one=False): """ Attempts to convert 'source' to the types that this generator can handle. The intention is to produce the set of targets can should be used when generator is run. only_one: convert...
[ "def", "convert_to_consumable_types", "(", "self", ",", "project", ",", "name", ",", "prop_set", ",", "sources", ",", "only_one", "=", "False", ")", ":", "consumed", "=", "[", "]", "bypassed", "=", "[", "]", "missing_types", "=", "[", "]", "if", "len", ...
https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/generators.py#L485-L558
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextParagraphLayoutBox.PromoteList
(*args)
return _richtext.RichTextParagraphLayoutBox_PromoteList(*args)
PromoteList(self, int promoteBy, RichTextRange range, wxRichTextListStyleDefinition def=None, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel=-1) -> bool PromoteList(self, int promoteBy, RichTextRange range, String defName, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, ...
PromoteList(self, int promoteBy, RichTextRange range, wxRichTextListStyleDefinition def=None, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel=-1) -> bool PromoteList(self, int promoteBy, RichTextRange range, String defName, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, ...
[ "PromoteList", "(", "self", "int", "promoteBy", "RichTextRange", "range", "wxRichTextListStyleDefinition", "def", "=", "None", "int", "flags", "=", "RICHTEXT_SETSTYLE_WITH_UNDO", "int", "specifiedLevel", "=", "-", "1", ")", "-", ">", "bool", "PromoteList", "(", "s...
def PromoteList(*args): """ PromoteList(self, int promoteBy, RichTextRange range, wxRichTextListStyleDefinition def=None, int flags=RICHTEXT_SETSTYLE_WITH_UNDO, int specifiedLevel=-1) -> bool PromoteList(self, int promoteBy, RichTextRange range, String defName, ...
[ "def", "PromoteList", "(", "*", "args", ")", ":", "return", "_richtext", ".", "RichTextParagraphLayoutBox_PromoteList", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L1779-L1787
tuttleofx/TuttleOFX
36fc4cae15092a84ea8c29b9c6658c7cabfadb6e
applications/example/pythonBinding/demo_progress_handle.py
python
ProgressHandle.beginSequence
(self)
Called before the beginning of the process
Called before the beginning of the process
[ "Called", "before", "the", "beginning", "of", "the", "process" ]
def beginSequence(self): """ Called before the beginning of the process """ if self.callback: self.callback() print "---> beginSequence"
[ "def", "beginSequence", "(", "self", ")", ":", "if", "self", ".", "callback", ":", "self", ".", "callback", "(", ")", "print", "\"---> beginSequence\"" ]
https://github.com/tuttleofx/TuttleOFX/blob/36fc4cae15092a84ea8c29b9c6658c7cabfadb6e/applications/example/pythonBinding/demo_progress_handle.py#L34-L40
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/calendar.py
python
TextCalendar.formatweekday
(self, day, width)
return names[day][:width].center(width)
Returns a formatted week day name.
Returns a formatted week day name.
[ "Returns", "a", "formatted", "week", "day", "name", "." ]
def formatweekday(self, day, width): """ Returns a formatted week day name. """ if width >= 9: names = day_name else: names = day_abbr return names[day][:width].center(width)
[ "def", "formatweekday", "(", "self", ",", "day", ",", "width", ")", ":", "if", "width", ">=", "9", ":", "names", "=", "day_name", "else", ":", "names", "=", "day_abbr", "return", "names", "[", "day", "]", "[", ":", "width", "]", ".", "center", "(",...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/calendar.py#L287-L295
facebook/ThreatExchange
31914a51820c73c8a0daffe62ccca29a6e3d359e
api-reference-examples/python/pytx/pytx/rtu.py
python
ListenerView.dispatch_request
(self)
return self.get_response
This must be here for the Flask View to work. We verify that we got POST data and send it to the callback function, otherwise we assume it was a GET and respond with the configured GET response.
This must be here for the Flask View to work. We verify that we got POST data and send it to the callback function, otherwise we assume it was a GET and respond with the configured GET response.
[ "This", "must", "be", "here", "for", "the", "Flask", "View", "to", "work", ".", "We", "verify", "that", "we", "got", "POST", "data", "and", "send", "it", "to", "the", "callback", "function", "otherwise", "we", "assume", "it", "was", "a", "GET", "and", ...
def dispatch_request(self): """ This must be here for the Flask View to work. We verify that we got POST data and send it to the callback function, otherwise we assume it was a GET and respond with the configured GET response. """ if request.method == 'POST': ...
[ "def", "dispatch_request", "(", "self", ")", ":", "if", "request", ".", "method", "==", "'POST'", ":", "return", "self", ".", "callback", "(", "request", "=", "request", ".", "get_json", "(", "force", "=", "True", ")", ")", "return", "self", ".", "get_...
https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/api-reference-examples/python/pytx/pytx/rtu.py#L98-L107
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/special/orthogonal.py
python
_initial_nodes_b
(n, k)
return xksq
r"""Gatteschi initial guesses Computes an initial approximation to the square of the `k`-th (positive) root :math:`x_k` of the Hermite polynomial :math:`H_n` of order :math:`n`. The formula is the one from lemma 3.2 in the original paper. The guesses are accurate in the region just below :math:`\sq...
r"""Gatteschi initial guesses
[ "r", "Gatteschi", "initial", "guesses" ]
def _initial_nodes_b(n, k): r"""Gatteschi initial guesses Computes an initial approximation to the square of the `k`-th (positive) root :math:`x_k` of the Hermite polynomial :math:`H_n` of order :math:`n`. The formula is the one from lemma 3.2 in the original paper. The guesses are accurate in the ...
[ "def", "_initial_nodes_b", "(", "n", ",", "k", ")", ":", "a", "=", "n", "%", "2", "-", "0.5", "nu", "=", "4.0", "*", "floor", "(", "n", "/", "2.0", ")", "+", "2.0", "*", "a", "+", "2.0", "# Airy roots by approximation", "ak", "=", "specfun", ".",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/orthogonal.py#L797-L834
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBTypeMember.GetBitfieldSizeInBits
(self)
return _lldb.SBTypeMember_GetBitfieldSizeInBits(self)
GetBitfieldSizeInBits(self) -> uint32_t
GetBitfieldSizeInBits(self) -> uint32_t
[ "GetBitfieldSizeInBits", "(", "self", ")", "-", ">", "uint32_t" ]
def GetBitfieldSizeInBits(self): """GetBitfieldSizeInBits(self) -> uint32_t""" return _lldb.SBTypeMember_GetBitfieldSizeInBits(self)
[ "def", "GetBitfieldSizeInBits", "(", "self", ")", ":", "return", "_lldb", ".", "SBTypeMember_GetBitfieldSizeInBits", "(", "self", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10160-L10162
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/training/input.py
python
_batch_join
(tensors_list, batch_size, keep_input, capacity=32, enqueue_many=False, shapes=None, dynamic_pad=False, allow_smaller_final_batch=False, shared_name=None, name=None)
Helper function for `batch_join` and `maybe_batch_join`.
Helper function for `batch_join` and `maybe_batch_join`.
[ "Helper", "function", "for", "batch_join", "and", "maybe_batch_join", "." ]
def _batch_join(tensors_list, batch_size, keep_input, capacity=32, enqueue_many=False, shapes=None, dynamic_pad=False, allow_smaller_final_batch=False, shared_name=None, name=None): """Helper function for `batch_join` and `maybe_batch_join`.""" if context.in_eager_mode(): raise V...
[ "def", "_batch_join", "(", "tensors_list", ",", "batch_size", ",", "keep_input", ",", "capacity", "=", "32", ",", "enqueue_many", "=", "False", ",", "shapes", "=", "None", ",", "dynamic_pad", "=", "False", ",", "allow_smaller_final_batch", "=", "False", ",", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/training/input.py#L726-L756
rbgirshick/caffe-fast-rcnn
28a579eaf0668850705598b3075b8969f22226d9
python/caffe/io.py
python
Transformer.set_mean
(self, in_, mean)
Set the mean to subtract for centering the data. Parameters ---------- in_ : which input to assign this mean. mean : mean ndarray (input dimensional or broadcastable)
Set the mean to subtract for centering the data.
[ "Set", "the", "mean", "to", "subtract", "for", "centering", "the", "data", "." ]
def set_mean(self, in_, mean): """ Set the mean to subtract for centering the data. Parameters ---------- in_ : which input to assign this mean. mean : mean ndarray (input dimensional or broadcastable) """ self.__check_input(in_) ms = mean.shape ...
[ "def", "set_mean", "(", "self", ",", "in_", ",", "mean", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "ms", "=", "mean", ".", "shape", "if", "mean", ".", "ndim", "==", "1", ":", "# broadcast channels", "if", "ms", "[", "0", "]", "!=", ...
https://github.com/rbgirshick/caffe-fast-rcnn/blob/28a579eaf0668850705598b3075b8969f22226d9/python/caffe/io.py#L232-L256
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/__init__.py
python
tempdir
()
return getenv('TMPDIR', getenv('TEMP', getenv('TMP', '/tmp')))
Return the default temorary directory.
Return the default temorary directory.
[ "Return", "the", "default", "temorary", "directory", "." ]
def tempdir(): """ Return the default temorary directory. """ from os import getenv return getenv('TMPDIR', getenv('TEMP', getenv('TMP', '/tmp')))
[ "def", "tempdir", "(", ")", ":", "from", "os", "import", "getenv", "return", "getenv", "(", "'TMPDIR'", ",", "getenv", "(", "'TEMP'", ",", "getenv", "(", "'TMP'", ",", "'/tmp'", ")", ")", ")" ]
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/tools/scan-build-py/libscanbuild/__init__.py#L33-L37
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/ftplib.py
python
FTP.acct
(self, password)
return self.voidcmd(cmd)
Send new account name.
Send new account name.
[ "Send", "new", "account", "name", "." ]
def acct(self, password): '''Send new account name.''' cmd = 'ACCT ' + password return self.voidcmd(cmd)
[ "def", "acct", "(", "self", ",", "password", ")", ":", "cmd", "=", "'ACCT '", "+", "password", "return", "self", ".", "voidcmd", "(", "cmd", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/ftplib.py#L548-L551
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/sessions.py
python
Session.merge_environment_settings
(self, url, proxies, stream, verify, cert)
return {'verify': verify, 'proxies': proxies, 'stream': stream, 'cert': cert}
Check the environment and merge it with some settings. :rtype: dict
Check the environment and merge it with some settings.
[ "Check", "the", "environment", "and", "merge", "it", "with", "some", "settings", "." ]
def merge_environment_settings(self, url, proxies, stream, verify, cert): """ Check the environment and merge it with some settings. :rtype: dict """ # Gather clues from the surrounding environment. if self.trust_env: # Set environment's proxies. ...
[ "def", "merge_environment_settings", "(", "self", ",", "url", ",", "proxies", ",", "stream", ",", "verify", ",", "cert", ")", ":", "# Gather clues from the surrounding environment.", "if", "self", ".", "trust_env", ":", "# Set environment's proxies.", "no_proxy", "=",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/common-code/lib/requests/sessions.py#L687-L714
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/configloader.py
python
build_profile_map
(parsed_ini_config)
return final_config
Convert the parsed INI config into a profile map. The config file format requires that every profile except the default to be prepended with "profile", e.g.:: [profile test] aws_... = foo aws_... = bar [profile bar] aws_... = foo aws_... = bar # This i...
Convert the parsed INI config into a profile map.
[ "Convert", "the", "parsed", "INI", "config", "into", "a", "profile", "map", "." ]
def build_profile_map(parsed_ini_config): """Convert the parsed INI config into a profile map. The config file format requires that every profile except the default to be prepended with "profile", e.g.:: [profile test] aws_... = foo aws_... = bar [profile bar] aws_...
[ "def", "build_profile_map", "(", "parsed_ini_config", ")", ":", "parsed_config", "=", "copy", ".", "deepcopy", "(", "parsed_ini_config", ")", "profiles", "=", "{", "}", "final_config", "=", "{", "}", "for", "key", ",", "values", "in", "parsed_config", ".", "...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/configloader.py#L202-L272
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/gyp/pylib/gyp/generator/android.py
python
AndroidMkWriter.WriteCopies
(self, copies, extra_outputs)
Write Makefile code for any 'copies' from the gyp input. extra_outputs: a list that will be filled in with any outputs of this action (used to make other pieces dependent on this action)
Write Makefile code for any 'copies' from the gyp input.
[ "Write", "Makefile", "code", "for", "any", "copies", "from", "the", "gyp", "input", "." ]
def WriteCopies(self, copies, extra_outputs): """Write Makefile code for any 'copies' from the gyp input. extra_outputs: a list that will be filled in with any outputs of this action (used to make other pieces dependent on this action) """ self.WriteLn('### Generated for copy rule.')...
[ "def", "WriteCopies", "(", "self", ",", "copies", ",", "extra_outputs", ")", ":", "self", ".", "WriteLn", "(", "'### Generated for copy rule.'", ")", "variable", "=", "make", ".", "StringToMakefileVariable", "(", "self", ".", "relative_target", "+", "'_copies'", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/gyp/pylib/gyp/generator/android.py#L416-L453
moderngl/moderngl
32fe79927e02b0fa893b3603d677bdae39771e14
moderngl/context.py
python
Context.depth_func
(self)
int: Set the default depth func. The depth function is set using a string. Example:: ctx.depth_func = '<=' # GL_LEQUAL ctx.depth_func = '<' # GL_LESS ctx.depth_func = '>=' # GL_GEQUAL ctx.depth_func = '>' # GL_GREATER ...
int: Set the default depth func. The depth function is set using a string.
[ "int", ":", "Set", "the", "default", "depth", "func", ".", "The", "depth", "function", "is", "set", "using", "a", "string", "." ]
def depth_func(self) -> str: ''' int: Set the default depth func. The depth function is set using a string. Example:: ctx.depth_func = '<=' # GL_LEQUAL ctx.depth_func = '<' # GL_LESS ctx.depth_func = '>=' # GL_GEQUAL ...
[ "def", "depth_func", "(", "self", ")", "->", "str", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/moderngl/moderngl/blob/32fe79927e02b0fa893b3603d677bdae39771e14/moderngl/context.py#L353-L370
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/richtext.py
python
TextAttrBorder.HasColour
(*args, **kwargs)
return _richtext.TextAttrBorder_HasColour(*args, **kwargs)
HasColour(self) -> bool
HasColour(self) -> bool
[ "HasColour", "(", "self", ")", "-", ">", "bool" ]
def HasColour(*args, **kwargs): """HasColour(self) -> bool""" return _richtext.TextAttrBorder_HasColour(*args, **kwargs)
[ "def", "HasColour", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "TextAttrBorder_HasColour", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/richtext.py#L390-L392
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/Paste/paste/util/intset.py
python
IntSet.len
(self)
return rlen
Returns the length of this integer set as an integer. In case the length is infinite, returns -1. This function exists because of a limitation of the builtin len() function which expects values in the range 0 <= len < 2**31. Use this function in case your integer set might be larger.
Returns the length of this integer set as an integer. In case the length is infinite, returns -1. This function exists because of a limitation of the builtin len() function which expects values in the range 0 <= len < 2**31. Use this function in case your integer set might be larger.
[ "Returns", "the", "length", "of", "this", "integer", "set", "as", "an", "integer", ".", "In", "case", "the", "length", "is", "infinite", "returns", "-", "1", ".", "This", "function", "exists", "because", "of", "a", "limitation", "of", "the", "builtin", "...
def len(self): """Returns the length of this integer set as an integer. In case the length is infinite, returns -1. This function exists because of a limitation of the builtin len() function which expects values in the range 0 <= len < 2**31. Use this function in case your integer ...
[ "def", "len", "(", "self", ")", ":", "if", "not", "self", ".", "_ranges", ":", "return", "0", "if", "self", ".", "_ranges", "[", "0", "]", "[", "0", "]", "is", "_MININF", "or", "self", ".", "_ranges", "[", "-", "1", "]", "[", "1", "]", "is", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/Paste/paste/util/intset.py#L424-L438
SpaceNetChallenge/BuildingDetectors
3def3c44b5847c744cd2f3356182892d92496579
qinhaifang/src/caffe-mnc/python/caffe/pycaffe.py
python
_Net_blobs
(self)
return OrderedDict(zip(self._blob_names, self._blobs))
An OrderedDict (bottom to top, i.e., input to output) of network blobs indexed by name
An OrderedDict (bottom to top, i.e., input to output) of network blobs indexed by name
[ "An", "OrderedDict", "(", "bottom", "to", "top", "i", ".", "e", ".", "input", "to", "output", ")", "of", "network", "blobs", "indexed", "by", "name" ]
def _Net_blobs(self): """ An OrderedDict (bottom to top, i.e., input to output) of network blobs indexed by name """ return OrderedDict(zip(self._blob_names, self._blobs))
[ "def", "_Net_blobs", "(", "self", ")", ":", "return", "OrderedDict", "(", "zip", "(", "self", ".", "_blob_names", ",", "self", ".", "_blobs", ")", ")" ]
https://github.com/SpaceNetChallenge/BuildingDetectors/blob/3def3c44b5847c744cd2f3356182892d92496579/qinhaifang/src/caffe-mnc/python/caffe/pycaffe.py#L23-L28
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py
python
qa_ofdm_frame_equalizer_vcvc.test_001c_carrier_offset_no_cp
(self)
Same as before, but put a carrier offset in there
Same as before, but put a carrier offset in there
[ "Same", "as", "before", "but", "put", "a", "carrier", "offset", "in", "there" ]
def test_001c_carrier_offset_no_cp(self): """ Same as before, but put a carrier offset in there """ fft_len = 8 cp_len = 0 n_syms = 1 carr_offset = 1 occupied_carriers = ((-2, -1, 1, 2),) tx_data = ( 0, 0, 0, -1j, -1j, 0, -1j, -1j, ...
[ "def", "test_001c_carrier_offset_no_cp", "(", "self", ")", ":", "fft_len", "=", "8", "cp_len", "=", "0", "n_syms", "=", "1", "carr_offset", "=", "1", "occupied_carriers", "=", "(", "(", "-", "2", ",", "-", "1", ",", "1", ",", "2", ")", ",", ")", "t...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/gr-digital/python/digital/qa_ofdm_frame_equalizer_vcvc.py#L103-L145
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/training/saver.py
python
Saver.from_proto
(saver_def)
return Saver(saver_def=saver_def)
Returns a `Saver` object created from `saver_def`.
Returns a `Saver` object created from `saver_def`.
[ "Returns", "a", "Saver", "object", "created", "from", "saver_def", "." ]
def from_proto(saver_def): """Returns a `Saver` object created from `saver_def`.""" return Saver(saver_def=saver_def)
[ "def", "from_proto", "(", "saver_def", ")", ":", "return", "Saver", "(", "saver_def", "=", "saver_def", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/training/saver.py#L968-L970
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
third_party/mbedtls/repo/scripts/assemble_changelog.py
python
ChangelogFormat.format_category
(cls, title, body)
Construct the text of a category section from its title and body.
Construct the text of a category section from its title and body.
[ "Construct", "the", "text", "of", "a", "category", "section", "from", "its", "title", "and", "body", "." ]
def format_category(cls, title, body): """Construct the text of a category section from its title and body.""" raise NotImplementedError
[ "def", "format_category", "(", "cls", ",", "title", ",", "body", ")", ":", "raise", "NotImplementedError" ]
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/third_party/mbedtls/repo/scripts/assemble_changelog.py#L115-L117
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py
python
SdcaModel._l2_loss
(self, l2)
Computes the (un-normalized) l2 loss of the model.
Computes the (un-normalized) l2 loss of the model.
[ "Computes", "the", "(", "un", "-", "normalized", ")", "l2", "loss", "of", "the", "model", "." ]
def _l2_loss(self, l2): """Computes the (un-normalized) l2 loss of the model.""" with name_scope('l2_loss'): sum = 0.0 for name in ['sparse_features_weights', 'dense_features_weights']: for weights in self._convert_n_to_tensor(self._variables[name]): sum += math_ops.reduce_sum(math...
[ "def", "_l2_loss", "(", "self", ",", "l2", ")", ":", "with", "name_scope", "(", "'l2_loss'", ")", ":", "sum", "=", "0.0", "for", "name", "in", "[", "'sparse_features_weights'", ",", "'dense_features_weights'", "]", ":", "for", "weights", "in", "self", ".",...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py#L408-L416
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py
python
RefVariable.assign_sub
(self, delta, use_locking=False, name=None, read_value=True)
return assign.op
Subtracts a value from this variable. This is essentially a shortcut for `assign_sub(self, delta)`. Args: delta: A `Tensor`. The value to subtract from this variable. use_locking: If `True`, use locking during the operation. name: The name of the operation to be created read_value: if ...
Subtracts a value from this variable.
[ "Subtracts", "a", "value", "from", "this", "variable", "." ]
def assign_sub(self, delta, use_locking=False, name=None, read_value=True): """Subtracts a value from this variable. This is essentially a shortcut for `assign_sub(self, delta)`. Args: delta: A `Tensor`. The value to subtract from this variable. use_locking: If `True`, use locking during the o...
[ "def", "assign_sub", "(", "self", ",", "delta", ",", "use_locking", "=", "False", ",", "name", "=", "None", ",", "read_value", "=", "True", ")", ":", "assign", "=", "state_ops", ".", "assign_sub", "(", "self", ".", "_variable", ",", "delta", ",", "use_...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/variables.py#L2094-L2114
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/command/build_src.py
python
build_src.pyrex_sources
(self, sources, extension)
return new_sources
Pyrex not supported; this remains for Cython support (see below)
Pyrex not supported; this remains for Cython support (see below)
[ "Pyrex", "not", "supported", ";", "this", "remains", "for", "Cython", "support", "(", "see", "below", ")" ]
def pyrex_sources(self, sources, extension): """Pyrex not supported; this remains for Cython support (see below)""" new_sources = [] ext_name = extension.name.split('.')[-1] for source in sources: (base, ext) = os.path.splitext(source) if ext == '.pyx': ...
[ "def", "pyrex_sources", "(", "self", ",", "sources", ",", "extension", ")", ":", "new_sources", "=", "[", "]", "ext_name", "=", "extension", ".", "name", ".", "split", "(", "'.'", ")", "[", "-", "1", "]", "for", "source", "in", "sources", ":", "(", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numpy/distutils/command/build_src.py#L445-L458
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
caffe2/python/workspace.py
python
ApplyTransform
(transform_key, net)
return transformed_net
Apply a Transform to a NetDef protobuf object, and returns the new transformed NetDef. Inputs: transform_key: the name of the transform, as it is stored in the registry net: a NetDef protobuf object Returns: Transformed NetDef protobuf object.
Apply a Transform to a NetDef protobuf object, and returns the new transformed NetDef.
[ "Apply", "a", "Transform", "to", "a", "NetDef", "protobuf", "object", "and", "returns", "the", "new", "transformed", "NetDef", "." ]
def ApplyTransform(transform_key, net): """Apply a Transform to a NetDef protobuf object, and returns the new transformed NetDef. Inputs: transform_key: the name of the transform, as it is stored in the registry net: a NetDef protobuf object Returns: Transformed NetDef protobuf object...
[ "def", "ApplyTransform", "(", "transform_key", ",", "net", ")", ":", "transformed_net", "=", "caffe2_pb2", ".", "NetDef", "(", ")", "transformed_str", "=", "C", ".", "apply_transform", "(", "str", "(", "transform_key", ")", ".", "encode", "(", "'utf-8'", ")"...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/caffe2/python/workspace.py#L462-L478
tum-vision/fusenet
a1451be2971b348a01b0f525c2a3a7a0e215a591
scripts/cpp_lint.py
python
CheckInvalidIncrement
(filename, clean_lines, linenum, error)
Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ or *count += 1. Args: filename: The name of the current file. ...
Checks for invalid increment *count++.
[ "Checks", "for", "invalid", "increment", "*", "count", "++", "." ]
def CheckInvalidIncrement(filename, clean_lines, linenum, error): """Checks for invalid increment *count++. For example following function: void increment_counter(int* count) { *count++; } is invalid, because it effectively does count++, moving pointer, and should be replaced with ++*count, (*count)++ ...
[ "def", "CheckInvalidIncrement", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "if", "_RE_PATTERN_INVALID_INCREMENT", ".", "match", "(", "line", ")", ":", "error", ...
https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/scripts/cpp_lint.py#L1733-L1752
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/feature_selection/mutual_info_.py
python
_compute_mi_cc
(x, y, n_neighbors)
return max(0, mi)
Compute mutual information between two continuous variables. Parameters ---------- x, y : ndarray, shape (n_samples,) Samples of two continuous random variables, must have an identical shape. n_neighbors : int Number of nearest neighbors to search for each point, see [1]_. ...
Compute mutual information between two continuous variables.
[ "Compute", "mutual", "information", "between", "two", "continuous", "variables", "." ]
def _compute_mi_cc(x, y, n_neighbors): """Compute mutual information between two continuous variables. Parameters ---------- x, y : ndarray, shape (n_samples,) Samples of two continuous random variables, must have an identical shape. n_neighbors : int Number of nearest neig...
[ "def", "_compute_mi_cc", "(", "x", ",", "y", ",", "n_neighbors", ")", ":", "n_samples", "=", "x", ".", "size", "x", "=", "x", ".", "reshape", "(", "(", "-", "1", ",", "1", ")", ")", "y", "=", "y", ".", "reshape", "(", "(", "-", "1", ",", "1...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/feature_selection/mutual_info_.py#L18-L76
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
llvm/utils/benchmark/mingw.py
python
root
(location = None, arch = None, version = None, threading = None, exceptions = None, revision = None, log = EmptyLogger())
return root_dir
Returns the root folder of a specific version of the mingw-builds variant of gcc. Will download the compiler if needed
Returns the root folder of a specific version of the mingw-builds variant of gcc. Will download the compiler if needed
[ "Returns", "the", "root", "folder", "of", "a", "specific", "version", "of", "the", "mingw", "-", "builds", "variant", "of", "gcc", ".", "Will", "download", "the", "compiler", "if", "needed" ]
def root(location = None, arch = None, version = None, threading = None, exceptions = None, revision = None, log = EmptyLogger()): ''' Returns the root folder of a specific version of the mingw-builds variant of gcc. Will download the compiler if needed ''' # Get the repository if we don't ...
[ "def", "root", "(", "location", "=", "None", ",", "arch", "=", "None", ",", "version", "=", "None", ",", "threading", "=", "None", ",", "exceptions", "=", "None", ",", "revision", "=", "None", ",", "log", "=", "EmptyLogger", "(", ")", ")", ":", "# ...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/llvm/utils/benchmark/mingw.py#L172-L246
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/orchestrator/module.py
python
OrchestratorCli._daemon_action_redeploy
(self, name: str, image: Optional[str] = None)
return HandleCommandResult(stdout=completion.result_str())
Redeploy a daemon (with a specifc image)
Redeploy a daemon (with a specifc image)
[ "Redeploy", "a", "daemon", "(", "with", "a", "specifc", "image", ")" ]
def _daemon_action_redeploy(self, name: str, image: Optional[str] = None) -> HandleCommandResult: """Redeploy a daemon (with a specifc image)""" if '.' not in name: raise OrchestratorError('%s is not a valid daemon name' % name)...
[ "def", "_daemon_action_redeploy", "(", "self", ",", "name", ":", "str", ",", "image", ":", "Optional", "[", "str", "]", "=", "None", ")", "->", "HandleCommandResult", ":", "if", "'.'", "not", "in", "name", ":", "raise", "OrchestratorError", "(", "'%s is no...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/orchestrator/module.py#L966-L974
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/io/pytables.py
python
DataCol.set_metadata
(self, metadata)
record the metadata
record the metadata
[ "record", "the", "metadata" ]
def set_metadata(self, metadata): """ record the metadata """ if metadata is not None: metadata = np.array(metadata, copy=False).ravel() self.metadata = metadata
[ "def", "set_metadata", "(", "self", ",", "metadata", ")", ":", "if", "metadata", "is", "not", "None", ":", "metadata", "=", "np", ".", "array", "(", "metadata", ",", "copy", "=", "False", ")", ".", "ravel", "(", ")", "self", ".", "metadata", "=", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/pytables.py#L1917-L1921
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/symsrc/pefile.py
python
PE.set_word_at_offset
(self, offset, word)
return self.set_bytes_at_offset(offset, self.get_data_from_word(word))
Set the word value at the given file offset.
Set the word value at the given file offset.
[ "Set", "the", "word", "value", "at", "the", "given", "file", "offset", "." ]
def set_word_at_offset(self, offset, word): """Set the word value at the given file offset.""" return self.set_bytes_at_offset(offset, self.get_data_from_word(word))
[ "def", "set_word_at_offset", "(", "self", ",", "offset", ",", "word", ")", ":", "return", "self", ".", "set_bytes_at_offset", "(", "offset", ",", "self", ".", "get_data_from_word", "(", "word", ")", ")" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/symsrc/pefile.py#L3497-L3499
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py
python
cleanupCharEncodingHandlers
()
Cleanup the memory allocated for the char encoding support, it unregisters all the encoding handlers and the aliases.
Cleanup the memory allocated for the char encoding support, it unregisters all the encoding handlers and the aliases.
[ "Cleanup", "the", "memory", "allocated", "for", "the", "char", "encoding", "support", "it", "unregisters", "all", "the", "encoding", "handlers", "and", "the", "aliases", "." ]
def cleanupCharEncodingHandlers(): """Cleanup the memory allocated for the char encoding support, it unregisters all the encoding handlers and the aliases. """ libxml2mod.xmlCleanupCharEncodingHandlers()
[ "def", "cleanupCharEncodingHandlers", "(", ")", ":", "libxml2mod", ".", "xmlCleanupCharEncodingHandlers", "(", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L1116-L1119
Project-OSRM/osrm-backend
f2e284623e25b5570dd2a5e6985abcb3790fd348
third_party/flatbuffers/conanfile.py
python
FlatbuffersConan.build
(self)
Configure, build and install FlatBuffers using CMake.
Configure, build and install FlatBuffers using CMake.
[ "Configure", "build", "and", "install", "FlatBuffers", "using", "CMake", "." ]
def build(self): """Configure, build and install FlatBuffers using CMake. """ cmake = self.configure_cmake() cmake.build()
[ "def", "build", "(", "self", ")", ":", "cmake", "=", "self", ".", "configure_cmake", "(", ")", "cmake", ".", "build", "(", ")" ]
https://github.com/Project-OSRM/osrm-backend/blob/f2e284623e25b5570dd2a5e6985abcb3790fd348/third_party/flatbuffers/conanfile.py#L48-L52
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Node/FS.py
python
FileBuildInfo.prepare_dependencies
(self)
Prepares a FileBuildInfo object for explaining what changed The bsources, bdepends and bimplicit lists have all been stored on disk as paths relative to the top-level SConstruct directory. Convert the strings to actual Nodes (for use by the --debug=explain code and --implicit-cache).
Prepares a FileBuildInfo object for explaining what changed
[ "Prepares", "a", "FileBuildInfo", "object", "for", "explaining", "what", "changed" ]
def prepare_dependencies(self): """ Prepares a FileBuildInfo object for explaining what changed The bsources, bdepends and bimplicit lists have all been stored on disk as paths relative to the top-level SConstruct directory. Convert the strings to actual Nodes (for use by the ...
[ "def", "prepare_dependencies", "(", "self", ")", ":", "attrs", "=", "[", "(", "'bsources'", ",", "'bsourcesigs'", ")", ",", "(", "'bdepends'", ",", "'bdependsigs'", ")", ",", "(", "'bimplicit'", ",", "'bimplicitsigs'", ")", ",", "]", "for", "(", "nattr", ...
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/Node/FS.py#L2534-L2561
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/extern/pubsub.py
python
_getCallableName
(callable)
Get name for a callable, ie function, bound method or callable instance
Get name for a callable, ie function, bound method or callable instance
[ "Get", "name", "for", "a", "callable", "ie", "function", "bound", "method", "or", "callable", "instance" ]
def _getCallableName(callable): """Get name for a callable, ie function, bound method or callable instance""" if ismethod(callable): return '%s.%s ' % (callable.im_self, callable.im_func.func_name) elif isfunction(callable): return '%s ' % callable.__name__ else: return '%s ...
[ "def", "_getCallableName", "(", "callable", ")", ":", "if", "ismethod", "(", "callable", ")", ":", "return", "'%s.%s '", "%", "(", "callable", ".", "im_self", ",", "callable", ".", "im_func", ".", "func_name", ")", "elif", "isfunction", "(", "callable", ")...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/extern/pubsub.py#L113-L121
keyboardio/Kaleidoscope
d59604e98b2439d108647f15be52984a6837d360
bin/cpplint.py
python
CheckMakePairUsesDeduction
(filename, clean_lines, linenum, error)
Check that make_pair's template arguments are deduced. G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are specified explicitly, and such use isn't intended in any case. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linen...
Check that make_pair's template arguments are deduced.
[ "Check", "that", "make_pair", "s", "template", "arguments", "are", "deduced", "." ]
def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): """Check that make_pair's template arguments are deduced. G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are specified explicitly, and such use isn't intended in any case. Args: filename: The name of the current fi...
[ "def", "CheckMakePairUsesDeduction", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "match", "=", "_RE_PATTERN_EXPLICIT_MAKEPAIR", ".", "search", "(", "line", ")", "i...
https://github.com/keyboardio/Kaleidoscope/blob/d59604e98b2439d108647f15be52984a6837d360/bin/cpplint.py#L5855-L5873
trilinos/Trilinos
6168be6dd51e35e1cd681e9c4b24433e709df140
packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py
python
PhactoriImagesetBlock.WriteImagesPassedOnOffFilter
(self, datadescription)
write out the .png/.jpg/whatever images associated with this imageset block for the current timestep/state. Must loop through camera angles and do a write for each one if necessary
write out the .png/.jpg/whatever images associated with this imageset block for the current timestep/state. Must loop through camera angles and do a write for each one if necessary
[ "write", "out", "the", ".", "png", "/", ".", "jpg", "/", "whatever", "images", "associated", "with", "this", "imageset", "block", "for", "the", "current", "timestep", "/", "state", ".", "Must", "loop", "through", "camera", "angles", "and", "do", "a", "wr...
def WriteImagesPassedOnOffFilter(self, datadescription): """write out the .png/.jpg/whatever images associated with this imageset block for the current timestep/state. Must loop through camera angles and do a write for each one if necessary""" global gPipeAndViewsState if PhactoriDbg(100): ...
[ "def", "WriteImagesPassedOnOffFilter", "(", "self", ",", "datadescription", ")", ":", "global", "gPipeAndViewsState", "if", "PhactoriDbg", "(", "100", ")", ":", "myDebugPrint3", "(", "\"PhactoriImagesetBlock::WriteImagesPassedOnOffFilter entered\\n\"", ")", "for", "ii", "...
https://github.com/trilinos/Trilinos/blob/6168be6dd51e35e1cd681e9c4b24433e709df140/packages/seacas/libraries/ioss/src/visualization/catalyst/phactori/phactori.py#L9527-L9690
nasa/astrobee
9241e67e6692810d6e275abb3165b6d02f4ca5ef
scripts/git/cpplint.py
python
FileInfo.Split
(self)
return (project,) + os.path.splitext(rest)
Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension).
Splits the file into the directory, basename, and extension.
[ "Splits", "the", "file", "into", "the", "directory", "basename", "and", "extension", "." ]
def Split(self): """Splits the file into the directory, basename, and extension. For 'chrome/browser/browser.cc', Split() would return ('chrome/browser', 'browser', '.cc') Returns: A tuple of (directory, basename, extension). """ googlename = self.RepositoryN...
[ "def", "Split", "(", "self", ")", ":", "googlename", "=", "self", ".", "RepositoryName", "(", ")", "project", ",", "rest", "=", "os", ".", "path", ".", "split", "(", "googlename", ")", "return", "(", "project", ",", ")", "+", "os", ".", "path", "."...
https://github.com/nasa/astrobee/blob/9241e67e6692810d6e275abb3165b6d02f4ca5ef/scripts/git/cpplint.py#L1078-L1090
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/linear_model/_logistic.py
python
LogisticRegression.fit
(self, X, y, sample_weight=None)
return self
Fit the model according to the given training data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Training vector, where n_samples is the number of samples and n_features is the number of features. y : array-like of shape...
Fit the model according to the given training data.
[ "Fit", "the", "model", "according", "to", "the", "given", "training", "data", "." ]
def fit(self, X, y, sample_weight=None): """ Fit the model according to the given training data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) Training vector, where n_samples is the number of samples and n_feature...
[ "def", "fit", "(", "self", ",", "X", ",", "y", ",", "sample_weight", "=", "None", ")", ":", "solver", "=", "_check_solver", "(", "self", ".", "solver", ",", "self", ".", "penalty", ",", "self", ".", "dual", ")", "if", "not", "isinstance", "(", "sel...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/linear_model/_logistic.py#L1459-L1617
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/pathlib.py
python
PurePath.relative_to
(self, *other)
return self._from_parsed_parts('', root if n == 1 else '', abs_parts[n:])
Return the relative path to another path identified by the passed arguments. If the operation is not possible (because this is not a subpath of the other path), raise ValueError.
Return the relative path to another path identified by the passed arguments. If the operation is not possible (because this is not a subpath of the other path), raise ValueError.
[ "Return", "the", "relative", "path", "to", "another", "path", "identified", "by", "the", "passed", "arguments", ".", "If", "the", "operation", "is", "not", "possible", "(", "because", "this", "is", "not", "a", "subpath", "of", "the", "other", "path", ")", ...
def relative_to(self, *other): """Return the relative path to another path identified by the passed arguments. If the operation is not possible (because this is not a subpath of the other path), raise ValueError. """ # For the purpose of this method, drive and root are considere...
[ "def", "relative_to", "(", "self", ",", "*", "other", ")", ":", "# For the purpose of this method, drive and root are considered", "# separate parts, i.e.:", "# Path('c:/').relative_to('c:') gives Path('/')", "# Path('c:/').relative_to('/') raise ValueError", "if", "not", "other...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/pathlib.py#L872-L902
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/control_flow_ops.py
python
ControlFlowState.ZerosLikeForExit
(self, val)
return result
Create zeros_like gradient for a loop exit. If the result of a loop variable is not used but is involved in computing the result of some needed loop variable, we create a zero-valued tensor that is fed as gradient for the Exit node of that loop variable. Note that val.op is an Exit, and this method mus...
Create zeros_like gradient for a loop exit.
[ "Create", "zeros_like", "gradient", "for", "a", "loop", "exit", "." ]
def ZerosLikeForExit(self, val): """Create zeros_like gradient for a loop exit. If the result of a loop variable is not used but is involved in computing the result of some needed loop variable, we create a zero-valued tensor that is fed as gradient for the Exit node of that loop variable. Note tha...
[ "def", "ZerosLikeForExit", "(", "self", ",", "val", ")", ":", "val_shape", "=", "val", ".", "get_shape", "(", ")", "forward_ctxt", "=", "val", ".", "op", ".", "_get_control_flow_context", "(", ")", "outer_forward_ctxt", "=", "forward_ctxt", ".", "outer_context...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/control_flow_ops.py#L1137-L1190
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/distributions/util.py
python
log_combinations
(n, counts, name="log_combinations")
Multinomial coefficient. Given `n` and `counts`, where `counts` has last dimension `k`, we compute the multinomial coefficient as: ```n! / sum_i n_i!``` where `i` runs over all `k` classes. Args: n: Floating-point `Tensor` broadcastable with `counts`. This represents `n` outcomes. counts: Fl...
Multinomial coefficient.
[ "Multinomial", "coefficient", "." ]
def log_combinations(n, counts, name="log_combinations"): """Multinomial coefficient. Given `n` and `counts`, where `counts` has last dimension `k`, we compute the multinomial coefficient as: ```n! / sum_i n_i!``` where `i` runs over all `k` classes. Args: n: Floating-point `Tensor` broadcastable wi...
[ "def", "log_combinations", "(", "n", ",", "counts", ",", "name", "=", "\"log_combinations\"", ")", ":", "# First a bit about the number of ways counts could have come in:", "# E.g. if counts = [1, 2], then this is 3 choose 2.", "# In general, this is (sum counts)! / sum(counts!)", "# T...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/distributions/util.py#L487-L518
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/cr/cr/base/host.py
python
Host.Matches
(self)
return False
Detects whether this is the correct host implementation. This method is overridden by the concrete implementations. Returns: true if the plugin matches the machine it is running on.
Detects whether this is the correct host implementation.
[ "Detects", "whether", "this", "is", "the", "correct", "host", "implementation", "." ]
def Matches(self): """Detects whether this is the correct host implementation. This method is overridden by the concrete implementations. Returns: true if the plugin matches the machine it is running on. """ return False
[ "def", "Matches", "(", "self", ")", ":", "return", "False" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/cr/cr/base/host.py#L29-L36
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/perf/profile_creators/profile_safe_url_list.py
python
GetSafeUrls
()
Returns a list of safe urls by loading them from a pre-generated file.
Returns a list of safe urls by loading them from a pre-generated file.
[ "Returns", "a", "list", "of", "safe", "urls", "by", "loading", "them", "from", "a", "pre", "-", "generated", "file", "." ]
def GetSafeUrls(): """Returns a list of safe urls by loading them from a pre-generated file.""" safe_url_dir = os.path.dirname(os.path.realpath(__file__)) safe_url_path = os.path.join(safe_url_dir, "profile_safe_url_list.json") with open(safe_url_path, "r") as safe_url_file: return json.load(safe_url_file)
[ "def", "GetSafeUrls", "(", ")", ":", "safe_url_dir", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "realpath", "(", "__file__", ")", ")", "safe_url_path", "=", "os", ".", "path", ".", "join", "(", "safe_url_dir", ",", "\"profile_...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/perf/profile_creators/profile_safe_url_list.py#L21-L26
RobotLocomotion/drake
0e18a34604c45ed65bc9018a54f7610f91cdad5b
tools/lint/drakelint.py
python
_check_unguarded_openmp_uses
(filename)
return 0
Return 0 if all OpenMP uses in @p filename are properly guarded by #if defined(_OPENMP), and 1 otherwise.
Return 0 if all OpenMP uses in
[ "Return", "0", "if", "all", "OpenMP", "uses", "in" ]
def _check_unguarded_openmp_uses(filename): """Return 0 if all OpenMP uses in @p filename are properly guarded by #if defined(_OPENMP), and 1 otherwise. """ openmp_include = "#include <omp.h>" openmp_pragma = "#pragma omp" openmp_pre_guard = "#if defined(_OPENMP)" openmp_post_guard = "#endi...
[ "def", "_check_unguarded_openmp_uses", "(", "filename", ")", ":", "openmp_include", "=", "\"#include <omp.h>\"", "openmp_pragma", "=", "\"#pragma omp\"", "openmp_pre_guard", "=", "\"#if defined(_OPENMP)\"", "openmp_post_guard", "=", "\"#endif\"", "with", "open", "(", "filen...
https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/lint/drakelint.py#L7-L35
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/special/basic.py
python
pbvv_seq
(v, x)
return dv[:n1+1], dp[:n1+1]
Parabolic cylinder functions Vv(x) and derivatives. Parameters ---------- v : float Order of the parabolic cylinder function x : float Value at which to evaluate the function and derivatives Returns ------- dv : ndarray Values of V_vi(x), for vi=v-int(v), vi=1+v-int...
Parabolic cylinder functions Vv(x) and derivatives.
[ "Parabolic", "cylinder", "functions", "Vv", "(", "x", ")", "and", "derivatives", "." ]
def pbvv_seq(v, x): """Parabolic cylinder functions Vv(x) and derivatives. Parameters ---------- v : float Order of the parabolic cylinder function x : float Value at which to evaluate the function and derivatives Returns ------- dv : ndarray Values of V_vi(x), ...
[ "def", "pbvv_seq", "(", "v", ",", "x", ")", ":", "if", "not", "(", "isscalar", "(", "v", ")", "and", "isscalar", "(", "x", ")", ")", ":", "raise", "ValueError", "(", "\"arguments must be scalars.\"", ")", "n", "=", "int", "(", "v", ")", "v0", "=", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/special/basic.py#L1588-L1622
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/tensor/linalg.py
python
norm
(x, p='fro', axis=None, keepdim=False, name=None)
Returns the matrix norm (Frobenius) or vector norm (the 1-norm, the Euclidean or 2-norm, and in general the p-norm for p > 0) of a given tensor. .. note:: This norm API is different from `numpy.linalg.norm`. This api supports high-order input tensors (rank >= 3), and certain axis need to be poi...
[]
def norm(x, p='fro', axis=None, keepdim=False, name=None): """ Returns the matrix norm (Frobenius) or vector norm (the 1-norm, the Euclidean or 2-norm, and in general the p-norm for p > 0) of a given tensor. .. note:: This norm API is different from `numpy.linalg.norm`. This api suppor...
[ "def", "norm", "(", "x", ",", "p", "=", "'fro'", ",", "axis", "=", "None", ",", "keepdim", "=", "False", ",", "name", "=", "None", ")", ":", "def", "frobenius_norm", "(", "input", ",", "dim", "=", "None", ",", "keepdim", "=", "False", ",", "name"...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/tensor/linalg.py#L164-L448
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad/grad_implementations.py
python
bprop_identity
(x, out, dout)
return (dout,)
Backpropagator for primitive `identity`.
Backpropagator for primitive `identity`.
[ "Backpropagator", "for", "primitive", "identity", "." ]
def bprop_identity(x, out, dout): """Backpropagator for primitive `identity`.""" return (dout,)
[ "def", "bprop_identity", "(", "x", ",", "out", ",", "dout", ")", ":", "return", "(", "dout", ",", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_implementations.py#L149-L151
h0x91b/redis-v8
ac8b9d49701d75bcee3719892a2a6a50b437e47a
redis/deps/v8/tools/grokdump.py
python
FullDump
(reader, heap)
Dump all available memory regions.
Dump all available memory regions.
[ "Dump", "all", "available", "memory", "regions", "." ]
def FullDump(reader, heap): """Dump all available memory regions.""" def dump_region(reader, start, size, location): print while start & 3 != 0: start += 1 size -= 1 location += 1 is_executable = reader.IsProbableExecutableRegion(location, size) is_ascii = reader.IsProbableASCIIReg...
[ "def", "FullDump", "(", "reader", ",", "heap", ")", ":", "def", "dump_region", "(", "reader", ",", "start", ",", "size", ",", "location", ")", ":", "print", "while", "start", "&", "3", "!=", "0", ":", "start", "+=", "1", "size", "-=", "1", "locatio...
https://github.com/h0x91b/redis-v8/blob/ac8b9d49701d75bcee3719892a2a6a50b437e47a/redis/deps/v8/tools/grokdump.py#L111-L165
hakuna-m/wubiuefi
caec1af0a09c78fd5a345180ada1fe45e0c63493
src/pypack/modulegraph/pkg_resources.py
python
ResourceManager.resource_filename
(self, package_or_requirement, resource_name)
return get_provider(package_or_requirement).get_resource_filename( self, resource_name )
Return a true filesystem path for specified resource
Return a true filesystem path for specified resource
[ "Return", "a", "true", "filesystem", "path", "for", "specified", "resource" ]
def resource_filename(self, package_or_requirement, resource_name): """Return a true filesystem path for specified resource""" return get_provider(package_or_requirement).get_resource_filename( self, resource_name )
[ "def", "resource_filename", "(", "self", ",", "package_or_requirement", ",", "resource_name", ")", ":", "return", "get_provider", "(", "package_or_requirement", ")", ".", "get_resource_filename", "(", "self", ",", "resource_name", ")" ]
https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/pypack/modulegraph/pkg_resources.py#L734-L738
epiqc/ScaffCC
66a79944ee4cd116b27bc1a69137276885461db8
llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py
python
WriteLLVMChecksums
(checksums, f)
Writes checksums to a text file. Args: checksums: a dict mapping from project name to project checksum (result of ComputeLLVMChecksums). f: a file object to write into.
Writes checksums to a text file.
[ "Writes", "checksums", "to", "a", "text", "file", "." ]
def WriteLLVMChecksums(checksums, f): """Writes checksums to a text file. Args: checksums: a dict mapping from project name to project checksum (result of ComputeLLVMChecksums). f: a file object to write into. """ for proj in sorted(checksums.keys()): f.write("{} {}\n".format(checksums[proj]...
[ "def", "WriteLLVMChecksums", "(", "checksums", ",", "f", ")", ":", "for", "proj", "in", "sorted", "(", "checksums", ".", "keys", "(", ")", ")", ":", "f", ".", "write", "(", "\"{} {}\\n\"", ".", "format", "(", "checksums", "[", "proj", "]", ",", "proj...
https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/llvm/utils/docker/scripts/llvm_checksum/llvm_checksum.py#L131-L141
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/eclib/ctrlbox.py
python
ControlBar.DoPaintBackground
(self, dc, rect, color, color2)
Paint the background of the given rect based on the style of the control bar. @param dc: DC to draw on @param rect: wx.Rect @param color: Pen/Base gradient color @param color2: Gradient end color
Paint the background of the given rect based on the style of the control bar. @param dc: DC to draw on @param rect: wx.Rect @param color: Pen/Base gradient color @param color2: Gradient end color
[ "Paint", "the", "background", "of", "the", "given", "rect", "based", "on", "the", "style", "of", "the", "control", "bar", ".", "@param", "dc", ":", "DC", "to", "draw", "on", "@param", "rect", ":", "wx", ".", "Rect", "@param", "color", ":", "Pen", "/"...
def DoPaintBackground(self, dc, rect, color, color2): """Paint the background of the given rect based on the style of the control bar. @param dc: DC to draw on @param rect: wx.Rect @param color: Pen/Base gradient color @param color2: Gradient end color """ ...
[ "def", "DoPaintBackground", "(", "self", ",", "dc", ",", "rect", ",", "color", ",", "color2", ")", ":", "# Paint the gradient", "if", "self", ".", "_style", "&", "CTRLBAR_STYLE_GRADIENT", ":", "if", "isinstance", "(", "dc", ",", "wx", ".", "GCDC", ")", "...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/eclib/ctrlbox.py#L507-L551
flexflow/FlexFlow
581fad8ba8d10a16a3102ee2b406b0319586df24
python/flexflow/keras/datasets/cifar10.py
python
load_data
(num_samples=40000)
return (x_train, y_train), (x_test, y_test)
Loads CIFAR10 dataset. # Returns Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`.
Loads CIFAR10 dataset.
[ "Loads", "CIFAR10", "dataset", "." ]
def load_data(num_samples=40000): """Loads CIFAR10 dataset. # Returns Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`. """ dirname = 'cifar-10-batches-py' origin = 'https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz' path = get_file(dirname, origin=origin, untar=True)...
[ "def", "load_data", "(", "num_samples", "=", "40000", ")", ":", "dirname", "=", "'cifar-10-batches-py'", "origin", "=", "'https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz'", "path", "=", "get_file", "(", "dirname", ",", "origin", "=", "origin", ",", "untar", ...
https://github.com/flexflow/FlexFlow/blob/581fad8ba8d10a16a3102ee2b406b0319586df24/python/flexflow/keras/datasets/cifar10.py#L13-L43
facebook/fboss
60063db1df37c2ec0e7dcd0955c54885ea9bf7f0
build/fbcode_builder/fbcode_builder.py
python
FBCodeBuilder.fb_github_project_workdir
(self, project_and_path, github_org="facebook")
return self.github_project_workdir(github_org + "/" + project, path)
This helper lets Facebook-internal CI special-cases FB projects
This helper lets Facebook-internal CI special-cases FB projects
[ "This", "helper", "lets", "Facebook", "-", "internal", "CI", "special", "-", "cases", "FB", "projects" ]
def fb_github_project_workdir(self, project_and_path, github_org="facebook"): "This helper lets Facebook-internal CI special-cases FB projects" project, path = project_and_path.split("/", 1) return self.github_project_workdir(github_org + "/" + project, path)
[ "def", "fb_github_project_workdir", "(", "self", ",", "project_and_path", ",", "github_org", "=", "\"facebook\"", ")", ":", "project", ",", "path", "=", "project_and_path", ".", "split", "(", "\"/\"", ",", "1", ")", "return", "self", ".", "github_project_workdir...
https://github.com/facebook/fboss/blob/60063db1df37c2ec0e7dcd0955c54885ea9bf7f0/build/fbcode_builder/fbcode_builder.py#L393-L396
libLAS/libLAS
e6a1aaed412d638687b8aec44f7b12df7ca2bbbb
python/liblas/header.py
python
Header.get_systemid
(self)
return str(core.las.LASHeader_GetSystemId(self.handle).decode())
Returns the system identifier specified in the file
Returns the system identifier specified in the file
[ "Returns", "the", "system", "identifier", "specified", "in", "the", "file" ]
def get_systemid(self): """Returns the system identifier specified in the file""" return str(core.las.LASHeader_GetSystemId(self.handle).decode())
[ "def", "get_systemid", "(", "self", ")", ":", "return", "str", "(", "core", ".", "las", ".", "LASHeader_GetSystemId", "(", "self", ".", "handle", ")", ".", "decode", "(", ")", ")" ]
https://github.com/libLAS/libLAS/blob/e6a1aaed412d638687b8aec44f7b12df7ca2bbbb/python/liblas/header.py#L238-L240
Yelp/MOE
5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c
moe/optimal_learning/python/interfaces/domain_interface.py
python
DomainInterface.get_bounding_box
(self)
Return a list of ClosedIntervals representing a bounding box for this domain.
Return a list of ClosedIntervals representing a bounding box for this domain.
[ "Return", "a", "list", "of", "ClosedIntervals", "representing", "a", "bounding", "box", "for", "this", "domain", "." ]
def get_bounding_box(self): """Return a list of ClosedIntervals representing a bounding box for this domain.""" pass
[ "def", "get_bounding_box", "(", "self", ")", ":", "pass" ]
https://github.com/Yelp/MOE/blob/5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c/moe/optimal_learning/python/interfaces/domain_interface.py#L30-L32
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_gdi.py
python
GraphicsContext.DrawRotatedText
(*args, **kwargs)
return _gdi_.GraphicsContext_DrawRotatedText(*args, **kwargs)
DrawRotatedText(self, String str, Double x, Double y, Double angle, GraphicsBrush backgroundBrush=NullGraphicsBrush) Draws a text string at the defined position, at the specified angle, which is given in radians.
DrawRotatedText(self, String str, Double x, Double y, Double angle, GraphicsBrush backgroundBrush=NullGraphicsBrush)
[ "DrawRotatedText", "(", "self", "String", "str", "Double", "x", "Double", "y", "Double", "angle", "GraphicsBrush", "backgroundBrush", "=", "NullGraphicsBrush", ")" ]
def DrawRotatedText(*args, **kwargs): """ DrawRotatedText(self, String str, Double x, Double y, Double angle, GraphicsBrush backgroundBrush=NullGraphicsBrush) Draws a text string at the defined position, at the specified angle, which is given in radians. """ return _gdi_...
[ "def", "DrawRotatedText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsContext_DrawRotatedText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_gdi.py#L6391-L6398
GJDuck/LowFat
ecf6a0f0fa1b73a27a626cf493cc39e477b6faea
llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py
python
Diagnostic.category_number
(self)
return conf.lib.clang_getDiagnosticCategory(self)
The category number for this diagnostic or 0 if unavailable.
The category number for this diagnostic or 0 if unavailable.
[ "The", "category", "number", "for", "this", "diagnostic", "or", "0", "if", "unavailable", "." ]
def category_number(self): """The category number for this diagnostic or 0 if unavailable.""" return conf.lib.clang_getDiagnosticCategory(self)
[ "def", "category_number", "(", "self", ")", ":", "return", "conf", ".", "lib", ".", "clang_getDiagnosticCategory", "(", "self", ")" ]
https://github.com/GJDuck/LowFat/blob/ecf6a0f0fa1b73a27a626cf493cc39e477b6faea/llvm-4.0.0.src/tools/clang/bindings/python/clang/cindex.py#L388-L390
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/math/symbolic.py
python
Context.bindFunction
(self,function,remapping=None)
return function(*args)
Produces an Expression that evalutes the function, where its arguments are bound to variables / user data in the current environment. The argument names should map to similarly named variables or user data. If remapping is provided, then it maps function arguments to variables or values ...
Produces an Expression that evalutes the function, where its arguments are bound to variables / user data in the current environment. The argument names should map to similarly named variables or user data.
[ "Produces", "an", "Expression", "that", "evalutes", "the", "function", "where", "its", "arguments", "are", "bound", "to", "variables", "/", "user", "data", "in", "the", "current", "environment", ".", "The", "argument", "names", "should", "map", "to", "similarl...
def bindFunction(self,function,remapping=None): """Produces an Expression that evalutes the function, where its arguments are bound to variables / user data in the current environment. The argument names should map to similarly named variables or user data. If remapping is provided, t...
[ "def", "bindFunction", "(", "self", ",", "function", ",", "remapping", "=", "None", ")", ":", "if", "isinstance", "(", "function", ",", "str", ")", ":", "function", "=", "self", ".", "customFunctions", "[", "function", "]", "assert", "isinstance", "(", "...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/symbolic.py#L1223-L1260
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/debugger_cli_common.py
python
RichTextLines.extend
(self, other)
Extend this instance of RichTextLines with another instance. The extension takes effect on the text lines, the font attribute segments, as well as the annotations. The line indices in the font attribute segments and the annotations are adjusted to account for the existing lines. If there are duplicate,...
Extend this instance of RichTextLines with another instance.
[ "Extend", "this", "instance", "of", "RichTextLines", "with", "another", "instance", "." ]
def extend(self, other): """Extend this instance of RichTextLines with another instance. The extension takes effect on the text lines, the font attribute segments, as well as the annotations. The line indices in the font attribute segments and the annotations are adjusted to account for the existing ...
[ "def", "extend", "(", "self", ",", "other", ")", ":", "orig_num_lines", "=", "self", ".", "num_lines", "(", ")", "# Record original number of lines.", "# Merge the lines.", "self", ".", "_lines", ".", "extend", "(", "other", ".", "lines", ")", "# Merge the font_...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/cli/debugger_cli_common.py#L270-L300
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/ops/control_flow_ops.py
python
_GetOutputContext
(op)
return ctxt
Return the control flow context for the output of an op.
Return the control flow context for the output of an op.
[ "Return", "the", "control", "flow", "context", "for", "the", "output", "of", "an", "op", "." ]
def _GetOutputContext(op): """Return the control flow context for the output of an op.""" ctxt = op._get_control_flow_context() if IsLoopExit(op): ctxt = ctxt.outer_context return ctxt
[ "def", "_GetOutputContext", "(", "op", ")", ":", "ctxt", "=", "op", ".", "_get_control_flow_context", "(", ")", "if", "IsLoopExit", "(", "op", ")", ":", "ctxt", "=", "ctxt", ".", "outer_context", "return", "ctxt" ]
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/control_flow_ops.py#L484-L489
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/summary/impl/reservoir.py
python
_ReservoirBucket.Items
(self)
Get all the items in the bucket.
Get all the items in the bucket.
[ "Get", "all", "the", "items", "in", "the", "bucket", "." ]
def Items(self): """Get all the items in the bucket.""" with self._mutex: return self.items
[ "def", "Items", "(", "self", ")", ":", "with", "self", ".", "_mutex", ":", "return", "self", ".", "items" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/summary/impl/reservoir.py#L231-L234
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
FWCore/ParameterSet/python/Mixins.py
python
_Parameterizable.getParameter
(self, params)
return lastParam
_getParameter_ Retrieve the specified parameter from the PSet Provided given the attribute chain returns None if not found
_getParameter_
[ "_getParameter_" ]
def getParameter(self, params): """ _getParameter_ Retrieve the specified parameter from the PSet Provided given the attribute chain returns None if not found """ lastParam = self # Don't accidentally iterate over letters in a string if type(para...
[ "def", "getParameter", "(", "self", ",", "params", ")", ":", "lastParam", "=", "self", "# Don't accidentally iterate over letters in a string", "if", "type", "(", "params", ")", ".", "__name__", "==", "'str'", ":", "return", "getattr", "(", "self", ",", "params"...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/FWCore/ParameterSet/python/Mixins.py#L207-L225
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py
python
EmacsMode.re_read_init_file
(self, e)
Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.
Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.
[ "Read", "in", "the", "contents", "of", "the", "inputrc", "file", "and", "incorporate", "any", "bindings", "or", "variable", "assignments", "found", "there", "." ]
def re_read_init_file(self, e): # (C-x C-r) '''Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.''' pass
[ "def", "re_read_init_file", "(", "self", ",", "e", ")", ":", "# (C-x C-r)", "pass" ]
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/modes/emacs.py#L454-L457
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/graph_editor/match.py
python
OpMatcher.__call__
(self, op)
return True
Evaluate if the op matches or not.
Evaluate if the op matches or not.
[ "Evaluate", "if", "the", "op", "matches", "or", "not", "." ]
def __call__(self, op): """Evaluate if the op matches or not.""" if not isinstance(op, tf_ops.Operation): raise TypeError("Expect tf.Operation, got: {}".format(type(op))) for positive_filter in self.positive_filters: if not positive_filter(op): return False if self.input_op_matches i...
[ "def", "__call__", "(", "self", ",", "op", ")", ":", "if", "not", "isinstance", "(", "op", ",", "tf_ops", ".", "Operation", ")", ":", "raise", "TypeError", "(", "\"Expect tf.Operation, got: {}\"", ".", "format", "(", "type", "(", "op", ")", ")", ")", "...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/graph_editor/match.py#L81-L120
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.GetCellAlignment
(*args, **kwargs)
return _grid.Grid_GetCellAlignment(*args, **kwargs)
GetCellAlignment(int row, int col) -> (horiz, vert)
GetCellAlignment(int row, int col) -> (horiz, vert)
[ "GetCellAlignment", "(", "int", "row", "int", "col", ")", "-", ">", "(", "horiz", "vert", ")" ]
def GetCellAlignment(*args, **kwargs): """GetCellAlignment(int row, int col) -> (horiz, vert)""" return _grid.Grid_GetCellAlignment(*args, **kwargs)
[ "def", "GetCellAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_GetCellAlignment", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1798-L1800
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/email/_header_value_parser.py
python
get_section
(value)
return section, value
'*' digits The formal BNF is more complicated because leading 0s are not allowed. We check for that and add a defect. We also assume no CFWS is allowed between the '*' and the digits, though the RFC is not crystal clear on that. The caller should already have dealt with leading CFWS.
'*' digits
[ "*", "digits" ]
def get_section(value): """ '*' digits The formal BNF is more complicated because leading 0s are not allowed. We check for that and add a defect. We also assume no CFWS is allowed between the '*' and the digits, though the RFC is not crystal clear on that. The caller should already have dealt wit...
[ "def", "get_section", "(", "value", ")", ":", "section", "=", "Section", "(", ")", "if", "not", "value", "or", "value", "[", "0", "]", "!=", "'*'", ":", "raise", "errors", ".", "HeaderParseError", "(", "\"Expected section but found {}\"", ".", "format", "(...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/email/_header_value_parser.py#L2359-L2386
codilime/veles
e65de5a7c268129acffcdb03034efd8d256d025c
python/veles/dis/isa/falcon.py
python
FalconIsa.parse_ab
(form)
return [ ParseWord(fields.b), ParseInsn(form), ]
Generates the remainder of a parser for two-byte forms (a, b).
Generates the remainder of a parser for two-byte forms (a, b).
[ "Generates", "the", "remainder", "of", "a", "parser", "for", "two", "-", "byte", "forms", "(", "a", "b", ")", "." ]
def parse_ab(form): """ Generates the remainder of a parser for two-byte forms (a, b). """ fields = FalconFields return [ ParseWord(fields.b), ParseInsn(form), ]
[ "def", "parse_ab", "(", "form", ")", ":", "fields", "=", "FalconFields", "return", "[", "ParseWord", "(", "fields", ".", "b", ")", ",", "ParseInsn", "(", "form", ")", ",", "]" ]
https://github.com/codilime/veles/blob/e65de5a7c268129acffcdb03034efd8d256d025c/python/veles/dis/isa/falcon.py#L709-L717
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/pyedbglib/serialport/wincdc.py
python
CDC.func_name
(self)
return "%s::%s" % (__name__, sys._getframe(1).f_code.co_name)
Get function name
Get function name
[ "Get", "function", "name" ]
def func_name(self): """ Get function name """ return "%s::%s" % (__name__, sys._getframe(1).f_code.co_name)
[ "def", "func_name", "(", "self", ")", ":", "return", "\"%s::%s\"", "%", "(", "__name__", ",", "sys", ".", "_getframe", "(", "1", ")", ".", "f_code", ".", "co_name", ")" ]
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/pyedbglib/serialport/wincdc.py#L35-L39
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py
python
StateSpaceModel.transition_to_powers
(self, powers)
return math_utils.matrix_to_powers( ops.convert_to_tensor(self.get_state_transition(), dtype=self.dtype), powers)
Raise the transition matrix to a batch of powers. Computes state_transition^powers. If special cases are available, overriding this function can lead to more efficient inferences. Args: powers: A [...] shape integer Tensor with powers to raise the transition matrix to. Returns: The...
Raise the transition matrix to a batch of powers.
[ "Raise", "the", "transition", "matrix", "to", "a", "batch", "of", "powers", "." ]
def transition_to_powers(self, powers): """Raise the transition matrix to a batch of powers. Computes state_transition^powers. If special cases are available, overriding this function can lead to more efficient inferences. Args: powers: A [...] shape integer Tensor with powers to raise the trans...
[ "def", "transition_to_powers", "(", "self", ",", "powers", ")", ":", "return", "math_utils", ".", "matrix_to_powers", "(", "ops", ".", "convert_to_tensor", "(", "self", ".", "get_state_transition", "(", ")", ",", "dtype", "=", "self", ".", "dtype", ")", ",",...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/timeseries/python/timeseries/state_space_models/state_space_model.py#L290-L305
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py
python
_xml_escape
(data)
return data
Escape &, <, >, ", ', etc. in a string of data.
Escape &, <, >, ", ', etc. in a string of data.
[ "Escape", "&", "<", ">", "etc", ".", "in", "a", "string", "of", "data", "." ]
def _xml_escape(data): """Escape &, <, >, ", ', etc. in a string of data.""" # ampersand must be replaced first from_symbols = '&><"\'' to_symbols = ('&'+s+';' for s in "amp gt lt quot apos".split()) for from_,to_ in zip(from_symbols, to_symbols): data = data.replace(from_, to_) return ...
[ "def", "_xml_escape", "(", "data", ")", ":", "# ampersand must be replaced first", "from_symbols", "=", "'&><\"\\''", "to_symbols", "=", "(", "'&'", "+", "s", "+", "';'", "for", "s", "in", "\"amp gt lt quot apos\"", ".", "split", "(", ")", ")", "for", "from_",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/_vendor/pyparsing.py#L185-L193
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/mooseutils/ReporterReader.py
python
ReporterReader.__bool__
(self)
return self._index < len(self._data['time_steps'])
Allows this object to be used in boolean cases. ```python data = ReporterReader('file.json') if not data: print 'No data found!' ```
Allows this object to be used in boolean cases.
[ "Allows", "this", "object", "to", "be", "used", "in", "boolean", "cases", "." ]
def __bool__(self): """ Allows this object to be used in boolean cases. ```python data = ReporterReader('file.json') if not data: print 'No data found!' ``` """ return self._index < len(self._data['time_steps'])
[ "def", "__bool__", "(", "self", ")", ":", "return", "self", ".", "_index", "<", "len", "(", "self", ".", "_data", "[", "'time_steps'", "]", ")" ]
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/mooseutils/ReporterReader.py#L99-L109
nfrechette/acl-ue4-plugin
2a5433b5e7521ca5f3f66ba1afd91a63cce1af7a
Tools/stat_parser.py
python
print_progress
(iteration, total, prefix='', suffix='', decimals = 1, bar_length = 40)
Call in a loop to create terminal progress bar @params: iteration - Required : current iteration (Int) total - Required : total iterations (Int) prefix - Optional : prefix string (Str) suffix - Optional : suffix string (Str) decimals - Optional : positive number of decimals in perce...
Call in a loop to create terminal progress bar
[ "Call", "in", "a", "loop", "to", "create", "terminal", "progress", "bar" ]
def print_progress(iteration, total, prefix='', suffix='', decimals = 1, bar_length = 40): # Taken from https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console # With minor tweaks """ Call in a loop to create terminal progress bar @params: iteration - Required : current iteration (Int) ...
[ "def", "print_progress", "(", "iteration", ",", "total", ",", "prefix", "=", "''", ",", "suffix", "=", "''", ",", "decimals", "=", "1", ",", "bar_length", "=", "40", ")", ":", "# Taken from https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console",...
https://github.com/nfrechette/acl-ue4-plugin/blob/2a5433b5e7521ca5f3f66ba1afd91a63cce1af7a/Tools/stat_parser.py#L222-L250
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/Direct/ISISDirecInelasticConfig.py
python
MantidConfigDirectInelastic._parse_replacement_info
(self, repl_info)
return (source, dest)
process dom element 'replacement' and returns the variables with its correspondent value to replace variable by their value. If value contains one or more of the supported variables as its part, this variable is replaced by its value. Supported variables are defi...
process dom element 'replacement' and returns the variables with its correspondent value to replace variable by their value.
[ "process", "dom", "element", "replacement", "and", "returns", "the", "variables", "with", "its", "correspondent", "value", "to", "replace", "variable", "by", "their", "value", "." ]
def _parse_replacement_info(self, repl_info): """process dom element 'replacement' and returns the variables with its correspondent value to replace variable by their value. If value contains one or more of the supported variables as its part, this variable is repla...
[ "def", "_parse_replacement_info", "(", "self", ",", "repl_info", ")", ":", "# what should be replaced in the file", "source", "=", "repl_info", ".", "getAttribute", "(", "\"var\"", ")", "if", "len", "(", "source", ")", "==", "0", ":", "raise", "ValueError", "(",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/ISISDirecInelasticConfig.py#L624-L650
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
tools/pot/openvino/tools/pot/statistics/functions/activations.py
python
calculate_per_channel_stats
(acts, fn, axis=1)
return fn(t, axis=2)
Calculates per-channel statistics for activations using a specific function :param act: activation :param fn: function to calculate per-channel statistics :return statistics generated by fn for each activation in the batch
Calculates per-channel statistics for activations using a specific function :param act: activation :param fn: function to calculate per-channel statistics :return statistics generated by fn for each activation in the batch
[ "Calculates", "per", "-", "channel", "statistics", "for", "activations", "using", "a", "specific", "function", ":", "param", "act", ":", "activation", ":", "param", "fn", ":", "function", "to", "calculate", "per", "-", "channel", "statistics", ":", "return", ...
def calculate_per_channel_stats(acts, fn, axis=1): """ Calculates per-channel statistics for activations using a specific function :param act: activation :param fn: function to calculate per-channel statistics :return statistics generated by fn for each activation in the batch """ if len(acts.sh...
[ "def", "calculate_per_channel_stats", "(", "acts", ",", "fn", ",", "axis", "=", "1", ")", ":", "if", "len", "(", "acts", ".", "shape", ")", "<", "3", ":", "return", "acts", "acts", "=", "np", ".", "moveaxis", "(", "acts", ",", "axis", ",", "1", "...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/tools/pot/openvino/tools/pot/statistics/functions/activations.py#L17-L27
ROCmSoftwarePlatform/rocBLAS
3738f8b098cdc1db1bdfc164ceb689d073116c98
scripts/performance/blas/commandrunner.py
python
Comparison._get_sweep_keys
(self)
return []
The keys that are collapsed when collecting results. E.g. Used to make the x-axis of a plot.
The keys that are collapsed when collecting results. E.g. Used to make the x-axis of a plot.
[ "The", "keys", "that", "are", "collapsed", "when", "collecting", "results", ".", "E", ".", "g", ".", "Used", "to", "make", "the", "x", "-", "axis", "of", "a", "plot", "." ]
def _get_sweep_keys(self): '''The keys that are collapsed when collecting results. E.g. Used to make the x-axis of a plot.''' return []
[ "def", "_get_sweep_keys", "(", "self", ")", ":", "return", "[", "]" ]
https://github.com/ROCmSoftwarePlatform/rocBLAS/blob/3738f8b098cdc1db1bdfc164ceb689d073116c98/scripts/performance/blas/commandrunner.py#L793-L795
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
RobotModel.__init__
(self)
r""" __init__(RobotModel self) -> RobotModel
r""" __init__(RobotModel self) -> RobotModel
[ "r", "__init__", "(", "RobotModel", "self", ")", "-", ">", "RobotModel" ]
def __init__(self): r""" __init__(RobotModel self) -> RobotModel """ _robotsim.RobotModel_swiginit(self, _robotsim.new_RobotModel())
[ "def", "__init__", "(", "self", ")", ":", "_robotsim", ".", "RobotModel_swiginit", "(", "self", ",", "_robotsim", ".", "new_RobotModel", "(", ")", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L4818-L4824