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
htcondor/htcondor
4829724575176d1d6c936e4693dfd78a728569b0
src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/client.py
python
IClient.OpenAuthorizationDialog
(self, Username)
Opens authorization dialog. @param Username: Skypename of the user to authenticate. @type Username: unicode
Opens authorization dialog.
[ "Opens", "authorization", "dialog", "." ]
def OpenAuthorizationDialog(self, Username): '''Opens authorization dialog. @param Username: Skypename of the user to authenticate. @type Username: unicode ''' self.OpenDialog('AUTHORIZATION', Username)
[ "def", "OpenAuthorizationDialog", "(", "self", ",", "Username", ")", ":", "self", ".", "OpenDialog", "(", "'AUTHORIZATION'", ",", "Username", ")" ]
https://github.com/htcondor/htcondor/blob/4829724575176d1d6c936e4693dfd78a728569b0/src/condor_contrib/condor_pigeon/src/condor_pigeon_client/skype_linux_tools/Skype4Py/client.py#L108-L114
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/lib-tk/Tkinter.py
python
Wm.wm_group
(self, pathName=None)
return self.tk.call('wm', 'group', self._w, pathName)
Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.
Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.
[ "Set", "the", "group", "leader", "widgets", "for", "related", "widgets", "to", "PATHNAME", ".", "Return", "the", "group", "leader", "of", "this", "widget", "if", "None", "is", "given", "." ]
def wm_group(self, pathName=None): """Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.""" return self.tk.call('wm', 'group', self._w, pathName)
[ "def", "wm_group", "(", "self", ",", "pathName", "=", "None", ")", ":", "return", "self", ".", "tk", ".", "call", "(", "'wm'", ",", "'group'", ",", "self", ".", "_w", ",", "pathName", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/lib-tk/Tkinter.py#L1687-L1690
gem5/gem5
141cc37c2d4b93959d4c249b8f7e6a8b2ef75338
src/python/m5/ext/pyfdt/pyfdt.py
python
FdtPropertyBytes.__eq__
(self, node)
return True
Check node equality check properties are the same (same values)
Check node equality check properties are the same (same values)
[ "Check", "node", "equality", "check", "properties", "are", "the", "same", "(", "same", "values", ")" ]
def __eq__(self, node): """Check node equality check properties are the same (same values) """ if not FdtProperty.__eq__(self, node): return False if self.__len__() != len(node): return False for index in range(self.__len__()): if se...
[ "def", "__eq__", "(", "self", ",", "node", ")", ":", "if", "not", "FdtProperty", ".", "__eq__", "(", "self", ",", "node", ")", ":", "return", "False", "if", "self", ".", "__len__", "(", ")", "!=", "len", "(", "node", ")", ":", "return", "False", ...
https://github.com/gem5/gem5/blob/141cc37c2d4b93959d4c249b8f7e6a8b2ef75338/src/python/m5/ext/pyfdt/pyfdt.py#L388-L399
LLNL/Caliper
60e06980fc65057e1da01296e6eebbbed30f59c8
python/caliper-reader/caliperreader/caliperstreamreader.py
python
CaliperStreamReader.attribute
(self, attribute_name)
return self.db.attributes[attribute_name]
Return a Caliper Attribute object for the given attribute name.
Return a Caliper Attribute object for the given attribute name.
[ "Return", "a", "Caliper", "Attribute", "object", "for", "the", "given", "attribute", "name", "." ]
def attribute(self, attribute_name): """ Return a Caliper Attribute object for the given attribute name. """ return self.db.attributes[attribute_name]
[ "def", "attribute", "(", "self", ",", "attribute_name", ")", ":", "return", "self", ".", "db", ".", "attributes", "[", "attribute_name", "]" ]
https://github.com/LLNL/Caliper/blob/60e06980fc65057e1da01296e6eebbbed30f59c8/python/caliper-reader/caliperreader/caliperstreamreader.py#L63-L67
eldar/deepcut-cnn
928bf2f224fce132f6e4404b4c95fb017297a5e0
scripts/cpp_lint.py
python
_BlockInfo.CheckBegin
(self, filename, clean_lines, linenum, error)
Run checks that applies to text up to the opening brace. This is mostly for checking the text after the class identifier and the "{", usually where the base class is specified. For other blocks, there isn't much to check, so we always pass. Args: filename: The name of the current file. cl...
Run checks that applies to text up to the opening brace.
[ "Run", "checks", "that", "applies", "to", "text", "up", "to", "the", "opening", "brace", "." ]
def CheckBegin(self, filename, clean_lines, linenum, error): """Run checks that applies to text up to the opening brace. This is mostly for checking the text after the class identifier and the "{", usually where the base class is specified. For other blocks, there isn't much to check, so we always pas...
[ "def", "CheckBegin", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "pass" ]
https://github.com/eldar/deepcut-cnn/blob/928bf2f224fce132f6e4404b4c95fb017297a5e0/scripts/cpp_lint.py#L1763-L1776
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/agents/configs.py
python
default
()
return locals()
Default configuration for PPO.
Default configuration for PPO.
[ "Default", "configuration", "for", "PPO", "." ]
def default(): """Default configuration for PPO.""" # General algorithm = ppo.PPOAlgorithm num_agents = 30 eval_episodes = 30 use_gpu = False # Network network = networks.feed_forward_gaussian weight_summaries = dict(all=r'.*', policy=r'.*/policy/.*', value=r'.*/value/.*') policy_layers = 200, 100 ...
[ "def", "default", "(", ")", ":", "# General", "algorithm", "=", "ppo", ".", "PPOAlgorithm", "num_agents", "=", "30", "eval_episodes", "=", "30", "use_gpu", "=", "False", "# Network", "network", "=", "networks", ".", "feed_forward_gaussian", "weight_summaries", "...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/agents/configs.py#L35-L62
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
Locale.GetLanguage
(*args, **kwargs)
return _gdi_.Locale_GetLanguage(*args, **kwargs)
GetLanguage(self) -> int
GetLanguage(self) -> int
[ "GetLanguage", "(", "self", ")", "-", ">", "int" ]
def GetLanguage(*args, **kwargs): """GetLanguage(self) -> int""" return _gdi_.Locale_GetLanguage(*args, **kwargs)
[ "def", "GetLanguage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Locale_GetLanguage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L3118-L3120
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/builder.py
python
IRBuilder.fcmp_unordered
(self, cmpop, lhs, rhs, name='', flags=[])
return instr
Floating-point unordered comparison: name = lhs <cmpop> rhs where cmpop can be '==', '!=', '<', '<=', '>', '>=', 'ord', 'uno'
Floating-point unordered comparison: name = lhs <cmpop> rhs
[ "Floating", "-", "point", "unordered", "comparison", ":", "name", "=", "lhs", "<cmpop", ">", "rhs" ]
def fcmp_unordered(self, cmpop, lhs, rhs, name='', flags=[]): """ Floating-point unordered comparison: name = lhs <cmpop> rhs where cmpop can be '==', '!=', '<', '<=', '>', '>=', 'ord', 'uno' """ if cmpop in _CMP_MAP: op = 'u' + _CMP_MAP[cmpop] el...
[ "def", "fcmp_unordered", "(", "self", ",", "cmpop", ",", "lhs", ",", "rhs", ",", "name", "=", "''", ",", "flags", "=", "[", "]", ")", ":", "if", "cmpop", "in", "_CMP_MAP", ":", "op", "=", "'u'", "+", "_CMP_MAP", "[", "cmpop", "]", "else", ":", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/llvmlite/ir/builder.py#L576-L589
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/calendar.py
python
TextCalendar.formatyear
(self, theyear, w=2, l=1, c=6, m=3)
return ''.join(v)
Returns a year's calendar as a multi-line string.
Returns a year's calendar as a multi-line string.
[ "Returns", "a", "year", "s", "calendar", "as", "a", "multi", "-", "line", "string", "." ]
def formatyear(self, theyear, w=2, l=1, c=6, m=3): """ Returns a year's calendar as a multi-line string. """ w = max(2, w) l = max(1, l) c = max(2, c) colwidth = (w + 1) * 7 - 1 v = [] a = v.append a(repr(theyear).center(colwidth*m+c*(m-1))...
[ "def", "formatyear", "(", "self", ",", "theyear", ",", "w", "=", "2", ",", "l", "=", "1", ",", "c", "=", "6", ",", "m", "=", "3", ")", ":", "w", "=", "max", "(", "2", ",", "w", ")", "l", "=", "max", "(", "1", ",", "l", ")", "c", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/calendar.py#L368-L403
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/binary-prefix-divisible-by-5.py
python
Solution.prefixesDivBy5
(self, A)
return [x % 5 == 0 for x in A]
:type A: List[int] :rtype: List[bool]
:type A: List[int] :rtype: List[bool]
[ ":", "type", "A", ":", "List", "[", "int", "]", ":", "rtype", ":", "List", "[", "bool", "]" ]
def prefixesDivBy5(self, A): """ :type A: List[int] :rtype: List[bool] """ for i in xrange(1, len(A)): A[i] += A[i-1] * 2 % 5 return [x % 5 == 0 for x in A]
[ "def", "prefixesDivBy5", "(", "self", ",", "A", ")", ":", "for", "i", "in", "xrange", "(", "1", ",", "len", "(", "A", ")", ")", ":", "A", "[", "i", "]", "+=", "A", "[", "i", "-", "1", "]", "*", "2", "%", "5", "return", "[", "x", "%", "5...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/binary-prefix-divisible-by-5.py#L5-L12
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/utils/deprecation.py
python
deprecated
(reason=None, func_name=None)
return decorator
r""" This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.
r""" This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.
[ "r", "This", "is", "a", "decorator", "which", "can", "be", "used", "to", "mark", "functions", "as", "deprecated", ".", "It", "will", "result", "in", "a", "warning", "being", "emitted", "when", "the", "function", "is", "used", "." ]
def deprecated(reason=None, func_name=None): r""" This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used. """ def decorator(func): object_type = "class" if inspect.isclass(func) else "function" messa...
[ "def", "deprecated", "(", "reason", "=", "None", ",", "func_name", "=", "None", ")", ":", "def", "decorator", "(", "func", ")", ":", "object_type", "=", "\"class\"", "if", "inspect", ".", "isclass", "(", "func", ")", "else", "\"function\"", "message", "=...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/utils/deprecation.py#L22-L43
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
python
XCConfigurationList.ConfigurationNamed
(self, name)
Convenience accessor to obtain an XCBuildConfiguration by name.
Convenience accessor to obtain an XCBuildConfiguration by name.
[ "Convenience", "accessor", "to", "obtain", "an", "XCBuildConfiguration", "by", "name", "." ]
def ConfigurationNamed(self, name): """Convenience accessor to obtain an XCBuildConfiguration by name.""" for configuration in self._properties["buildConfigurations"]: if configuration._properties["name"] == name: return configuration raise KeyError(name)
[ "def", "ConfigurationNamed", "(", "self", ",", "name", ")", ":", "for", "configuration", "in", "self", ".", "_properties", "[", "\"buildConfigurations\"", "]", ":", "if", "configuration", ".", "_properties", "[", "\"name\"", "]", "==", "name", ":", "return", ...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py#L1708-L1714
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/google/protobuf/internal/encoder.py
python
StringSizer
(field_number, is_repeated, is_packed)
Returns a sizer for a string field.
Returns a sizer for a string field.
[ "Returns", "a", "sizer", "for", "a", "string", "field", "." ]
def StringSizer(field_number, is_repeated, is_packed): """Returns a sizer for a string field.""" tag_size = _TagSize(field_number) local_VarintSize = _VarintSize local_len = len assert not is_packed if is_repeated: def RepeatedFieldSize(value): result = tag_size * len(value) for element in ...
[ "def", "StringSizer", "(", "field_number", ",", "is_repeated", ",", "is_packed", ")", ":", "tag_size", "=", "_TagSize", "(", "field_number", ")", "local_VarintSize", "=", "_VarintSize", "local_len", "=", "len", "assert", "not", "is_packed", "if", "is_repeated", ...
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/encoder.py#L233-L252
zhaoweicai/mscnn
534bcac5710a579d60827f192035f7eef6d8c585
scripts/cpp_lint.py
python
CheckMakePairUsesDeduction
(filename, clean_lines, linenum, error)
Check that make_pair's template arguments are deduced. G++ 4.6 in C++0x 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++0x 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/zhaoweicai/mscnn/blob/534bcac5710a579d60827f192035f7eef6d8c585/scripts/cpp_lint.py#L4579-L4597
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/metrics_impl.py
python
mean_cosine_distance
(labels, predictions, dim, weights=None, metrics_collections=None, updates_collections=None, name=None)
return mean_distance, update_op
Computes the cosine distance between the labels and predictions. The `mean_cosine_distance` function creates two local variables, `total` and `count` that are used to compute the average cosine distance between `predictions` and `labels`. This average is weighted by `weights`, and it is ultimately returned as ...
Computes the cosine distance between the labels and predictions.
[ "Computes", "the", "cosine", "distance", "between", "the", "labels", "and", "predictions", "." ]
def mean_cosine_distance(labels, predictions, dim, weights=None, metrics_collections=None, updates_collections=None, name=None): """Computes the cosine distance between the labels and predictions. The `mean_cosine_distance` function creates...
[ "def", "mean_cosine_distance", "(", "labels", ",", "predictions", ",", "dim", ",", "weights", "=", "None", ",", "metrics_collections", "=", "None", ",", "updates_collections", "=", "None", ",", "name", "=", "None", ")", ":", "predictions", ",", "labels", ","...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/metrics_impl.py#L714-L777
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/tools/stats-viewer.py
python
UiCounter.Set
(self, value)
Updates the ui for this counter. Args: value: The value to display Returns: True if the value had changed, otherwise False. The first call always returns True.
Updates the ui for this counter.
[ "Updates", "the", "ui", "for", "this", "counter", "." ]
def Set(self, value): """Updates the ui for this counter. Args: value: The value to display Returns: True if the value had changed, otherwise False. The first call always returns True. """ if value == self.last_value: return False else: self.last_value = value ...
[ "def", "Set", "(", "self", ",", "value", ")", ":", "if", "value", "==", "self", ".", "last_value", ":", "return", "False", "else", ":", "self", ".", "last_value", "=", "value", "self", ".", "var", ".", "set", "(", "self", ".", "format", "%", "value...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/tools/stats-viewer.py#L282-L297
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/aui.py
python
AuiToolBar.GetToolCount
(*args, **kwargs)
return _aui.AuiToolBar_GetToolCount(*args, **kwargs)
GetToolCount(self) -> size_t
GetToolCount(self) -> size_t
[ "GetToolCount", "(", "self", ")", "-", ">", "size_t" ]
def GetToolCount(*args, **kwargs): """GetToolCount(self) -> size_t""" return _aui.AuiToolBar_GetToolCount(*args, **kwargs)
[ "def", "GetToolCount", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBar_GetToolCount", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L2086-L2088
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Wrapping/Python/paraview/servermanager.py
python
Property.__eq__
(self, other)
return ((self is None and other is None) or (self is not None and other is not None and self.__repr__() == other.__repr__()))
Returns true if the properties or properties values are the same.
Returns true if the properties or properties values are the same.
[ "Returns", "true", "if", "the", "properties", "or", "properties", "values", "are", "the", "same", "." ]
def __eq__(self, other): "Returns true if the properties or properties values are the same." return ((self is None and other is None) or (self is not None and other is not None and self.__repr__() == other.__repr__()))
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "return", "(", "(", "self", "is", "None", "and", "other", "is", "None", ")", "or", "(", "self", "is", "not", "None", "and", "other", "is", "not", "None", "and", "self", ".", "__repr__", "(", "...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/servermanager.py#L712-L715
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cpplint/cpplint.py
python
CheckIncludeLine
(filename, clean_lines, linenum, include_state, error)
Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage must be put here. Args: filename: The name of the current file. clean_l...
Check rules that are applicable to #include lines.
[ "Check", "rules", "that", "are", "applicable", "to", "#include", "lines", "." ]
def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): """Check rules that are applicable to #include lines. Strings on #include lines are NOT removed from elided line, to make certain tasks easier. However, to prevent false positives, checks applicable to #include lines in CheckLanguage m...
[ "def", "CheckIncludeLine", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "include_state", ",", "error", ")", ":", "fileinfo", "=", "FileInfo", "(", "filename", ")", "line", "=", "clean_lines", ".", "lines", "[", "linenum", "]", "# \"include\" shoul...
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cpplint/cpplint.py#L4605-L4675
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/xrc.py
python
XmlResource.Get
(*args, **kwargs)
return _xrc.XmlResource_Get(*args, **kwargs)
Get() -> XmlResource
Get() -> XmlResource
[ "Get", "()", "-", ">", "XmlResource" ]
def Get(*args, **kwargs): """Get() -> XmlResource""" return _xrc.XmlResource_Get(*args, **kwargs)
[ "def", "Get", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_xrc", ".", "XmlResource_Get", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/xrc.py#L200-L202
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
python/taichi/linalg/sparse_matrix.py
python
SparseMatrix.transpose
(self)
return SparseMatrix(sm=sm)
Sparse Matrix transpose. Returns: The transposed sparse mastrix.
Sparse Matrix transpose.
[ "Sparse", "Matrix", "transpose", "." ]
def transpose(self): """Sparse Matrix transpose. Returns: The transposed sparse mastrix. """ sm = self.matrix.transpose() return SparseMatrix(sm=sm)
[ "def", "transpose", "(", "self", ")", ":", "sm", "=", "self", ".", "matrix", ".", "transpose", "(", ")", "return", "SparseMatrix", "(", "sm", "=", "sm", ")" ]
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/linalg/sparse_matrix.py#L79-L86
koth/kcws
88efbd36a7022de4e6e90f5a1fb880cf87cfae9f
third_party/setuptools/pkg_resources.py
python
get_distribution
(dist)
return dist
Return a current distribution object for a Requirement or string
Return a current distribution object for a Requirement or string
[ "Return", "a", "current", "distribution", "object", "for", "a", "Requirement", "or", "string" ]
def get_distribution(dist): """Return a current distribution object for a Requirement or string""" if isinstance(dist, basestring): dist = Requirement.parse(dist) if isinstance(dist, Requirement): dist = get_provider(dist) if not isinstance(dist, Distribution): raise TypeError("Expected string, ...
[ "def", "get_distribution", "(", "dist", ")", ":", "if", "isinstance", "(", "dist", ",", "basestring", ")", ":", "dist", "=", "Requirement", ".", "parse", "(", "dist", ")", "if", "isinstance", "(", "dist", ",", "Requirement", ")", ":", "dist", "=", "get...
https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/setuptools/pkg_resources.py#L346-L352
google/shaka-packager
e1b0c7c45431327fd3ce193514a5407d07b39b22
packager/third_party/protobuf/python/google/protobuf/descriptor.py
python
_OptionsOrNone
(descriptor_proto)
Returns the value of the field `options`, or None if it is not set.
Returns the value of the field `options`, or None if it is not set.
[ "Returns", "the", "value", "of", "the", "field", "options", "or", "None", "if", "it", "is", "not", "set", "." ]
def _OptionsOrNone(descriptor_proto): """Returns the value of the field `options`, or None if it is not set.""" if descriptor_proto.HasField('options'): return descriptor_proto.options else: return None
[ "def", "_OptionsOrNone", "(", "descriptor_proto", ")", ":", "if", "descriptor_proto", ".", "HasField", "(", "'options'", ")", ":", "return", "descriptor_proto", ".", "options", "else", ":", "return", "None" ]
https://github.com/google/shaka-packager/blob/e1b0c7c45431327fd3ce193514a5407d07b39b22/packager/third_party/protobuf/python/google/protobuf/descriptor.py#L894-L899
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_model.py
python
GeneralFittingModel.global_parameters
(self)
return self.fitting_context.global_parameters
Returns the global parameters stored in the model.
Returns the global parameters stored in the model.
[ "Returns", "the", "global", "parameters", "stored", "in", "the", "model", "." ]
def global_parameters(self) -> list: """Returns the global parameters stored in the model.""" return self.fitting_context.global_parameters
[ "def", "global_parameters", "(", "self", ")", "->", "list", ":", "return", "self", ".", "fitting_context", ".", "global_parameters" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/general_fitting/general_fitting_model.py#L86-L88
PaddlePaddle/Paddle
1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c
python/paddle/tensor/math.py
python
maximum
(x, y, name=None)
return _elementwise_op(LayerHelper(op_type, **locals()))
Compare two tensors and returns a new tensor containing the element-wise maxima. The equation is: .. math:: out = max(x, y) **Note**: ``paddle.maximum`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broadcasting` . Args: x (Tensor): ...
Compare two tensors and returns a new tensor containing the element-wise maxima. The equation is:
[ "Compare", "two", "tensors", "and", "returns", "a", "new", "tensor", "containing", "the", "element", "-", "wise", "maxima", ".", "The", "equation", "is", ":" ]
def maximum(x, y, name=None): """ Compare two tensors and returns a new tensor containing the element-wise maxima. The equation is: .. math:: out = max(x, y) **Note**: ``paddle.maximum`` supports broadcasting. If you want know more about broadcasting, please refer to :ref:`user_guide_broad...
[ "def", "maximum", "(", "x", ",", "y", ",", "name", "=", "None", ")", ":", "op_type", "=", "'elementwise_max'", "axis", "=", "-", "1", "act", "=", "None", "if", "in_dygraph_mode", "(", ")", ":", "return", "_elementwise_op_in_dygraph", "(", "x", ",", "y"...
https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/tensor/math.py#L519-L576
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/src/robotsim.py
python
RobotModel.getID
(self)
return _robotsim.RobotModel_getID(self)
getID(RobotModel self) -> int Returns the ID of the robot in its world. Note: The world ID is not the same as the robot index.
getID(RobotModel self) -> int
[ "getID", "(", "RobotModel", "self", ")", "-", ">", "int" ]
def getID(self): """ getID(RobotModel self) -> int Returns the ID of the robot in its world. Note: The world ID is not the same as the robot index. """ return _robotsim.RobotModel_getID(self)
[ "def", "getID", "(", "self", ")", ":", "return", "_robotsim", ".", "RobotModel_getID", "(", "self", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/robotsim.py#L4532-L4543
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/external/boost/boost_1_68_0/tools/build/src/util/utility.py
python
replace_grist
(features, new_grist)
return result
Replaces the grist of a string by a new one. Returns the string with the new grist.
Replaces the grist of a string by a new one. Returns the string with the new grist.
[ "Replaces", "the", "grist", "of", "a", "string", "by", "a", "new", "one", ".", "Returns", "the", "string", "with", "the", "new", "grist", "." ]
def replace_grist (features, new_grist): """ Replaces the grist of a string by a new one. Returns the string with the new grist. """ assert is_iterable_typed(features, basestring) or isinstance(features, basestring) assert isinstance(new_grist, basestring) # this function is used a lot in th...
[ "def", "replace_grist", "(", "features", ",", "new_grist", ")", ":", "assert", "is_iterable_typed", "(", "features", ",", "basestring", ")", "or", "isinstance", "(", "features", ",", "basestring", ")", "assert", "isinstance", "(", "new_grist", ",", "basestring",...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/boost/boost_1_68_0/tools/build/src/util/utility.py#L56-L83
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/layers/python/layers/embedding_ops.py
python
embedding_lookup_unique
(params, ids, name=None)
Version of embedding_lookup that avoids duplicate lookups. This can save communication in the case of repeated ids. Same interface as embedding_lookup. Except it supports multi-dimensional `ids` which allows to not reshape input/output to fit gather. Args: params: A list of tensors with the same shape and...
Version of embedding_lookup that avoids duplicate lookups.
[ "Version", "of", "embedding_lookup", "that", "avoids", "duplicate", "lookups", "." ]
def embedding_lookup_unique(params, ids, name=None): """Version of embedding_lookup that avoids duplicate lookups. This can save communication in the case of repeated ids. Same interface as embedding_lookup. Except it supports multi-dimensional `ids` which allows to not reshape input/output to fit gather. A...
[ "def", "embedding_lookup_unique", "(", "params", ",", "ids", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"EmbeddingLookupUnique\"", ",", "[", "params", ",", "ids", "]", ")", ":", "ids", "=", "ops", ".", "co...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/layers/python/layers/embedding_ops.py#L448-L482
bigartm/bigartm
47e37f982de87aa67bfd475ff1f39da696b181b3
3rdparty/protobuf-3.0.0/python/google/protobuf/internal/containers.py
python
RepeatedScalarFieldContainer.__delitem__
(self, key)
Deletes the item at the specified position.
Deletes the item at the specified position.
[ "Deletes", "the", "item", "at", "the", "specified", "position", "." ]
def __delitem__(self, key): """Deletes the item at the specified position.""" del self._values[key] self._message_listener.Modified()
[ "def", "__delitem__", "(", "self", ",", "key", ")", ":", "del", "self", ".", "_values", "[", "key", "]", "self", ".", "_message_listener", ".", "Modified", "(", ")" ]
https://github.com/bigartm/bigartm/blob/47e37f982de87aa67bfd475ff1f39da696b181b3/3rdparty/protobuf-3.0.0/python/google/protobuf/internal/containers.py#L320-L323
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/ez_setup.py
python
download_setuptools
( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay = 15 )
return os.path.realpath(saveto)
Download setuptools from a specified location and return its filename `version` should be a valid setuptools version number that is available as an egg for download under the `download_base` URL (which should end with a '/'). `to_dir` is the directory where the egg will be downloaded. `delay` is the nu...
Download setuptools from a specified location and return its filename
[ "Download", "setuptools", "from", "a", "specified", "location", "and", "return", "its", "filename" ]
def download_setuptools( version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay = 15 ): """Download setuptools from a specified location and return its filename `version` should be a valid setuptools version number that is available as an egg for download under the `download_ba...
[ "def", "download_setuptools", "(", "version", "=", "DEFAULT_VERSION", ",", "download_base", "=", "DEFAULT_URL", ",", "to_dir", "=", "os", ".", "curdir", ",", "delay", "=", "15", ")", ":", "import", "urllib2", ",", "shutil", "egg_name", "=", "\"setuptools-%s-py...
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/ez_setup.py#L127-L172
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/core/fromnumeric.py
python
amin
(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue, where=np._NoValue)
return _wrapreduction(a, np.minimum, 'min', axis, None, out, keepdims=keepdims, initial=initial, where=where)
Return the minimum of an array or minimum along an axis. Parameters ---------- a : array_like Input data. axis : None or int or tuple of ints, optional Axis or axes along which to operate. By default, flattened input is used. .. versionadded:: 1.7.0 If this is...
Return the minimum of an array or minimum along an axis.
[ "Return", "the", "minimum", "of", "an", "array", "or", "minimum", "along", "an", "axis", "." ]
def amin(a, axis=None, out=None, keepdims=np._NoValue, initial=np._NoValue, where=np._NoValue): """ Return the minimum of an array or minimum along an axis. Parameters ---------- a : array_like Input data. axis : None or int or tuple of ints, optional Axis or axes along...
[ "def", "amin", "(", "a", ",", "axis", "=", "None", ",", "out", "=", "None", ",", "keepdims", "=", "np", ".", "_NoValue", ",", "initial", "=", "np", ".", "_NoValue", ",", "where", "=", "np", ".", "_NoValue", ")", ":", "return", "_wrapreduction", "("...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/core/fromnumeric.py#L2764-L2880
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/src/robotsim.py
python
SimRobotController.setTorque
(self, t: "doubleVector")
return _robotsim.SimRobotController_setTorque(self, t)
r""" setTorque(SimRobotController self, doubleVector t) Sets a torque command controller. t can have size model().numDrivers() or model().numLinks().
r""" setTorque(SimRobotController self, doubleVector t)
[ "r", "setTorque", "(", "SimRobotController", "self", "doubleVector", "t", ")" ]
def setTorque(self, t: "doubleVector") -> "void": r""" setTorque(SimRobotController self, doubleVector t) Sets a torque command controller. t can have size model().numDrivers() or model().numLinks(). """ return _robotsim.SimRobotController_setTorque(self, t)
[ "def", "setTorque", "(", "self", ",", "t", ":", "\"doubleVector\"", ")", "->", "\"void\"", ":", "return", "_robotsim", ".", "SimRobotController_setTorque", "(", "self", ",", "t", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/src/robotsim.py#L7696-L7705
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/xml/dom/expatbuilder.py
python
ExpatBuilder.parseFile
(self, file)
return doc
Parse a document from a file object, returning the document node.
Parse a document from a file object, returning the document node.
[ "Parse", "a", "document", "from", "a", "file", "object", "returning", "the", "document", "node", "." ]
def parseFile(self, file): """Parse a document from a file object, returning the document node.""" parser = self.getParser() first_buffer = True try: while 1: buffer = file.read(16*1024) if not buffer: break ...
[ "def", "parseFile", "(", "self", ",", "file", ")", ":", "parser", "=", "self", ".", "getParser", "(", ")", "first_buffer", "=", "True", "try", ":", "while", "1", ":", "buffer", "=", "file", ".", "read", "(", "16", "*", "1024", ")", "if", "not", "...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/xml/dom/expatbuilder.py#L197-L217
h2oai/datatable
753197c3f76041dd6468e0f6a9708af92d80f6aa
src/datatable/expr/reduce.py
python
corr
(col1, col2)
return Expr(OpCodes.CORR, (col1, col2))
Compute Pearson correlation coefficient between two columns.
Compute Pearson correlation coefficient between two columns.
[ "Compute", "Pearson", "correlation", "coefficient", "between", "two", "columns", "." ]
def corr(col1, col2): """ Compute Pearson correlation coefficient between two columns. """ return Expr(OpCodes.CORR, (col1, col2))
[ "def", "corr", "(", "col1", ",", "col2", ")", ":", "return", "Expr", "(", "OpCodes", ".", "CORR", ",", "(", "col1", ",", "col2", ")", ")" ]
https://github.com/h2oai/datatable/blob/753197c3f76041dd6468e0f6a9708af92d80f6aa/src/datatable/expr/reduce.py#L106-L110
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_controls.py
python
Notebook.SetPadding
(*args, **kwargs)
return _controls_.Notebook_SetPadding(*args, **kwargs)
SetPadding(self, Size padding)
SetPadding(self, Size padding)
[ "SetPadding", "(", "self", "Size", "padding", ")" ]
def SetPadding(*args, **kwargs): """SetPadding(self, Size padding)""" return _controls_.Notebook_SetPadding(*args, **kwargs)
[ "def", "SetPadding", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "Notebook_SetPadding", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_controls.py#L3096-L3098
tiny-dnn/tiny-dnn
c0f576f5cb7b35893f62127cb7aec18f77a3bcc5
third_party/gemmlowp/meta/generators/mul_Nx8_Mx8_neon.py
python
Duplicate
(emitter, registers, rows, cols, min_register, values)
return duplicated
Populate a grid of registers duplicating provided values.
Populate a grid of registers duplicating provided values.
[ "Populate", "a", "grid", "of", "registers", "duplicating", "provided", "values", "." ]
def Duplicate(emitter, registers, rows, cols, min_register, values): """Populate a grid of registers duplicating provided values.""" duplicated = [RegisterForCols(registers, cols, min_register) for unused_i in range(rows)] for i in range(rows): emitter.EmitVDup('32', duplicated[i], emitter.La...
[ "def", "Duplicate", "(", "emitter", ",", "registers", ",", "rows", ",", "cols", ",", "min_register", ",", "values", ")", ":", "duplicated", "=", "[", "RegisterForCols", "(", "registers", ",", "cols", ",", "min_register", ")", "for", "unused_i", "in", "rang...
https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/gemmlowp/meta/generators/mul_Nx8_Mx8_neon.py#L148-L156
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/json_schema_compiler/cc_generator.py
python
_Generator._GenerateCreateCallbackArguments
(self, function_scope, callback)
return c
Generate all functions to create Value parameters for a callback. E.g for function "Bar", generate Bar::Results::Create E.g for event "Baz", generate Baz::Create function_scope: the function scope path, e.g. Foo::Bar for the function Foo::Bar::Baz(). May be None if there is no function...
Generate all functions to create Value parameters for a callback.
[ "Generate", "all", "functions", "to", "create", "Value", "parameters", "for", "a", "callback", "." ]
def _GenerateCreateCallbackArguments(self, function_scope, callback): """Generate all functions to create Value parameters for a callback. E.g for function "Bar", generate Bar::Results::Create E.g for event "Baz", generate Baz::Create function_scope: the function scope path, e.g. Foo::Bar for the func...
[ "def", "_GenerateCreateCallbackArguments", "(", "self", ",", "function_scope", ",", "callback", ")", ":", "c", "=", "Code", "(", ")", "params", "=", "callback", ".", "params", "c", ".", "Concat", "(", "self", ".", "_GeneratePropertyFunctions", "(", "function_s...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/json_schema_compiler/cc_generator.py#L863-L895
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pythonapi.py
python
PythonAPI.tuple_getitem
(self, tup, idx)
return self.builder.call(fn, [tup, idx])
Borrow reference
Borrow reference
[ "Borrow", "reference" ]
def tuple_getitem(self, tup, idx): """ Borrow reference """ fnty = Type.function(self.pyobj, [self.pyobj, self.py_ssize_t]) fn = self._get_function(fnty, name="PyTuple_GetItem") idx = self.context.get_constant(types.intp, idx) return self.builder.call(fn, [tup, id...
[ "def", "tuple_getitem", "(", "self", ",", "tup", ",", "idx", ")", ":", "fnty", "=", "Type", ".", "function", "(", "self", ".", "pyobj", ",", "[", "self", ".", "pyobj", ",", "self", ".", "py_ssize_t", "]", ")", "fn", "=", "self", ".", "_get_function...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/pythonapi.py#L766-L773
SequoiaDB/SequoiaDB
2894ed7e5bd6fe57330afc900cf76d0ff0df9f64
tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py
python
uCSIsYiSyllables
(code)
return ret
Check whether the character is part of YiSyllables UCS Block
Check whether the character is part of YiSyllables UCS Block
[ "Check", "whether", "the", "character", "is", "part", "of", "YiSyllables", "UCS", "Block" ]
def uCSIsYiSyllables(code): """Check whether the character is part of YiSyllables UCS Block """ ret = libxml2mod.xmlUCSIsYiSyllables(code) return ret
[ "def", "uCSIsYiSyllables", "(", "code", ")", ":", "ret", "=", "libxml2mod", ".", "xmlUCSIsYiSyllables", "(", "code", ")", "return", "ret" ]
https://github.com/SequoiaDB/SequoiaDB/blob/2894ed7e5bd6fe57330afc900cf76d0ff0df9f64/tools/server/php_linux/libxml2/lib/python2.4/site-packages/libxml2.py#L2936-L2939
lmb-freiburg/flownet2
b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc
scripts/cpp_lint.py
python
_NestingState.InnermostClass
(self)
return None
Get class info on the top of the stack. Returns: A _ClassInfo object if we are inside a class, or None otherwise.
Get class info on the top of the stack.
[ "Get", "class", "info", "on", "the", "top", "of", "the", "stack", "." ]
def InnermostClass(self): """Get class info on the top of the stack. Returns: A _ClassInfo object if we are inside a class, or None otherwise. """ for i in range(len(self.stack), 0, -1): classinfo = self.stack[i - 1] if isinstance(classinfo, _ClassInfo): return classinfo r...
[ "def", "InnermostClass", "(", "self", ")", ":", "for", "i", "in", "range", "(", "len", "(", "self", ".", "stack", ")", ",", "0", ",", "-", "1", ")", ":", "classinfo", "=", "self", ".", "stack", "[", "i", "-", "1", "]", "if", "isinstance", "(", ...
https://github.com/lmb-freiburg/flownet2/blob/b92e198b56b0e52e1ba0a5a98dc0e39fa5ae70cc/scripts/cpp_lint.py#L2160-L2170
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/msvc.py
python
_msvc14_find_vc2017
()
return None, None
Python 3.8 "distutils/_msvccompiler.py" backport Returns "15, path" based on the result of invoking vswhere.exe If no install is found, returns "None, None" The version is returned to avoid unnecessarily changing the function result. It may be ignored when the path is not None. If vswhere.exe is ...
Python 3.8 "distutils/_msvccompiler.py" backport
[ "Python", "3", ".", "8", "distutils", "/", "_msvccompiler", ".", "py", "backport" ]
def _msvc14_find_vc2017(): """Python 3.8 "distutils/_msvccompiler.py" backport Returns "15, path" based on the result of invoking vswhere.exe If no install is found, returns "None, None" The version is returned to avoid unnecessarily changing the function result. It may be ignored when the path is...
[ "def", "_msvc14_find_vc2017", "(", ")", ":", "root", "=", "environ", ".", "get", "(", "\"ProgramFiles(x86)\"", ")", "or", "environ", ".", "get", "(", "\"ProgramFiles\"", ")", "if", "not", "root", ":", "return", "None", ",", "None", "try", ":", "path", "=...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/msvc.py#L176-L208
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
syzygy/build/app_verifier.py
python
Colorize
(text)
return '\n'.join([_ColorizeLine(line) for line in text.split('\n')])
Colorizes the given app verifier output with ANSI color codes.
Colorizes the given app verifier output with ANSI color codes.
[ "Colorizes", "the", "given", "app", "verifier", "output", "with", "ANSI", "color", "codes", "." ]
def Colorize(text): """Colorizes the given app verifier output with ANSI color codes.""" fore = colorama.Fore style = colorama.Style def _ColorizeLine(line): line = re.sub('^(Error.*:)(.*)', style.BRIGHT + fore.RED + '\\1' + fore.YELLOW + '\\2' + style.RESET_ALL, ...
[ "def", "Colorize", "(", "text", ")", ":", "fore", "=", "colorama", ".", "Fore", "style", "=", "colorama", ".", "Style", "def", "_ColorizeLine", "(", "line", ")", ":", "line", "=", "re", ".", "sub", "(", "'^(Error.*:)(.*)'", ",", "style", ".", "BRIGHT",...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/syzygy/build/app_verifier.py#L138-L152
fabianschenk/REVO
eb949c0fdbcdf0be09a38464eb0592a90803947f
thirdparty/Sophus/py/sophus/complex.py
python
Complex.__truediv__
(self, scalar)
return Complex(self.real / scalar, self.imag / scalar)
scalar division
scalar division
[ "scalar", "division" ]
def __truediv__(self, scalar): """ scalar division """ return Complex(self.real / scalar, self.imag / scalar)
[ "def", "__truediv__", "(", "self", ",", "scalar", ")", ":", "return", "Complex", "(", "self", ".", "real", "/", "scalar", ",", "self", ".", "imag", "/", "scalar", ")" ]
https://github.com/fabianschenk/REVO/blob/eb949c0fdbcdf0be09a38464eb0592a90803947f/thirdparty/Sophus/py/sophus/complex.py#L25-L27
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Arch/ArchSectionPlane.py
python
getCameraData
(floatlist)
return c
reconstructs a valid camera data string from stored values
reconstructs a valid camera data string from stored values
[ "reconstructs", "a", "valid", "camera", "data", "string", "from", "stored", "values" ]
def getCameraData(floatlist): """reconstructs a valid camera data string from stored values""" c = "" if len(floatlist) >= 12: d = floatlist camtype = "orthographic" if len(floatlist) == 13: if d[12] == 1: camtype = "perspective" if camtype == "o...
[ "def", "getCameraData", "(", "floatlist", ")", ":", "c", "=", "\"\"", "if", "len", "(", "floatlist", ")", ">=", "12", ":", "d", "=", "floatlist", "camtype", "=", "\"orthographic\"", "if", "len", "(", "floatlist", ")", "==", "13", ":", "if", "d", "[",...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchSectionPlane.py#L652-L675
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/v7.9.317/third_party/jinja2/utils.py
python
environmentfunction
(f)
return f
This decorator can be used to mark a function or method as environment callable. This decorator works exactly like the :func:`contextfunction` decorator just that the first argument is the active :class:`Environment` and not context.
This decorator can be used to mark a function or method as environment callable. This decorator works exactly like the :func:`contextfunction` decorator just that the first argument is the active :class:`Environment` and not context.
[ "This", "decorator", "can", "be", "used", "to", "mark", "a", "function", "or", "method", "as", "environment", "callable", ".", "This", "decorator", "works", "exactly", "like", "the", ":", "func", ":", "contextfunction", "decorator", "just", "that", "the", "f...
def environmentfunction(f): """This decorator can be used to mark a function or method as environment callable. This decorator works exactly like the :func:`contextfunction` decorator just that the first argument is the active :class:`Environment` and not context. """ f.environmentfunction = Tr...
[ "def", "environmentfunction", "(", "f", ")", ":", "f", ".", "environmentfunction", "=", "True", "return", "f" ]
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/v7.9.317/third_party/jinja2/utils.py#L73-L80
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
buildscripts/idl/idl/errors.py
python
ParserContext.add_duplicate_action_types
(self, location, name)
Add an error about specifying an action type twice in the same list.
Add an error about specifying an action type twice in the same list.
[ "Add", "an", "error", "about", "specifying", "an", "action", "type", "twice", "in", "the", "same", "list", "." ]
def add_duplicate_action_types(self, location, name): # type: (common.SourceLocation, str) -> None """Add an error about specifying an action type twice in the same list.""" # pylint: disable=invalid-name self._add_error(location, ERROR_ID_DUPLICATE_ACTION_TYPE, "...
[ "def", "add_duplicate_action_types", "(", "self", ",", "location", ",", "name", ")", ":", "# type: (common.SourceLocation, str) -> None", "# pylint: disable=invalid-name", "self", ".", "_add_error", "(", "location", ",", "ERROR_ID_DUPLICATE_ACTION_TYPE", ",", "\"Cannot specif...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/buildscripts/idl/idl/errors.py#L933-L938
arkenthera/electron-vibrancy
383153ef9ccb23a6c7517150d6bb0794dff3115e
scripts/cpplint.py
python
CheckPrintf
(filename, clean_lines, linenum, error)
Check for printf related issues. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check for printf related issues.
[ "Check", "for", "printf", "related", "issues", "." ]
def CheckPrintf(filename, clean_lines, linenum, error): """Check for printf related issues. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found. """ l...
[ "def", "CheckPrintf", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# When snprintf is used, the second argument shouldn't be a literal.", "match", "=", "Search", "(", "r...
https://github.com/arkenthera/electron-vibrancy/blob/383153ef9ccb23a6c7517150d6bb0794dff3115e/scripts/cpplint.py#L4483-L4509
etotheipi/BitcoinArmory
2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98
armoryd.py
python
Armory_Json_Rpc_Server.jsonrpc_gethextxtobroadcast
(self, txASCIIFile)
return self.retStr
DESCRIPTION: Get a signed Tx from a file and get the raw hex data to broadcast. PARAMETERS: txASCIIFile - The path to a file with a signed transacion. RETURN: A hex string of the raw transaction data to be transmitted.
DESCRIPTION: Get a signed Tx from a file and get the raw hex data to broadcast. PARAMETERS: txASCIIFile - The path to a file with a signed transacion. RETURN: A hex string of the raw transaction data to be transmitted.
[ "DESCRIPTION", ":", "Get", "a", "signed", "Tx", "from", "a", "file", "and", "get", "the", "raw", "hex", "data", "to", "broadcast", ".", "PARAMETERS", ":", "txASCIIFile", "-", "The", "path", "to", "a", "file", "with", "a", "signed", "transacion", ".", "...
def jsonrpc_gethextxtobroadcast(self, txASCIIFile): """ DESCRIPTION: Get a signed Tx from a file and get the raw hex data to broadcast. PARAMETERS: txASCIIFile - The path to a file with a signed transacion. RETURN: A hex string of the raw transaction data to be transmitted. ...
[ "def", "jsonrpc_gethextxtobroadcast", "(", "self", ",", "txASCIIFile", ")", ":", "ustxObj", "=", "None", "enoughSigs", "=", "False", "sigStatus", "=", "None", "sigsValid", "=", "False", "ustxReadable", "=", "False", "allData", "=", "''", "finalTx", "=", "None"...
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryd.py#L2666-L2734
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/__init__.py
python
Logger.handle
(self, record)
Call the handlers for the specified record. This method is used for unpickled records received from a socket, as well as those created locally. Logger-level filtering is applied.
Call the handlers for the specified record.
[ "Call", "the", "handlers", "for", "the", "specified", "record", "." ]
def handle(self, record): """ Call the handlers for the specified record. This method is used for unpickled records received from a socket, as well as those created locally. Logger-level filtering is applied. """ if (not self.disabled) and self.filter(record): ...
[ "def", "handle", "(", "self", ",", "record", ")", ":", "if", "(", "not", "self", ".", "disabled", ")", "and", "self", ".", "filter", "(", "record", ")", ":", "self", ".", "callHandlers", "(", "record", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/logging/__init__.py#L1270-L1278
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/ndarray/random.py
python
normal
(loc=0, scale=1, shape=_Null, dtype=_Null, ctx=None, out=None, **kwargs)
return _random_helper(_internal._random_normal, _internal._sample_normal, [loc, scale], shape, dtype, ctx, out, kwargs)
Draw random samples from a normal (Gaussian) distribution. Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation). Parameters ---------- loc : float or NDArray, optional Mean (centre) of the distribution. scale : float ...
Draw random samples from a normal (Gaussian) distribution.
[ "Draw", "random", "samples", "from", "a", "normal", "(", "Gaussian", ")", "distribution", "." ]
def normal(loc=0, scale=1, shape=_Null, dtype=_Null, ctx=None, out=None, **kwargs): """Draw random samples from a normal (Gaussian) distribution. Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation). Parameters ---------- loc...
[ "def", "normal", "(", "loc", "=", "0", ",", "scale", "=", "1", ",", "shape", "=", "_Null", ",", "dtype", "=", "_Null", ",", "ctx", "=", "None", ",", "out", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "_random_helper", "(", "_interna...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/random.py#L113-L167
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rosmaster/src/rosmaster/master_api.py
python
ROSMasterHandler._ready
(self, uri)
Initialize the handler with the XMLRPC URI. This is a standard callback from the XmlRpcNode API. @param uri: XML-RPC URI @type uri: str
Initialize the handler with the XMLRPC URI. This is a standard callback from the XmlRpcNode API.
[ "Initialize", "the", "handler", "with", "the", "XMLRPC", "URI", ".", "This", "is", "a", "standard", "callback", "from", "the", "XmlRpcNode", "API", "." ]
def _ready(self, uri): """ Initialize the handler with the XMLRPC URI. This is a standard callback from the XmlRpcNode API. @param uri: XML-RPC URI @type uri: str """ self.uri = uri
[ "def", "_ready", "(", "self", ",", "uri", ")", ":", "self", ".", "uri", "=", "uri" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rosmaster/src/rosmaster/master_api.py#L268-L275
protocolbuffers/protobuf
b5ab0b7a18b7336c60130f4ddb2d97c51792f896
python/mox.py
python
Regex.equals
(self, rhs)
return self.regex.search(rhs) is not None
Check to see if rhs matches regular expression pattern. Returns: bool
Check to see if rhs matches regular expression pattern.
[ "Check", "to", "see", "if", "rhs", "matches", "regular", "expression", "pattern", "." ]
def equals(self, rhs): """Check to see if rhs matches regular expression pattern. Returns: bool """ return self.regex.search(rhs) is not None
[ "def", "equals", "(", "self", ",", "rhs", ")", ":", "return", "self", ".", "regex", ".", "search", "(", "rhs", ")", "is", "not", "None" ]
https://github.com/protocolbuffers/protobuf/blob/b5ab0b7a18b7336c60130f4ddb2d97c51792f896/python/mox.py#L922-L929
rdiankov/openrave
d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7
python/ikfast.py
python
IKFastSolver.ConvertSinCosEquationToHalfTan
(self, eq, convertvars)
return eqnew, othereq, htvarsubsinv
converts all the sin/cos of variables to half-tangents. Returns two equations (poly, denominator)
converts all the sin/cos of variables to half-tangents. Returns two equations (poly, denominator)
[ "converts", "all", "the", "sin", "/", "cos", "of", "variables", "to", "half", "-", "tangents", ".", "Returns", "two", "equations", "(", "poly", "denominator", ")" ]
def ConvertSinCosEquationToHalfTan(self, eq, convertvars): """converts all the sin/cos of variables to half-tangents. Returns two equations (poly, denominator) """ cossinvars = [] htvarsubs = [] htvars = [] htvarsubsinv = [] cossinsubs = [] for varsym in c...
[ "def", "ConvertSinCosEquationToHalfTan", "(", "self", ",", "eq", ",", "convertvars", ")", ":", "cossinvars", "=", "[", "]", "htvarsubs", "=", "[", "]", "htvars", "=", "[", "]", "htvarsubsinv", "=", "[", "]", "cossinsubs", "=", "[", "]", "for", "varsym", ...
https://github.com/rdiankov/openrave/blob/d1a23023fd4b58f077d2ca949ceaf1b91f3f13d7/python/ikfast.py#L5829-L5873
aristanetworks/EosSdk
a824c1be13152a1ef8e5bc1b28d42585bf1308a6
examples/InterfaceMonitor.py
python
InterfaceMonitor.on_oper_status
(self, intfId, operState)
Callback provided by IntfHandler when an interface's configuration changes
Callback provided by IntfHandler when an interface's configuration changes
[ "Callback", "provided", "by", "IntfHandler", "when", "an", "interface", "s", "configuration", "changes" ]
def on_oper_status(self, intfId, operState): """ Callback provided by IntfHandler when an interface's configuration changes """ self.numIntfChanges_ += 1 intfState = 'up' if operState == eossdk.INTF_OPER_UP else 'down' lastChangeTime = re.sub( ' +', ' ', time.ctime() ) self.tracer.tr...
[ "def", "on_oper_status", "(", "self", ",", "intfId", ",", "operState", ")", ":", "self", ".", "numIntfChanges_", "+=", "1", "intfState", "=", "'up'", "if", "operState", "==", "eossdk", ".", "INTF_OPER_UP", "else", "'down'", "lastChangeTime", "=", "re", ".", ...
https://github.com/aristanetworks/EosSdk/blob/a824c1be13152a1ef8e5bc1b28d42585bf1308a6/examples/InterfaceMonitor.py#L39-L56
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/signal/_peak_finding.py
python
_boolrelextrema
(data, comparator, axis=0, order=1, mode='clip')
return results
Calculate the relative extrema of `data`. Relative extrema are calculated by finding locations where ``comparator(data[n], data[n+1:n+order+1])`` is True. Parameters ---------- data : ndarray Array in which to find the relative extrema. comparator : callable Function to use to ...
Calculate the relative extrema of `data`.
[ "Calculate", "the", "relative", "extrema", "of", "data", "." ]
def _boolrelextrema(data, comparator, axis=0, order=1, mode='clip'): """ Calculate the relative extrema of `data`. Relative extrema are calculated by finding locations where ``comparator(data[n], data[n+1:n+order+1])`` is True. Parameters ---------- data : ndarray Array in which to...
[ "def", "_boolrelextrema", "(", "data", ",", "comparator", ",", "axis", "=", "0", ",", "order", "=", "1", ",", "mode", "=", "'clip'", ")", ":", "if", "(", "(", "int", "(", "order", ")", "!=", "order", ")", "or", "(", "order", "<", "1", ")", ")",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/_peak_finding.py#L25-L81
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py2/IPython/utils/io.py
python
temp_pyfile
(src, ext='.py')
return fname, f
Make a temporary python file, return filename and filehandle. Parameters ---------- src : string or list of strings (no need for ending newlines if list) Source code to be written to the file. ext : optional, string Extension for the generated file. Returns ------- (filename, ...
Make a temporary python file, return filename and filehandle.
[ "Make", "a", "temporary", "python", "file", "return", "filename", "and", "filehandle", "." ]
def temp_pyfile(src, ext='.py'): """Make a temporary python file, return filename and filehandle. Parameters ---------- src : string or list of strings (no need for ending newlines if list) Source code to be written to the file. ext : optional, string Extension for the generated file. ...
[ "def", "temp_pyfile", "(", "src", ",", "ext", "=", "'.py'", ")", ":", "fname", "=", "tempfile", ".", "mkstemp", "(", "ext", ")", "[", "1", "]", "f", "=", "open", "(", "fname", ",", "'w'", ")", "f", ".", "write", "(", "src", ")", "f", ".", "fl...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py2/IPython/utils/io.py#L193-L213
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/collective_ops_benchmark.py
python
CollectiveOpBenchmark.benchmark_collective
(self)
Measures the performance of local CPU collective execution.
Measures the performance of local CPU collective execution.
[ "Measures", "the", "performance", "of", "local", "CPU", "collective", "execution", "." ]
def benchmark_collective(self): """Measures the performance of local CPU collective execution.""" shapes = [(10,), (1000,), (1000000,)] devices = [2, 4, 8] collective_key_counter = 0 for group_size in devices: group_key = collective_key_counter instance_key = collective_key_counter ...
[ "def", "benchmark_collective", "(", "self", ")", ":", "shapes", "=", "[", "(", "10", ",", ")", ",", "(", "1000", ",", ")", ",", "(", "1000000", ",", ")", "]", "devices", "=", "[", "2", ",", "4", ",", "8", "]", "collective_key_counter", "=", "0", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/collective_ops_benchmark.py#L35-L82
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/math/spline.py
python
bezier_subdivide
(x1,x2,x3,x4,u=0.5)
return [(x1,p1,q1,r1),(r1,q2,p3,x4)]
Subdivides a Bezier curve at the parameter u
Subdivides a Bezier curve at the parameter u
[ "Subdivides", "a", "Bezier", "curve", "at", "the", "parameter", "u" ]
def bezier_subdivide(x1,x2,x3,x4,u=0.5): """Subdivides a Bezier curve at the parameter u""" p1 = vectorops.interpolate(x1,x2,u) p2 = vectorops.interpolate(x2,x3,u) p3 = vectorops.interpolate(x3,x4,u) q1 = vectorops.interpolate(p1,p2,u) q2 = vectorops.interpolate(p2,p3,u) r1 = vectorops.inter...
[ "def", "bezier_subdivide", "(", "x1", ",", "x2", ",", "x3", ",", "x4", ",", "u", "=", "0.5", ")", ":", "p1", "=", "vectorops", ".", "interpolate", "(", "x1", ",", "x2", ",", "u", ")", "p2", "=", "vectorops", ".", "interpolate", "(", "x2", ",", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/spline.py#L79-L87
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matrixlib/defmatrix.py
python
matrix.getH
(self)
Returns the (complex) conjugate transpose of `self`. Equivalent to ``np.transpose(self)`` if `self` is real-valued. Parameters ---------- None Returns ------- ret : matrix object complex conjugate transpose of `self` Examples ------...
Returns the (complex) conjugate transpose of `self`.
[ "Returns", "the", "(", "complex", ")", "conjugate", "transpose", "of", "self", "." ]
def getH(self): """ Returns the (complex) conjugate transpose of `self`. Equivalent to ``np.transpose(self)`` if `self` is real-valued. Parameters ---------- None Returns ------- ret : matrix object complex conjugate transpose of `se...
[ "def", "getH", "(", "self", ")", ":", "if", "issubclass", "(", "self", ".", "dtype", ".", "type", ",", "N", ".", "complexfloating", ")", ":", "return", "self", ".", "transpose", "(", ")", ".", "conjugate", "(", ")", "else", ":", "return", "self", "...
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/matrixlib/defmatrix.py#L960-L992
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/adodbapi/adodbapi.py
python
Cursor.fetchone
(self)
return None
Fetch the next row of a query result set, returning a single sequence, or None when no more data is available. An Error (or subclass) exception is raised if the previous call to executeXXX() did not produce any result set or no call was issued yet.
Fetch the next row of a query result set, returning a single sequence, or None when no more data is available.
[ "Fetch", "the", "next", "row", "of", "a", "query", "result", "set", "returning", "a", "single", "sequence", "or", "None", "when", "no", "more", "data", "is", "available", "." ]
def fetchone(self): """ Fetch the next row of a query result set, returning a single sequence, or None when no more data is available. An Error (or subclass) exception is raised if the previous call to executeXXX() did not produce any result set or no call was issued yet. ...
[ "def", "fetchone", "(", "self", ")", ":", "self", ".", "messages", "=", "[", "]", "result", "=", "self", ".", "_fetch", "(", "1", ")", "if", "result", ":", "# return record (not list of records)", "return", "result", "[", "0", "]", "return", "None" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/adodbapi/adodbapi.py#L1045-L1056
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/control/robotinterface.py
python
RobotInterfaceBase.partInterface
(self, part: str, joint_idx: Optional[int] = None )
Returns a RobotInterfaceBase that allows control of the given part/joint. If no such controller exists, raises a NotImplementedError. The part/joint controller should operate on exactly the DOFs specified by self.indices(part,joint_idx).
Returns a RobotInterfaceBase that allows control of the given part/joint. If no such controller exists, raises a NotImplementedError.
[ "Returns", "a", "RobotInterfaceBase", "that", "allows", "control", "of", "the", "given", "part", "/", "joint", ".", "If", "no", "such", "controller", "exists", "raises", "a", "NotImplementedError", "." ]
def partInterface(self, part: str, joint_idx: Optional[int] = None ) -> 'RobotInterfaceBase': """Returns a RobotInterfaceBase that allows control of the given part/joint. If no such controller exists, raises a NotImplementedError. The part/joint control...
[ "def", "partInterface", "(", "self", ",", "part", ":", "str", ",", "joint_idx", ":", "Optional", "[", "int", "]", "=", "None", ")", "->", "'RobotInterfaceBase'", ":", "raise", "NotImplementedError", "(", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/control/robotinterface.py#L332-L343
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/environment.py
python
Template.is_up_to_date
(self)
return self._uptodate()
If this variable is `False` there is a newer version available.
If this variable is `False` there is a newer version available.
[ "If", "this", "variable", "is", "False", "there", "is", "a", "newer", "version", "available", "." ]
def is_up_to_date(self): """If this variable is `False` there is a newer version available.""" if self._uptodate is None: return True return self._uptodate()
[ "def", "is_up_to_date", "(", "self", ")", ":", "if", "self", ".", "_uptodate", "is", "None", ":", "return", "True", "return", "self", ".", "_uptodate", "(", ")" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/environment.py#L1062-L1066
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/calendar.py
python
CalendarCtrlBase.SetHolidayColours
(*args, **kwargs)
return _calendar.CalendarCtrlBase_SetHolidayColours(*args, **kwargs)
SetHolidayColours(self, Colour colFg, Colour colBg) Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used).
SetHolidayColours(self, Colour colFg, Colour colBg)
[ "SetHolidayColours", "(", "self", "Colour", "colFg", "Colour", "colBg", ")" ]
def SetHolidayColours(*args, **kwargs): """ SetHolidayColours(self, Colour colFg, Colour colBg) Holiday colour is used for the holidays (if CAL_SHOW_HOLIDAYS style is used). """ return _calendar.CalendarCtrlBase_SetHolidayColours(*args, **kwargs)
[ "def", "SetHolidayColours", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_calendar", ".", "CalendarCtrlBase_SetHolidayColours", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/calendar.py#L360-L367
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/data_structures/sframe.py
python
SFrame.head
(self, n=10)
return SFrame(_proxy=self.__proxy__.head(n))
The first n rows of the SFrame. Parameters ---------- n : int, optional The number of rows to fetch. Returns ------- out : SFrame A new SFrame which contains the first n rows of the current SFrame See Also -------- tail, ...
The first n rows of the SFrame.
[ "The", "first", "n", "rows", "of", "the", "SFrame", "." ]
def head(self, n=10): """ The first n rows of the SFrame. Parameters ---------- n : int, optional The number of rows to fetch. Returns ------- out : SFrame A new SFrame which contains the first n rows of the current SFrame ...
[ "def", "head", "(", "self", ",", "n", "=", "10", ")", ":", "return", "SFrame", "(", "_proxy", "=", "self", ".", "__proxy__", ".", "head", "(", "n", ")", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/data_structures/sframe.py#L2547-L2565
9miao/CrossApp
1f5375e061bf69841eb19728598f5ae3f508d620
tools/bindings-generator/generator.py
python
Generator._sorted_parents
(self, nclass)
return sorted_parents
returns the sorted list of parents for a native class
returns the sorted list of parents for a native class
[ "returns", "the", "sorted", "list", "of", "parents", "for", "a", "native", "class" ]
def _sorted_parents(self, nclass): ''' returns the sorted list of parents for a native class ''' sorted_parents = [] for p in nclass.parents: if p.class_name in self.generated_classes.keys(): sorted_parents += self._sorted_parents(p) if nclass....
[ "def", "_sorted_parents", "(", "self", ",", "nclass", ")", ":", "sorted_parents", "=", "[", "]", "for", "p", "in", "nclass", ".", "parents", ":", "if", "p", ".", "class_name", "in", "self", ".", "generated_classes", ".", "keys", "(", ")", ":", "sorted_...
https://github.com/9miao/CrossApp/blob/1f5375e061bf69841eb19728598f5ae3f508d620/tools/bindings-generator/generator.py#L1171-L1181
hszhao/PSPNet
cf7e5a99ba37e46118026e96be5821a9bc63bde0
examples/web_demo/app.py
python
start_from_terminal
(app)
Parse command line options and start the server.
Parse command line options and start the server.
[ "Parse", "command", "line", "options", "and", "start", "the", "server", "." ]
def start_from_terminal(app): """ Parse command line options and start the server. """ parser = optparse.OptionParser() parser.add_option( '-d', '--debug', help="enable debug mode", action="store_true", default=False) parser.add_option( '-p', '--port', hel...
[ "def", "start_from_terminal", "(", "app", ")", ":", "parser", "=", "optparse", ".", "OptionParser", "(", ")", "parser", ".", "add_option", "(", "'-d'", ",", "'--debug'", ",", "help", "=", "\"enable debug mode\"", ",", "action", "=", "\"store_true\"", ",", "d...
https://github.com/hszhao/PSPNet/blob/cf7e5a99ba37e46118026e96be5821a9bc63bde0/examples/web_demo/app.py#L192-L220
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/numpy/py3/numpy/lib/function_base.py
python
copy
(a, order='K', subok=False)
return array(a, order=order, subok=subok, copy=True)
Return an array copy of the given object. Parameters ---------- a : array_like Input data. order : {'C', 'F', 'A', 'K'}, optional Controls the memory layout of the copy. 'C' means C-order, 'F' means F-order, 'A' means 'F' if `a` is Fortran contiguous, 'C' otherwise. 'K' ...
Return an array copy of the given object.
[ "Return", "an", "array", "copy", "of", "the", "given", "object", "." ]
def copy(a, order='K', subok=False): """ Return an array copy of the given object. Parameters ---------- a : array_like Input data. order : {'C', 'F', 'A', 'K'}, optional Controls the memory layout of the copy. 'C' means C-order, 'F' means F-order, 'A' means 'F' if `a` i...
[ "def", "copy", "(", "a", ",", "order", "=", "'K'", ",", "subok", "=", "False", ")", ":", "return", "array", "(", "a", ",", "order", "=", "order", ",", "subok", "=", "subok", ",", "copy", "=", "True", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/numpy/py3/numpy/lib/function_base.py#L727-L804
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/httplib2/upload-diffs.py
python
GuessVCSName
(options)
return (VCS_UNKNOWN, None)
Helper to guess the version control system. This examines the current directory, guesses which VersionControlSystem we're using, and returns an string indicating which VCS is detected. Returns: A pair (vcs, output). vcs is a string indicating which VCS was detected and is one of VCS_GIT, VCS_MERCURIAL,...
Helper to guess the version control system.
[ "Helper", "to", "guess", "the", "version", "control", "system", "." ]
def GuessVCSName(options): """Helper to guess the version control system. This examines the current directory, guesses which VersionControlSystem we're using, and returns an string indicating which VCS is detected. Returns: A pair (vcs, output). vcs is a string indicating which VCS was detected and i...
[ "def", "GuessVCSName", "(", "options", ")", ":", "for", "attribute", ",", "value", "in", "options", ".", "__dict__", ".", "iteritems", "(", ")", ":", "if", "attribute", ".", "startswith", "(", "\"p4\"", ")", "and", "value", "!=", "None", ":", "return", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/httplib2/upload-diffs.py#L1967-L2026
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/saving/saving_utils.py
python
_serialize_nested_config
(config)
return nest.map_structure(_serialize_fn, config)
Serialized a nested structure of Keras objects.
Serialized a nested structure of Keras objects.
[ "Serialized", "a", "nested", "structure", "of", "Keras", "objects", "." ]
def _serialize_nested_config(config): """Serialized a nested structure of Keras objects.""" def _serialize_fn(obj): if callable(obj): return generic_utils.serialize_keras_object(obj) return obj return nest.map_structure(_serialize_fn, config)
[ "def", "_serialize_nested_config", "(", "config", ")", ":", "def", "_serialize_fn", "(", "obj", ")", ":", "if", "callable", "(", "obj", ")", ":", "return", "generic_utils", ".", "serialize_keras_object", "(", "obj", ")", "return", "obj", "return", "nest", "....
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/saving/saving_utils.py#L266-L274
arx/ArxLibertatis
0313c51625f3f55016cdad43d2c7f7296d27949c
scripts/cpplint.py
python
IsErrorSuppressedByNolint
(category, linenum)
return (linenum in _error_suppressions.get(category, set()) or linenum in _error_suppressions.get(None, set()))
Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the current line number. Returns: bool, True iff the error...
Returns true if the specified error category is suppressed on this line.
[ "Returns", "true", "if", "the", "specified", "error", "category", "is", "suppressed", "on", "this", "line", "." ]
def IsErrorSuppressedByNolint(category, linenum): """Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by ParseNolintSuppressions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the curre...
[ "def", "IsErrorSuppressedByNolint", "(", "category", ",", "linenum", ")", ":", "return", "(", "linenum", "in", "_error_suppressions", ".", "get", "(", "category", ",", "set", "(", ")", ")", "or", "linenum", "in", "_error_suppressions", ".", "get", "(", "None...
https://github.com/arx/ArxLibertatis/blob/0313c51625f3f55016cdad43d2c7f7296d27949c/scripts/cpplint.py#L357-L370
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/applications/workbench/workbench/widgets/plotselector/presenter.py
python
PlotSelectorPresenter.update_visibility_icon
(self, plot_number)
Updates the icon to indicate a plot as hidden or visible :param plot_number: The unique number in GlobalFigureManager
Updates the icon to indicate a plot as hidden or visible :param plot_number: The unique number in GlobalFigureManager
[ "Updates", "the", "icon", "to", "indicate", "a", "plot", "as", "hidden", "or", "visible", ":", "param", "plot_number", ":", "The", "unique", "number", "in", "GlobalFigureManager" ]
def update_visibility_icon(self, plot_number): """ Updates the icon to indicate a plot as hidden or visible :param plot_number: The unique number in GlobalFigureManager """ try: is_visible = self.model.is_visible(plot_number) self.view.set_visibility_icon(...
[ "def", "update_visibility_icon", "(", "self", ",", "plot_number", ")", ":", "try", ":", "is_visible", "=", "self", ".", "model", ".", "is_visible", "(", "plot_number", ")", "self", ".", "view", ".", "set_visibility_icon", "(", "plot_number", ",", "is_visible",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/applications/workbench/workbench/widgets/plotselector/presenter.py#L183-L195
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/retdec-3.2/scripts/type_extractor/type_extractor/params_info.py
python
Param.parse_annotations
(self)
Parses annotations from param type to attribute 'annotations'.
Parses annotations from param type to attribute 'annotations'.
[ "Parses", "annotations", "from", "param", "type", "to", "attribute", "annotations", "." ]
def parse_annotations(self): """Parses annotations from param type to attribute 'annotations'.""" found_annots = [] for annot in self.type.split(' '): if annot in ANNOTATIONS: found_annots.append('_opt_' if annot == 'OPTIONAL' else annot) self.type = r...
[ "def", "parse_annotations", "(", "self", ")", ":", "found_annots", "=", "[", "]", "for", "annot", "in", "self", ".", "type", ".", "split", "(", "' '", ")", ":", "if", "annot", "in", "ANNOTATIONS", ":", "found_annots", ".", "append", "(", "'_opt_'", "if...
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/retdec-3.2/scripts/type_extractor/type_extractor/params_info.py#L68-L78
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_graphs.py
python
DebugGraph.non_debug_graph_def
(self)
return self._non_debug_graph_def
The GraphDef without the Copy* and Debug* nodes added by the debugger.
The GraphDef without the Copy* and Debug* nodes added by the debugger.
[ "The", "GraphDef", "without", "the", "Copy", "*", "and", "Debug", "*", "nodes", "added", "by", "the", "debugger", "." ]
def non_debug_graph_def(self): """The GraphDef without the Copy* and Debug* nodes added by the debugger.""" self._reconstruct_non_debug_graph_def() return self._non_debug_graph_def
[ "def", "non_debug_graph_def", "(", "self", ")", ":", "self", ".", "_reconstruct_non_debug_graph_def", "(", ")", "return", "self", ".", "_non_debug_graph_def" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/debug/lib/debug_graphs.py#L441-L444
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
third_party/closure_linter/closure_linter/checkerbase.py
python
CheckerBase.Check
(self, filename, source=None)
Checks the file, printing warnings and errors as they are found. Args: filename: The name of the file to check. source: Optional. The contents of the file. Can be either a string or file-like object. If omitted, contents will be read from disk from the given filename.
Checks the file, printing warnings and errors as they are found.
[ "Checks", "the", "file", "printing", "warnings", "and", "errors", "as", "they", "are", "found", "." ]
def Check(self, filename, source=None): """Checks the file, printing warnings and errors as they are found. Args: filename: The name of the file to check. source: Optional. The contents of the file. Can be either a string or file-like object. If omitted, contents will be read from disk ...
[ "def", "Check", "(", "self", ",", "filename", ",", "source", "=", "None", ")", ":", "if", "source", "is", "None", ":", "try", ":", "f", "=", "open", "(", "filename", ")", "except", "IOError", ":", "self", ".", "_error_handler", ".", "HandleFile", "("...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/checkerbase.py#L151-L181
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/register.py
python
register.classifiers
(self)
Fetch the list of classifiers from the server.
Fetch the list of classifiers from the server.
[ "Fetch", "the", "list", "of", "classifiers", "from", "the", "server", "." ]
def classifiers(self): ''' Fetch the list of classifiers from the server. ''' response = urllib2.urlopen(self.repository+'?:action=list_classifiers') log.info(response.read())
[ "def", "classifiers", "(", "self", ")", ":", "response", "=", "urllib2", ".", "urlopen", "(", "self", ".", "repository", "+", "'?:action=list_classifiers'", ")", "log", ".", "info", "(", "response", ".", "read", "(", ")", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/command/register.py#L86-L90
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
array/min_max_arr.py
python
getminmax_tournament
(arr, low, high)
Tournament Method Divide the array into two parts and compare the maximums and minimums of the two parts to get the maximum and the minimum of the whole array.
Tournament Method Divide the array into two parts and compare the maximums and minimums of the two parts to get the maximum and the minimum of the whole array.
[ "Tournament", "Method", "Divide", "the", "array", "into", "two", "parts", "and", "compare", "the", "maximums", "and", "minimums", "of", "the", "two", "parts", "to", "get", "the", "maximum", "and", "the", "minimum", "of", "the", "whole", "array", "." ]
def getminmax_tournament(arr, low, high): """ Tournament Method Divide the array into two parts and compare the maximums and minimums of the two parts to get the maximum and the minimum of the whole array. """ if low == high: return arr[low], arr[low] if abs(low - high) == 1: ...
[ "def", "getminmax_tournament", "(", "arr", ",", "low", ",", "high", ")", ":", "if", "low", "==", "high", ":", "return", "arr", "[", "low", "]", ",", "arr", "[", "low", "]", "if", "abs", "(", "low", "-", "high", ")", "==", "1", ":", "min_num", "...
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/array/min_max_arr.py#L38-L61
okex/V3-Open-API-SDK
c5abb0db7e2287718e0055e17e57672ce0ec7fd9
okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py
python
Environment.obtain
(self, requirement, installer=None)
Obtain a distribution matching `requirement` (e.g. via download) Obtain a distro that matches requirement (e.g. via download). In the base ``Environment`` class, this routine just returns ``installer(requirement)``, unless `installer` is None, in which case None is returned instead. T...
Obtain a distribution matching `requirement` (e.g. via download)
[ "Obtain", "a", "distribution", "matching", "requirement", "(", "e", ".", "g", ".", "via", "download", ")" ]
def obtain(self, requirement, installer=None): """Obtain a distribution matching `requirement` (e.g. via download) Obtain a distro that matches requirement (e.g. via download). In the base ``Environment`` class, this routine just returns ``installer(requirement)``, unless `installer` i...
[ "def", "obtain", "(", "self", ",", "requirement", ",", "installer", "=", "None", ")", ":", "if", "installer", "is", "not", "None", ":", "return", "installer", "(", "requirement", ")" ]
https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_vendor/pkg_resources/__init__.py#L1065-L1075
google/earthenterprise
0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9
earth_enterprise/src/server/wsgi/wms/ogc/common/projections.py
python
Flat.LonLatFromLogXY
(self, log_xy)
return geom.Pair(self._Lon(log_xy.x), self._Lat(log_xy.y))
Inverse projection; log_x/y are scaled to planet_radius. Args: log_xy: logical point to be 'inverted' (ie find lon, lat). Returns: Pair of lon, lat.
Inverse projection; log_x/y are scaled to planet_radius.
[ "Inverse", "projection", ";", "log_x", "/", "y", "are", "scaled", "to", "planet_radius", "." ]
def LonLatFromLogXY(self, log_xy): """Inverse projection; log_x/y are scaled to planet_radius. Args: log_xy: logical point to be 'inverted' (ie find lon, lat). Returns: Pair of lon, lat. """ utils.Assert(isinstance(log_xy, geom.Pair)) return geom.Pair(self._Lon(log_xy.x), self....
[ "def", "LonLatFromLogXY", "(", "self", ",", "log_xy", ")", ":", "utils", ".", "Assert", "(", "isinstance", "(", "log_xy", ",", "geom", ".", "Pair", ")", ")", "return", "geom", ".", "Pair", "(", "self", ".", "_Lon", "(", "log_xy", ".", "x", ")", ","...
https://github.com/google/earthenterprise/blob/0fe84e29be470cd857e3a0e52e5d0afd5bb8cee9/earth_enterprise/src/server/wsgi/wms/ogc/common/projections.py#L192-L202
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/report.py
python
copy_resource_files
(output_dir)
Copy the javascript and css files to the report directory.
Copy the javascript and css files to the report directory.
[ "Copy", "the", "javascript", "and", "css", "files", "to", "the", "report", "directory", "." ]
def copy_resource_files(output_dir): """ Copy the javascript and css files to the report directory. """ this_dir = os.path.dirname(os.path.realpath(__file__)) for resource in os.listdir(os.path.join(this_dir, 'resources')): shutil.copy(os.path.join(this_dir, 'resources', resource), output_dir)
[ "def", "copy_resource_files", "(", "output_dir", ")", ":", "this_dir", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "realpath", "(", "__file__", ")", ")", "for", "resource", "in", "os", ".", "listdir", "(", "os", ".", "path", ...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/tools/scan-build-py/libscanbuild/report.py#L459-L464
facebook/folly
744a0a698074d1b013813065fe60f545aa2c9b94
build/fbcode_builder/getdeps/buildopts.py
python
BuildOptions.__init__
( self, fbcode_builder_dir, scratch_dir, host_type, install_dir=None, num_jobs=0, use_shipit=False, vcvars_path=None, allow_system_packages=False, lfs_path=None, shared_libs=False, facebook_internal=None, )
fbcode_builder_dir - the path to either the in-fbsource fbcode_builder dir, or for shipit-transformed repos, the build dir that has been mapped into that dir. scratch_dir - a place where we can store repos and build bits. This path ...
fbcode_builder_dir - the path to either the in-fbsource fbcode_builder dir, or for shipit-transformed repos, the build dir that has been mapped into that dir. scratch_dir - a place where we can store repos and build bits. This path ...
[ "fbcode_builder_dir", "-", "the", "path", "to", "either", "the", "in", "-", "fbsource", "fbcode_builder", "dir", "or", "for", "shipit", "-", "transformed", "repos", "the", "build", "dir", "that", "has", "been", "mapped", "into", "that", "dir", ".", "scratch_...
def __init__( self, fbcode_builder_dir, scratch_dir, host_type, install_dir=None, num_jobs=0, use_shipit=False, vcvars_path=None, allow_system_packages=False, lfs_path=None, shared_libs=False, facebook_internal=None, ): ...
[ "def", "__init__", "(", "self", ",", "fbcode_builder_dir", ",", "scratch_dir", ",", "host_type", ",", "install_dir", "=", "None", ",", "num_jobs", "=", "0", ",", "use_shipit", "=", "False", ",", "vcvars_path", "=", "None", ",", "allow_system_packages", "=", ...
https://github.com/facebook/folly/blob/744a0a698074d1b013813065fe60f545aa2c9b94/build/fbcode_builder/getdeps/buildopts.py#L41-L143
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py
python
TPen._update
(self, count=True, forced=False)
dummy method - to be overwritten by child class
dummy method - to be overwritten by child class
[ "dummy", "method", "-", "to", "be", "overwritten", "by", "child", "class" ]
def _update(self, count=True, forced=False): """dummy method - to be overwritten by child class"""
[ "def", "_update", "(", "self", ",", "count", "=", "True", ",", "forced", "=", "False", ")", ":" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py#L2369-L2370
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py
python
getmodulename
(path)
return None
Return the module name for a given file, or None.
Return the module name for a given file, or None.
[ "Return", "the", "module", "name", "for", "a", "given", "file", "or", "None", "." ]
def getmodulename(path): """Return the module name for a given file, or None.""" fname = os.path.basename(path) # Check for paths that look like an actual module file suffixes = [(-len(suffix), suffix) for suffix in importlib.machinery.all_suffixes()] suffixes.sort() # try longes...
[ "def", "getmodulename", "(", "path", ")", ":", "fname", "=", "os", ".", "path", ".", "basename", "(", "path", ")", "# Check for paths that look like an actual module file", "suffixes", "=", "[", "(", "-", "len", "(", "suffix", ")", ",", "suffix", ")", "for",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py#L668-L678
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/telemetry/telemetry/page/actions/page_action.py
python
PageAction.RunsPreviousAction
(self)
return False
Some actions require some initialization to be performed before the previous action. For example, wait for href change needs to record the old href before the previous action changes it. Therefore, we allow actions to run the previous action. An action that does this should override this to return True ...
Some actions require some initialization to be performed before the previous action. For example, wait for href change needs to record the old href before the previous action changes it. Therefore, we allow actions to run the previous action. An action that does this should override this to return True ...
[ "Some", "actions", "require", "some", "initialization", "to", "be", "performed", "before", "the", "previous", "action", ".", "For", "example", "wait", "for", "href", "change", "needs", "to", "record", "the", "old", "href", "before", "the", "previous", "action"...
def RunsPreviousAction(self): """Some actions require some initialization to be performed before the previous action. For example, wait for href change needs to record the old href before the previous action changes it. Therefore, we allow actions to run the previous action. An action that does this sho...
[ "def", "RunsPreviousAction", "(", "self", ")", ":", "return", "False" ]
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/telemetry/telemetry/page/actions/page_action.py#L56-L62
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/pydoc.py
python
classname
(object, modname)
return name
Get a class name and qualify it with a module name if necessary.
Get a class name and qualify it with a module name if necessary.
[ "Get", "a", "class", "name", "and", "qualify", "it", "with", "a", "module", "name", "if", "necessary", "." ]
def classname(object, modname): """Get a class name and qualify it with a module name if necessary.""" name = object.__name__ if object.__module__ != modname: name = object.__module__ + '.' + name return name
[ "def", "classname", "(", "object", ",", "modname", ")", ":", "name", "=", "object", ".", "__name__", "if", "object", ".", "__module__", "!=", "modname", ":", "name", "=", "object", ".", "__module__", "+", "'.'", "+", "name", "return", "name" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/pydoc.py#L97-L102
tiann/android-native-debug
198903ed9346dc4a74327a63cb98d449b97d8047
app/source/art/tools/cpplint.py
python
FileInfo.BaseName
(self)
return self.Split()[1]
File base name - text after the final slash, before the final period.
File base name - text after the final slash, before the final period.
[ "File", "base", "name", "-", "text", "after", "the", "final", "slash", "before", "the", "final", "period", "." ]
def BaseName(self): """File base name - text after the final slash, before the final period.""" return self.Split()[1]
[ "def", "BaseName", "(", "self", ")", ":", "return", "self", ".", "Split", "(", ")", "[", "1", "]" ]
https://github.com/tiann/android-native-debug/blob/198903ed9346dc4a74327a63cb98d449b97d8047/app/source/art/tools/cpplint.py#L815-L817
shedskin/shedskin
ae88dbca7b1d9671cd8be448cb0b497122758936
examples/bh.py
python
BH.usage
()
The usage routine which describes the program options.
The usage routine which describes the program options.
[ "The", "usage", "routine", "which", "describes", "the", "program", "options", "." ]
def usage(): """The usage routine which describes the program options.""" print >>stderr, "usage: python bh.py -b <size> [-s <steps>] [-p] [-m] [-h]" print >>stderr, " -b the number of bodies" print >>stderr, " -s the max. number of time steps (default=10)" print >>stderr, " -...
[ "def", "usage", "(", ")", ":", "print", ">>", "stderr", ",", "\"usage: python bh.py -b <size> [-s <steps>] [-p] [-m] [-h]\"", "print", ">>", "stderr", ",", "\" -b the number of bodies\"", "print", ">>", "stderr", ",", "\" -s the max. number of time steps (default=10)\"", "p...
https://github.com/shedskin/shedskin/blob/ae88dbca7b1d9671cd8be448cb0b497122758936/examples/bh.py#L703-L711
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Wrapping/Python/paraview/selection.py
python
SelectSurfaceCells
(Rectangle=[], Polygon=[], View=None, Modifier=None)
Select visible cells within a rectangular or polygon region. - Rectangle - list containing bottom left (x1, y1) and top right (x2, y2) corner of a rectangle defining the selection region in the format [x1, y1, x2, y2]. Defined in pixels. If not empty, the Polygon parameter must be empty or None. - ...
Select visible cells within a rectangular or polygon region.
[ "Select", "visible", "cells", "within", "a", "rectangular", "or", "polygon", "region", "." ]
def SelectSurfaceCells(Rectangle=[], Polygon=[], View=None, Modifier=None): """Select visible cells within a rectangular or polygon region. - Rectangle - list containing bottom left (x1, y1) and top right (x2, y2) corner of a rectangle defining the selection region in the format [x1, y1, x2, y2]. Defined...
[ "def", "SelectSurfaceCells", "(", "Rectangle", "=", "[", "]", ",", "Polygon", "=", "[", "]", ",", "View", "=", "None", ",", "Modifier", "=", "None", ")", ":", "if", "not", "View", ":", "View", "=", "paraview", ".", "simple", ".", "GetActiveView", "("...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/selection.py#L227-L250
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Window.ConvertPixelPointToDialog
(*args, **kwargs)
return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
ConvertPixelPointToDialog(self, Point pt) -> Point
ConvertPixelPointToDialog(self, Point pt) -> Point
[ "ConvertPixelPointToDialog", "(", "self", "Point", "pt", ")", "-", ">", "Point" ]
def ConvertPixelPointToDialog(*args, **kwargs): """ConvertPixelPointToDialog(self, Point pt) -> Point""" return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
[ "def", "ConvertPixelPointToDialog", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_ConvertPixelPointToDialog", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L10600-L10602
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
python
_RegistryQueryBase
(sysdir, key, value)
return text
Use reg.exe to read a particular key. While ideally we might use the win32 module, we would like gyp to be python neutral, so for instance cygwin python lacks this module. Arguments: sysdir: The system subdirectory to attempt to launch reg.exe from. key: The registry key to read from. value: The par...
Use reg.exe to read a particular key.
[ "Use", "reg", ".", "exe", "to", "read", "a", "particular", "key", "." ]
def _RegistryQueryBase(sysdir, key, value): """Use reg.exe to read a particular key. While ideally we might use the win32 module, we would like gyp to be python neutral, so for instance cygwin python lacks this module. Arguments: sysdir: The system subdirectory to attempt to launch reg.exe from. key...
[ "def", "_RegistryQueryBase", "(", "sysdir", ",", "key", ",", "value", ")", ":", "# Skip if not on Windows or Python Win32 setup issue", "if", "sys", ".", "platform", "not", "in", "(", "\"win32\"", ",", "\"cygwin\"", ")", ":", "return", "None", "# Setup params to pas...
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py#L154-L181
rjpower/falcon
f0f0835e89dac53309b683c94bb376adf0bf158a
benchmarks/meteor.py
python
get_senh
(board, cti)
return se_nh
-> south-east neighborhood
-> south-east neighborhood
[ "-", ">", "south", "-", "east", "neighborhood" ]
def get_senh(board, cti): '''-> south-east neighborhood''' se_nh = [] nh = [E, SW, SE] for c in board: se_nh.append(frozenset([cti[c + o] for o in nh if (c + o) in cti])) return se_nh
[ "def", "get_senh", "(", "board", ",", "cti", ")", ":", "se_nh", "=", "[", "]", "nh", "=", "[", "E", ",", "SW", ",", "SE", "]", "for", "c", "in", "board", ":", "se_nh", ".", "append", "(", "frozenset", "(", "[", "cti", "[", "c", "+", "o", "]...
https://github.com/rjpower/falcon/blob/f0f0835e89dac53309b683c94bb376adf0bf158a/benchmarks/meteor.py#L59-L65
weolar/miniblink49
1c4678db0594a4abde23d3ebbcc7cd13c3170777
third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py
python
MemorizingFile.get_memorized_lines
(self)
return self._memorized_lines
Get lines memorized so far.
Get lines memorized so far.
[ "Get", "lines", "memorized", "so", "far", "." ]
def get_memorized_lines(self): """Get lines memorized so far.""" return self._memorized_lines
[ "def", "get_memorized_lines", "(", "self", ")", ":", "return", "self", ".", "_memorized_lines" ]
https://github.com/weolar/miniblink49/blob/1c4678db0594a4abde23d3ebbcc7cd13c3170777/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/memorizingfile.py#L94-L96
rdkit/rdkit
ede860ae316d12d8568daf5ee800921c3389c84e
rdkit/sping/PDF/pdfutils.py
python
cachedImageExists
(filename)
Determines if a cached image exists which has the same name and equal or newer date to the given file.
Determines if a cached image exists which has the same name and equal or newer date to the given file.
[ "Determines", "if", "a", "cached", "image", "exists", "which", "has", "the", "same", "name", "and", "equal", "or", "newer", "date", "to", "the", "given", "file", "." ]
def cachedImageExists(filename): """Determines if a cached image exists which has the same name and equal or newer date to the given file.""" cachedname = os.path.splitext(filename)[0] + '.a85' if os.path.isfile(cachedname): # see if it is newer original_date = os.stat(filename)[...
[ "def", "cachedImageExists", "(", "filename", ")", ":", "cachedname", "=", "os", ".", "path", ".", "splitext", "(", "filename", ")", "[", "0", "]", "+", "'.a85'", "if", "os", ".", "path", ".", "isfile", "(", "cachedname", ")", ":", "# see if it is newer",...
https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/sping/PDF/pdfutils.py#L70-L84
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/usb_gadget/hid_gadget.py
python
HidFeature.SetFeatureReport
(self, data)
Handle an feature report sent from the host. This function is called when a SET_REPORT(feature) command for this class's Report ID is received. It should be overridden by a subclass. Args: data: Contents of the feature report.
Handle an feature report sent from the host.
[ "Handle", "an", "feature", "report", "sent", "from", "the", "host", "." ]
def SetFeatureReport(self, data): """Handle an feature report sent from the host. This function is called when a SET_REPORT(feature) command for this class's Report ID is received. It should be overridden by a subclass. Args: data: Contents of the feature report. """ pass
[ "def", "SetFeatureReport", "(", "self", ",", "data", ")", ":", "pass" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/usb_gadget/hid_gadget.py#L341-L350
homenc/HElib
f0e3e010009c592cd411ba96baa8376eb485247a
misc/algen/algen.py
python
parsePrimeRange
(rangeStr)
return p_prime
Parses the ranges and numbers given to it, but only of primes. Args: rangeStr: a string e.g. '2-5,7,10-11' Returns: A list of prime numbers to try out. Usage: >>> parsePrimeRange('2-5,7,10-11') [2, 3, 5, 7, 11]
Parses the ranges and numbers given to it, but only of primes.
[ "Parses", "the", "ranges", "and", "numbers", "given", "to", "it", "but", "only", "of", "primes", "." ]
def parsePrimeRange(rangeStr): """ Parses the ranges and numbers given to it, but only of primes. Args: rangeStr: a string e.g. '2-5,7,10-11' Returns: A list of prime numbers to try out. Usage: >>> parsePrimeRange('2-5,7,10-11') [2, 3, 5, 7, 11] """ p_prime = list(\ ...
[ "def", "parsePrimeRange", "(", "rangeStr", ")", ":", "p_prime", "=", "list", "(", "filter", "(", "lambda", "x", ":", "numth", ".", "factorize", "(", "x", ")", "[", "x", "]", "==", "1", ",", "parseRange", "(", "rangeStr", ")", ")", ")", "if", "len",...
https://github.com/homenc/HElib/blob/f0e3e010009c592cd411ba96baa8376eb485247a/misc/algen/algen.py#L73-L93
taskflow/taskflow
f423a100a70b275f6e7331bc96537a3fe172e8d7
3rd-party/tbb/python/tbb/__init__.py
python
Monkey.__init__
(self, max_num_threads=None, benchmark=False)
Create context manager for running under TBB scheduler. :param max_num_threads: if specified, limits maximal number of threads :param benchmark: if specified, blocks in initialization until requested number of threads are ready
Create context manager for running under TBB scheduler. :param max_num_threads: if specified, limits maximal number of threads :param benchmark: if specified, blocks in initialization until requested number of threads are ready
[ "Create", "context", "manager", "for", "running", "under", "TBB", "scheduler", ".", ":", "param", "max_num_threads", ":", "if", "specified", "limits", "maximal", "number", "of", "threads", ":", "param", "benchmark", ":", "if", "specified", "blocks", "in", "ini...
def __init__(self, max_num_threads=None, benchmark=False): """ Create context manager for running under TBB scheduler. :param max_num_threads: if specified, limits maximal number of threads :param benchmark: if specified, blocks in initialization until requested number of threads are rea...
[ "def", "__init__", "(", "self", ",", "max_num_threads", "=", "None", ",", "benchmark", "=", "False", ")", ":", "if", "max_num_threads", ":", "self", ".", "ctl", "=", "global_control", "(", "global_control", ".", "max_allowed_parallelism", ",", "int", "(", "m...
https://github.com/taskflow/taskflow/blob/f423a100a70b275f6e7331bc96537a3fe172e8d7/3rd-party/tbb/python/tbb/__init__.py#L163-L175
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/ops/rnn_cell.py
python
MultiRNNCell.__init__
(self, cells, state_is_tuple=True)
Create a RNN cell composed sequentially of a number of RNNCells. Args: cells: list of RNNCells that will be composed in this order. state_is_tuple: If True, accepted and returned states are n-tuples, where `n = len(cells)`. If False, the states are all concatenated along the column axi...
Create a RNN cell composed sequentially of a number of RNNCells.
[ "Create", "a", "RNN", "cell", "composed", "sequentially", "of", "a", "number", "of", "RNNCells", "." ]
def __init__(self, cells, state_is_tuple=True): """Create a RNN cell composed sequentially of a number of RNNCells. Args: cells: list of RNNCells that will be composed in this order. state_is_tuple: If True, accepted and returned states are n-tuples, where `n = len(cells)`. If False, the s...
[ "def", "__init__", "(", "self", ",", "cells", ",", "state_is_tuple", "=", "True", ")", ":", "if", "not", "cells", ":", "raise", "ValueError", "(", "\"Must specify at least one cell for MultiRNNCell.\"", ")", "self", ".", "_cells", "=", "cells", "self", ".", "_...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/ops/rnn_cell.py#L762-L784
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/array_ops.py
python
ScatterElements.__init__
(self, axis=0)
Initialize ScatterElements
Initialize ScatterElements
[ "Initialize", "ScatterElements" ]
def __init__(self, axis=0): """Initialize ScatterElements""" validator.check_value_type("axis", axis, [int], self.name) self.init_prim_io_names(inputs=['data', 'indices', 'updates'], outputs=['y'])
[ "def", "__init__", "(", "self", ",", "axis", "=", "0", ")", ":", "validator", ".", "check_value_type", "(", "\"axis\"", ",", "axis", ",", "[", "int", "]", ",", "self", ".", "name", ")", "self", ".", "init_prim_io_names", "(", "inputs", "=", "[", "'da...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/array_ops.py#L6696-L6699
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py
python
Metrowerks_Shell_Suite_Events.Set_Preferences
(self, _no_object=None, _attributes={}, **_arguments)
Set Preferences: Set the preferences for the current project Keyword argument of_panel: Name of the preference panel Keyword argument to: Preferences settings Keyword argument _attributes: AppleEvent attribute dictionary
Set Preferences: Set the preferences for the current project Keyword argument of_panel: Name of the preference panel Keyword argument to: Preferences settings Keyword argument _attributes: AppleEvent attribute dictionary
[ "Set", "Preferences", ":", "Set", "the", "preferences", "for", "the", "current", "project", "Keyword", "argument", "of_panel", ":", "Name", "of", "the", "preference", "panel", "Keyword", "argument", "to", ":", "Preferences", "settings", "Keyword", "argument", "_...
def Set_Preferences(self, _no_object=None, _attributes={}, **_arguments): """Set Preferences: Set the preferences for the current project Keyword argument of_panel: Name of the preference panel Keyword argument to: Preferences settings Keyword argument _attributes: AppleEvent attribute d...
[ "def", "Set_Preferences", "(", "self", ",", "_no_object", "=", "None", ",", "_attributes", "=", "{", "}", ",", "*", "*", "_arguments", ")", ":", "_code", "=", "'MMPR'", "_subcode", "=", "'Pref'", "aetools", ".", "keysubst", "(", "_arguments", ",", "self"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/lib-scriptpackages/CodeWarrior/Metrowerks_Shell_Suite.py#L675-L694
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/ndarray/ndarray.py
python
linspace
(start, stop, num, endpoint=True, ctx=None, dtype=mx_real_t)
return _internal._linspace(start=start, stop=stop, num=num, endpoint=endpoint, dtype=dtype, ctx=str(ctx))
Return evenly spaced numbers within a specified interval. Values are generated within the half-open interval [`start`, `stop`) or closed interval [start, stop] depending on whether `endpoint` is True or False. The function is similar to `numpy.linspace`, but returns an `NDArray`. Parameters ------...
Return evenly spaced numbers within a specified interval.
[ "Return", "evenly", "spaced", "numbers", "within", "a", "specified", "interval", "." ]
def linspace(start, stop, num, endpoint=True, ctx=None, dtype=mx_real_t): """Return evenly spaced numbers within a specified interval. Values are generated within the half-open interval [`start`, `stop`) or closed interval [start, stop] depending on whether `endpoint` is True or False. The function is ...
[ "def", "linspace", "(", "start", ",", "stop", ",", "num", ",", "endpoint", "=", "True", ",", "ctx", "=", "None", ",", "dtype", "=", "mx_real_t", ")", ":", "if", "ctx", "is", "None", ":", "ctx", "=", "current_context", "(", ")", "return", "_internal",...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/ndarray/ndarray.py#L2640-L2681
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/hooks.py
python
first_non_none_response
(responses, default=None)
return default
Find first non None response in a list of tuples. This function can be used to find the first non None response from handlers connected to an event. This is useful if you are interested in the returned responses from event handlers. Example usage:: print(first_non_none_response([(func1, None), (f...
Find first non None response in a list of tuples.
[ "Find", "first", "non", "None", "response", "in", "a", "list", "of", "tuples", "." ]
def first_non_none_response(responses, default=None): """Find first non None response in a list of tuples. This function can be used to find the first non None response from handlers connected to an event. This is useful if you are interested in the returned responses from event handlers. Example usag...
[ "def", "first_non_none_response", "(", "responses", ",", "default", "=", "None", ")", ":", "for", "response", "in", "responses", ":", "if", "response", "[", "1", "]", "is", "not", "None", ":", "return", "response", "[", "1", "]", "return", "default" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/botocore/hooks.py#L38-L63