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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LiquidPlayer/LiquidCore | 9405979363f2353ac9a71ad8ab59685dd7f919c9 | deps/node-10.15.3/tools/gyp/pylib/gyp/generator/msvs.py | python | _GetUniquePlatforms | (spec) | return platforms | Returns the list of unique platforms for this spec, e.g ['win32', ...].
Arguments:
spec: The target dictionary containing the properties of the target.
Returns:
The MSVSUserFile object created. | Returns the list of unique platforms for this spec, e.g ['win32', ...]. | [
"Returns",
"the",
"list",
"of",
"unique",
"platforms",
"for",
"this",
"spec",
"e",
".",
"g",
"[",
"win32",
"...",
"]",
"."
] | def _GetUniquePlatforms(spec):
"""Returns the list of unique platforms for this spec, e.g ['win32', ...].
Arguments:
spec: The target dictionary containing the properties of the target.
Returns:
The MSVSUserFile object created.
"""
# Gather list of unique platforms.
platforms = OrderedSet()
for c... | [
"def",
"_GetUniquePlatforms",
"(",
"spec",
")",
":",
"# Gather list of unique platforms.",
"platforms",
"=",
"OrderedSet",
"(",
")",
"for",
"configuration",
"in",
"spec",
"[",
"'configurations'",
"]",
":",
"platforms",
".",
"add",
"(",
"_ConfigPlatform",
"(",
"spe... | https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/tools/gyp/pylib/gyp/generator/msvs.py#L1074-L1087 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | TextAttr.HasFontUnderlined | (*args, **kwargs) | return _controls_.TextAttr_HasFontUnderlined(*args, **kwargs) | HasFontUnderlined(self) -> bool | HasFontUnderlined(self) -> bool | [
"HasFontUnderlined",
"(",
"self",
")",
"-",
">",
"bool"
] | def HasFontUnderlined(*args, **kwargs):
"""HasFontUnderlined(self) -> bool"""
return _controls_.TextAttr_HasFontUnderlined(*args, **kwargs) | [
"def",
"HasFontUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"TextAttr_HasFontUnderlined",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L1804-L1806 | |
PlatformLab/Arachne | e67391471007174dd4002dc2c160628e19c284e8 | scripts/cpplint.py | python | FindStartOfExpressionInLine | (line, endpos, stack) | return (-1, stack) | Find position at the matching start of current expression.
This is almost the reverse of FindEndOfExpressionInLine, but note
that the input position and returned position differs by 1.
Args:
line: a CleansedLines line.
endpos: start searching at this position.
stack: nesting stack at endpos.
Retu... | Find position at the matching start of current expression. | [
"Find",
"position",
"at",
"the",
"matching",
"start",
"of",
"current",
"expression",
"."
] | def FindStartOfExpressionInLine(line, endpos, stack):
"""Find position at the matching start of current expression.
This is almost the reverse of FindEndOfExpressionInLine, but note
that the input position and returned position differs by 1.
Args:
line: a CleansedLines line.
endpos: start searching at... | [
"def",
"FindStartOfExpressionInLine",
"(",
"line",
",",
"endpos",
",",
"stack",
")",
":",
"i",
"=",
"endpos",
"while",
"i",
">=",
"0",
":",
"char",
"=",
"line",
"[",
"i",
"]",
"if",
"char",
"in",
"')]}'",
":",
"# Found end of expression, push to expression s... | https://github.com/PlatformLab/Arachne/blob/e67391471007174dd4002dc2c160628e19c284e8/scripts/cpplint.py#L1614-L1688 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/pydoc.py | python | HTMLDoc.markup | (self, text, escape=None, funcs={}, classes={}, methods={}) | return ''.join(results) | Mark up some plain text, given a context of symbols to look for.
Each context dictionary maps object names to anchor names. | Mark up some plain text, given a context of symbols to look for.
Each context dictionary maps object names to anchor names. | [
"Mark",
"up",
"some",
"plain",
"text",
"given",
"a",
"context",
"of",
"symbols",
"to",
"look",
"for",
".",
"Each",
"context",
"dictionary",
"maps",
"object",
"names",
"to",
"anchor",
"names",
"."
] | def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
"""Mark up some plain text, given a context of symbols to look for.
Each context dictionary maps object names to anchor names."""
escape = escape or self.escape
results = []
here = 0
pattern = re.compi... | [
"def",
"markup",
"(",
"self",
",",
"text",
",",
"escape",
"=",
"None",
",",
"funcs",
"=",
"{",
"}",
",",
"classes",
"=",
"{",
"}",
",",
"methods",
"=",
"{",
"}",
")",
":",
"escape",
"=",
"escape",
"or",
"self",
".",
"escape",
"results",
"=",
"[... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/pydoc.py#L673-L712 | |
sailing-pmls/bosen | 06cb58902d011fbea5f9428f10ce30e621492204 | style_script/cpplint.py | python | FindNextMultiLineCommentEnd | (lines, lineix) | return len(lines) | We are inside a comment, find the end marker. | We are inside a comment, find the end marker. | [
"We",
"are",
"inside",
"a",
"comment",
"find",
"the",
"end",
"marker",
"."
] | def FindNextMultiLineCommentEnd(lines, lineix):
"""We are inside a comment, find the end marker."""
while lineix < len(lines):
if lines[lineix].strip().endswith('*/'):
return lineix
lineix += 1
return len(lines) | [
"def",
"FindNextMultiLineCommentEnd",
"(",
"lines",
",",
"lineix",
")",
":",
"while",
"lineix",
"<",
"len",
"(",
"lines",
")",
":",
"if",
"lines",
"[",
"lineix",
"]",
".",
"strip",
"(",
")",
".",
"endswith",
"(",
"'*/'",
")",
":",
"return",
"lineix",
... | https://github.com/sailing-pmls/bosen/blob/06cb58902d011fbea5f9428f10ce30e621492204/style_script/cpplint.py#L1241-L1247 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/mingw32ccompiler.py | python | _check_for_import_lib | () | return (False, candidates[0]) | Check if an import library for the Python runtime already exists. | Check if an import library for the Python runtime already exists. | [
"Check",
"if",
"an",
"import",
"library",
"for",
"the",
"Python",
"runtime",
"already",
"exists",
"."
] | def _check_for_import_lib():
"""Check if an import library for the Python runtime already exists."""
major_version, minor_version = tuple(sys.version_info[:2])
# patterns for the file name of the library itself
patterns = ['libpython%d%d.a',
'libpython%d%d.dll.a',
'libpy... | [
"def",
"_check_for_import_lib",
"(",
")",
":",
"major_version",
",",
"minor_version",
"=",
"tuple",
"(",
"sys",
".",
"version_info",
"[",
":",
"2",
"]",
")",
"# patterns for the file name of the library itself",
"patterns",
"=",
"[",
"'libpython%d%d.a'",
",",
"'libp... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/mingw32ccompiler.py#L420-L454 | |
OkCupid/okws | 1c337392c676ccb4e9a4c92d11d5d2fada6427d2 | contrib/pub3-upgrade.py | python | Pub1Parser.p_pub | (self, p) | pub : switch
| set
| include
| load
| comment | pub : switch
| set
| include
| load
| comment | [
"pub",
":",
"switch",
"|",
"set",
"|",
"include",
"|",
"load",
"|",
"comment"
] | def p_pub (self, p):
'''pub : switch
| set
| include
| load
| comment '''
p[0] = p[1] | [
"def",
"p_pub",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"p",
"[",
"1",
"]"
] | https://github.com/OkCupid/okws/blob/1c337392c676ccb4e9a4c92d11d5d2fada6427d2/contrib/pub3-upgrade.py#L872-L878 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudsearch2/search.py | python | SearchResults.next_page | (self) | Call Cloudsearch to get the next page of search results
:rtype: :class:`boto.cloudsearch2.search.SearchResults`
:return: the following page of search results | Call Cloudsearch to get the next page of search results | [
"Call",
"Cloudsearch",
"to",
"get",
"the",
"next",
"page",
"of",
"search",
"results"
] | def next_page(self):
"""Call Cloudsearch to get the next page of search results
:rtype: :class:`boto.cloudsearch2.search.SearchResults`
:return: the following page of search results
"""
if self.query.page <= self.num_pages_needed:
self.query.start += self.query.real_... | [
"def",
"next_page",
"(",
"self",
")",
":",
"if",
"self",
".",
"query",
".",
"page",
"<=",
"self",
".",
"num_pages_needed",
":",
"self",
".",
"query",
".",
"start",
"+=",
"self",
".",
"query",
".",
"real_size",
"self",
".",
"query",
".",
"page",
"+=",... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/cloudsearch2/search.py#L62-L73 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_gdi.py | python | Font.Scale | (*args, **kwargs) | return _gdi_.Font_Scale(*args, **kwargs) | Scale(self, float x) -> Font | Scale(self, float x) -> Font | [
"Scale",
"(",
"self",
"float",
"x",
")",
"-",
">",
"Font"
] | def Scale(*args, **kwargs):
"""Scale(self, float x) -> Font"""
return _gdi_.Font_Scale(*args, **kwargs) | [
"def",
"Scale",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_gdi_",
".",
"Font_Scale",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L2472-L2474 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/lib/ogl/_diagram.py | python | Diagram.GetCount | (self) | return len(self._shapeList) | Return the number of shapes in the diagram. | Return the number of shapes in the diagram. | [
"Return",
"the",
"number",
"of",
"shapes",
"in",
"the",
"diagram",
"."
] | def GetCount(self):
"""Return the number of shapes in the diagram."""
return len(self._shapeList) | [
"def",
"GetCount",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_shapeList",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/ogl/_diagram.py#L165-L167 | |
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/training/queue_runner.py | python | QueueRunner.name | (self) | return self._queue.name | The string name of the underlying Queue. | The string name of the underlying Queue. | [
"The",
"string",
"name",
"of",
"the",
"underlying",
"Queue",
"."
] | def name(self):
"""The string name of the underlying Queue."""
return self._queue.name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_queue",
".",
"name"
] | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/training/queue_runner.py#L165-L167 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/tree.py | python | TreeItem._GetSubList | (self) | return sublist | Do not override! Called by TreeNode. | Do not override! Called by TreeNode. | [
"Do",
"not",
"override!",
"Called",
"by",
"TreeNode",
"."
] | def _GetSubList(self):
"""Do not override! Called by TreeNode."""
if not self.IsExpandable():
return []
sublist = self.GetSubList()
if not sublist:
self.expandable = 0
return sublist | [
"def",
"_GetSubList",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"IsExpandable",
"(",
")",
":",
"return",
"[",
"]",
"sublist",
"=",
"self",
".",
"GetSubList",
"(",
")",
"if",
"not",
"sublist",
":",
"self",
".",
"expandable",
"=",
"0",
"return",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/tree.py#L363-L370 | |
dolphin-emu/dolphin | b4c7f2b1e834ce5ea4b2301f9d4fb07c11afeabb | Externals/fmt/support/rst2md.py | python | convert | (rst_path) | return core.publish_file(source_path=rst_path, writer=MDWriter()) | Converts RST file to Markdown. | Converts RST file to Markdown. | [
"Converts",
"RST",
"file",
"to",
"Markdown",
"."
] | def convert(rst_path):
"""Converts RST file to Markdown."""
return core.publish_file(source_path=rst_path, writer=MDWriter()) | [
"def",
"convert",
"(",
"rst_path",
")",
":",
"return",
"core",
".",
"publish_file",
"(",
"source_path",
"=",
"rst_path",
",",
"writer",
"=",
"MDWriter",
"(",
")",
")"
] | https://github.com/dolphin-emu/dolphin/blob/b4c7f2b1e834ce5ea4b2301f9d4fb07c11afeabb/Externals/fmt/support/rst2md.py#L153-L155 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/__init__.py | python | Process.cpu_times | (self) | return self._proc.cpu_times() | Return a (user, system, children_user, children_system)
namedtuple representing the accumulated process time, in
seconds.
This is similar to os.times() but per-process.
On macOS and Windows children_user and children_system are
always set to 0. | Return a (user, system, children_user, children_system)
namedtuple representing the accumulated process time, in
seconds.
This is similar to os.times() but per-process.
On macOS and Windows children_user and children_system are
always set to 0. | [
"Return",
"a",
"(",
"user",
"system",
"children_user",
"children_system",
")",
"namedtuple",
"representing",
"the",
"accumulated",
"process",
"time",
"in",
"seconds",
".",
"This",
"is",
"similar",
"to",
"os",
".",
"times",
"()",
"but",
"per",
"-",
"process",
... | def cpu_times(self):
"""Return a (user, system, children_user, children_system)
namedtuple representing the accumulated process time, in
seconds.
This is similar to os.times() but per-process.
On macOS and Windows children_user and children_system are
always set to 0.
... | [
"def",
"cpu_times",
"(",
"self",
")",
":",
"return",
"self",
".",
"_proc",
".",
"cpu_times",
"(",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/psutil/__init__.py#L1051-L1059 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/models/rnn/translate/seq2seq_model.py | python | Seq2SeqModel.__init__ | (self, source_vocab_size, target_vocab_size, buckets, size,
num_layers, max_gradient_norm, batch_size, learning_rate,
learning_rate_decay_factor, use_lstm=False,
num_samples=512, forward_only=False) | Create the model.
Args:
source_vocab_size: size of the source vocabulary.
target_vocab_size: size of the target vocabulary.
buckets: a list of pairs (I, O), where I specifies maximum input length
that will be processed in that bucket, and O specifies maximum output
length. Trainin... | Create the model. | [
"Create",
"the",
"model",
"."
] | def __init__(self, source_vocab_size, target_vocab_size, buckets, size,
num_layers, max_gradient_norm, batch_size, learning_rate,
learning_rate_decay_factor, use_lstm=False,
num_samples=512, forward_only=False):
"""Create the model.
Args:
source_vocab_size: si... | [
"def",
"__init__",
"(",
"self",
",",
"source_vocab_size",
",",
"target_vocab_size",
",",
"buckets",
",",
"size",
",",
"num_layers",
",",
"max_gradient_norm",
",",
"batch_size",
",",
"learning_rate",
",",
"learning_rate_decay_factor",
",",
"use_lstm",
"=",
"False",
... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/models/rnn/translate/seq2seq_model.py#L46-L166 | ||
mapnik/mapnik | f3da900c355e1d15059c4a91b00203dcc9d9f0ef | scons/scons-local-4.1.0/SCons/Node/FS.py | python | Dir.__clearRepositoryCache | (self, duplicate=None) | Called when we change the repository(ies) for a directory.
This clears any cached information that is invalidated by changing
the repository. | Called when we change the repository(ies) for a directory.
This clears any cached information that is invalidated by changing
the repository. | [
"Called",
"when",
"we",
"change",
"the",
"repository",
"(",
"ies",
")",
"for",
"a",
"directory",
".",
"This",
"clears",
"any",
"cached",
"information",
"that",
"is",
"invalidated",
"by",
"changing",
"the",
"repository",
"."
] | def __clearRepositoryCache(self, duplicate=None):
"""Called when we change the repository(ies) for a directory.
This clears any cached information that is invalidated by changing
the repository."""
for node in self.entries.values():
if node != self.dir:
if no... | [
"def",
"__clearRepositoryCache",
"(",
"self",
",",
"duplicate",
"=",
"None",
")",
":",
"for",
"node",
"in",
"self",
".",
"entries",
".",
"values",
"(",
")",
":",
"if",
"node",
"!=",
"self",
".",
"dir",
":",
"if",
"node",
"!=",
"self",
"and",
"isinsta... | https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Node/FS.py#L1612-L1628 | ||
glotzerlab/hoomd-blue | f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a | hoomd/filter/all_.py | python | All.__reduce__ | (self) | return (type(self), tuple()) | Enable (deep)copying and pickling of `All` particle filters. | Enable (deep)copying and pickling of `All` particle filters. | [
"Enable",
"(",
"deep",
")",
"copying",
"and",
"pickling",
"of",
"All",
"particle",
"filters",
"."
] | def __reduce__(self):
"""Enable (deep)copying and pickling of `All` particle filters."""
return (type(self), tuple()) | [
"def",
"__reduce__",
"(",
"self",
")",
":",
"return",
"(",
"type",
"(",
"self",
")",
",",
"tuple",
"(",
")",
")"
] | https://github.com/glotzerlab/hoomd-blue/blob/f7f97abfa3fcc2522fa8d458d65d0aeca7ba781a/hoomd/filter/all_.py#L28-L30 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | LogBuffer.__init__ | (self, *args, **kwargs) | __init__(self) -> LogBuffer | __init__(self) -> LogBuffer | [
"__init__",
"(",
"self",
")",
"-",
">",
"LogBuffer"
] | def __init__(self, *args, **kwargs):
"""__init__(self) -> LogBuffer"""
_misc_.LogBuffer_swiginit(self,_misc_.new_LogBuffer(*args, **kwargs)) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_misc_",
".",
"LogBuffer_swiginit",
"(",
"self",
",",
"_misc_",
".",
"new_LogBuffer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1828-L1830 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/grid.py | python | GridCellAttr.SetBackgroundColour | (*args, **kwargs) | return _grid.GridCellAttr_SetBackgroundColour(*args, **kwargs) | SetBackgroundColour(self, Colour colBack) | SetBackgroundColour(self, Colour colBack) | [
"SetBackgroundColour",
"(",
"self",
"Colour",
"colBack",
")"
] | def SetBackgroundColour(*args, **kwargs):
"""SetBackgroundColour(self, Colour colBack)"""
return _grid.GridCellAttr_SetBackgroundColour(*args, **kwargs) | [
"def",
"SetBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellAttr_SetBackgroundColour",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/grid.py#L547-L549 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py | python | Index.isna | (self) | return self._isnan | Detect missing values.
Return a boolean same-sized object indicating if the values are NA.
NA values, such as ``None``, :attr:`numpy.NaN` or :attr:`pd.NaT`, get
mapped to ``True`` values.
Everything else get mapped to ``False`` values. Characters such as
empty strings `''` or :a... | Detect missing values. | [
"Detect",
"missing",
"values",
"."
] | def isna(self):
"""
Detect missing values.
Return a boolean same-sized object indicating if the values are NA.
NA values, such as ``None``, :attr:`numpy.NaN` or :attr:`pd.NaT`, get
mapped to ``True`` values.
Everything else get mapped to ``False`` values. Characters such... | [
"def",
"isna",
"(",
"self",
")",
":",
"return",
"self",
".",
"_isnan"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/pandas/core/indexes/base.py#L1785-L1838 | |
oracle/graaljs | 36a56e8e993d45fc40939a3a4d9c0c24990720f1 | graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | _ExtractImportantEnvironment | (output_of_set) | return env | Extracts environment variables required for the toolchain to run from
a textual dump output by the cmd.exe 'set' command. | Extracts environment variables required for the toolchain to run from
a textual dump output by the cmd.exe 'set' command. | [
"Extracts",
"environment",
"variables",
"required",
"for",
"the",
"toolchain",
"to",
"run",
"from",
"a",
"textual",
"dump",
"output",
"by",
"the",
"cmd",
".",
"exe",
"set",
"command",
"."
] | def _ExtractImportantEnvironment(output_of_set):
"""Extracts environment variables required for the toolchain to run from
a textual dump output by the cmd.exe 'set' command."""
envvars_to_save = (
"goma_.*", # TODO(scottmg): This is ugly, but needed for goma.
"include",
"lib",
... | [
"def",
"_ExtractImportantEnvironment",
"(",
"output_of_set",
")",
":",
"envvars_to_save",
"=",
"(",
"\"goma_.*\"",
",",
"# TODO(scottmg): This is ugly, but needed for goma.",
"\"include\"",
",",
"\"lib\"",
",",
"\"libpath\"",
",",
"\"path\"",
",",
"\"pathext\"",
",",
"\"s... | https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L1115-L1152 | |
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/legacy_tf_layers/variable_scope_shim.py | python | _EagerVariableStore._get_single_variable | (
self,
name,
shape=None,
dtype=dtypes.float32,
initializer=None,
regularizer=None,
partition_info=None,
reuse=None,
trainable=None,
caching_device=None,
validate_shape=True,
constraint=None,
synchronization=vs.VariableSynchronization.AUTO,
... | return v | Get or create a single Variable (e.g.
a shard or entire variable).
See the documentation of get_variable above (ignore partitioning components)
for details.
Args:
name: see get_variable.
shape: see get_variable.
dtype: see get_variable.
initializer: see get_variable.
reg... | Get or create a single Variable (e.g. | [
"Get",
"or",
"create",
"a",
"single",
"Variable",
"(",
"e",
".",
"g",
"."
] | def _get_single_variable(
self,
name,
shape=None,
dtype=dtypes.float32,
initializer=None,
regularizer=None,
partition_info=None,
reuse=None,
trainable=None,
caching_device=None,
validate_shape=True,
constraint=None,
synchronization=vs.Variabl... | [
"def",
"_get_single_variable",
"(",
"self",
",",
"name",
",",
"shape",
"=",
"None",
",",
"dtype",
"=",
"dtypes",
".",
"float32",
",",
"initializer",
"=",
"None",
",",
"regularizer",
"=",
"None",
",",
"partition_info",
"=",
"None",
",",
"reuse",
"=",
"Non... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/legacy_tf_layers/variable_scope_shim.py#L388-L517 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/xml/sax/xmlreader.py | python | Locator.getPublicId | (self) | return None | Return the public identifier for the current event. | Return the public identifier for the current event. | [
"Return",
"the",
"public",
"identifier",
"for",
"the",
"current",
"event",
"."
] | def getPublicId(self):
"Return the public identifier for the current event."
return None | [
"def",
"getPublicId",
"(",
"self",
")",
":",
"return",
"None"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/sax/xmlreader.py#L179-L181 | |
tangzhenyu/Scene-Text-Understanding | 0f7ffc7aea5971a50cdc03d33d0a41075285948b | ctpn_crnn_ocr/CTPN/caffe/python/summarize.py | python | print_table | (table, max_width) | Print a simple nicely-aligned table.
table must be a list of (equal-length) lists. Columns are space-separated,
and as narrow as possible, but no wider than max_width. Text may overflow
columns; note that unlike string.format, this will not affect subsequent
columns, if possible. | Print a simple nicely-aligned table. | [
"Print",
"a",
"simple",
"nicely",
"-",
"aligned",
"table",
"."
] | def print_table(table, max_width):
"""Print a simple nicely-aligned table.
table must be a list of (equal-length) lists. Columns are space-separated,
and as narrow as possible, but no wider than max_width. Text may overflow
columns; note that unlike string.format, this will not affect subsequent
co... | [
"def",
"print_table",
"(",
"table",
",",
"max_width",
")",
":",
"max_widths",
"=",
"[",
"max_width",
"]",
"*",
"len",
"(",
"table",
"[",
"0",
"]",
")",
"column_widths",
"=",
"[",
"max",
"(",
"printed_len",
"(",
"row",
"[",
"j",
"]",
")",
"+",
"1",
... | https://github.com/tangzhenyu/Scene-Text-Understanding/blob/0f7ffc7aea5971a50cdc03d33d0a41075285948b/ctpn_crnn_ocr/CTPN/caffe/python/summarize.py#L41-L61 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/platform.py | python | python_version | () | return _sys_version()[1] | Returns the Python version as string 'major.minor.patchlevel'
Note that unlike the Python sys.version, the returned value
will always include the patchlevel (it defaults to 0). | Returns the Python version as string 'major.minor.patchlevel' | [
"Returns",
"the",
"Python",
"version",
"as",
"string",
"major",
".",
"minor",
".",
"patchlevel"
] | def python_version():
""" Returns the Python version as string 'major.minor.patchlevel'
Note that unlike the Python sys.version, the returned value
will always include the patchlevel (it defaults to 0).
"""
return _sys_version()[1] | [
"def",
"python_version",
"(",
")",
":",
"return",
"_sys_version",
"(",
")",
"[",
"1",
"]"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/platform.py#L1518-L1526 | |
epiqc/ScaffCC | 66a79944ee4cd116b27bc1a69137276885461db8 | clang/utils/check_cfc/check_cfc.py | python | main_is_frozen | () | return (hasattr(sys, "frozen") or # new py2exe
hasattr(sys, "importers") or # old py2exe
imp.is_frozen("__main__")) | Returns True when running as a py2exe executable. | Returns True when running as a py2exe executable. | [
"Returns",
"True",
"when",
"running",
"as",
"a",
"py2exe",
"executable",
"."
] | def main_is_frozen():
"""Returns True when running as a py2exe executable."""
return (hasattr(sys, "frozen") or # new py2exe
hasattr(sys, "importers") or # old py2exe
imp.is_frozen("__main__")) | [
"def",
"main_is_frozen",
"(",
")",
":",
"return",
"(",
"hasattr",
"(",
"sys",
",",
"\"frozen\"",
")",
"or",
"# new py2exe",
"hasattr",
"(",
"sys",
",",
"\"importers\"",
")",
"or",
"# old py2exe",
"imp",
".",
"is_frozen",
"(",
"\"__main__\"",
")",
")"
] | https://github.com/epiqc/ScaffCC/blob/66a79944ee4cd116b27bc1a69137276885461db8/clang/utils/check_cfc/check_cfc.py#L84-L88 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/framework/op_def_registry.py | python | get_registered_ops | () | return _registered_ops | Returns a dictionary mapping names to OpDefs. | Returns a dictionary mapping names to OpDefs. | [
"Returns",
"a",
"dictionary",
"mapping",
"names",
"to",
"OpDefs",
"."
] | def get_registered_ops():
"""Returns a dictionary mapping names to OpDefs."""
return _registered_ops | [
"def",
"get_registered_ops",
"(",
")",
":",
"return",
"_registered_ops"
] | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/framework/op_def_registry.py#L40-L42 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/grid.py | python | GridCellFloatRenderer.GetFormat | (*args, **kwargs) | return _grid.GridCellFloatRenderer_GetFormat(*args, **kwargs) | GetFormat(self) -> int | GetFormat(self) -> int | [
"GetFormat",
"(",
"self",
")",
"-",
">",
"int"
] | def GetFormat(*args, **kwargs):
"""GetFormat(self) -> int"""
return _grid.GridCellFloatRenderer_GetFormat(*args, **kwargs) | [
"def",
"GetFormat",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridCellFloatRenderer_GetFormat",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/grid.py#L203-L205 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/android/appstats.py | python | DeviceSnapshot.GetTimestamp | (self) | return self.timestamp | Returns the time since program start that this snapshot was taken. | Returns the time since program start that this snapshot was taken. | [
"Returns",
"the",
"time",
"since",
"program",
"start",
"that",
"this",
"snapshot",
"was",
"taken",
"."
] | def GetTimestamp(self):
"""Returns the time since program start that this snapshot was taken."""
return self.timestamp | [
"def",
"GetTimestamp",
"(",
"self",
")",
":",
"return",
"self",
".",
"timestamp"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/android/appstats.py#L424-L426 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_controls.py | python | ListEvent.GetLabel | (*args, **kwargs) | return _controls_.ListEvent_GetLabel(*args, **kwargs) | GetLabel(self) -> String | GetLabel(self) -> String | [
"GetLabel",
"(",
"self",
")",
"-",
">",
"String"
] | def GetLabel(*args, **kwargs):
"""GetLabel(self) -> String"""
return _controls_.ListEvent_GetLabel(*args, **kwargs) | [
"def",
"GetLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_controls_",
".",
"ListEvent_GetLabel",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_controls.py#L4326-L4328 | |
apache/incubator-mxnet | f03fb23f1d103fec9541b5ae59ee06b1734a51d9 | python/mxnet/gluon/contrib/data/vision/transforms/bbox/utils.py | python | bbox_xyxy_to_xywh | (xyxy) | Convert bounding boxes from format (xmin, ymin, xmax, ymax) to (x, y, w, h).
Parameters
----------
xyxy : list, tuple or numpy.ndarray
The bbox in format (xmin, ymin, xmax, ymax).
If numpy.ndarray is provided, we expect multiple bounding boxes with
shape `(N, 4)`.
Returns
-... | Convert bounding boxes from format (xmin, ymin, xmax, ymax) to (x, y, w, h). | [
"Convert",
"bounding",
"boxes",
"from",
"format",
"(",
"xmin",
"ymin",
"xmax",
"ymax",
")",
"to",
"(",
"x",
"y",
"w",
"h",
")",
"."
] | def bbox_xyxy_to_xywh(xyxy):
"""Convert bounding boxes from format (xmin, ymin, xmax, ymax) to (x, y, w, h).
Parameters
----------
xyxy : list, tuple or numpy.ndarray
The bbox in format (xmin, ymin, xmax, ymax).
If numpy.ndarray is provided, we expect multiple bounding boxes with
... | [
"def",
"bbox_xyxy_to_xywh",
"(",
"xyxy",
")",
":",
"if",
"isinstance",
"(",
"xyxy",
",",
"(",
"tuple",
",",
"list",
")",
")",
":",
"if",
"not",
"len",
"(",
"xyxy",
")",
"==",
"4",
":",
"raise",
"IndexError",
"(",
"\"Bounding boxes must have 4 elements, giv... | https://github.com/apache/incubator-mxnet/blob/f03fb23f1d103fec9541b5ae59ee06b1734a51d9/python/mxnet/gluon/contrib/data/vision/transforms/bbox/utils.py#L252-L283 | ||
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/palindrome-permutation-ii.py | python | Solution2.generatePalindromes | (self, s) | return [''.join(half_palindrome + mid + half_palindrome[::-1]) \
for half_palindrome in set(itertools.permutations(chars))] if len(mid) < 2 else [] | :type s: str
:rtype: List[str] | :type s: str
:rtype: List[str] | [
":",
"type",
"s",
":",
"str",
":",
"rtype",
":",
"List",
"[",
"str",
"]"
] | def generatePalindromes(self, s):
"""
:type s: str
:rtype: List[str]
"""
cnt = collections.Counter(s)
mid = tuple(k for k, v in cnt.iteritems() if v % 2)
chars = ''.join(k * (v / 2) for k, v in cnt.iteritems())
return [''.join(half_palindrome + mid + half_... | [
"def",
"generatePalindromes",
"(",
"self",
",",
"s",
")",
":",
"cnt",
"=",
"collections",
".",
"Counter",
"(",
"s",
")",
"mid",
"=",
"tuple",
"(",
"k",
"for",
"k",
",",
"v",
"in",
"cnt",
".",
"iteritems",
"(",
")",
"if",
"v",
"%",
"2",
")",
"ch... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/palindrome-permutation-ii.py#L39-L48 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_model.py | python | TFAsymmetryFittingModel._update_tf_asymmetry_simultaneous_fit_function_after_sequential | (self, workspaces: list, functions: list) | Updates the single fit functions after a sequential fit has been run on the Sequential fitting tab. | Updates the single fit functions after a sequential fit has been run on the Sequential fitting tab. | [
"Updates",
"the",
"single",
"fit",
"functions",
"after",
"a",
"sequential",
"fit",
"has",
"been",
"run",
"on",
"the",
"Sequential",
"fitting",
"tab",
"."
] | def _update_tf_asymmetry_simultaneous_fit_function_after_sequential(self, workspaces: list, functions: list) -> None:
"""Updates the single fit functions after a sequential fit has been run on the Sequential fitting tab."""
for fit_index, workspace_names in enumerate(workspaces):
if self._ar... | [
"def",
"_update_tf_asymmetry_simultaneous_fit_function_after_sequential",
"(",
"self",
",",
"workspaces",
":",
"list",
",",
"functions",
":",
"list",
")",
"->",
"None",
":",
"for",
"fit_index",
",",
"workspace_names",
"in",
"enumerate",
"(",
"workspaces",
")",
":",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqtinterfaces/mantidqtinterfaces/Muon/GUI/Common/fitting_widgets/tf_asymmetry_fitting/tf_asymmetry_fitting_model.py#L900-L905 | ||
metashell/metashell | f4177e4854ea00c8dbc722cadab26ef413d798ea | 3rd/templight/clang/bindings/python/clang/cindex.py | python | CursorKind.is_invalid | (self) | return conf.lib.clang_isInvalid(self) | Test if this is an invalid kind. | Test if this is an invalid kind. | [
"Test",
"if",
"this",
"is",
"an",
"invalid",
"kind",
"."
] | def is_invalid(self):
"""Test if this is an invalid kind."""
return conf.lib.clang_isInvalid(self) | [
"def",
"is_invalid",
"(",
"self",
")",
":",
"return",
"conf",
".",
"lib",
".",
"clang_isInvalid",
"(",
"self",
")"
] | https://github.com/metashell/metashell/blob/f4177e4854ea00c8dbc722cadab26ef413d798ea/3rd/templight/clang/bindings/python/clang/cindex.py#L691-L693 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/third_party/coverage/coverage/files.py | python | TreeMatcher.info | (self) | return self.dirs | A list of strings for displaying when dumping state. | A list of strings for displaying when dumping state. | [
"A",
"list",
"of",
"strings",
"for",
"displaying",
"when",
"dumping",
"state",
"."
] | def info(self):
"""A list of strings for displaying when dumping state."""
return self.dirs | [
"def",
"info",
"(",
"self",
")",
":",
"return",
"self",
".",
"dirs"
] | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/coverage/coverage/files.py#L193-L195 | |
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/multiprocessing/managers.py | python | BaseProxy.__str__ | (self) | Return representation of the referent (or a fall-back if that fails) | Return representation of the referent (or a fall-back if that fails) | [
"Return",
"representation",
"of",
"the",
"referent",
"(",
"or",
"a",
"fall",
"-",
"back",
"if",
"that",
"fails",
")"
] | def __str__(self):
'''
Return representation of the referent (or a fall-back if that fails)
'''
try:
return self._callmethod('__repr__')
except Exception:
return repr(self)[:-1] + "; '__str__()' failed>" | [
"def",
"__str__",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_callmethod",
"(",
"'__repr__'",
")",
"except",
"Exception",
":",
"return",
"repr",
"(",
"self",
")",
"[",
":",
"-",
"1",
"]",
"+",
"\"; '__str__()' failed>\""
] | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/multiprocessing/managers.py#L817-L824 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_windows.py | python | CalculateLayoutEvent.SetRect | (*args, **kwargs) | return _windows_.CalculateLayoutEvent_SetRect(*args, **kwargs) | SetRect(self, Rect rect) | SetRect(self, Rect rect) | [
"SetRect",
"(",
"self",
"Rect",
"rect",
")"
] | def SetRect(*args, **kwargs):
"""SetRect(self, Rect rect)"""
return _windows_.CalculateLayoutEvent_SetRect(*args, **kwargs) | [
"def",
"SetRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"CalculateLayoutEvent_SetRect",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_windows.py#L2019-L2021 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/symtable.py | python | Symbol.is_namespace | (self) | return bool(self.__namespaces) | Returns true if name binding introduces new namespace.
If the name is used as the target of a function or class
statement, this will be true.
Note that a single name can be bound to multiple objects. If
is_namespace() is true, the name may also be bound to other
objects, like ... | Returns true if name binding introduces new namespace. | [
"Returns",
"true",
"if",
"name",
"binding",
"introduces",
"new",
"namespace",
"."
] | def is_namespace(self):
"""Returns true if name binding introduces new namespace.
If the name is used as the target of a function or class
statement, this will be true.
Note that a single name can be bound to multiple objects. If
is_namespace() is true, the name may also be bo... | [
"def",
"is_namespace",
"(",
"self",
")",
":",
"return",
"bool",
"(",
"self",
".",
"__namespaces",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/symtable.py#L210-L221 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/debug/lib/stepper.py | python | NodeStepper.last_updated | (self) | return self._last_updated | Get the names of the variables updated in the last cont() call.
Returns:
A set of the variable names updated in the previous cont() call.
If no cont() call has occurred before, returns None. | Get the names of the variables updated in the last cont() call. | [
"Get",
"the",
"names",
"of",
"the",
"variables",
"updated",
"in",
"the",
"last",
"cont",
"()",
"call",
"."
] | def last_updated(self):
"""Get the names of the variables updated in the last cont() call.
Returns:
A set of the variable names updated in the previous cont() call.
If no cont() call has occurred before, returns None.
"""
return self._last_updated | [
"def",
"last_updated",
"(",
"self",
")",
":",
"return",
"self",
".",
"_last_updated"
] | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/lib/stepper.py#L852-L860 | |
apache/singa | 93fd9da72694e68bfe3fb29d0183a65263d238a1 | setup.py | python | generate_singa_config | (with_cuda, with_nccl) | Generate singa_config.h file to define some macros for the cpp code.
Args:
with_cuda(bool): indicator for cudnn and cuda lib
with_nccl(bool): indicator for nccl lib | Generate singa_config.h file to define some macros for the cpp code. | [
"Generate",
"singa_config",
".",
"h",
"file",
"to",
"define",
"some",
"macros",
"for",
"the",
"cpp",
"code",
"."
] | def generate_singa_config(with_cuda, with_nccl):
'''Generate singa_config.h file to define some macros for the cpp code.
Args:
with_cuda(bool): indicator for cudnn and cuda lib
with_nccl(bool): indicator for nccl lib
'''
config = ['#define USE_CBLAS', '#define USE_GLOG', '#define USE_DN... | [
"def",
"generate_singa_config",
"(",
"with_cuda",
",",
"with_nccl",
")",
":",
"config",
"=",
"[",
"'#define USE_CBLAS'",
",",
"'#define USE_GLOG'",
",",
"'#define USE_DNNL'",
"]",
"if",
"not",
"with_cuda",
":",
"config",
".",
"append",
"(",
"'#define CPU_ONLY'",
"... | https://github.com/apache/singa/blob/93fd9da72694e68bfe3fb29d0183a65263d238a1/setup.py#L140-L189 | ||
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/docs/parser.py | python | is_free_function | (py_object, full_name, index) | return True | Check if input is a free function (and not a class- or static method).
Args:
py_object: The the object in question.
full_name: The full name of the object, like `tf.module.symbol`.
index: The {full_name:py_object} dictionary for the public API.
Returns:
True if the obeject is a stand-alone functio... | Check if input is a free function (and not a class- or static method). | [
"Check",
"if",
"input",
"is",
"a",
"free",
"function",
"(",
"and",
"not",
"a",
"class",
"-",
"or",
"static",
"method",
")",
"."
] | def is_free_function(py_object, full_name, index):
"""Check if input is a free function (and not a class- or static method).
Args:
py_object: The the object in question.
full_name: The full name of the object, like `tf.module.symbol`.
index: The {full_name:py_object} dictionary for the public API.
R... | [
"def",
"is_free_function",
"(",
"py_object",
",",
"full_name",
",",
"index",
")",
":",
"if",
"not",
"tf_inspect",
".",
"isfunction",
"(",
"py_object",
")",
":",
"return",
"False",
"parent_name",
"=",
"full_name",
".",
"rsplit",
"(",
"'.'",
",",
"1",
")",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/tools/docs/parser.py#L38-L57 | |
nvdla/sw | 79538ba1b52b040a4a4645f630e457fa01839e90 | umd/external/protobuf-2.6/python/google/protobuf/message.py | python | Message.__getstate__ | (self) | return dict(serialized=self.SerializePartialToString()) | Support the pickle protocol. | Support the pickle protocol. | [
"Support",
"the",
"pickle",
"protocol",
"."
] | def __getstate__(self):
"""Support the pickle protocol."""
return dict(serialized=self.SerializePartialToString()) | [
"def",
"__getstate__",
"(",
"self",
")",
":",
"return",
"dict",
"(",
"serialized",
"=",
"self",
".",
"SerializePartialToString",
"(",
")",
")"
] | https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/message.py#L277-L279 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/operations/check.py | python | create_package_set_from_installed | (**kwargs) | return package_set, problems | Converts a list of distributions into a PackageSet. | Converts a list of distributions into a PackageSet. | [
"Converts",
"a",
"list",
"of",
"distributions",
"into",
"a",
"PackageSet",
"."
] | def create_package_set_from_installed(**kwargs):
# type: (**Any) -> Tuple[PackageSet, bool]
"""Converts a list of distributions into a PackageSet.
"""
# Default to using all packages installed on the system
if kwargs == {}:
kwargs = {"local_only": False, "skip": ()}
package_set = {}
... | [
"def",
"create_package_set_from_installed",
"(",
"*",
"*",
"kwargs",
")",
":",
"# type: (**Any) -> Tuple[PackageSet, bool]",
"# Default to using all packages installed on the system",
"if",
"kwargs",
"==",
"{",
"}",
":",
"kwargs",
"=",
"{",
"\"local_only\"",
":",
"False",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/operations/check.py#L34-L52 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/boringssl/src/util/bot/extract.py | python | CheckedJoin | (output, path) | return os.path.join(output, path) | CheckedJoin returns os.path.join(output, path). It does sanity checks to
ensure the resulting path is under output, but shouldn't be used on untrusted
input. | CheckedJoin returns os.path.join(output, path). It does sanity checks to
ensure the resulting path is under output, but shouldn't be used on untrusted
input. | [
"CheckedJoin",
"returns",
"os",
".",
"path",
".",
"join",
"(",
"output",
"path",
")",
".",
"It",
"does",
"sanity",
"checks",
"to",
"ensure",
"the",
"resulting",
"path",
"is",
"under",
"output",
"but",
"shouldn",
"t",
"be",
"used",
"on",
"untrusted",
"inp... | def CheckedJoin(output, path):
"""
CheckedJoin returns os.path.join(output, path). It does sanity checks to
ensure the resulting path is under output, but shouldn't be used on untrusted
input.
"""
path = os.path.normpath(path)
if os.path.isabs(path) or path.startswith('.'):
raise ValueError(path)
re... | [
"def",
"CheckedJoin",
"(",
"output",
",",
"path",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"path",
")",
"if",
"os",
".",
"path",
".",
"isabs",
"(",
"path",
")",
"or",
"path",
".",
"startswith",
"(",
"'.'",
")",
":",
"raise"... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/boringssl/src/util/bot/extract.py#L27-L36 | |
ZhouWeikuan/DouDiZhu | 0d84ff6c0bc54dba6ae37955de9ae9307513dc99 | code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py | python | Config.set_library_file | (filename) | Set the exact location of libclang | Set the exact location of libclang | [
"Set",
"the",
"exact",
"location",
"of",
"libclang"
] | def set_library_file(filename):
"""Set the exact location of libclang"""
if Config.loaded:
raise Exception("library file must be set before before using " \
"any other functionalities in libclang.")
Config.library_file = filename | [
"def",
"set_library_file",
"(",
"filename",
")",
":",
"if",
"Config",
".",
"loaded",
":",
"raise",
"Exception",
"(",
"\"library file must be set before before using \"",
"\"any other functionalities in libclang.\"",
")",
"Config",
".",
"library_file",
"=",
"filename"
] | https://github.com/ZhouWeikuan/DouDiZhu/blob/0d84ff6c0bc54dba6ae37955de9ae9307513dc99/code/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L3335-L3341 | ||
klzgrad/naiveproxy | ed2c513637c77b18721fe428d7ed395b4d284c83 | src/build/fuchsia/device_target.py | python | DeviceTarget._GetSdkHash | (self) | return (version_info[product_key], version_info[version_key]) | Read version of hash in pre-installed package directory.
Returns:
Tuple of (product, version) of image to be installed.
Raises:
VersionNotFoundError: if contents of buildargs.gn cannot be found or the
version number cannot be extracted. | Read version of hash in pre-installed package directory.
Returns:
Tuple of (product, version) of image to be installed.
Raises:
VersionNotFoundError: if contents of buildargs.gn cannot be found or the
version number cannot be extracted. | [
"Read",
"version",
"of",
"hash",
"in",
"pre",
"-",
"installed",
"package",
"directory",
".",
"Returns",
":",
"Tuple",
"of",
"(",
"product",
"version",
")",
"of",
"image",
"to",
"be",
"installed",
".",
"Raises",
":",
"VersionNotFoundError",
":",
"if",
"cont... | def _GetSdkHash(self):
"""Read version of hash in pre-installed package directory.
Returns:
Tuple of (product, version) of image to be installed.
Raises:
VersionNotFoundError: if contents of buildargs.gn cannot be found or the
version number cannot be extracted.
"""
# TODO(crbug.c... | [
"def",
"_GetSdkHash",
"(",
"self",
")",
":",
"# TODO(crbug.com/1261961): Stop processing buildargs.gn directly.",
"with",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_system_image_dir",
",",
"_BUILD_ARGS",
")",
")",
"as",
"f",
":",
"contents",
... | https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/build/fuchsia/device_target.py#L264-L292 | |
kamyu104/LeetCode-Solutions | 77605708a927ea3b85aee5a479db733938c7c211 | Python/integer-break.py | python | Solution2.integerBreak | (self, n) | return res[n % 4] | :type n: int
:rtype: int | :type n: int
:rtype: int | [
":",
"type",
"n",
":",
"int",
":",
"rtype",
":",
"int"
] | def integerBreak(self, n):
"""
:type n: int
:rtype: int
"""
if n < 4:
return n - 1
# integerBreak(n) = max(integerBreak(n - 2) * 2, integerBreak(n - 3) * 3)
res = [0, 1, 2, 3]
for i in xrange(4, n + 1):
res[i % 4] = max(res[(i - 2)... | [
"def",
"integerBreak",
"(",
"self",
",",
"n",
")",
":",
"if",
"n",
"<",
"4",
":",
"return",
"n",
"-",
"1",
"# integerBreak(n) = max(integerBreak(n - 2) * 2, integerBreak(n - 3) * 3)",
"res",
"=",
"[",
"0",
",",
"1",
",",
"2",
",",
"3",
"]",
"for",
"i",
"... | https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/integer-break.py#L50-L62 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/imaplib.py | python | IMAP4.deleteacl | (self, mailbox, who) | return self._simple_command('DELETEACL', mailbox, who) | Delete the ACLs (remove any rights) set for who on mailbox.
(typ, [data]) = <instance>.deleteacl(mailbox, who) | Delete the ACLs (remove any rights) set for who on mailbox. | [
"Delete",
"the",
"ACLs",
"(",
"remove",
"any",
"rights",
")",
"set",
"for",
"who",
"on",
"mailbox",
"."
] | def deleteacl(self, mailbox, who):
"""Delete the ACLs (remove any rights) set for who on mailbox.
(typ, [data]) = <instance>.deleteacl(mailbox, who)
"""
return self._simple_command('DELETEACL', mailbox, who) | [
"def",
"deleteacl",
"(",
"self",
",",
"mailbox",
",",
"who",
")",
":",
"return",
"self",
".",
"_simple_command",
"(",
"'DELETEACL'",
",",
"mailbox",
",",
"who",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/imaplib.py#L490-L495 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | src/icebox/icebox_py/__init__.py | python | Vm.resume | (self) | Resume vm. | Resume vm. | [
"Resume",
"vm",
"."
] | def resume(self):
"""Resume vm."""
libicebox.resume() | [
"def",
"resume",
"(",
"self",
")",
":",
"libicebox",
".",
"resume",
"(",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/src/icebox/icebox_py/__init__.py#L650-L652 | ||
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetAsmflags | (self, config) | return asmflags | Returns the flags that need to be added to ml invocations. | Returns the flags that need to be added to ml invocations. | [
"Returns",
"the",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
"ml",
"invocations",
"."
] | def GetAsmflags(self, config):
"""Returns the flags that need to be added to ml invocations."""
config = self._TargetConfig(config)
asmflags = []
safeseh = self._Setting(('MASM', 'UseSafeExceptionHandlers'), config)
if safeseh == 'true':
asmflags.append('/safeseh')
return asmflags | [
"def",
"GetAsmflags",
"(",
"self",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"asmflags",
"=",
"[",
"]",
"safeseh",
"=",
"self",
".",
"_Setting",
"(",
"(",
"'MASM'",
",",
"'UseSafeExceptionHandlers'",
")",
"... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L425-L432 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/ordered_set.py | python | OrderedSet.__iter__ | (self) | return iter(self.items) | Example:
>>> list(iter(OrderedSet([1, 2, 3])))
[1, 2, 3] | Example:
>>> list(iter(OrderedSet([1, 2, 3])))
[1, 2, 3] | [
"Example",
":",
">>>",
"list",
"(",
"iter",
"(",
"OrderedSet",
"(",
"[",
"1",
"2",
"3",
"]",
")))",
"[",
"1",
"2",
"3",
"]"
] | def __iter__(self):
"""
Example:
>>> list(iter(OrderedSet([1, 2, 3])))
[1, 2, 3]
"""
return iter(self.items) | [
"def",
"__iter__",
"(",
"self",
")",
":",
"return",
"iter",
"(",
"self",
".",
"items",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/setuptools/_vendor/ordered_set.py#L259-L265 | |
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | tools/auto_bisect/bisect_perf_regression.py | python | BisectPerformanceMetrics._FindNextDepotToBisect | (
self, current_depot, min_revision_state, max_revision_state) | return external_depot | Decides which depot the script should dive into next (if any).
Args:
current_depot: Current depot being bisected.
min_revision_state: State of the earliest revision in the bisect range.
max_revision_state: State of the latest revision in the bisect range.
Returns:
Name of the depot to ... | Decides which depot the script should dive into next (if any). | [
"Decides",
"which",
"depot",
"the",
"script",
"should",
"dive",
"into",
"next",
"(",
"if",
"any",
")",
"."
] | def _FindNextDepotToBisect(
self, current_depot, min_revision_state, max_revision_state):
"""Decides which depot the script should dive into next (if any).
Args:
current_depot: Current depot being bisected.
min_revision_state: State of the earliest revision in the bisect range.
max_revi... | [
"def",
"_FindNextDepotToBisect",
"(",
"self",
",",
"current_depot",
",",
"min_revision_state",
",",
"max_revision_state",
")",
":",
"external_depot",
"=",
"None",
"for",
"next_depot",
"in",
"bisect_utils",
".",
"DEPOT_NAMES",
":",
"if",
"(",
"'platform'",
"in",
"b... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/auto_bisect/bisect_perf_regression.py#L1784-L1822 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/package_index.py | python | parse_bdist_wininst | (name) | return base, py_ver, plat | Return (base,pyversion) or (None,None) for possible .exe name | Return (base,pyversion) or (None,None) for possible .exe name | [
"Return",
"(",
"base",
"pyversion",
")",
"or",
"(",
"None",
"None",
")",
"for",
"possible",
".",
"exe",
"name"
] | def parse_bdist_wininst(name):
"""Return (base,pyversion) or (None,None) for possible .exe name"""
lower = name.lower()
base, py_ver, plat = None, None, None
if lower.endswith('.exe'):
if lower.endswith('.win32.exe'):
base = name[:-10]
plat = 'win32'
elif lower.... | [
"def",
"parse_bdist_wininst",
"(",
"name",
")",
":",
"lower",
"=",
"name",
".",
"lower",
"(",
")",
"base",
",",
"py_ver",
",",
"plat",
"=",
"None",
",",
"None",
",",
"None",
"if",
"lower",
".",
"endswith",
"(",
"'.exe'",
")",
":",
"if",
"lower",
".... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/package_index.py#L62-L83 | |
FreeCAD/FreeCAD | ba42231b9c6889b89e064d6d563448ed81e376ec | src/Mod/Arch/ArchProfile.py | python | makeProfile | (profile=[0,'REC','REC100x100','R',100,100]) | return obj | makeProfile(profile): returns a shape with the face defined by the profile data | makeProfile(profile): returns a shape with the face defined by the profile data | [
"makeProfile",
"(",
"profile",
")",
":",
"returns",
"a",
"shape",
"with",
"the",
"face",
"defined",
"by",
"the",
"profile",
"data"
] | def makeProfile(profile=[0,'REC','REC100x100','R',100,100]):
'''makeProfile(profile): returns a shape with the face defined by the profile data'''
if not FreeCAD.ActiveDocument:
FreeCAD.Console.PrintError("No active document. Aborting\n")
return
obj = FreeCAD.ActiveDocument.addObject("Par... | [
"def",
"makeProfile",
"(",
"profile",
"=",
"[",
"0",
",",
"'REC'",
",",
"'REC100x100'",
",",
"'R'",
",",
"100",
",",
"100",
"]",
")",
":",
"if",
"not",
"FreeCAD",
".",
"ActiveDocument",
":",
"FreeCAD",
".",
"Console",
".",
"PrintError",
"(",
"\"No acti... | https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Arch/ArchProfile.py#L85-L108 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/inspect.py | python | Parameter.replace | (self, *, name=_void, kind=_void,
annotation=_void, default=_void) | return type(self)(name, kind, default=default, annotation=annotation) | Creates a customized copy of the Parameter. | Creates a customized copy of the Parameter. | [
"Creates",
"a",
"customized",
"copy",
"of",
"the",
"Parameter",
"."
] | def replace(self, *, name=_void, kind=_void,
annotation=_void, default=_void):
"""Creates a customized copy of the Parameter."""
if name is _void:
name = self._name
if kind is _void:
kind = self._kind
if annotation is _void:
annotati... | [
"def",
"replace",
"(",
"self",
",",
"*",
",",
"name",
"=",
"_void",
",",
"kind",
"=",
"_void",
",",
"annotation",
"=",
"_void",
",",
"default",
"=",
"_void",
")",
":",
"if",
"name",
"is",
"_void",
":",
"name",
"=",
"self",
".",
"_name",
"if",
"ki... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/inspect.py#L2533-L2549 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/py/py/_io/capture.py | python | FDCapture.__init__ | (self, targetfd, tmpfile=None, now=True, patchsys=False) | save targetfd descriptor, and open a new
temporary file there. If no tmpfile is
specified a tempfile.Tempfile() will be opened
in text mode. | save targetfd descriptor, and open a new
temporary file there. If no tmpfile is
specified a tempfile.Tempfile() will be opened
in text mode. | [
"save",
"targetfd",
"descriptor",
"and",
"open",
"a",
"new",
"temporary",
"file",
"there",
".",
"If",
"no",
"tmpfile",
"is",
"specified",
"a",
"tempfile",
".",
"Tempfile",
"()",
"will",
"be",
"opened",
"in",
"text",
"mode",
"."
] | def __init__(self, targetfd, tmpfile=None, now=True, patchsys=False):
""" save targetfd descriptor, and open a new
temporary file there. If no tmpfile is
specified a tempfile.Tempfile() will be opened
in text mode.
"""
self.targetfd = targetfd
if tmpf... | [
"def",
"__init__",
"(",
"self",
",",
"targetfd",
",",
"tmpfile",
"=",
"None",
",",
"now",
"=",
"True",
",",
"patchsys",
"=",
"False",
")",
":",
"self",
".",
"targetfd",
"=",
"targetfd",
"if",
"tmpfile",
"is",
"None",
"and",
"targetfd",
"!=",
"0",
":"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_io/capture.py#L34-L50 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/contrib/tensor_forest/python/ops/training_ops.py | python | _ScatterAddNdimShape | (unused_op) | return [] | Shape function for ScatterAddNdim Op. | Shape function for ScatterAddNdim Op. | [
"Shape",
"function",
"for",
"ScatterAddNdim",
"Op",
"."
] | def _ScatterAddNdimShape(unused_op):
"""Shape function for ScatterAddNdim Op."""
return [] | [
"def",
"_ScatterAddNdimShape",
"(",
"unused_op",
")",
":",
"return",
"[",
"]"
] | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/tensor_forest/python/ops/training_ops.py#L95-L97 | |
bairdzhang/smallhardface | 76fa1d87a9602d9b13d7a7fe693fc7aec91cab80 | external/marcopede-face-eval-f2870fd85d48/util.py | python | load | (filename) | return aux | load any python object | load any python object | [
"load",
"any",
"python",
"object"
] | def load(filename):
"""
load any python object
"""
fd = open(filename, "r")
aux = cPickle.load(fd)
fd.close()
return aux | [
"def",
"load",
"(",
"filename",
")",
":",
"fd",
"=",
"open",
"(",
"filename",
",",
"\"r\"",
")",
"aux",
"=",
"cPickle",
".",
"load",
"(",
"fd",
")",
"fd",
".",
"close",
"(",
")",
"return",
"aux"
] | https://github.com/bairdzhang/smallhardface/blob/76fa1d87a9602d9b13d7a7fe693fc7aec91cab80/external/marcopede-face-eval-f2870fd85d48/util.py#L43-L50 | |
gaoxiang12/ORBSLAM2_with_pointcloud_map | cf94d66a9e4253abd66398c7ef461a7a903efffe | ORB_SLAM2_modified/Examples/ROS/ORB_SLAM2/build/devel/_setup_util.py | python | rollback_env_variables | (environ, env_var_subfolders) | return lines | Generate shell code to reset environment variables
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
This does not cover modifications performed by environment hooks. | Generate shell code to reset environment variables
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
This does not cover modifications performed by environment hooks. | [
"Generate",
"shell",
"code",
"to",
"reset",
"environment",
"variables",
"by",
"unrolling",
"modifications",
"based",
"on",
"all",
"workspaces",
"in",
"CMAKE_PREFIX_PATH",
".",
"This",
"does",
"not",
"cover",
"modifications",
"performed",
"by",
"environment",
"hooks"... | def rollback_env_variables(environ, env_var_subfolders):
'''
Generate shell code to reset environment variables
by unrolling modifications based on all workspaces in CMAKE_PREFIX_PATH.
This does not cover modifications performed by environment hooks.
'''
lines = []
unmodified_environ = copy.... | [
"def",
"rollback_env_variables",
"(",
"environ",
",",
"env_var_subfolders",
")",
":",
"lines",
"=",
"[",
"]",
"unmodified_environ",
"=",
"copy",
".",
"copy",
"(",
"environ",
")",
"for",
"key",
"in",
"sorted",
"(",
"env_var_subfolders",
".",
"keys",
"(",
")",... | https://github.com/gaoxiang12/ORBSLAM2_with_pointcloud_map/blob/cf94d66a9e4253abd66398c7ef461a7a903efffe/ORB_SLAM2_modified/Examples/ROS/ORB_SLAM2/build/devel/_setup_util.py#L62-L80 | |
kushview/Element | 1cc16380caa2ab79461246ba758b9de1f46db2a5 | waflib/Tools/c_config.py | python | cxx_load_tools | (conf) | Loads the Waf c++ extensions | Loads the Waf c++ extensions | [
"Loads",
"the",
"Waf",
"c",
"++",
"extensions"
] | def cxx_load_tools(conf):
"""
Loads the Waf c++ extensions
"""
if not conf.env.DEST_OS:
conf.env.DEST_OS = Utils.unversioned_sys_platform()
conf.load('cxx') | [
"def",
"cxx_load_tools",
"(",
"conf",
")",
":",
"if",
"not",
"conf",
".",
"env",
".",
"DEST_OS",
":",
"conf",
".",
"env",
".",
"DEST_OS",
"=",
"Utils",
".",
"unversioned_sys_platform",
"(",
")",
"conf",
".",
"load",
"(",
"'cxx'",
")"
] | https://github.com/kushview/Element/blob/1cc16380caa2ab79461246ba758b9de1f46db2a5/waflib/Tools/c_config.py#L1010-L1016 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/index/package_finder.py | python | CandidateEvaluator._sort_key | (self, candidate) | return (
has_allowed_hash, yank_value, binary_preference, candidate.version,
build_tag, pri,
) | Function to pass as the `key` argument to a call to sorted() to sort
InstallationCandidates by preference.
Returns a tuple such that tuples sorting as greater using Python's
default comparison operator are more preferred.
The preference is as follows:
First and foremost, candi... | Function to pass as the `key` argument to a call to sorted() to sort
InstallationCandidates by preference. | [
"Function",
"to",
"pass",
"as",
"the",
"key",
"argument",
"to",
"a",
"call",
"to",
"sorted",
"()",
"to",
"sort",
"InstallationCandidates",
"by",
"preference",
"."
] | def _sort_key(self, candidate):
# type: (InstallationCandidate) -> CandidateSortingKey
"""
Function to pass as the `key` argument to a call to sorted() to sort
InstallationCandidates by preference.
Returns a tuple such that tuples sorting as greater using Python's
defaul... | [
"def",
"_sort_key",
"(",
"self",
",",
"candidate",
")",
":",
"# type: (InstallationCandidate) -> CandidateSortingKey",
"valid_tags",
"=",
"self",
".",
"_supported_tags",
"support_num",
"=",
"len",
"(",
"valid_tags",
")",
"build_tag",
"=",
"(",
")",
"# type: BuildTag",... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/index/package_finder.py#L482-L540 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/api.py | python | device_array | (shape, dtype=np.float, strides=None, order='C', stream=0) | return devicearray.DeviceNDArray(shape=shape, strides=strides, dtype=dtype,
stream=stream) | device_array(shape, dtype=np.float, strides=None, order='C', stream=0)
Allocate an empty device ndarray. Similar to :meth:`numpy.empty`. | device_array(shape, dtype=np.float, strides=None, order='C', stream=0) | [
"device_array",
"(",
"shape",
"dtype",
"=",
"np",
".",
"float",
"strides",
"=",
"None",
"order",
"=",
"C",
"stream",
"=",
"0",
")"
] | def device_array(shape, dtype=np.float, strides=None, order='C', stream=0):
"""device_array(shape, dtype=np.float, strides=None, order='C', stream=0)
Allocate an empty device ndarray. Similar to :meth:`numpy.empty`.
"""
shape, strides, dtype = _prepare_shape_strides_dtype(shape, strides, dtype,
... | [
"def",
"device_array",
"(",
"shape",
",",
"dtype",
"=",
"np",
".",
"float",
",",
"strides",
"=",
"None",
",",
"order",
"=",
"'C'",
",",
"stream",
"=",
"0",
")",
":",
"shape",
",",
"strides",
",",
"dtype",
"=",
"_prepare_shape_strides_dtype",
"(",
"shap... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/cuda/api.py#L119-L127 | |
mysql/mysql-router | cc0179f982bb9739a834eb6fd205a56224616133 | ext/gmock/scripts/gmock_doctor.py | python | _OverloadedFunctionActionDiagnoser | (msg) | return _GenericDiagnoser('OFA', 'Overloaded Function Action',
[(gcc_regex, diagnosis),
(clang_regex, diagnosis)],
msg) | Diagnoses the OFA disease, given the error messages by the compiler. | Diagnoses the OFA disease, given the error messages by the compiler. | [
"Diagnoses",
"the",
"OFA",
"disease",
"given",
"the",
"error",
"messages",
"by",
"the",
"compiler",
"."
] | def _OverloadedFunctionActionDiagnoser(msg):
"""Diagnoses the OFA disease, given the error messages by the compiler."""
gcc_regex = (_GCC_FILE_LINE_RE + r'error: no matching function for call to '
r'\'Invoke\(<unresolved overloaded function type>')
clang_regex = (_CLANG_FILE_LINE_RE + r'error: no ... | [
"def",
"_OverloadedFunctionActionDiagnoser",
"(",
"msg",
")",
":",
"gcc_regex",
"=",
"(",
"_GCC_FILE_LINE_RE",
"+",
"r'error: no matching function for call to '",
"r'\\'Invoke\\(<unresolved overloaded function type>'",
")",
"clang_regex",
"=",
"(",
"_CLANG_FILE_LINE_RE",
"+",
"... | https://github.com/mysql/mysql-router/blob/cc0179f982bb9739a834eb6fd205a56224616133/ext/gmock/scripts/gmock_doctor.py#L299-L321 | |
vusec/vuzzer64 | 2b1b0ed757a3dca114db0192fa4ab1add92348bc | fuzzer-code/operators.py | python | GAoperator.double_full_mutate | (self,original,fl) | return self.change_random_full(result,fl) | This is called to do heavy mutation when no progress is made in previous generations. | This is called to do heavy mutation when no progress is made in previous generations. | [
"This",
"is",
"called",
"to",
"do",
"heavy",
"mutation",
"when",
"no",
"progress",
"is",
"made",
"in",
"previous",
"generations",
"."
] | def double_full_mutate(self,original,fl):
''' This is called to do heavy mutation when no progress is made in previous generations. '''
result = self.change_random_full(original,fl)
return self.change_random_full(result,fl) | [
"def",
"double_full_mutate",
"(",
"self",
",",
"original",
",",
"fl",
")",
":",
"result",
"=",
"self",
".",
"change_random_full",
"(",
"original",
",",
"fl",
")",
"return",
"self",
".",
"change_random_full",
"(",
"result",
",",
"fl",
")"
] | https://github.com/vusec/vuzzer64/blob/2b1b0ed757a3dca114db0192fa4ab1add92348bc/fuzzer-code/operators.py#L260-L263 | |
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | rdkit/Chem/GraphDescriptors.py | python | _pyChi0v | (mol) | return res | From equations (5),(9) and (10) of Rev. Comp. Chem. vol 2, 367-422, (1991) | From equations (5),(9) and (10) of Rev. Comp. Chem. vol 2, 367-422, (1991) | [
"From",
"equations",
"(",
"5",
")",
"(",
"9",
")",
"and",
"(",
"10",
")",
"of",
"Rev",
".",
"Comp",
".",
"Chem",
".",
"vol",
"2",
"367",
"-",
"422",
"(",
"1991",
")"
] | def _pyChi0v(mol):
""" From equations (5),(9) and (10) of Rev. Comp. Chem. vol 2, 367-422, (1991)
"""
deltas = _hkDeltas(mol)
while 0 in deltas:
deltas.remove(0)
mol._hkDeltas = None
res = sum(numpy.sqrt(1. / numpy.array(deltas)))
return res | [
"def",
"_pyChi0v",
"(",
"mol",
")",
":",
"deltas",
"=",
"_hkDeltas",
"(",
"mol",
")",
"while",
"0",
"in",
"deltas",
":",
"deltas",
".",
"remove",
"(",
"0",
")",
"mol",
".",
"_hkDeltas",
"=",
"None",
"res",
"=",
"sum",
"(",
"numpy",
".",
"sqrt",
"... | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/rdkit/Chem/GraphDescriptors.py#L259-L268 | |
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/Maze/environment.py | python | MazeEnvironment.mark_maze_agent | (self, agent, r1, c1, r2, c2) | mark a maze cell with an agent moving from r1, c1 to r2, c2 | mark a maze cell with an agent moving from r1, c1 to r2, c2 | [
"mark",
"a",
"maze",
"cell",
"with",
"an",
"agent",
"moving",
"from",
"r1",
"c1",
"to",
"r2",
"c2"
] | def mark_maze_agent(self, agent, r1, c1, r2, c2):
""" mark a maze cell with an agent moving from r1, c1 to r2, c2 """
# remove the previous object, if necessary
self.unmark_maze_agent(r2,c2)
# add a new marker object
position = Vector3f( (r1+1) * GRID_DX, (c1+1) * GRID_DY, 0)
... | [
"def",
"mark_maze_agent",
"(",
"self",
",",
"agent",
",",
"r1",
",",
"c1",
",",
"r2",
",",
"c2",
")",
":",
"# remove the previous object, if necessary",
"self",
".",
"unmark_maze_agent",
"(",
"r2",
",",
"c2",
")",
"# add a new marker object",
"position",
"=",
... | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Maze/environment.py#L328-L337 | ||
DaFuCoding/MTCNN_Caffe | 09c30c3ff391bd9cb6b249c1910afaf147767ab3 | python/caffe/coord_map.py | python | crop | (top_from, top_to) | return L.Crop(top_from, top_to,
crop_param=dict(axis=ax + 1, # +1 for first cropping dim.
offset=list(-np.round(b).astype(int)))) | Define a Crop layer to crop a top (from) to another top (to) by
determining the coordinate mapping between the two and net spec'ing
the axis and shift parameters of the crop. | Define a Crop layer to crop a top (from) to another top (to) by
determining the coordinate mapping between the two and net spec'ing
the axis and shift parameters of the crop. | [
"Define",
"a",
"Crop",
"layer",
"to",
"crop",
"a",
"top",
"(",
"from",
")",
"to",
"another",
"top",
"(",
"to",
")",
"by",
"determining",
"the",
"coordinate",
"mapping",
"between",
"the",
"two",
"and",
"net",
"spec",
"ing",
"the",
"axis",
"and",
"shift"... | def crop(top_from, top_to):
"""
Define a Crop layer to crop a top (from) to another top (to) by
determining the coordinate mapping between the two and net spec'ing
the axis and shift parameters of the crop.
"""
ax, a, b = coord_map_from_to(top_from, top_to)
assert (a == 1).all(), 'scale mism... | [
"def",
"crop",
"(",
"top_from",
",",
"top_to",
")",
":",
"ax",
",",
"a",
",",
"b",
"=",
"coord_map_from_to",
"(",
"top_from",
",",
"top_to",
")",
"assert",
"(",
"a",
"==",
"1",
")",
".",
"all",
"(",
")",
",",
"'scale mismatch on crop (a = {})'",
".",
... | https://github.com/DaFuCoding/MTCNN_Caffe/blob/09c30c3ff391bd9cb6b249c1910afaf147767ab3/python/caffe/coord_map.py#L172-L185 | |
krishauser/Klampt | 972cc83ea5befac3f653c1ba20f80155768ad519 | Python/python2_version/klampt/src/motionplanning.py | python | CSpaceInterface.setSampler | (self, pySamp) | return _motionplanning.CSpaceInterface_setSampler(self, pySamp) | setSampler(CSpaceInterface self, PyObject * pySamp) | setSampler(CSpaceInterface self, PyObject * pySamp) | [
"setSampler",
"(",
"CSpaceInterface",
"self",
"PyObject",
"*",
"pySamp",
")"
] | def setSampler(self, pySamp):
"""
setSampler(CSpaceInterface self, PyObject * pySamp)
"""
return _motionplanning.CSpaceInterface_setSampler(self, pySamp) | [
"def",
"setSampler",
"(",
"self",
",",
"pySamp",
")",
":",
"return",
"_motionplanning",
".",
"CSpaceInterface_setSampler",
"(",
"self",
",",
"pySamp",
")"
] | https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/src/motionplanning.py#L386-L393 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | ConfigBase.GetNextEntry | (*args, **kwargs) | return _misc_.ConfigBase_GetNextEntry(*args, **kwargs) | GetNextEntry(long index) -> (more, value, index)
Allows enumerating the entries in the current group in a config
object. Returns a tuple containing a flag indicating there are more
items, the name of the current item, and an index to pass to
GetNextGroup to fetch the next item. | GetNextEntry(long index) -> (more, value, index) | [
"GetNextEntry",
"(",
"long",
"index",
")",
"-",
">",
"(",
"more",
"value",
"index",
")"
] | def GetNextEntry(*args, **kwargs):
"""
GetNextEntry(long index) -> (more, value, index)
Allows enumerating the entries in the current group in a config
object. Returns a tuple containing a flag indicating there are more
items, the name of the current item, and an index to pass ... | [
"def",
"GetNextEntry",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"ConfigBase_GetNextEntry",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L3194-L3203 | |
wyrover/book-code | 7f4883d9030d553bc6bcfa3da685e34789839900 | 3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py | python | FieldMask.AllFieldsFromDescriptor | (self, message_descriptor) | Gets all direct fields of Message Descriptor to FieldMask. | Gets all direct fields of Message Descriptor to FieldMask. | [
"Gets",
"all",
"direct",
"fields",
"of",
"Message",
"Descriptor",
"to",
"FieldMask",
"."
] | def AllFieldsFromDescriptor(self, message_descriptor):
"""Gets all direct fields of Message Descriptor to FieldMask."""
self.Clear()
for field in message_descriptor.fields:
self.paths.append(field.name) | [
"def",
"AllFieldsFromDescriptor",
"(",
"self",
",",
"message_descriptor",
")",
":",
"self",
".",
"Clear",
"(",
")",
"for",
"field",
"in",
"message_descriptor",
".",
"fields",
":",
"self",
".",
"paths",
".",
"append",
"(",
"field",
".",
"name",
")"
] | https://github.com/wyrover/book-code/blob/7f4883d9030d553bc6bcfa3da685e34789839900/3rdparty/protobuf/python/google/protobuf/internal/well_known_types.py#L397-L401 | ||
nnrg/opennero | 43e12a1bcba6e228639db3886fec1dc47ddc24cb | mods/Roomba/module.py | python | furniture | (x,y) | return (constants.XDIM * x, constants.YDIM * (1-y)) | convert from furniture space to roomba space | convert from furniture space to roomba space | [
"convert",
"from",
"furniture",
"space",
"to",
"roomba",
"space"
] | def furniture(x,y):
"""
convert from furniture space to roomba space
"""
return (constants.XDIM * x, constants.YDIM * (1-y)) | [
"def",
"furniture",
"(",
"x",
",",
"y",
")",
":",
"return",
"(",
"constants",
".",
"XDIM",
"*",
"x",
",",
"constants",
".",
"YDIM",
"*",
"(",
"1",
"-",
"y",
")",
")"
] | https://github.com/nnrg/opennero/blob/43e12a1bcba6e228639db3886fec1dc47ddc24cb/mods/Roomba/module.py#L158-L162 | |
rodeofx/OpenWalter | 6116fbe3f04f1146c854afbfbdbe944feaee647e | walter/katana/WalterIn/walterUSDExtern.py | python | WalterUSDExtern.getPrimsCount | (self) | return WALTER_IN_SO.WalterUSDExtern_getPrimsCount(self.obj) | Gets the number of USD primitives. | Gets the number of USD primitives. | [
"Gets",
"the",
"number",
"of",
"USD",
"primitives",
"."
] | def getPrimsCount(self):
WALTER_IN_SO.WalterUSDExtern_getPrimsCount.restype = c_int
WALTER_IN_SO.WalterUSDExtern_getPrimsCount.argtypes = [c_void_p]
"""Gets the number of USD primitives."""
return WALTER_IN_SO.WalterUSDExtern_getPrimsCount(self.obj) | [
"def",
"getPrimsCount",
"(",
"self",
")",
":",
"WALTER_IN_SO",
".",
"WalterUSDExtern_getPrimsCount",
".",
"restype",
"=",
"c_int",
"WALTER_IN_SO",
".",
"WalterUSDExtern_getPrimsCount",
".",
"argtypes",
"=",
"[",
"c_void_p",
"]",
"return",
"WALTER_IN_SO",
".",
"Walte... | https://github.com/rodeofx/OpenWalter/blob/6116fbe3f04f1146c854afbfbdbe944feaee647e/walter/katana/WalterIn/walterUSDExtern.py#L65-L69 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/symbol/symbol.py | python | Symbol._compose | (self, *args, **kwargs) | Composes symbol using inputs.
x._compose(y, z) <=> x(y,z)
This function mutates the current symbol.
Example
-------
>>> data = mx.symbol.Variable('data')
>>> net1 = mx.symbol.FullyConnected(data=data, name='fc1', num_hidden=10)
>>> net2 = mx.symbol.FullyConnect... | Composes symbol using inputs. | [
"Composes",
"symbol",
"using",
"inputs",
"."
] | def _compose(self, *args, **kwargs):
"""Composes symbol using inputs.
x._compose(y, z) <=> x(y,z)
This function mutates the current symbol.
Example
-------
>>> data = mx.symbol.Variable('data')
>>> net1 = mx.symbol.FullyConnected(data=data, name='fc1', num_hidd... | [
"def",
"_compose",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"name",
"=",
"kwargs",
".",
"pop",
"(",
"'name'",
",",
"None",
")",
"if",
"name",
":",
"name",
"=",
"c_str",
"(",
"name",
")",
"if",
"len",
"(",
"args",
")",
... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/symbol/symbol.py#L420-L473 | ||
Tencent/TNN | 7acca99f54c55747b415a4c57677403eebc7b706 | third_party/flatbuffers/python/flatbuffers/flexbuffers.py | python | Builder._WriteScalarVector | (self, element_type, byte_width, elements, fixed) | return loc | Writes scalar vector elements to the underlying buffer. | Writes scalar vector elements to the underlying buffer. | [
"Writes",
"scalar",
"vector",
"elements",
"to",
"the",
"underlying",
"buffer",
"."
] | def _WriteScalarVector(self, element_type, byte_width, elements, fixed):
"""Writes scalar vector elements to the underlying buffer."""
bit_width = BitWidth.B(byte_width)
# If you get this exception, you're trying to write a vector with a size
# field that is bigger than the scalars you're trying to writ... | [
"def",
"_WriteScalarVector",
"(",
"self",
",",
"element_type",
",",
"byte_width",
",",
"elements",
",",
"fixed",
")",
":",
"bit_width",
"=",
"BitWidth",
".",
"B",
"(",
"byte_width",
")",
"# If you get this exception, you're trying to write a vector with a size",
"# fiel... | https://github.com/Tencent/TNN/blob/7acca99f54c55747b415a4c57677403eebc7b706/third_party/flatbuffers/python/flatbuffers/flexbuffers.py#L1066-L1088 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/setuptools/py2/pkg_resources/_vendor/six.py | python | add_metaclass | (metaclass) | return wrapper | Class decorator for creating a class with a metaclass. | Class decorator for creating a class with a metaclass. | [
"Class",
"decorator",
"for",
"creating",
"a",
"class",
"with",
"a",
"metaclass",
"."
] | def add_metaclass(metaclass):
"""Class decorator for creating a class with a metaclass."""
def wrapper(cls):
orig_vars = cls.__dict__.copy()
slots = orig_vars.get('__slots__')
if slots is not None:
if isinstance(slots, str):
slots = [slots]
for slo... | [
"def",
"add_metaclass",
"(",
"metaclass",
")",
":",
"def",
"wrapper",
"(",
"cls",
")",
":",
"orig_vars",
"=",
"cls",
".",
"__dict__",
".",
"copy",
"(",
")",
"slots",
"=",
"orig_vars",
".",
"get",
"(",
"'__slots__'",
")",
"if",
"slots",
"is",
"not",
"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py2/pkg_resources/_vendor/six.py#L812-L825 | |
H-uru/Plasma | c2140ea046e82e9c199e257a7f2e7edb42602871 | Scripts/Python/plasma/PlasmaTypes.py | python | PtFindAvatar | (events) | return None | Find the avatar in one of the event records | Find the avatar in one of the event records | [
"Find",
"the",
"avatar",
"in",
"one",
"of",
"the",
"event",
"records"
] | def PtFindAvatar(events):
"Find the avatar in one of the event records"
for event in events:
if event[0]==kCollisionEvent or event[0]==kPickedEvent or event[0]==kFacingEvent or event[0]==kContainedEvent or event[0]==kSpawnedEvent:
return event[2]
if event[0] == kMultiStageEvent:
... | [
"def",
"PtFindAvatar",
"(",
"events",
")",
":",
"for",
"event",
"in",
"events",
":",
"if",
"event",
"[",
"0",
"]",
"==",
"kCollisionEvent",
"or",
"event",
"[",
"0",
"]",
"==",
"kPickedEvent",
"or",
"event",
"[",
"0",
"]",
"==",
"kFacingEvent",
"or",
... | https://github.com/H-uru/Plasma/blob/c2140ea046e82e9c199e257a7f2e7edb42602871/Scripts/Python/plasma/PlasmaTypes.py#L209-L217 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py | python | _preprocess_conv3d_input | (x, data_format) | return x, tf_data_format | Transpose and cast the input before the conv3d.
Arguments:
x: input tensor.
data_format: string, `"channels_last"` or `"channels_first"`.
Returns:
A tensor. | Transpose and cast the input before the conv3d. | [
"Transpose",
"and",
"cast",
"the",
"input",
"before",
"the",
"conv3d",
"."
] | def _preprocess_conv3d_input(x, data_format):
"""Transpose and cast the input before the conv3d.
Arguments:
x: input tensor.
data_format: string, `"channels_last"` or `"channels_first"`.
Returns:
A tensor.
"""
tf_data_format = 'NDHWC'
if data_format == 'channels_first':
if not _has_n... | [
"def",
"_preprocess_conv3d_input",
"(",
"x",
",",
"data_format",
")",
":",
"tf_data_format",
"=",
"'NDHWC'",
"if",
"data_format",
"==",
"'channels_first'",
":",
"if",
"not",
"_has_nchw_support",
"(",
")",
":",
"x",
"=",
"array_ops",
".",
"transpose",
"(",
"x",... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/keras/backend.py#L4631-L4647 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/imaplib.py | python | IMAP4.sort | (self, sort_criteria, charset, *search_criteria) | return self._untagged_response(typ, dat, name) | IMAP4rev1 extension SORT command.
(typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...) | IMAP4rev1 extension SORT command. | [
"IMAP4rev1",
"extension",
"SORT",
"command",
"."
] | def sort(self, sort_criteria, charset, *search_criteria):
"""IMAP4rev1 extension SORT command.
(typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...)
"""
name = 'SORT'
#if not name in self.capabilities: # Let the server decide!
# raise s... | [
"def",
"sort",
"(",
"self",
",",
"sort_criteria",
",",
"charset",
",",
"*",
"search_criteria",
")",
":",
"name",
"=",
"'SORT'",
"#if not name in self.capabilities: # Let the server decide!",
"# raise self.error('unimplemented extension command: %s' % name)",
"if",
"(... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/imaplib.py#L688-L699 | |
ApolloAuto/apollo-platform | 86d9dc6743b496ead18d597748ebabd34a513289 | ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/chebyshev.py | python | _zseries_mul | (z1, z2) | return np.convolve(z1, z2) | Multiply two z-series.
Multiply two z-series to produce a z-series.
Parameters
----------
z1, z2 : 1-D ndarray
The arrays must be 1-D but this is not checked.
Returns
-------
product : 1-D ndarray
The product z-series.
Notes
-----
This is simply convolution. I... | Multiply two z-series. | [
"Multiply",
"two",
"z",
"-",
"series",
"."
] | def _zseries_mul(z1, z2) :
"""Multiply two z-series.
Multiply two z-series to produce a z-series.
Parameters
----------
z1, z2 : 1-D ndarray
The arrays must be 1-D but this is not checked.
Returns
-------
product : 1-D ndarray
The product z-series.
Notes
-----... | [
"def",
"_zseries_mul",
"(",
"z1",
",",
"z2",
")",
":",
"return",
"np",
".",
"convolve",
"(",
"z1",
",",
"z2",
")"
] | https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/polynomial/chebyshev.py#L161-L185 | |
PX4/PX4-Autopilot | 0b9f60a0370be53d683352c63fd92db3d6586e18 | Tools/mavlink_px4.py | python | MAVLink.hil_rc_inputs_raw_send | (self, time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi) | return self.send(self.hil_rc_inputs_raw_encode(time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi)) | Sent from simulation to autopilot. The RAW values of the RC channels
received. The standard PPM modulation is as follows:
1000 microseconds: 0%, 2000 microseconds: 100%.
Individual receivers/transmitters might violate this
specification.
t... | Sent from simulation to autopilot. The RAW values of the RC channels
received. The standard PPM modulation is as follows:
1000 microseconds: 0%, 2000 microseconds: 100%.
Individual receivers/transmitters might violate this
specification. | [
"Sent",
"from",
"simulation",
"to",
"autopilot",
".",
"The",
"RAW",
"values",
"of",
"the",
"RC",
"channels",
"received",
".",
"The",
"standard",
"PPM",
"modulation",
"is",
"as",
"follows",
":",
"1000",
"microseconds",
":",
"0%",
"2000",
"microseconds",
":",
... | def hil_rc_inputs_raw_send(self, time_usec, chan1_raw, chan2_raw, chan3_raw, chan4_raw, chan5_raw, chan6_raw, chan7_raw, chan8_raw, chan9_raw, chan10_raw, chan11_raw, chan12_raw, rssi):
'''
Sent from simulation to autopilot. The RAW values of the RC channels
received. The... | [
"def",
"hil_rc_inputs_raw_send",
"(",
"self",
",",
"time_usec",
",",
"chan1_raw",
",",
"chan2_raw",
",",
"chan3_raw",
",",
"chan4_raw",
",",
"chan5_raw",
",",
"chan6_raw",
",",
"chan7_raw",
",",
"chan8_raw",
",",
"chan9_raw",
",",
"chan10_raw",
",",
"chan11_raw"... | https://github.com/PX4/PX4-Autopilot/blob/0b9f60a0370be53d683352c63fd92db3d6586e18/Tools/mavlink_px4.py#L4683-L4707 | |
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/AbstractVisitor.py | python | AbstractVisitor.DictStartVisit | (self, obj) | Defined to generate start of command Python class. | Defined to generate start of command Python class. | [
"Defined",
"to",
"generate",
"start",
"of",
"command",
"Python",
"class",
"."
] | def DictStartVisit(self, obj):
"""
Defined to generate start of command Python class.
"""
raise Exception(
"# DictStartVisit.startCommandVisit() - Implementation Error: you must supply your own concrete implementation."
) | [
"def",
"DictStartVisit",
"(",
"self",
",",
"obj",
")",
":",
"raise",
"Exception",
"(",
"\"# DictStartVisit.startCommandVisit() - Implementation Error: you must supply your own concrete implementation.\"",
")"
] | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/AbstractVisitor.py#L147-L153 | ||
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Platform/posix.py | python | escape | (arg) | return '"' + arg + '"' | escape shell special characters | escape shell special characters | [
"escape",
"shell",
"special",
"characters"
] | def escape(arg):
"""escape shell special characters"""
slash = '\\'
special = '"$'
arg = arg.replace(slash, slash+slash)
for c in special:
arg = arg.replace(c, slash+c)
# print("ESCAPE RESULT: %s" % arg)
return '"' + arg + '"' | [
"def",
"escape",
"(",
"arg",
")",
":",
"slash",
"=",
"'\\\\'",
"special",
"=",
"'\"$'",
"arg",
"=",
"arg",
".",
"replace",
"(",
"slash",
",",
"slash",
"+",
"slash",
")",
"for",
"c",
"in",
"special",
":",
"arg",
"=",
"arg",
".",
"replace",
"(",
"c... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Platform/posix.py#L45-L55 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_misc.py | python | FileType.GetOpenCommand | (*args, **kwargs) | return _misc_.FileType_GetOpenCommand(*args, **kwargs) | GetOpenCommand(self, String filename, String mimetype=EmptyString) -> PyObject | GetOpenCommand(self, String filename, String mimetype=EmptyString) -> PyObject | [
"GetOpenCommand",
"(",
"self",
"String",
"filename",
"String",
"mimetype",
"=",
"EmptyString",
")",
"-",
">",
"PyObject"
] | def GetOpenCommand(*args, **kwargs):
"""GetOpenCommand(self, String filename, String mimetype=EmptyString) -> PyObject"""
return _misc_.FileType_GetOpenCommand(*args, **kwargs) | [
"def",
"GetOpenCommand",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"FileType_GetOpenCommand",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L2605-L2607 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/programs/scripts/internetcontent/nv_python_libs/rev3/rev3_api.py | python | Videos.getVideoID | (self, link) | return videoID | Read the Web page to find the video ID number used for fullscreen autoplay
return the video ID number
return None if the number cannot be found | Read the Web page to find the video ID number used for fullscreen autoplay
return the video ID number
return None if the number cannot be found | [
"Read",
"the",
"Web",
"page",
"to",
"find",
"the",
"video",
"ID",
"number",
"used",
"for",
"fullscreen",
"autoplay",
"return",
"the",
"video",
"ID",
"number",
"return",
"None",
"if",
"the",
"number",
"cannot",
"be",
"found"
] | def getVideoID(self, link):
''' Read the Web page to find the video ID number used for fullscreen autoplay
return the video ID number
return None if the number cannot be found
'''
videoID = None
try:
eTree = etree.parse(link, self.FullScreenParser)
exc... | [
"def",
"getVideoID",
"(",
"self",
",",
"link",
")",
":",
"videoID",
"=",
"None",
"try",
":",
"eTree",
"=",
"etree",
".",
"parse",
"(",
"link",
",",
"self",
".",
"FullScreenParser",
")",
"except",
"Exception",
"as",
"errormsg",
":",
"sys",
".",
"stderr"... | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/programs/scripts/internetcontent/nv_python_libs/rev3/rev3_api.py#L457-L489 | |
generalized-intelligence/GAAS | 29ab17d3e8a4ba18edef3a57c36d8db6329fac73 | algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/so2.py | python | So2.matrix | (self) | return sympy.Matrix([
[self.z.real, -self.z.imag],
[self.z.imag, self.z.real]]) | returns matrix representation | returns matrix representation | [
"returns",
"matrix",
"representation"
] | def matrix(self):
""" returns matrix representation """
return sympy.Matrix([
[self.z.real, -self.z.imag],
[self.z.imag, self.z.real]]) | [
"def",
"matrix",
"(",
"self",
")",
":",
"return",
"sympy",
".",
"Matrix",
"(",
"[",
"[",
"self",
".",
"z",
".",
"real",
",",
"-",
"self",
".",
"z",
".",
"imag",
"]",
",",
"[",
"self",
".",
"z",
".",
"imag",
",",
"self",
".",
"z",
".",
"real... | https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/algorithms/src/LocalizationAndMapping/registration_localization/fast_gicp/thirdparty/Sophus/py/sophus/so2.py#L35-L39 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/grid.py | python | GridTableMessage.SetCommandInt2 | (*args, **kwargs) | return _grid.GridTableMessage_SetCommandInt2(*args, **kwargs) | SetCommandInt2(self, int comInt2) | SetCommandInt2(self, int comInt2) | [
"SetCommandInt2",
"(",
"self",
"int",
"comInt2",
")"
] | def SetCommandInt2(*args, **kwargs):
"""SetCommandInt2(self, int comInt2)"""
return _grid.GridTableMessage_SetCommandInt2(*args, **kwargs) | [
"def",
"SetCommandInt2",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_grid",
".",
"GridTableMessage_SetCommandInt2",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/grid.py#L1099-L1101 | |
MythTV/mythtv | d282a209cb8be85d036f85a62a8ec971b67d45f4 | mythtv/bindings/python/MythTV/dataheap.py | python | Job.setStatus | (self,status) | Job.setStatus(Status) -> None, updates status | Job.setStatus(Status) -> None, updates status | [
"Job",
".",
"setStatus",
"(",
"Status",
")",
"-",
">",
"None",
"updates",
"status"
] | def setStatus(self,status):
"""Job.setStatus(Status) -> None, updates status"""
self.status = status
self.update() | [
"def",
"setStatus",
"(",
"self",
",",
"status",
")",
":",
"self",
".",
"status",
"=",
"status",
"self",
".",
"update",
"(",
")"
] | https://github.com/MythTV/mythtv/blob/d282a209cb8be85d036f85a62a8ec971b67d45f4/mythtv/bindings/python/MythTV/dataheap.py#L712-L715 | ||
priyankchheda/algorithms | c361aa9071573fa9966d5b02d05e524815abcf2b | linked_list/is_palindrome.py | python | Node.__init__ | (self, data) | initializing single node with data | initializing single node with data | [
"initializing",
"single",
"node",
"with",
"data"
] | def __init__(self, data):
""" initializing single node with data """
self.data = data
self.next = None | [
"def",
"__init__",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"data",
"=",
"data",
"self",
".",
"next",
"=",
"None"
] | https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/linked_list/is_palindrome.py#L6-L9 | ||
Polidea/SiriusObfuscator | b0e590d8130e97856afe578869b83a209e2b19be | SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py | python | Cursor.is_anonymous | (self) | return conf.lib.clang_Cursor_isAnonymous(self) | Check if the record is anonymous. | Check if the record is anonymous. | [
"Check",
"if",
"the",
"record",
"is",
"anonymous",
"."
] | def is_anonymous(self):
"""
Check if the record is anonymous.
"""
if self.kind == CursorKind.FIELD_DECL:
return self.type.get_declaration().is_anonymous()
return conf.lib.clang_Cursor_isAnonymous(self) | [
"def",
"is_anonymous",
"(",
"self",
")",
":",
"if",
"self",
".",
"kind",
"==",
"CursorKind",
".",
"FIELD_DECL",
":",
"return",
"self",
".",
"type",
".",
"get_declaration",
"(",
")",
".",
"is_anonymous",
"(",
")",
"return",
"conf",
".",
"lib",
".",
"cla... | https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/clang/bindings/python/clang/cindex.py#L1714-L1720 | |
3drobotics/ardupilot-solo | 05a123b002c11dccc905d4d7703a38e5f36ee723 | mk/PX4/Tools/gencpp/src/gencpp/__init__.py | python | msg_type_to_cpp | (type) | Converts a message type (e.g. uint32, std_msgs/String, etc.) into the C++ declaration
for that type (e.g. uint32_t, std_msgs::String_<ContainerAllocator>)
@param type: The message type
@type type: str
@return: The C++ declaration
@rtype: str | Converts a message type (e.g. uint32, std_msgs/String, etc.) into the C++ declaration
for that type (e.g. uint32_t, std_msgs::String_<ContainerAllocator>) | [
"Converts",
"a",
"message",
"type",
"(",
"e",
".",
"g",
".",
"uint32",
"std_msgs",
"/",
"String",
"etc",
".",
")",
"into",
"the",
"C",
"++",
"declaration",
"for",
"that",
"type",
"(",
"e",
".",
"g",
".",
"uint32_t",
"std_msgs",
"::",
"String_<Container... | def msg_type_to_cpp(type):
"""
Converts a message type (e.g. uint32, std_msgs/String, etc.) into the C++ declaration
for that type (e.g. uint32_t, std_msgs::String_<ContainerAllocator>)
@param type: The message type
@type type: str
@return: The C++ declaration
@rtype: str
"""
(base_... | [
"def",
"msg_type_to_cpp",
"(",
"type",
")",
":",
"(",
"base_type",
",",
"is_array",
",",
"array_len",
")",
"=",
"genmsg",
".",
"msgs",
".",
"parse_type",
"(",
"type",
")",
"cpp_type",
"=",
"None",
"if",
"(",
"genmsg",
".",
"msgs",
".",
"is_builtin",
"(... | https://github.com/3drobotics/ardupilot-solo/blob/05a123b002c11dccc905d4d7703a38e5f36ee723/mk/PX4/Tools/gencpp/src/gencpp/__init__.py#L58-L88 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/Editra/src/ed_stc.py | python | EditraStc.StopRecord | (self) | Stops the recording and builds the macro script
@postcondition: macro recording is stopped | Stops the recording and builds the macro script
@postcondition: macro recording is stopped | [
"Stops",
"the",
"recording",
"and",
"builds",
"the",
"macro",
"script",
"@postcondition",
":",
"macro",
"recording",
"is",
"stopped"
] | def StopRecord(self): # pylint: disable-msg=W0221
"""Stops the recording and builds the macro script
@postcondition: macro recording is stopped
"""
self.recording = False
super(EditraStc, self).StopRecord()
evt = ed_event.StatusEvent(ed_event.edEVT_STATUS, self.GetId(),
... | [
"def",
"StopRecord",
"(",
"self",
")",
":",
"# pylint: disable-msg=W0221",
"self",
".",
"recording",
"=",
"False",
"super",
"(",
"EditraStc",
",",
"self",
")",
".",
"StopRecord",
"(",
")",
"evt",
"=",
"ed_event",
".",
"StatusEvent",
"(",
"ed_event",
".",
"... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_stc.py#L1513-L1524 | ||
NVIDIA/DALI | bf16cc86ba8f091b145f91962f21fe1b6aff243d | docs/examples/use_cases/tensorflow/efficientdet/model/backbone/efficientnet_model.py | python | Head.call | (self, inputs, training, pooled_features_only) | return outputs | Call the layer. | Call the layer. | [
"Call",
"the",
"layer",
"."
] | def call(self, inputs, training, pooled_features_only):
"""Call the layer."""
outputs = self._relu_fn(self._bn(self._conv_head(inputs), training=training))
self.endpoints["head_1x1"] = outputs
if self._global_params.local_pooling:
shape = outputs.get_shape().as_list()
... | [
"def",
"call",
"(",
"self",
",",
"inputs",
",",
"training",
",",
"pooled_features_only",
")",
":",
"outputs",
"=",
"self",
".",
"_relu_fn",
"(",
"self",
".",
"_bn",
"(",
"self",
".",
"_conv_head",
"(",
"inputs",
")",
",",
"training",
"=",
"training",
"... | https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/docs/examples/use_cases/tensorflow/efficientdet/model/backbone/efficientnet_model.py#L606-L636 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/sparse/base.py | python | spmatrix.tolil | (self, copy=False) | return self.tocsr(copy=False).tolil(copy=copy) | Convert this matrix to LInked List format.
With copy=False, the data/indices may be shared between this matrix and
the resultant lil_matrix. | Convert this matrix to LInked List format. | [
"Convert",
"this",
"matrix",
"to",
"LInked",
"List",
"format",
"."
] | def tolil(self, copy=False):
"""Convert this matrix to LInked List format.
With copy=False, the data/indices may be shared between this matrix and
the resultant lil_matrix.
"""
return self.tocsr(copy=False).tolil(copy=copy) | [
"def",
"tolil",
"(",
"self",
",",
"copy",
"=",
"False",
")",
":",
"return",
"self",
".",
"tocsr",
"(",
"copy",
"=",
"False",
")",
".",
"tolil",
"(",
"copy",
"=",
"copy",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/sparse/base.py#L752-L758 | |
natanielruiz/android-yolo | 1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f | jni-build/jni/include/tensorflow/python/ops/math_ops.py | python | sign | (x, name=None) | Returns an element-wise indication of the sign of a number.
`y = sign(x) = -1` if `x < 0`; 0 if `x == 0`; 1 if `x > 0`.
For complex numbers, `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`.
Args:
x: A `Tensor` or `SparseTensor`. Must be one of the following types: `half`,
`float32`, `float64`,... | Returns an element-wise indication of the sign of a number. | [
"Returns",
"an",
"element",
"-",
"wise",
"indication",
"of",
"the",
"sign",
"of",
"a",
"number",
"."
] | def sign(x, name=None):
"""Returns an element-wise indication of the sign of a number.
`y = sign(x) = -1` if `x < 0`; 0 if `x == 0`; 1 if `x > 0`.
For complex numbers, `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`.
Args:
x: A `Tensor` or `SparseTensor`. Must be one of the following types: `half`... | [
"def",
"sign",
"(",
"x",
",",
"name",
"=",
"None",
")",
":",
"with",
"ops",
".",
"op_scope",
"(",
"[",
"x",
"]",
",",
"name",
",",
"\"Sign\"",
")",
"as",
"name",
":",
"if",
"isinstance",
"(",
"x",
",",
"ops",
".",
"SparseTensor",
")",
":",
"x_s... | https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/math_ops.py#L304-L324 | ||
adobe/chromium | cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7 | chrome/common/extensions/PRESUBMIT.py | python | DocsGenerated | (input_api) | return any(IsGeneratedDoc(path, input_api)
for path in input_api.LocalPaths()) | Return True if there are any generated docs in this change.
Generated docs are the files that are the output of build.py. Typically
all docs changes will contain both generated docs and non-generated files. | Return True if there are any generated docs in this change. | [
"Return",
"True",
"if",
"there",
"are",
"any",
"generated",
"docs",
"in",
"this",
"change",
"."
] | def DocsGenerated(input_api):
"""Return True if there are any generated docs in this change.
Generated docs are the files that are the output of build.py. Typically
all docs changes will contain both generated docs and non-generated files.
"""
return any(IsGeneratedDoc(path, input_api)
for path ... | [
"def",
"DocsGenerated",
"(",
"input_api",
")",
":",
"return",
"any",
"(",
"IsGeneratedDoc",
"(",
"path",
",",
"input_api",
")",
"for",
"path",
"in",
"input_api",
".",
"LocalPaths",
"(",
")",
")"
] | https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/chrome/common/extensions/PRESUBMIT.py#L117-L124 | |
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/isis_instrument.py | python | BaseInstrument.get_default_beam_center | (self) | return [0, 0] | Returns the default beam center position, or the pixel location
of real-space coordinates (0,0). | Returns the default beam center position, or the pixel location
of real-space coordinates (0,0). | [
"Returns",
"the",
"default",
"beam",
"center",
"position",
"or",
"the",
"pixel",
"location",
"of",
"real",
"-",
"space",
"coordinates",
"(",
"0",
"0",
")",
"."
] | def get_default_beam_center(self):
"""
Returns the default beam center position, or the pixel location
of real-space coordinates (0,0).
"""
return [0, 0] | [
"def",
"get_default_beam_center",
"(",
"self",
")",
":",
"return",
"[",
"0",
",",
"0",
"]"
] | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_instrument.py#L39-L44 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/pandas/py3/pandas/core/generic.py | python | NDFrame.to_excel | (
self,
excel_writer,
sheet_name: str = "Sheet1",
na_rep: str = "",
float_format: str | None = None,
columns=None,
header=True,
index=True,
index_label=None,
startrow=0,
startcol=0,
engine=None,
merge_cells=True,
... | Write {klass} to an Excel sheet.
To write a single {klass} to an Excel .xlsx file it is only necessary to
specify a target file name. To write to multiple sheets it is necessary to
create an `ExcelWriter` object with a target file name, and specify a sheet
in the file to write to.
... | Write {klass} to an Excel sheet. | [
"Write",
"{",
"klass",
"}",
"to",
"an",
"Excel",
"sheet",
"."
] | def to_excel(
self,
excel_writer,
sheet_name: str = "Sheet1",
na_rep: str = "",
float_format: str | None = None,
columns=None,
header=True,
index=True,
index_label=None,
startrow=0,
startcol=0,
engine=None,
merge_cel... | [
"def",
"to_excel",
"(",
"self",
",",
"excel_writer",
",",
"sheet_name",
":",
"str",
"=",
"\"Sheet1\"",
",",
"na_rep",
":",
"str",
"=",
"\"\"",
",",
"float_format",
":",
"str",
"|",
"None",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"header",
"=",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/generic.py#L2131-L2292 | ||
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | third_party/closure_linter/closure_linter/common/tokenizer.py | python | Tokenizer._CreateToken | (self, string, token_type, line, line_number, values=None) | return tokens.Token(string, token_type, line, line_number, values) | Creates a new Token object (or subclass).
Args:
string: The string of input the token represents.
token_type: The type of token.
line: The text of the line this token is in.
line_number: The line number of the token.
values: A dict of named values within the token. For instance, a
... | Creates a new Token object (or subclass). | [
"Creates",
"a",
"new",
"Token",
"object",
"(",
"or",
"subclass",
")",
"."
] | def _CreateToken(self, string, token_type, line, line_number, values=None):
"""Creates a new Token object (or subclass).
Args:
string: The string of input the token represents.
token_type: The type of token.
line: The text of the line this token is in.
line_number: The line number of th... | [
"def",
"_CreateToken",
"(",
"self",
",",
"string",
",",
"token_type",
",",
"line",
",",
"line_number",
",",
"values",
"=",
"None",
")",
":",
"return",
"tokens",
".",
"Token",
"(",
"string",
",",
"token_type",
",",
"line",
",",
"line_number",
",",
"values... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/third_party/closure_linter/closure_linter/common/tokenizer.py#L78-L93 | |
Kitware/VTK | 5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8 | Utilities/Maintenance/vtk_generate_pyi.py | python | isenum | (m) | return (isclass(m) and issubclass(m, int)) | Check for enums (currently derived from int) | Check for enums (currently derived from int) | [
"Check",
"for",
"enums",
"(",
"currently",
"derived",
"from",
"int",
")"
] | def isenum(m):
"""Check for enums (currently derived from int)"""
return (isclass(m) and issubclass(m, int)) | [
"def",
"isenum",
"(",
"m",
")",
":",
"return",
"(",
"isclass",
"(",
"m",
")",
"and",
"issubclass",
"(",
"m",
",",
"int",
")",
")"
] | https://github.com/Kitware/VTK/blob/5b4df4d90a4f31194d97d3c639dd38ea8f81e8b8/Utilities/Maintenance/vtk_generate_pyi.py#L71-L73 | |
SoarGroup/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | scons/scons-local-4.1.0/SCons/Tool/docbook/__init__.py | python | __extend_targets_sources | (target, source) | return target, source | Prepare the lists of target and source files. | Prepare the lists of target and source files. | [
"Prepare",
"the",
"lists",
"of",
"target",
"and",
"source",
"files",
"."
] | def __extend_targets_sources(target, source):
""" Prepare the lists of target and source files. """
if not SCons.Util.is_List(target):
target = [target]
if not source:
source = target[:]
elif not SCons.Util.is_List(source):
source = [source]
if len(target) < len(source):
... | [
"def",
"__extend_targets_sources",
"(",
"target",
",",
"source",
")",
":",
"if",
"not",
"SCons",
".",
"Util",
".",
"is_List",
"(",
"target",
")",
":",
"target",
"=",
"[",
"target",
"]",
"if",
"not",
"source",
":",
"source",
"=",
"target",
"[",
":",
"... | https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/docbook/__init__.py#L71-L82 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.