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
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/plugins/Launch/launch/cfgdlg.py
python
CommandListCtrl.OnMenu
(self, evt)
Handle Menu events
Handle Menu events
[ "Handle", "Menu", "events" ]
def OnMenu(self, evt): """Handle Menu events""" e_id = evt.GetId() if e_id == ID_BROWSE: dlg = wx.FileDialog(self, _("Choose and executable")) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() if self._cindex >= 0: se...
[ "def", "OnMenu", "(", "self", ",", "evt", ")", ":", "e_id", "=", "evt", ".", "GetId", "(", ")", "if", "e_id", "==", "ID_BROWSE", ":", "dlg", "=", "wx", ".", "FileDialog", "(", "self", ",", "_", "(", "\"Choose and executable\"", ")", ")", "if", "dlg...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/Launch/launch/cfgdlg.py#L605-L627
andre-martins/TurboParser
a87b8e45694c18b826bb3c42e8344bd32928007d
python/tokenizer/portuguese_contractions.py
python
PortugueseContractions._generate_clitics
(self)
return final_clitic_list, final_suffix_list
Generate clitics (e.g. '-se') and verb suffixes (e.g. '-ei') for Portuguese. :rtype: a list of suffixes and a list of clitics.
Generate clitics (e.g. '-se') and verb suffixes (e.g. '-ei') for Portuguese.
[ "Generate", "clitics", "(", "e", ".", "g", ".", "-", "se", ")", "and", "verb", "suffixes", "(", "e", ".", "g", ".", "-", "ei", ")", "for", "Portuguese", "." ]
def _generate_clitics(self): """ Generate clitics (e.g. '-se') and verb suffixes (e.g. '-ei') for Portuguese. :rtype: a list of suffixes and a list of clitics. """ import numpy as np suffixes = set() clitics = set() # Suffixos dos verbos em meso...
[ "def", "_generate_clitics", "(", "self", ")", ":", "import", "numpy", "as", "np", "suffixes", "=", "set", "(", ")", "clitics", "=", "set", "(", ")", "# Suffixos dos verbos em mesoclíticos.", "suffixes", ".", "add", "(", "u'-ei'", ")", "suffixes", ".", "add",...
https://github.com/andre-martins/TurboParser/blob/a87b8e45694c18b826bb3c42e8344bd32928007d/python/tokenizer/portuguese_contractions.py#L207-L316
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Source/ThirdParty/FakeIt/2.0.2/build/coveralls.py
python
gitrepo
(cwd)
return { 'head': { 'id': repo.gitlog('%H'), 'author_name': repo.gitlog('%aN'), 'author_email': repo.gitlog('%ae'), 'committer_name': repo.gitlog('%cN'), 'committer_email': repo.gitlog('%ce'), 'message': repo.gitlog('%s') }, ...
Return hash of Git data that can be used to display more information to users. Example: "git": { "head": { "id": "5e837ce92220be64821128a70f6093f836dd2c05", "author_name": "Wil Gieseler", "author_email": "wil@example.com", "com...
Return hash of Git data that can be used to display more information to users.
[ "Return", "hash", "of", "Git", "data", "that", "can", "be", "used", "to", "display", "more", "information", "to", "users", "." ]
def gitrepo(cwd): """Return hash of Git data that can be used to display more information to users. Example: "git": { "head": { "id": "5e837ce92220be64821128a70f6093f836dd2c05", "author_name": "Wil Gieseler", "author_email": "wil@example.c...
[ "def", "gitrepo", "(", "cwd", ")", ":", "repo", "=", "Repository", "(", "cwd", ")", "return", "{", "'head'", ":", "{", "'id'", ":", "repo", ".", "gitlog", "(", "'%H'", ")", ",", "'author_name'", ":", "repo", ".", "gitlog", "(", "'%aN'", ")", ",", ...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/ThirdParty/FakeIt/2.0.2/build/coveralls.py#L14-L52
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/contrib/keras/python/keras/utils/data_utils.py
python
SequenceEnqueuer.stop
(self, timeout=None)
Stop running threads and wait for them to exit, if necessary. Should be called by the same thread which called start(). Arguments: timeout: maximum time to wait on thread.join()
Stop running threads and wait for them to exit, if necessary.
[ "Stop", "running", "threads", "and", "wait", "for", "them", "to", "exit", "if", "necessary", "." ]
def stop(self, timeout=None): """Stop running threads and wait for them to exit, if necessary. Should be called by the same thread which called start(). Arguments: timeout: maximum time to wait on thread.join() """ raise NotImplementedError
[ "def", "stop", "(", "self", ",", "timeout", "=", "None", ")", ":", "raise", "NotImplementedError" ]
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/contrib/keras/python/keras/utils/data_utils.py#L423-L431
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/gtk/gizmos.py
python
TreeListCtrl.SetItemImage
(*args, **kwargs)
return _gizmos.TreeListCtrl_SetItemImage(*args, **kwargs)
SetItemImage(self, TreeItemId item, int image, int column=-1, int which=TreeItemIcon_Normal)
SetItemImage(self, TreeItemId item, int image, int column=-1, int which=TreeItemIcon_Normal)
[ "SetItemImage", "(", "self", "TreeItemId", "item", "int", "image", "int", "column", "=", "-", "1", "int", "which", "=", "TreeItemIcon_Normal", ")" ]
def SetItemImage(*args, **kwargs): """SetItemImage(self, TreeItemId item, int image, int column=-1, int which=TreeItemIcon_Normal)""" return _gizmos.TreeListCtrl_SetItemImage(*args, **kwargs)
[ "def", "SetItemImage", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_SetItemImage", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/gtk/gizmos.py#L663-L665
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/tasks/terminal_conditions.py
python
maxstep_terminal_condition
(env, max_step=500)
return env.env_step_counter > max_step
A terminal condition based on the time step. Args: env: An instance of MinitaurGymEnv max_step: The maximum time step allowed for the environment Returns: A boolean indicating if the env.step exceeds the given limit
A terminal condition based on the time step.
[ "A", "terminal", "condition", "based", "on", "the", "time", "step", "." ]
def maxstep_terminal_condition(env, max_step=500): """A terminal condition based on the time step. Args: env: An instance of MinitaurGymEnv max_step: The maximum time step allowed for the environment Returns: A boolean indicating if the env.step exceeds the given limit """ return env.env_step_co...
[ "def", "maxstep_terminal_condition", "(", "env", ",", "max_step", "=", "500", ")", ":", "return", "env", ".", "env_step_counter", ">", "max_step" ]
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/tasks/terminal_conditions.py#L175-L185
tomahawk-player/tomahawk-resolvers
7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d
archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/service_reflection.py
python
_ServiceBuilder.BuildService
(self, cls)
Constructs the service class. Args: cls: The class that will be constructed.
Constructs the service class.
[ "Constructs", "the", "service", "class", "." ]
def BuildService(self, cls): """Constructs the service class. Args: cls: The class that will be constructed. """ # CallMethod needs to operate with an instance of the Service class. This # internal wrapper function exists only to be able to pass the service # instance to the method that ...
[ "def", "BuildService", "(", "self", ",", "cls", ")", ":", "# CallMethod needs to operate with an instance of the Service class. This", "# internal wrapper function exists only to be able to pass the service", "# instance to the method that does the real CallMethod work.", "def", "_WrapCallMe...
https://github.com/tomahawk-player/tomahawk-resolvers/blob/7f827bbe410ccfdb0446f7d6a91acc2199c9cc8d/archive/spotify/breakpad/third_party/protobuf/protobuf/python/google/protobuf/service_reflection.py#L133-L154
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_controls.py
python
SpinCtrlDouble.GetValue
(*args, **kwargs)
return _controls_.SpinCtrlDouble_GetValue(*args, **kwargs)
GetValue(self) -> double
GetValue(self) -> double
[ "GetValue", "(", "self", ")", "-", ">", "double" ]
def GetValue(*args, **kwargs): """GetValue(self) -> double""" return _controls_.SpinCtrlDouble_GetValue(*args, **kwargs)
[ "def", "GetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "SpinCtrlDouble_GetValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_controls.py#L2492-L2494
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/ipython/py3/IPython/core/logger.py
python
Logger.log
(self, line_mod, line_ori)
Write the sources to a log. Inputs: - line_mod: possibly modified input, such as the transformations made by input prefilters or input handlers of various kinds. This should always be valid Python. - line_ori: unmodified input line from the user. This is not nece...
Write the sources to a log.
[ "Write", "the", "sources", "to", "a", "log", "." ]
def log(self, line_mod, line_ori): """Write the sources to a log. Inputs: - line_mod: possibly modified input, such as the transformations made by input prefilters or input handlers of various kinds. This should always be valid Python. - line_ori: unmodified input ...
[ "def", "log", "(", "self", ",", "line_mod", ",", "line_ori", ")", ":", "# Write the log line, but decide which one according to the", "# log_raw_input flag, set when the log is started.", "if", "self", ".", "log_raw_input", ":", "self", ".", "log_write", "(", "line_ori", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/ipython/py3/IPython/core/logger.py#L167-L185
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/node/base.py
python
Node.GetTextualIds
(self)
return []
Returns a list of the textual ids of this node.
Returns a list of the textual ids of this node.
[ "Returns", "a", "list", "of", "the", "textual", "ids", "of", "this", "node", "." ]
def GetTextualIds(self): '''Returns a list of the textual ids of this node. ''' if 'name' in self.attrs: return [self.attrs['name']] return []
[ "def", "GetTextualIds", "(", "self", ")", ":", "if", "'name'", "in", "self", ".", "attrs", ":", "return", "[", "self", ".", "attrs", "[", "'name'", "]", "]", "return", "[", "]" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/node/base.py#L465-L470
choasup/caffe-yolo9000
e8a476c4c23d756632f7a26c681a96e3ab672544
python/caffe/io.py
python
Transformer.set_raw_scale
(self, in_, scale)
Set the scale of raw features s.t. the input blob = input * scale. While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale of these models must be 255. Parameters ---------- in_ : which input ...
Set the scale of raw features s.t. the input blob = input * scale. While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale of these models must be 255.
[ "Set", "the", "scale", "of", "raw", "features", "s", ".", "t", ".", "the", "input", "blob", "=", "input", "*", "scale", ".", "While", "Python", "represents", "images", "in", "[", "0", "1", "]", "certain", "Caffe", "models", "like", "CaffeNet", "and", ...
def set_raw_scale(self, in_, scale): """ Set the scale of raw features s.t. the input blob = input * scale. While Python represents images in [0, 1], certain Caffe models like CaffeNet and AlexNet represent images in [0, 255] so the raw_scale of these models must be 255. ...
[ "def", "set_raw_scale", "(", "self", ",", "in_", ",", "scale", ")", ":", "self", ".", "__check_input", "(", "in_", ")", "self", ".", "raw_scale", "[", "in_", "]", "=", "scale" ]
https://github.com/choasup/caffe-yolo9000/blob/e8a476c4c23d756632f7a26c681a96e3ab672544/python/caffe/io.py#L221-L234
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/rewrites/registry.py
python
Rewrite.match
(self, func_ir, block, typemap, calltypes)
return False
Overload this method to check an IR block for matching terms in the rewrite.
Overload this method to check an IR block for matching terms in the rewrite.
[ "Overload", "this", "method", "to", "check", "an", "IR", "block", "for", "matching", "terms", "in", "the", "rewrite", "." ]
def match(self, func_ir, block, typemap, calltypes): '''Overload this method to check an IR block for matching terms in the rewrite. ''' return False
[ "def", "match", "(", "self", ",", "func_ir", ",", "block", ",", "typemap", ",", "calltypes", ")", ":", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numba/rewrites/registry.py#L17-L21
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/weakref.py
python
finalize.atexit
(self)
return bool(info) and info.atexit
Whether finalizer should be called at exit
Whether finalizer should be called at exit
[ "Whether", "finalizer", "should", "be", "called", "at", "exit" ]
def atexit(self): """Whether finalizer should be called at exit""" info = self._registry.get(self) return bool(info) and info.atexit
[ "def", "atexit", "(", "self", ")", ":", "info", "=", "self", ".", "_registry", ".", "get", "(", "self", ")", "return", "bool", "(", "info", ")", "and", "info", ".", "atexit" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/weakref.py#L596-L599
arangodb/arangodb
0d658689c7d1b721b314fa3ca27d38303e1570c8
3rdParty/V8/gyp/generator/msvs.py
python
_GetOutputTargetExt
(spec)
return None
Returns the extension for this target, including the dot If product_extension is specified, set target_extension to this to avoid MSB8012, returns None otherwise. Ignores any target_extension settings in the input files. Arguments: spec: The target dictionary containing the properties of the target. Ret...
Returns the extension for this target, including the dot
[ "Returns", "the", "extension", "for", "this", "target", "including", "the", "dot" ]
def _GetOutputTargetExt(spec): """Returns the extension for this target, including the dot If product_extension is specified, set target_extension to this to avoid MSB8012, returns None otherwise. Ignores any target_extension settings in the input files. Arguments: spec: The target dictionary containing...
[ "def", "_GetOutputTargetExt", "(", "spec", ")", ":", "target_extension", "=", "spec", ".", "get", "(", "'product_extension'", ")", "if", "target_extension", ":", "return", "'.'", "+", "target_extension", "return", "None" ]
https://github.com/arangodb/arangodb/blob/0d658689c7d1b721b314fa3ca27d38303e1570c8/3rdParty/V8/gyp/generator/msvs.py#L1060-L1075
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/tools/Editra/plugins/codebrowser/codebrowser/gentag/taglib.py
python
Class.AddMethod
(self, method)
Convenience method for adding a L{Method} to the class object @param method: L{Method} object
Convenience method for adding a L{Method} to the class object @param method: L{Method} object
[ "Convenience", "method", "for", "adding", "a", "L", "{", "Method", "}", "to", "the", "class", "object", "@param", "method", ":", "L", "{", "Method", "}", "object" ]
def AddMethod(self, method): """Convenience method for adding a L{Method} to the class object @param method: L{Method} object """ self.AddElement('method', method)
[ "def", "AddMethod", "(", "self", ",", "method", ")", ":", "self", ".", "AddElement", "(", "'method'", ",", "method", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/tools/Editra/plugins/codebrowser/codebrowser/gentag/taglib.py#L248-L253
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/utils/base.py
python
saveResult
(fname, data, rrms=None, chi2=None, mode='w')
Save rms/chi2 results into filename.
Save rms/chi2 results into filename.
[ "Save", "rms", "/", "chi2", "results", "into", "filename", "." ]
def saveResult(fname, data, rrms=None, chi2=None, mode='w'): """Save rms/chi2 results into filename.""" pg.warn("utils.saveResult .. in use? (debug)") with open(fname, mode) as f: np.savetxt(f, data) if rrms is not None: f.write('\nrrms:{}\n'.format(rrms)) if chi2 is not ...
[ "def", "saveResult", "(", "fname", ",", "data", ",", "rrms", "=", "None", ",", "chi2", "=", "None", ",", "mode", "=", "'w'", ")", ":", "pg", ".", "warn", "(", "\"utils.saveResult .. in use? (debug)\"", ")", "with", "open", "(", "fname", ",", "mode", ")...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/utils/base.py#L127-L135
google/mozc
7329757e1ad30e327c1ae823a8302c79482d6b9c
src/android/vectorgraphics/gen_mozc_drawable.py
python
MozcDrawableConverter._ParseColor
(self, color)
return c
Parses color attribute and returns int32 value or None.
Parses color attribute and returns int32 value or None.
[ "Parses", "color", "attribute", "and", "returns", "int32", "value", "or", "None", "." ]
def _ParseColor(self, color): """Parses color attribute and returns int32 value or None.""" if color == 'none': return None m = COLOR_PATTERN.match(color) if not m: return None c_str = m.group(1) if 3 <= len(c_str) <= 4: expanded_c_str = '' for ch in c_str: expa...
[ "def", "_ParseColor", "(", "self", ",", "color", ")", ":", "if", "color", "==", "'none'", ":", "return", "None", "m", "=", "COLOR_PATTERN", ".", "match", "(", "color", ")", "if", "not", "m", ":", "return", "None", "c_str", "=", "m", ".", "group", "...
https://github.com/google/mozc/blob/7329757e1ad30e327c1ae823a8302c79482d6b9c/src/android/vectorgraphics/gen_mozc_drawable.py#L232-L256
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/richtext.py
python
RichTextPrinting.PreviewFile
(*args, **kwargs)
return _richtext.RichTextPrinting_PreviewFile(*args, **kwargs)
PreviewFile(self, String richTextFile) -> bool
PreviewFile(self, String richTextFile) -> bool
[ "PreviewFile", "(", "self", "String", "richTextFile", ")", "-", ">", "bool" ]
def PreviewFile(*args, **kwargs): """PreviewFile(self, String richTextFile) -> bool""" return _richtext.RichTextPrinting_PreviewFile(*args, **kwargs)
[ "def", "PreviewFile", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_richtext", ".", "RichTextPrinting_PreviewFile", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/richtext.py#L4492-L4494
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Inelastic/Direct/diagnostics.py
python
get_failed_spectra_list
(diag_workspace)
return failed_spectra
Compile a list of spectra numbers that are marked as masked in the given workspace Input: diag_workspace - A workspace containing masking
Compile a list of spectra numbers that are marked as masked in the given workspace
[ "Compile", "a", "list", "of", "spectra", "numbers", "that", "are", "marked", "as", "masked", "in", "the", "given", "workspace" ]
def get_failed_spectra_list(diag_workspace): """Compile a list of spectra numbers that are marked as masked in the given workspace Input: diag_workspace - A workspace containing masking """ if isinstance(diag_workspace, str): diag_workspace = mtd[diag_workspace] failed_spectra ...
[ "def", "get_failed_spectra_list", "(", "diag_workspace", ")", ":", "if", "isinstance", "(", "diag_workspace", ",", "str", ")", ":", "diag_workspace", "=", "mtd", "[", "diag_workspace", "]", "failed_spectra", "=", "[", "]", "spectrumInfo", "=", "diag_workspace", ...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Inelastic/Direct/diagnostics.py#L449-L467
infinit/memo
3a8394d0f647efe03ccb8bfe885a7279cb8be8a6
elle/drake/src/drake/__init__.py
python
ArchiveExtractor.__init__
(self, tarball, targets = [], patches = None, patch_dir = drake.Path('.'))
Constructor @param targets: list of paths (not nodes) @param patches: list of (patch_node, strip_level)
Constructor
[ "Constructor" ]
def __init__(self, tarball, targets = [], patches = None, patch_dir = drake.Path('.')): """ Constructor @param targets: list of paths (not nodes) @param patches: list of (patch_node, strip_level) """ self.__tarball = tarball self.__patches = patches if patches is not None ...
[ "def", "__init__", "(", "self", ",", "tarball", ",", "targets", "=", "[", "]", ",", "patches", "=", "None", ",", "patch_dir", "=", "drake", ".", "Path", "(", "'.'", ")", ")", ":", "self", ".", "__tarball", "=", "tarball", "self", ".", "__patches", ...
https://github.com/infinit/memo/blob/3a8394d0f647efe03ccb8bfe885a7279cb8be8a6/elle/drake/src/drake/__init__.py#L4253-L4275
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_lines.py
python
Line.drawSegment
(self, point)
Draws new line segment.
Draws new line segment.
[ "Draws", "new", "line", "segment", "." ]
def drawSegment(self, point): """Draws new line segment.""" import Part if self.planetrack and self.node: self.planetrack.set(self.node[-1]) if len(self.node) == 1: _msg(translate("draft", "Pick next point")) elif len(self.node) == 2: last = se...
[ "def", "drawSegment", "(", "self", ",", "point", ")", ":", "import", "Part", "if", "self", ".", "planetrack", "and", "self", ".", "node", ":", "self", ".", "planetrack", ".", "set", "(", "self", ".", "node", "[", "-", "1", "]", ")", "if", "len", ...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_lines.py#L224-L245
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
dom/bindings/mozwebidlcodegen/__init__.py
python
WebIDLCodegenManagerState.dump
(self, fh)
Dump serialized state to a file handle.
Dump serialized state to a file handle.
[ "Dump", "serialized", "state", "to", "a", "file", "handle", "." ]
def dump(self, fh): """Dump serialized state to a file handle.""" normalized = deepcopy(self) for k, v in self['webidls'].items(): # Convert sets to lists because JSON doesn't support sets. normalized['webidls'][k]['outputs'] = sorted(v['outputs']) normalized...
[ "def", "dump", "(", "self", ",", "fh", ")", ":", "normalized", "=", "deepcopy", "(", "self", ")", "for", "k", ",", "v", "in", "self", "[", "'webidls'", "]", ".", "items", "(", ")", ":", "# Convert sets to lists because JSON doesn't support sets.", "normalize...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/dom/bindings/mozwebidlcodegen/__init__.py#L109-L118
tensorflow/deepmath
b5b721f54de1d5d6a02d78f5da5995237f9995f9
deepmath/deephol/prover.py
python
setup_prover
(theorem_database: proof_assistant_pb2.TheoremDatabase)
return proof_assistant_obj
Starts up HOL and seeds it with given TheoremDatabase.
Starts up HOL and seeds it with given TheoremDatabase.
[ "Starts", "up", "HOL", "and", "seeds", "it", "with", "given", "TheoremDatabase", "." ]
def setup_prover(theorem_database: proof_assistant_pb2.TheoremDatabase): """Starts up HOL and seeds it with given TheoremDatabase.""" tf.logging.info('Setting up and registering theorems with proof assistant...') proof_assistant_obj = proof_assistant.ProofAssistant() for thm in theorem_database.theorems: re...
[ "def", "setup_prover", "(", "theorem_database", ":", "proof_assistant_pb2", ".", "TheoremDatabase", ")", ":", "tf", ".", "logging", ".", "info", "(", "'Setting up and registering theorems with proof assistant...'", ")", "proof_assistant_obj", "=", "proof_assistant", ".", ...
https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/deephol/prover.py#L359-L370
deepmind/open_spiel
4ca53bea32bb2875c7385d215424048ae92f78c8
open_spiel/python/algorithms/cfr.py
python
_CFRSolverBase._get_infostate_policy
(self, info_state_str)
return { action: prob_vec[action] for action in info_state_node.legal_actions }
Returns an {action: prob} dictionary for the policy on `info_state`.
Returns an {action: prob} dictionary for the policy on `info_state`.
[ "Returns", "an", "{", "action", ":", "prob", "}", "dictionary", "for", "the", "policy", "on", "info_state", "." ]
def _get_infostate_policy(self, info_state_str): """Returns an {action: prob} dictionary for the policy on `info_state`.""" info_state_node = self._info_state_nodes[info_state_str] prob_vec = self._current_policy.action_probability_array[ info_state_node.index_in_tabular_policy] return { ...
[ "def", "_get_infostate_policy", "(", "self", ",", "info_state_str", ")", ":", "info_state_node", "=", "self", ".", "_info_state_nodes", "[", "info_state_str", "]", "prob_vec", "=", "self", ".", "_current_policy", ".", "action_probability_array", "[", "info_state_node"...
https://github.com/deepmind/open_spiel/blob/4ca53bea32bb2875c7385d215424048ae92f78c8/open_spiel/python/algorithms/cfr.py#L343-L350
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py2/scipy/optimize/_tstutils.py
python
f2
(x)
return x**2 - 1
r"""f2 is a symmetric parabola, x**2 - 1
r"""f2 is a symmetric parabola, x**2 - 1
[ "r", "f2", "is", "a", "symmetric", "parabola", "x", "**", "2", "-", "1" ]
def f2(x): r"""f2 is a symmetric parabola, x**2 - 1""" return x**2 - 1
[ "def", "f2", "(", "x", ")", ":", "return", "x", "**", "2", "-", "1" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py2/scipy/optimize/_tstutils.py#L76-L78
openthread/openthread
9fcdbed9c526c70f1556d1ed84099c1535c7cd32
tools/harness-automation/autothreadharness/harness_case.py
python
HarnessCase._setup_page
(self)
Do sniffer settings and general settings
Do sniffer settings and general settings
[ "Do", "sniffer", "settings", "and", "general", "settings" ]
def _setup_page(self): """Do sniffer settings and general settings """ if not self.started: self.started = time.time() # Detect Sniffer try: dialog = self._browser.find_element_by_id('capture-Setup-modal') except BaseException: logger....
[ "def", "_setup_page", "(", "self", ")", ":", "if", "not", "self", ".", "started", ":", "self", ".", "started", "=", "time", ".", "time", "(", ")", "# Detect Sniffer", "try", ":", "dialog", "=", "self", ".", "_browser", ".", "find_element_by_id", "(", "...
https://github.com/openthread/openthread/blob/9fcdbed9c526c70f1556d1ed84099c1535c7cd32/tools/harness-automation/autothreadharness/harness_case.py#L377-L466
learnforpractice/pyeos
4f04eb982c86c1fdb413084af77c713a6fda3070
libraries/vm/vm_cpython_ss/lib/codecs.py
python
IncrementalDecoder.__init__
(self, errors='strict')
Create an IncrementalDecoder instance. The IncrementalDecoder may use different error handling schemes by providing the errors keyword argument. See the module docstring for a list of possible values.
Create an IncrementalDecoder instance.
[ "Create", "an", "IncrementalDecoder", "instance", "." ]
def __init__(self, errors='strict'): """ Create an IncrementalDecoder instance. The IncrementalDecoder may use different error handling schemes by providing the errors keyword argument. See the module docstring for a list of possible values. """ self.errors = err...
[ "def", "__init__", "(", "self", ",", "errors", "=", "'strict'", ")", ":", "self", ".", "errors", "=", "errors" ]
https://github.com/learnforpractice/pyeos/blob/4f04eb982c86c1fdb413084af77c713a6fda3070/libraries/vm/vm_cpython_ss/lib/codecs.py#L259-L267
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/spec.py
python
AbstractFileSystem.copy
(self, path1, path2, **kwargs)
Copy within two locations in the filesystem
Copy within two locations in the filesystem
[ "Copy", "within", "two", "locations", "in", "the", "filesystem" ]
def copy(self, path1, path2, **kwargs): """ Copy within two locations in the filesystem""" raise NotImplementedError
[ "def", "copy", "(", "self", ",", "path1", ",", "path2", ",", "*", "*", "kwargs", ")", ":", "raise", "NotImplementedError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/fsspec/spec.py#L663-L665
tfwu/FaceDetection-ConvNet-3D
f9251c48eb40c5aec8fba7455115c355466555be
python/mxnet/model.py
python
FeedForward.create
(symbol, X, y=None, ctx=None, num_epoch=None, epoch_size=None, optimizer='sgd', initializer=Uniform(0.01), eval_data=None, eval_metric='acc', epoch_end_callback=None, batch_end_callback=None, kvstore='local', logger=None, work_load_list=None, ev...
return model
Functional style to create a model. This function will be more consistent with functional languages such as R, where mutation is not allowed. Parameters ---------- symbol : Symbol The symbol configuration of computation network. X : DataIter Traini...
Functional style to create a model. This function will be more consistent with functional languages such as R, where mutation is not allowed. Parameters ---------- symbol : Symbol The symbol configuration of computation network. X : DataIter Traini...
[ "Functional", "style", "to", "create", "a", "model", ".", "This", "function", "will", "be", "more", "consistent", "with", "functional", "languages", "such", "as", "R", "where", "mutation", "is", "not", "allowed", ".", "Parameters", "----------", "symbol", ":",...
def create(symbol, X, y=None, ctx=None, num_epoch=None, epoch_size=None, optimizer='sgd', initializer=Uniform(0.01), eval_data=None, eval_metric='acc', epoch_end_callback=None, batch_end_callback=None, kvstore='local', logger=None, work_load_list=None, ...
[ "def", "create", "(", "symbol", ",", "X", ",", "y", "=", "None", ",", "ctx", "=", "None", ",", "num_epoch", "=", "None", ",", "epoch_size", "=", "None", ",", "optimizer", "=", "'sgd'", ",", "initializer", "=", "Uniform", "(", "0.01", ")", ",", "eva...
https://github.com/tfwu/FaceDetection-ConvNet-3D/blob/f9251c48eb40c5aec8fba7455115c355466555be/python/mxnet/model.py#L829-L894
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/viewer/mpl/boreholes.py
python
BoreHole._load
(self)
Loads the data file.
Loads the data file.
[ "Loads", "the", "data", "file", "." ]
def _load(self): """Loads the data file.""" self.data = np.genfromtxt(self._fname, dtype=None) if self.data.size > 1: header = self.data[0][2].split('_') self.borehole_id = header[0] self._textoffset = float(header[1]) self.inline_pos = (self.data[...
[ "def", "_load", "(", "self", ")", ":", "self", ".", "data", "=", "np", ".", "genfromtxt", "(", "self", ".", "_fname", ",", "dtype", "=", "None", ")", "if", "self", ".", "data", ".", "size", ">", "1", ":", "header", "=", "self", ".", "data", "["...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/viewer/mpl/boreholes.py#L54-L67
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/contrib/losses/python/losses/loss_ops.py
python
sigmoid_cross_entropy
(logits, multi_class_labels, weight=1.0, label_smoothing=0, scope=None)
Creates a cross-entropy loss using tf.nn.sigmoid_cross_entropy_with_logits. `weight` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the given value. If `weight` is a tensor of size [`batch_size`], then the loss weights apply to each corresponding sample. If `l...
Creates a cross-entropy loss using tf.nn.sigmoid_cross_entropy_with_logits.
[ "Creates", "a", "cross", "-", "entropy", "loss", "using", "tf", ".", "nn", ".", "sigmoid_cross_entropy_with_logits", "." ]
def sigmoid_cross_entropy(logits, multi_class_labels, weight=1.0, label_smoothing=0, scope=None): """Creates a cross-entropy loss using tf.nn.sigmoid_cross_entropy_with_logits. `weight` acts as a coefficient for the loss. If a scalar is provided, then the loss is simply scaled by the gi...
[ "def", "sigmoid_cross_entropy", "(", "logits", ",", "multi_class_labels", ",", "weight", "=", "1.0", ",", "label_smoothing", "=", "0", ",", "scope", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "scope", ",", "\"sigmoid_cross_entropy_loss\"", "...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/contrib/losses/python/losses/loss_ops.py#L300-L341
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/jedi/jedi/evaluate/analysis.py
python
_check_for_setattr
(instance)
return any(node.start_pos < stmt.start_pos < node.end_pos for stmt in stmts)
Check if there's any setattr method inside an instance. If so, return True.
Check if there's any setattr method inside an instance. If so, return True.
[ "Check", "if", "there", "s", "any", "setattr", "method", "inside", "an", "instance", ".", "If", "so", "return", "True", "." ]
def _check_for_setattr(instance): """ Check if there's any setattr method inside an instance. If so, return True. """ from jedi.evaluate.context import ModuleContext module = instance.get_root_context() if not isinstance(module, ModuleContext): return False node = module.tree_node ...
[ "def", "_check_for_setattr", "(", "instance", ")", ":", "from", "jedi", ".", "evaluate", ".", "context", "import", "ModuleContext", "module", "=", "instance", ".", "get_root_context", "(", ")", "if", "not", "isinstance", "(", "module", ",", "ModuleContext", ")...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/jedi/jedi/evaluate/analysis.py#L94-L110
facebookincubator/BOLT
88c70afe9d388ad430cc150cc158641701397f70
third-party/benchmark/tools/gbench/util.py
python
run_benchmark
(exe_name, benchmark_flags)
return json_res
Run a benchmark specified by 'exe_name' with the specified 'benchmark_flags'. The benchmark is run directly as a subprocess to preserve real time console output. RETURNS: A JSON object representing the benchmark output
Run a benchmark specified by 'exe_name' with the specified 'benchmark_flags'. The benchmark is run directly as a subprocess to preserve real time console output. RETURNS: A JSON object representing the benchmark output
[ "Run", "a", "benchmark", "specified", "by", "exe_name", "with", "the", "specified", "benchmark_flags", ".", "The", "benchmark", "is", "run", "directly", "as", "a", "subprocess", "to", "preserve", "real", "time", "console", "output", ".", "RETURNS", ":", "A", ...
def run_benchmark(exe_name, benchmark_flags): """ Run a benchmark specified by 'exe_name' with the specified 'benchmark_flags'. The benchmark is run directly as a subprocess to preserve real time console output. RETURNS: A JSON object representing the benchmark output """ output_name = find_...
[ "def", "run_benchmark", "(", "exe_name", ",", "benchmark_flags", ")", ":", "output_name", "=", "find_benchmark_flag", "(", "'--benchmark_out='", ",", "benchmark_flags", ")", "is_temp_output", "=", "False", "if", "output_name", "is", "None", ":", "is_temp_output", "=...
https://github.com/facebookincubator/BOLT/blob/88c70afe9d388ad430cc150cc158641701397f70/third-party/benchmark/tools/gbench/util.py#L140-L166
lighttransport/nanort
74063967336311f54ede5dffdfa242123825033b
deps/cpplint.py
python
IsRValueType
(typenames, clean_lines, nesting_state, linenum, column)
return False
Check if the token ending on (linenum, column) is a type. Assumes that text to the right of the column is "&&" or a function name. Args: typenames: set of type names from template-argument-list. clean_lines: A CleansedLines instance containing the file. nesting_state: A NestingState instance which m...
Check if the token ending on (linenum, column) is a type.
[ "Check", "if", "the", "token", "ending", "on", "(", "linenum", "column", ")", "is", "a", "type", "." ]
def IsRValueType(typenames, clean_lines, nesting_state, linenum, column): """Check if the token ending on (linenum, column) is a type. Assumes that text to the right of the column is "&&" or a function name. Args: typenames: set of type names from template-argument-list. clean_lines: A CleansedLines i...
[ "def", "IsRValueType", "(", "typenames", ",", "clean_lines", ",", "nesting_state", ",", "linenum", ",", "column", ")", ":", "prefix", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "[", "0", ":", "column", "]", "# Get one word to the left. If we failed...
https://github.com/lighttransport/nanort/blob/74063967336311f54ede5dffdfa242123825033b/deps/cpplint.py#L3431-L3632
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/_collections_abc.py
python
MutableSequence.insert
(self, index, value)
S.insert(index, value) -- insert value before index
S.insert(index, value) -- insert value before index
[ "S", ".", "insert", "(", "index", "value", ")", "--", "insert", "value", "before", "index" ]
def insert(self, index, value): 'S.insert(index, value) -- insert value before index' raise IndexError
[ "def", "insert", "(", "self", ",", "index", ",", "value", ")", ":", "raise", "IndexError" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/_collections_abc.py#L965-L967
forkineye/ESPixelStick
22926f1c0d1131f1369fc7cad405689a095ae3cb
dist/bin/esptool/serial/tools/miniterm.py
python
Miniterm.change_filter
(self)
change the i/o transformations
change the i/o transformations
[ "change", "the", "i", "/", "o", "transformations" ]
def change_filter(self): """change the i/o transformations""" sys.stderr.write('\n--- Available Filters:\n') sys.stderr.write('\n'.join( '--- {:<10} = {.__doc__}'.format(k, v) for k, v in sorted(TRANSFORMATIONS.items()))) sys.stderr.write('\n--- Enter new filter...
[ "def", "change_filter", "(", "self", ")", ":", "sys", ".", "stderr", ".", "write", "(", "'\\n--- Available Filters:\\n'", ")", "sys", ".", "stderr", ".", "write", "(", "'\\n'", ".", "join", "(", "'--- {:<10} = {.__doc__}'", ".", "format", "(", "k", ",", ...
https://github.com/forkineye/ESPixelStick/blob/22926f1c0d1131f1369fc7cad405689a095ae3cb/dist/bin/esptool/serial/tools/miniterm.py#L603-L620
grpc/grpc
27bc6fe7797e43298dc931b96dc57322d0852a9f
examples/python/route_guide/route_guide_pb2_grpc.py
python
RouteGuideServicer.GetFeature
(self, request, context)
A simple RPC. Obtains the feature at a given position. A feature with an empty name is returned if there's no feature at the given position.
A simple RPC.
[ "A", "simple", "RPC", "." ]
def GetFeature(self, request, context): """A simple RPC. Obtains the feature at a given position. A feature with an empty name is returned if there's no feature at the given position. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') rai...
[ "def", "GetFeature", "(", "self", ",", "request", ",", "context", ")", ":", "context", ".", "set_code", "(", "grpc", ".", "StatusCode", ".", "UNIMPLEMENTED", ")", "context", ".", "set_details", "(", "'Method not implemented!'", ")", "raise", "NotImplementedError...
https://github.com/grpc/grpc/blob/27bc6fe7797e43298dc931b96dc57322d0852a9f/examples/python/route_guide/route_guide_pb2_grpc.py#L43-L53
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/genpy/src/genpy/rostime.py
python
TVal.to_sec
(self)
return float(self.secs) + float(self.nsecs) / 1e9
:returns: time as float seconds (same as time.time() representation), ``float``
:returns: time as float seconds (same as time.time() representation), ``float``
[ ":", "returns", ":", "time", "as", "float", "seconds", "(", "same", "as", "time", ".", "time", "()", "representation", ")", "float" ]
def to_sec(self): """ :returns: time as float seconds (same as time.time() representation), ``float`` """ return float(self.secs) + float(self.nsecs) / 1e9
[ "def", "to_sec", "(", "self", ")", ":", "return", "float", "(", "self", ".", "secs", ")", "+", "float", "(", "self", ".", "nsecs", ")", "/", "1e9" ]
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/genpy/src/genpy/rostime.py#L104-L108
Tencent/CMONGO
c40380caa14e05509f46993aa8b8da966b09b0b5
src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/link.py
python
_versioned_lib_suffix
(env, suffix, version)
return suffix
For suffix='.so' and version='0.1.2' it returns '.so.0.1.2
For suffix='.so' and version='0.1.2' it returns '.so.0.1.2
[ "For", "suffix", "=", ".", "so", "and", "version", "=", "0", ".", "1", ".", "2", "it", "returns", ".", "so", ".", "0", ".", "1", ".", "2" ]
def _versioned_lib_suffix(env, suffix, version): """For suffix='.so' and version='0.1.2' it returns '.so.0.1.2'""" Verbose = False if Verbose: print "_versioned_lib_suffix: suffix=%r" % suffix print "_versioned_lib_suffix: version=%r" % version if not suffix.endswith(version): su...
[ "def", "_versioned_lib_suffix", "(", "env", ",", "suffix", ",", "version", ")", ":", "Verbose", "=", "False", "if", "Verbose", ":", "print", "\"_versioned_lib_suffix: suffix=%r\"", "%", "suffix", "print", "\"_versioned_lib_suffix: version=%r\"", "%", "version", "if", ...
https://github.com/Tencent/CMONGO/blob/c40380caa14e05509f46993aa8b8da966b09b0b5/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/link.py#L145-L155
hughperkins/tf-coriander
970d3df6c11400ad68405f22b0c42a52374e94ca
tensorflow/python/framework/ops.py
python
Graph.name_scope
(self, name)
r"""Returns a context manager that creates hierarchical names for operations. A graph maintains a stack of name scopes. A `with name_scope(...):` statement pushes a new name onto the stack for the lifetime of the context. The `name` argument will be interpreted as follows: * A string (not ending with...
r"""Returns a context manager that creates hierarchical names for operations.
[ "r", "Returns", "a", "context", "manager", "that", "creates", "hierarchical", "names", "for", "operations", "." ]
def name_scope(self, name): r"""Returns a context manager that creates hierarchical names for operations. A graph maintains a stack of name scopes. A `with name_scope(...):` statement pushes a new name onto the stack for the lifetime of the context. The `name` argument will be interpreted as follows: ...
[ "def", "name_scope", "(", "self", ",", "name", ")", ":", "if", "name", ":", "if", "self", ".", "_name_stack", ":", "# Scopes created in a nested scope may have initial characters", "# that are illegal as the initial character of an op name", "# (viz. '-', '\\', '/', and '_').", ...
https://github.com/hughperkins/tf-coriander/blob/970d3df6c11400ad68405f22b0c42a52374e94ca/tensorflow/python/framework/ops.py#L2795-L2901
FreeCAD/FreeCAD
ba42231b9c6889b89e064d6d563448ed81e376ec
src/Mod/Draft/draftguitools/gui_shapestrings.py
python
ShapeString.GetResources
(self)
return d
Set icon, menu and tooltip.
Set icon, menu and tooltip.
[ "Set", "icon", "menu", "and", "tooltip", "." ]
def GetResources(self): """Set icon, menu and tooltip.""" d = {'Pixmap': 'Draft_ShapeString', 'MenuText': QT_TRANSLATE_NOOP("Draft_ShapeString", "Shape from text"), 'ToolTip': QT_TRANSLATE_NOOP("Draft_ShapeString", "Creates a shape from a text string by choosing a specific fon...
[ "def", "GetResources", "(", "self", ")", ":", "d", "=", "{", "'Pixmap'", ":", "'Draft_ShapeString'", ",", "'MenuText'", ":", "QT_TRANSLATE_NOOP", "(", "\"Draft_ShapeString\"", ",", "\"Shape from text\"", ")", ",", "'ToolTip'", ":", "QT_TRANSLATE_NOOP", "(", "\"Dra...
https://github.com/FreeCAD/FreeCAD/blob/ba42231b9c6889b89e064d6d563448ed81e376ec/src/Mod/Draft/draftguitools/gui_shapestrings.py#L63-L69
google/or-tools
2cb85b4eead4c38e1c54b48044f92087cf165bce
ortools/constraint_solver/doc/routing_svg.py
python
SVG.footer
()
Writes svg footer.
Writes svg footer.
[ "Writes", "svg", "footer", "." ]
def footer(): """Writes svg footer.""" print(r'</svg>')
[ "def", "footer", "(", ")", ":", "print", "(", "r'</svg>'", ")" ]
https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/ortools/constraint_solver/doc/routing_svg.py#L321-L323
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/concat_benchmark.py
python
build_graph
(device, input_shape, variable, num_inputs, axis, grad)
Build a graph containing a sequence of concat operations. Args: device: string, the device to run on. input_shape: shape of the input tensors. variable: whether or not to randomize the input shape num_inputs: the number of inputs to concat axis: axis to be concat'ed grad: if True compute the ...
Build a graph containing a sequence of concat operations.
[ "Build", "a", "graph", "containing", "a", "sequence", "of", "concat", "operations", "." ]
def build_graph(device, input_shape, variable, num_inputs, axis, grad): """Build a graph containing a sequence of concat operations. Args: device: string, the device to run on. input_shape: shape of the input tensors. variable: whether or not to randomize the input shape num_inputs: the number of i...
[ "def", "build_graph", "(", "device", ",", "input_shape", ",", "variable", ",", "num_inputs", ",", "axis", ",", "grad", ")", ":", "with", "ops", ".", "device", "(", "\"/%s:0\"", "%", "device", ")", ":", "if", "not", "variable", ":", "inputs", "=", "[", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/concat_benchmark.py#L35-L75
thalium/icebox
99d147d5b9269222225443ce171b4fd46d8985d4
third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py
python
xpathContext.xpathFreeContext
(self)
Free up an xmlXPathContext
Free up an xmlXPathContext
[ "Free", "up", "an", "xmlXPathContext" ]
def xpathFreeContext(self): """Free up an xmlXPathContext """ libxml2mod.xmlXPathFreeContext(self._o)
[ "def", "xpathFreeContext", "(", "self", ")", ":", "libxml2mod", ".", "xmlXPathFreeContext", "(", "self", ".", "_o", ")" ]
https://github.com/thalium/icebox/blob/99d147d5b9269222225443ce171b4fd46d8985d4/third_party/virtualbox/src/libs/libxml2-2.9.4/python/libxml2class.py#L6561-L6563
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
Framework/PythonInterface/plugins/algorithms/ExaminePowderDiffProfile.py
python
ExaminePowderDiffProfile.PyInit
(self)
return
Declare properties
Declare properties
[ "Declare", "properties" ]
def PyInit(self): """ Declare properties """ # Data file self.declareProperty(MatrixWorkspaceProperty("InputWorkspace", "", Direction.Input, PropertyMode.Optional), "Name of data workspace containing the diffraction pattern in .prf file. ") self.decla...
[ "def", "PyInit", "(", "self", ")", ":", "# Data file", "self", ".", "declareProperty", "(", "MatrixWorkspaceProperty", "(", "\"InputWorkspace\"", ",", "\"\"", ",", "Direction", ".", "Input", ",", "PropertyMode", ".", "Optional", ")", ",", "\"Name of data workspace...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/Framework/PythonInterface/plugins/algorithms/ExaminePowderDiffProfile.py#L51-L96
Kitware/kwiver
7ed70308905698b6e88d27ae3dc028c9b016ca0a
python/kwiver/sprokit/processes/simple_homog_tracker.py
python
track
(min_iou=None)
Create a Transformer that performs tracking (only associating tracks with the given minimum IOU). The .step call expects three arguments: - a Kwiver DetectedObjectSet - a Kwiver F2FHomography - a Kwiver timestamp and returns a Kwiver ObjectTrackSet
Create a Transformer that performs tracking (only associating tracks with the given minimum IOU). The .step call expects three arguments: - a Kwiver DetectedObjectSet - a Kwiver F2FHomography - a Kwiver timestamp and returns a Kwiver ObjectTrackSet
[ "Create", "a", "Transformer", "that", "performs", "tracking", "(", "only", "associating", "tracks", "with", "the", "given", "minimum", "IOU", ")", ".", "The", ".", "step", "call", "expects", "three", "arguments", ":", "-", "a", "Kwiver", "DetectedObjectSet", ...
def track(min_iou=None): """Create a Transformer that performs tracking (only associating tracks with the given minimum IOU). The .step call expects three arguments: - a Kwiver DetectedObjectSet - a Kwiver F2FHomography - a Kwiver timestamp and returns a Kwiver ObjectTrackSet""" ch = co...
[ "def", "track", "(", "min_iou", "=", "None", ")", ":", "ch", "=", "convert_homographies", "(", ")", "ct", "=", "core_track", "(", "min_iou", ")", "bt", "=", "build_tracks", "(", ")", "output", "=", "None", "while", "True", ":", "do_set", ",", "homog_s2...
https://github.com/Kitware/kwiver/blob/7ed70308905698b6e88d27ae3dc028c9b016ca0a/python/kwiver/sprokit/processes/simple_homog_tracker.py#L285-L305
CoolProp/CoolProp
381c8535e5dec3eec27ad430ebbfff8bc9dfc008
wrappers/Python/CoolProp/Plots/SimpleCycles.py
python
TwoStage
(Ref, Q, Te, Tc, DTsh, DTsc, eta_oi, f_p, Tsat_ic, DTsh_ic, Ts_Ph='Ph', prints=False, skipPlot=False, axis=None, **kwargs)
return COP
This function plots a two-stage cycle, on the current axis, or that given by the optional parameter *axis* Required parameters: * Ref : Refrigerant [string] * Q : Cooling capacity [W] * Te : Evap Temperature [K] * Tc : Condensing Temperature [K] * DTsh : Evaporator outlet superheat [K] * D...
This function plots a two-stage cycle, on the current axis, or that given by the optional parameter *axis*
[ "This", "function", "plots", "a", "two", "-", "stage", "cycle", "on", "the", "current", "axis", "or", "that", "given", "by", "the", "optional", "parameter", "*", "axis", "*" ]
def TwoStage(Ref, Q, Te, Tc, DTsh, DTsc, eta_oi, f_p, Tsat_ic, DTsh_ic, Ts_Ph='Ph', prints=False, skipPlot=False, axis=None, **kwargs): """ This function plots a two-stage cycle, on the current axis, or that given by the optional parameter *axis* Required parameters: * Ref : Refrigerant [string] *...
[ "def", "TwoStage", "(", "Ref", ",", "Q", ",", "Te", ",", "Tc", ",", "DTsh", ",", "DTsc", ",", "eta_oi", ",", "f_p", ",", "Tsat_ic", ",", "DTsh_ic", ",", "Ts_Ph", "=", "'Ph'", ",", "prints", "=", "False", ",", "skipPlot", "=", "False", ",", "axis"...
https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/wrappers/Python/CoolProp/Plots/SimpleCycles.py#L45-L184
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListCtrl.CreateOrDestroyHeaderWindowAsNeeded
(self)
Creates or destroys the header window depending on the window style flags.
Creates or destroys the header window depending on the window style flags.
[ "Creates", "or", "destroys", "the", "header", "window", "depending", "on", "the", "window", "style", "flags", "." ]
def CreateOrDestroyHeaderWindowAsNeeded(self): """ Creates or destroys the header window depending on the window style flags. """ needs_header = self.HasHeader() has_header = self._headerWin is not None if needs_header == has_header: return if needs_header:...
[ "def", "CreateOrDestroyHeaderWindowAsNeeded", "(", "self", ")", ":", "needs_header", "=", "self", ".", "HasHeader", "(", ")", "has_header", "=", "self", ".", "_headerWin", "is", "not", "None", "if", "needs_header", "==", "has_header", ":", "return", "if", "nee...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L10952-L10987
hpi-xnor/BMXNet-v2
af2b1859eafc5c721b1397cef02f946aaf2ce20d
python/mxnet/contrib/text/vocab.py
python
Vocabulary.to_tokens
(self, indices)
return tokens[0] if to_reduce else tokens
Converts token indices to tokens according to the vocabulary. Parameters ---------- indices : int or list of ints A source token index or token indices to be converted. Returns ------- str or list of strs A token or a list of tokens according t...
Converts token indices to tokens according to the vocabulary.
[ "Converts", "token", "indices", "to", "tokens", "according", "to", "the", "vocabulary", "." ]
def to_tokens(self, indices): """Converts token indices to tokens according to the vocabulary. Parameters ---------- indices : int or list of ints A source token index or token indices to be converted. Returns ------- str or list of strs ...
[ "def", "to_tokens", "(", "self", ",", "indices", ")", ":", "to_reduce", "=", "False", "if", "not", "isinstance", "(", "indices", ",", "list", ")", ":", "indices", "=", "[", "indices", "]", "to_reduce", "=", "True", "max_idx", "=", "len", "(", "self", ...
https://github.com/hpi-xnor/BMXNet-v2/blob/af2b1859eafc5c721b1397cef02f946aaf2ce20d/python/mxnet/contrib/text/vocab.py#L188-L218
devsisters/libquic
8954789a056d8e7d5fcb6452fd1572ca57eb5c4e
src/third_party/protobuf/python/google/protobuf/internal/well_known_types.py
python
Any.Is
(self, descriptor)
return self.TypeName() == descriptor.full_name
Checks if this Any represents the given protobuf type.
Checks if this Any represents the given protobuf type.
[ "Checks", "if", "this", "Any", "represents", "the", "given", "protobuf", "type", "." ]
def Is(self, descriptor): """Checks if this Any represents the given protobuf type.""" return self.TypeName() == descriptor.full_name
[ "def", "Is", "(", "self", ",", "descriptor", ")", ":", "return", "self", ".", "TypeName", "(", ")", "==", "descriptor", ".", "full_name" ]
https://github.com/devsisters/libquic/blob/8954789a056d8e7d5fcb6452fd1572ca57eb5c4e/src/third_party/protobuf/python/google/protobuf/internal/well_known_types.py#L90-L92
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/squeezer.py
python
ExpandingButton.view
(self, event=None)
view event handler View the original text in a separate text viewer window.
view event handler
[ "view", "event", "handler" ]
def view(self, event=None): """view event handler View the original text in a separate text viewer window. """ view_text(self.text, "Squeezed Output Viewer", self.s, modal=False, wrap='none')
[ "def", "view", "(", "self", ",", "event", "=", "None", ")", ":", "view_text", "(", "self", ".", "text", ",", "\"Squeezed Output Viewer\"", ",", "self", ".", "s", ",", "modal", "=", "False", ",", "wrap", "=", "'none'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/idlelib/squeezer.py#L175-L181
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
compiler-rt/lib/sanitizer_common/scripts/cpplint.py
python
NestingState.CheckCompletedBlocks
(self, filename, error)
Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
Checks that all classes and namespaces have been completely parsed.
[ "Checks", "that", "all", "classes", "and", "namespaces", "have", "been", "completely", "parsed", "." ]
def CheckCompletedBlocks(self, filename, error): """Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found. """ # Note: Th...
[ "def", "CheckCompletedBlocks", "(", "self", ",", "filename", ",", "error", ")", ":", "# Note: This test can result in false positives if #ifdef constructs", "# get in the way of brace matching. See the testBuildClass test in", "# cpplint_unittest.py for an example of this.", "for", "obj"...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/compiler-rt/lib/sanitizer_common/scripts/cpplint.py#L2758-L2777
hakuna-m/wubiuefi
caec1af0a09c78fd5a345180ada1fe45e0c63493
src/openpgp/sap/msg/KeyMsg.py
python
PublicKeyMsg.get_block
(self, blocktype, target)
Retrieve a key or user ID block given an identifying string. :Parameters: - `blocktype`: 'key' or 'userid' - `target`: string key ID, fingerprint, or (unambiguous) substring of a user ID value (for key IDs and fingerprints, make sure that `target` is all caps...
Retrieve a key or user ID block given an identifying string.
[ "Retrieve", "a", "key", "or", "user", "ID", "block", "given", "an", "identifying", "string", "." ]
def get_block(self, blocktype, target): """Retrieve a key or user ID block given an identifying string. :Parameters: - `blocktype`: 'key' or 'userid' - `target`: string key ID, fingerprint, or (unambiguous) substring of a user ID value (for key IDs and fingerprints...
[ "def", "get_block", "(", "self", ",", "blocktype", ",", "target", ")", ":", "target_upper", "=", "target", ".", "upper", "(", ")", "if", "'key'", "==", "blocktype", ":", "primary", "=", "self", ".", "_b_primary", ".", "leader", "if", "target_upper", "in"...
https://github.com/hakuna-m/wubiuefi/blob/caec1af0a09c78fd5a345180ada1fe45e0c63493/src/openpgp/sap/msg/KeyMsg.py#L130-L164
alibaba/weex_js_engine
2bdf4b6f020c1fc99c63f649718f6faf7e27fdde
jni/v8core/v8/tools/stats-viewer.py
python
StatsViewer.Run
(self)
The main entry-point to running the stats viewer.
The main entry-point to running the stats viewer.
[ "The", "main", "entry", "-", "point", "to", "running", "the", "stats", "viewer", "." ]
def Run(self): """The main entry-point to running the stats viewer.""" try: self.data = self.MountSharedData() # OpenWindow blocks until the main window is closed self.OpenWindow() finally: self.CleanUp()
[ "def", "Run", "(", "self", ")", ":", "try", ":", "self", ".", "data", "=", "self", ".", "MountSharedData", "(", ")", "# OpenWindow blocks until the main window is closed", "self", ".", "OpenWindow", "(", ")", "finally", ":", "self", ".", "CleanUp", "(", ")" ...
https://github.com/alibaba/weex_js_engine/blob/2bdf4b6f020c1fc99c63f649718f6faf7e27fdde/jni/v8core/v8/tools/stats-viewer.py#L87-L94
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
scripts/Engineering/EnggUtils.py
python
crop_data
(parent, ws, indices)
return alg.getProperty('OutputWorkspace').value
DEPRECATED: not used in UI, only in deprecated functions (EnggVanadiumCorrections and EnggFocus) Produces a cropped workspace from the input workspace so that only data for the specified bank (given as a list of indices) is left. NB: This assumes spectra for a bank are consequent. @param parent :: pa...
DEPRECATED: not used in UI, only in deprecated functions (EnggVanadiumCorrections and EnggFocus)
[ "DEPRECATED", ":", "not", "used", "in", "UI", "only", "in", "deprecated", "functions", "(", "EnggVanadiumCorrections", "and", "EnggFocus", ")" ]
def crop_data(parent, ws, indices): """ DEPRECATED: not used in UI, only in deprecated functions (EnggVanadiumCorrections and EnggFocus) Produces a cropped workspace from the input workspace so that only data for the specified bank (given as a list of indices) is left. NB: This assumes spectra for...
[ "def", "crop_data", "(", "parent", ",", "ws", ",", "indices", ")", ":", "# Leave only spectra between min and max", "alg", "=", "parent", ".", "createChildAlgorithm", "(", "'ExtractSpectra'", ")", "alg", ".", "setProperty", "(", "'InputWorkspace'", ",", "ws", ")",...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/scripts/Engineering/EnggUtils.py#L874-L895
msftguy/ssh-rd
a5f3a79daeac5844edebf01916c9613563f1c390
_3rd/boost_1_48_0/tools/build/v2/build/type.py
python
all_derived
(type)
return result
Returns type and all classes that derive from it, in the order of their distance from type.
Returns type and all classes that derive from it, in the order of their distance from type.
[ "Returns", "type", "and", "all", "classes", "that", "derive", "from", "it", "in", "the", "order", "of", "their", "distance", "from", "type", "." ]
def all_derived (type): """ Returns type and all classes that derive from it, in the order of their distance from type. """ result = [type] for d in __types [type]['derived']: result.extend (all_derived (d)) return result
[ "def", "all_derived", "(", "type", ")", ":", "result", "=", "[", "type", "]", "for", "d", "in", "__types", "[", "type", "]", "[", "'derived'", "]", ":", "result", ".", "extend", "(", "all_derived", "(", "d", ")", ")", "return", "result" ]
https://github.com/msftguy/ssh-rd/blob/a5f3a79daeac5844edebf01916c9613563f1c390/_3rd/boost_1_48_0/tools/build/v2/build/type.py#L173-L180
google/llvm-propeller
45c226984fe8377ebfb2ad7713c680d652ba678d
clang/tools/scan-build-py/libscanbuild/arguments.py
python
create_intercept_parser
()
return parser
Creates a parser for command-line arguments to 'intercept'.
Creates a parser for command-line arguments to 'intercept'.
[ "Creates", "a", "parser", "for", "command", "-", "line", "arguments", "to", "intercept", "." ]
def create_intercept_parser(): """ Creates a parser for command-line arguments to 'intercept'. """ parser = create_default_parser() parser_add_cdb(parser) parser_add_prefer_wrapper(parser) parser_add_compilers(parser) advanced = parser.add_argument_group('advanced options') group = advanc...
[ "def", "create_intercept_parser", "(", ")", ":", "parser", "=", "create_default_parser", "(", ")", "parser_add_cdb", "(", "parser", ")", "parser_add_prefer_wrapper", "(", "parser", ")", "parser_add_compilers", "(", "parser", ")", "advanced", "=", "parser", ".", "a...
https://github.com/google/llvm-propeller/blob/45c226984fe8377ebfb2ad7713c680d652ba678d/clang/tools/scan-build-py/libscanbuild/arguments.py#L143-L164
mapnik/mapnik
f3da900c355e1d15059c4a91b00203dcc9d9f0ef
scons/scons-local-4.1.0/SCons/Builder.py
python
BuilderBase.add_emitter
(self, suffix, emitter)
Add a suffix-emitter mapping to this Builder. This assumes that emitter has been initialized with an appropriate dictionary type, and will throw a TypeError if not, so the caller is responsible for knowing that this is an appropriate method to call for the Builder in question.
Add a suffix-emitter mapping to this Builder.
[ "Add", "a", "suffix", "-", "emitter", "mapping", "to", "this", "Builder", "." ]
def add_emitter(self, suffix, emitter): """Add a suffix-emitter mapping to this Builder. This assumes that emitter has been initialized with an appropriate dictionary type, and will throw a TypeError if not, so the caller is responsible for knowing that this is an appropriate me...
[ "def", "add_emitter", "(", "self", ",", "suffix", ",", "emitter", ")", ":", "self", ".", "emitter", "[", "suffix", "]", "=", "emitter" ]
https://github.com/mapnik/mapnik/blob/f3da900c355e1d15059c4a91b00203dcc9d9f0ef/scons/scons-local-4.1.0/SCons/Builder.py#L688-L696
Samsung/veles
95ed733c2e49bc011ad98ccf2416ecec23fbf352
veles/graphics_client.py
python
GraphicsClient.run
(self)
Creates and runs main graphics window.
Creates and runs main graphics window.
[ "Creates", "and", "runs", "main", "graphics", "window", "." ]
def run(self): """Creates and runs main graphics window. """ self._lock.acquire() if self.backend == "no": self._run() return Plotter = import_module("veles.plotter").Plotter try: if self._shutted_down: return ...
[ "def", "run", "(", "self", ")", ":", "self", ".", "_lock", ".", "acquire", "(", ")", "if", "self", ".", "backend", "==", "\"no\"", ":", "self", ".", "_run", "(", ")", "return", "Plotter", "=", "import_module", "(", "\"veles.plotter\"", ")", ".", "Plo...
https://github.com/Samsung/veles/blob/95ed733c2e49bc011ad98ccf2416ecec23fbf352/veles/graphics_client.py#L124-L197
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
tools/site_compare/commands/maskmaker.py
python
CreateCommand
(cmdline)
Inserts the command and arguments into a command line for parsing.
Inserts the command and arguments into a command line for parsing.
[ "Inserts", "the", "command", "and", "arguments", "into", "a", "command", "line", "for", "parsing", "." ]
def CreateCommand(cmdline): """Inserts the command and arguments into a command line for parsing.""" cmd = cmdline.AddCommand( ["maskmaker"], "Automatically generates a mask from a list of URLs", ValidateMaskmaker, ExecuteMaskmaker) cmd.AddArgument( ["-bp", "--browserpath"], "Full path to bro...
[ "def", "CreateCommand", "(", "cmdline", ")", ":", "cmd", "=", "cmdline", ".", "AddCommand", "(", "[", "\"maskmaker\"", "]", ",", "\"Automatically generates a mask from a list of URLs\"", ",", "ValidateMaskmaker", ",", "ExecuteMaskmaker", ")", "cmd", ".", "AddArgument"...
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/tools/site_compare/commands/maskmaker.py#L24-L85
yarny/gbdt
c99d90d7de57705c30b05d520a32e458985fd834
gbdt/_forest_visualizer.py
python
ForestVisualizer.visualize_tree
(self, i)
return digraph
Visualizes tree i.
Visualizes tree i.
[ "Visualizes", "tree", "i", "." ]
def visualize_tree(self, i): """Visualizes tree i.""" try: from graphviz import Digraph except ImportError: raise ImportError('Please install graphviz.') tree = self._forestJson['tree'][i] digraph = Digraph(format='png') self.__visualizeTreeIntern...
[ "def", "visualize_tree", "(", "self", ",", "i", ")", ":", "try", ":", "from", "graphviz", "import", "Digraph", "except", "ImportError", ":", "raise", "ImportError", "(", "'Please install graphviz.'", ")", "tree", "=", "self", ".", "_forestJson", "[", "'tree'",...
https://github.com/yarny/gbdt/blob/c99d90d7de57705c30b05d520a32e458985fd834/gbdt/_forest_visualizer.py#L18-L28
oracle/graaljs
36a56e8e993d45fc40939a3a4d9c0c24990720f1
graal-nodejs/tools/gyp/pylib/gyp/win_tool.py
python
WinTool._CommandifyName
(self, name_string)
return name_string.title().replace("-", "")
Transforms a tool name like recursive-mirror to RecursiveMirror.
Transforms a tool name like recursive-mirror to RecursiveMirror.
[ "Transforms", "a", "tool", "name", "like", "recursive", "-", "mirror", "to", "RecursiveMirror", "." ]
def _CommandifyName(self, name_string): """Transforms a tool name like recursive-mirror to RecursiveMirror.""" return name_string.title().replace("-", "")
[ "def", "_CommandifyName", "(", "self", ",", "name_string", ")", ":", "return", "name_string", ".", "title", "(", ")", ".", "replace", "(", "\"-\"", ",", "\"\"", ")" ]
https://github.com/oracle/graaljs/blob/36a56e8e993d45fc40939a3a4d9c0c24990720f1/graal-nodejs/tools/gyp/pylib/gyp/win_tool.py#L75-L77
snap-stanford/snap-python
d53c51b0a26aa7e3e7400b014cdf728948fde80a
setup/snap.py
python
TRStr.GetPrimHashCd
(self)
return _snap.TRStr_GetPrimHashCd(self)
GetPrimHashCd(TRStr self) -> int Parameters: self: TRStr const *
GetPrimHashCd(TRStr self) -> int
[ "GetPrimHashCd", "(", "TRStr", "self", ")", "-", ">", "int" ]
def GetPrimHashCd(self): """ GetPrimHashCd(TRStr self) -> int Parameters: self: TRStr const * """ return _snap.TRStr_GetPrimHashCd(self)
[ "def", "GetPrimHashCd", "(", "self", ")", ":", "return", "_snap", ".", "TRStr_GetPrimHashCd", "(", "self", ")" ]
https://github.com/snap-stanford/snap-python/blob/d53c51b0a26aa7e3e7400b014cdf728948fde80a/setup/snap.py#L9401-L9409
ChromiumWebApps/chromium
c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7
chrome/tools/inconsistent-eol.py
python
ProcessFiles
(filelist)
Fix line endings in each file in the filelist list.
Fix line endings in each file in the filelist list.
[ "Fix", "line", "endings", "in", "each", "file", "in", "the", "filelist", "list", "." ]
def ProcessFiles(filelist): """Fix line endings in each file in the filelist list.""" for filename in filelist: filename = filename.strip() logging.debug(filename) try: # Open in binary mode to preserve existing line endings. text = open(filename, 'rb').read() except IOError, e: if...
[ "def", "ProcessFiles", "(", "filelist", ")", ":", "for", "filename", "in", "filelist", ":", "filename", "=", "filename", ".", "strip", "(", ")", "logging", ".", "debug", "(", "filename", ")", "try", ":", "# Open in binary mode to preserve existing line endings.", ...
https://github.com/ChromiumWebApps/chromium/blob/c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7/chrome/tools/inconsistent-eol.py#L74-L102
baidu-research/tensorflow-allreduce
66d5b855e90b0949e9fa5cca5599fd729a70e874
tensorflow/python/ops/control_flow_ops.py
python
exit
(data, name=None)
Exits the current frame to its parent frame. Exit makes its input `data` available to the parent frame. Args: data: The tensor to be made available to the parent frame. name: A name for this operation (optional). Returns: The same tensor as `data`.
Exits the current frame to its parent frame.
[ "Exits", "the", "current", "frame", "to", "its", "parent", "frame", "." ]
def exit(data, name=None): """Exits the current frame to its parent frame. Exit makes its input `data` available to the parent frame. Args: data: The tensor to be made available to the parent frame. name: A name for this operation (optional). Returns: The same tensor as `data`. """ data = ops...
[ "def", "exit", "(", "data", ",", "name", "=", "None", ")", ":", "data", "=", "ops", ".", "internal_convert_to_tensor_or_indexed_slices", "(", "data", ",", "as_ref", "=", "True", ")", "if", "isinstance", "(", "data", ",", "ops", ".", "Tensor", ")", ":", ...
https://github.com/baidu-research/tensorflow-allreduce/blob/66d5b855e90b0949e9fa5cca5599fd729a70e874/tensorflow/python/ops/control_flow_ops.py#L245-L275
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/http/cookiejar.py
python
unmatched
(match)
return match.string[:start]+match.string[end:]
Return unmatched part of re.Match object.
Return unmatched part of re.Match object.
[ "Return", "unmatched", "part", "of", "re", ".", "Match", "object", "." ]
def unmatched(match): """Return unmatched part of re.Match object.""" start, end = match.span(0) return match.string[:start]+match.string[end:]
[ "def", "unmatched", "(", "match", ")", ":", "start", ",", "end", "=", "match", ".", "span", "(", "0", ")", "return", "match", ".", "string", "[", ":", "start", "]", "+", "match", ".", "string", "[", "end", ":", "]" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/http/cookiejar.py#L331-L334
strukturag/libheif
0082fea96ee70a20c8906a0373bedec0c01777bc
scripts/cpplint.py
python
IsCppString
(line)
return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string constant.
Does line terminate so, that the next symbol is in string constant.
[ "Does", "line", "terminate", "so", "that", "the", "next", "symbol", "is", "in", "string", "constant", "." ]
def IsCppString(line): """Does line terminate so, that the next symbol is in string constant. This function does not consider single-line nor multi-line comments. Args: line: is a partial line of code starting from the 0..n. Returns: True, if next character appended to 'line' is inside a string c...
[ "def", "IsCppString", "(", "line", ")", ":", "line", "=", "line", ".", "replace", "(", "r'\\\\'", ",", "'XX'", ")", "# after this, \\\\\" does not match to \\\"", "return", "(", "(", "line", ".", "count", "(", "'\"'", ")", "-", "line", ".", "count", "(", ...
https://github.com/strukturag/libheif/blob/0082fea96ee70a20c8906a0373bedec0c01777bc/scripts/cpplint.py#L1224-L1238
lammps/lammps
b75c3065430a75b1b5543a10e10f46d9b4c91913
tools/i-pi/ipi/utils/depend.py
python
depend_array.__array_wrap__
(self, arr, context=None)
Wraps up output array from ufunc. See docstring of __array_prepare__().
Wraps up output array from ufunc.
[ "Wraps", "up", "output", "array", "from", "ufunc", "." ]
def __array_wrap__(self, arr, context=None): """ Wraps up output array from ufunc. See docstring of __array_prepare__(). """ if context is None or len(context) < 2 or not type(context[0]) is np.ufunc: return np.ndarray.__array_wrap__(self.view(np.ndarray),arr.view(np.ndarray),context)...
[ "def", "__array_wrap__", "(", "self", ",", "arr", ",", "context", "=", "None", ")", ":", "if", "context", "is", "None", "or", "len", "(", "context", ")", "<", "2", "or", "not", "type", "(", "context", "[", "0", "]", ")", "is", "np", ".", "ufunc",...
https://github.com/lammps/lammps/blob/b75c3065430a75b1b5543a10e10f46d9b4c91913/tools/i-pi/ipi/utils/depend.py#L468-L479
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_impl.py
python
sigmoid_cross_entropy_with_logits_v2
( # pylint: disable=invalid-name labels=None, logits=None, name=None)
return sigmoid_cross_entropy_with_logits( logits=logits, labels=labels, name=name)
Computes sigmoid cross entropy given `logits`. Measures the probability error in discrete classification tasks in which each class is independent and not mutually exclusive. For instance, one could perform multilabel classification where a picture can contain both an elephant and a dog at the same time. Fo...
Computes sigmoid cross entropy given `logits`.
[ "Computes", "sigmoid", "cross", "entropy", "given", "logits", "." ]
def sigmoid_cross_entropy_with_logits_v2( # pylint: disable=invalid-name labels=None, logits=None, name=None): """Computes sigmoid cross entropy given `logits`. Measures the probability error in discrete classification tasks in which each class is independent and not mutually exclusive. For instanc...
[ "def", "sigmoid_cross_entropy_with_logits_v2", "(", "# pylint: disable=invalid-name", "labels", "=", "None", ",", "logits", "=", "None", ",", "name", "=", "None", ")", ":", "return", "sigmoid_cross_entropy_with_logits", "(", "logits", "=", "logits", ",", "labels", "...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/python/ops/nn_impl.py#L194-L240
klzgrad/naiveproxy
ed2c513637c77b18721fe428d7ed395b4d284c83
src/tools/grit/grit/util.py
python
Substituter.AddSubstitutions
(self, subs)
Add new values to the substitutor. Args: subs: A dictionary of new substitutions.
Add new values to the substitutor.
[ "Add", "new", "values", "to", "the", "substitutor", "." ]
def AddSubstitutions(self, subs): '''Add new values to the substitutor. Args: subs: A dictionary of new substitutions. ''' self.substitutions_.update(subs) self.dirty_ = True
[ "def", "AddSubstitutions", "(", "self", ",", "subs", ")", ":", "self", ".", "substitutions_", ".", "update", "(", "subs", ")", "self", ".", "dirty_", "=", "True" ]
https://github.com/klzgrad/naiveproxy/blob/ed2c513637c77b18721fe428d7ed395b4d284c83/src/tools/grit/grit/util.py#L548-L555
lilypond/lilypond
2a14759372979f5b796ee802b0ee3bc15d28b06b
scripts/build/output-distance.py
python
png_dims
(fn: str)
Reads width/height from PNG file.
Reads width/height from PNG file.
[ "Reads", "width", "/", "height", "from", "PNG", "file", "." ]
def png_dims(fn: str) -> Tuple[int, int]: """Reads width/height from PNG file.""" # avoid subprocessing, as subprocessing is relatively expensive, # and we run this for each image we handle with open(fn, 'rb') as f: header = f.read(32) w = int.from_bytes(header[16:20], 'big', signed=Fal...
[ "def", "png_dims", "(", "fn", ":", "str", ")", "->", "Tuple", "[", "int", ",", "int", "]", ":", "# avoid subprocessing, as subprocessing is relatively expensive,", "# and we run this for each image we handle", "with", "open", "(", "fn", ",", "'rb'", ")", "as", "f", ...
https://github.com/lilypond/lilypond/blob/2a14759372979f5b796ee802b0ee3bc15d28b06b/scripts/build/output-distance.py#L102-L111
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/keras/_impl/keras/datasets/boston_housing.py
python
load_data
(path='boston_housing.npz', seed=113, test_split=0.2)
return (x_train, y_train), (x_test, y_test)
Loads the Boston Housing dataset. Arguments: path: path where to cache the dataset locally (relative to ~/.keras/datasets). seed: Random seed for shuffling the data before computing the test split. test_split: fraction of the data to reserve as test set. Returns: Tuple ...
Loads the Boston Housing dataset.
[ "Loads", "the", "Boston", "Housing", "dataset", "." ]
def load_data(path='boston_housing.npz', seed=113, test_split=0.2): """Loads the Boston Housing dataset. Arguments: path: path where to cache the dataset locally (relative to ~/.keras/datasets). seed: Random seed for shuffling the data before computing the test split. test_spl...
[ "def", "load_data", "(", "path", "=", "'boston_housing.npz'", ",", "seed", "=", "113", ",", "test_split", "=", "0.2", ")", ":", "assert", "0", "<=", "test_split", "<", "1", "fh", "=", "'f553886a1f8d56431e820c5b82552d9d95cfcb96d1e678153f8839538947dff5'", "path", "=...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/keras/_impl/keras/datasets/boston_housing.py#L26-L59
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/estimator/gc.py
python
_get_paths
(base_dir, parser)
return sorted(paths)
Gets a list of Paths in a given directory. Args: base_dir: directory. parser: a function which gets the raw Path and can augment it with information such as the export_version, or ignore the path by returning None. An example parser may extract the export version from a path such as "/tmp/...
Gets a list of Paths in a given directory.
[ "Gets", "a", "list", "of", "Paths", "in", "a", "given", "directory", "." ]
def _get_paths(base_dir, parser): """Gets a list of Paths in a given directory. Args: base_dir: directory. parser: a function which gets the raw Path and can augment it with information such as the export_version, or ignore the path by returning None. An example parser may extract the export v...
[ "def", "_get_paths", "(", "base_dir", ",", "parser", ")", ":", "raw_paths", "=", "gfile", ".", "ListDirectory", "(", "base_dir", ")", "paths", "=", "[", "]", "for", "r", "in", "raw_paths", ":", "p", "=", "parser", "(", "Path", "(", "os", ".", "path",...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/estimator/gc.py#L182-L209
google/syzygy
8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5
third_party/numpy/files/numpy/polynomial/legendre.py
python
legfromroots
(roots)
Generate a Legendre series with the given roots. Return the array of coefficients for the P-series whose roots (a.k.a. "zeros") are given by *roots*. The returned array of coefficients is ordered from lowest order "term" to highest, and zeros of multiplicity greater than one must be included in *roots...
Generate a Legendre series with the given roots.
[ "Generate", "a", "Legendre", "series", "with", "the", "given", "roots", "." ]
def legfromroots(roots) : """ Generate a Legendre series with the given roots. Return the array of coefficients for the P-series whose roots (a.k.a. "zeros") are given by *roots*. The returned array of coefficients is ordered from lowest order "term" to highest, and zeros of multiplicity great...
[ "def", "legfromroots", "(", "roots", ")", ":", "if", "len", "(", "roots", ")", "==", "0", ":", "return", "np", ".", "ones", "(", "1", ")", "else", ":", "[", "roots", "]", "=", "pu", ".", "as_series", "(", "[", "roots", "]", ",", "trim", "=", ...
https://github.com/google/syzygy/blob/8164b24ebde9c5649c9a09e88a7fc0b0fcbd1bc5/third_party/numpy/files/numpy/polynomial/legendre.py#L230-L289
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/design-twitter.py
python
Twitter.__init__
(self)
Initialize your data structure here.
Initialize your data structure here.
[ "Initialize", "your", "data", "structure", "here", "." ]
def __init__(self): """ Initialize your data structure here. """ self.__number_of_most_recent_tweets = 10 self.__followings = collections.defaultdict(set) self.__messages = collections.defaultdict(list) self.__time = 0
[ "def", "__init__", "(", "self", ")", ":", "self", ".", "__number_of_most_recent_tweets", "=", "10", "self", ".", "__followings", "=", "collections", ".", "defaultdict", "(", "set", ")", "self", ".", "__messages", "=", "collections", ".", "defaultdict", "(", ...
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/design-twitter.py#L12-L19
dmlc/decord
96b750c7221322391969929e855b942d2fdcd06b
python/decord/_ffi/ndarray.py
python
NDArrayBase.shape
(self)
return tuple(self.handle.contents.shape[i] for i in range(self.handle.contents.ndim))
Shape of this array
Shape of this array
[ "Shape", "of", "this", "array" ]
def shape(self): """Shape of this array""" return tuple(self.handle.contents.shape[i] for i in range(self.handle.contents.ndim))
[ "def", "shape", "(", "self", ")", ":", "return", "tuple", "(", "self", ".", "handle", ".", "contents", ".", "shape", "[", "i", "]", "for", "i", "in", "range", "(", "self", ".", "handle", ".", "contents", ".", "ndim", ")", ")" ]
https://github.com/dmlc/decord/blob/96b750c7221322391969929e855b942d2fdcd06b/python/decord/_ffi/ndarray.py#L138-L140
netket/netket
0d534e54ecbf25b677ea72af6b85947979420652
netket/jax/_grad.py
python
value_and_grad
( fun: Callable, argnums: Union[int, Sequence[int]] = 0, has_aux: bool = False, allow_int: bool = False, )
return value_and_grad_f
Create a function which evaluates both ``fun`` and the gradient of ``fun``. Args: fun: Function to be differentiated. Its arguments at positions specified by ``argnums`` should be arrays, scalars, or standard Python containers. It should return a scalar (which includes arrays with shape ``()`...
Create a function which evaluates both ``fun`` and the gradient of ``fun``.
[ "Create", "a", "function", "which", "evaluates", "both", "fun", "and", "the", "gradient", "of", "fun", "." ]
def value_and_grad( fun: Callable, argnums: Union[int, Sequence[int]] = 0, has_aux: bool = False, allow_int: bool = False, ) -> Callable[..., Tuple[Any, Any]]: """Create a function which evaluates both ``fun`` and the gradient of ``fun``. Args: fun: Function to be differentiated. Its argu...
[ "def", "value_and_grad", "(", "fun", ":", "Callable", ",", "argnums", ":", "Union", "[", "int", ",", "Sequence", "[", "int", "]", "]", "=", "0", ",", "has_aux", ":", "bool", "=", "False", ",", "allow_int", ":", "bool", "=", "False", ",", ")", "->",...
https://github.com/netket/netket/blob/0d534e54ecbf25b677ea72af6b85947979420652/netket/jax/_grad.py#L92-L205
tensorflow/deepmath
b5b721f54de1d5d6a02d78f5da5995237f9995f9
deepmath/guidance/model_wavenet.py
python
Model.conjecture_embedding
(self, conjectures)
return self.make_embedding(conjectures)
Compute the embedding for each of the conjectures.
Compute the embedding for each of the conjectures.
[ "Compute", "the", "embedding", "for", "each", "of", "the", "conjectures", "." ]
def conjecture_embedding(self, conjectures): """Compute the embedding for each of the conjectures.""" return self.make_embedding(conjectures)
[ "def", "conjecture_embedding", "(", "self", ",", "conjectures", ")", ":", "return", "self", ".", "make_embedding", "(", "conjectures", ")" ]
https://github.com/tensorflow/deepmath/blob/b5b721f54de1d5d6a02d78f5da5995237f9995f9/deepmath/guidance/model_wavenet.py#L72-L74
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/contrib/distributions/python/ops/mixture.py
python
Mixture.entropy_lower_bound
(self, name="entropy_lower_bound")
r"""A lower bound on the entropy of this mixture model. The bound below is not always very tight, and its usefulness depends on the mixture probabilities and the components in use. A lower bound is useful for ELBO when the `Mixture` is the variational distribution: \\( \log p(x) >= ELBO = \in...
r"""A lower bound on the entropy of this mixture model.
[ "r", "A", "lower", "bound", "on", "the", "entropy", "of", "this", "mixture", "model", "." ]
def entropy_lower_bound(self, name="entropy_lower_bound"): r"""A lower bound on the entropy of this mixture model. The bound below is not always very tight, and its usefulness depends on the mixture probabilities and the components in use. A lower bound is useful for ELBO when the `Mixture` is the var...
[ "def", "entropy_lower_bound", "(", "self", ",", "name", "=", "\"entropy_lower_bound\"", ")", ":", "with", "self", ".", "_name_scope", "(", "name", ",", "values", "=", "[", "self", ".", "cat", ".", "logits", "]", ")", ":", "with", "ops", ".", "control_dep...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/contrib/distributions/python/ops/mixture.py#L403-L450
adobe/chromium
cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7
third_party/tlslite/tlslite/TLSRecordLayer.py
python
TLSRecordLayer.setsockopt
(self, level, optname, value)
return self.sock.setsockopt(level, optname, value)
Set the value of the given socket option (socket emulation).
Set the value of the given socket option (socket emulation).
[ "Set", "the", "value", "of", "the", "given", "socket", "option", "(", "socket", "emulation", ")", "." ]
def setsockopt(self, level, optname, value): """Set the value of the given socket option (socket emulation).""" return self.sock.setsockopt(level, optname, value)
[ "def", "setsockopt", "(", "self", ",", "level", ",", "optname", ",", "value", ")", ":", "return", "self", ".", "sock", ".", "setsockopt", "(", "level", ",", "optname", ",", "value", ")" ]
https://github.com/adobe/chromium/blob/cfe5bf0b51b1f6b9fe239c2a3c2f2364da9967d7/third_party/tlslite/tlslite/TLSRecordLayer.py#L438-L440
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Code/Tools/waf-1.7.13/waflib/Tools/glib2.py
python
process_marshal
(self)
Process the marshal files stored in the attribute *marshal_list* to create :py:class:`waflib.Tools.glib2.glib_genmarshal` instances. Add the c file created to the list of source to process.
Process the marshal files stored in the attribute *marshal_list* to create :py:class:`waflib.Tools.glib2.glib_genmarshal` instances. Add the c file created to the list of source to process.
[ "Process", "the", "marshal", "files", "stored", "in", "the", "attribute", "*", "marshal_list", "*", "to", "create", ":", "py", ":", "class", ":", "waflib", ".", "Tools", ".", "glib2", ".", "glib_genmarshal", "instances", ".", "Add", "the", "c", "file", "...
def process_marshal(self): """ Process the marshal files stored in the attribute *marshal_list* to create :py:class:`waflib.Tools.glib2.glib_genmarshal` instances. Add the c file created to the list of source to process. """ for f, prefix in getattr(self, 'marshal_list', []): node = self.path.find_resource(f) ...
[ "def", "process_marshal", "(", "self", ")", ":", "for", "f", ",", "prefix", "in", "getattr", "(", "self", ",", "'marshal_list'", ",", "[", "]", ")", ":", "node", "=", "self", ".", "path", ".", "find_resource", "(", "f", ")", "if", "not", "node", ":...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Code/Tools/waf-1.7.13/waflib/Tools/glib2.py#L35-L52
RapidsAtHKUST/CommunityDetectionCodes
23dbafd2e57ab0f5f0528b1322c4a409f21e5892
Algorithms/2008-CliquePercolation/src_python/seq_clique_percolation.py
python
communitiesByKCliques
(kcliques)
Phase II in the SCP algorithm. Finds communities in the order they appear as the cliques are added to the network.
Phase II in the SCP algorithm. Finds communities in the order they appear as the cliques are added to the network.
[ "Phase", "II", "in", "the", "SCP", "algorithm", ".", "Finds", "communities", "in", "the", "order", "they", "appear", "as", "the", "cliques", "are", "added", "to", "the", "network", "." ]
def communitiesByKCliques(kcliques): """ Phase II in the SCP algorithm. Finds communities in the order they appear as the cliques are added to the network. """ # Calculate the neighboring relations krTree = Ktree() for kclique in kcliques: if isinstance(kclique, EvaluationEvent): ...
[ "def", "communitiesByKCliques", "(", "kcliques", ")", ":", "# Calculate the neighboring relations", "krTree", "=", "Ktree", "(", ")", "for", "kclique", "in", "kcliques", ":", "if", "isinstance", "(", "kclique", ",", "EvaluationEvent", ")", ":", "communityStructure",...
https://github.com/RapidsAtHKUST/CommunityDetectionCodes/blob/23dbafd2e57ab0f5f0528b1322c4a409f21e5892/Algorithms/2008-CliquePercolation/src_python/seq_clique_percolation.py#L764-L780
rapidsai/cudf
d5b2448fc69f17509304d594f029d0df56984962
python/cudf/cudf/core/reshape.py
python
_normalize_series_and_dataframe
(objs, axis)
Convert any cudf.Series objects in objs to DataFrames in place.
Convert any cudf.Series objects in objs to DataFrames in place.
[ "Convert", "any", "cudf", ".", "Series", "objects", "in", "objs", "to", "DataFrames", "in", "place", "." ]
def _normalize_series_and_dataframe(objs, axis): """Convert any cudf.Series objects in objs to DataFrames in place.""" # Default to naming series by a numerical id if they are not named. sr_name = 0 for idx, o in enumerate(objs): if isinstance(o, cudf.Series): if axis == 1: ...
[ "def", "_normalize_series_and_dataframe", "(", "objs", ",", "axis", ")", ":", "# Default to naming series by a numerical id if they are not named.", "sr_name", "=", "0", "for", "idx", ",", "o", "in", "enumerate", "(", "objs", ")", ":", "if", "isinstance", "(", "o", ...
https://github.com/rapidsai/cudf/blob/d5b2448fc69f17509304d594f029d0df56984962/python/cudf/cudf/core/reshape.py#L94-L108
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/math/symbolic_sympy.py
python
_make_sympy_adaptor
(func)
return type(func.name+"_sympy_adaptor",(sympy.Function,),attributes)
Adapts a symbolic Function to a sympy Function
Adapts a symbolic Function to a sympy Function
[ "Adapts", "a", "symbolic", "Function", "to", "a", "sympy", "Function" ]
def _make_sympy_adaptor(func): """Adapts a symbolic Function to a sympy Function""" assert isinstance(func,Function) def _eval_evalf(self,prec): fargs = [a._to_mpmath(prec) for a in self.args] res = self._symbolic_func(*fargs).evalf() return sympy.S(res) def fdiff(self, argindex)...
[ "def", "_make_sympy_adaptor", "(", "func", ")", ":", "assert", "isinstance", "(", "func", ",", "Function", ")", "def", "_eval_evalf", "(", "self", ",", "prec", ")", ":", "fargs", "=", "[", "a", ".", "_to_mpmath", "(", "prec", ")", "for", "a", "in", "...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/math/symbolic_sympy.py#L153-L187
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py
python
PlaceHolder.__init__
(self, alogger)
Initialize with the specified logger being a child of this placeholder.
Initialize with the specified logger being a child of this placeholder.
[ "Initialize", "with", "the", "specified", "logger", "being", "a", "child", "of", "this", "placeholder", "." ]
def __init__(self, alogger): """ Initialize with the specified logger being a child of this placeholder. """ self.loggerMap = { alogger : None }
[ "def", "__init__", "(", "self", ",", "alogger", ")", ":", "self", ".", "loggerMap", "=", "{", "alogger", ":", "None", "}" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py#L1164-L1168
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/s3fs/core.py
python
S3FileSystem.put_tags
(self, path, tags, mode='o')
Set tags for given existing key Tags are a str:str mapping that can be attached to any key, see https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html This is similar to, but distinct from, key metadata, which is usually set at key creation time. ...
Set tags for given existing key
[ "Set", "tags", "for", "given", "existing", "key" ]
def put_tags(self, path, tags, mode='o'): """Set tags for given existing key Tags are a str:str mapping that can be attached to any key, see https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html This is similar to, but distinct from, key metadata...
[ "def", "put_tags", "(", "self", ",", "path", ",", "tags", ",", "mode", "=", "'o'", ")", ":", "bucket", ",", "key", ",", "version_id", "=", "self", ".", "split_path", "(", "path", ")", "if", "mode", "==", "'m'", ":", "existing_tags", "=", "self", "....
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/s3fs/core.py#L682-L717
gnuradio/gnuradio
09c3c4fa4bfb1a02caac74cb5334dfe065391e3b
docs/doxygen/update_pydoc.py
python
argParse
()
return parser.parse_args()
Parses commandline args.
Parses commandline args.
[ "Parses", "commandline", "args", "." ]
def argParse(): """Parses commandline args.""" desc = 'Scrape the doxygen generated xml for docstrings to insert into python bindings' parser = ArgumentParser(description=desc) parser.add_argument("function", help="Operation to perform on docstrings", choices=[ "scrape", "sub", ...
[ "def", "argParse", "(", ")", ":", "desc", "=", "'Scrape the doxygen generated xml for docstrings to insert into python bindings'", "parser", "=", "ArgumentParser", "(", "description", "=", "desc", ")", "parser", ".", "add_argument", "(", "\"function\"", ",", "help", "="...
https://github.com/gnuradio/gnuradio/blob/09c3c4fa4bfb1a02caac74cb5334dfe065391e3b/docs/doxygen/update_pydoc.py#L337-L351
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/distutils/command/bdist.py
python
show_formats
()
Print list of available formats (arguments to "--format" option).
Print list of available formats (arguments to "--format" option).
[ "Print", "list", "of", "available", "formats", "(", "arguments", "to", "--", "format", "option", ")", "." ]
def show_formats(): """Print list of available formats (arguments to "--format" option). """ from distutils.fancy_getopt import FancyGetopt formats = [] for format in bdist.format_commands: formats.append(("formats=" + format, None, bdist.format_command[format][1])) ...
[ "def", "show_formats", "(", ")", ":", "from", "distutils", ".", "fancy_getopt", "import", "FancyGetopt", "formats", "=", "[", "]", "for", "format", "in", "bdist", ".", "format_commands", ":", "formats", ".", "append", "(", "(", "\"formats=\"", "+", "format",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/distutils/command/bdist.py#L12-L21
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
bindings/python/cntk/axis.py
python
Axis.name
(self)
return super(Axis, self).name()
Returns the name of this axis. Returns: str: the name of this axis.
Returns the name of this axis.
[ "Returns", "the", "name", "of", "this", "axis", "." ]
def name(self): ''' Returns the name of this axis. Returns: str: the name of this axis. ''' return super(Axis, self).name()
[ "def", "name", "(", "self", ")", ":", "return", "super", "(", "Axis", ",", "self", ")", ".", "name", "(", ")" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/bindings/python/cntk/axis.py#L71-L78
Z3Prover/z3
d745d03afdfdf638d66093e2bfbacaf87187f35b
src/api/python/z3/z3.py
python
BitVecRef.sort
(self)
return BitVecSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
Return the sort of the bit-vector expression `self`. >>> x = BitVec('x', 32) >>> x.sort() BitVec(32) >>> x.sort() == BitVecSort(32) True
Return the sort of the bit-vector expression `self`.
[ "Return", "the", "sort", "of", "the", "bit", "-", "vector", "expression", "self", "." ]
def sort(self): """Return the sort of the bit-vector expression `self`. >>> x = BitVec('x', 32) >>> x.sort() BitVec(32) >>> x.sort() == BitVecSort(32) True """ return BitVecSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx)
[ "def", "sort", "(", "self", ")", ":", "return", "BitVecSortRef", "(", "Z3_get_sort", "(", "self", ".", "ctx_ref", "(", ")", ",", "self", ".", "as_ast", "(", ")", ")", ",", "self", ".", "ctx", ")" ]
https://github.com/Z3Prover/z3/blob/d745d03afdfdf638d66093e2bfbacaf87187f35b/src/api/python/z3/z3.py#L3455-L3464
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_core.py
python
Window.HasFocus
(*args, **kwargs)
return _core_.Window_HasFocus(*args, **kwargs)
HasFocus(self) -> bool Returns ``True`` if the window has the keyboard focus.
HasFocus(self) -> bool
[ "HasFocus", "(", "self", ")", "-", ">", "bool" ]
def HasFocus(*args, **kwargs): """ HasFocus(self) -> bool Returns ``True`` if the window has the keyboard focus. """ return _core_.Window_HasFocus(*args, **kwargs)
[ "def", "HasFocus", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_core_", ".", "Window_HasFocus", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_core.py#L10150-L10156
RobotLocomotion/drake
0e18a34604c45ed65bc9018a54f7610f91cdad5b
tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_hydroelastic_contact.py
python
_Contact._contact_label_suffix
(key)
return ""
Creates a contact label based on the contact key.
Creates a contact label based on the contact key.
[ "Creates", "a", "contact", "label", "based", "on", "the", "contact", "key", "." ]
def _contact_label_suffix(key): """Creates a contact label based on the contact key.""" name1, name2, need_names = key if need_names: return f' ({name1}, {name2})' return ""
[ "def", "_contact_label_suffix", "(", "key", ")", ":", "name1", ",", "name2", ",", "need_names", "=", "key", "if", "need_names", ":", "return", "f' ({name1}, {name2})'", "return", "\"\"" ]
https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/workspace/drake_visualizer/_drake_visualizer_builtin_scripts/show_hydroelastic_contact.py#L551-L556
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/pdfviewer/dcgraphics.py
python
dcGraphicsContext.PopState
(self)
Restore the most recently saved state which was saved with PushState.
Restore the most recently saved state which was saved with PushState.
[ "Restore", "the", "most", "recently", "saved", "state", "which", "was", "saved", "with", "PushState", "." ]
def PopState(self): """ Restore the most recently saved state which was saved with PushState. """ self.gstate = self.saved_state.pop()
[ "def", "PopState", "(", "self", ")", ":", "self", ".", "gstate", "=", "self", ".", "saved_state", ".", "pop", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/pdfviewer/dcgraphics.py#L149-L153
mhammond/pywin32
44afd86ba8485194df93234639243252deeb40d5
Pythonwin/pywin/framework/scriptutils.py
python
GetActiveFileName
(bAutoSave=1)
return pathName
Gets the file name for the active frame, saving it if necessary. Returns None if it cant be found, or raises KeyboardInterrupt.
Gets the file name for the active frame, saving it if necessary.
[ "Gets", "the", "file", "name", "for", "the", "active", "frame", "saving", "it", "if", "necessary", "." ]
def GetActiveFileName(bAutoSave=1): """Gets the file name for the active frame, saving it if necessary. Returns None if it cant be found, or raises KeyboardInterrupt. """ pathName = None active = GetActiveView() if active is None: return None try: doc = active.GetDocument() ...
[ "def", "GetActiveFileName", "(", "bAutoSave", "=", "1", ")", ":", "pathName", "=", "None", "active", "=", "GetActiveView", "(", ")", "if", "active", "is", "None", ":", "return", "None", "try", ":", "doc", "=", "active", ".", "GetDocument", "(", ")", "p...
https://github.com/mhammond/pywin32/blob/44afd86ba8485194df93234639243252deeb40d5/Pythonwin/pywin/framework/scriptutils.py#L171-L204
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/idlelib/help.py
python
HelpFrame.toc_menu
(self, text)
return toc
Create table of contents as drop-down menu.
Create table of contents as drop-down menu.
[ "Create", "table", "of", "contents", "as", "drop", "-", "down", "menu", "." ]
def toc_menu(self, text): "Create table of contents as drop-down menu." toc = Menubutton(self, text='TOC') drop = Menu(toc, tearoff=False) for lbl, dex in text.parser.toc: drop.add_command(label=lbl, command=lambda dex=dex:text.yview(dex)) toc['menu'] = drop r...
[ "def", "toc_menu", "(", "self", ",", "text", ")", ":", "toc", "=", "Menubutton", "(", "self", ",", "text", "=", "'TOC'", ")", "drop", "=", "Menu", "(", "toc", ",", "tearoff", "=", "False", ")", "for", "lbl", ",", "dex", "in", "text", ".", "parser...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/idlelib/help.py#L226-L233
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_gdi.py
python
DC.DrawLabel
(*args, **kwargs)
return _gdi_.DC_DrawLabel(*args, **kwargs)
DrawLabel(self, String text, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP, int indexAccel=-1) Draw *text* within the specified rectangle, abiding by the alignment flags. Will additionally emphasize the character at *indexAccel* if it is not -1.
DrawLabel(self, String text, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP, int indexAccel=-1)
[ "DrawLabel", "(", "self", "String", "text", "Rect", "rect", "int", "alignment", "=", "wxALIGN_LEFT|wxALIGN_TOP", "int", "indexAccel", "=", "-", "1", ")" ]
def DrawLabel(*args, **kwargs): """ DrawLabel(self, String text, Rect rect, int alignment=wxALIGN_LEFT|wxALIGN_TOP, int indexAccel=-1) Draw *text* within the specified rectangle, abiding by the alignment flags. Will additionally emphasize the character at *indexAccel* if ...
[ "def", "DrawLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gdi_", ".", "DC_DrawLabel", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_gdi.py#L3940-L3949
ablab/quast
5f6709528129a6ad266a6b24ef3f40b88f0fe04b
quast_libs/site_packages/joblib2/disk.py
python
mkdirp
(d)
Ensure directory d exists (like mkdir -p on Unix) No guarantee that the directory is writable.
Ensure directory d exists (like mkdir -p on Unix) No guarantee that the directory is writable.
[ "Ensure", "directory", "d", "exists", "(", "like", "mkdir", "-", "p", "on", "Unix", ")", "No", "guarantee", "that", "the", "directory", "is", "writable", "." ]
def mkdirp(d): """Ensure directory d exists (like mkdir -p on Unix) No guarantee that the directory is writable. """ try: os.makedirs(d) except OSError, e: if e.errno != errno.EEXIST: raise
[ "def", "mkdirp", "(", "d", ")", ":", "try", ":", "os", ".", "makedirs", "(", "d", ")", "except", "OSError", ",", "e", ":", "if", "e", ".", "errno", "!=", "errno", ".", "EEXIST", ":", "raise" ]
https://github.com/ablab/quast/blob/5f6709528129a6ad266a6b24ef3f40b88f0fe04b/quast_libs/site_packages/joblib2/disk.py#L49-L57
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/msw/_controls.py
python
StaticText_GetClassDefaultAttributes
(*args, **kwargs)
return _controls_.StaticText_GetClassDefaultAttributes(*args, **kwargs)
StaticText_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours...
StaticText_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
[ "StaticText_GetClassDefaultAttributes", "(", "int", "variant", "=", "WINDOW_VARIANT_NORMAL", ")", "-", ">", "VisualAttributes" ]
def StaticText_GetClassDefaultAttributes(*args, **kwargs): """ StaticText_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control...
[ "def", "StaticText_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_controls_", ".", "StaticText_GetClassDefaultAttributes", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/msw/_controls.py#L1048-L1063
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py
python
sometrue
(*args, **kwargs)
return any(*args, **kwargs)
Check whether some values are true. Refer to `any` for full documentation. See Also -------- any : equivalent function; see for details.
Check whether some values are true.
[ "Check", "whether", "some", "values", "are", "true", "." ]
def sometrue(*args, **kwargs): """ Check whether some values are true. Refer to `any` for full documentation. See Also -------- any : equivalent function; see for details. """ return any(*args, **kwargs)
[ "def", "sometrue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "any", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/core/fromnumeric.py#L3627-L3637
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/dashboard/dashboard/group_report.py
python
GroupReportHandler.get
(self)
Renders the UI for the group report page.
Renders the UI for the group report page.
[ "Renders", "the", "UI", "for", "the", "group", "report", "page", "." ]
def get(self): """Renders the UI for the group report page.""" self.RenderStaticHtml('group_report.html')
[ "def", "get", "(", "self", ")", ":", "self", ".", "RenderStaticHtml", "(", "'group_report.html'", ")" ]
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/dashboard/dashboard/group_report.py#L32-L34