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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ledger/ledger | 8e79216887cf3c342dfca1ffa52cf4e6389d6de4 | contrib/non-profit-audit-reports/ooolib2/__init__.py | python | Writer.__init__ | (self) | Initialize ooolib Writer instance | Initialize ooolib Writer instance | [
"Initialize",
"ooolib",
"Writer",
"instance"
] | def __init__(self):
"Initialize ooolib Writer instance"
# Default to no debugging
self.debug = False
self.meta = Meta('odt') | [
"def",
"__init__",
"(",
"self",
")",
":",
"# Default to no debugging",
"self",
".",
"debug",
"=",
"False",
"self",
".",
"meta",
"=",
"Meta",
"(",
"'odt'",
")"
] | https://github.com/ledger/ledger/blob/8e79216887cf3c342dfca1ffa52cf4e6389d6de4/contrib/non-profit-audit-reports/ooolib2/__init__.py#L1845-L1849 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/html.py | python | HtmlBookRecord.GetContentsEnd | (*args, **kwargs) | return _html.HtmlBookRecord_GetContentsEnd(*args, **kwargs) | GetContentsEnd(self) -> int | GetContentsEnd(self) -> int | [
"GetContentsEnd",
"(",
"self",
")",
"-",
">",
"int"
] | def GetContentsEnd(*args, **kwargs):
"""GetContentsEnd(self) -> int"""
return _html.HtmlBookRecord_GetContentsEnd(*args, **kwargs) | [
"def",
"GetContentsEnd",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html",
".",
"HtmlBookRecord_GetContentsEnd",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/html.py#L1435-L1437 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/_windows.py | python | PrintPreview.Print | (*args, **kwargs) | return _windows_.PrintPreview_Print(*args, **kwargs) | Print(self, bool interactive) -> bool | Print(self, bool interactive) -> bool | [
"Print",
"(",
"self",
"bool",
"interactive",
")",
"-",
">",
"bool"
] | def Print(*args, **kwargs):
"""Print(self, bool interactive) -> bool"""
return _windows_.PrintPreview_Print(*args, **kwargs) | [
"def",
"Print",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_windows_",
".",
"PrintPreview_Print",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_windows.py#L5650-L5652 | |
LLNL/lbann | 26083e6c86050302ce33148aea70f62e61cacb92 | python/lbann/contrib/lc/systems.py | python | system | () | return _system | Name of system.
Hostname with trailing digits removed. | Name of system. | [
"Name",
"of",
"system",
"."
] | def system():
"""Name of system.
Hostname with trailing digits removed.
"""
return _system | [
"def",
"system",
"(",
")",
":",
"return",
"_system"
] | https://github.com/LLNL/lbann/blob/26083e6c86050302ce33148aea70f62e61cacb92/python/lbann/contrib/lc/systems.py#L37-L43 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py | python | Panedwindow.insert | (self, pos, child, **kw) | Inserts a pane at the specified positions.
pos is either the string end, and integer index, or the name
of a child. If child is already managed by the paned window,
moves it to the specified position. | Inserts a pane at the specified positions. | [
"Inserts",
"a",
"pane",
"at",
"the",
"specified",
"positions",
"."
] | def insert(self, pos, child, **kw):
"""Inserts a pane at the specified positions.
pos is either the string end, and integer index, or the name
of a child. If child is already managed by the paned window,
moves it to the specified position."""
self.tk.call(self._w, "insert", pos,... | [
"def",
"insert",
"(",
"self",
",",
"pos",
",",
"child",
",",
"*",
"*",
"kw",
")",
":",
"self",
".",
"tk",
".",
"call",
"(",
"self",
".",
"_w",
",",
"\"insert\"",
",",
"pos",
",",
"child",
",",
"*",
"(",
"_format_optdict",
"(",
"kw",
")",
")",
... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/tkinter/ttk.py#L962-L968 | ||
RamadhanAmizudin/malware | 2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1 | Fuzzbunch/fuzzbunch/pyreadline/rlmain.py | python | Readline.read_init_file | (self, filename=None) | Parse a readline initialization file. The default filename is the last filename used. | Parse a readline initialization file. The default filename is the last filename used. | [
"Parse",
"a",
"readline",
"initialization",
"file",
".",
"The",
"default",
"filename",
"is",
"the",
"last",
"filename",
"used",
"."
] | def read_init_file(self, filename=None):
'''Parse a readline initialization file. The default filename is the last filename used.'''
log('read_init_file("%s")' % filename) | [
"def",
"read_init_file",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"log",
"(",
"'read_init_file(\"%s\")'",
"%",
"filename",
")"
] | https://github.com/RamadhanAmizudin/malware/blob/2c6c53c8b0d556f5d8078d6ca0fc4448f4697cf1/Fuzzbunch/fuzzbunch/pyreadline/rlmain.py#L150-L152 | ||
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/handlers.py | python | BufferingHandler.close | (self) | Close the handler.
This version just flushes and chains to the parent class' close(). | Close the handler. | [
"Close",
"the",
"handler",
"."
] | def close(self):
"""
Close the handler.
This version just flushes and chains to the parent class' close().
"""
self.flush()
logging.Handler.close(self) | [
"def",
"close",
"(",
"self",
")",
":",
"self",
".",
"flush",
"(",
")",
"logging",
".",
"Handler",
".",
"close",
"(",
"self",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/logging/handlers.py#L1156-L1163 | ||
koth/kcws | 88efbd36a7022de4e6e90f5a1fb880cf87cfae9f | third_party/python/cpplint/cpplint.py | python | CheckCheck | (filename, clean_lines, linenum, error) | Checks the use of CHECK and EXPECT macros.
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. | Checks the use of CHECK and EXPECT macros. | [
"Checks",
"the",
"use",
"of",
"CHECK",
"and",
"EXPECT",
"macros",
"."
] | def CheckCheck(filename, clean_lines, linenum, error):
"""Checks the use of CHECK and EXPECT macros.
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.
... | [
"def",
"CheckCheck",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"# Decide the set of replacement macros that should be suggested",
"lines",
"=",
"clean_lines",
".",
"elided",
"(",
"check_macro",
",",
"start_pos",
")",
"=",
"FindCheckM... | https://github.com/koth/kcws/blob/88efbd36a7022de4e6e90f5a1fb880cf87cfae9f/third_party/python/cpplint/cpplint.py#L4202-L4317 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/stc.py | python | StyledTextCtrl.MarkerGet | (*args, **kwargs) | return _stc.StyledTextCtrl_MarkerGet(*args, **kwargs) | MarkerGet(self, int line) -> int
Get a bit mask of all the markers set on a line. | MarkerGet(self, int line) -> int | [
"MarkerGet",
"(",
"self",
"int",
"line",
")",
"-",
">",
"int"
] | def MarkerGet(*args, **kwargs):
"""
MarkerGet(self, int line) -> int
Get a bit mask of all the markers set on a line.
"""
return _stc.StyledTextCtrl_MarkerGet(*args, **kwargs) | [
"def",
"MarkerGet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_stc",
".",
"StyledTextCtrl_MarkerGet",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/stc.py#L2386-L2392 | |
NERSC/timemory | 431912b360ff50d1a160d7826e2eea04fbd1037f | timemory/plotting/plotting.py | python | timemory_data.__add__ | (self, rhs) | return self | for combining results (typically from different MPI processes) | for combining results (typically from different MPI processes) | [
"for",
"combining",
"results",
"(",
"typically",
"from",
"different",
"MPI",
"processes",
")"
] | def __add__(self, rhs):
"""for combining results (typically from different MPI processes)"""
self.laps += rhs.laps
self.value += rhs.value
self.accum += rhs.accum
self.data += rhs.data
return self | [
"def",
"__add__",
"(",
"self",
",",
"rhs",
")",
":",
"self",
".",
"laps",
"+=",
"rhs",
".",
"laps",
"self",
".",
"value",
"+=",
"rhs",
".",
"value",
"self",
".",
"accum",
"+=",
"rhs",
".",
"accum",
"self",
".",
"data",
"+=",
"rhs",
".",
"data",
... | https://github.com/NERSC/timemory/blob/431912b360ff50d1a160d7826e2eea04fbd1037f/timemory/plotting/plotting.py#L315-L321 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/nn/utils/prune.py | python | is_pruned | (module) | return False | r"""Check whether ``module`` is pruned by looking for
``forward_pre_hooks`` in its modules that inherit from the
:class:`BasePruningMethod`.
Args:
module (nn.Module): object that is either pruned or unpruned
Returns:
binary answer to whether ``module`` is pruned.
Examples:
... | r"""Check whether ``module`` is pruned by looking for
``forward_pre_hooks`` in its modules that inherit from the
:class:`BasePruningMethod`. | [
"r",
"Check",
"whether",
"module",
"is",
"pruned",
"by",
"looking",
"for",
"forward_pre_hooks",
"in",
"its",
"modules",
"that",
"inherit",
"from",
"the",
":",
"class",
":",
"BasePruningMethod",
"."
] | def is_pruned(module):
r"""Check whether ``module`` is pruned by looking for
``forward_pre_hooks`` in its modules that inherit from the
:class:`BasePruningMethod`.
Args:
module (nn.Module): object that is either pruned or unpruned
Returns:
binary answer to whether ``module`` is pru... | [
"def",
"is_pruned",
"(",
"module",
")",
":",
"for",
"_",
",",
"submodule",
"in",
"module",
".",
"named_modules",
"(",
")",
":",
"for",
"_",
",",
"hook",
"in",
"submodule",
".",
"_forward_pre_hooks",
".",
"items",
"(",
")",
":",
"if",
"isinstance",
"(",... | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/nn/utils/prune.py#L1195-L1218 | |
apple/swift-lldb | d74be846ef3e62de946df343e8c234bde93a8912 | scripts/Python/static-binding/lldb.py | python | SBData.CreateDataFromDoubleArray | (endian, addr_byte_size, array) | return _lldb.SBData_CreateDataFromDoubleArray(endian, addr_byte_size, array) | CreateDataFromDoubleArray(lldb::ByteOrder endian, uint32_t addr_byte_size, double * array) -> SBData | CreateDataFromDoubleArray(lldb::ByteOrder endian, uint32_t addr_byte_size, double * array) -> SBData | [
"CreateDataFromDoubleArray",
"(",
"lldb",
"::",
"ByteOrder",
"endian",
"uint32_t",
"addr_byte_size",
"double",
"*",
"array",
")",
"-",
">",
"SBData"
] | def CreateDataFromDoubleArray(endian, addr_byte_size, array):
"""CreateDataFromDoubleArray(lldb::ByteOrder endian, uint32_t addr_byte_size, double * array) -> SBData"""
return _lldb.SBData_CreateDataFromDoubleArray(endian, addr_byte_size, array) | [
"def",
"CreateDataFromDoubleArray",
"(",
"endian",
",",
"addr_byte_size",
",",
"array",
")",
":",
"return",
"_lldb",
".",
"SBData_CreateDataFromDoubleArray",
"(",
"endian",
",",
"addr_byte_size",
",",
"array",
")"
] | https://github.com/apple/swift-lldb/blob/d74be846ef3e62de946df343e8c234bde93a8912/scripts/Python/static-binding/lldb.py#L3457-L3459 | |
RLBot/RLBot | 34332b12cf158b3ef8dbf174ae67c53683368a9d | src/main/python/rlbot/utils/class_importer.py | python | import_agent | (python_file) | return import_class_with_base(python_file, BaseAgent) | Imports the first class that extends BaseAgent.
:param python_file: The absolute path of the bot's main python file
:return: The agent requested or BaseAgent if there are any problems. | Imports the first class that extends BaseAgent. | [
"Imports",
"the",
"first",
"class",
"that",
"extends",
"BaseAgent",
"."
] | def import_agent(python_file) -> ExternalClassWrapper:
"""
Imports the first class that extends BaseAgent.
:param python_file: The absolute path of the bot's main python file
:return: The agent requested or BaseAgent if there are any problems.
"""
return import_class_with_base(python_file, Base... | [
"def",
"import_agent",
"(",
"python_file",
")",
"->",
"ExternalClassWrapper",
":",
"return",
"import_class_with_base",
"(",
"python_file",
",",
"BaseAgent",
")"
] | https://github.com/RLBot/RLBot/blob/34332b12cf158b3ef8dbf174ae67c53683368a9d/src/main/python/rlbot/utils/class_importer.py#L81-L88 | |
bundy-dns/bundy | 3d41934996b82b0cd2fe22dd74d2abc1daba835d | src/lib/python/bundy/config/ccsession.py | python | RPCError.code | (self) | return self.__code | The code as sent over the CC. | The code as sent over the CC. | [
"The",
"code",
"as",
"sent",
"over",
"the",
"CC",
"."
] | def code(self):
"""
The code as sent over the CC.
"""
return self.__code | [
"def",
"code",
"(",
"self",
")",
":",
"return",
"self",
".",
"__code"
] | https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/src/lib/python/bundy/config/ccsession.py#L64-L68 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_carbon/_misc.py | python | StopWatch.Pause | (*args, **kwargs) | return _misc_.StopWatch_Pause(*args, **kwargs) | Pause(self) | Pause(self) | [
"Pause",
"(",
"self",
")"
] | def Pause(*args, **kwargs):
"""Pause(self)"""
return _misc_.StopWatch_Pause(*args, **kwargs) | [
"def",
"Pause",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"StopWatch_Pause",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L887-L889 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib.py | python | proxy_bypass_environment | (host) | return 0 | Test if proxies should not be used for a particular host.
Checks the environment for a variable named no_proxy, which should
be a list of DNS suffixes separated by commas, or '*' for all hosts. | Test if proxies should not be used for a particular host. | [
"Test",
"if",
"proxies",
"should",
"not",
"be",
"used",
"for",
"a",
"particular",
"host",
"."
] | def proxy_bypass_environment(host):
"""Test if proxies should not be used for a particular host.
Checks the environment for a variable named no_proxy, which should
be a list of DNS suffixes separated by commas, or '*' for all hosts.
"""
no_proxy = os.environ.get('no_proxy', '') or os.environ.get('N... | [
"def",
"proxy_bypass_environment",
"(",
"host",
")",
":",
"no_proxy",
"=",
"os",
".",
"environ",
".",
"get",
"(",
"'no_proxy'",
",",
"''",
")",
"or",
"os",
".",
"environ",
".",
"get",
"(",
"'NO_PROXY'",
",",
"''",
")",
"# '*' is special case for always bypas... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/urllib.py#L1371-L1389 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/propgrid.py | python | IntProperty.DoValidation | (*args, **kwargs) | return _propgrid.IntProperty_DoValidation(*args, **kwargs) | DoValidation(PGProperty property, wxLongLong_t value, PGValidationInfo pValidationInfo,
int mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE) -> bool | DoValidation(PGProperty property, wxLongLong_t value, PGValidationInfo pValidationInfo,
int mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE) -> bool | [
"DoValidation",
"(",
"PGProperty",
"property",
"wxLongLong_t",
"value",
"PGValidationInfo",
"pValidationInfo",
"int",
"mode",
"=",
"PG_PROPERTY_VALIDATION_ERROR_MESSAGE",
")",
"-",
">",
"bool"
] | def DoValidation(*args, **kwargs):
"""
DoValidation(PGProperty property, wxLongLong_t value, PGValidationInfo pValidationInfo,
int mode=PG_PROPERTY_VALIDATION_ERROR_MESSAGE) -> bool
"""
return _propgrid.IntProperty_DoValidation(*args, **kwargs) | [
"def",
"DoValidation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"IntProperty_DoValidation",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/propgrid.py#L2912-L2917 | |
benoitsteiner/tensorflow-opencl | cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5 | tensorflow/python/ops/array_ops.py | python | squeeze | (input, axis=None, name=None, squeeze_dims=None) | return gen_array_ops._squeeze(input, axis, name) | Removes dimensions of size 1 from the shape of a tensor.
Given a tensor `input`, this operation returns a tensor of the same type with
all dimensions of size 1 removed. If you don't want to remove all size 1
dimensions, you can remove specific size 1 dimensions by specifying
`axis`.
For example:
```pytho... | Removes dimensions of size 1 from the shape of a tensor. | [
"Removes",
"dimensions",
"of",
"size",
"1",
"from",
"the",
"shape",
"of",
"a",
"tensor",
"."
] | def squeeze(input, axis=None, name=None, squeeze_dims=None):
# pylint: disable=redefined-builtin
"""Removes dimensions of size 1 from the shape of a tensor.
Given a tensor `input`, this operation returns a tensor of the same type with
all dimensions of size 1 removed. If you don't want to remove all size 1
d... | [
"def",
"squeeze",
"(",
"input",
",",
"axis",
"=",
"None",
",",
"name",
"=",
"None",
",",
"squeeze_dims",
"=",
"None",
")",
":",
"# pylint: disable=redefined-builtin",
"if",
"squeeze_dims",
"is",
"not",
"None",
":",
"if",
"axis",
"is",
"not",
"None",
":",
... | https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/ops/array_ops.py#L2377-L2423 | |
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/chigger/observers/TimerObserver.py | python | TimerObserver._callback | (self, obj, event) | The function to be called by the RenderWindow.
Inputs:
obj, event: Required by VTK. | The function to be called by the RenderWindow. | [
"The",
"function",
"to",
"be",
"called",
"by",
"the",
"RenderWindow",
"."
] | def _callback(self, obj, event): #pylint: disable=unused-argument
"""
The function to be called by the RenderWindow.
Inputs:
obj, event: Required by VTK.
"""
if self.isOptionValid('count') and (self._count >= self.getOption('count')):
self._window.getVTKI... | [
"def",
"_callback",
"(",
"self",
",",
"obj",
",",
"event",
")",
":",
"#pylint: disable=unused-argument",
"if",
"self",
".",
"isOptionValid",
"(",
"'count'",
")",
"and",
"(",
"self",
".",
"_count",
">=",
"self",
".",
"getOption",
"(",
"'count'",
")",
")",
... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/observers/TimerObserver.py#L50-L63 | ||
y123456yz/reading-and-annotate-mongodb-3.6 | 93280293672ca7586dc24af18132aa61e4ed7fcf | mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tex.py | python | generate_common | (env) | Add internal Builders and construction variables for LaTeX to an Environment. | Add internal Builders and construction variables for LaTeX to an Environment. | [
"Add",
"internal",
"Builders",
"and",
"construction",
"variables",
"for",
"LaTeX",
"to",
"an",
"Environment",
"."
] | def generate_common(env):
"""Add internal Builders and construction variables for LaTeX to an Environment."""
# Add OSX system paths so TeX tools can be found
# when a list of tools is given the exists() method is not called
generate_darwin(env)
# A generic tex file Action, sufficient for all tex ... | [
"def",
"generate_common",
"(",
"env",
")",
":",
"# Add OSX system paths so TeX tools can be found",
"# when a list of tools is given the exists() method is not called",
"generate_darwin",
"(",
"env",
")",
"# A generic tex file Action, sufficient for all tex files.",
"global",
"TeXAction"... | https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/tex.py#L865-L976 | ||
root-project/root | fcd3583bb14852bf2e8cd2415717cbaac0e75896 | bindings/pyroot/cppyy/cppyy-backend/cling/python/cppyy_backend/_cppyy_generator.py | python | main | (argv=None) | Takes a set of C++ header files and generate a JSON output file describing
the objects found in them. This output is intended to support more
convenient access to a set of cppyy-supported bindings.
Examples:
INC=/usr/include
QT5=$INC/x86_64-linux-gnu/qt5
KF5=$INC/KF5
INCDIR... | Takes a set of C++ header files and generate a JSON output file describing
the objects found in them. This output is intended to support more
convenient access to a set of cppyy-supported bindings. | [
"Takes",
"a",
"set",
"of",
"C",
"++",
"header",
"files",
"and",
"generate",
"a",
"JSON",
"output",
"file",
"describing",
"the",
"objects",
"found",
"in",
"them",
".",
"This",
"output",
"is",
"intended",
"to",
"support",
"more",
"convenient",
"access",
"to"... | def main(argv=None):
"""
Takes a set of C++ header files and generate a JSON output file describing
the objects found in them. This output is intended to support more
convenient access to a set of cppyy-supported bindings.
Examples:
INC=/usr/include
QT5=$INC/x86_64-linux-gnu/qt5
... | [
"def",
"main",
"(",
"argv",
"=",
"None",
")",
":",
"if",
"argv",
"is",
"None",
":",
"argv",
"=",
"sys",
".",
"argv",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"epilog",
"=",
"inspect",
".",
"getdoc",
"(",
"main",
")",
",",
"formatter_cla... | https://github.com/root-project/root/blob/fcd3583bb14852bf2e8cd2415717cbaac0e75896/bindings/pyroot/cppyy/cppyy-backend/cling/python/cppyy_backend/_cppyy_generator.py#L666-L742 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/tornado/tornado-6/tornado/web.py | python | RequestHandler.set_status | (self, status_code: int, reason: Optional[str] = None) | Sets the status code for our response.
:arg int status_code: Response status code.
:arg str reason: Human-readable reason phrase describing the status
code. If ``None``, it will be filled in from
`http.client.responses` or "Unknown".
.. versionchanged:: 5.0
... | Sets the status code for our response. | [
"Sets",
"the",
"status",
"code",
"for",
"our",
"response",
"."
] | def set_status(self, status_code: int, reason: Optional[str] = None) -> None:
"""Sets the status code for our response.
:arg int status_code: Response status code.
:arg str reason: Human-readable reason phrase describing the status
code. If ``None``, it will be filled in from
... | [
"def",
"set_status",
"(",
"self",
",",
"status_code",
":",
"int",
",",
"reason",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"_status_code",
"=",
"status_code",
"if",
"reason",
"is",
"not",
"None",
":",
"self",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/tornado/tornado-6/tornado/web.py#L343-L360 | ||
jeog/TDAmeritradeAPI | 91c738afd7d57b54f6231170bd64c2550fafd34d | python/tdma_api/get.py | python | _OptionChainGetterBase.get_contract_type | (self) | return clib.get_val('OptionChainGetter_GetContractType_ABI', c_int,
self._obj) | Returns OPTION_CONTRACT_TYPE_[] constant being used. | Returns OPTION_CONTRACT_TYPE_[] constant being used. | [
"Returns",
"OPTION_CONTRACT_TYPE_",
"[]",
"constant",
"being",
"used",
"."
] | def get_contract_type(self):
"""Returns OPTION_CONTRACT_TYPE_[] constant being used."""
return clib.get_val('OptionChainGetter_GetContractType_ABI', c_int,
self._obj) | [
"def",
"get_contract_type",
"(",
"self",
")",
":",
"return",
"clib",
".",
"get_val",
"(",
"'OptionChainGetter_GetContractType_ABI'",
",",
"c_int",
",",
"self",
".",
"_obj",
")"
] | https://github.com/jeog/TDAmeritradeAPI/blob/91c738afd7d57b54f6231170bd64c2550fafd34d/python/tdma_api/get.py#L821-L824 | |
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/traci/_lane.py | python | LaneDomain.getCO2Emission | (self, laneID) | return self._getUniversal(tc.VAR_CO2EMISSION, laneID) | getCO2Emission(string) -> double
Returns the CO2 emission in mg for the last time step on the given lane. | getCO2Emission(string) -> double | [
"getCO2Emission",
"(",
"string",
")",
"-",
">",
"double"
] | def getCO2Emission(self, laneID):
"""getCO2Emission(string) -> double
Returns the CO2 emission in mg for the last time step on the given lane.
"""
return self._getUniversal(tc.VAR_CO2EMISSION, laneID) | [
"def",
"getCO2Emission",
"(",
"self",
",",
"laneID",
")",
":",
"return",
"self",
".",
"_getUniversal",
"(",
"tc",
".",
"VAR_CO2EMISSION",
",",
"laneID",
")"
] | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/traci/_lane.py#L144-L149 | |
amazon-archives/amazon-dsstne | e429ea811135a2ba3d69b2f7af496b791a61e962 | benchmarks/tf/autoencoder.py | python | AutoencoderParser.__init__ | (self, cmd) | Takes a argparse command as configuration.
Loads data, and makes it accessible as member variables:
Accessible members:
train: MiniBatcher object for training | Takes a argparse command as configuration.
Loads data, and makes it accessible as member variables:
Accessible members:
train: MiniBatcher object for training | [
"Takes",
"a",
"argparse",
"command",
"as",
"configuration",
".",
"Loads",
"data",
"and",
"makes",
"it",
"accessible",
"as",
"member",
"variables",
":",
"Accessible",
"members",
":",
"train",
":",
"MiniBatcher",
"object",
"for",
"training"
] | def __init__(self, cmd):
"""Takes a argparse command as configuration.
Loads data, and makes it accessible as member variables:
Accessible members:
train: MiniBatcher object for training
"""
# Parse config from command
dims = cmd.vocab_size
# Set up l... | [
"def",
"__init__",
"(",
"self",
",",
"cmd",
")",
":",
"# Parse config from command",
"dims",
"=",
"cmd",
".",
"vocab_size",
"# Set up loader",
"mgr",
"=",
"DataManager",
"(",
"dims",
")",
"# Load train data",
"train_x",
"=",
"mgr",
".",
"load",
"(",
"cmd",
"... | https://github.com/amazon-archives/amazon-dsstne/blob/e429ea811135a2ba3d69b2f7af496b791a61e962/benchmarks/tf/autoencoder.py#L143-L158 | ||
eclipse/sumo | 7132a9b8b6eea734bdec38479026b4d8c4336d03 | tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py | python | Polygons.pick_handle | (self, coord, detectwidth=0.1) | return handles | Retuns list [ id, ind_vert] when handle is near coord,
otherwise [] | Retuns list [ id, ind_vert] when handle is near coord,
otherwise [] | [
"Retuns",
"list",
"[",
"id",
"ind_vert",
"]",
"when",
"handle",
"is",
"near",
"coord",
"otherwise",
"[]"
] | def pick_handle(self, coord, detectwidth=0.1):
"""
Retuns list [ id, ind_vert] when handle is near coord,
otherwise []
"""
# print 'pick_handle',self.get_ident(),len(self),detectwidth
dw = detectwidth ** 2 # np.sqrt(detectwidth)
if len(self) == 0:
r... | [
"def",
"pick_handle",
"(",
"self",
",",
"coord",
",",
"detectwidth",
"=",
"0.1",
")",
":",
"# print 'pick_handle',self.get_ident(),len(self),detectwidth",
"dw",
"=",
"detectwidth",
"**",
"2",
"# np.sqrt(detectwidth)",
"if",
"len",
"(",
"self",
")",
"==",
"0",
":",... | https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py#L3957-L3997 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/cmd.py | python | Cmd.parseline | (self, line) | return cmd, arg, line | Parse the line into a command name and a string containing
the arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed. | Parse the line into a command name and a string containing
the arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed. | [
"Parse",
"the",
"line",
"into",
"a",
"command",
"name",
"and",
"a",
"string",
"containing",
"the",
"arguments",
".",
"Returns",
"a",
"tuple",
"containing",
"(",
"command",
"args",
"line",
")",
".",
"command",
"and",
"args",
"may",
"be",
"None",
"if",
"th... | def parseline(self, line):
"""Parse the line into a command name and a string containing
the arguments. Returns a tuple containing (command, args, line).
'command' and 'args' may be None if the line couldn't be parsed.
"""
line = line.strip()
if not line:
ret... | [
"def",
"parseline",
"(",
"self",
",",
"line",
")",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"not",
"line",
":",
"return",
"None",
",",
"None",
",",
"line",
"elif",
"line",
"[",
"0",
"]",
"==",
"'?'",
":",
"line",
"=",
"'help '",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/cmd.py#L176-L194 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/optimizer.py | python | PipelineOptimizer._find_post_op | (self, index, var_name) | return result_op | Find the post op that has variable named var_name as input. | Find the post op that has variable named var_name as input. | [
"Find",
"the",
"post",
"op",
"that",
"has",
"variable",
"named",
"var_name",
"as",
"input",
"."
] | def _find_post_op(self, index, var_name):
"""
Find the post op that has variable named var_name as input.
"""
# bugfix for uniform hybrid parallelism
if '.cast_fp32' in var_name:
var_name = var_name.replace('.cast_fp32', '')
if '.cast_fp16' in var_name:
... | [
"def",
"_find_post_op",
"(",
"self",
",",
"index",
",",
"var_name",
")",
":",
"# bugfix for uniform hybrid parallelism",
"if",
"'.cast_fp32'",
"in",
"var_name",
":",
"var_name",
"=",
"var_name",
".",
"replace",
"(",
"'.cast_fp32'",
",",
"''",
")",
"if",
"'.cast_... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/optimizer.py#L4663-L4680 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py | python | Mailbox.get_message | (self, key) | Return a Message representation or raise a KeyError. | Return a Message representation or raise a KeyError. | [
"Return",
"a",
"Message",
"representation",
"or",
"raise",
"a",
"KeyError",
"."
] | def get_message(self, key):
"""Return a Message representation or raise a KeyError."""
raise NotImplementedError('Method must be implemented by subclass') | [
"def",
"get_message",
"(",
"self",
",",
"key",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Method must be implemented by subclass'",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/mailbox.py#L86-L88 | ||
BlzFans/wke | b0fa21158312e40c5fbd84682d643022b6c34a93 | cygwin/lib/python2.6/mhlib.py | python | Folder.getcurrent | (self) | Return the current message. Raise Error when there is none. | Return the current message. Raise Error when there is none. | [
"Return",
"the",
"current",
"message",
".",
"Raise",
"Error",
"when",
"there",
"is",
"none",
"."
] | def getcurrent(self):
"""Return the current message. Raise Error when there is none."""
seqs = self.getsequences()
try:
return max(seqs['cur'])
except (ValueError, KeyError):
raise Error, "no cur message" | [
"def",
"getcurrent",
"(",
"self",
")",
":",
"seqs",
"=",
"self",
".",
"getsequences",
"(",
")",
"try",
":",
"return",
"max",
"(",
"seqs",
"[",
"'cur'",
"]",
")",
"except",
"(",
"ValueError",
",",
"KeyError",
")",
":",
"raise",
"Error",
",",
"\"no cur... | https://github.com/BlzFans/wke/blob/b0fa21158312e40c5fbd84682d643022b6c34a93/cygwin/lib/python2.6/mhlib.py#L334-L340 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/dataview.py | python | DataViewIconTextRenderer.__init__ | (self, *args, **kwargs) | __init__(self, String varianttype="wxDataViewIconText", int mode=DATAVIEW_CELL_INERT,
int align=DVR_DEFAULT_ALIGNMENT) -> DataViewIconTextRenderer
The `DataViewIconTextRenderer` class is used to display text with a
small icon next to it as it is typically done in a file manager. This
... | __init__(self, String varianttype="wxDataViewIconText", int mode=DATAVIEW_CELL_INERT,
int align=DVR_DEFAULT_ALIGNMENT) -> DataViewIconTextRenderer | [
"__init__",
"(",
"self",
"String",
"varianttype",
"=",
"wxDataViewIconText",
"int",
"mode",
"=",
"DATAVIEW_CELL_INERT",
"int",
"align",
"=",
"DVR_DEFAULT_ALIGNMENT",
")",
"-",
">",
"DataViewIconTextRenderer"
] | def __init__(self, *args, **kwargs):
"""
__init__(self, String varianttype="wxDataViewIconText", int mode=DATAVIEW_CELL_INERT,
int align=DVR_DEFAULT_ALIGNMENT) -> DataViewIconTextRenderer
The `DataViewIconTextRenderer` class is used to display text with a
small icon next t... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"_dataview",
".",
"DataViewIconTextRenderer_swiginit",
"(",
"self",
",",
"_dataview",
".",
"new_DataViewIconTextRenderer",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/dataview.py#L1273-L1283 | ||
rdkit/rdkit | ede860ae316d12d8568daf5ee800921c3389c84e | External/pymol/modules/pymol/rpc.py | python | rpcSet | (prop, val, obj) | executes a PyMol set command
return value is either the result of the command or the empty string | executes a PyMol set command
return value is either the result of the command or the empty string | [
"executes",
"a",
"PyMol",
"set",
"command",
"return",
"value",
"is",
"either",
"the",
"result",
"of",
"the",
"command",
"or",
"the",
"empty",
"string"
] | def rpcSet(prop, val, obj):
""" executes a PyMol set command
return value is either the result of the command or the empty string
"""
res = cmd.set(prop, val, obj)
if res is not None:
return res
else:
return '' | [
"def",
"rpcSet",
"(",
"prop",
",",
"val",
",",
"obj",
")",
":",
"res",
"=",
"cmd",
".",
"set",
"(",
"prop",
",",
"val",
",",
"obj",
")",
"if",
"res",
"is",
"not",
"None",
":",
"return",
"res",
"else",
":",
"return",
"''"
] | https://github.com/rdkit/rdkit/blob/ede860ae316d12d8568daf5ee800921c3389c84e/External/pymol/modules/pymol/rpc.py#L52-L62 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/windows/Lib/imaplib.py | python | IMAP4.logout | (self) | return typ, dat | Shutdown connection to server.
(typ, [data]) = <instance>.logout()
Returns server 'BYE' response. | Shutdown connection to server. | [
"Shutdown",
"connection",
"to",
"server",
"."
] | def logout(self):
"""Shutdown connection to server.
(typ, [data]) = <instance>.logout()
Returns server 'BYE' response.
"""
self.state = 'LOGOUT'
try: typ, dat = self._simple_command('LOGOUT')
except: typ, dat = 'NO', ['%s: %s' % sys.exc_info()[:2]]
self.... | [
"def",
"logout",
"(",
"self",
")",
":",
"self",
".",
"state",
"=",
"'LOGOUT'",
"try",
":",
"typ",
",",
"dat",
"=",
"self",
".",
"_simple_command",
"(",
"'LOGOUT'",
")",
"except",
":",
"typ",
",",
"dat",
"=",
"'NO'",
",",
"[",
"'%s: %s'",
"%",
"sys"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/imaplib.py#L620-L633 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py | python | Distribution.as_requirement | (self) | return Requirement.parse('%s==%s' % (self.project_name, self.version)) | Return a ``Requirement`` that matches this distribution exactly | Return a ``Requirement`` that matches this distribution exactly | [
"Return",
"a",
"Requirement",
"that",
"matches",
"this",
"distribution",
"exactly"
] | def as_requirement(self):
"""Return a ``Requirement`` that matches this distribution exactly"""
return Requirement.parse('%s==%s' % (self.project_name, self.version)) | [
"def",
"as_requirement",
"(",
"self",
")",
":",
"return",
"Requirement",
".",
"parse",
"(",
"'%s==%s'",
"%",
"(",
"self",
".",
"project_name",
",",
"self",
".",
"version",
")",
")"
] | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/pkg_resources.py#L2385-L2387 | |
microsoft/CNTK | e9396480025b9ca457d26b6f33dd07c474c6aa04 | Examples/Image/Detection/FastRCNN/BrainScript/selectivesearch/selectivesearch.py | python | _sim_fill | (r1, r2, imsize) | return 1.0 - (bbsize - r1["size"] - r2["size"]) / imsize | calculate the fill similarity over the image | calculate the fill similarity over the image | [
"calculate",
"the",
"fill",
"similarity",
"over",
"the",
"image"
] | def _sim_fill(r1, r2, imsize):
"""
calculate the fill similarity over the image
"""
bbsize = (
(max(r1["max_x"], r2["max_x"]) - min(r1["min_x"], r2["min_x"]))
* (max(r1["max_y"], r2["max_y"]) - min(r1["min_y"], r2["min_y"]))
)
return 1.0 - (bbsize - r1["size"] - r2["size"]) /... | [
"def",
"_sim_fill",
"(",
"r1",
",",
"r2",
",",
"imsize",
")",
":",
"bbsize",
"=",
"(",
"(",
"max",
"(",
"r1",
"[",
"\"max_x\"",
"]",
",",
"r2",
"[",
"\"max_x\"",
"]",
")",
"-",
"min",
"(",
"r1",
"[",
"\"min_x\"",
"]",
",",
"r2",
"[",
"\"min_x\"... | https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/Examples/Image/Detection/FastRCNN/BrainScript/selectivesearch/selectivesearch.py#L58-L66 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/AWSPythonSDK/1.5.8/docutils/statemachine.py | python | StateMachine.add_states | (self, state_classes) | Add `state_classes` (a list of `State` subclasses). | Add `state_classes` (a list of `State` subclasses). | [
"Add",
"state_classes",
"(",
"a",
"list",
"of",
"State",
"subclasses",
")",
"."
] | def add_states(self, state_classes):
"""
Add `state_classes` (a list of `State` subclasses).
"""
for state_class in state_classes:
self.add_state(state_class) | [
"def",
"add_states",
"(",
"self",
",",
"state_classes",
")",
":",
"for",
"state_class",
"in",
"state_classes",
":",
"self",
".",
"add_state",
"(",
"state_class",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/AWSPythonSDK/1.5.8/docutils/statemachine.py#L480-L485 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/msw/_misc.py | python | PlatformInformation.GetEndianness | (*args, **kwargs) | return _misc_.PlatformInformation_GetEndianness(*args, **kwargs) | GetEndianness(self) -> int | GetEndianness(self) -> int | [
"GetEndianness",
"(",
"self",
")",
"-",
">",
"int"
] | def GetEndianness(*args, **kwargs):
"""GetEndianness(self) -> int"""
return _misc_.PlatformInformation_GetEndianness(*args, **kwargs) | [
"def",
"GetEndianness",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_misc_",
".",
"PlatformInformation_GetEndianness",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_misc.py#L1105-L1107 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/aui.py | python | AuiPaneInfo.IsDestroyOnClose | (*args, **kwargs) | return _aui.AuiPaneInfo_IsDestroyOnClose(*args, **kwargs) | IsDestroyOnClose(self) -> bool | IsDestroyOnClose(self) -> bool | [
"IsDestroyOnClose",
"(",
"self",
")",
"-",
">",
"bool"
] | def IsDestroyOnClose(*args, **kwargs):
"""IsDestroyOnClose(self) -> bool"""
return _aui.AuiPaneInfo_IsDestroyOnClose(*args, **kwargs) | [
"def",
"IsDestroyOnClose",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_aui",
".",
"AuiPaneInfo_IsDestroyOnClose",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/aui.py#L293-L295 | |
potassco/clingo | e0c91d8f95cc28de1c480a871f9c97c30de83d40 | libpyclingo/clingo/ast.py | python | Id | (location: Location, name: str) | return AST(p_ast[0]) | Construct an AST node of type `ASTType.Id`. | Construct an AST node of type `ASTType.Id`. | [
"Construct",
"an",
"AST",
"node",
"of",
"type",
"ASTType",
".",
"Id",
"."
] | def Id(location: Location, name: str) -> AST:
'''
Construct an AST node of type `ASTType.Id`.
'''
p_ast = _ffi.new('clingo_ast_t**')
c_location = _c_location(location)
_handle_error(_lib.clingo_ast_build(
_lib.clingo_ast_type_id, p_ast,
c_location[0],
_ffi.new('char const... | [
"def",
"Id",
"(",
"location",
":",
"Location",
",",
"name",
":",
"str",
")",
"->",
"AST",
":",
"p_ast",
"=",
"_ffi",
".",
"new",
"(",
"'clingo_ast_t**'",
")",
"c_location",
"=",
"_c_location",
"(",
"location",
")",
"_handle_error",
"(",
"_lib",
".",
"c... | https://github.com/potassco/clingo/blob/e0c91d8f95cc28de1c480a871f9c97c30de83d40/libpyclingo/clingo/ast.py#L1196-L1206 | |
hpi-xnor/BMXNet | ed0b201da6667887222b8e4b5f997c4f6b61943d | python/mxnet/module/sequential_module.py | python | SequentialModule.init_params | (self, initializer=Uniform(0.01), arg_params=None, aux_params=None,
allow_missing=False, force_init=False, allow_extra=False) | Initializes parameters.
Parameters
----------
initializer : Initializer
arg_params : dict
Default ``None``. Existing parameters. This has higher priority
than `initializer`.
aux_params : dict
Default ``None``. Existing auxiliary states. This h... | Initializes parameters. | [
"Initializes",
"parameters",
"."
] | def init_params(self, initializer=Uniform(0.01), arg_params=None, aux_params=None,
allow_missing=False, force_init=False, allow_extra=False):
"""Initializes parameters.
Parameters
----------
initializer : Initializer
arg_params : dict
Default ``No... | [
"def",
"init_params",
"(",
"self",
",",
"initializer",
"=",
"Uniform",
"(",
"0.01",
")",
",",
"arg_params",
"=",
"None",
",",
"aux_params",
"=",
"None",
",",
"allow_missing",
"=",
"False",
",",
"force_init",
"=",
"False",
",",
"allow_extra",
"=",
"False",
... | https://github.com/hpi-xnor/BMXNet/blob/ed0b201da6667887222b8e4b5f997c4f6b61943d/python/mxnet/module/sequential_module.py#L173-L222 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/pimp.py | python | PimpPreferences.check | (self) | return rv | Check that the preferences make sense: directories exist and are
writable, the install directory is on sys.path, etc. | Check that the preferences make sense: directories exist and are
writable, the install directory is on sys.path, etc. | [
"Check",
"that",
"the",
"preferences",
"make",
"sense",
":",
"directories",
"exist",
"and",
"are",
"writable",
"the",
"install",
"directory",
"is",
"on",
"sys",
".",
"path",
"etc",
"."
] | def check(self):
"""Check that the preferences make sense: directories exist and are
writable, the install directory is on sys.path, etc."""
rv = ""
RWX_OK = os.R_OK|os.W_OK|os.X_OK
if not os.path.exists(self.downloadDir):
rv += "Warning: Download directory \"%s\" do... | [
"def",
"check",
"(",
"self",
")",
":",
"rv",
"=",
"\"\"",
"RWX_OK",
"=",
"os",
".",
"R_OK",
"|",
"os",
".",
"W_OK",
"|",
"os",
".",
"X_OK",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"downloadDir",
")",
":",
"rv",
"+=",
... | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi-v7a/toolchain/lib/python2.7/plat-mac/pimp.py#L316-L345 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | wx/tools/XRCed/presenter.py | python | _Presenter.checkCompatibility | (self, comp) | return True | Check parent/child compatibility. | Check parent/child compatibility. | [
"Check",
"parent",
"/",
"child",
"compatibility",
"."
] | def checkCompatibility(self, comp):
'''Check parent/child compatibility.'''
if self.createSibling: container = self.container
else: container = self.comp
if not container.canHaveChild(comp):
wx.LogError('Incompatible parent/child: parent is %s, child is %s!' %
... | [
"def",
"checkCompatibility",
"(",
"self",
",",
"comp",
")",
":",
"if",
"self",
".",
"createSibling",
":",
"container",
"=",
"self",
".",
"container",
"else",
":",
"container",
"=",
"self",
".",
"comp",
"if",
"not",
"container",
".",
"canHaveChild",
"(",
... | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/XRCed/presenter.py#L443-L451 | |
thalium/icebox | 99d147d5b9269222225443ce171b4fd46d8985d4 | third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py | python | parserCtxt.parseAttributeListDecl | (self) | : parse the Attribute list def for an element [52]
AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53]
AttDef ::= S Name S AttType S DefaultDecl | : parse the Attribute list def for an element [52]
AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53]
AttDef ::= S Name S AttType S DefaultDecl | [
":",
"parse",
"the",
"Attribute",
"list",
"def",
"for",
"an",
"element",
"[",
"52",
"]",
"AttlistDecl",
"::",
"=",
"<!ATTLIST",
"S",
"Name",
"AttDef",
"*",
"S?",
">",
"[",
"53",
"]",
"AttDef",
"::",
"=",
"S",
"Name",
"S",
"AttType",
"S",
"DefaultDecl... | def parseAttributeListDecl(self):
""": parse the Attribute list def for an element [52]
AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53]
AttDef ::= S Name S AttType S DefaultDecl """
libxml2mod.xmlParseAttributeListDecl(self._o) | [
"def",
"parseAttributeListDecl",
"(",
"self",
")",
":",
"libxml2mod",
".",
"xmlParseAttributeListDecl",
"(",
"self",
".",
"_o",
")"
] | https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2.py#L5199-L5203 | ||
ricardoquesada/Spidermonkey | 4a75ea2543408bd1b2c515aa95901523eeef7858 | media/webrtc/trunk/build/android/emulator.py | python | Emulator._DeviceName | (self) | return ('emulator-%d' % port, port) | Return our device name. | Return our device name. | [
"Return",
"our",
"device",
"name",
"."
] | def _DeviceName(self):
"""Return our device name."""
port = _GetAvailablePort()
return ('emulator-%d' % port, port) | [
"def",
"_DeviceName",
"(",
"self",
")",
":",
"port",
"=",
"_GetAvailablePort",
"(",
")",
"return",
"(",
"'emulator-%d'",
"%",
"port",
",",
"port",
")"
] | https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/build/android/emulator.py#L162-L165 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/loader_impl.py | python | _get_main_op_tensor | (
meta_graph_def_to_load, init_op_key=constants.MAIN_OP_KEY) | return init_op | Gets the main op tensor, if one exists.
Args:
meta_graph_def_to_load: The meta graph def from the SavedModel to be loaded.
init_op_key: name of collection to check; should be one of MAIN_OP_KEY
or the deprecated LEGACY_INIT_OP_KEY
Returns:
The main op tensor, if it exists and `None` otherwise.
... | Gets the main op tensor, if one exists. | [
"Gets",
"the",
"main",
"op",
"tensor",
"if",
"one",
"exists",
"."
] | def _get_main_op_tensor(
meta_graph_def_to_load, init_op_key=constants.MAIN_OP_KEY):
"""Gets the main op tensor, if one exists.
Args:
meta_graph_def_to_load: The meta graph def from the SavedModel to be loaded.
init_op_key: name of collection to check; should be one of MAIN_OP_KEY
or the deprecat... | [
"def",
"_get_main_op_tensor",
"(",
"meta_graph_def_to_load",
",",
"init_op_key",
"=",
"constants",
".",
"MAIN_OP_KEY",
")",
":",
"# TODO(kathywu): Rename this method to _get_op_from_collection when",
"# dependency from SavedModelEstimator is removed.",
"collection_def",
"=",
"meta_gr... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/saved_model/loader_impl.py#L134-L160 | |
Z3Prover/z3 | d745d03afdfdf638d66093e2bfbacaf87187f35b | src/api/python/z3/z3.py | python | FailIf | (p, ctx=None) | return Tactic(Z3_tactic_fail_if(p.ctx.ref(), p.probe), p.ctx) | Return a tactic that fails if the probe `p` evaluates to true.
Otherwise, it returns the input goal unmodified.
In the following example, the tactic applies 'simplify' if and only if there are
more than 2 constraints in the goal.
>>> t = OrElse(FailIf(Probe('size') > 2), Tactic('simplify'))
>>> x,... | Return a tactic that fails if the probe `p` evaluates to true.
Otherwise, it returns the input goal unmodified. | [
"Return",
"a",
"tactic",
"that",
"fails",
"if",
"the",
"probe",
"p",
"evaluates",
"to",
"true",
".",
"Otherwise",
"it",
"returns",
"the",
"input",
"goal",
"unmodified",
"."
] | def FailIf(p, ctx=None):
"""Return a tactic that fails if the probe `p` evaluates to true.
Otherwise, it returns the input goal unmodified.
In the following example, the tactic applies 'simplify' if and only if there are
more than 2 constraints in the goal.
>>> t = OrElse(FailIf(Probe('size') > 2)... | [
"def",
"FailIf",
"(",
"p",
",",
"ctx",
"=",
"None",
")",
":",
"p",
"=",
"_to_probe",
"(",
"p",
",",
"ctx",
")",
"return",
"Tactic",
"(",
"Z3_tactic_fail_if",
"(",
"p",
".",
"ctx",
".",
"ref",
"(",
")",
",",
"p",
".",
"probe",
")",
",",
"p",
"... | https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L8626-L8645 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/scipy/scipy/signal/ltisys.py | python | TransferFunction.den | (self) | return self._den | Denominator of the `TransferFunction` system. | Denominator of the `TransferFunction` system. | [
"Denominator",
"of",
"the",
"TransferFunction",
"system",
"."
] | def den(self):
"""Denominator of the `TransferFunction` system."""
return self._den | [
"def",
"den",
"(",
"self",
")",
":",
"return",
"self",
".",
"_den"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/signal/ltisys.py#L789-L791 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/python/py/py/_path/svnwc.py | python | SvnPathBase.propget | (self, name) | return value | return the content of the given property. | return the content of the given property. | [
"return",
"the",
"content",
"of",
"the",
"given",
"property",
"."
] | def propget(self, name):
""" return the content of the given property. """
value = self._propget(name)
return value | [
"def",
"propget",
"(",
"self",
",",
"name",
")",
":",
"value",
"=",
"self",
".",
"_propget",
"(",
"name",
")",
"return",
"value"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/py/py/_path/svnwc.py#L228-L231 | |
yrnkrn/zapcc | c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50 | bindings/python/llvm/object.py | python | Relocation.type_name | (self) | return lib.LLVMGetRelocationTypeName(self) | The relocation type's name, as a str. | The relocation type's name, as a str. | [
"The",
"relocation",
"type",
"s",
"name",
"as",
"a",
"str",
"."
] | def type_name(self):
"""The relocation type's name, as a str."""
if self.expired:
raise Exception('Relocation instance has expired.')
return lib.LLVMGetRelocationTypeName(self) | [
"def",
"type_name",
"(",
"self",
")",
":",
"if",
"self",
".",
"expired",
":",
"raise",
"Exception",
"(",
"'Relocation instance has expired.'",
")",
"return",
"lib",
".",
"LLVMGetRelocationTypeName",
"(",
"self",
")"
] | https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/bindings/python/llvm/object.py#L400-L405 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | DQM/Integration/scripts/harvesting_tools/cmsHarvester.py | python | CMSHarvester.process_dataset_ignore_list | (self) | Update the list of datasets taking into account the ones to
ignore.
Both lists have been generated before from DBS and both are
assumed to be unique.
NOTE: The advantage of creating the ignore list from DBS (in
case a regexp is given) and matching that instead of directly
... | Update the list of datasets taking into account the ones to
ignore. | [
"Update",
"the",
"list",
"of",
"datasets",
"taking",
"into",
"account",
"the",
"ones",
"to",
"ignore",
"."
] | def process_dataset_ignore_list(self):
"""Update the list of datasets taking into account the ones to
ignore.
Both lists have been generated before from DBS and both are
assumed to be unique.
NOTE: The advantage of creating the ignore list from DBS (in
case a regexp is ... | [
"def",
"process_dataset_ignore_list",
"(",
"self",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Processing list of datasets to ignore...\"",
")",
"self",
".",
"logger",
".",
"debug",
"(",
"\"Before processing ignore list there are %d \"",
"\"datasets in the list to... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/DQM/Integration/scripts/harvesting_tools/cmsHarvester.py#L3565-L3606 | ||
tensorflow/tensorflow | 419e3a6b650ea4bd1b0cba23c4348f8a69f3272e | tensorflow/python/keras/distribute/worker_training_state.py | python | WorkerTrainingState.delete_backup | (self) | Delete the backup directories.
Delete the backup directories which should not exist after `fit()`
successfully finishes. | Delete the backup directories. | [
"Delete",
"the",
"backup",
"directories",
"."
] | def delete_backup(self):
"""Delete the backup directories.
Delete the backup directories which should not exist after `fit()`
successfully finishes.
"""
if self.write_checkpoint_manager is self.read_checkpoint_manager:
try:
file_io.delete_recursively_v2(self.write_checkpoint_manager.d... | [
"def",
"delete_backup",
"(",
"self",
")",
":",
"if",
"self",
".",
"write_checkpoint_manager",
"is",
"self",
".",
"read_checkpoint_manager",
":",
"try",
":",
"file_io",
".",
"delete_recursively_v2",
"(",
"self",
".",
"write_checkpoint_manager",
".",
"directory",
")... | https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/keras/distribute/worker_training_state.py#L108-L118 | ||
miyosuda/TensorFlowAndroidDemo | 35903e0221aa5f109ea2dbef27f20b52e317f42d | jni-build/jni/include/tensorflow/python/framework/gen_docs_combined.py | python | all_libraries | (module_to_name, members, documented) | return [
# Splits of module 'tf'.
library("framework", "Building Graphs", framework_lib),
library("check_ops", "Asserts and boolean checks."),
library("constant_op", "Constants, Sequences, and Random Values",
constant_op, prefix=PREFIX_TEXT),
library("state_ops",
... | Make a list of the individual files that we want to create.
Args:
module_to_name: Dictionary mapping modules to short names.
members: Dictionary mapping member name to (fullname, member).
documented: Set of documented names to update.
Returns:
List of (filename, docs.Library) pairs. | Make a list of the individual files that we want to create. | [
"Make",
"a",
"list",
"of",
"the",
"individual",
"files",
"that",
"we",
"want",
"to",
"create",
"."
] | def all_libraries(module_to_name, members, documented):
"""Make a list of the individual files that we want to create.
Args:
module_to_name: Dictionary mapping modules to short names.
members: Dictionary mapping member name to (fullname, member).
documented: Set of documented names to update.
Return... | [
"def",
"all_libraries",
"(",
"module_to_name",
",",
"members",
",",
"documented",
")",
":",
"def",
"library",
"(",
"name",
",",
"title",
",",
"module",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
"if",
"module",
"is",
"None",
":",
"module",
"=",
"s... | https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/python/framework/gen_docs_combined.py#L75-L183 | |
tensorflow/deepmath | b5b721f54de1d5d6a02d78f5da5995237f9995f9 | deepmath/premises/model_definition_cnn_flat3.py | python | Model.classifier | (self, conjecture_embedding, axiom_embedding) | return logits | Compute the logits from conjecture and axiom embeddings. | Compute the logits from conjecture and axiom embeddings. | [
"Compute",
"the",
"logits",
"from",
"conjecture",
"and",
"axiom",
"embeddings",
"."
] | def classifier(self, conjecture_embedding, axiom_embedding):
"""Compute the logits from conjecture and axiom embeddings."""
with self.graph.as_default():
net = tf.concat((conjecture_embedding, axiom_embedding), 1)
net = layers.relu(net, 1024)
logits = layers.linear(net, 2)
return logits | [
"def",
"classifier",
"(",
"self",
",",
"conjecture_embedding",
",",
"axiom_embedding",
")",
":",
"with",
"self",
".",
"graph",
".",
"as_default",
"(",
")",
":",
"net",
"=",
"tf",
".",
"concat",
"(",
"(",
"conjecture_embedding",
",",
"axiom_embedding",
")",
... | https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/premises/model_definition_cnn_flat3.py#L63-L69 | |
pytorch/pytorch | 7176c92687d3cc847cc046bf002269c6949a21c2 | torch/_tensor.py | python | Tensor.storage_type | (self) | return type(self.storage()) | r"""storage_type() -> type
Returns the type of the underlying storage. | r"""storage_type() -> type | [
"r",
"storage_type",
"()",
"-",
">",
"type"
] | def storage_type(self):
r"""storage_type() -> type
Returns the type of the underlying storage.
"""
# NB: this returns old fashioned TypedStorage, e.g., FloatStorage, as it
# would be pretty pointless otherwise (it would always return
# UntypedStorage)
return typ... | [
"def",
"storage_type",
"(",
"self",
")",
":",
"# NB: this returns old fashioned TypedStorage, e.g., FloatStorage, as it",
"# would be pretty pointless otherwise (it would always return",
"# UntypedStorage)",
"return",
"type",
"(",
"self",
".",
"storage",
"(",
")",
")"
] | https://github.com/pytorch/pytorch/blob/7176c92687d3cc847cc046bf002269c6949a21c2/torch/_tensor.py#L827-L836 | |
intel/llvm | e6d0547e9d99b5a56430c4749f6c7e328bf221ab | mlir/utils/spirv/gen_spirv_dialect.py | python | gen_instr_coverage_report | (path, instructions) | Dumps to standard output a YAML report of current instruction coverage
Arguments:
- path: the path to SPIRBase.td
- instructions: a list containing all SPIR-V instructions' grammar | Dumps to standard output a YAML report of current instruction coverage | [
"Dumps",
"to",
"standard",
"output",
"a",
"YAML",
"report",
"of",
"current",
"instruction",
"coverage"
] | def gen_instr_coverage_report(path, instructions):
"""Dumps to standard output a YAML report of current instruction coverage
Arguments:
- path: the path to SPIRBase.td
- instructions: a list containing all SPIR-V instructions' grammar
"""
with open(path, 'r') as f:
content = f.read()
content = c... | [
"def",
"gen_instr_coverage_report",
"(",
"path",
",",
"instructions",
")",
":",
"with",
"open",
"(",
"path",
",",
"'r'",
")",
"as",
"f",
":",
"content",
"=",
"f",
".",
"read",
"(",
")",
"content",
"=",
"content",
".",
"split",
"(",
"AUTOGEN_OPCODE_SECTIO... | https://github.com/intel/llvm/blob/e6d0547e9d99b5a56430c4749f6c7e328bf221ab/mlir/utils/spirv/gen_spirv_dialect.py#L482-L530 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py | python | Message._explain_to | (self, message) | Copy format-specific state to message insofar as possible. | Copy format-specific state to message insofar as possible. | [
"Copy",
"format",
"-",
"specific",
"state",
"to",
"message",
"insofar",
"as",
"possible",
"."
] | def _explain_to(self, message):
"""Copy format-specific state to message insofar as possible."""
if isinstance(message, Message):
return # There's nothing format-specific to explain.
else:
raise TypeError('Cannot convert to specified type') | [
"def",
"_explain_to",
"(",
"self",
",",
"message",
")",
":",
"if",
"isinstance",
"(",
"message",
",",
"Message",
")",
":",
"return",
"# There's nothing format-specific to explain.",
"else",
":",
"raise",
"TypeError",
"(",
"'Cannot convert to specified type'",
")"
] | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/mailbox.py#L1515-L1520 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/codecs.py | python | StreamWriter.reset | (self) | Resets the codec buffers used for keeping internal state.
Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recover state. | Resets the codec buffers used for keeping internal state. | [
"Resets",
"the",
"codec",
"buffers",
"used",
"for",
"keeping",
"internal",
"state",
"."
] | def reset(self):
""" Resets the codec buffers used for keeping internal state.
Calling this method should ensure that the data on the
output is put into a clean state, that allows appending
of new fresh data without having to rescan the whole
stream to recover s... | [
"def",
"reset",
"(",
"self",
")",
":",
"pass"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/codecs.py#L387-L397 | ||
sonyxperiadev/WebGL | 0299b38196f78c6d5f74bcf6fa312a3daee6de60 | Tools/Scripts/webkitpy/common/system/filesystem.py | python | FileSystem.rmtree | (self, path) | Delete the directory rooted at path, empty or no. | Delete the directory rooted at path, empty or no. | [
"Delete",
"the",
"directory",
"rooted",
"at",
"path",
"empty",
"or",
"no",
"."
] | def rmtree(self, path):
"""Delete the directory rooted at path, empty or no."""
shutil.rmtree(path, ignore_errors=True) | [
"def",
"rmtree",
"(",
"self",
",",
"path",
")",
":",
"shutil",
".",
"rmtree",
"(",
"path",
",",
"ignore_errors",
"=",
"True",
")"
] | https://github.com/sonyxperiadev/WebGL/blob/0299b38196f78c6d5f74bcf6fa312a3daee6de60/Tools/Scripts/webkitpy/common/system/filesystem.py#L250-L252 | ||
idaholab/moose | 9eeebc65e098b4c30f8205fb41591fd5b61eb6ff | python/chigger/utils/AxisOptions.py | python | get_options | () | return opt | Retuns options for vtkAxis objects. | Retuns options for vtkAxis objects. | [
"Retuns",
"options",
"for",
"vtkAxis",
"objects",
"."
] | def get_options():
"""
Retuns options for vtkAxis objects.
"""
opt = Options()
opt.add('num_ticks', 5, "The number of tick marks to place on the axis.", vtype=int)
opt.add('lim', "The axis extents.", vtype=list)
opt.add('font_color', [1, 1, 1], "The color of the axis, ticks, and labels.")
... | [
"def",
"get_options",
"(",
")",
":",
"opt",
"=",
"Options",
"(",
")",
"opt",
".",
"add",
"(",
"'num_ticks'",
",",
"5",
",",
"\"The number of tick marks to place on the axis.\"",
",",
"vtype",
"=",
"int",
")",
"opt",
".",
"add",
"(",
"'lim'",
",",
"\"The ax... | https://github.com/idaholab/moose/blob/9eeebc65e098b4c30f8205fb41591fd5b61eb6ff/python/chigger/utils/AxisOptions.py#L22-L50 | |
baidu-research/tensorflow-allreduce | 66d5b855e90b0949e9fa5cca5599fd729a70e874 | tensorflow/python/ops/state_ops.py | python | is_variable_initialized | (ref, name=None) | Checks whether a tensor has been initialized.
Outputs boolean scalar indicating whether the tensor has been initialized.
Args:
ref: A mutable `Tensor`.
Should be from a `Variable` node. May be uninitialized.
name: A name for the operation (optional).
Returns:
A `Tensor` of type `bool`. | Checks whether a tensor has been initialized. | [
"Checks",
"whether",
"a",
"tensor",
"has",
"been",
"initialized",
"."
] | def is_variable_initialized(ref, name=None):
"""Checks whether a tensor has been initialized.
Outputs boolean scalar indicating whether the tensor has been initialized.
Args:
ref: A mutable `Tensor`.
Should be from a `Variable` node. May be uninitialized.
name: A name for the operation (optional).... | [
"def",
"is_variable_initialized",
"(",
"ref",
",",
"name",
"=",
"None",
")",
":",
"if",
"ref",
".",
"dtype",
".",
"_is_ref_dtype",
":",
"return",
"gen_state_ops",
".",
"is_variable_initialized",
"(",
"ref",
"=",
"ref",
",",
"name",
"=",
"name",
")",
"# Han... | https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/state_ops.py#L169-L187 | ||
s9xie/DSN | 065e49898d239f5c96be558616b2556eabc50351 | scripts/cpp_lint.py | python | CheckForHeaderGuard | (filename, 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.
lines: An array of strings, each representing a line of the file.
error: The function to call... | Checks that the file contains a header guard. | [
"Checks",
"that",
"the",
"file",
"contains",
"a",
"header",
"guard",
"."
] | def CheckForHeaderGuard(filename, 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.
lines: An array of strings, each representi... | [
"def",
"CheckForHeaderGuard",
"(",
"filename",
",",
"lines",
",",
"error",
")",
":",
"cppvar",
"=",
"GetHeaderGuardCPPVariable",
"(",
"filename",
")",
"ifndef",
"=",
"None",
"ifndef_linenum",
"=",
"0",
"define",
"=",
"None",
"endif",
"=",
"None",
"endif_linenu... | https://github.com/s9xie/DSN/blob/065e49898d239f5c96be558616b2556eabc50351/scripts/cpp_lint.py#L1404-L1476 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | scripts/SANS/SANSUtility.py | python | CummulativeTimeSeriesPropertyAdder._update_single_valued_entries | (self, workspace) | We need to update single-valued entries which are based on the
cumulative time series
:param workspace: the workspace which requires the changes | We need to update single-valued entries which are based on the
cumulative time series
:param workspace: the workspace which requires the changes | [
"We",
"need",
"to",
"update",
"single",
"-",
"valued",
"entries",
"which",
"are",
"based",
"on",
"the",
"cumulative",
"time",
"series",
":",
"param",
"workspace",
":",
"the",
"workspace",
"which",
"requires",
"the",
"changes"
] | def _update_single_valued_entries(self, workspace):
"""
We need to update single-valued entries which are based on the
cumulative time series
:param workspace: the workspace which requires the changes
"""
run = workspace.getRun()
alg_log = AlgorithmManager.create... | [
"def",
"_update_single_valued_entries",
"(",
"self",
",",
"workspace",
")",
":",
"run",
"=",
"workspace",
".",
"getRun",
"(",
")",
"alg_log",
"=",
"AlgorithmManager",
".",
"createUnmanaged",
"(",
"\"AddSampleLog\"",
")",
"alg_log",
".",
"initialize",
"(",
")",
... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/SANS/SANSUtility.py#L1345-L1365 | ||
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mhlib.py | python | MH.listallfolders | (self) | return self.listallsubfolders('') | Return the names of all folders and subfolders, recursively. | Return the names of all folders and subfolders, recursively. | [
"Return",
"the",
"names",
"of",
"all",
"folders",
"and",
"subfolders",
"recursively",
"."
] | def listallfolders(self):
"""Return the names of all folders and subfolders, recursively."""
return self.listallsubfolders('') | [
"def",
"listallfolders",
"(",
"self",
")",
":",
"return",
"self",
".",
"listallsubfolders",
"(",
"''",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mhlib.py#L179-L181 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python3/src/Lib/compileall.py | python | main | () | return True | Script main program. | Script main program. | [
"Script",
"main",
"program",
"."
] | def main():
"""Script main program."""
import argparse
parser = argparse.ArgumentParser(
description='Utilities to support installing Python libraries.')
parser.add_argument('-l', action='store_const', const=0,
default=None, dest='maxlevels',
help... | [
"def",
"main",
"(",
")",
":",
"import",
"argparse",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Utilities to support installing Python libraries.'",
")",
"parser",
".",
"add_argument",
"(",
"'-l'",
",",
"action",
"=",
"'store_const'"... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/compileall.py#L306-L455 | |
pmq20/node-packer | 12c46c6e44fbc14d9ee645ebd17d5296b324f7e0 | lts/deps/v8/third_party/jinja2/compiler.py | python | CodeGenerator.visit_Block | (self, node, frame) | Call a block and register it for the template. | Call a block and register it for the template. | [
"Call",
"a",
"block",
"and",
"register",
"it",
"for",
"the",
"template",
"."
] | def visit_Block(self, node, frame):
"""Call a block and register it for the template."""
level = 0
if frame.toplevel:
# if we know that we are a child template, there is no need to
# check if we are one
if self.has_known_extends:
return
... | [
"def",
"visit_Block",
"(",
"self",
",",
"node",
",",
"frame",
")",
":",
"level",
"=",
"0",
"if",
"frame",
".",
"toplevel",
":",
"# if we know that we are a child template, there is no need to",
"# check if we are one",
"if",
"self",
".",
"has_known_extends",
":",
"r... | https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/deps/v8/third_party/jinja2/compiler.py#L811-L841 | ||
pyne/pyne | 0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3 | pyne/mesh.py | python | Tag.__init__ | (self, mesh=None, name=None, doc=None) | Parameters
----------
mesh : Mesh, optional
The PyNE mesh to tag.
name : str, optional
The name of the tag.
doc : str, optional
Documentation string for the tag. | Parameters
----------
mesh : Mesh, optional
The PyNE mesh to tag.
name : str, optional
The name of the tag.
doc : str, optional
Documentation string for the tag. | [
"Parameters",
"----------",
"mesh",
":",
"Mesh",
"optional",
"The",
"PyNE",
"mesh",
"to",
"tag",
".",
"name",
":",
"str",
"optional",
"The",
"name",
"of",
"the",
"tag",
".",
"doc",
":",
"str",
"optional",
"Documentation",
"string",
"for",
"the",
"tag",
"... | def __init__(self, mesh=None, name=None, doc=None):
"""Parameters
----------
mesh : Mesh, optional
The PyNE mesh to tag.
name : str, optional
The name of the tag.
doc : str, optional
Documentation string for the tag.
"""
if mes... | [
"def",
"__init__",
"(",
"self",
",",
"mesh",
"=",
"None",
",",
"name",
"=",
"None",
",",
"doc",
"=",
"None",
")",
":",
"if",
"mesh",
"is",
"None",
"or",
"name",
"is",
"None",
":",
"self",
".",
"_lazy_args",
"=",
"{",
"'mesh'",
":",
"mesh",
",",
... | https://github.com/pyne/pyne/blob/0c2714d7c0d1b5e20be6ae6527da2c660dd6b1b3/pyne/mesh.py#L65-L86 | ||
mantidproject/mantid | 03deeb89254ec4289edb8771e0188c2090a02f32 | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLPreprocess.py | python | ReflectometryILLPreprocess._flatBkgRanges | (self, ws) | return highRange + lowRange | Return spectrum number ranges for flat background fitting. | Return spectrum number ranges for flat background fitting. | [
"Return",
"spectrum",
"number",
"ranges",
"for",
"flat",
"background",
"fitting",
"."
] | def _flatBkgRanges(self, ws):
"""Return spectrum number ranges for flat background fitting."""
sign = self._workspaceIndexDirection(ws)
peakPos = ws.run().getProperty(common.SampleLogs.FOREGROUND_CENTRE).value
# Convert to spectrum numbers
peakPos = ws.getSpectrum(peakPos).getSpe... | [
"def",
"_flatBkgRanges",
"(",
"self",
",",
"ws",
")",
":",
"sign",
"=",
"self",
".",
"_workspaceIndexDirection",
"(",
"ws",
")",
"peakPos",
"=",
"ws",
".",
"run",
"(",
")",
".",
"getProperty",
"(",
"common",
".",
"SampleLogs",
".",
"FOREGROUND_CENTRE",
"... | https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryILLPreprocess.py#L305-L329 | |
echronos/echronos | c996f1d2c8af6c6536205eb319c1bf1d4d84569c | external_tools/ply_info/example/GardenSnake/GardenSnake.py | python | p_expr_stmt | (p) | expr_stmt : testlist ASSIGN testlist
| testlist | expr_stmt : testlist ASSIGN testlist
| testlist | [
"expr_stmt",
":",
"testlist",
"ASSIGN",
"testlist",
"|",
"testlist"
] | def p_expr_stmt(p):
"""expr_stmt : testlist ASSIGN testlist
| testlist """
if len(p) == 2:
# a list of expressions
p[0] = ast.Discard(p[1])
else:
p[0] = Assign(p[1], p[3]) | [
"def",
"p_expr_stmt",
"(",
"p",
")",
":",
"if",
"len",
"(",
"p",
")",
"==",
"2",
":",
"# a list of expressions",
"p",
"[",
"0",
"]",
"=",
"ast",
".",
"Discard",
"(",
"p",
"[",
"1",
"]",
")",
"else",
":",
"p",
"[",
"0",
"]",
"=",
"Assign",
"("... | https://github.com/echronos/echronos/blob/c996f1d2c8af6c6536205eb319c1bf1d4d84569c/external_tools/ply_info/example/GardenSnake/GardenSnake.py#L442-L449 | ||
miyosuda/TensorFlowAndroidMNIST | 7b5a4603d2780a8a2834575706e9001977524007 | jni-build/jni/include/tensorflow/python/training/input.py | python | shuffle_batch | (tensors, batch_size, capacity, min_after_dequeue,
num_threads=1, seed=None, enqueue_many=False, shapes=None,
allow_smaller_final_batch=False, shared_name=None, name=None) | Creates batches by randomly shuffling tensors.
This function adds the following to the current `Graph`:
* A shuffling queue into which tensors from `tensors` are enqueued.
* A `dequeue_many` operation to create batches from the queue.
* A `QueueRunner` to `QUEUE_RUNNER` collection, to enqueue the tensors
... | Creates batches by randomly shuffling tensors. | [
"Creates",
"batches",
"by",
"randomly",
"shuffling",
"tensors",
"."
] | def shuffle_batch(tensors, batch_size, capacity, min_after_dequeue,
num_threads=1, seed=None, enqueue_many=False, shapes=None,
allow_smaller_final_batch=False, shared_name=None, name=None):
"""Creates batches by randomly shuffling tensors.
This function adds the following to the... | [
"def",
"shuffle_batch",
"(",
"tensors",
",",
"batch_size",
",",
"capacity",
",",
"min_after_dequeue",
",",
"num_threads",
"=",
"1",
",",
"seed",
"=",
"None",
",",
"enqueue_many",
"=",
"False",
",",
"shapes",
"=",
"None",
",",
"allow_smaller_final_batch",
"=",
... | https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/training/input.py#L714-L819 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/gtk/dataview.py | python | DataViewCtrl.PrependProgressColumn | (*args, **kwargs) | return _dataview.DataViewCtrl_PrependProgressColumn(*args, **kwargs) | PrependProgressColumn(self, PyObject label_or_bitmap, unsigned int model_column,
int mode=DATAVIEW_CELL_INERT, int width=DVC_DEFAULT_WIDTH,
int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | PrependProgressColumn(self, PyObject label_or_bitmap, unsigned int model_column,
int mode=DATAVIEW_CELL_INERT, int width=DVC_DEFAULT_WIDTH,
int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn | [
"PrependProgressColumn",
"(",
"self",
"PyObject",
"label_or_bitmap",
"unsigned",
"int",
"model_column",
"int",
"mode",
"=",
"DATAVIEW_CELL_INERT",
"int",
"width",
"=",
"DVC_DEFAULT_WIDTH",
"int",
"align",
"=",
"ALIGN_CENTER",
"int",
"flags",
"=",
"DATAVIEW_COL_RESIZABLE... | def PrependProgressColumn(*args, **kwargs):
"""
PrependProgressColumn(self, PyObject label_or_bitmap, unsigned int model_column,
int mode=DATAVIEW_CELL_INERT, int width=DVC_DEFAULT_WIDTH,
int align=ALIGN_CENTER, int flags=DATAVIEW_COL_RESIZABLE) -> DataViewColumn
"""
... | [
"def",
"PrependProgressColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_dataview",
".",
"DataViewCtrl_PrependProgressColumn",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/dataview.py#L1614-L1620 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/os.py | python | execle | (file, *args) | execle(file, *args, env)
Execute the executable file with argument list args and
environment env, replacing the current process. | execle(file, *args, env) | [
"execle",
"(",
"file",
"*",
"args",
"env",
")"
] | def execle(file, *args):
"""execle(file, *args, env)
Execute the executable file with argument list args and
environment env, replacing the current process. """
env = args[-1]
execve(file, args[:-1], env) | [
"def",
"execle",
"(",
"file",
",",
"*",
"args",
")",
":",
"env",
"=",
"args",
"[",
"-",
"1",
"]",
"execve",
"(",
"file",
",",
"args",
"[",
":",
"-",
"1",
"]",
",",
"env",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/os.py#L316-L322 | ||
borglab/gtsam | a5bee157efce6a0563704bce6a5d188c29817f39 | gtsam/3rdparty/GeographicLib/python/geographiclib/geomath.py | python | Math.cbrt | (x) | return y if x >= 0 else -y | Real cube root of a number | Real cube root of a number | [
"Real",
"cube",
"root",
"of",
"a",
"number"
] | def cbrt(x):
"""Real cube root of a number"""
y = math.pow(abs(x), 1/3.0)
return y if x >= 0 else -y | [
"def",
"cbrt",
"(",
"x",
")",
":",
"y",
"=",
"math",
".",
"pow",
"(",
"abs",
"(",
"x",
")",
",",
"1",
"/",
"3.0",
")",
"return",
"y",
"if",
"x",
">=",
"0",
"else",
"-",
"y"
] | https://github.com/borglab/gtsam/blob/a5bee157efce6a0563704bce6a5d188c29817f39/gtsam/3rdparty/GeographicLib/python/geographiclib/geomath.py#L43-L47 | |
apache/impala | 8ddac48f3428c86f2cbd037ced89cfb903298b12 | shell/ext-py/prettytable-0.7.2/prettytable.py | python | PrettyTable._get_vertical_char | (self) | return self._vertical_char | The charcter used when printing table borders to draw vertical lines
Arguments:
vertical_char - single character string used to draw vertical lines | The charcter used when printing table borders to draw vertical lines | [
"The",
"charcter",
"used",
"when",
"printing",
"table",
"borders",
"to",
"draw",
"vertical",
"lines"
] | def _get_vertical_char(self):
"""The charcter used when printing table borders to draw vertical lines
Arguments:
vertical_char - single character string used to draw vertical lines"""
return self._vertical_char | [
"def",
"_get_vertical_char",
"(",
"self",
")",
":",
"return",
"self",
".",
"_vertical_char"
] | https://github.com/apache/impala/blob/8ddac48f3428c86f2cbd037ced89cfb903298b12/shell/ext-py/prettytable-0.7.2/prettytable.py#L653-L659 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | ppapi/generators/idl_node.py | python | IDLNode.GetOneOf | (self, *keys) | return None | Get an object for the given key(s). | Get an object for the given key(s). | [
"Get",
"an",
"object",
"for",
"the",
"given",
"key",
"(",
"s",
")",
"."
] | def GetOneOf(self, *keys):
"""Get an object for the given key(s)."""
out = self.GetListOf(*keys)
if out:
return out[0]
return None | [
"def",
"GetOneOf",
"(",
"self",
",",
"*",
"keys",
")",
":",
"out",
"=",
"self",
".",
"GetListOf",
"(",
"*",
"keys",
")",
"if",
"out",
":",
"return",
"out",
"[",
"0",
"]",
"return",
"None"
] | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/ppapi/generators/idl_node.py#L166-L171 | |
tensorflow/minigo | 6d89c202cdceaf449aefc3149ab2110d44f1a6a4 | oneoffs/prepare_bigquery.py | python | parse_comment_node | (comment) | return post_Q, debug_rows | Resign Threshold: -0.88
-0.0662
D4 (100) ==> D16 (14) ==> Q16 (3) ==> Q4 (1) ==> Q: -0.07149
move: action Q U P P-Dir N soft-N p-delta p-rel
D4 : -0.028, -0.048, 0.020, 0.048, 0.064, 100 0.1096 0.06127 1.27
D16 : -0.024, -0.043, 0.019, 0.044, 0.059, 96 0.1053 0.06135 1.40 | Resign Threshold: -0.88
-0.0662
D4 (100) ==> D16 (14) ==> Q16 (3) ==> Q4 (1) ==> Q: -0.07149
move: action Q U P P-Dir N soft-N p-delta p-rel
D4 : -0.028, -0.048, 0.020, 0.048, 0.064, 100 0.1096 0.06127 1.27
D16 : -0.024, -0.043, 0.019, 0.044, 0.059, 96 0.1053 0.06135 1.40 | [
"Resign",
"Threshold",
":",
"-",
"0",
".",
"88",
"-",
"0",
".",
"0662",
"D4",
"(",
"100",
")",
"==",
">",
"D16",
"(",
"14",
")",
"==",
">",
"Q16",
"(",
"3",
")",
"==",
">",
"Q4",
"(",
"1",
")",
"==",
">",
"Q",
":",
"-",
"0",
".",
"07149... | def parse_comment_node(comment):
# Example of a comment node. The resign threshold line appears only
# for the first move in the game; it gets preprocessed by extract_game_data
"""
Resign Threshold: -0.88
-0.0662
D4 (100) ==> D16 (14) ==> Q16 (3) ==> Q4 (1) ==> Q: -0.07149
move: action Q U P... | [
"def",
"parse_comment_node",
"(",
"comment",
")",
":",
"# Example of a comment node. The resign threshold line appears only",
"# for the first move in the game; it gets preprocessed by extract_game_data",
"lines",
"=",
"comment",
".",
"split",
"(",
"'\\n'",
")",
"if",
"lines",
"[... | https://github.com/tensorflow/minigo/blob/6d89c202cdceaf449aefc3149ab2110d44f1a6a4/oneoffs/prepare_bigquery.py#L192-L221 | |
cms-sw/cmssw | fd9de012d503d3405420bcbeec0ec879baa57cf2 | CondTools/SiStrip/python/o2o_helper.py | python | send_mail | (subject, message, send_to, send_from, text_attachments=[]) | Send an email. [send_to] needs to be a list. | Send an email. [send_to] needs to be a list. | [
"Send",
"an",
"email",
".",
"[",
"send_to",
"]",
"needs",
"to",
"be",
"a",
"list",
"."
] | def send_mail(subject, message, send_to, send_from, text_attachments=[]):
'''Send an email. [send_to] needs to be a list.'''
msg = MIMEMultipart()
msg['Subject'] = subject
msg['From'] = send_from
msg['To'] = ','.join(send_to)
msg.attach(MIMEText(message))
for fn in text_attachments:
... | [
"def",
"send_mail",
"(",
"subject",
",",
"message",
",",
"send_to",
",",
"send_from",
",",
"text_attachments",
"=",
"[",
"]",
")",
":",
"msg",
"=",
"MIMEMultipart",
"(",
")",
"msg",
"[",
"'Subject'",
"]",
"=",
"subject",
"msg",
"[",
"'From'",
"]",
"=",... | https://github.com/cms-sw/cmssw/blob/fd9de012d503d3405420bcbeec0ec879baa57cf2/CondTools/SiStrip/python/o2o_helper.py#L131-L147 | ||
hanpfei/chromium-net | 392cc1fa3a8f92f42e4071ab6e674d8e0482f83f | third_party/catapult/telemetry/third_party/web-page-replay/httpclient.py | python | ReplayHttpArchiveFetch.__init__ | (self, http_archive, real_dns_lookup, inject_script,
use_diff_on_unknown_requests=False,
use_closest_match=False, scramble_images=False) | Initialize ReplayHttpArchiveFetch.
Args:
http_archive: an instance of a HttpArchive
real_dns_lookup: a function that resolves a host to an IP.
inject_script: script string to inject in all pages
use_diff_on_unknown_requests: If True, log unknown requests
with a diff to requests that... | Initialize ReplayHttpArchiveFetch. | [
"Initialize",
"ReplayHttpArchiveFetch",
"."
] | def __init__(self, http_archive, real_dns_lookup, inject_script,
use_diff_on_unknown_requests=False,
use_closest_match=False, scramble_images=False):
"""Initialize ReplayHttpArchiveFetch.
Args:
http_archive: an instance of a HttpArchive
real_dns_lookup: a function that... | [
"def",
"__init__",
"(",
"self",
",",
"http_archive",
",",
"real_dns_lookup",
",",
"inject_script",
",",
"use_diff_on_unknown_requests",
"=",
"False",
",",
"use_closest_match",
"=",
"False",
",",
"scramble_images",
"=",
"False",
")",
":",
"self",
".",
"http_archive... | https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/third_party/web-page-replay/httpclient.py#L409-L428 | ||
chromiumembedded/cef | 80caf947f3fe2210e5344713c5281d8af9bdc295 | tools/cef_parser.py | python | obj_class.get_attribs | (self) | return self.attribs | Return all attributes as a dictionary. | Return all attributes as a dictionary. | [
"Return",
"all",
"attributes",
"as",
"a",
"dictionary",
"."
] | def get_attribs(self):
""" Return all attributes as a dictionary. """
return self.attribs | [
"def",
"get_attribs",
"(",
"self",
")",
":",
"return",
"self",
".",
"attribs"
] | https://github.com/chromiumembedded/cef/blob/80caf947f3fe2210e5344713c5281d8af9bdc295/tools/cef_parser.py#L968-L970 | |
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py | python | RawTurtle.end_fill | (self) | Fill the shape drawn after the call begin_fill().
No argument.
Example (for a Turtle instance named turtle):
>>> turtle.begin_fill()
>>> turtle.forward(100)
>>> turtle.left(90)
>>> turtle.forward(100)
>>> turtle.left(90)
>>> turtle.forward(100)
>... | Fill the shape drawn after the call begin_fill(). | [
"Fill",
"the",
"shape",
"drawn",
"after",
"the",
"call",
"begin_fill",
"()",
"."
] | def end_fill(self):
"""Fill the shape drawn after the call begin_fill().
No argument.
Example (for a Turtle instance named turtle):
>>> turtle.begin_fill()
>>> turtle.forward(100)
>>> turtle.left(90)
>>> turtle.forward(100)
>>> turtle.left(90)
>>... | [
"def",
"end_fill",
"(",
"self",
")",
":",
"self",
".",
"fill",
"(",
"False",
")"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/turtle.py#L3197-L3213 | ||
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py | python | _signature_get_partial | (wrapped_sig, partial, extra_args=()) | return wrapped_sig.replace(parameters=new_params.values()) | Private helper to calculate how 'wrapped_sig' signature will
look like after applying a 'functools.partial' object (or alike)
on it. | Private helper to calculate how 'wrapped_sig' signature will
look like after applying a 'functools.partial' object (or alike)
on it. | [
"Private",
"helper",
"to",
"calculate",
"how",
"wrapped_sig",
"signature",
"will",
"look",
"like",
"after",
"applying",
"a",
"functools",
".",
"partial",
"object",
"(",
"or",
"alike",
")",
"on",
"it",
"."
] | def _signature_get_partial(wrapped_sig, partial, extra_args=()):
"""Private helper to calculate how 'wrapped_sig' signature will
look like after applying a 'functools.partial' object (or alike)
on it.
"""
old_params = wrapped_sig.parameters
new_params = OrderedDict(old_params.items())
part... | [
"def",
"_signature_get_partial",
"(",
"wrapped_sig",
",",
"partial",
",",
"extra_args",
"=",
"(",
")",
")",
":",
"old_params",
"=",
"wrapped_sig",
".",
"parameters",
"new_params",
"=",
"OrderedDict",
"(",
"old_params",
".",
"items",
"(",
")",
")",
"partial_arg... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/inspect.py#L1723-L1796 | |
ChromiumWebApps/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | tools/win/toolchain/toolchain.py | python | ExtractIso | (iso_path) | return target_path | Use 7zip to extract the contents of the given .iso (or self-extracting
.exe). | Use 7zip to extract the contents of the given .iso (or self-extracting
.exe). | [
"Use",
"7zip",
"to",
"extract",
"the",
"contents",
"of",
"the",
"given",
".",
"iso",
"(",
"or",
"self",
"-",
"extracting",
".",
"exe",
")",
"."
] | def ExtractIso(iso_path):
"""Use 7zip to extract the contents of the given .iso (or self-extracting
.exe)."""
target_path = TempDir()
sys.stdout.write('Extracting %s...\n' % iso_path)
sys.stdout.flush()
# TODO(scottmg): Do this (and exe) manually with python code.
# Note that at the beginning of main() we... | [
"def",
"ExtractIso",
"(",
"iso_path",
")",
":",
"target_path",
"=",
"TempDir",
"(",
")",
"sys",
".",
"stdout",
".",
"write",
"(",
"'Extracting %s...\\n'",
"%",
"iso_path",
")",
"sys",
".",
"stdout",
".",
"flush",
"(",
")",
"# TODO(scottmg): Do this (and exe) m... | https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/tools/win/toolchain/toolchain.py#L224-L234 | |
eventql/eventql | 7ca0dbb2e683b525620ea30dc40540a22d5eb227 | deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/mac_tool.py | python | MacTool.ExecCopyInfoPlist | (self, source, dest) | Copies the |source| Info.plist to the destination directory |dest|. | Copies the |source| Info.plist to the destination directory |dest|. | [
"Copies",
"the",
"|source|",
"Info",
".",
"plist",
"to",
"the",
"destination",
"directory",
"|dest|",
"."
] | def ExecCopyInfoPlist(self, source, dest):
"""Copies the |source| Info.plist to the destination directory |dest|."""
# Read the source Info.plist into memory.
fd = open(source, 'r')
lines = fd.read()
fd.close()
# Go through all the environment variables and replace them as variables in
# th... | [
"def",
"ExecCopyInfoPlist",
"(",
"self",
",",
"source",
",",
"dest",
")",
":",
"# Read the source Info.plist into memory.",
"fd",
"=",
"open",
"(",
"source",
",",
"'r'",
")",
"lines",
"=",
"fd",
".",
"read",
"(",
")",
"fd",
".",
"close",
"(",
")",
"# Go ... | https://github.com/eventql/eventql/blob/7ca0dbb2e683b525620ea30dc40540a22d5eb227/deps/3rdparty/spidermonkey/mozjs/media/webrtc/trunk/tools/gyp/pylib/gyp/mac_tool.py#L108-L130 | ||
wlanjie/AndroidFFmpeg | 7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf | tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/util.py | python | Finalize.still_active | (self) | return self._key in _finalizer_registry | Return whether this finalizer is still waiting to invoke callback | Return whether this finalizer is still waiting to invoke callback | [
"Return",
"whether",
"this",
"finalizer",
"is",
"still",
"waiting",
"to",
"invoke",
"callback"
] | def still_active(self):
'''
Return whether this finalizer is still waiting to invoke callback
'''
return self._key in _finalizer_registry | [
"def",
"still_active",
"(",
"self",
")",
":",
"return",
"self",
".",
"_key",
"in",
"_finalizer_registry"
] | https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/multiprocessing/util.py#L218-L222 | |
windystrife/UnrealEngine_NVIDIAGameWorks | b50e6338a7c5b26374d66306ebc7807541ff815e | Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py | python | Text.window_cget | (self, index, option) | return self.tk.call(self._w, 'window', 'cget', index, option) | Return the value of OPTION of an embedded window at INDEX. | Return the value of OPTION of an embedded window at INDEX. | [
"Return",
"the",
"value",
"of",
"OPTION",
"of",
"an",
"embedded",
"window",
"at",
"INDEX",
"."
] | def window_cget(self, index, option):
"""Return the value of OPTION of an embedded window at INDEX."""
if option[:1] != '-':
option = '-' + option
if option[-1:] == '_':
option = option[:-1]
return self.tk.call(self._w, 'window', 'cget', index, option) | [
"def",
"window_cget",
"(",
"self",
",",
"index",
",",
"option",
")",
":",
"if",
"option",
"[",
":",
"1",
"]",
"!=",
"'-'",
":",
"option",
"=",
"'-'",
"+",
"option",
"if",
"option",
"[",
"-",
"1",
":",
"]",
"==",
"'_'",
":",
"option",
"=",
"opti... | https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/lib-tk/Tkinter.py#L3166-L3172 | |
lighttransport/nanort | 74063967336311f54ede5dffdfa242123825033b | deps/cpplint.py | python | CheckOperatorSpacing | (filename, clean_lines, linenum, error) | Checks for horizontal spacing around operators.
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. | Checks for horizontal spacing around operators. | [
"Checks",
"for",
"horizontal",
"spacing",
"around",
"operators",
"."
] | def CheckOperatorSpacing(filename, clean_lines, linenum, error):
"""Checks for horizontal spacing around operators.
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... | [
"def",
"CheckOperatorSpacing",
"(",
"filename",
",",
"clean_lines",
",",
"linenum",
",",
"error",
")",
":",
"line",
"=",
"clean_lines",
".",
"elided",
"[",
"linenum",
"]",
"# Don't try to do spacing checks for operator methods. Do this by",
"# replacing the troublesome cha... | https://github.com/lighttransport/nanort/blob/74063967336311f54ede5dffdfa242123825033b/deps/cpplint.py#L3127-L3239 | ||
facebook/ThreatExchange | 31914a51820c73c8a0daffe62ccca29a6e3d359e | hasher-matcher-actioner/hmalib/common/models/models_base.py | python | DynamoDBItem.write_to_table_if_not_found | (self, table: Table) | return True | Write record to DDB if the PK/SK combination does not exist.
Returns:
* True when record was written (did not exist)
* False when record could not be written (PK/SK combo existed) | Write record to DDB if the PK/SK combination does not exist. | [
"Write",
"record",
"to",
"DDB",
"if",
"the",
"PK",
"/",
"SK",
"combination",
"does",
"not",
"exist",
"."
] | def write_to_table_if_not_found(self, table: Table) -> bool:
"""
Write record to DDB if the PK/SK combination does not exist.
Returns:
* True when record was written (did not exist)
* False when record could not be written (PK/SK combo existed)
"""
try:
... | [
"def",
"write_to_table_if_not_found",
"(",
"self",
",",
"table",
":",
"Table",
")",
"->",
"bool",
":",
"try",
":",
"table",
".",
"put_item",
"(",
"Item",
"=",
"self",
".",
"to_dynamodb_item",
"(",
")",
",",
"ConditionExpression",
"=",
"\"attribute_not_exists(P... | https://github.com/facebook/ThreatExchange/blob/31914a51820c73c8a0daffe62ccca29a6e3d359e/hasher-matcher-actioner/hmalib/common/models/models_base.py#L22-L46 | |
tfwu/FaceDetection-ConvNet-3D | f9251c48eb40c5aec8fba7455115c355466555be | python/mxnet/ndarray.py | python | _make_ndarray_function | (handle) | return ret_function | Create a NDArray function from the FunctionHandle. | Create a NDArray function from the FunctionHandle. | [
"Create",
"a",
"NDArray",
"function",
"from",
"the",
"FunctionHandle",
"."
] | def _make_ndarray_function(handle):
"""Create a NDArray function from the FunctionHandle."""
NDARRAY_ARG_BEFORE_SCALAR = 1
ACCEPT_EMPTY_MUTATE_TARGET = 1 << 2
# Get the property of NDArray
n_used_vars = mx_uint()
n_scalars = mx_uint()
n_mutate_vars = mx_uint()
type_mask = ctypes.c_int()
... | [
"def",
"_make_ndarray_function",
"(",
"handle",
")",
":",
"NDARRAY_ARG_BEFORE_SCALAR",
"=",
"1",
"ACCEPT_EMPTY_MUTATE_TARGET",
"=",
"1",
"<<",
"2",
"# Get the property of NDArray",
"n_used_vars",
"=",
"mx_uint",
"(",
")",
"n_scalars",
"=",
"mx_uint",
"(",
")",
"n_mu... | https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/mxnet/ndarray.py#L930-L1078 | |
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/propgrid.py | python | PGChoices.GetId | (*args, **kwargs) | return _propgrid.PGChoices_GetId(*args, **kwargs) | GetId(self) -> PGChoicesId | GetId(self) -> PGChoicesId | [
"GetId",
"(",
"self",
")",
"-",
">",
"PGChoicesId"
] | def GetId(*args, **kwargs):
"""GetId(self) -> PGChoicesId"""
return _propgrid.PGChoices_GetId(*args, **kwargs) | [
"def",
"GetId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_propgrid",
".",
"PGChoices_GetId",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L267-L269 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/site-packages/botocore/docs/bcdoc/docstringparser.py | python | LineItemNode._lstrip | (self, node) | return False | Traverses the tree, stripping out whitespace until text data is found
:param node: The node to strip
:return: True if non-whitespace data was found, False otherwise | Traverses the tree, stripping out whitespace until text data is found
:param node: The node to strip
:return: True if non-whitespace data was found, False otherwise | [
"Traverses",
"the",
"tree",
"stripping",
"out",
"whitespace",
"until",
"text",
"data",
"is",
"found",
":",
"param",
"node",
":",
"The",
"node",
"to",
"strip",
":",
"return",
":",
"True",
"if",
"non",
"-",
"whitespace",
"data",
"was",
"found",
"False",
"o... | def _lstrip(self, node):
"""
Traverses the tree, stripping out whitespace until text data is found
:param node: The node to strip
:return: True if non-whitespace data was found, False otherwise
"""
for child in node.children:
if isinstance(child, DataNode):
... | [
"def",
"_lstrip",
"(",
"self",
",",
"node",
")",
":",
"for",
"child",
"in",
"node",
".",
"children",
":",
"if",
"isinstance",
"(",
"child",
",",
"DataNode",
")",
":",
"child",
".",
"lstrip",
"(",
")",
"if",
"child",
".",
"data",
":",
"return",
"Tru... | 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/docs/bcdoc/docstringparser.py#L154-L170 | |
aws/lumberyard | f85344403c1c2e77ec8c75deb2c116e97b713217 | dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py | python | FTP.connect | (self, host='', port=0, timeout=-999, source_address=None) | return self.welcome | Connect to host. Arguments are:
- host: hostname to connect to (string, default previous host)
- port: port to connect to (integer, default previous port)
- timeout: the timeout to set against the ftp socket(s)
- source_address: a 2-tuple (host, port) for the socket to bind
... | Connect to host. Arguments are:
- host: hostname to connect to (string, default previous host)
- port: port to connect to (integer, default previous port)
- timeout: the timeout to set against the ftp socket(s)
- source_address: a 2-tuple (host, port) for the socket to bind
... | [
"Connect",
"to",
"host",
".",
"Arguments",
"are",
":",
"-",
"host",
":",
"hostname",
"to",
"connect",
"to",
"(",
"string",
"default",
"previous",
"host",
")",
"-",
"port",
":",
"port",
"to",
"connect",
"to",
"(",
"integer",
"default",
"previous",
"port",... | def connect(self, host='', port=0, timeout=-999, source_address=None):
'''Connect to host. Arguments are:
- host: hostname to connect to (string, default previous host)
- port: port to connect to (integer, default previous port)
- timeout: the timeout to set against the ftp socket(s)... | [
"def",
"connect",
"(",
"self",
",",
"host",
"=",
"''",
",",
"port",
"=",
"0",
",",
"timeout",
"=",
"-",
"999",
",",
"source_address",
"=",
"None",
")",
":",
"if",
"host",
"!=",
"''",
":",
"self",
".",
"host",
"=",
"host",
"if",
"port",
">",
"0"... | https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/ftplib.py#L135-L156 | |
gimli-org/gimli | 17aa2160de9b15ababd9ef99e89b1bc3277bbb23 | pygimli/physics/ert/ertScheme.py | python | DataSchemeWennerBeta.createData | (self, **kwargs) | return self.data_ | Create a Wenner-beta dataset.
Don't use directly .. call create from DataSchemeManager or
ert.createData(elecs, schemeName='wb', **kwargs) instead. | Create a Wenner-beta dataset. | [
"Create",
"a",
"Wenner",
"-",
"beta",
"dataset",
"."
] | def createData(self, **kwargs):
"""Create a Wenner-beta dataset.
Don't use directly .. call create from DataSchemeManager or
ert.createData(elecs, schemeName='wb', **kwargs) instead.
"""
nElectrodes = self.nElectrodes_
maxSep = nElectrodes - 2
if self.maxSeparat... | [
"def",
"createData",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"nElectrodes",
"=",
"self",
".",
"nElectrodes_",
"maxSep",
"=",
"nElectrodes",
"-",
"2",
"if",
"self",
".",
"maxSeparation",
"<",
"maxSep",
":",
"maxSep",
"=",
"self",
".",
"maxSeparati... | https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/physics/ert/ertScheme.py#L607-L634 | |
PaddlePaddle/Paddle | 1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c | python/paddle/fluid/contrib/mixed_precision/fp16_utils.py | python | update_role_var_grad | (main_prog, params_grads) | Update op_role_var attr for some ops to make sure the gradients
transferred across GPUs is FP16.
1. Check whether the op that outputs gradient is cast or not.
2. If op is cast and gradient is FP32, remove the op_role_var
and find the prev op which outputs FP16 gradient
3. Update the op_role_var o... | Update op_role_var attr for some ops to make sure the gradients
transferred across GPUs is FP16.
1. Check whether the op that outputs gradient is cast or not.
2. If op is cast and gradient is FP32, remove the op_role_var
and find the prev op which outputs FP16 gradient
3. Update the op_role_var o... | [
"Update",
"op_role_var",
"attr",
"for",
"some",
"ops",
"to",
"make",
"sure",
"the",
"gradients",
"transferred",
"across",
"GPUs",
"is",
"FP16",
".",
"1",
".",
"Check",
"whether",
"the",
"op",
"that",
"outputs",
"gradient",
"is",
"cast",
"or",
"not",
".",
... | def update_role_var_grad(main_prog, params_grads):
"""
Update op_role_var attr for some ops to make sure the gradients
transferred across GPUs is FP16.
1. Check whether the op that outputs gradient is cast or not.
2. If op is cast and gradient is FP32, remove the op_role_var
and find the prev... | [
"def",
"update_role_var_grad",
"(",
"main_prog",
",",
"params_grads",
")",
":",
"block",
"=",
"main_prog",
".",
"global_block",
"(",
")",
"block",
".",
"_sync_with_cpp",
"(",
")",
"BACKWARD",
"=",
"core",
".",
"op_proto_and_checker_maker",
".",
"OpRole",
".",
... | https://github.com/PaddlePaddle/Paddle/blob/1252f4bb3e574df80aa6d18c7ddae1b3a90bd81c/python/paddle/fluid/contrib/mixed_precision/fp16_utils.py#L641-L703 | ||
emscripten-core/emscripten | 0d413d3c5af8b28349682496edc14656f5700c2f | third_party/WebIDL.py | python | Parser.p_ArgumentsEmpty | (self, p) | Arguments : | Arguments : | [
"Arguments",
":"
] | def p_ArgumentsEmpty(self, p):
"""
Arguments :
"""
p[0] = [] | [
"def",
"p_ArgumentsEmpty",
"(",
"self",
",",
"p",
")",
":",
"p",
"[",
"0",
"]",
"=",
"[",
"]"
] | https://github.com/emscripten-core/emscripten/blob/0d413d3c5af8b28349682496edc14656f5700c2f/third_party/WebIDL.py#L4348-L4352 | ||
nasa/fprime | 595cf3682d8365943d86c1a6fe7c78f0a116acf0 | Autocoders/Python/src/fprime_ac/generators/visitors/PortHVisitor.py | python | PortHVisitor._get_args_sum_string | (self, obj) | return arg_str | Return a string of sizeof calls that sum to the port
buffer size for use within the input ports. | Return a string of sizeof calls that sum to the port
buffer size for use within the input ports. | [
"Return",
"a",
"string",
"of",
"sizeof",
"calls",
"that",
"sum",
"to",
"the",
"port",
"buffer",
"size",
"for",
"use",
"within",
"the",
"input",
"ports",
"."
] | def _get_args_sum_string(self, obj):
"""
Return a string of sizeof calls that sum to the port
buffer size for use within the input ports.
"""
args = obj.get_args()
arg_str = ""
# empty list then void args
if len(args) == 0:
arg_str = "0"
... | [
"def",
"_get_args_sum_string",
"(",
"self",
",",
"obj",
")",
":",
"args",
"=",
"obj",
".",
"get_args",
"(",
")",
"arg_str",
"=",
"\"\"",
"# empty list then void args",
"if",
"len",
"(",
"args",
")",
"==",
"0",
":",
"arg_str",
"=",
"\"0\"",
"return",
"arg... | https://github.com/nasa/fprime/blob/595cf3682d8365943d86c1a6fe7c78f0a116acf0/Autocoders/Python/src/fprime_ac/generators/visitors/PortHVisitor.py#L131-L195 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/mailbox.py | python | Maildir.remove | (self, key) | Remove the keyed message; raise KeyError if it doesn't exist. | Remove the keyed message; raise KeyError if it doesn't exist. | [
"Remove",
"the",
"keyed",
"message",
";",
"raise",
"KeyError",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | def remove(self, key):
"""Remove the keyed message; raise KeyError if it doesn't exist."""
os.remove(os.path.join(self._path, self._lookup(key))) | [
"def",
"remove",
"(",
"self",
",",
"key",
")",
":",
"os",
".",
"remove",
"(",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_path",
",",
"self",
".",
"_lookup",
"(",
"key",
")",
")",
")"
] | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/mailbox.py#L308-L310 | ||
wxWidgets/wxPython-Classic | 19571e1ae65f1ac445f5491474121998c97a1bf0 | src/osx_cocoa/html2.py | python | WebView.Create | (*args, **kwargs) | return _html2.WebView_Create(*args, **kwargs) | Create(self, Window parent, int id=ID_ANY, String url=wxWebViewDefaultURLStr,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, String name=wxWebViewNameStr) -> bool | Create(self, Window parent, int id=ID_ANY, String url=wxWebViewDefaultURLStr,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, String name=wxWebViewNameStr) -> bool | [
"Create",
"(",
"self",
"Window",
"parent",
"int",
"id",
"=",
"ID_ANY",
"String",
"url",
"=",
"wxWebViewDefaultURLStr",
"Point",
"pos",
"=",
"DefaultPosition",
"Size",
"size",
"=",
"DefaultSize",
"long",
"style",
"=",
"0",
"String",
"name",
"=",
"wxWebViewNameS... | def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=ID_ANY, String url=wxWebViewDefaultURLStr,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, String name=wxWebViewNameStr) -> bool
"""
return _html2.WebView_Create(*args, **kwargs) | [
"def",
"Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"_html2",
".",
"WebView_Create",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/html2.py#L130-L136 | |
okex/V3-Open-API-SDK | c5abb0db7e2287718e0055e17e57672ce0ec7fd9 | okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/utils/misc.py | python | dist_is_local | (dist) | return is_local(dist_location(dist)) | Return True if given Distribution object is installed locally
(i.e. within current virtualenv).
Always True if we're not in a virtualenv. | Return True if given Distribution object is installed locally
(i.e. within current virtualenv). | [
"Return",
"True",
"if",
"given",
"Distribution",
"object",
"is",
"installed",
"locally",
"(",
"i",
".",
"e",
".",
"within",
"current",
"virtualenv",
")",
"."
] | def dist_is_local(dist):
# type: (Distribution) -> bool
"""
Return True if given Distribution object is installed locally
(i.e. within current virtualenv).
Always True if we're not in a virtualenv.
"""
return is_local(dist_location(dist)) | [
"def",
"dist_is_local",
"(",
"dist",
")",
":",
"# type: (Distribution) -> bool",
"return",
"is_local",
"(",
"dist_location",
"(",
"dist",
")",
")"
] | https://github.com/okex/V3-Open-API-SDK/blob/c5abb0db7e2287718e0055e17e57672ce0ec7fd9/okex-python-sdk-api/venv/Lib/site-packages/pip-19.0.3-py3.8.egg/pip/_internal/utils/misc.py#L326-L335 | |
catboost/catboost | 167f64f237114a4d10b2b4ee42adb4569137debe | contrib/tools/python/src/Lib/_LWPCookieJar.py | python | lwp_cookie_str | (cookie) | return join_header_words([h]) | Return string representation of Cookie in the LWP cookie file format.
Actually, the format is extended a bit -- see module docstring. | Return string representation of Cookie in the LWP cookie file format. | [
"Return",
"string",
"representation",
"of",
"Cookie",
"in",
"the",
"LWP",
"cookie",
"file",
"format",
"."
] | def lwp_cookie_str(cookie):
"""Return string representation of Cookie in the LWP cookie file format.
Actually, the format is extended a bit -- see module docstring.
"""
h = [(cookie.name, cookie.value),
("path", cookie.path),
("domain", cookie.domain)]
if cookie.port is not None:... | [
"def",
"lwp_cookie_str",
"(",
"cookie",
")",
":",
"h",
"=",
"[",
"(",
"cookie",
".",
"name",
",",
"cookie",
".",
"value",
")",
",",
"(",
"\"path\"",
",",
"cookie",
".",
"path",
")",
",",
"(",
"\"domain\"",
",",
"cookie",
".",
"domain",
")",
"]",
... | https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/_LWPCookieJar.py#L20-L47 | |
Xilinx/Vitis-AI | fc74d404563d9951b57245443c73bef389f3657f | tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py | python | crossed_column | (keys, hash_bucket_size, hash_key=None) | return CrossedColumn(
keys=tuple(keys), hash_bucket_size=hash_bucket_size, hash_key=hash_key) | Returns a column for performing crosses of categorical features.
Crossed features will be hashed according to `hash_bucket_size`. Conceptually,
the transformation can be thought of as:
Hash(cartesian product of features) % `hash_bucket_size`
For example, if the input features are:
* SparseTensor referred... | Returns a column for performing crosses of categorical features. | [
"Returns",
"a",
"column",
"for",
"performing",
"crosses",
"of",
"categorical",
"features",
"."
] | def crossed_column(keys, hash_bucket_size, hash_key=None):
"""Returns a column for performing crosses of categorical features.
Crossed features will be hashed according to `hash_bucket_size`. Conceptually,
the transformation can be thought of as:
Hash(cartesian product of features) % `hash_bucket_size`
Fo... | [
"def",
"crossed_column",
"(",
"keys",
",",
"hash_bucket_size",
",",
"hash_key",
"=",
"None",
")",
":",
"if",
"not",
"hash_bucket_size",
"or",
"hash_bucket_size",
"<",
"1",
":",
"raise",
"ValueError",
"(",
"'hash_bucket_size must be > 1. '",
"'hash_bucket_size: {}'",
... | https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/feature_column/feature_column_v2.py#L1982-L2106 | |
apple/turicreate | cce55aa5311300e3ce6af93cb45ba791fd1bdf49 | src/external/xgboost/python-package/xgboost/core.py | python | _load_lib | () | return lib | Load xgboost Library. | Load xgboost Library. | [
"Load",
"xgboost",
"Library",
"."
] | def _load_lib():
"""Load xgboost Library."""
lib_path = find_lib_path()
if len(lib_path) == 0:
return None
lib = ctypes.cdll.LoadLibrary(lib_path[0])
lib.XGBGetLastError.restype = ctypes.c_char_p
return lib | [
"def",
"_load_lib",
"(",
")",
":",
"lib_path",
"=",
"find_lib_path",
"(",
")",
"if",
"len",
"(",
"lib_path",
")",
"==",
"0",
":",
"return",
"None",
"lib",
"=",
"ctypes",
".",
"cdll",
".",
"LoadLibrary",
"(",
"lib_path",
"[",
"0",
"]",
")",
"lib",
"... | https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/src/external/xgboost/python-package/xgboost/core.py#L81-L88 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.