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
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/orchestrator/module.py
python
OrchestratorCli._osd_rm_start
(self, osd_id: List[str], replace: bool = False, force: bool = False, zap: bool = False)
return HandleCommandResult(stdout=completion.result_str())
Remove OSD daemons
Remove OSD daemons
[ "Remove", "OSD", "daemons" ]
def _osd_rm_start(self, osd_id: List[str], replace: bool = False, force: bool = False, zap: bool = False) -> HandleCommandResult: """Remove OSD daemons""" completion = self.remove_osds(osd_id, replace=replace, force=...
[ "def", "_osd_rm_start", "(", "self", ",", "osd_id", ":", "List", "[", "str", "]", ",", "replace", ":", "bool", "=", "False", ",", "force", ":", "bool", "=", "False", ",", "zap", ":", "bool", "=", "False", ")", "->", "HandleCommandResult", ":", "compl...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/orchestrator/module.py#L804-L812
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/tools/docs/pretty_docs.py
python
_Metadata.__init__
(self, name)
Creata a Metadata builder. Args: name: The name of the page being described by the Metadata block.
Creata a Metadata builder.
[ "Creata", "a", "Metadata", "builder", "." ]
def __init__(self, name): """Creata a Metadata builder. Args: name: The name of the page being described by the Metadata block. """ self.name = name self._content = []
[ "def", "__init__", "(", "self", ",", "name", ")", ":", "self", ".", "name", "=", "name", "self", ".", "_content", "=", "[", "]" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/tools/docs/pretty_docs.py#L316-L323
microsoft/ELL
a1d6bacc37a14879cc025d9be2ba40b1a0632315
tools/importers/common/converters.py
python
ConvertUnaryOperation.convert
(self, conversion_parameters: typing.Mapping[str, typing.Any])
return None
Return the appropriate ELL node
Return the appropriate ELL node
[ "Return", "the", "appropriate", "ELL", "node" ]
def convert(self, conversion_parameters: typing.Mapping[str, typing.Any]): """ Return the appropriate ELL node """ return None
[ "def", "convert", "(", "self", ",", "conversion_parameters", ":", "typing", ".", "Mapping", "[", "str", ",", "typing", ".", "Any", "]", ")", ":", "return", "None" ]
https://github.com/microsoft/ELL/blob/a1d6bacc37a14879cc025d9be2ba40b1a0632315/tools/importers/common/converters.py#L1607-L1611
nvdla/sw
79538ba1b52b040a4a4645f630e457fa01839e90
umd/external/protobuf-2.6/python/google/protobuf/internal/cpp_message.py
python
NewCMessage
(full_message_name)
return _net_proto2___python.NewCMessage(full_message_name)
Creates a new C++ protocol message by its name.
Creates a new C++ protocol message by its name.
[ "Creates", "a", "new", "C", "++", "protocol", "message", "by", "its", "name", "." ]
def NewCMessage(full_message_name): """Creates a new C++ protocol message by its name.""" return _net_proto2___python.NewCMessage(full_message_name)
[ "def", "NewCMessage", "(", "full_message_name", ")", ":", "return", "_net_proto2___python", ".", "NewCMessage", "(", "full_message_name", ")" ]
https://github.com/nvdla/sw/blob/79538ba1b52b040a4a4645f630e457fa01839e90/umd/external/protobuf-2.6/python/google/protobuf/internal/cpp_message.py#L73-L75
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
Region.XorRegion
(*args, **kwargs)
return _gdi_.Region_XorRegion(*args, **kwargs)
XorRegion(self, Region region) -> bool
XorRegion(self, Region region) -> bool
[ "XorRegion", "(", "self", "Region", "region", ")", "-", ">", "bool" ]
def XorRegion(*args, **kwargs): """XorRegion(self, Region region) -> bool""" return _gdi_.Region_XorRegion(*args, **kwargs)
[ "def", "XorRegion", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "Region_XorRegion", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L1635-L1637
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/command/setopt.py
python
edit_config
(filename, settings, dry_run=False)
Edit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to ...
Edit a configuration file to include `settings`
[ "Edit", "a", "configuration", "file", "to", "include", "settings" ]
def edit_config(filename, settings, dry_run=False): """Edit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or d...
[ "def", "edit_config", "(", "filename", ",", "settings", ",", "dry_run", "=", "False", ")", ":", "log", ".", "debug", "(", "\"Reading configuration from %s\"", ",", "filename", ")", "opts", "=", "configparser", ".", "RawConfigParser", "(", ")", "opts", ".", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/command/setopt.py#L32-L73
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/flatnotebook.py
python
FlatNotebook.GetActiveTabTextColour
(self)
return self._pages._activeTextColour
Get the active tab text colour.
Get the active tab text colour.
[ "Get", "the", "active", "tab", "text", "colour", "." ]
def GetActiveTabTextColour(self): """ Get the active tab text colour. """ return self._pages._activeTextColour
[ "def", "GetActiveTabTextColour", "(", "self", ")", ":", "return", "self", ".", "_pages", ".", "_activeTextColour" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/flatnotebook.py#L4938-L4941
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/aui.py
python
AuiToolBarItem.SetLabel
(*args, **kwargs)
return _aui.AuiToolBarItem_SetLabel(*args, **kwargs)
SetLabel(self, String s)
SetLabel(self, String s)
[ "SetLabel", "(", "self", "String", "s", ")" ]
def SetLabel(*args, **kwargs): """SetLabel(self, String s)""" return _aui.AuiToolBarItem_SetLabel(*args, **kwargs)
[ "def", "SetLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBarItem_SetLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1769-L1771
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/contrib/securetransport.py
python
extract_from_urllib3
()
Undo monkey-patching by :func:`inject_into_urllib3`.
Undo monkey-patching by :func:`inject_into_urllib3`.
[ "Undo", "monkey", "-", "patching", "by", ":", "func", ":", "inject_into_urllib3", "." ]
def extract_from_urllib3(): """ Undo monkey-patching by :func:`inject_into_urllib3`. """ util.SSLContext = orig_util_SSLContext util.ssl_.SSLContext = orig_util_SSLContext util.HAS_SNI = orig_util_HAS_SNI util.ssl_.HAS_SNI = orig_util_HAS_SNI util.IS_SECURETRANSPORT = False util.ssl_...
[ "def", "extract_from_urllib3", "(", ")", ":", "util", ".", "SSLContext", "=", "orig_util_SSLContext", "util", ".", "ssl_", ".", "SSLContext", "=", "orig_util_SSLContext", "util", ".", "HAS_SNI", "=", "orig_util_HAS_SNI", "util", ".", "ssl_", ".", "HAS_SNI", "=",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/urllib3/contrib/securetransport.py#L192-L201
chromiumembedded/cef
80caf947f3fe2210e5344713c5281d8af9bdc295
tools/automate/automate-git.py
python
msg
(message)
Output a message.
Output a message.
[ "Output", "a", "message", "." ]
def msg(message): """ Output a message. """ sys.stdout.write('--> ' + message + "\n")
[ "def", "msg", "(", "message", ")", ":", "sys", ".", "stdout", ".", "write", "(", "'--> '", "+", "message", "+", "\"\\n\"", ")" ]
https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/automate/automate-git.py#L51-L53
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/generic.py
python
NDFrame._add_series_only_operations
(cls)
Add the series only operations to the cls; evaluate the doc strings again.
Add the series only operations to the cls; evaluate the doc strings again.
[ "Add", "the", "series", "only", "operations", "to", "the", "cls", ";", "evaluate", "the", "doc", "strings", "again", "." ]
def _add_series_only_operations(cls): """ Add the series only operations to the cls; evaluate the doc strings again. """ axis_descr, name, name2 = _doc_parms(cls) def nanptp(values, axis=0, skipna=True): nmax = nanops.nanmax(values, axis, skipna) ...
[ "def", "_add_series_only_operations", "(", "cls", ")", ":", "axis_descr", ",", "name", ",", "name2", "=", "_doc_parms", "(", "cls", ")", "def", "nanptp", "(", "values", ",", "axis", "=", "0", ",", "skipna", "=", "True", ")", ":", "nmax", "=", "nanops",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/generic.py#L10107-L10129
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_snapper.py
python
Snapper.setGrid
(self)
Set the grid, if visible.
Set the grid, if visible.
[ "Set", "the", "grid", "if", "visible", "." ]
def setGrid(self): """Set the grid, if visible.""" self.setTrackers() if self.grid and (not self.forceGridOff): if self.grid.Visible: self.grid.set()
[ "def", "setGrid", "(", "self", ")", ":", "self", ".", "setTrackers", "(", ")", "if", "self", ".", "grid", "and", "(", "not", "self", ".", "forceGridOff", ")", ":", "if", "self", ".", "grid", ".", "Visible", ":", "self", ".", "grid", ".", "set", "...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_snapper.py#L1648-L1653
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py
python
InstalledDistribution.check_installed_files
(self)
return mismatches
Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is ...
Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is ...
[ "Checks", "that", "the", "hashes", "and", "sizes", "of", "the", "files", "in", "RECORD", "are", "matched", "by", "the", "files", "themselves", ".", "Returns", "a", "(", "possibly", "empty", ")", "list", "of", "mismatches", ".", "Each", "entry", "in", "th...
def check_installed_files(self): """ Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' ...
[ "def", "check_installed_files", "(", "self", ")", ":", "mismatches", "=", "[", "]", "base", "=", "os", ".", "path", ".", "dirname", "(", "self", ".", "path", ")", "record_path", "=", "self", ".", "get_distinfo_file", "(", "'RECORD'", ")", "for", "path", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/distlib/database.py#L708-L741
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py
python
Series.append
(self, to_append, ignore_index=False, verify_integrity=False)
return concat( to_concat, ignore_index=ignore_index, verify_integrity=verify_integrity )
Concatenate two or more Series. Parameters ---------- to_append : Series or list/tuple of Series Series to append with self. ignore_index : bool, default False If True, do not use the index labels. verify_integrity : bool, default False If Tru...
Concatenate two or more Series.
[ "Concatenate", "two", "or", "more", "Series", "." ]
def append(self, to_append, ignore_index=False, verify_integrity=False): """ Concatenate two or more Series. Parameters ---------- to_append : Series or list/tuple of Series Series to append with self. ignore_index : bool, default False If True, d...
[ "def", "append", "(", "self", ",", "to_append", ",", "ignore_index", "=", "False", ",", "verify_integrity", "=", "False", ")", ":", "from", "pandas", ".", "core", ".", "reshape", ".", "concat", "import", "concat", "if", "isinstance", "(", "to_append", ",",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/pandas/core/series.py#L2504-L2583
tensorflow/io
92b44e180674a8af0e12e405530f7343e3e693e4
tensorflow_io/python/ops/arrow_dataset_ops.py
python
ArrowDataset.from_pandas
( cls, df, columns=None, preserve_index=True, batch_size=None, batch_mode="keep_remainder", )
return cls.from_record_batches( batch, output_types, output_shapes, columns=columns, batch_size=batch_size, batch_mode=batch_mode, )
Create an ArrowDataset from a given Pandas DataFrame. Output types and shapes are inferred from the Arrow schema after DataFrame conversion. If preserve_index is True, the DataFrame index will be the last column. This method requires pyarrow to be installed. Args: df: a Pand...
Create an ArrowDataset from a given Pandas DataFrame. Output types and shapes are inferred from the Arrow schema after DataFrame conversion. If preserve_index is True, the DataFrame index will be the last column. This method requires pyarrow to be installed.
[ "Create", "an", "ArrowDataset", "from", "a", "given", "Pandas", "DataFrame", ".", "Output", "types", "and", "shapes", "are", "inferred", "from", "the", "Arrow", "schema", "after", "DataFrame", "conversion", ".", "If", "preserve_index", "is", "True", "the", "Da...
def from_pandas( cls, df, columns=None, preserve_index=True, batch_size=None, batch_mode="keep_remainder", ): """Create an ArrowDataset from a given Pandas DataFrame. Output types and shapes are inferred from the Arrow schema after DataFrame conversion...
[ "def", "from_pandas", "(", "cls", ",", "df", ",", "columns", "=", "None", ",", "preserve_index", "=", "True", ",", "batch_size", "=", "None", ",", "batch_mode", "=", "\"keep_remainder\"", ",", ")", ":", "import", "pyarrow", "as", "pa", "# pylint: disable=imp...
https://github.com/tensorflow/io/blob/92b44e180674a8af0e12e405530f7343e3e693e4/tensorflow_io/python/ops/arrow_dataset_ops.py#L294-L334
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/calendar.py
python
format
(cols, colwidth=_colwidth, spacing=_spacing)
Prints multi-column formatting for year calendars
Prints multi-column formatting for year calendars
[ "Prints", "multi", "-", "column", "formatting", "for", "year", "calendars" ]
def format(cols, colwidth=_colwidth, spacing=_spacing): """Prints multi-column formatting for year calendars""" print formatstring(cols, colwidth, spacing)
[ "def", "format", "(", "cols", ",", "colwidth", "=", "_colwidth", ",", "spacing", "=", "_spacing", ")", ":", "print", "formatstring", "(", "cols", ",", "colwidth", ",", "spacing", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/calendar.py#L596-L598
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/OpenSfM/opensfm/io.py
python
open_wt
(path)
return io.open(path, 'w', encoding='utf-8')
Open a file in text mode for writing utf-8.
Open a file in text mode for writing utf-8.
[ "Open", "a", "file", "in", "text", "mode", "for", "writing", "utf", "-", "8", "." ]
def open_wt(path): """Open a file in text mode for writing utf-8.""" return io.open(path, 'w', encoding='utf-8')
[ "def", "open_wt", "(", "path", ")", ":", "return", "io", ".", "open", "(", "path", ",", "'w'", ",", "encoding", "=", "'utf-8'", ")" ]
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/OpenSfM/opensfm/io.py#L454-L456
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/elastic/rendezvous/dynamic_rendezvous.py
python
DynamicRendezvousHandler.set_closed
(self)
See base class.
See base class.
[ "See", "base", "class", "." ]
def set_closed(self) -> None: """See base class.""" try: with self._heartbeat_lock: self._close() except Exception as e: self._record( message=f"{type(e).__name__}: {str(e)}", node_state=NodeState.FAILED, ) ...
[ "def", "set_closed", "(", "self", ")", "->", "None", ":", "try", ":", "with", "self", ".", "_heartbeat_lock", ":", "self", ".", "_close", "(", ")", "except", "Exception", "as", "e", ":", "self", ".", "_record", "(", "message", "=", "f\"{type(e).__name__}...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/elastic/rendezvous/dynamic_rendezvous.py#L1063-L1073
raymondlu/super-animation-samples
04234269112ff0dc32447f27a761dbbb00b8ba17
samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py
python
CompileCommand.arguments
(self)
Get an iterable object providing each argument in the command line for the compiler invocation as a _CXString. Invariant : the first argument is the compiler executable
Get an iterable object providing each argument in the command line for the compiler invocation as a _CXString.
[ "Get", "an", "iterable", "object", "providing", "each", "argument", "in", "the", "command", "line", "for", "the", "compiler", "invocation", "as", "a", "_CXString", "." ]
def arguments(self): """ Get an iterable object providing each argument in the command line for the compiler invocation as a _CXString. Invariant : the first argument is the compiler executable """ length = conf.lib.clang_CompileCommand_getNumArgs(self.cmd) for i...
[ "def", "arguments", "(", "self", ")", ":", "length", "=", "conf", ".", "lib", ".", "clang_CompileCommand_getNumArgs", "(", "self", ".", "cmd", ")", "for", "i", "in", "xrange", "(", "length", ")", ":", "yield", "conf", ".", "lib", ".", "clang_CompileComma...
https://github.com/raymondlu/super-animation-samples/blob/04234269112ff0dc32447f27a761dbbb00b8ba17/samples/cocos2d-x-3.1/CocosLuaGame2/frameworks/cocos2d-x/tools/bindings-generator/clang/cindex.py#L2574-L2583
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/regioninfo.py
python
load_endpoint_json
(path)
Loads a given JSON file & returns it. :param path: The path to the JSON file :type path: string :returns: The loaded data
Loads a given JSON file & returns it.
[ "Loads", "a", "given", "JSON", "file", "&", "returns", "it", "." ]
def load_endpoint_json(path): """ Loads a given JSON file & returns it. :param path: The path to the JSON file :type path: string :returns: The loaded data """ with open(path, 'r') as endpoints_file: return json.load(endpoints_file)
[ "def", "load_endpoint_json", "(", "path", ")", ":", "with", "open", "(", "path", ",", "'r'", ")", "as", "endpoints_file", ":", "return", "json", ".", "load", "(", "endpoints_file", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/regioninfo.py#L30-L40
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/stats/_distn_infrastructure.py
python
rv_generic.rvs
(self, *args, **kwds)
return vals
Random variates of given type. Parameters ---------- arg1, arg2, arg3,... : array_like The shape parameter(s) for the distribution (see docstring of the instance object for more information). loc : array_like, optional Location parameter (default=0). ...
Random variates of given type.
[ "Random", "variates", "of", "given", "type", "." ]
def rvs(self, *args, **kwds): """ Random variates of given type. Parameters ---------- arg1, arg2, arg3,... : array_like The shape parameter(s) for the distribution (see docstring of the instance object for more information). loc : array_like, opt...
[ "def", "rvs", "(", "self", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "discrete", "=", "kwds", ".", "pop", "(", "'discrete'", ",", "None", ")", "rndm", "=", "kwds", ".", "pop", "(", "'random_state'", ",", "None", ")", "args", ",", "loc", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/_distn_infrastructure.py#L907-L967
chanyn/3Dpose_ssl
585696676279683a279b1ecca136c0e0d02aef2a
caffe-3dssl/scripts/cpp_lint.py
python
CheckBraces
(filename, clean_lines, linenum, error)
Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Looks for misplaced braces (e.g. at the end of line).
[ "Looks", "for", "misplaced", "braces", "(", "e", ".", "g", ".", "at", "the", "end", "of", "line", ")", "." ]
def CheckBraces(filename, clean_lines, linenum, error): """Looks for misplaced braces (e.g. at the end of line). Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any er...
[ "def", "CheckBraces", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# get rid of comments and strings", "if", "Match", "(", "r'\\s*{\\s*$'", ",", "line", ")", ":", ...
https://github.com/chanyn/3Dpose_ssl/blob/585696676279683a279b1ecca136c0e0d02aef2a/caffe-3dssl/scripts/cpp_lint.py#L3069-L3240
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py
python
Decimal.__floordiv__
(self, other, context=None)
return self._divide(other, context)[0]
self // other
self // other
[ "self", "//", "other" ]
def __floordiv__(self, other, context=None): """self // other""" other = _convert_other(other) if other is NotImplemented: return other if context is None: context = getcontext() ans = self._check_nans(other, context) if ans: return a...
[ "def", "__floordiv__", "(", "self", ",", "other", ",", "context", "=", "None", ")", ":", "other", "=", "_convert_other", "(", "other", ")", "if", "other", "is", "NotImplemented", ":", "return", "other", "if", "context", "is", "None", ":", "context", "=",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/decimal.py#L1547-L1573
cornell-zhang/heterocl
6d9e4b4acc2ee2707b2d25b27298c0335bccedfd
python/heterocl/tvm/ndarray.py
python
vpi
(dev_id=0)
return TVMContext(9, dev_id)
Construct a VPI simulated device Parameters ---------- dev_id : int, optional The integer device id Returns ------- ctx : TVMContext The created context
Construct a VPI simulated device
[ "Construct", "a", "VPI", "simulated", "device" ]
def vpi(dev_id=0): """Construct a VPI simulated device Parameters ---------- dev_id : int, optional The integer device id Returns ------- ctx : TVMContext The created context """ return TVMContext(9, dev_id)
[ "def", "vpi", "(", "dev_id", "=", "0", ")", ":", "return", "TVMContext", "(", "9", ",", "dev_id", ")" ]
https://github.com/cornell-zhang/heterocl/blob/6d9e4b4acc2ee2707b2d25b27298c0335bccedfd/python/heterocl/tvm/ndarray.py#L108-L121
s9xie/DSN
065e49898d239f5c96be558616b2556eabc50351
scripts/cpp_lint.py
python
_CppLintState.SetCountingStyle
(self, counting_style)
Sets the module's counting options.
Sets the module's counting options.
[ "Sets", "the", "module", "s", "counting", "options", "." ]
def SetCountingStyle(self, counting_style): """Sets the module's counting options.""" self.counting = counting_style
[ "def", "SetCountingStyle", "(", "self", ",", "counting_style", ")", ":", "self", ".", "counting", "=", "counting_style" ]
https://github.com/s9xie/DSN/blob/065e49898d239f5c96be558616b2556eabc50351/scripts/cpp_lint.py#L708-L710
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py
python
_SignedVarintSize
(value)
return 10
Compute the size of a signed varint value.
Compute the size of a signed varint value.
[ "Compute", "the", "size", "of", "a", "signed", "varint", "value", "." ]
def _SignedVarintSize(value): """Compute the size of a signed varint value.""" if value < 0: return 10 if value <= 0x7f: return 1 if value <= 0x3fff: return 2 if value <= 0x1fffff: return 3 if value <= 0xfffffff: return 4 if value <= 0x7ffffffff: return 5 if value <= 0x3ffffffffff: return 6 if value <...
[ "def", "_SignedVarintSize", "(", "value", ")", ":", "if", "value", "<", "0", ":", "return", "10", "if", "value", "<=", "0x7f", ":", "return", "1", "if", "value", "<=", "0x3fff", ":", "return", "2", "if", "value", "<=", "0x1fffff", ":", "return", "3",...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/encoder.py#L87-L99
bryanyzhu/Hidden-Two-Stream
f7f684adbdacb6df6b1cf196c3a476cd23484a0f
scripts/cpp_lint.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/bryanyzhu/Hidden-Two-Stream/blob/f7f684adbdacb6df6b1cf196c3a476cd23484a0f/scripts/cpp_lint.py#L1134-L1140
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftgeoutils/circles_apollonius.py
python
circleFrom3CircleTangents
(circle1, circle2, circle3)
Return the circle that is tangent to three other circles. This problem is called the 'Problem of Appollonius'. A special case is that of 'Soddy circles'. To Do ----- Currently not all possible solutions are found, only the Soddy circles. * Calc all 6 homothetic centers. * Create 3 lines ...
Return the circle that is tangent to three other circles.
[ "Return", "the", "circle", "that", "is", "tangent", "to", "three", "other", "circles", "." ]
def circleFrom3CircleTangents(circle1, circle2, circle3): """Return the circle that is tangent to three other circles. This problem is called the 'Problem of Appollonius'. A special case is that of 'Soddy circles'. To Do ----- Currently not all possible solutions are found, only the Soddy cir...
[ "def", "circleFrom3CircleTangents", "(", "circle1", ",", "circle2", ",", "circle3", ")", ":", "if", "(", "geomType", "(", "circle1", ")", "!=", "\"Circle\"", "and", "geomType", "(", "circle2", ")", "!=", "\"Circle\"", "and", "geomType", "(", "circle3", ")", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftgeoutils/circles_apollonius.py#L170-L223
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py
python
Telnet.read_sb_data
(self)
return buf
Return any data available in the SB ... SE queue. Return '' if no SB ... SE available. Should only be called after seeing a SB or SE command. When a new SB command is found, old unread SB data will be discarded. Don't block.
Return any data available in the SB ... SE queue.
[ "Return", "any", "data", "available", "in", "the", "SB", "...", "SE", "queue", "." ]
def read_sb_data(self): """Return any data available in the SB ... SE queue. Return '' if no SB ... SE available. Should only be called after seeing a SB or SE command. When a new SB command is found, old unread SB data will be discarded. Don't block. """ buf = self.sbd...
[ "def", "read_sb_data", "(", "self", ")", ":", "buf", "=", "self", ".", "sbdataq", "self", ".", "sbdataq", "=", "''", "return", "buf" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/telnetlib.py#L455-L465
yun-liu/RCF
91bfb054ad04187dbbe21e539e165ad9bd3ff00b
scripts/cpp_lint.py
python
CheckLanguage
(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error)
Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum:...
Checks rules from the 'C++ language rules' section of cppguide.html.
[ "Checks", "rules", "from", "the", "C", "++", "language", "rules", "section", "of", "cppguide", ".", "html", "." ]
def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, nesting_state, error): """Checks rules from the 'C++ language rules' section of cppguide.html. Some of these rules are hard to test (function overloading, using uint32 inappropriately), but we do the best we can. ...
[ "def", "CheckLanguage", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "file_extension", ",", "include_state", ",", "nesting_state", ",", "error", ")", ":", "# If the line is empty or consists of entirely a comment, no need to", "# check it.", "line", "=", "cle...
https://github.com/yun-liu/RCF/blob/91bfb054ad04187dbbe21e539e165ad9bd3ff00b/scripts/cpp_lint.py#L3834-L4132
Komnomnomnom/swigibpy
cfd307fdbfaffabc69a2dc037538d7e34a8b8daf
swigibpy.py
python
EWrapper.pyError
(self, type, value, traceback)
Handles an error thrown during invocation of an EWrapper method. Arguments are those provided by sys.exc_info()
Handles an error thrown during invocation of an EWrapper method.
[ "Handles", "an", "error", "thrown", "during", "invocation", "of", "an", "EWrapper", "method", "." ]
def pyError(self, type, value, traceback): '''Handles an error thrown during invocation of an EWrapper method. Arguments are those provided by sys.exc_info() ''' sys.stderr.write("Exception thrown during EWrapper method dispatch:\n") print_exception(type, value, traceback)
[ "def", "pyError", "(", "self", ",", "type", ",", "value", ",", "traceback", ")", ":", "sys", ".", "stderr", ".", "write", "(", "\"Exception thrown during EWrapper method dispatch:\\n\"", ")", "print_exception", "(", "type", ",", "value", ",", "traceback", ")" ]
https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L2666-L2672
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/msvc.py
python
EnvironmentInfo.SdkTools
(self)
return list(self._sdk_tools())
Microsoft Windows SDK Tools. Return ------ list of str paths
Microsoft Windows SDK Tools.
[ "Microsoft", "Windows", "SDK", "Tools", "." ]
def SdkTools(self): """ Microsoft Windows SDK Tools. Return ------ list of str paths """ return list(self._sdk_tools())
[ "def", "SdkTools", "(", "self", ")", ":", "return", "list", "(", "self", ".", "_sdk_tools", "(", ")", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/setuptools/msvc.py#L1434-L1443
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
site_scons/site_tools/auto_archive.py
python
auto_archive_gen
(first_env, make_archive_script, pkg_fmt)
return auto_archive
Generate an archive task function for pkg_fmt where pkg_fmt is one of zip, tar, or auto.
Generate an archive task function for pkg_fmt where pkg_fmt is one of zip, tar, or auto.
[ "Generate", "an", "archive", "task", "function", "for", "pkg_fmt", "where", "pkg_fmt", "is", "one", "of", "zip", "tar", "or", "auto", "." ]
def auto_archive_gen(first_env, make_archive_script, pkg_fmt): """Generate an archive task function for pkg_fmt where pkg_fmt is one of zip, tar, or auto.""" if pkg_fmt == "auto": if first_env["PLATFORM"] == "win32": pkg_fmt = "zip" else: pkg_fmt = "tar" def auto_ar...
[ "def", "auto_archive_gen", "(", "first_env", ",", "make_archive_script", ",", "pkg_fmt", ")", ":", "if", "pkg_fmt", "==", "\"auto\"", ":", "if", "first_env", "[", "\"PLATFORM\"", "]", "==", "\"win32\"", ":", "pkg_fmt", "=", "\"zip\"", "else", ":", "pkg_fmt", ...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/site_scons/site_tools/auto_archive.py#L139-L173
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/_grad/grad_nn_ops.py
python
get_bprop_ctc_loss
(self)
return bprop
Grad definition for `CTCLoss` operation
Grad definition for `CTCLoss` operation
[ "Grad", "definition", "for", "CTCLoss", "operation" ]
def get_bprop_ctc_loss(self): """Grad definition for `CTCLoss` operation""" expand = P.ExpandDims() def bprop(inputs, labels_indices, labels_values, sequence_length, out, dout): grad_loss = out[1] grad = grad_loss * expand(dout[0], -1) return grad, zeros_like(labels_indices), zeros_...
[ "def", "get_bprop_ctc_loss", "(", "self", ")", ":", "expand", "=", "P", ".", "ExpandDims", "(", ")", "def", "bprop", "(", "inputs", ",", "labels_indices", ",", "labels_values", ",", "sequence_length", ",", "out", ",", "dout", ")", ":", "grad_loss", "=", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/_grad/grad_nn_ops.py#L1220-L1229
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/special/basic.py
python
y1p_zeros
(nt, complex=False)
return specfun.cyzo(nt, kf, kc)
Compute nt zeros of Bessel derivative Y1'(z), and value at each zero. The values are given by Y1(z1) at each z1 where Y1'(z1)=0. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return only the real zeros; set to True to return ...
Compute nt zeros of Bessel derivative Y1'(z), and value at each zero.
[ "Compute", "nt", "zeros", "of", "Bessel", "derivative", "Y1", "(", "z", ")", "and", "value", "at", "each", "zero", "." ]
def y1p_zeros(nt, complex=False): """Compute nt zeros of Bessel derivative Y1'(z), and value at each zero. The values are given by Y1(z1) at each z1 where Y1'(z1)=0. Parameters ---------- nt : int Number of zeros to return complex : bool, default False Set to False to return on...
[ "def", "y1p_zeros", "(", "nt", ",", "complex", "=", "False", ")", ":", "if", "not", "isscalar", "(", "nt", ")", "or", "(", "floor", "(", "nt", ")", "!=", "nt", ")", "or", "(", "nt", "<=", "0", ")", ":", "raise", "ValueError", "(", "\"Arguments mu...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/special/basic.py#L382-L415
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/inner_ops.py
python
NoRepeatNGram.__init__
(self, ngram_size=1)
NoRepeatNGram Randperm
NoRepeatNGram Randperm
[ "NoRepeatNGram", "Randperm" ]
def __init__(self, ngram_size=1): """NoRepeatNGram Randperm""" validator.check_value_type("ngram_size", ngram_size, [int], self.name) validator.check_int(ngram_size, 1, Rel.GE, "ngram_size", self.name) self.ngram_size = ngram_size self.init_prim_io_names(inputs=['state_seq', 'log...
[ "def", "__init__", "(", "self", ",", "ngram_size", "=", "1", ")", ":", "validator", ".", "check_value_type", "(", "\"ngram_size\"", ",", "ngram_size", ",", "[", "int", "]", ",", "self", ".", "name", ")", "validator", ".", "check_int", "(", "ngram_size", ...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/inner_ops.py#L184-L189
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/tlslite/tlslite/utils/hmac.py
python
HMAC.copy
(self)
return other
Return a separate copy of this hashing object. An update to this copy won't affect the original object.
Return a separate copy of this hashing object.
[ "Return", "a", "separate", "copy", "of", "this", "hashing", "object", "." ]
def copy(self): """Return a separate copy of this hashing object. An update to this copy won't affect the original object. """ other = HMAC(None) #TREVNEW - for faster copying other.digest_size = self.digest_size #TREVNEW other.digestmod = self.digestmod other.in...
[ "def", "copy", "(", "self", ")", ":", "other", "=", "HMAC", "(", "None", ")", "#TREVNEW - for faster copying", "other", ".", "digest_size", "=", "self", ".", "digest_size", "#TREVNEW", "other", ".", "digestmod", "=", "self", ".", "digestmod", "other", ".", ...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/tlslite/tlslite/utils/hmac.py#L64-L74
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/ftplib.py
python
test
()
Test program. Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ... -d dir -l list -p password
Test program. Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...
[ "Test", "program", ".", "Usage", ":", "ftp", "[", "-", "d", "]", "[", "-", "r", "[", "file", "]]", "host", "[", "-", "l", "[", "dir", "]]", "[", "-", "d", "[", "dir", "]]", "[", "-", "p", "]", "[", "file", "]", "..." ]
def test(): '''Test program. Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ... -d dir -l list -p password ''' if len(sys.argv) < 2: print test.__doc__ sys.exit(0) debugging = 0 rcfile = None while sys.argv[1] == '-d': debugging = debug...
[ "def", "test", "(", ")", ":", "if", "len", "(", "sys", ".", "argv", ")", "<", "2", ":", "print", "test", ".", "__doc__", "sys", ".", "exit", "(", "0", ")", "debugging", "=", "0", "rcfile", "=", "None", "while", "sys", ".", "argv", "[", "1", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/ftplib.py#L1034-L1086
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Fem/femresult/resulttools.py
python
show_color_by_scalar_with_cutoff
(resultobj, values, limit=None)
Sets mesh color using list of values. Internally used by show_result function. Parameters ---------- resultobj : Fem::ResultMechanical FreeCAD FEM mechanical result object values : list of floats the values to be colored and cutoff has to be the same length as resultobj.NodeNumb...
Sets mesh color using list of values. Internally used by show_result function.
[ "Sets", "mesh", "color", "using", "list", "of", "values", ".", "Internally", "used", "by", "show_result", "function", "." ]
def show_color_by_scalar_with_cutoff(resultobj, values, limit=None): """Sets mesh color using list of values. Internally used by show_result function. Parameters ---------- resultobj : Fem::ResultMechanical FreeCAD FEM mechanical result object values : list of floats the values to b...
[ "def", "show_color_by_scalar_with_cutoff", "(", "resultobj", ",", "values", ",", "limit", "=", "None", ")", ":", "if", "limit", ":", "filtered_values", "=", "[", "]", "for", "v", "in", "values", ":", "if", "v", ">", "limit", ":", "filtered_values", ".", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Fem/femresult/resulttools.py#L150-L180
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/python/framework/ops.py
python
Graph.create_op
(self, op_type, inputs, dtypes, input_types=None, name=None, attrs=None, op_def=None, compute_shapes=True, compute_device=True)
return ret
Creates an `Operation` in this graph. This is a low-level interface for creating an `Operation`. Most programs will not call this method directly, and instead use the Python op constructors, such as `tf.constant()`, which add ops to the default graph. Args: op_type: The `Operation` type to c...
Creates an `Operation` in this graph.
[ "Creates", "an", "Operation", "in", "this", "graph", "." ]
def create_op(self, op_type, inputs, dtypes, input_types=None, name=None, attrs=None, op_def=None, compute_shapes=True, compute_device=True): """Creates an `Operation` in this graph. This is a low-level interface for creating an `Operation`. Most programs will not call this ...
[ "def", "create_op", "(", "self", ",", "op_type", ",", "inputs", ",", "dtypes", ",", "input_types", "=", "None", ",", "name", "=", "None", ",", "attrs", "=", "None", ",", "op_def", "=", "None", ",", "compute_shapes", "=", "True", ",", "compute_device", ...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/ops.py#L2241-L2360
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/base.py
python
load_iris
(data_path=None)
return load_csv_with_header( data_path, target_dtype=np.int, features_dtype=np.float)
Load Iris dataset. Args: data_path: string, path to iris dataset (optional) Returns: Dataset object containing data in-memory.
Load Iris dataset.
[ "Load", "Iris", "dataset", "." ]
def load_iris(data_path=None): """Load Iris dataset. Args: data_path: string, path to iris dataset (optional) Returns: Dataset object containing data in-memory. """ if data_path is None: module_path = path.dirname(__file__) data_path = path.join(module_path, 'data', 'iris.csv') return lo...
[ "def", "load_iris", "(", "data_path", "=", "None", ")", ":", "if", "data_path", "is", "None", ":", "module_path", "=", "path", ".", "dirname", "(", "__file__", ")", "data_path", "=", "path", ".", "join", "(", "module_path", ",", "'data'", ",", "'iris.csv...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/learn/python/learn/datasets/base.py#L104-L119
idaholab/moose
9eeebc65e098b4c30f8205fb41591fd5b61eb6ff
python/peacock/PostprocessorViewer/plugins/LineSettingsWidget.py
python
LineSettingsWidget._callbackMarkerStyle
(self, index)
Callback for marker style selection.
Callback for marker style selection.
[ "Callback", "for", "marker", "style", "selection", "." ]
def _callbackMarkerStyle(self, index): """ Callback for marker style selection. """ style = self.MarkerStyle.currentText() # Update the size to the default if 'markersize' not in self._settings: size = self._artist.get_markersize() self.MarkerSize...
[ "def", "_callbackMarkerStyle", "(", "self", ",", "index", ")", ":", "style", "=", "self", ".", "MarkerStyle", ".", "currentText", "(", ")", "# Update the size to the default", "if", "'markersize'", "not", "in", "self", ".", "_settings", ":", "size", "=", "self...
https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/peacock/PostprocessorViewer/plugins/LineSettingsWidget.py#L266-L278
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/combo.py
python
ComboCtrl.SetValueWithEvent
(*args, **kwargs)
return _combo.ComboCtrl_SetValueWithEvent(*args, **kwargs)
SetValueWithEvent(self, String value, bool withEvent=True) Same as `SetValue`, but also sends a EVT_TEXT event if withEvent is true.
SetValueWithEvent(self, String value, bool withEvent=True)
[ "SetValueWithEvent", "(", "self", "String", "value", "bool", "withEvent", "=", "True", ")" ]
def SetValueWithEvent(*args, **kwargs): """ SetValueWithEvent(self, String value, bool withEvent=True) Same as `SetValue`, but also sends a EVT_TEXT event if withEvent is true. """ return _combo.ComboCtrl_SetValueWithEvent(*args, **kwargs)
[ "def", "SetValueWithEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_combo", ".", "ComboCtrl_SetValueWithEvent", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L261-L267
ros-controls/ros_control
53c2487d1b56a40f1d00b06c49512aa7fd2bf465
rqt_controller_manager/src/rqt_controller_manager/controller_manager.py
python
ControllerManager._list_controllers
(self)
return controllers
@return List of controllers associated to a controller manager namespace. Contains both stopped/running controllers, as returned by the C{list_controllers} service, plus uninitialized controllers with configurations loaded in the parameter server. @rtype [str]
[]
def _list_controllers(self): """ @return List of controllers associated to a controller manager namespace. Contains both stopped/running controllers, as returned by the C{list_controllers} service, plus uninitialized controllers with configurations loaded in the parameter server....
[ "def", "_list_controllers", "(", "self", ")", ":", "if", "not", "self", ".", "_cm_ns", ":", "return", "[", "]", "# Add loaded controllers first", "controllers", "=", "self", ".", "_controller_lister", "(", ")", "# Append potential controller configs found in the paramet...
https://github.com/ros-controls/ros_control/blob/53c2487d1b56a40f1d00b06c49512aa7fd2bf465/rqt_controller_manager/src/rqt_controller_manager/controller_manager.py#L212-L236
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/ast.py
python
NodeVisitor.generic_visit
(self, node)
Called if no explicit visitor function exists for a node.
Called if no explicit visitor function exists for a node.
[ "Called", "if", "no", "explicit", "visitor", "function", "exists", "for", "a", "node", "." ]
def generic_visit(self, node): """Called if no explicit visitor function exists for a node.""" for field, value in iter_fields(node): if isinstance(value, list): for item in value: if isinstance(item, AST): self.visit(item) ...
[ "def", "generic_visit", "(", "self", ",", "node", ")", ":", "for", "field", ",", "value", "in", "iter_fields", "(", "node", ")", ":", "if", "isinstance", "(", "value", ",", "list", ")", ":", "for", "item", "in", "value", ":", "if", "isinstance", "(",...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/ast.py#L243-L251
Caffe-MPI/Caffe-MPI.github.io
df5992af571a2a19981b69635115c393f18d1c76
scripts/cpp_lint.py
python
FindStartOfExpressionInLine
(line, endpos, depth, startchar, endchar)
return (-1, depth)
Find position at the matching startchar. 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. depth: nesting level at endpos. startchar: expression...
Find position at the matching startchar.
[ "Find", "position", "at", "the", "matching", "startchar", "." ]
def FindStartOfExpressionInLine(line, endpos, depth, startchar, endchar): """Find position at the matching startchar. 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 ...
[ "def", "FindStartOfExpressionInLine", "(", "line", ",", "endpos", ",", "depth", ",", "startchar", ",", "endchar", ")", ":", "for", "i", "in", "xrange", "(", "endpos", ",", "-", "1", ",", "-", "1", ")", ":", "if", "line", "[", "i", "]", "==", "endch...
https://github.com/Caffe-MPI/Caffe-MPI.github.io/blob/df5992af571a2a19981b69635115c393f18d1c76/scripts/cpp_lint.py#L1300-L1324
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/io/stata.py
python
_convert_datetime_to_stata_type
(fmt)
Converts from one of the stata date formats to a type in TYPE_MAP
Converts from one of the stata date formats to a type in TYPE_MAP
[ "Converts", "from", "one", "of", "the", "stata", "date", "formats", "to", "a", "type", "in", "TYPE_MAP" ]
def _convert_datetime_to_stata_type(fmt): """ Converts from one of the stata date formats to a type in TYPE_MAP """ if fmt in ["tc", "%tc", "td", "%td", "tw", "%tw", "tm", "%tm", "tq", "%tq", "th", "%th", "ty", "%ty"]: return np.float64 # Stata expects doubles for SIFs else: ...
[ "def", "_convert_datetime_to_stata_type", "(", "fmt", ")", ":", "if", "fmt", "in", "[", "\"tc\"", ",", "\"%tc\"", ",", "\"td\"", ",", "\"%td\"", ",", "\"tw\"", ",", "\"%tw\"", ",", "\"tm\"", ",", "\"%tm\"", ",", "\"tq\"", ",", "\"%tq\"", ",", "\"th\"", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/io/stata.py#L1786-L1795
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/SANS/isis_reduction_steps.py
python
_issueInfo
(msg)
Prints a message to the log @param msg: message to be issued
Prints a message to the log
[ "Prints", "a", "message", "to", "the", "log" ]
def _issueInfo(msg): """ Prints a message to the log @param msg: message to be issued """ print(msg) sanslog.notice(msg)
[ "def", "_issueInfo", "(", "msg", ")", ":", "print", "(", "msg", ")", "sanslog", ".", "notice", "(", "msg", ")" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/isis_reduction_steps.py#L57-L63
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/stats/mstats_basic.py
python
tmax
(a, upperlimit=None, axis=0, inclusive=True)
return ma.maximum.reduce(am, axis)
Compute the trimmed maximum This function computes the maximum value of an array along a given axis, while ignoring values larger than a specified upper limit. Parameters ---------- a : array_like array of values upperlimit : None or float, optional Values in the input array gr...
Compute the trimmed maximum
[ "Compute", "the", "trimmed", "maximum" ]
def tmax(a, upperlimit=None, axis=0, inclusive=True): """ Compute the trimmed maximum This function computes the maximum value of an array along a given axis, while ignoring values larger than a specified upper limit. Parameters ---------- a : array_like array of values upperli...
[ "def", "tmax", "(", "a", ",", "upperlimit", "=", "None", ",", "axis", "=", "0", ",", "inclusive", "=", "True", ")", ":", "a", ",", "axis", "=", "_chk_asarray", "(", "a", ",", "axis", ")", "am", "=", "trima", "(", "a", ",", "(", "None", ",", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/mstats_basic.py#L1867-L1915
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/webkit.py
python
WebKitStateChangedEvent.GetURL
(*args, **kwargs)
return _webkit.WebKitStateChangedEvent_GetURL(*args, **kwargs)
GetURL(self) -> String
GetURL(self) -> String
[ "GetURL", "(", "self", ")", "-", ">", "String" ]
def GetURL(*args, **kwargs): """GetURL(self) -> String""" return _webkit.WebKitStateChangedEvent_GetURL(*args, **kwargs)
[ "def", "GetURL", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_webkit", ".", "WebKitStateChangedEvent_GetURL", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/webkit.py#L246-L248
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py
python
_ReqExtras.markers_pass
(self, req, extras=None)
return not req.marker or any(extra_evals)
Evaluate markers for req against each extra that demanded it. Return False if the req has a marker and fails evaluation. Otherwise, return True.
Evaluate markers for req against each extra that demanded it.
[ "Evaluate", "markers", "for", "req", "against", "each", "extra", "that", "demanded", "it", "." ]
def markers_pass(self, req, extras=None): """ Evaluate markers for req against each extra that demanded it. Return False if the req has a marker and fails evaluation. Otherwise, return True. """ extra_evals = ( req.marker.evaluate({'extra': extra}) ...
[ "def", "markers_pass", "(", "self", ",", "req", ",", "extras", "=", "None", ")", ":", "extra_evals", "=", "(", "req", ".", "marker", ".", "evaluate", "(", "{", "'extra'", ":", "extra", "}", ")", "for", "extra", "in", "self", ".", "get", "(", "req",...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pkg_resources/__init__.py#L944-L956
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py
python
Text.scan_dragto
(self, x, y)
Adjust the view of the text to 10 times the difference between X and Y and the coordinates given in scan_mark.
Adjust the view of the text to 10 times the difference between X and Y and the coordinates given in scan_mark.
[ "Adjust", "the", "view", "of", "the", "text", "to", "10", "times", "the", "difference", "between", "X", "and", "Y", "and", "the", "coordinates", "given", "in", "scan_mark", "." ]
def scan_dragto(self, x, y): """Adjust the view of the text to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y)
[ "def", "scan_dragto", "(", "self", ",", "x", ",", "y", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'scan'", ",", "'dragto'", ",", "x", ",", "y", ")" ]
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L3073-L3077
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/aui.py
python
AuiToolBarItem.GetUserData
(*args, **kwargs)
return _aui.AuiToolBarItem_GetUserData(*args, **kwargs)
GetUserData(self) -> long
GetUserData(self) -> long
[ "GetUserData", "(", "self", ")", "-", ">", "long" ]
def GetUserData(*args, **kwargs): """GetUserData(self) -> long""" return _aui.AuiToolBarItem_GetUserData(*args, **kwargs)
[ "def", "GetUserData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiToolBarItem_GetUserData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/aui.py#L1869-L1871
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_labels.py
python
Label.setmode
(self, i)
Set the type of label, if it is associated to an object.
Set the type of label, if it is associated to an object.
[ "Set", "the", "type", "of", "label", "if", "it", "is", "associated", "to", "an", "object", "." ]
def setmode(self, i): """Set the type of label, if it is associated to an object.""" from draftobjects.label import get_label_types self.labeltype = get_label_types()[i] utils.setParam("labeltype", self.labeltype)
[ "def", "setmode", "(", "self", ",", "i", ")", ":", "from", "draftobjects", ".", "label", "import", "get_label_types", "self", ".", "labeltype", "=", "get_label_types", "(", ")", "[", "i", "]", "utils", ".", "setParam", "(", "\"labeltype\"", ",", "self", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_labels.py#L83-L87
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/interpolate/interpolate.py
python
_PPolyBase.extend
(self, c, x, right=True)
Add additional breakpoints and coefficients to the polynomial. Parameters ---------- c : ndarray, size (k, m, ...) Additional coefficients for polynomials in intervals ``self.x[-1] <= x < x_right[0]``, ``x_right[0] <= x < x_right[1]``, ..., ``x_right[m-2] <= ...
Add additional breakpoints and coefficients to the polynomial.
[ "Add", "additional", "breakpoints", "and", "coefficients", "to", "the", "polynomial", "." ]
def extend(self, c, x, right=True): """ Add additional breakpoints and coefficients to the polynomial. Parameters ---------- c : ndarray, size (k, m, ...) Additional coefficients for polynomials in intervals ``self.x[-1] <= x < x_right[0]``, ``x_right[0] ...
[ "def", "extend", "(", "self", ",", "c", ",", "x", ",", "right", "=", "True", ")", ":", "c", "=", "np", ".", "asarray", "(", "c", ")", "x", "=", "np", ".", "asarray", "(", "x", ")", "if", "c", ".", "ndim", "<", "2", ":", "raise", "ValueError...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/interpolate/interpolate.py#L714-L767
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/xml/sax/xmlreader.py
python
Locator.getLineNumber
(self)
return -1
Return the line number where the current event ends.
Return the line number where the current event ends.
[ "Return", "the", "line", "number", "where", "the", "current", "event", "ends", "." ]
def getLineNumber(self): "Return the line number where the current event ends." return -1
[ "def", "getLineNumber", "(", "self", ")", ":", "return", "-", "1" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/xml/sax/xmlreader.py#L175-L177
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/groupby/groupby.py
python
GroupBy.nth
(self, n, dropna=None)
return result
Take the nth row from each group if n is an int, or a subset of rows if n is a list of ints. If dropna, will take the nth non-null row, dropna is either Truthy (if a Series) or 'all', 'any' (if a DataFrame); this is equivalent to calling dropna(how=dropna) before the groupby. ...
Take the nth row from each group if n is an int, or a subset of rows if n is a list of ints.
[ "Take", "the", "nth", "row", "from", "each", "group", "if", "n", "is", "an", "int", "or", "a", "subset", "of", "rows", "if", "n", "is", "a", "list", "of", "ints", "." ]
def nth(self, n, dropna=None): """ Take the nth row from each group if n is an int, or a subset of rows if n is a list of ints. If dropna, will take the nth non-null row, dropna is either Truthy (if a Series) or 'all', 'any' (if a DataFrame); this is equivalent to callin...
[ "def", "nth", "(", "self", ",", "n", ",", "dropna", "=", "None", ")", ":", "if", "isinstance", "(", "n", ",", "int", ")", ":", "nth_values", "=", "[", "n", "]", "elif", "isinstance", "(", "n", ",", "(", "set", ",", "list", ",", "tuple", ")", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/groupby/groupby.py#L1531-L1689
pytorch/pytorch
7176c92687d3cc847cc046bf002269c6949a21c2
torch/distributed/optim/zero_redundancy_optimizer.py
python
ZeroRedundancyOptimizer._local_step
( self, gradients: Optional[List[Optional[torch.Tensor]]] = None, closure: Optional[Callable[[], float]] = None, **kwargs: Any, )
return loss
r""" Performs a single optimizer step without syncing parameters across ranks. Arguments: gradients (list[Optional[torch.Tensor]], optional): a :class:`list` of length equal to the number of parameters assigned to this rank containing gradient tensors...
r""" Performs a single optimizer step without syncing parameters across ranks.
[ "r", "Performs", "a", "single", "optimizer", "step", "without", "syncing", "parameters", "across", "ranks", "." ]
def _local_step( self, gradients: Optional[List[Optional[torch.Tensor]]] = None, closure: Optional[Callable[[], float]] = None, **kwargs: Any, ) -> Optional[float]: r""" Performs a single optimizer step without syncing parameters across ranks. Argumen...
[ "def", "_local_step", "(", "self", ",", "gradients", ":", "Optional", "[", "List", "[", "Optional", "[", "torch", ".", "Tensor", "]", "]", "]", "=", "None", ",", "closure", ":", "Optional", "[", "Callable", "[", "[", "]", ",", "float", "]", "]", "=...
https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/distributed/optim/zero_redundancy_optimizer.py#L955-L1022
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/richtext.py
python
TextBoxAttr.GetTopPadding
(*args)
return _richtext.TextBoxAttr_GetTopPadding(*args)
GetTopPadding(self) -> TextAttrDimension GetTopPadding(self) -> TextAttrDimension
GetTopPadding(self) -> TextAttrDimension GetTopPadding(self) -> TextAttrDimension
[ "GetTopPadding", "(", "self", ")", "-", ">", "TextAttrDimension", "GetTopPadding", "(", "self", ")", "-", ">", "TextAttrDimension" ]
def GetTopPadding(*args): """ GetTopPadding(self) -> TextAttrDimension GetTopPadding(self) -> TextAttrDimension """ return _richtext.TextBoxAttr_GetTopPadding(*args)
[ "def", "GetTopPadding", "(", "*", "args", ")", ":", "return", "_richtext", ".", "TextBoxAttr_GetTopPadding", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/richtext.py#L719-L724
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/core/discover.py
python
DiscoverClasses
(start_dir, top_level_dir, base_class, pattern='*', index_by_class_name=True, directly_constructable=False)
return classes
Discover all classes in |start_dir| which subclass |base_class|. Base classes that contain subclasses are ignored by default. Args: start_dir: The directory to recursively search. top_level_dir: The top level of the package, for importing. base_class: The base class to search for. pattern: Unix sh...
Discover all classes in |start_dir| which subclass |base_class|.
[ "Discover", "all", "classes", "in", "|start_dir|", "which", "subclass", "|base_class|", "." ]
def DiscoverClasses(start_dir, top_level_dir, base_class, pattern='*', index_by_class_name=True, directly_constructable=False): """Discover all classes in |start_dir| which subclass |base_class|. Base classes that c...
[ "def", "DiscoverClasses", "(", "start_dir", ",", "top_level_dir", ",", "base_class", ",", "pattern", "=", "'*'", ",", "index_by_class_name", "=", "True", ",", "directly_constructable", "=", "False", ")", ":", "modules", "=", "DiscoverModules", "(", "start_dir", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/core/discover.py#L76-L111
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/training/input.py
python
batch
(tensors, batch_size, num_threads=1, capacity=32, enqueue_many=False, shapes=None, dynamic_pad=False, allow_smaller_final_batch=False, shared_name=None, name=None)
Creates batches of tensors in `tensors`. The argument `tensors` can be a list or a dictionary of tensors. The value returned by the function will be of the same type as `tensors`. This function is implemented using a queue. A `QueueRunner` for the queue is added to the current `Graph`'s `QUEUE_RUNNER` colle...
Creates batches of tensors in `tensors`.
[ "Creates", "batches", "of", "tensors", "in", "tensors", "." ]
def batch(tensors, batch_size, num_threads=1, capacity=32, enqueue_many=False, shapes=None, dynamic_pad=False, allow_smaller_final_batch=False, shared_name=None, name=None): """Creates batches of tensors in `tensors`. The argument `tensors` can be a list or a dictionary of tensors. The value ...
[ "def", "batch", "(", "tensors", ",", "batch_size", ",", "num_threads", "=", "1", ",", "capacity", "=", "32", ",", "enqueue_many", "=", "False", ",", "shapes", "=", "None", ",", "dynamic_pad", "=", "False", ",", "allow_smaller_final_batch", "=", "False", ",...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/input.py#L504-L597
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/filelist.py
python
translate_pattern
(pattern, anchor=1, prefix=None, is_regex=0)
return re.compile(pattern_re)
Translate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object).
Translate a shell-like wildcard pattern to a compiled regular expression.
[ "Translate", "a", "shell", "-", "like", "wildcard", "pattern", "to", "a", "compiled", "regular", "expression", "." ]
def translate_pattern(pattern, anchor=1, prefix=None, is_regex=0): """Translate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a re...
[ "def", "translate_pattern", "(", "pattern", ",", "anchor", "=", "1", ",", "prefix", "=", "None", ",", "is_regex", "=", "0", ")", ":", "if", "is_regex", ":", "if", "isinstance", "(", "pattern", ",", "str", ")", ":", "return", "re", ".", "compile", "("...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/distutils/filelist.py#L312-L343
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/multiprocessing/process.py
python
BaseProcess.daemon
(self, daemonic)
Set whether process is a daemon
Set whether process is a daemon
[ "Set", "whether", "process", "is", "a", "daemon" ]
def daemon(self, daemonic): ''' Set whether process is a daemon ''' assert self._popen is None, 'process has already started' self._config['daemon'] = daemonic
[ "def", "daemon", "(", "self", ",", "daemonic", ")", ":", "assert", "self", ".", "_popen", "is", "None", ",", "'process has already started'", "self", ".", "_config", "[", "'daemon'", "]", "=", "daemonic" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/multiprocessing/process.py#L206-L211
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/tpu/python/tpu/tpu_estimator.py
python
_EvalMetrics.to_metric_metric_ops_for_cpu
(eval_metrics)
Converts `TPUEstimatorSpec.eval_metrics` to `eval_metric_ops` for CPU.
Converts `TPUEstimatorSpec.eval_metrics` to `eval_metric_ops` for CPU.
[ "Converts", "TPUEstimatorSpec", ".", "eval_metrics", "to", "eval_metric_ops", "for", "CPU", "." ]
def to_metric_metric_ops_for_cpu(eval_metrics): """Converts `TPUEstimatorSpec.eval_metrics` to `eval_metric_ops` for CPU.""" if not eval_metrics: return None _EvalMetrics.validate(eval_metrics) metric_fn, tensors = eval_metrics if isinstance(tensors, (tuple, list)): return metric_fn(*...
[ "def", "to_metric_metric_ops_for_cpu", "(", "eval_metrics", ")", ":", "if", "not", "eval_metrics", ":", "return", "None", "_EvalMetrics", ".", "validate", "(", "eval_metrics", ")", "metric_fn", ",", "tensors", "=", "eval_metrics", "if", "isinstance", "(", "tensors...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/tpu/python/tpu/tpu_estimator.py#L1117-L1137
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/maya/script/cryAlembic.py
python
getMeshAndSGs
(nodes=[])
return selMesh, selSGs
filters visible mesh shapes from given or selected nodes and returns them with thier shading groups
filters visible mesh shapes from given or selected nodes and returns them with thier shading groups
[ "filters", "visible", "mesh", "shapes", "from", "given", "or", "selected", "nodes", "and", "returns", "them", "with", "thier", "shading", "groups" ]
def getMeshAndSGs(nodes=[]): """ filters visible mesh shapes from given or selected nodes and returns them with thier shading groups """ if not nodes: nodes = cmds.ls(sl=True) if not nodes: return None, None selMesh = set(cmds.ls(cmds.listRelatives(nodes, allDescendents=True)...
[ "def", "getMeshAndSGs", "(", "nodes", "=", "[", "]", ")", ":", "if", "not", "nodes", ":", "nodes", "=", "cmds", ".", "ls", "(", "sl", "=", "True", ")", "if", "not", "nodes", ":", "return", "None", ",", "None", "selMesh", "=", "set", "(", "cmds", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/maya/script/cryAlembic.py#L182-L196
chuckcho/video-caffe
fc232b3e3a90ea22dd041b9fc5c542f170581f20
tools/extra/parse_log.py
python
parse_log
(path_to_log)
return train_dict_list, test_dict_list
Parse log file Returns (train_dict_list, test_dict_list) train_dict_list and test_dict_list are lists of dicts that define the table rows
Parse log file Returns (train_dict_list, test_dict_list)
[ "Parse", "log", "file", "Returns", "(", "train_dict_list", "test_dict_list", ")" ]
def parse_log(path_to_log): """Parse log file Returns (train_dict_list, test_dict_list) train_dict_list and test_dict_list are lists of dicts that define the table rows """ regex_iteration = re.compile('Iteration (\d+)') regex_train_output = re.compile('Train net output #(\d+): (\S+) = ([\...
[ "def", "parse_log", "(", "path_to_log", ")", ":", "regex_iteration", "=", "re", ".", "compile", "(", "'Iteration (\\d+)'", ")", "regex_train_output", "=", "re", ".", "compile", "(", "'Train net output #(\\d+): (\\S+) = ([\\.\\deE+-]+)'", ")", "regex_test_output", "=", ...
https://github.com/chuckcho/video-caffe/blob/fc232b3e3a90ea22dd041b9fc5c542f170581f20/tools/extra/parse_log.py#L17-L83
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py2/sklearn/preprocessing/data.py
python
MinMaxScaler.inverse_transform
(self, X)
return X
Undo the scaling of X according to feature_range. Parameters ---------- X : array-like, shape [n_samples, n_features] Input data that will be transformed. It cannot be sparse.
Undo the scaling of X according to feature_range.
[ "Undo", "the", "scaling", "of", "X", "according", "to", "feature_range", "." ]
def inverse_transform(self, X): """Undo the scaling of X according to feature_range. Parameters ---------- X : array-like, shape [n_samples, n_features] Input data that will be transformed. It cannot be sparse. """ check_is_fitted(self, 'scale_') X =...
[ "def", "inverse_transform", "(", "self", ",", "X", ")", ":", "check_is_fitted", "(", "self", ",", "'scale_'", ")", "X", "=", "check_array", "(", "X", ",", "copy", "=", "self", ".", "copy", ",", "ensure_2d", "=", "False", ",", "dtype", "=", "FLOAT_DTYPE...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py2/sklearn/preprocessing/data.py#L362-L378
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/lib/twodim_base.py
python
tri
(N, M=None, k=0, dtype=float)
return m.astype(dtype)
An array with ones at and below the given diagonal and zeros elsewhere. Parameters ---------- N : int Number of rows in the array. M : int, optional Number of columns in the array. By default, `M` is taken equal to `N`. k : int, optional The sub-diagonal at and below...
An array with ones at and below the given diagonal and zeros elsewhere.
[ "An", "array", "with", "ones", "at", "and", "below", "the", "given", "diagonal", "and", "zeros", "elsewhere", "." ]
def tri(N, M=None, k=0, dtype=float): """ An array with ones at and below the given diagonal and zeros elsewhere. Parameters ---------- N : int Number of rows in the array. M : int, optional Number of columns in the array. By default, `M` is taken equal to `N`. k : i...
[ "def", "tri", "(", "N", ",", "M", "=", "None", ",", "k", "=", "0", ",", "dtype", "=", "float", ")", ":", "if", "M", "is", "None", ":", "M", "=", "N", "m", "=", "greater_equal", "(", "subtract", ".", "outer", "(", "arange", "(", "N", ")", ",...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/lib/twodim_base.py#L352-L392
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
ListEvent.GetData
(*args, **kwargs)
return _controls_.ListEvent_GetData(*args, **kwargs)
GetData(self) -> long
GetData(self) -> long
[ "GetData", "(", "self", ")", "-", ">", "long" ]
def GetData(*args, **kwargs): """GetData(self) -> long""" return _controls_.ListEvent_GetData(*args, **kwargs)
[ "def", "GetData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "ListEvent_GetData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L4346-L4348
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/learn/python/learn/estimators/estimator.py
python
infer_real_valued_columns_from_input_fn
(input_fn)
Creates `FeatureColumn` objects for inputs defined by `input_fn`. This interprets all inputs as dense, fixed-length float values. This creates a local graph in which it calls `input_fn` to build the tensors, then discards it. Args: input_fn: Input function returning a tuple of: features - Dictiona...
Creates `FeatureColumn` objects for inputs defined by `input_fn`.
[ "Creates", "FeatureColumn", "objects", "for", "inputs", "defined", "by", "input_fn", "." ]
def infer_real_valued_columns_from_input_fn(input_fn): """Creates `FeatureColumn` objects for inputs defined by `input_fn`. This interprets all inputs as dense, fixed-length float values. This creates a local graph in which it calls `input_fn` to build the tensors, then discards it. Args: input_fn: Inpu...
[ "def", "infer_real_valued_columns_from_input_fn", "(", "input_fn", ")", ":", "with", "ops", ".", "Graph", "(", ")", ".", "as_default", "(", ")", ":", "features", ",", "_", "=", "input_fn", "(", ")", "return", "layers", ".", "infer_real_valued_columns", "(", ...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/learn/python/learn/estimators/estimator.py#L143-L160
SpenceKonde/megaTinyCore
1c4a70b18a149fe6bcb551dfa6db11ca50b8997b
megaavr/tools/libs/serial/serialutil.py
python
SerialBase.iread_until
(self, *args, **kwargs)
\ Read lines, implemented as generator. It will raise StopIteration on timeout (empty read).
\ Read lines, implemented as generator. It will raise StopIteration on timeout (empty read).
[ "\\", "Read", "lines", "implemented", "as", "generator", ".", "It", "will", "raise", "StopIteration", "on", "timeout", "(", "empty", "read", ")", "." ]
def iread_until(self, *args, **kwargs): """\ Read lines, implemented as generator. It will raise StopIteration on timeout (empty read). """ while True: line = self.read_until(*args, **kwargs) if not line: break yield line
[ "def", "iread_until", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "while", "True", ":", "line", "=", "self", ".", "read_until", "(", "*", "args", ",", "*", "*", "kwargs", ")", "if", "not", "line", ":", "break", "yield", "lin...
https://github.com/SpenceKonde/megaTinyCore/blob/1c4a70b18a149fe6bcb551dfa6db11ca50b8997b/megaavr/tools/libs/serial/serialutil.py#L672-L681
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/tarfile.py
python
TarInfo._block
(self, count)
return blocks * BLOCKSIZE
Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024.
Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024.
[ "Round", "up", "a", "byte", "count", "by", "BLOCKSIZE", "and", "return", "it", "e", ".", "g", ".", "_block", "(", "834", ")", "=", ">", "1024", "." ]
def _block(self, count): """Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024. """ blocks, remainder = divmod(count, BLOCKSIZE) if remainder: blocks += 1 return blocks * BLOCKSIZE
[ "def", "_block", "(", "self", ",", "count", ")", ":", "blocks", ",", "remainder", "=", "divmod", "(", "count", ",", "BLOCKSIZE", ")", "if", "remainder", ":", "blocks", "+=", "1", "return", "blocks", "*", "BLOCKSIZE" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tarfile.py#L1358-L1365
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/selector_events.py
python
BaseSelectorEventLoop.sock_connect
(self, sock, address)
return await fut
Connect to a remote socket at address. This method is a coroutine.
Connect to a remote socket at address.
[ "Connect", "to", "a", "remote", "socket", "at", "address", "." ]
async def sock_connect(self, sock, address): """Connect to a remote socket at address. This method is a coroutine. """ _check_ssl_socket(sock) if self._debug and sock.gettimeout() != 0: raise ValueError("the socket must be non-blocking") if not hasattr(socke...
[ "async", "def", "sock_connect", "(", "self", ",", "sock", ",", "address", ")", ":", "_check_ssl_socket", "(", "sock", ")", "if", "self", ".", "_debug", "and", "sock", ".", "gettimeout", "(", ")", "!=", "0", ":", "raise", "ValueError", "(", "\"the socket ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/asyncio/selector_events.py#L457-L473
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/stats/kde.py
python
gaussian_kde.integrate_box_1d
(self, low, high)
return value
Computes the integral of a 1D pdf between two bounds. Parameters ---------- low : scalar Lower bound of integration. high : scalar Upper bound of integration. Returns ------- value : scalar The result of the integral. ...
Computes the integral of a 1D pdf between two bounds.
[ "Computes", "the", "integral", "of", "a", "1D", "pdf", "between", "two", "bounds", "." ]
def integrate_box_1d(self, low, high): """ Computes the integral of a 1D pdf between two bounds. Parameters ---------- low : scalar Lower bound of integration. high : scalar Upper bound of integration. Returns ------- valu...
[ "def", "integrate_box_1d", "(", "self", ",", "low", ",", "high", ")", ":", "if", "self", ".", "d", "!=", "1", ":", "raise", "ValueError", "(", "\"integrate_box_1d() only handles 1D pdfs\"", ")", "stdev", "=", "ravel", "(", "sqrt", "(", "self", ".", "covari...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/stats/kde.py#L318-L351
alibaba/MNN
c4d9566171d589c3ded23aa18ffb197016995a12
pymnn/pip_package/MNN/expr/__init__.py
python
sigmoid
(x)
return _F.sigmoid(x)
sigmoid(x) Return the ``1/(1+exp(-1))``, element-wise. Parameters ---------- x : var_like, input value. Returns ------- y : Var. The sigmoid of `x`. Example: ------- >>> expr.sigmoid([9., 0.5]) var([0.9998766, 0.62246716])
sigmoid(x) Return the ``1/(1+exp(-1))``, element-wise.
[ "sigmoid", "(", "x", ")", "Return", "the", "1", "/", "(", "1", "+", "exp", "(", "-", "1", "))", "element", "-", "wise", "." ]
def sigmoid(x): ''' sigmoid(x) Return the ``1/(1+exp(-1))``, element-wise. Parameters ---------- x : var_like, input value. Returns ------- y : Var. The sigmoid of `x`. Example: ------- >>> expr.sigmoid([9., 0.5]) var([0.9998766, 0.62246716]) ''' x = _to_va...
[ "def", "sigmoid", "(", "x", ")", ":", "x", "=", "_to_var", "(", "x", ")", "return", "_F", ".", "sigmoid", "(", "x", ")" ]
https://github.com/alibaba/MNN/blob/c4d9566171d589c3ded23aa18ffb197016995a12/pymnn/pip_package/MNN/expr/__init__.py#L657-L676
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/training/training_ops.py
python
_ApplyAdamShape
(op)
return [grad_shape]
Shape function for the ApplyAdam op.
Shape function for the ApplyAdam op.
[ "Shape", "function", "for", "the", "ApplyAdam", "op", "." ]
def _ApplyAdamShape(op): """Shape function for the ApplyAdam op.""" var_shape = op.inputs[0].get_shape() m_shape = op.inputs[1].get_shape().merge_with(var_shape) v_shape = op.inputs[2].get_shape().merge_with(m_shape) _AssertInputIsScalar(op, 3) # beta1_power _AssertInputIsScalar(op, 4) # beta2_power _As...
[ "def", "_ApplyAdamShape", "(", "op", ")", ":", "var_shape", "=", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", "m_shape", "=", "op", ".", "inputs", "[", "1", "]", ".", "get_shape", "(", ")", ".", "merge_with", "(", "var_shape", ")...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/training_ops.py#L99-L111
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/tool/transl2tc.py
python
TranslationToTc.ExtractTranslations
(self, current_grd, source_rc, source_path, transl_rc, transl_path)
return id2transl
Extracts translations from the translated RC file, matching them with translations in the source RC file to calculate their ID, and correcting placeholders, limiting output to translateables, etc. using the supplied .grd file which is the current .grd file for your project. If this object's 'limits' at...
Extracts translations from the translated RC file, matching them with translations in the source RC file to calculate their ID, and correcting placeholders, limiting output to translateables, etc. using the supplied .grd file which is the current .grd file for your project.
[ "Extracts", "translations", "from", "the", "translated", "RC", "file", "matching", "them", "with", "translations", "in", "the", "source", "RC", "file", "to", "calculate", "their", "ID", "and", "correcting", "placeholders", "limiting", "output", "to", "translateabl...
def ExtractTranslations(self, current_grd, source_rc, source_path, transl_rc, transl_path): '''Extracts translations from the translated RC file, matching them with translations in the source RC file to calculate their ID, and correcting placeholders, limiting ou...
[ "def", "ExtractTranslations", "(", "self", ",", "current_grd", ",", "source_rc", ",", "source_path", ",", "transl_rc", ",", "transl_path", ")", ":", "source_grd", "=", "self", ".", "rc2grd", ".", "Process", "(", "source_rc", ",", "source_path", ")", "self", ...
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/tool/transl2tc.py#L89-L231
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
python
_GetDefines
(config)
return defines
Returns the list of preprocessor definitions for this configuation. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of preprocessor definitions.
Returns the list of preprocessor definitions for this configuation.
[ "Returns", "the", "list", "of", "preprocessor", "definitions", "for", "this", "configuation", "." ]
def _GetDefines(config): """Returns the list of preprocessor definitions for this configuation. Arguments: config: The dictionary that defines the special processing to be done for this configuration. Returns: The list of preprocessor definitions. """ defines = [] for d in config.get('d...
[ "def", "_GetDefines", "(", "config", ")", ":", "defines", "=", "[", "]", "for", "d", "in", "config", ".", "get", "(", "'defines'", ",", "[", "]", ")", ":", "if", "type", "(", "d", ")", "==", "list", ":", "fd", "=", "'='", ".", "join", "(", "[...
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L1308-L1324
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/column/categorical.py
python
CategoricalAccessor.categories
(self)
return cudf.core.index.as_index(self._column.categories)
The categories of this categorical.
The categories of this categorical.
[ "The", "categories", "of", "this", "categorical", "." ]
def categories(self) -> "cudf.core.index.BaseIndex": """ The categories of this categorical. """ return cudf.core.index.as_index(self._column.categories)
[ "def", "categories", "(", "self", ")", "->", "\"cudf.core.index.BaseIndex\"", ":", "return", "cudf", ".", "core", ".", "index", ".", "as_index", "(", "self", ".", "_column", ".", "categories", ")" ]
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/column/categorical.py#L116-L120
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/pxssh.py
python
pxssh.login
( self, server, username, password='', terminal_type='ansi', original_prompt=r"[#$]", login_timeout=10, port=None, auto_prompt_reset=True)
return True
This logs the user into the given server. It uses the 'original_prompt' to try to find the prompt right after login. When it finds the prompt it immediately tries to reset the prompt to something more easily matched. The default 'original_prompt' is very optimistic and is easily fooled. ...
This logs the user into the given server. It uses the 'original_prompt' to try to find the prompt right after login. When it finds the prompt it immediately tries to reset the prompt to something more easily matched. The default 'original_prompt' is very optimistic and is easily fooled. ...
[ "This", "logs", "the", "user", "into", "the", "given", "server", ".", "It", "uses", "the", "original_prompt", "to", "try", "to", "find", "the", "prompt", "right", "after", "login", ".", "When", "it", "finds", "the", "prompt", "it", "immediately", "tries", ...
def login( self, server, username, password='', terminal_type='ansi', original_prompt=r"[#$]", login_timeout=10, port=None, auto_prompt_reset=True): """This logs the user into the given server. It uses th...
[ "def", "login", "(", "self", ",", "server", ",", "username", ",", "password", "=", "''", ",", "terminal_type", "=", "'ansi'", ",", "original_prompt", "=", "r\"[#$]\"", ",", "login_timeout", "=", "10", ",", "port", "=", "None", ",", "auto_prompt_reset", "="...
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/third_party/Python/module/pexpect-2.4/pxssh.py#L178-L315
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/futures.py
python
Future.set_exception
(self, exception)
Mark the future done and set an exception. If the future is already done when this method is called, raises InvalidStateError.
Mark the future done and set an exception.
[ "Mark", "the", "future", "done", "and", "set", "an", "exception", "." ]
def set_exception(self, exception): """Mark the future done and set an exception. If the future is already done when this method is called, raises InvalidStateError. """ if self._state != _PENDING: raise InvalidStateError('{}: {!r}'.format(self._state, self)) ...
[ "def", "set_exception", "(", "self", ",", "exception", ")", ":", "if", "self", ".", "_state", "!=", "_PENDING", ":", "raise", "InvalidStateError", "(", "'{}: {!r}'", ".", "format", "(", "self", ".", "_state", ",", "self", ")", ")", "if", "isinstance", "(...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/asyncio/futures.py#L242-L258
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py
python
_MergeShape
(op)
Shape function for the Merge op. The Merge op takes many inputs of arbitrary shapes, and produces a first output that is one of those inputs, and a second scalar output. If all input shapes are known and have the same rank, the output shape must have that rank, otherwise the output shape is unknown. Each ...
Shape function for the Merge op.
[ "Shape", "function", "for", "the", "Merge", "op", "." ]
def _MergeShape(op): """Shape function for the Merge op. The Merge op takes many inputs of arbitrary shapes, and produces a first output that is one of those inputs, and a second scalar output. If all input shapes are known and have the same rank, the output shape must have that rank, otherwise the output...
[ "def", "_MergeShape", "(", "op", ")", ":", "output_shape", "=", "op", ".", "inputs", "[", "0", "]", ".", "get_shape", "(", ")", "if", "output_shape", ".", "dims", "is", "None", ":", "return", "[", "tensor_shape", ".", "unknown_shape", "(", ")", ",", ...
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/python/ops/control_flow_ops.py#L2395-L2427
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/contrib/learn/python/learn/summary_writer_cache.py
python
SummaryWriterCache.get
(logdir)
Returns the SummaryWriter for the specified directory. Args: logdir: str, name of the directory. Returns: A `SummaryWriter`.
Returns the SummaryWriter for the specified directory.
[ "Returns", "the", "SummaryWriter", "for", "the", "specified", "directory", "." ]
def get(logdir): """Returns the SummaryWriter for the specified directory. Args: logdir: str, name of the directory. Returns: A `SummaryWriter`. """ with SummaryWriterCache._lock: if logdir not in SummaryWriterCache._cache: SummaryWriterCache._cache[logdir] = summary_io.S...
[ "def", "get", "(", "logdir", ")", ":", "with", "SummaryWriterCache", ".", "_lock", ":", "if", "logdir", "not", "in", "SummaryWriterCache", ".", "_cache", ":", "SummaryWriterCache", ".", "_cache", "[", "logdir", "]", "=", "summary_io", ".", "SummaryWriter", "...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/contrib/learn/python/learn/summary_writer_cache.py#L47-L60
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/crywaflib/cryengine_modules.py
python
CryEngineModule
(ctx, *k, **kw)
CryEngine Modules are mostly compiled as dynamic libraries Except the build configuration requieres a monolithic build
CryEngine Modules are mostly compiled as dynamic libraries Except the build configuration requieres a monolithic build
[ "CryEngine", "Modules", "are", "mostly", "compiled", "as", "dynamic", "libraries", "Except", "the", "build", "configuration", "requieres", "a", "monolithic", "build" ]
def CryEngineModule(ctx, *k, **kw): """ CryEngine Modules are mostly compiled as dynamic libraries Except the build configuration requieres a monolithic build """ # Initialize the Task Generator InitializeTaskGenerator(ctx, kw) # Setup TaskGenerator specific settings set_cryengine_flags(ctx, kw) SetupRunTim...
[ "def", "CryEngineModule", "(", "ctx", ",", "*", "k", ",", "*", "*", "kw", ")", ":", "# Initialize the Task Generator", "InitializeTaskGenerator", "(", "ctx", ",", "kw", ")", "# Setup TaskGenerator specific settings\t", "set_cryengine_flags", "(", "ctx", ",", "kw", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/crywaflib/cryengine_modules.py#L846-L885
cmu-sei/pharos
af54b6ada58d50c046fa899452addce80e9ce8da
tools/ooanalyzer/ida/OOAnalyzer.py
python
PyOOAnalyzer.__apply_method
(self, method)
return
Apply methods of this class to the IDB
Apply methods of this class to the IDB
[ "Apply", "methods", "of", "this", "class", "to", "the", "IDB" ]
def __apply_method(self, method): ''' Apply methods of this class to the IDB ''' method_name = method.demangled_name if method.demangled_name is not None else method.method_name cmt = cmt = "%s::%s" % (method.cls.ida_name, method_name) if method.is_virtual == True: ...
[ "def", "__apply_method", "(", "self", ",", "method", ")", ":", "method_name", "=", "method", ".", "demangled_name", "if", "method", ".", "demangled_name", "is", "not", "None", "else", "method", ".", "method_name", "cmt", "=", "cmt", "=", "\"%s::%s\"", "%", ...
https://github.com/cmu-sei/pharos/blob/af54b6ada58d50c046fa899452addce80e9ce8da/tools/ooanalyzer/ida/OOAnalyzer.py#L662-L697
BlzFans/wke
b0fa21158312e40c5fbd84682d643022b6c34a93
cygwin/lib/python2.6/numbers.py
python
Real.imag
(self)
return 0
Real numbers have no imaginary component.
Real numbers have no imaginary component.
[ "Real", "numbers", "have", "no", "imaginary", "component", "." ]
def imag(self): """Real numbers have no imaginary component.""" return 0
[ "def", "imag", "(", "self", ")", ":", "return", "0" ]
https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/numbers.py#L259-L261
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scikit-learn/py3/sklearn/preprocessing/_label.py
python
MultiLabelBinarizer.fit_transform
(self, y)
return yt
Fit the label sets binarizer and transform the given label sets Parameters ---------- y : iterable of iterables A set of labels (any orderable and hashable object) for each sample. If the `classes` parameter is set, `y` will not be iterated. Returns ...
Fit the label sets binarizer and transform the given label sets
[ "Fit", "the", "label", "sets", "binarizer", "and", "transform", "the", "given", "label", "sets" ]
def fit_transform(self, y): """Fit the label sets binarizer and transform the given label sets Parameters ---------- y : iterable of iterables A set of labels (any orderable and hashable object) for each sample. If the `classes` parameter is set, `y` will not be ...
[ "def", "fit_transform", "(", "self", ",", "y", ")", ":", "self", ".", "_cached_dict", "=", "None", "if", "self", ".", "classes", "is", "not", "None", ":", "return", "self", ".", "fit", "(", "y", ")", ".", "transform", "(", "y", ")", "# Automatically ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scikit-learn/py3/sklearn/preprocessing/_label.py#L883-L924
CalcProgrammer1/OpenRGB
8156b0167a7590dd8ba561dfde524bfcacf46b5e
dependencies/mbedtls-2.24.0/scripts/assemble_changelog.py
python
TextChangelogFormat.extract_top_version
(cls, changelog_file_content)
return (changelog_file_content[:top_version_start], top_version_title, top_version_body, changelog_file_content[top_version_end:])
A version section starts with a line starting with '='.
A version section starts with a line starting with '='.
[ "A", "version", "section", "starts", "with", "a", "line", "starting", "with", "=", "." ]
def extract_top_version(cls, changelog_file_content): """A version section starts with a line starting with '='.""" m = re.search(cls._top_version_re, changelog_file_content) top_version_start = m.start(1) top_version_end = m.end(2) top_version_title = m.group(1) top_vers...
[ "def", "extract_top_version", "(", "cls", ",", "changelog_file_content", ")", ":", "m", "=", "re", ".", "search", "(", "cls", ".", "_top_version_re", ",", "changelog_file_content", ")", "top_version_start", "=", "m", ".", "start", "(", "1", ")", "top_version_e...
https://github.com/CalcProgrammer1/OpenRGB/blob/8156b0167a7590dd8ba561dfde524bfcacf46b5e/dependencies/mbedtls-2.24.0/scripts/assemble_changelog.py#L131-L144
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/output/vt100.py
python
Vt100_Output.set_attributes
(self, attrs: Attrs, color_depth: ColorDepth)
Create new style and output. :param attrs: `Attrs` instance.
Create new style and output.
[ "Create", "new", "style", "and", "output", "." ]
def set_attributes(self, attrs: Attrs, color_depth: ColorDepth) -> None: """ Create new style and output. :param attrs: `Attrs` instance. """ # Get current depth. escape_code_cache = self._escape_code_caches[color_depth] # Write escape character. self.wr...
[ "def", "set_attributes", "(", "self", ",", "attrs", ":", "Attrs", ",", "color_depth", ":", "ColorDepth", ")", "->", "None", ":", "# Get current depth.", "escape_code_cache", "=", "self", ".", "_escape_code_caches", "[", "color_depth", "]", "# Write escape character....
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/output/vt100.py#L589-L599
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Tool/packaging/rpm.py
python
SimpleTagCompiler.compile
(self, values)
return str
Compiles the tagset and returns a str containing the result
Compiles the tagset and returns a str containing the result
[ "Compiles", "the", "tagset", "and", "returns", "a", "str", "containing", "the", "result" ]
def compile(self, values): """ Compiles the tagset and returns a str containing the result """ def is_international(tag): return tag.endswith('_') def get_country_code(tag): return tag[-2:] def strip_country_code(tag): return tag[:-2] ...
[ "def", "compile", "(", "self", ",", "values", ")", ":", "def", "is_international", "(", "tag", ")", ":", "return", "tag", ".", "endswith", "(", "'_'", ")", "def", "get_country_code", "(", "tag", ")", ":", "return", "tag", "[", "-", "2", ":", "]", "...
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Tool/packaging/rpm.py#L324-L358
microsoft/checkedc-clang
a173fefde5d7877b7750e7ce96dd08cf18baebf2
mlir/utils/spirv/gen_spirv_dialect.py
python
uniquify_enum_cases
(lst)
return uniqued_cases, duplicated_cases
Prunes duplicate enum cases from the list. Arguments: - lst: List whose elements are to be uniqued. Assumes each element is a (symbol, value) pair and elements already sorted according to value. Returns: - A list with all duplicates removed. The elements are sorted according to value and, for each...
Prunes duplicate enum cases from the list.
[ "Prunes", "duplicate", "enum", "cases", "from", "the", "list", "." ]
def uniquify_enum_cases(lst): """Prunes duplicate enum cases from the list. Arguments: - lst: List whose elements are to be uniqued. Assumes each element is a (symbol, value) pair and elements already sorted according to value. Returns: - A list with all duplicates removed. The elements are sorted ac...
[ "def", "uniquify_enum_cases", "(", "lst", ")", ":", "cases", "=", "lst", "uniqued_cases", "=", "[", "]", "duplicated_cases", "=", "{", "}", "# First sort according to the value", "cases", ".", "sort", "(", "key", "=", "lambda", "x", ":", "x", "[", "1", "]"...
https://github.com/microsoft/checkedc-clang/blob/a173fefde5d7877b7750e7ce96dd08cf18baebf2/mlir/utils/spirv/gen_spirv_dialect.py#L103-L138
taichi-dev/taichi
973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6
python/taichi/lang/ops.py
python
cmp_gt
(a, b)
return _binary_operation(_ti_core.expr_cmp_gt, lambda a, b: -int(a > b), a, b)
Compare two values (greater than) Args: a (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): value LHS b (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): value RHS Returns: Union[:class:`~taichi.lang.expr.Expr`, bool]: True if L...
Compare two values (greater than)
[ "Compare", "two", "values", "(", "greater", "than", ")" ]
def cmp_gt(a, b): """Compare two values (greater than) Args: a (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): value LHS b (Union[:class:`~taichi.lang.expr.Expr`, :class:`~taichi.lang.matrix.Matrix`]): value RHS Returns: Union[:class:`~taichi.lang.exp...
[ "def", "cmp_gt", "(", "a", ",", "b", ")", ":", "return", "_binary_operation", "(", "_ti_core", ".", "expr_cmp_gt", ",", "lambda", "a", ",", "b", ":", "-", "int", "(", "a", ">", "b", ")", ",", "a", ",", "b", ")" ]
https://github.com/taichi-dev/taichi/blob/973c04d6ba40f34e9e3bd5a28ae0ee0802f136a6/python/taichi/lang/ops.py#L617-L629
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/zipfile.py
python
ZipInfo.FileHeader
(self, zip64=None)
return header + filename + extra
Return the per-file header as a string.
Return the per-file header as a string.
[ "Return", "the", "per", "-", "file", "header", "as", "a", "string", "." ]
def FileHeader(self, zip64=None): """Return the per-file header as a string.""" dt = self.date_time dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2] dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2) if self.flag_bits & 0x08: # Set these to zero because we write them...
[ "def", "FileHeader", "(", "self", ",", "zip64", "=", "None", ")", ":", "dt", "=", "self", ".", "date_time", "dosdate", "=", "(", "dt", "[", "0", "]", "-", "1980", ")", "<<", "9", "|", "dt", "[", "1", "]", "<<", "5", "|", "dt", "[", "2", "]"...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/zipfile.py#L352-L389
Harick1/caffe-yolo
eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3
scripts/cpp_lint.py
python
CheckPosixThreading
(filename, clean_lines, linenum, error)
Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. These tests guide the engineers to use thread-safe functions (when us...
Checks for calls to thread-unsafe functions.
[ "Checks", "for", "calls", "to", "thread", "-", "unsafe", "functions", "." ]
def CheckPosixThreading(filename, clean_lines, linenum, error): """Checks for calls to thread-unsafe functions. Much code has been originally written without consideration of multi-threading. Also, engineers are relying on their old experience; they have learned posix before threading extensions were added. Th...
[ "def", "CheckPosixThreading", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "for", "single_thread_function", ",", "multithread_safe_function", "in", "threading_list", ":...
https://github.com/Harick1/caffe-yolo/blob/eea92bf3ddfe4d0ff6b0b3ba9b15c029a83ed9a3/scripts/cpp_lint.py#L1681-L1705
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
python
conv_2d_nhwc_hwcf
( I=TensorDef(T1, S.N, S.OH * S.SH + S.KH * S.DH, S.OW * S.SW + S.KW * S.DW, S.C), K=TensorDef(T2, S.KH, S.KW, S.C, S.F), O=TensorDef(U, S.N, S.OH, S.OW, S.F, output=True), strides=IndexAttrDef(S.SH, S.SW), dilations=IndexAttrDef(S.DH, S.DW))
Performs 2-D convolution. Layout: * Input: NHWC. * Kernel: HWCF. Numeric casting is performed on the operands to the inner multiply, promoting them to the same data type as the accumulator/output.
Performs 2-D convolution.
[ "Performs", "2", "-", "D", "convolution", "." ]
def conv_2d_nhwc_hwcf( I=TensorDef(T1, S.N, S.OH * S.SH + S.KH * S.DH, S.OW * S.SW + S.KW * S.DW, S.C), K=TensorDef(T2, S.KH, S.KW, S.C, S.F), O=TensorDef(U, S.N, S.OH, S.OW, S.F, output=True), strides=IndexAttrDef(S.SH, S.SW), dilations=IndexAttrDef(S.DH, S.DW)): """Performs 2-D c...
[ "def", "conv_2d_nhwc_hwcf", "(", "I", "=", "TensorDef", "(", "T1", ",", "S", ".", "N", ",", "S", ".", "OH", "*", "S", ".", "SH", "+", "S", ".", "KH", "*", "S", ".", "DH", ",", "S", ".", "OW", "*", "S", ".", "SW", "+", "S", ".", "KW", "*...
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py#L242-L262
SoarGroup/Soar
a1c5e249499137a27da60533c72969eef3b8ab6b
scons/scons-local-4.1.0/SCons/Node/__init__.py
python
Node.postprocess
(self)
Clean up anything we don't need to hang onto after we've been built.
Clean up anything we don't need to hang onto after we've been built.
[ "Clean", "up", "anything", "we", "don", "t", "need", "to", "hang", "onto", "after", "we", "ve", "been", "built", "." ]
def postprocess(self): """Clean up anything we don't need to hang onto after we've been built.""" self.executor_cleanup() self.waiting_parents = set()
[ "def", "postprocess", "(", "self", ")", ":", "self", ".", "executor_cleanup", "(", ")", "self", ".", "waiting_parents", "=", "set", "(", ")" ]
https://github.com/SoarGroup/Soar/blob/a1c5e249499137a27da60533c72969eef3b8ab6b/scons/scons-local-4.1.0/SCons/Node/__init__.py#L846-L850
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_core.py
python
Window.HasFlag
(*args, **kwargs)
return _core_.Window_HasFlag(*args, **kwargs)
HasFlag(self, int flag) -> bool Test if the given style is set for this window.
HasFlag(self, int flag) -> bool
[ "HasFlag", "(", "self", "int", "flag", ")", "-", ">", "bool" ]
def HasFlag(*args, **kwargs): """ HasFlag(self, int flag) -> bool Test if the given style is set for this window. """ return _core_.Window_HasFlag(*args, **kwargs)
[ "def", "HasFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_HasFlag", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_core.py#L10037-L10043
jackaudio/jack2
21b293dbc37d42446141a08922cdec0d2550c6a0
waflib/Node.py
python
Node.bldpath
(self)
return self.path_from(self.ctx.bldnode)
Returns the relative path seen from the build directory ``src/foo.cpp`` :rtype: string
Returns the relative path seen from the build directory ``src/foo.cpp``
[ "Returns", "the", "relative", "path", "seen", "from", "the", "build", "directory", "src", "/", "foo", ".", "cpp" ]
def bldpath(self): """ Returns the relative path seen from the build directory ``src/foo.cpp`` :rtype: string """ return self.path_from(self.ctx.bldnode)
[ "def", "bldpath", "(", "self", ")", ":", "return", "self", ".", "path_from", "(", "self", ".", "ctx", ".", "bldnode", ")" ]
https://github.com/jackaudio/jack2/blob/21b293dbc37d42446141a08922cdec0d2550c6a0/waflib/Node.py#L887-L893
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/bijector.py
python
_Bijector._inverse_and_inverse_log_det_jacobian
(self, x)
Subclass implementation of inverse_and_inverse_log_det_jacobian(). Args: x: `Tensor`. The input to the "inverse" evaluation. Returns: List of two `Tensor` items, inverse and inverse_log_det_jacobian.
Subclass implementation of inverse_and_inverse_log_det_jacobian().
[ "Subclass", "implementation", "of", "inverse_and_inverse_log_det_jacobian", "()", "." ]
def _inverse_and_inverse_log_det_jacobian(self, x): """Subclass implementation of inverse_and_inverse_log_det_jacobian(). Args: x: `Tensor`. The input to the "inverse" evaluation. Returns: List of two `Tensor` items, inverse and inverse_log_det_jacobian. """ raise NotImplementedError( ...
[ "def", "_inverse_and_inverse_log_det_jacobian", "(", "self", ",", "x", ")", ":", "raise", "NotImplementedError", "(", "'_inverse_and_inverse_log_det_jacobian not implemented'", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/bijector.py#L271-L281
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/signal/mel_ops.py
python
_hertz_to_mel
(frequencies_hertz, name=None)
Converts frequencies in `frequencies_hertz` in Hertz to the mel scale. Args: frequencies_hertz: A `Tensor` of frequencies in Hertz. name: An optional name for the operation. Returns: A `Tensor` of the same shape and type of `frequencies_hertz` containing frequencies in the mel scale.
Converts frequencies in `frequencies_hertz` in Hertz to the mel scale.
[ "Converts", "frequencies", "in", "frequencies_hertz", "in", "Hertz", "to", "the", "mel", "scale", "." ]
def _hertz_to_mel(frequencies_hertz, name=None): """Converts frequencies in `frequencies_hertz` in Hertz to the mel scale. Args: frequencies_hertz: A `Tensor` of frequencies in Hertz. name: An optional name for the operation. Returns: A `Tensor` of the same shape and type of `frequencies_hertz` cont...
[ "def", "_hertz_to_mel", "(", "frequencies_hertz", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "'hertz_to_mel'", ",", "[", "frequencies_hertz", "]", ")", ":", "frequencies_hertz", "=", "ops", ".", "convert_to_tensor",...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/signal/mel_ops.py#L50-L64