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
microsoft/onnxruntime
f92e47e95b13a240e37caf7b36577983544f98fc
orttraining/orttraining/python/training/optim/lr_scheduler.py
python
_LRScheduler.get_lr
(self, train_step_info)
r"""Returns a list of learning rate Args: train_step_info (:py:class:`.TrainStepInfo`): runtime info for current training step Returns: ordered :py:obj:`list` of learning rates. The first entry is the default learning rate and the remaining r...
r"""Returns a list of learning rate
[ "r", "Returns", "a", "list", "of", "learning", "rate" ]
def get_lr(self, train_step_info): r"""Returns a list of learning rate Args: train_step_info (:py:class:`.TrainStepInfo`): runtime info for current training step Returns: ordered :py:obj:`list` of learning rates. The first entry is the default learning r...
[ "def", "get_lr", "(", "self", ",", "train_step_info", ")", ":", "raise", "NotImplementedError" ]
https://github.com/microsoft/onnxruntime/blob/f92e47e95b13a240e37caf7b36577983544f98fc/orttraining/orttraining/python/training/optim/lr_scheduler.py#L31-L43
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBProcess.GetMemoryRegionInfo
(self, *args)
return _lldb.SBProcess_GetMemoryRegionInfo(self, *args)
GetMemoryRegionInfo(self, addr_t load_addr, SBMemoryRegionInfo region_info) -> SBError
GetMemoryRegionInfo(self, addr_t load_addr, SBMemoryRegionInfo region_info) -> SBError
[ "GetMemoryRegionInfo", "(", "self", "addr_t", "load_addr", "SBMemoryRegionInfo", "region_info", ")", "-", ">", "SBError" ]
def GetMemoryRegionInfo(self, *args): """GetMemoryRegionInfo(self, addr_t load_addr, SBMemoryRegionInfo region_info) -> SBError""" return _lldb.SBProcess_GetMemoryRegionInfo(self, *args)
[ "def", "GetMemoryRegionInfo", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBProcess_GetMemoryRegionInfo", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L7354-L7356
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py3/pandas/core/arrays/datetimelike.py
python
DatetimeLikeArrayMixin._add_timedeltalike_scalar
(self, other)
return type(self)._simple_new( # type: ignore[call-arg] new_values, dtype=self.dtype, freq=new_freq )
Add a delta of a timedeltalike Returns ------- Same type as self
Add a delta of a timedeltalike
[ "Add", "a", "delta", "of", "a", "timedeltalike" ]
def _add_timedeltalike_scalar(self, other): """ Add a delta of a timedeltalike Returns ------- Same type as self """ if isna(other): # i.e np.timedelta64("NaT"), not recognized by delta_to_nanoseconds new_values = np.empty(self.shape, dtyp...
[ "def", "_add_timedeltalike_scalar", "(", "self", ",", "other", ")", ":", "if", "isna", "(", "other", ")", ":", "# i.e np.timedelta64(\"NaT\"), not recognized by delta_to_nanoseconds", "new_values", "=", "np", ".", "empty", "(", "self", ".", "shape", ",", "dtype", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py3/pandas/core/arrays/datetimelike.py#L1074-L1102
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/site_compare/site_compare.py
python
main
()
return 0
Main executable. Parse the command line and invoke the command.
Main executable. Parse the command line and invoke the command.
[ "Main", "executable", ".", "Parse", "the", "command", "line", "and", "invoke", "the", "command", "." ]
def main(): """Main executable. Parse the command line and invoke the command.""" cmdline = command_line.CommandLine() # The below two commands are currently unstable so have been disabled # commands.compare2.CreateCommand(cmdline) # commands.maskmaker.CreateCommand(cmdline) commands.measure.CreateCommand(...
[ "def", "main", "(", ")", ":", "cmdline", "=", "command_line", ".", "CommandLine", "(", ")", "# The below two commands are currently unstable so have been disabled", "# commands.compare2.CreateCommand(cmdline)", "# commands.maskmaker.CreateCommand(cmdline)", "commands", ".", "measur...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/site_compare/site_compare.py#L161-L172
esphome/esphome
40e06c9819f17409615d4f4eec5cfe4dc9a3776d
esphome/config.py
python
line_info
(config, path, highlight=True)
return "None"
Display line config source.
Display line config source.
[ "Display", "line", "config", "source", "." ]
def line_info(config, path, highlight=True): """Display line config source.""" if not highlight: return None obj = config.get_deepest_document_range_for_path(path) if obj: mark = obj.start_mark source = f"[source {mark.document}:{mark.line + 1}]" return color(Fore.CYAN, s...
[ "def", "line_info", "(", "config", ",", "path", ",", "highlight", "=", "True", ")", ":", "if", "not", "highlight", ":", "return", "None", "obj", "=", "config", ".", "get_deepest_document_range_for_path", "(", "path", ")", "if", "obj", ":", "mark", "=", "...
https://github.com/esphome/esphome/blob/40e06c9819f17409615d4f4eec5cfe4dc9a3776d/esphome/config.py#L834-L843
s5z/zsim
fb4d6e0475a25cffd23f0687ede2d43d96b4a99f
misc/cpplint.py
python
CheckAltTokens
(filename, clean_lines, linenum, error)
Check alternative keywords being used in boolean expressions. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. error: The function to call with any errors found.
Check alternative keywords being used in boolean expressions.
[ "Check", "alternative", "keywords", "being", "used", "in", "boolean", "expressions", "." ]
def CheckAltTokens(filename, clean_lines, linenum, error): """Check alternative keywords being used in boolean expressions. 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 ...
[ "def", "CheckAltTokens", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "# Avoid preprocessor lines", "if", "Match", "(", "r'^\\s*#'", ",", "line", ")", ":", "retur...
https://github.com/s5z/zsim/blob/fb4d6e0475a25cffd23f0687ede2d43d96b4a99f/misc/cpplint.py#L2736-L2765
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py
python
PDeque.maxlen
(self)
return self._maxlen
Maximum length of the queue.
Maximum length of the queue.
[ "Maximum", "length", "of", "the", "queue", "." ]
def maxlen(self): """ Maximum length of the queue. """ return self._maxlen
[ "def", "maxlen", "(", "self", ")", ":", "return", "self", ".", "_maxlen" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/lib/pyrsistent/_pdeque.py#L99-L103
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/tools/gyp/pylib/gyp/MSVSVersion.py
python
_RegistryQuery
(key, value=None)
return text
r"""Use reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and up and available on Windows Server 2003 and XP through KB patch 942589. Note that Sysnati...
r"""Use reg.exe to read a particular key through _RegistryQueryBase.
[ "r", "Use", "reg", ".", "exe", "to", "read", "a", "particular", "key", "through", "_RegistryQueryBase", "." ]
def _RegistryQuery(key, value=None): r"""Use reg.exe to read a particular key through _RegistryQueryBase. First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If that fails, it falls back to System32. Sysnative is available on Vista and up and available on Windows Server 2003 and XP throu...
[ "def", "_RegistryQuery", "(", "key", ",", "value", "=", "None", ")", ":", "text", "=", "None", "try", ":", "text", "=", "_RegistryQueryBase", "(", "'Sysnative'", ",", "key", ",", "value", ")", "except", "OSError", ",", "e", ":", "if", "e", ".", "errn...
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/tools/gyp/pylib/gyp/MSVSVersion.py#L172-L197
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/grid.py
python
Grid.InsertRows
(*args, **kwargs)
return _grid.Grid_InsertRows(*args, **kwargs)
InsertRows(self, int pos=0, int numRows=1, bool updateLabels=True) -> bool
InsertRows(self, int pos=0, int numRows=1, bool updateLabels=True) -> bool
[ "InsertRows", "(", "self", "int", "pos", "=", "0", "int", "numRows", "=", "1", "bool", "updateLabels", "=", "True", ")", "-", ">", "bool" ]
def InsertRows(*args, **kwargs): """InsertRows(self, int pos=0, int numRows=1, bool updateLabels=True) -> bool""" return _grid.Grid_InsertRows(*args, **kwargs)
[ "def", "InsertRows", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_grid", ".", "Grid_InsertRows", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/grid.py#L1267-L1269
toggl-open-source/toggldesktop
91865205885531cc8fd9e8d613dad49d625d56e7
third_party/cpplint/cpplint.py
python
_FunctionState.End
(self)
Stop analyzing function body.
Stop analyzing function body.
[ "Stop", "analyzing", "function", "body", "." ]
def End(self): """Stop analyzing function body.""" self.in_a_function = False
[ "def", "End", "(", "self", ")", ":", "self", ".", "in_a_function", "=", "False" ]
https://github.com/toggl-open-source/toggldesktop/blob/91865205885531cc8fd9e8d613dad49d625d56e7/third_party/cpplint/cpplint.py#L964-L966
RamadhanAmizudin/malware
2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1
Fuzzbunch/exploits/ZIBE/pyreadline/console/ironpython_console.py
python
Console.size
(self, width=None, height=None)
u'''Set/get window size.
u'''Set/get window size.
[ "u", "Set", "/", "get", "window", "size", "." ]
def size(self, width=None, height=None): u'''Set/get window size.''' sc = System.Console if width is not None and height is not None: sc.BufferWidth, sc.BufferHeight = width,height else: return sc.BufferWidth, sc.BufferHeight if width is not None and heig...
[ "def", "size", "(", "self", ",", "width", "=", "None", ",", "height", "=", "None", ")", ":", "sc", "=", "System", ".", "Console", "if", "width", "is", "not", "None", "and", "height", "is", "not", "None", ":", "sc", ".", "BufferWidth", ",", "sc", ...
https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/exploits/ZIBE/pyreadline/console/ironpython_console.py#L325-L336
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/boto/boto/vpc/__init__.py
python
VPCConnection.create_customer_gateway
(self, type, ip_address, bgp_asn, dry_run=False)
return self.get_object('CreateCustomerGateway', params, CustomerGateway)
Create a new Customer Gateway :type type: str :param type: Type of VPN Connection. Only valid value currently is 'ipsec.1' :type ip_address: str :param ip_address: Internet-routable IP address for customer's gateway. Must be a static address. :type ...
Create a new Customer Gateway
[ "Create", "a", "new", "Customer", "Gateway" ]
def create_customer_gateway(self, type, ip_address, bgp_asn, dry_run=False): """ Create a new Customer Gateway :type type: str :param type: Type of VPN Connection. Only valid value currently is 'ipsec.1' :type ip_address: str :param ip_address: Internet-routable IP add...
[ "def", "create_customer_gateway", "(", "self", ",", "type", ",", "ip_address", ",", "bgp_asn", ",", "dry_run", "=", "False", ")", ":", "params", "=", "{", "'Type'", ":", "type", ",", "'IpAddress'", ":", "ip_address", ",", "'BgpAsn'", ":", "bgp_asn", "}", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/boto/boto/vpc/__init__.py#L944-L970
albertz/openlierox
d316c14a8eb57848ef56e9bfa7b23a56f694a51b
tools/DedicatedServerVideo/gdata/spreadsheet/text_db.py
python
RecordResultSet.GetNext
(self)
Fetches the next batch of rows in the result set. Returns: A new RecordResultSet.
Fetches the next batch of rows in the result set.
[ "Fetches", "the", "next", "batch", "of", "rows", "in", "the", "result", "set", "." ]
def GetNext(self): """Fetches the next batch of rows in the result set. Returns: A new RecordResultSet. """ next_link = self.feed.GetNextLink() if next_link and next_link.href: new_feed = self.client._GetSpreadsheetsClient().Get(next_link.href, converter=gdata.spreadsheet.Spr...
[ "def", "GetNext", "(", "self", ")", ":", "next_link", "=", "self", ".", "feed", ".", "GetNextLink", "(", ")", "if", "next_link", "and", "next_link", ".", "href", ":", "new_feed", "=", "self", ".", "client", ".", "_GetSpreadsheetsClient", "(", ")", ".", ...
https://github.com/albertz/openlierox/blob/d316c14a8eb57848ef56e9bfa7b23a56f694a51b/tools/DedicatedServerVideo/gdata/spreadsheet/text_db.py#L446-L457
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/dataview.py
python
DataViewEvent.GetDataSize
(*args, **kwargs)
return _dataview.DataViewEvent_GetDataSize(*args, **kwargs)
GetDataSize(self) -> size_t
GetDataSize(self) -> size_t
[ "GetDataSize", "(", "self", ")", "-", ">", "size_t" ]
def GetDataSize(*args, **kwargs): """GetDataSize(self) -> size_t""" return _dataview.DataViewEvent_GetDataSize(*args, **kwargs)
[ "def", "GetDataSize", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_dataview", ".", "DataViewEvent_GetDataSize", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/dataview.py#L1988-L1990
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py
python
PrecompiledHeader._PchHeader
(self)
return os.path.split(self.settings.msvs_precompiled_header[self.config])[1]
Get the header that will appear in an #include line for all source files.
Get the header that will appear in an #include line for all source files.
[ "Get", "the", "header", "that", "will", "appear", "in", "an", "#include", "line", "for", "all", "source", "files", "." ]
def _PchHeader(self): """Get the header that will appear in an #include line for all source files.""" return os.path.split(self.settings.msvs_precompiled_header[self.config])[1]
[ "def", "_PchHeader", "(", "self", ")", ":", "return", "os", ".", "path", ".", "split", "(", "self", ".", "settings", ".", "msvs_precompiled_header", "[", "self", ".", "config", "]", ")", "[", "1", "]" ]
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/msvs_emulation.py#L563-L566
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
gpu/command_buffer/build_gles2_cmd_buffer.py
python
TodoHandler.WriteGLES2Implementation
(self, func, file)
Overrriden from TypeHandler.
Overrriden from TypeHandler.
[ "Overrriden", "from", "TypeHandler", "." ]
def WriteGLES2Implementation(self, func, file): """Overrriden from TypeHandler.""" file.Write("%s GLES2Implementation::%s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" // TODO: for now this is a no-op\n") file.Write( ...
[ "def", "WriteGLES2Implementation", "(", "self", ",", "func", ",", "file", ")", ":", "file", ".", "Write", "(", "\"%s GLES2Implementation::%s(%s) {\\n\"", "%", "(", "func", ".", "return_type", ",", "func", ".", "original_name", ",", "func", ".", "MakeTypedOrigina...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/gpu/command_buffer/build_gles2_cmd_buffer.py#L3493-L3506
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/klampt/vis/visualization.py
python
getWindow
()
return _window_manager.getWindow()
Retrieves ID of currently active window or -1 if no window is active
Retrieves ID of currently active window or -1 if no window is active
[ "Retrieves", "ID", "of", "currently", "active", "window", "or", "-", "1", "if", "no", "window", "is", "active" ]
def getWindow() -> int: """Retrieves ID of currently active window or -1 if no window is active""" global _window_manager _init() return _window_manager.getWindow()
[ "def", "getWindow", "(", ")", "->", "int", ":", "global", "_window_manager", "_init", "(", ")", "return", "_window_manager", ".", "getWindow", "(", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/klampt/vis/visualization.py#L925-L929
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/cookies.py
python
MockRequest.add_header
(self, key, val)
cookielib has no legitimate use for this method; add it back if you find one.
cookielib has no legitimate use for this method; add it back if you find one.
[ "cookielib", "has", "no", "legitimate", "use", "for", "this", "method", ";", "add", "it", "back", "if", "you", "find", "one", "." ]
def add_header(self, key, val): """cookielib has no legitimate use for this method; add it back if you find one.""" raise NotImplementedError("Cookie headers should be added with add_unredirected_header()")
[ "def", "add_header", "(", "self", ",", "key", ",", "val", ")", ":", "raise", "NotImplementedError", "(", "\"Cookie headers should be added with add_unredirected_header()\"", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/requests/cookies.py#L74-L76
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/composite/multitype_ops/setitem_impl.py
python
_list_setitem_with_tuple
(data, number_index, value)
return F.list_setitem(data, number_index, value)
Assigns value to list. Inputs: data (list): Data of type list. number_index (Number): Index of data. value (list): Value given. Outputs: list, type is the same as the element type of data.
Assigns value to list.
[ "Assigns", "value", "to", "list", "." ]
def _list_setitem_with_tuple(data, number_index, value): """ Assigns value to list. Inputs: data (list): Data of type list. number_index (Number): Index of data. value (list): Value given. Outputs: list, type is the same as the element type of data. """ return F...
[ "def", "_list_setitem_with_tuple", "(", "data", ",", "number_index", ",", "value", ")", ":", "return", "F", ".", "list_setitem", "(", "data", ",", "number_index", ",", "value", ")" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/composite/multitype_ops/setitem_impl.py#L90-L102
apiaryio/snowcrash
b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3
tools/gyp/pylib/gyp/generator/cmake.py
python
WriteRules
(target_name, rules, extra_sources, extra_deps, path_to_gyp, output)
Write CMake for the 'rules' in the target. Args: target_name: the name of the CMake target being generated. actions: the Gyp 'actions' dict for this target. extra_sources: [(<cmake_src>, <src>)] to append with generated source files. extra_deps: [<cmake_taget>] to append with generated targets. p...
Write CMake for the 'rules' in the target.
[ "Write", "CMake", "for", "the", "rules", "in", "the", "target", "." ]
def WriteRules(target_name, rules, extra_sources, extra_deps, path_to_gyp, output): """Write CMake for the 'rules' in the target. Args: target_name: the name of the CMake target being generated. actions: the Gyp 'actions' dict for this target. extra_sources: [(<cmake_src>, <src>)] to app...
[ "def", "WriteRules", "(", "target_name", ",", "rules", ",", "extra_sources", ",", "extra_deps", ",", "path_to_gyp", ",", "output", ")", ":", "for", "rule", "in", "rules", ":", "rule_name", "=", "StringToCMakeTargetName", "(", "target_name", "+", "'__'", "+", ...
https://github.com/apiaryio/snowcrash/blob/b5b39faa85f88ee17459edf39fdc6fe4fc70d2e3/tools/gyp/pylib/gyp/generator/cmake.py#L330-L441
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/distribute/distribute_lib.py
python
_require_strategy_scope_strategy
(strategy)
Verify in a `strategy.scope()` in this thread.
Verify in a `strategy.scope()` in this thread.
[ "Verify", "in", "a", "strategy", ".", "scope", "()", "in", "this", "thread", "." ]
def _require_strategy_scope_strategy(strategy): """Verify in a `strategy.scope()` in this thread.""" context = _get_per_thread_mode() if context.strategy is strategy: return _wrong_strategy_scope(strategy, context)
[ "def", "_require_strategy_scope_strategy", "(", "strategy", ")", ":", "context", "=", "_get_per_thread_mode", "(", ")", "if", "context", ".", "strategy", "is", "strategy", ":", "return", "_wrong_strategy_scope", "(", "strategy", ",", "context", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/distribute/distribute_lib.py#L342-L346
pisa-engine/pisa
0efb7926d4928c8aae672ba4d7a1419891f2676d
script/ext/baker.py
python
Baker.usage
(self, cmd=None, scriptname=None, exception=None, fobj=sys.stdout)
Prints usage of the specified command.
Prints usage of the specified command.
[ "Prints", "usage", "of", "the", "specified", "command", "." ]
def usage(self, cmd=None, scriptname=None, exception=None, fobj=sys.stdout): """ Prints usage of the specified command. """ if exception is not None: scriptname, cmd = exception.scriptname, exception.cmd if scriptname is None: scriptname = s...
[ "def", "usage", "(", "self", ",", "cmd", "=", "None", ",", "scriptname", "=", "None", ",", "exception", "=", "None", ",", "fobj", "=", "sys", ".", "stdout", ")", ":", "if", "exception", "is", "not", "None", ":", "scriptname", ",", "cmd", "=", "exce...
https://github.com/pisa-engine/pisa/blob/0efb7926d4928c8aae672ba4d7a1419891f2676d/script/ext/baker.py#L324-L341
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/stc.py
python
StyledTextCtrl.MarginGetText
(*args, **kwargs)
return _stc.StyledTextCtrl_MarginGetText(*args, **kwargs)
MarginGetText(self, int line) -> String Get the text in the text margin for a line
MarginGetText(self, int line) -> String
[ "MarginGetText", "(", "self", "int", "line", ")", "-", ">", "String" ]
def MarginGetText(*args, **kwargs): """ MarginGetText(self, int line) -> String Get the text in the text margin for a line """ return _stc.StyledTextCtrl_MarginGetText(*args, **kwargs)
[ "def", "MarginGetText", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_stc", ".", "StyledTextCtrl_MarginGetText", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L5847-L5853
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLReduction.py
python
DirectILLReduction._sOfQW
(self, mainWS)
return sOfQWWS
Run the SofQWNormalisedPolygon algorithm.
Run the SofQWNormalisedPolygon algorithm.
[ "Run", "the", "SofQWNormalisedPolygon", "algorithm", "." ]
def _sOfQW(self, mainWS): """Run the SofQWNormalisedPolygon algorithm.""" sOfQWWSName = self._names.withSuffix('sofqw') if self.getProperty(common.PROP_BINNING_PARAMS_Q).isDefault: qMin, qMax = _minMaxQ(mainWS) dq = _deltaQ(mainWS) e = numpy.ceil(-numpy.log10(...
[ "def", "_sOfQW", "(", "self", ",", "mainWS", ")", ":", "sOfQWWSName", "=", "self", ".", "_names", ".", "withSuffix", "(", "'sofqw'", ")", "if", "self", ".", "getProperty", "(", "common", ".", "PROP_BINNING_PARAMS_Q", ")", ".", "isDefault", ":", "qMin", "...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/DirectILLReduction.py#L550-L574
panda3d/panda3d
833ad89ebad58395d0af0b7ec08538e5e4308265
direct/src/showbase/BufferViewer.py
python
BufferViewer.setSort
(self, bin, sort)
Set the cull-bin and sort-order for the output cards. The default value is 'fixed', 10000.
Set the cull-bin and sort-order for the output cards. The default value is 'fixed', 10000.
[ "Set", "the", "cull", "-", "bin", "and", "sort", "-", "order", "for", "the", "output", "cards", ".", "The", "default", "value", "is", "fixed", "10000", "." ]
def setSort(self, bin, sort): """Set the cull-bin and sort-order for the output cards. The default value is 'fixed', 10000.""" self.cullbin = bin self.cullsort = sort self.dirty = 1
[ "def", "setSort", "(", "self", ",", "bin", ",", "sort", ")", ":", "self", ".", "cullbin", "=", "bin", "self", ".", "cullsort", "=", "sort", "self", ".", "dirty", "=", "1" ]
https://github.com/panda3d/panda3d/blob/833ad89ebad58395d0af0b7ec08538e5e4308265/direct/src/showbase/BufferViewer.py#L189-L194
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py
python
Real.__float__
(self)
Any Real can be converted to a native float object. Called for float(self).
Any Real can be converted to a native float object.
[ "Any", "Real", "can", "be", "converted", "to", "a", "native", "float", "object", "." ]
def __float__(self): """Any Real can be converted to a native float object. Called for float(self).""" raise NotImplementedError
[ "def", "__float__", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/numbers.py#L181-L185
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/retryhandler.py
python
BaseChecker.__call__
(self, attempt_number, response, caught_exception)
Determine if retry criteria matches. Note that either ``response`` is not None and ``caught_exception`` is None or ``response`` is None and ``caught_exception`` is not None. :type attempt_number: int :param attempt_number: The total number of times we've attempted to send t...
Determine if retry criteria matches.
[ "Determine", "if", "retry", "criteria", "matches", "." ]
def __call__(self, attempt_number, response, caught_exception): """Determine if retry criteria matches. Note that either ``response`` is not None and ``caught_exception`` is None or ``response`` is None and ``caught_exception`` is not None. :type attempt_number: int :param atte...
[ "def", "__call__", "(", "self", ",", "attempt_number", ",", "response", ",", "caught_exception", ")", ":", "# The default implementation allows subclasses to not have to check", "# whether or not response is None or not.", "if", "response", "is", "not", "None", ":", "return",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/retryhandler.py#L197-L225
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/easy_install.py
python
is_python_script
(script_text, filename)
return False
Is this text, as a whole, a Python script? (as opposed to shell/bat/etc.
Is this text, as a whole, a Python script? (as opposed to shell/bat/etc.
[ "Is", "this", "text", "as", "a", "whole", "a", "Python", "script?", "(", "as", "opposed", "to", "shell", "/", "bat", "/", "etc", "." ]
def is_python_script(script_text, filename): """Is this text, as a whole, a Python script? (as opposed to shell/bat/etc. """ if filename.endswith('.py') or filename.endswith('.pyw'): return True # extension says it's Python if is_python(script_text, filename): return True # it's ...
[ "def", "is_python_script", "(", "script_text", ",", "filename", ")", ":", "if", "filename", ".", "endswith", "(", "'.py'", ")", "or", "filename", ".", "endswith", "(", "'.pyw'", ")", ":", "return", "True", "# extension says it's Python", "if", "is_python", "("...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/easy_install.py#L1701-L1712
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/text_format.py
python
_Tokenizer.ConsumeUint32
(self)
return result
Consumes an unsigned 32bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 32bit integer couldn't be consumed.
Consumes an unsigned 32bit integer number.
[ "Consumes", "an", "unsigned", "32bit", "integer", "number", "." ]
def ConsumeUint32(self): """Consumes an unsigned 32bit integer number. Returns: The integer parsed. Raises: ParseError: If an unsigned 32bit integer couldn't be consumed. """ try: result = ParseInteger(self.token, is_signed=False, is_long=False) except ValueError as e: ...
[ "def", "ConsumeUint32", "(", "self", ")", ":", "try", ":", "result", "=", "ParseInteger", "(", "self", ".", "token", ",", "is_signed", "=", "False", ",", "is_long", "=", "False", ")", "except", "ValueError", "as", "e", ":", "raise", "self", ".", "_Pars...
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/text_format.py#L891-L905
cvxpy/cvxpy
5165b4fb750dfd237de8659383ef24b4b2e33aaf
cvxpy/reductions/solvers/conic_solvers/mosek_conif.py
python
MOSEK._build_slack_task
(task, data)
return task
This function assumes "data" is formatted by MOSEK.apply, and is only intended when the problem has integer constraints. As of MOSEK version 9.2, MOSEK does not support mixed-integer SDP. This implementation relies on that fact. "data" is a dict, keyed by s.C, s.A, s.B, 'K_dir', 'K_aff', s.BOOL...
This function assumes "data" is formatted by MOSEK.apply, and is only intended when the problem has integer constraints. As of MOSEK version 9.2, MOSEK does not support mixed-integer SDP. This implementation relies on that fact.
[ "This", "function", "assumes", "data", "is", "formatted", "by", "MOSEK", ".", "apply", "and", "is", "only", "intended", "when", "the", "problem", "has", "integer", "constraints", ".", "As", "of", "MOSEK", "version", "9", ".", "2", "MOSEK", "does", "not", ...
def _build_slack_task(task, data): """ This function assumes "data" is formatted by MOSEK.apply, and is only intended when the problem has integer constraints. As of MOSEK version 9.2, MOSEK does not support mixed-integer SDP. This implementation relies on that fact. "data" is a...
[ "def", "_build_slack_task", "(", "task", ",", "data", ")", ":", "import", "mosek", "K_aff", "=", "data", "[", "'K_aff'", "]", "# K_aff keyed by a2d.ZERO, a2d.NONNEG", "c", ",", "A", ",", "b", "=", "data", "[", "s", ".", "C", "]", ",", "data", "[", "s",...
https://github.com/cvxpy/cvxpy/blob/5165b4fb750dfd237de8659383ef24b4b2e33aaf/cvxpy/reductions/solvers/conic_solvers/mosek_conif.py#L320-L384
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
AboutDialogInfo.AddDocWriter
(*args, **kwargs)
return _misc_.AboutDialogInfo_AddDocWriter(*args, **kwargs)
AddDocWriter(self, String docwriter) Add a string to the list of documentation writers.
AddDocWriter(self, String docwriter)
[ "AddDocWriter", "(", "self", "String", "docwriter", ")" ]
def AddDocWriter(*args, **kwargs): """ AddDocWriter(self, String docwriter) Add a string to the list of documentation writers. """ return _misc_.AboutDialogInfo_AddDocWriter(*args, **kwargs)
[ "def", "AddDocWriter", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "AboutDialogInfo_AddDocWriter", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L6840-L6846
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/multiindex.py
python
MultiIndex.rename
(self, names, inplace=False)
return self.set_names(names, level=None, inplace=inplace)
Alter MultiIndex level names Parameters ---------- names : list of label Names to set, length must be the same as number of levels inplace : bool, default False If True, modifies objects directly, otherwise returns a new ``MultiIndex`` instance ...
Alter MultiIndex level names
[ "Alter", "MultiIndex", "level", "names" ]
def rename(self, names, inplace=False): """ Alter MultiIndex level names Parameters ---------- names : list of label Names to set, length must be the same as number of levels inplace : bool, default False If True, modifies objects directly, otherw...
[ "def", "rename", "(", "self", ",", "names", ",", "inplace", "=", "False", ")", ":", "return", "self", ".", "set_names", "(", "names", ",", "level", "=", "None", ",", "inplace", "=", "inplace", ")" ]
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/multiindex.py#L175-L219
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
src/python/turicreate/toolkits/recommender/util.py
python
_Recommender.get_similar_users
(self, users=None, k=10)
return response
Get the k most similar users for each entry in `users`. Each type of recommender has its own model for the similarity between users. For example, the factorization_recommender will return the nearest users based on the cosine similarity between latent user factors. (This method is not ...
Get the k most similar users for each entry in `users`.
[ "Get", "the", "k", "most", "similar", "users", "for", "each", "entry", "in", "users", "." ]
def get_similar_users(self, users=None, k=10): """Get the k most similar users for each entry in `users`. Each type of recommender has its own model for the similarity between users. For example, the factorization_recommender will return the nearest users based on the cosine similarity ...
[ "def", "get_similar_users", "(", "self", ",", "users", "=", "None", ",", "k", "=", "10", ")", ":", "if", "users", "is", "None", ":", "get_all_users", "=", "True", "users", "=", "_SArray", "(", ")", "else", ":", "get_all_users", "=", "False", "if", "i...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/python/turicreate/toolkits/recommender/util.py#L1019-L1083
GoSSIP-SJTU/Armariris
ad5d868482956b2194a77b39c8d543c7c2318200
tools/clang/utils/check_cfc/check_cfc.py
python
get_output_file
(args)
return None
Return the output file specified by this command or None if not specified.
Return the output file specified by this command or None if not specified.
[ "Return", "the", "output", "file", "specified", "by", "this", "command", "or", "None", "if", "not", "specified", "." ]
def get_output_file(args): """Return the output file specified by this command or None if not specified.""" grabnext = False for arg in args: if grabnext: return arg if arg == '-o': # Specified as a separate arg grabnext = True elif arg.startsw...
[ "def", "get_output_file", "(", "args", ")", ":", "grabnext", "=", "False", "for", "arg", "in", "args", ":", "if", "grabnext", ":", "return", "arg", "if", "arg", "==", "'-o'", ":", "# Specified as a separate arg", "grabnext", "=", "True", "elif", "arg", "."...
https://github.com/GoSSIP-SJTU/Armariris/blob/ad5d868482956b2194a77b39c8d543c7c2318200/tools/clang/utils/check_cfc/check_cfc.py#L127-L142
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/telnetlib.py
python
Telnet.read_all
(self)
return buf
Read all data until EOF; block until connection closed.
Read all data until EOF; block until connection closed.
[ "Read", "all", "data", "until", "EOF", ";", "block", "until", "connection", "closed", "." ]
def read_all(self): """Read all data until EOF; block until connection closed.""" self.process_rawq() while not self.eof: self.fill_rawq() self.process_rawq() buf = self.cookedq self.cookedq = b'' return buf
[ "def", "read_all", "(", "self", ")", ":", "self", ".", "process_rawq", "(", ")", "while", "not", "self", ".", "eof", ":", "self", ".", "fill_rawq", "(", ")", "self", ".", "process_rawq", "(", ")", "buf", "=", "self", ".", "cookedq", "self", ".", "c...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/telnetlib.py#L329-L337
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/ceph-volume/ceph_volume/devices/lvm/zap.py
python
find_associated_devices
(osd_id=None, osd_fsid=None)
return [Device(path) for path in set(devices_to_zap) if path]
From an ``osd_id`` and/or an ``osd_fsid``, filter out all the LVs in the system that match those tag values, further detect if any partitions are part of the OSD, and then return the set of LVs and partitions (if any).
From an ``osd_id`` and/or an ``osd_fsid``, filter out all the LVs in the system that match those tag values, further detect if any partitions are part of the OSD, and then return the set of LVs and partitions (if any).
[ "From", "an", "osd_id", "and", "/", "or", "an", "osd_fsid", "filter", "out", "all", "the", "LVs", "in", "the", "system", "that", "match", "those", "tag", "values", "further", "detect", "if", "any", "partitions", "are", "part", "of", "the", "OSD", "and", ...
def find_associated_devices(osd_id=None, osd_fsid=None): """ From an ``osd_id`` and/or an ``osd_fsid``, filter out all the LVs in the system that match those tag values, further detect if any partitions are part of the OSD, and then return the set of LVs and partitions (if any). """ lv_tags = {}...
[ "def", "find_associated_devices", "(", "osd_id", "=", "None", ",", "osd_fsid", "=", "None", ")", ":", "lv_tags", "=", "{", "}", "if", "osd_id", ":", "lv_tags", "[", "'ceph.osd_id'", "]", "=", "osd_id", "if", "osd_fsid", ":", "lv_tags", "[", "'ceph.osd_fsid...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/ceph-volume/ceph_volume/devices/lvm/zap.py#L73-L91
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
src/pybind/mgr/insights/health.py
python
HealthHistorySlot._key
(dt)
return HEALTH_HISTORY_KEY_PREFIX + dt.strftime("%Y-%m-%d_%H")
Key format. Example: health_2018_11_05_00
Key format. Example: health_2018_11_05_00
[ "Key", "format", ".", "Example", ":", "health_2018_11_05_00" ]
def _key(dt): """Key format. Example: health_2018_11_05_00""" return HEALTH_HISTORY_KEY_PREFIX + dt.strftime("%Y-%m-%d_%H")
[ "def", "_key", "(", "dt", ")", ":", "return", "HEALTH_HISTORY_KEY_PREFIX", "+", "dt", ".", "strftime", "(", "\"%Y-%m-%d_%H\"", ")" ]
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/src/pybind/mgr/insights/health.py#L175-L177
devpack/android-python27
d42dd67565e104cf7b0b50eb473f615db3e69901
python-build-with-qt/sip-4.11.2/sipconfig.py
python
version_to_sip_tag
(version, tags, description)
return tag
Convert a version number to a SIP tag. version is the version number. If it is negative then the latest version is assumed. (This is typically useful if a snapshot is indicated by a negative version number.) tags is the dictionary of tags keyed by version number. The tag used is the one with the...
Convert a version number to a SIP tag.
[ "Convert", "a", "version", "number", "to", "a", "SIP", "tag", "." ]
def version_to_sip_tag(version, tags, description): """Convert a version number to a SIP tag. version is the version number. If it is negative then the latest version is assumed. (This is typically useful if a snapshot is indicated by a negative version number.) tags is the dictionary of tags key...
[ "def", "version_to_sip_tag", "(", "version", ",", "tags", ",", "description", ")", ":", "vl", "=", "list", "(", "tags", ".", "keys", "(", ")", ")", "vl", ".", "sort", "(", ")", "# For a snapshot use the latest tag.", "if", "version", "<", "0", ":", "tag"...
https://github.com/devpack/android-python27/blob/d42dd67565e104cf7b0b50eb473f615db3e69901/python-build-with-qt/sip-4.11.2/sipconfig.py#L2196-L2223
tum-vision/fusenet
a1451be2971b348a01b0f525c2a3a7a0e215a591
python/caffe/draw.py
python
get_edge_label
(layer)
return edge_label
Define edge label based on layer type.
Define edge label based on layer type.
[ "Define", "edge", "label", "based", "on", "layer", "type", "." ]
def get_edge_label(layer): """Define edge label based on layer type. """ if layer.type == 'Data': edge_label = 'Batch ' + str(layer.data_param.batch_size) elif layer.type == 'Convolution' or layer.type == 'Deconvolution': edge_label = str(layer.convolution_param.num_output) elif lay...
[ "def", "get_edge_label", "(", "layer", ")", ":", "if", "layer", ".", "type", "==", "'Data'", ":", "edge_label", "=", "'Batch '", "+", "str", "(", "layer", ".", "data_param", ".", "batch_size", ")", "elif", "layer", ".", "type", "==", "'Convolution'", "or...
https://github.com/tum-vision/fusenet/blob/a1451be2971b348a01b0f525c2a3a7a0e215a591/python/caffe/draw.py#L46-L59
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/mindrecord/tools/mnist_to_mr.py
python
MnistToMR._transform_test
(self)
return ret
Execute transformation from Mnist test part to MindRecord. Returns: MSRStatus, whether Mnist is successfully transformed to MindRecord.
Execute transformation from Mnist test part to MindRecord.
[ "Execute", "transformation", "from", "Mnist", "test", "part", "to", "MindRecord", "." ]
def _transform_test(self): """ Execute transformation from Mnist test part to MindRecord. Returns: MSRStatus, whether Mnist is successfully transformed to MindRecord. """ t0_total = time.time() logger.info("transformed MindRecord schema is: {}".format(self.m...
[ "def", "_transform_test", "(", "self", ")", ":", "t0_total", "=", "time", ".", "time", "(", ")", "logger", ".", "info", "(", "\"transformed MindRecord schema is: {}\"", ".", "format", "(", "self", ".", "mnist_schema_json", ")", ")", "# set the header size", "sel...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/mindrecord/tools/mnist_to_mr.py#L174-L221
strukturag/libheif
0082fea96ee70a20c8906a0373bedec0c01777bc
scripts/cpplint.py
python
CleanseComments
(line)
return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)
Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed.
Removes //-comments and single-line C-style /* */ comments.
[ "Removes", "//", "-", "comments", "and", "single", "-", "line", "C", "-", "style", "/", "*", "*", "/", "comments", "." ]
def CleanseComments(line): """Removes //-comments and single-line C-style /* */ comments. Args: line: A line of C++ source. Returns: The line with single-line comments removed. """ commentpos = line.find('//') if commentpos != -1 and not IsCppString(line[:commentpos]): line = line[:commentpos]...
[ "def", "CleanseComments", "(", "line", ")", ":", "commentpos", "=", "line", ".", "find", "(", "'//'", ")", "if", "commentpos", "!=", "-", "1", "and", "not", "IsCppString", "(", "line", "[", ":", "commentpos", "]", ")", ":", "line", "=", "line", "[", ...
https://github.com/strukturag/libheif/blob/0082fea96ee70a20c8906a0373bedec0c01777bc/scripts/cpplint.py#L1361-L1374
EQEmu/Server
4a4158380551c134302a7517f1a59a14d8735d69
utils/scripts/vcxproj_dependencies.py
python
create_output_directory
()
Check for output directory - create if does not exist
Check for output directory - create if does not exist
[ "Check", "for", "output", "directory", "-", "create", "if", "does", "not", "exist" ]
def create_output_directory(): """ Check for output directory - create if does not exist """ try: output_path = '{0}/utils/scripts/vcxproj_dependencies_output'.format(base_path) if not os.path.exists(output_path): os.mkdir(output_path) return True excep...
[ "def", "create_output_directory", "(", ")", ":", "try", ":", "output_path", "=", "'{0}/utils/scripts/vcxproj_dependencies_output'", ".", "format", "(", "base_path", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "output_path", ")", ":", "os", ".", "m...
https://github.com/EQEmu/Server/blob/4a4158380551c134302a7517f1a59a14d8735d69/utils/scripts/vcxproj_dependencies.py#L74-L87
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/sliceviewer/peaksviewer/workspaceselection.py
python
PeaksWorkspaceSelectorModel.__init__
(self, workspace_provider, checked_names=None)
:param workspace_provider: An object allowing access to available workspaces :param checked_names: An optional list of str names of workspaces to check by default
:param workspace_provider: An object allowing access to available workspaces :param checked_names: An optional list of str names of workspaces to check by default
[ ":", "param", "workspace_provider", ":", "An", "object", "allowing", "access", "to", "available", "workspaces", ":", "param", "checked_names", ":", "An", "optional", "list", "of", "str", "names", "of", "workspaces", "to", "check", "by", "default" ]
def __init__(self, workspace_provider, checked_names=None): """ :param workspace_provider: An object allowing access to available workspaces :param checked_names: An optional list of str names of workspaces to check by default """ self._workspace_provider = workspace_provider ...
[ "def", "__init__", "(", "self", ",", "workspace_provider", ",", "checked_names", "=", "None", ")", ":", "self", ".", "_workspace_provider", "=", "workspace_provider", "self", ".", "_checked_names", "=", "checked_names", "if", "checked_names", "is", "not", "None", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/sliceviewer/peaksviewer/workspaceselection.py#L22-L28
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
_FunctionState.Check
(self, error, filename, linenum)
Report if too many lines in function body. Args: error: The function to call with any errors found. filename: The name of the current file. linenum: The number of the line to check.
Report if too many lines in function body.
[ "Report", "if", "too", "many", "lines", "in", "function", "body", "." ]
def Check(self, error, filename, linenum): """Report if too many lines in function body. Args: error: The function to call with any errors found. filename: The name of the current file. linenum: The number of the line to check. """ if not self.in_a_function: return if Match...
[ "def", "Check", "(", "self", ",", "error", ",", "filename", ",", "linenum", ")", ":", "if", "not", "self", ".", "in_a_function", ":", "return", "if", "Match", "(", "r'T(EST|est)'", ",", "self", ".", "current_function", ")", ":", "base_trigger", "=", "sel...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L1059-L1085
intel/llvm
e6d0547e9d99b5a56430c4749f6c7e328bf221ab
lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py
python
SpawnBase.fileno
(self)
return self.child_fd
Expose file descriptor for a file-like interface
Expose file descriptor for a file-like interface
[ "Expose", "file", "descriptor", "for", "a", "file", "-", "like", "interface" ]
def fileno(self): '''Expose file descriptor for a file-like interface ''' return self.child_fd
[ "def", "fileno", "(", "self", ")", ":", "return", "self", ".", "child_fd" ]
https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/lldb/third_party/Python/module/pexpect-4.6/pexpect/spawnbase.py#L501-L504
HyeonwooNoh/caffe
d9e8494a2832d67b25dee37194c7bcb9d52d0e42
scripts/download_model_binary.py
python
reporthook
(count, block_size, total_size)
From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/
From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/
[ "From", "http", ":", "//", "blog", ".", "moleculea", ".", "com", "/", "2012", "/", "10", "/", "04", "/", "urlretrieve", "-", "progres", "-", "indicator", "/" ]
def reporthook(count, block_size, total_size): """ From http://blog.moleculea.com/2012/10/04/urlretrieve-progres-indicator/ """ global start_time if count == 0: start_time = time.time() return duration = time.time() - start_time progress_size = int(count * block_size) spe...
[ "def", "reporthook", "(", "count", ",", "block_size", ",", "total_size", ")", ":", "global", "start_time", "if", "count", "==", "0", ":", "start_time", "=", "time", ".", "time", "(", ")", "return", "duration", "=", "time", ".", "time", "(", ")", "-", ...
https://github.com/HyeonwooNoh/caffe/blob/d9e8494a2832d67b25dee37194c7bcb9d52d0e42/scripts/download_model_binary.py#L13-L27
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/deps/v8/third_party/jinja2/filters.py
python
do_mark_safe
(value)
return Markup(value)
Mark the value as safe which means that in an environment with automatic escaping enabled this variable will not be escaped.
Mark the value as safe which means that in an environment with automatic escaping enabled this variable will not be escaped.
[ "Mark", "the", "value", "as", "safe", "which", "means", "that", "in", "an", "environment", "with", "automatic", "escaping", "enabled", "this", "variable", "will", "not", "be", "escaped", "." ]
def do_mark_safe(value): """Mark the value as safe which means that in an environment with automatic escaping enabled this variable will not be escaped. """ return Markup(value)
[ "def", "do_mark_safe", "(", "value", ")", ":", "return", "Markup", "(", "value", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/deps/v8/third_party/jinja2/filters.py#L883-L887
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py
python
_InternalDeclareKeyFlags
(flag_names, flag_values=FLAGS, key_flag_values=None)
Declares a flag as key for the calling module. Internal function. User code should call DECLARE_key_flag or ADOPT_module_key_flags instead. Args: flag_names: A list of strings that are names of already-registered Flag objects. flag_values: A FlagValues object that the flags listed in flag_n...
Declares a flag as key for the calling module.
[ "Declares", "a", "flag", "as", "key", "for", "the", "calling", "module", "." ]
def _InternalDeclareKeyFlags(flag_names, flag_values=FLAGS, key_flag_values=None): """Declares a flag as key for the calling module. Internal function. User code should call DECLARE_key_flag or ADOPT_module_key_flags instead. Args: flag_names: A list of strings that are names...
[ "def", "_InternalDeclareKeyFlags", "(", "flag_names", ",", "flag_values", "=", "FLAGS", ",", "key_flag_values", "=", "None", ")", ":", "key_flag_values", "=", "key_flag_values", "or", "flag_values", "module", "=", "_GetCallingModule", "(", ")", "for", "flag_name", ...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/gsutil/third_party/python-gflags/gflags.py#L2204-L2235
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py
python
QueueListener.dequeue
(self, block)
return self.queue.get(block)
Dequeue a record and return it, optionally blocking. The base implementation uses get. You may want to override this method if you want to use timeouts or work with custom queue implementations.
Dequeue a record and return it, optionally blocking.
[ "Dequeue", "a", "record", "and", "return", "it", "optionally", "blocking", "." ]
def dequeue(self, block): """ Dequeue a record and return it, optionally blocking. The base implementation uses get. You may want to override this method if you want to use timeouts or work with custom queue implementations. """ return self.queue.get(block)
[ "def", "dequeue", "(", "self", ",", "block", ")", ":", "return", "self", ".", "queue", ".", "get", "(", "block", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/logging/handlers.py#L1420-L1427
v8/v8
fee3bf095260bf657a3eea4d3d41f90c42c6c857
tools/stats-viewer.py
python
SharedDataAccess.CharAt
(self, index)
return self.data[index]
Return the ascii character at the specified byte index.
Return the ascii character at the specified byte index.
[ "Return", "the", "ascii", "character", "at", "the", "specified", "byte", "index", "." ]
def CharAt(self, index): """Return the ascii character at the specified byte index.""" return self.data[index]
[ "def", "CharAt", "(", "self", ",", "index", ")", ":", "return", "self", ".", "data", "[", "index", "]" ]
https://github.com/v8/v8/blob/fee3bf095260bf657a3eea4d3d41f90c42c6c857/tools/stats-viewer.py#L325-L327
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/tix.py
python
Tree.setmode
(self, entrypath, mode='none')
This command is used to indicate whether the entry given by entryPath has children entries and whether the children are visible. mode must be one of open, close or none. If mode is set to open, a (+) indicator is drawn next the entry. If mode is set to close, a (-) indicator is drawn next the entry....
This command is used to indicate whether the entry given by entryPath has children entries and whether the children are visible. mode must be one of open, close or none. If mode is set to open, a (+) indicator is drawn next the entry. If mode is set to close, a (-) indicator is drawn next the entry....
[ "This", "command", "is", "used", "to", "indicate", "whether", "the", "entry", "given", "by", "entryPath", "has", "children", "entries", "and", "whether", "the", "children", "are", "visible", ".", "mode", "must", "be", "one", "of", "open", "close", "or", "n...
def setmode(self, entrypath, mode='none'): '''This command is used to indicate whether the entry given by entryPath has children entries and whether the children are visible. mode must be one of open, close or none. If mode is set to open, a (+) indicator is drawn next the entry. If mode is set t...
[ "def", "setmode", "(", "self", ",", "entrypath", ",", "mode", "=", "'none'", ")", ":", "self", ".", "tk", ".", "call", "(", "self", ".", "_w", ",", "'setmode'", ",", "entrypath", ",", "mode", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/tix.py#L1534-L1544
ArduPilot/ardupilot
6e684b3496122b8158ac412b609d00004b7ac306
libraries/SITL/examples/JSON/pybullet/walking_robot.py
python
quaternion_to_AP
(quaternion)
return Quaternion([quaternion[3], quaternion[0], -quaternion[1], -quaternion[2]])
convert pybullet quaternion to ArduPilot quaternion
convert pybullet quaternion to ArduPilot quaternion
[ "convert", "pybullet", "quaternion", "to", "ArduPilot", "quaternion" ]
def quaternion_to_AP(quaternion): '''convert pybullet quaternion to ArduPilot quaternion''' return Quaternion([quaternion[3], quaternion[0], -quaternion[1], -quaternion[2]])
[ "def", "quaternion_to_AP", "(", "quaternion", ")", ":", "return", "Quaternion", "(", "[", "quaternion", "[", "3", "]", ",", "quaternion", "[", "0", "]", ",", "-", "quaternion", "[", "1", "]", ",", "-", "quaternion", "[", "2", "]", "]", ")" ]
https://github.com/ArduPilot/ardupilot/blob/6e684b3496122b8158ac412b609d00004b7ac306/libraries/SITL/examples/JSON/pybullet/walking_robot.py#L70-L72
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/numeric.py
python
isfortran
(a)
return a.flags.fnc
Returns True if array is arranged in Fortran-order in memory and not C-order. Parameters ---------- a : ndarray Input array. Examples -------- np.array allows to specify whether the array is written in C-contiguous order (last index varies the fastest), or FORTRAN-contiguous ...
Returns True if array is arranged in Fortran-order in memory and not C-order.
[ "Returns", "True", "if", "array", "is", "arranged", "in", "Fortran", "-", "order", "in", "memory", "and", "not", "C", "-", "order", "." ]
def isfortran(a): """ Returns True if array is arranged in Fortran-order in memory and not C-order. Parameters ---------- a : ndarray Input array. Examples -------- np.array allows to specify whether the array is written in C-contiguous order (last index varies the fa...
[ "def", "isfortran", "(", "a", ")", ":", "return", "a", ".", "flags", ".", "fnc" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/third_party/lib_x86_64/python2.7/dist-packages/numpy/core/numeric.py#L674-L729
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/protobuf/python/mox.py
python
Mox.CreateMockAnything
(self)
return new_mock
Create a mock that will accept any method calls. This does not enforce an interface.
Create a mock that will accept any method calls.
[ "Create", "a", "mock", "that", "will", "accept", "any", "method", "calls", "." ]
def CreateMockAnything(self): """Create a mock that will accept any method calls. This does not enforce an interface. """ new_mock = MockAnything() self._mock_objects.append(new_mock) return new_mock
[ "def", "CreateMockAnything", "(", "self", ")", ":", "new_mock", "=", "MockAnything", "(", ")", "self", ".", "_mock_objects", ".", "append", "(", "new_mock", ")", "return", "new_mock" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/protobuf/python/mox.py#L179-L187
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
tools/clang/tools/scan-build-py/libscanbuild/clang.py
python
get_version
(clang)
return output[0]
Returns the compiler version as string. :param clang: the compiler we are using :return: the version string printed to stderr
Returns the compiler version as string.
[ "Returns", "the", "compiler", "version", "as", "string", "." ]
def get_version(clang): """ Returns the compiler version as string. :param clang: the compiler we are using :return: the version string printed to stderr """ output = run_command([clang, '-v']) # the relevant version info is in the first line return output[0]
[ "def", "get_version", "(", "clang", ")", ":", "output", "=", "run_command", "(", "[", "clang", ",", "'-v'", "]", ")", "# the relevant version info is in the first line", "return", "output", "[", "0", "]" ]
https://github.com/GoSSIP-SJTU/TripleDoggy/blob/03648d6b19c812504b14e8b98c8c7b3f443f4e54/tools/clang/tools/scan-build-py/libscanbuild/clang.py#L23-L31
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/bdb.py
python
Bdb.get_breaks
(self, filename, lineno)
return filename in self.breaks and \ lineno in self.breaks[filename] and \ Breakpoint.bplist[filename, lineno] or []
Return all breakpoints for filename:lineno. If no breakpoints are set, return an empty list.
Return all breakpoints for filename:lineno.
[ "Return", "all", "breakpoints", "for", "filename", ":", "lineno", "." ]
def get_breaks(self, filename, lineno): """Return all breakpoints for filename:lineno. If no breakpoints are set, return an empty list. """ filename = self.canonic(filename) return filename in self.breaks and \ lineno in self.breaks[filename] and \ Breakp...
[ "def", "get_breaks", "(", "self", ",", "filename", ",", "lineno", ")", ":", "filename", "=", "self", ".", "canonic", "(", "filename", ")", "return", "filename", "in", "self", ".", "breaks", "and", "lineno", "in", "self", ".", "breaks", "[", "filename", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/bdb.py#L481-L489
PlatformLab/RAMCloud
b1866af19124325a6dfd8cbc267e2e3ef1f965d1
cpplint.py
python
FindNextMultiLineCommentEnd
(lines, lineix)
return len(lines)
We are inside a comment, find the end marker.
We are inside a comment, find the end marker.
[ "We", "are", "inside", "a", "comment", "find", "the", "end", "marker", "." ]
def FindNextMultiLineCommentEnd(lines, lineix): """We are inside a comment, find the end marker.""" while lineix < len(lines): if lines[lineix].strip().endswith('*/'): return lineix lineix += 1 return len(lines)
[ "def", "FindNextMultiLineCommentEnd", "(", "lines", ",", "lineix", ")", ":", "while", "lineix", "<", "len", "(", "lines", ")", ":", "if", "lines", "[", "lineix", "]", ".", "strip", "(", ")", ".", "endswith", "(", "'*/'", ")", ":", "return", "lineix", ...
https://github.com/PlatformLab/RAMCloud/blob/b1866af19124325a6dfd8cbc267e2e3ef1f965d1/cpplint.py#L814-L820
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/cli/curses_ui.py
python
CursesUI._title
(self, title, title_color=None)
Display title. Args: title: (str) The title to display. title_color: (str) Color of the title, e.g., "yellow".
Display title.
[ "Display", "title", "." ]
def _title(self, title, title_color=None): """Display title. Args: title: (str) The title to display. title_color: (str) Color of the title, e.g., "yellow". """ # Pad input title str with "-" and space characters to make it pretty. self._title_line = "--- %s " % title if len(self._...
[ "def", "_title", "(", "self", ",", "title", ",", "title_color", "=", "None", ")", ":", "# Pad input title str with \"-\" and space characters to make it pretty.", "self", ".", "_title_line", "=", "\"--- %s \"", "%", "title", "if", "len", "(", "self", ".", "_title_li...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/curses_ui.py#L908-L922
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/graph_editor/transform.py
python
keep_same_tensor_if_possible_handler
(info, t)
Transform a tensor into itself (identity) if possible. This handler transform a tensor into itself if the source and destination graph are the same. Otherwise it will create a placeholder. This handler is typically used to transform a hidden input tensors. Args: info: Transform._Info instance. t: tens...
Transform a tensor into itself (identity) if possible.
[ "Transform", "a", "tensor", "into", "itself", "(", "identity", ")", "if", "possible", "." ]
def keep_same_tensor_if_possible_handler(info, t): """Transform a tensor into itself (identity) if possible. This handler transform a tensor into itself if the source and destination graph are the same. Otherwise it will create a placeholder. This handler is typically used to transform a hidden input tensors. ...
[ "def", "keep_same_tensor_if_possible_handler", "(", "info", ",", "t", ")", ":", "if", "info", ".", "graph", "is", "info", ".", "graph_", ":", "return", "t", "else", ":", "return", "transform_tensor_into_placeholder_handler", "(", "info", ",", "t", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/graph_editor/transform.py#L51-L67
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py
python
Gamma.validate_args
(self)
return self._validate_args
Boolean describing behavior on invalid input.
Boolean describing behavior on invalid input.
[ "Boolean", "describing", "behavior", "on", "invalid", "input", "." ]
def validate_args(self): """Boolean describing behavior on invalid input.""" return self._validate_args
[ "def", "validate_args", "(", "self", ")", ":", "return", "self", ".", "_validate_args" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/tensorflow/contrib/distributions/python/ops/gamma.py#L114-L116
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/directtools/__init__.py
python
defaultrcparams
()
return params
Return a dictionary of directtools default matplotlib rc parameters. :returns: a :class:`dict` of default :mod:`matplotlib` rc parameters needed by :mod:`directtools`
Return a dictionary of directtools default matplotlib rc parameters.
[ "Return", "a", "dictionary", "of", "directtools", "default", "matplotlib", "rc", "parameters", "." ]
def defaultrcparams(): """Return a dictionary of directtools default matplotlib rc parameters. :returns: a :class:`dict` of default :mod:`matplotlib` rc parameters needed by :mod:`directtools` """ params = { 'legend.numpoints': 1 } return params
[ "def", "defaultrcparams", "(", ")", ":", "params", "=", "{", "'legend.numpoints'", ":", "1", "}", "return", "params" ]
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/directtools/__init__.py#L392-L400
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-mac/aetypes.py
python
nice
(s)
nice' representation of an object
nice' representation of an object
[ "nice", "representation", "of", "an", "object" ]
def nice(s): """'nice' representation of an object""" if type(s) is StringType: return repr(s) else: return str(s)
[ "def", "nice", "(", "s", ")", ":", "if", "type", "(", "s", ")", "is", "StringType", ":", "return", "repr", "(", "s", ")", "else", ":", "return", "str", "(", "s", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-mac/aetypes.py#L19-L22
balint256/gr-baz
937834ce3520b730277328d8e0cdebb3f2b1aafc
apps/am_fft.py
python
pick_subdevice
(u)
return (0, 0)
The user didn't specify a subdevice on the command line. If there's a daughterboard on A, select A. If there's a daughterboard on B, select B. Otherwise, select A.
The user didn't specify a subdevice on the command line. If there's a daughterboard on A, select A. If there's a daughterboard on B, select B. Otherwise, select A.
[ "The", "user", "didn", "t", "specify", "a", "subdevice", "on", "the", "command", "line", ".", "If", "there", "s", "a", "daughterboard", "on", "A", "select", "A", ".", "If", "there", "s", "a", "daughterboard", "on", "B", "select", "B", ".", "Otherwise",...
def pick_subdevice(u): """ The user didn't specify a subdevice on the command line. If there's a daughterboard on A, select A. If there's a daughterboard on B, select B. Otherwise, select A. """ if u.db(0, 0).dbid() >= 0: # dbid is < 0 if there's no d'board or a problem return ...
[ "def", "pick_subdevice", "(", "u", ")", ":", "if", "u", ".", "db", "(", "0", ",", "0", ")", ".", "dbid", "(", ")", ">=", "0", ":", "# dbid is < 0 if there's no d'board or a problem", "return", "(", "0", ",", "0", ")", "if", "u", ".", "db", "(", "1"...
https://github.com/balint256/gr-baz/blob/937834ce3520b730277328d8e0cdebb3f2b1aafc/apps/am_fft.py#L35-L46
cms-sw/cmssw
fd9de012d503d3405420bcbeec0ec879baa57cf2
PhysicsTools/PatAlgos/python/tools/ConfigToolBase.py
python
ConfigToolBase.addParameter
(self,dict,parname, parvalue, description,Type=None, allowedValues=None, acceptNoneValue=False)
Add a parameter with its label, value, description and type to self._parameters
Add a parameter with its label, value, description and type to self._parameters
[ "Add", "a", "parameter", "with", "its", "label", "value", "description", "and", "type", "to", "self", ".", "_parameters" ]
def addParameter(self,dict,parname, parvalue, description,Type=None, allowedValues=None, acceptNoneValue=False): """ Add a parameter with its label, value, description and type to self._parameters """ par=parameter() par.name=parname par.value=parvalue par.description=des...
[ "def", "addParameter", "(", "self", ",", "dict", ",", "parname", ",", "parvalue", ",", "description", ",", "Type", "=", "None", ",", "allowedValues", "=", "None", ",", "acceptNoneValue", "=", "False", ")", ":", "par", "=", "parameter", "(", ")", "par", ...
https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/PhysicsTools/PatAlgos/python/tools/ConfigToolBase.py#L102-L114
mongodb/mongo
d8ff665343ad29cf286ee2cf4a1960d29371937b
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/sunf90.py
python
generate
(env)
Add Builders and construction variables for sun f90 compiler to an Environment.
Add Builders and construction variables for sun f90 compiler to an Environment.
[ "Add", "Builders", "and", "construction", "variables", "for", "sun", "f90", "compiler", "to", "an", "Environment", "." ]
def generate(env): """Add Builders and construction variables for sun f90 compiler to an Environment.""" add_all_to_env(env) fcomp = env.Detect(compilers) or 'f90' env['FORTRAN'] = fcomp env['F90'] = fcomp env['SHFORTRAN'] = '$FORTRAN' env['SHF90'] = '$F90' env['SHFORT...
[ "def", "generate", "(", "env", ")", ":", "add_all_to_env", "(", "env", ")", "fcomp", "=", "env", ".", "Detect", "(", "compilers", ")", "or", "'f90'", "env", "[", "'FORTRAN'", "]", "=", "fcomp", "env", "[", "'F90'", "]", "=", "fcomp", "env", "[", "'...
https://github.com/mongodb/mongo/blob/d8ff665343ad29cf286ee2cf4a1960d29371937b/src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/sunf90.py#L42-L55
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/mantid/simpleapi.py
python
extract_progress_kwargs
(kwargs)
return start, end, kwargs
Returns tuple(startProgress, endProgress, kwargs) with the special keywords removed from kwargs. If the progress keywords are not specified, None will be returned in their place.
Returns tuple(startProgress, endProgress, kwargs) with the special keywords removed from kwargs. If the progress keywords are not specified, None will be returned in their place.
[ "Returns", "tuple", "(", "startProgress", "endProgress", "kwargs", ")", "with", "the", "special", "keywords", "removed", "from", "kwargs", ".", "If", "the", "progress", "keywords", "are", "not", "specified", "None", "will", "be", "returned", "in", "their", "pl...
def extract_progress_kwargs(kwargs): """ Returns tuple(startProgress, endProgress, kwargs) with the special keywords removed from kwargs. If the progress keywords are not specified, None will be returned in their place. """ start = kwargs.pop('startProgress', None) end = kwargs.pop('endProgr...
[ "def", "extract_progress_kwargs", "(", "kwargs", ")", ":", "start", "=", "kwargs", ".", "pop", "(", "'startProgress'", ",", "None", ")", "end", "=", "kwargs", ".", "pop", "(", "'endProgress'", ",", "None", ")", "return", "start", ",", "end", ",", "kwargs...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/mantid/simpleapi.py#L81-L89
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/xml/sax/xmlreader.py
python
InputSource.getByteStream
(self)
return self.__bytefile
Get the byte stream for this input source. The getEncoding method will return the character encoding for this byte stream, or None if unknown.
Get the byte stream for this input source.
[ "Get", "the", "byte", "stream", "for", "this", "input", "source", "." ]
def getByteStream(self): """Get the byte stream for this input source. The getEncoding method will return the character encoding for this byte stream, or None if unknown.""" return self.__bytefile
[ "def", "getByteStream", "(", "self", ")", ":", "return", "self", ".", "__bytefile" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/xml/sax/xmlreader.py#L253-L258
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ebmlib/fileutil.py
python
CopyFile
(orig, dest)
Copy the given file to the destination @param orig: file to copy (full path) @param dest: where to copy to
Copy the given file to the destination @param orig: file to copy (full path) @param dest: where to copy to
[ "Copy", "the", "given", "file", "to", "the", "destination", "@param", "orig", ":", "file", "to", "copy", "(", "full", "path", ")", "@param", "dest", ":", "where", "to", "copy", "to" ]
def CopyFile(orig, dest): """Copy the given file to the destination @param orig: file to copy (full path) @param dest: where to copy to """ raise NotImplementedError
[ "def", "CopyFile", "(", "orig", ",", "dest", ")", ":", "raise", "NotImplementedError" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ebmlib/fileutil.py#L99-L105
i42output/neoGFX
529857e006466271f9775e1a77882c3919e1c3e1
3rdparty/harfbuzz/harfbuzz-3.2.0/src/gen-tag-table.py
python
OpenTypeRegistryParser.inherit_from_macrolanguages
(self)
Copy mappings from macrolanguages to individual languages. If a BCP 47 tag for an individual mapping has no OpenType mapping but its macrolanguage does, the mapping is copied to the individual language. For example, als (Tosk Albanian) has no explicit mapping, so it inherits from sq (Albanian) the mapping to...
Copy mappings from macrolanguages to individual languages.
[ "Copy", "mappings", "from", "macrolanguages", "to", "individual", "languages", "." ]
def inherit_from_macrolanguages (self): """Copy mappings from macrolanguages to individual languages. If a BCP 47 tag for an individual mapping has no OpenType mapping but its macrolanguage does, the mapping is copied to the individual language. For example, als (Tosk Albanian) has no explicit mapping, so it...
[ "def", "inherit_from_macrolanguages", "(", "self", ")", ":", "global", "bcp_47", "original_ot_from_bcp_47", "=", "dict", "(", "self", ".", "from_bcp_47", ")", "for", "macrolanguage", ",", "languages", "in", "dict", "(", "bcp_47", ".", "macrolanguages", ")", ".",...
https://github.com/i42output/neoGFX/blob/529857e006466271f9775e1a77882c3919e1c3e1/3rdparty/harfbuzz/harfbuzz-3.2.0/src/gen-tag-table.py#L456-L494
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/aui.py
python
AuiMDIChildFrame.IsIconized
(*args, **kwargs)
return _aui.AuiMDIChildFrame_IsIconized(*args, **kwargs)
IsIconized(self) -> bool
IsIconized(self) -> bool
[ "IsIconized", "(", "self", ")", "-", ">", "bool" ]
def IsIconized(*args, **kwargs): """IsIconized(self) -> bool""" return _aui.AuiMDIChildFrame_IsIconized(*args, **kwargs)
[ "def", "IsIconized", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiMDIChildFrame_IsIconized", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/aui.py#L1578-L1580
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2.py
python
RequestHandler.handle_exception
(self, exception, debug)
Called if this handler throws an exception during execution. The default behavior is to re-raise the exception to be handled by :meth:`WSGIApplication.handle_exception`. :param exception: The exception that was thrown. :param debug_mode: True if the web applicat...
Called if this handler throws an exception during execution.
[ "Called", "if", "this", "handler", "throws", "an", "exception", "during", "execution", "." ]
def handle_exception(self, exception, debug): """Called if this handler throws an exception during execution. The default behavior is to re-raise the exception to be handled by :meth:`WSGIApplication.handle_exception`. :param exception: The exception that was thrown. ...
[ "def", "handle_exception", "(", "self", ",", "exception", ",", "debug", ")", ":", "raise" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2.py#L629-L640
tiny-dnn/tiny-dnn
c0f576f5cb7b35893f62127cb7aec18f77a3bcc5
third_party/cpplint.py
python
CheckForHeaderGuard
(filename, clean_lines, error)
Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance containing the file. error: The function to call with a...
Checks that the file contains a header guard.
[ "Checks", "that", "the", "file", "contains", "a", "header", "guard", "." ]
def CheckForHeaderGuard(filename, clean_lines, error): """Checks that the file contains a header guard. Logs an error if no #ifndef header guard is present. For other headers, checks that the full pathname is used. Args: filename: The name of the C++ header file. clean_lines: A CleansedLines instance...
[ "def", "CheckForHeaderGuard", "(", "filename", ",", "clean_lines", ",", "error", ")", ":", "# Don't check for header guards if there are error suppression", "# comments somewhere in this file.", "#", "# Because this is silencing a warning for a nonexistent line, we", "# only support the ...
https://github.com/tiny-dnn/tiny-dnn/blob/c0f576f5cb7b35893f62127cb7aec18f77a3bcc5/third_party/cpplint.py#L1986-L2086
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ctypes/macholib/dylib.py
python
dylib_info
(filename)
return is_dylib.groupdict()
A dylib name can take one of the following four forms: Location/Name.SomeVersion_Suffix.dylib Location/Name.SomeVersion.dylib Location/Name_Suffix.dylib Location/Name.dylib returns None if not found or a mapping equivalent to: dict( location='Location', ...
A dylib name can take one of the following four forms: Location/Name.SomeVersion_Suffix.dylib Location/Name.SomeVersion.dylib Location/Name_Suffix.dylib Location/Name.dylib
[ "A", "dylib", "name", "can", "take", "one", "of", "the", "following", "four", "forms", ":", "Location", "/", "Name", ".", "SomeVersion_Suffix", ".", "dylib", "Location", "/", "Name", ".", "SomeVersion", ".", "dylib", "Location", "/", "Name_Suffix", ".", "d...
def dylib_info(filename): """ A dylib name can take one of the following four forms: Location/Name.SomeVersion_Suffix.dylib Location/Name.SomeVersion.dylib Location/Name_Suffix.dylib Location/Name.dylib returns None if not found or a mapping equivalent to: dict( ...
[ "def", "dylib_info", "(", "filename", ")", ":", "is_dylib", "=", "DYLIB_RE", ".", "match", "(", "filename", ")", "if", "not", "is_dylib", ":", "return", "None", "return", "is_dylib", ".", "groupdict", "(", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/ctypes/macholib/dylib.py#L22-L45
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/combo.py
python
ComboCtrl.SetMargins
(*args)
return _combo.ComboCtrl_SetMargins(*args)
SetMargins(self, Point pt) -> bool SetMargins(self, int left, int top=-1) -> bool
SetMargins(self, Point pt) -> bool SetMargins(self, int left, int top=-1) -> bool
[ "SetMargins", "(", "self", "Point", "pt", ")", "-", ">", "bool", "SetMargins", "(", "self", "int", "left", "int", "top", "=", "-", "1", ")", "-", ">", "bool" ]
def SetMargins(*args): """ SetMargins(self, Point pt) -> bool SetMargins(self, int left, int top=-1) -> bool """ return _combo.ComboCtrl_SetMargins(*args)
[ "def", "SetMargins", "(", "*", "args", ")", ":", "return", "_combo", ".", "ComboCtrl_SetMargins", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/combo.py#L209-L214
espressomd/espresso
7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a
src/python/espressomd/checkpointing.py
python
Checkpoint.register_signal
(self, signum=None)
Register a signal that will trigger the signal handler. Parameters ---------- signum : :obj:`int` Signal to be registered.
Register a signal that will trigger the signal handler.
[ "Register", "a", "signal", "that", "will", "trigger", "the", "signal", "handler", "." ]
def register_signal(self, signum=None): """Register a signal that will trigger the signal handler. Parameters ---------- signum : :obj:`int` Signal to be registered. """ if not is_valid_type(signum, int): raise ValueError("Signal must be an integ...
[ "def", "register_signal", "(", "self", ",", "signum", "=", "None", ")", ":", "if", "not", "is_valid_type", "(", "signum", ",", "int", ")", ":", "raise", "ValueError", "(", "\"Signal must be an integer number.\"", ")", "if", "signum", "in", "self", ".", "chec...
https://github.com/espressomd/espresso/blob/7e29f9052e710fe1ebf0f5d2a8076b32921fbc6a/src/python/espressomd/checkpointing.py#L279-L297
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
samples/pySketch/pySketch.py
python
PolygonDrawingObject.drawHandles
(self, dc)
Draw selection handles for this DrawingObject
Draw selection handles for this DrawingObject
[ "Draw", "selection", "handles", "for", "this", "DrawingObject" ]
def drawHandles(self, dc): """Draw selection handles for this DrawingObject""" dc.SetPen(wx.BLACK_PEN) dc.SetBrush(wx.BLACK_BRUSH) x,y = self.position # Draw selection handles at the start and end points. for p in self.points: self._drawSelHandle(dc, x + p[0...
[ "def", "drawHandles", "(", "self", ",", "dc", ")", ":", "dc", ".", "SetPen", "(", "wx", ".", "BLACK_PEN", ")", "dc", ".", "SetBrush", "(", "wx", ".", "BLACK_BRUSH", ")", "x", ",", "y", "=", "self", ".", "position", "# Draw selection handles at the start ...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/samples/pySketch/pySketch.py#L2730-L2739
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/s3/transfer.py
python
TransferConfig.__init__
(self, multipart_threshold=8 * MB, max_concurrency=10, multipart_chunksize=8 * MB, num_download_attempts=5, max_io_queue=100, io_chunksize=256 * KB, use_threads=True)
Configuration object for managed S3 transfers :param multipart_threshold: The transfer size threshold for which multipart uploads, downloads, and copies will automatically be triggered. :param max_concurrency: The maximum number of threads that will be making reques...
Configuration object for managed S3 transfers
[ "Configuration", "object", "for", "managed", "S3", "transfers" ]
def __init__(self, multipart_threshold=8 * MB, max_concurrency=10, multipart_chunksize=8 * MB, num_download_attempts=5, max_io_queue=100, io_chunksize=256 * KB, use_threads=True): """Configurat...
[ "def", "__init__", "(", "self", ",", "multipart_threshold", "=", "8", "*", "MB", ",", "max_concurrency", "=", "10", ",", "multipart_chunksize", "=", "8", "*", "MB", ",", "num_download_attempts", "=", "5", ",", "max_io_queue", "=", "100", ",", "io_chunksize",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/boto3/s3/transfer.py#L169-L226
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/compiler.py
python
compile_internal
(typingctx, targetctx, library, func, args, return_type, flags, locals)
return pipeline.compile_extra(func)
For internal use only.
For internal use only.
[ "For", "internal", "use", "only", "." ]
def compile_internal(typingctx, targetctx, library, func, args, return_type, flags, locals): """ For internal use only. """ pipeline = Compiler(typingctx, targetctx, library, args, return_type, flags, locals) return pipeline.compile_extra(func)
[ "def", "compile_internal", "(", "typingctx", ",", "targetctx", ",", "library", ",", "func", ",", "args", ",", "return_type", ",", "flags", ",", "locals", ")", ":", "pipeline", "=", "Compiler", "(", "typingctx", ",", "targetctx", ",", "library", ",", "args"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/compiler.py#L618-L625
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/quantize.py
python
quantize_model
(to_quantize)
return quantize_apply(annotated_model)
Quantize a `tf.keras` model with the default quantization implementation. Quantization constructs a model which emulates quantization during training. This allows the model to learn parameters robust to quantization loss, and also model the accuracy of a quantized model. For more information, see https://ww...
Quantize a `tf.keras` model with the default quantization implementation.
[ "Quantize", "a", "tf", ".", "keras", "model", "with", "the", "default", "quantization", "implementation", "." ]
def quantize_model(to_quantize): """Quantize a `tf.keras` model with the default quantization implementation. Quantization constructs a model which emulates quantization during training. This allows the model to learn parameters robust to quantization loss, and also model the accuracy of a quantized model. ...
[ "def", "quantize_model", "(", "to_quantize", ")", ":", "if", "to_quantize", "is", "None", ":", "raise", "ValueError", "(", "'`to_quantize` cannot be None'", ")", "if", "not", "isinstance", "(", "to_quantize", ",", "keras", ".", "Model", ")", ":", "raise", "Val...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/quantize.py#L80-L138
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_gdi.py
python
GraphicsPath.AddCircle
(*args, **kwargs)
return _gdi_.GraphicsPath_AddCircle(*args, **kwargs)
AddCircle(self, Double x, Double y, Double r) Appends a circle around (x,y) with radius r as a new closed subpath.
AddCircle(self, Double x, Double y, Double r)
[ "AddCircle", "(", "self", "Double", "x", "Double", "y", "Double", "r", ")" ]
def AddCircle(*args, **kwargs): """ AddCircle(self, Double x, Double y, Double r) Appends a circle around (x,y) with radius r as a new closed subpath. """ return _gdi_.GraphicsPath_AddCircle(*args, **kwargs)
[ "def", "AddCircle", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "GraphicsPath_AddCircle", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_gdi.py#L5957-L5963
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/protobuf/py2/google/protobuf/text_format.py
python
Tokenizer.TryConsume
(self, token)
return False
Tries to consume a given piece of text. Args: token: Text to consume. Returns: True iff the text was consumed.
Tries to consume a given piece of text.
[ "Tries", "to", "consume", "a", "given", "piece", "of", "text", "." ]
def TryConsume(self, token): """Tries to consume a given piece of text. Args: token: Text to consume. Returns: True iff the text was consumed. """ if self.token == token: self.NextToken() return True return False
[ "def", "TryConsume", "(", "self", ",", "token", ")", ":", "if", "self", ".", "token", "==", "token", ":", "self", ".", "NextToken", "(", ")", "return", "True", "return", "False" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/protobuf/py2/google/protobuf/text_format.py#L1303-L1315
bingwin/MicroChat
81d9a71a212c1cbca5bba497ec42659a7d25dccf
mars/lint/cpplint.py
python
_BlockInfo.CheckEnd
(self, filename, clean_lines, linenum, error)
Run checks that applies to text after the closing brace. This is mostly used for checking end of namespace comments. 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...
Run checks that applies to text after the closing brace.
[ "Run", "checks", "that", "applies", "to", "text", "after", "the", "closing", "brace", "." ]
def CheckEnd(self, filename, clean_lines, linenum, error): """Run checks that applies to text after the closing brace. This is mostly used for checking end of namespace comments. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. line...
[ "def", "CheckEnd", "(", "self", ",", "filename", ",", "clean_lines", ",", "linenum", ",", "error", ")", ":", "pass" ]
https://github.com/bingwin/MicroChat/blob/81d9a71a212c1cbca5bba497ec42659a7d25dccf/mars/lint/cpplint.py#L2026-L2037
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PropertyGrid.IsEditorsValueModified
(*args, **kwargs)
return _propgrid.PropertyGrid_IsEditorsValueModified(*args, **kwargs)
IsEditorsValueModified(self) -> bool
IsEditorsValueModified(self) -> bool
[ "IsEditorsValueModified", "(", "self", ")", "-", ">", "bool" ]
def IsEditorsValueModified(*args, **kwargs): """IsEditorsValueModified(self) -> bool""" return _propgrid.PropertyGrid_IsEditorsValueModified(*args, **kwargs)
[ "def", "IsEditorsValueModified", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PropertyGrid_IsEditorsValueModified", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L2158-L2160
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/src/ed_style.py
python
StyleItem.GetAsList
(self)
return retval
Returns a list of attr:value strings this style item. @return: list attribute values usable for building stc or ess values
Returns a list of attr:value strings this style item. @return: list attribute values usable for building stc or ess values
[ "Returns", "a", "list", "of", "attr", ":", "value", "strings", "this", "style", "item", ".", "@return", ":", "list", "attribute", "values", "usable", "for", "building", "stc", "or", "ess", "values" ]
def GetAsList(self): """Returns a list of attr:value strings this style item. @return: list attribute values usable for building stc or ess values """ retval = list() for attr in ('fore', 'back', 'face', 'size'): val = getattr(self, attr, None) if...
[ "def", "GetAsList", "(", "self", ")", ":", "retval", "=", "list", "(", ")", "for", "attr", "in", "(", "'fore'", ",", "'back'", ",", "'face'", ",", "'size'", ")", ":", "val", "=", "getattr", "(", "self", ",", "attr", ",", "None", ")", "if", "val",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/src/ed_style.py#L134-L148
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
tools/site_compare/command_line.py
python
DoHelpCommand
(command)
Executed when the command is 'help'.
Executed when the command is 'help'.
[ "Executed", "when", "the", "command", "is", "help", "." ]
def DoHelpCommand(command): """Executed when the command is 'help'.""" out = command.cmdline.out width = command['--width'] if 'command' not in command: out.write(command.GetUsageString()) out.write("\n\n") indent = 5 gutter = 2 command_width = ( max([len(cmd.names[0]) for cmd in co...
[ "def", "DoHelpCommand", "(", "command", ")", ":", "out", "=", "command", ".", "cmdline", ".", "out", "width", "=", "command", "[", "'--width'", "]", "if", "'command'", "not", "in", "command", ":", "out", ".", "write", "(", "command", ".", "GetUsageString...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/site_compare/command_line.py#L622-L661
psi4/psi4
be533f7f426b6ccc263904e55122899b16663395
psi4/driver/qcdb/libmintsmolecule.py
python
LibmintsMolecule.set_full_geometry
(self, geom)
Sets the full geometry (dummies included), given a N X 3 array of coordinates *geom* in Bohr. >>> H2OH2O.set_full geometry([[1,2,3],[4,5,6],[7,8,9],[0,0,0],[-1,-2,-3],[-4,-5,-6],[-7,-8,-9]])
Sets the full geometry (dummies included), given a N X 3 array of coordinates *geom* in Bohr.
[ "Sets", "the", "full", "geometry", "(", "dummies", "included", ")", "given", "a", "N", "X", "3", "array", "of", "coordinates", "*", "geom", "*", "in", "Bohr", "." ]
def set_full_geometry(self, geom): """Sets the full geometry (dummies included), given a N X 3 array of coordinates *geom* in Bohr. >>> H2OH2O.set_full geometry([[1,2,3],[4,5,6],[7,8,9],[0,0,0],[-1,-2,-3],[-4,-5,-6],[-7,-8,-9]]) """ self.lock_frame = False for at in range(self....
[ "def", "set_full_geometry", "(", "self", ",", "geom", ")", ":", "self", ".", "lock_frame", "=", "False", "for", "at", "in", "range", "(", "self", ".", "nallatom", "(", ")", ")", ":", "self", ".", "full_atoms", "[", "at", "]", ".", "set_coordinates", ...
https://github.com/psi4/psi4/blob/be533f7f426b6ccc263904e55122899b16663395/psi4/driver/qcdb/libmintsmolecule.py#L1275-L1285
bumptop/BumpTop
466d23597a07ae738f4265262fa01087fc6e257c
trunk/win/Source/bin/jinja2/environment.py
python
Environment._tokenize
(self, source, name, filename=None, state=None)
return stream
Called by the parser to do the preprocessing and filtering for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`.
Called by the parser to do the preprocessing and filtering for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`.
[ "Called", "by", "the", "parser", "to", "do", "the", "preprocessing", "and", "filtering", "for", "all", "the", "extensions", ".", "Returns", "a", ":", "class", ":", "~jinja2", ".", "lexer", ".", "TokenStream", "." ]
def _tokenize(self, source, name, filename=None, state=None): """Called by the parser to do the preprocessing and filtering for all the extensions. Returns a :class:`~jinja2.lexer.TokenStream`. """ source = self.preprocess(source, name, filename) stream = self.lexer.tokenize(sou...
[ "def", "_tokenize", "(", "self", ",", "source", ",", "name", ",", "filename", "=", "None", ",", "state", "=", "None", ")", ":", "source", "=", "self", ".", "preprocess", "(", "source", ",", "name", ",", "filename", ")", "stream", "=", "self", ".", ...
https://github.com/bumptop/BumpTop/blob/466d23597a07ae738f4265262fa01087fc6e257c/trunk/win/Source/bin/jinja2/environment.py#L405-L415
eventql/eventql
7ca0dbb2e683b525620ea30dc40540a22d5eb227
deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py
python
ConstBitStream._getbitpos
(self)
return self._pos
Return the current position in the stream in bits.
Return the current position in the stream in bits.
[ "Return", "the", "current", "position", "in", "the", "stream", "in", "bits", "." ]
def _getbitpos(self): """Return the current position in the stream in bits.""" return self._pos
[ "def", "_getbitpos", "(", "self", ")", ":", "return", "self", ".", "_pos" ]
https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/python/bitstring/bitstring.py#L3806-L3808
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/ConfigSet.py
python
ConfigSet.__delitem__
(self, key)
Dictionary interface: get value from key
Dictionary interface: get value from key
[ "Dictionary", "interface", ":", "get", "value", "from", "key" ]
def __delitem__(self, key): """ Dictionary interface: get value from key """ self[key] = []
[ "def", "__delitem__", "(", "self", ",", "key", ")", ":", "self", "[", "key", "]", "=", "[", "]" ]
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/ConfigSet.py#L89-L93
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/math/so3.py
python
axis_angle
(R)
return (vectorops.unit(m),vectorops.norm(m))
Returns the (axis,angle) pair representing R
Returns the (axis,angle) pair representing R
[ "Returns", "the", "(", "axis", "angle", ")", "pair", "representing", "R" ]
def axis_angle(R): """Returns the (axis,angle) pair representing R""" m = rotation_vector(R) return (vectorops.unit(m),vectorops.norm(m))
[ "def", "axis_angle", "(", "R", ")", ":", "m", "=", "rotation_vector", "(", "R", ")", "return", "(", "vectorops", ".", "unit", "(", "m", ")", ",", "vectorops", ".", "norm", "(", "m", ")", ")" ]
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/so3.py#L186-L189
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/keras/backend.py
python
update_add
(x, increment)
return state_ops.assign_add(x, increment)
Update the value of `x` by adding `increment`. Args: x: A Variable. increment: A tensor of same shape as `x`. Returns: The variable `x` updated.
Update the value of `x` by adding `increment`.
[ "Update", "the", "value", "of", "x", "by", "adding", "increment", "." ]
def update_add(x, increment): """Update the value of `x` by adding `increment`. Args: x: A Variable. increment: A tensor of same shape as `x`. Returns: The variable `x` updated. """ return state_ops.assign_add(x, increment)
[ "def", "update_add", "(", "x", ",", "increment", ")", ":", "return", "state_ops", ".", "assign_add", "(", "x", ",", "increment", ")" ]
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/backend.py#L1873-L1883
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/egg_info.py
python
write_file
(filename, contents)
Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.
Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it.
[ "Create", "a", "file", "with", "the", "specified", "name", "and", "write", "contents", "(", "a", "sequence", "of", "strings", "without", "line", "terminators", ")", "to", "it", "." ]
def write_file(filename, contents): """Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. """ contents = "\n".join(contents) # assuming the contents has been vetted for utf-8 encoding contents = contents.encode("utf-8") with o...
[ "def", "write_file", "(", "filename", ",", "contents", ")", ":", "contents", "=", "\"\\n\"", ".", "join", "(", "contents", ")", "# assuming the contents has been vetted for utf-8 encoding", "contents", "=", "contents", ".", "encode", "(", "\"utf-8\"", ")", "with", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/site-packages/setuptools/command/egg_info.py#L599-L609
macchina-io/macchina.io
ef24ba0e18379c3dd48fb84e6dbf991101cb8db0
platform/JS/V8/v8/third_party/jinja2/compiler.py
python
CodeGenerator.indent
(self)
Indent by one.
Indent by one.
[ "Indent", "by", "one", "." ]
def indent(self): """Indent by one.""" self._indentation += 1
[ "def", "indent", "(", "self", ")", ":", "self", ".", "_indentation", "+=", "1" ]
https://github.com/macchina-io/macchina.io/blob/ef24ba0e18379c3dd48fb84e6dbf991101cb8db0/platform/JS/V8/v8/third_party/jinja2/compiler.py#L455-L457
openvinotoolkit/openvino
dedcbeafa8b84cccdc55ca64b8da516682b381c7
src/bindings/python/src/compatibility/ngraph/opset3/ops.py
python
topk
( data: NodeInput, k: NodeInput, axis: int, mode: str, sort: str, index_element_type: str = "i32", name: Optional[str] = None, )
return _get_node_factory_opset3().create( "TopK", as_nodes(data, k), {"axis": axis, "mode": mode, "sort": sort, "index_element_type": index_element_type}, )
Return a node which performs TopK. :param data: Input data. :param k: K. :param axis: TopK Axis. :param mode: Compute TopK largest ('max') or smallest ('min') :param sort: Order of output elements (sort by: 'none', 'index' or 'value') :param index_element_type: Type of output tensor with indice...
Return a node which performs TopK.
[ "Return", "a", "node", "which", "performs", "TopK", "." ]
def topk( data: NodeInput, k: NodeInput, axis: int, mode: str, sort: str, index_element_type: str = "i32", name: Optional[str] = None, ) -> Node: """Return a node which performs TopK. :param data: Input data. :param k: K. :param axis: TopK Axis. :param mode: Compute TopK...
[ "def", "topk", "(", "data", ":", "NodeInput", ",", "k", ":", "NodeInput", ",", "axis", ":", "int", ",", "mode", ":", "str", ",", "sort", ":", "str", ",", "index_element_type", ":", "str", "=", "\"i32\"", ",", "name", ":", "Optional", "[", "str", "]...
https://github.com/openvinotoolkit/openvino/blob/dedcbeafa8b84cccdc55ca64b8da516682b381c7/src/bindings/python/src/compatibility/ngraph/opset3/ops.py#L611-L634
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/interpolate/ndgriddata.py
python
NearestNDInterpolator.__call__
(self, *args)
return self.values[i]
Evaluate interpolator at given points. Parameters ---------- xi : ndarray of float, shape (..., ndim) Points where to interpolate data at.
Evaluate interpolator at given points.
[ "Evaluate", "interpolator", "at", "given", "points", "." ]
def __call__(self, *args): """ Evaluate interpolator at given points. Parameters ---------- xi : ndarray of float, shape (..., ndim) Points where to interpolate data at. """ xi = _ndim_coords_from_arrays(args, ndim=self.points.shape[1]) xi = ...
[ "def", "__call__", "(", "self", ",", "*", "args", ")", ":", "xi", "=", "_ndim_coords_from_arrays", "(", "args", ",", "ndim", "=", "self", ".", "points", ".", "shape", "[", "1", "]", ")", "xi", "=", "self", ".", "_check_call_shape", "(", "xi", ")", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/interpolate/ndgriddata.py#L67-L81
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/generate_playthrough.py
python
playthrough
(game_string, action_sequence, alsologtostdout=False, observation_params_string=None, seed: Optional[int] = None)
return "\n".join(lines) + "\n"
Returns a playthrough of the specified game as a single text. Actions are selected uniformly at random, including chance actions. Args: game_string: string, e.g. 'markov_soccer', with possible optional params, e.g. 'go(komi=4.5,board_size=19)'. action_sequence: A (possibly partial) list of action ch...
Returns a playthrough of the specified game as a single text.
[ "Returns", "a", "playthrough", "of", "the", "specified", "game", "as", "a", "single", "text", "." ]
def playthrough(game_string, action_sequence, alsologtostdout=False, observation_params_string=None, seed: Optional[int] = None): """Returns a playthrough of the specified game as a single text. Actions are selected uniformly at random, including chan...
[ "def", "playthrough", "(", "game_string", ",", "action_sequence", ",", "alsologtostdout", "=", "False", ",", "observation_params_string", "=", "None", ",", "seed", ":", "Optional", "[", "int", "]", "=", "None", ")", ":", "lines", "=", "playthrough_lines", "(",...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/generate_playthrough.py#L113-L134
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/build_py.py
python
build_py.build_package_data
(self)
Copy data files into build directory
Copy data files into build directory
[ "Copy", "data", "files", "into", "build", "directory" ]
def build_package_data(self): """Copy data files into build directory""" lastdir = None for package, src_dir, build_dir, filenames in self.data_files: for filename in filenames: target = os.path.join(build_dir, filename) self.mkpath(os.path.dirname(tar...
[ "def", "build_package_data", "(", "self", ")", ":", "lastdir", "=", "None", "for", "package", ",", "src_dir", ",", "build_dir", ",", "filenames", "in", "self", ".", "data_files", ":", "for", "filename", "in", "filenames", ":", "target", "=", "os", ".", "...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/command/build_py.py#L142-L153
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/driver/abstract_variational_driver.py
python
_to_iterable
(maybe_iterable)
return surely_iterable
_to_iterable(maybe_iterable) Ensure the result is iterable. If the input is not iterable, it is wrapped into a tuple.
_to_iterable(maybe_iterable)
[ "_to_iterable", "(", "maybe_iterable", ")" ]
def _to_iterable(maybe_iterable): """ _to_iterable(maybe_iterable) Ensure the result is iterable. If the input is not iterable, it is wrapped into a tuple. """ if hasattr(maybe_iterable, "__iter__"): surely_iterable = maybe_iterable else: surely_iterable = (maybe_iterable,) ...
[ "def", "_to_iterable", "(", "maybe_iterable", ")", ":", "if", "hasattr", "(", "maybe_iterable", ",", "\"__iter__\"", ")", ":", "surely_iterable", "=", "maybe_iterable", "else", ":", "surely_iterable", "=", "(", "maybe_iterable", ",", ")", "return", "surely_iterabl...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/driver/abstract_variational_driver.py#L28-L39
codilime/veles
e65de5a7c268129acffcdb03034efd8d256d025c
python/veles/async_conn/node.py
python
AsyncNode.run_method_raw
(self, method, params)
return self.conn.run_method_raw(self.id, method, params)
Runs a method on the object. Returns an awaitable of the result.
Runs a method on the object. Returns an awaitable of the result.
[ "Runs", "a", "method", "on", "the", "object", ".", "Returns", "an", "awaitable", "of", "the", "result", "." ]
def run_method_raw(self, method, params): """ Runs a method on the object. Returns an awaitable of the result. """ return self.conn.run_method_raw(self.id, method, params)
[ "def", "run_method_raw", "(", "self", ",", "method", ",", "params", ")", ":", "return", "self", ".", "conn", ".", "run_method_raw", "(", "self", ".", "id", ",", "method", ",", "params", ")" ]
https://github.com/codilime/veles/blob/e65de5a7c268129acffcdb03034efd8d256d025c/python/veles/async_conn/node.py#L236-L240
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
Wrapping/Python/paraview/benchmark/logparser.py
python
process_stats_across_ranks
(rank_frame_logs)
return frame_stats
Calculate stats across all ranks for each frame
Calculate stats across all ranks for each frame
[ "Calculate", "stats", "across", "all", "ranks", "for", "each", "frame" ]
def process_stats_across_ranks(rank_frame_logs): '''Calculate stats across all ranks for each frame''' frame_stats = [] for f in range(1, len(rank_frame_logs[0])): rank_logs = [r[f] for r in rank_frame_logs] frame_stats.append(collect_stats(rank_logs, 'Max')) return frame_stats
[ "def", "process_stats_across_ranks", "(", "rank_frame_logs", ")", ":", "frame_stats", "=", "[", "]", "for", "f", "in", "range", "(", "1", ",", "len", "(", "rank_frame_logs", "[", "0", "]", ")", ")", ":", "rank_logs", "=", "[", "r", "[", "f", "]", "fo...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/Wrapping/Python/paraview/benchmark/logparser.py#L266-L272