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
netease-youdao/hex
d7b8773dae8dde63f3807cef1d48c017077db727
tools/patch_util.py
python
from_file
(filename)
return patch
read and parse patch file return PatchInfo() object
read and parse patch file return PatchInfo() object
[ "read", "and", "parse", "patch", "file", "return", "PatchInfo", "()", "object" ]
def from_file(filename): """ read and parse patch file return PatchInfo() object """ info("reading patch from file %s" % filename) fp = open(filename, "rb") patch = PatchInfo(fp) fp.close() return patch
[ "def", "from_file", "(", "filename", ")", ":", "info", "(", "\"reading patch from file %s\"", "%", "filename", ")", "fp", "=", "open", "(", "filename", ",", "\"rb\"", ")", "patch", "=", "PatchInfo", "(", "fp", ")", "fp", ".", "close", "(", ")", "return",...
https://github.com/netease-youdao/hex/blob/d7b8773dae8dde63f3807cef1d48c017077db727/tools/patch_util.py#L39-L48
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/importlib-metadata/py2/importlib_metadata/__init__.py
python
Distribution._convert_egg_info_reqs_to_simple_reqs
(sections)
Historically, setuptools would solicit and store 'extra' requirements, including those with environment markers, in separate sections. More modern tools expect each dependency to be defined separately, with any relevant extras and environment markers attached directly to that req...
Historically, setuptools would solicit and store 'extra' requirements, including those with environment markers, in separate sections. More modern tools expect each dependency to be defined separately, with any relevant extras and environment markers attached directly to that req...
[ "Historically", "setuptools", "would", "solicit", "and", "store", "extra", "requirements", "including", "those", "with", "environment", "markers", "in", "separate", "sections", ".", "More", "modern", "tools", "expect", "each", "dependency", "to", "be", "defined", ...
def _convert_egg_info_reqs_to_simple_reqs(sections): """ Historically, setuptools would solicit and store 'extra' requirements, including those with environment markers, in separate sections. More modern tools expect each dependency to be defined separately, with any relevant ...
[ "def", "_convert_egg_info_reqs_to_simple_reqs", "(", "sections", ")", ":", "def", "make_condition", "(", "name", ")", ":", "return", "name", "and", "'extra == \"{name}\"'", ".", "format", "(", "name", "=", "name", ")", "def", "parse_condition", "(", "section", "...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/importlib-metadata/py2/importlib_metadata/__init__.py#L366-L389
ideawu/ssdb
f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4
deps/cpy/antlr3/tree.py
python
Tree.freshenParentAndChildIndexes
(self)
Set the parent and child index values for all children
Set the parent and child index values for all children
[ "Set", "the", "parent", "and", "child", "index", "values", "for", "all", "children" ]
def freshenParentAndChildIndexes(self): """Set the parent and child index values for all children""" raise NotImplementedError
[ "def", "freshenParentAndChildIndexes", "(", "self", ")", ":", "raise", "NotImplementedError" ]
https://github.com/ideawu/ssdb/blob/f229ba277c7f7d0ca5a441c0c6fb3d1209af68e4/deps/cpy/antlr3/tree.py#L142-L145
y123456yz/reading-and-annotate-mongodb-3.6
93280293672ca7586dc24af18132aa61e4ed7fcf
mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py
python
_detect_xgettext
(env)
return None
Detects *xgettext(1)* binary
Detects *xgettext(1)* binary
[ "Detects", "*", "xgettext", "(", "1", ")", "*", "binary" ]
def _detect_xgettext(env): """ Detects *xgettext(1)* binary """ if env.has_key('XGETTEXT'): return env['XGETTEXT'] xgettext = env.Detect('xgettext'); if xgettext: return xgettext raise SCons.Errors.StopError(XgettextNotFound,"Could not detect xgettext") return None
[ "def", "_detect_xgettext", "(", "env", ")", ":", "if", "env", ".", "has_key", "(", "'XGETTEXT'", ")", ":", "return", "env", "[", "'XGETTEXT'", "]", "xgettext", "=", "env", ".", "Detect", "(", "'xgettext'", ")", "if", "xgettext", ":", "return", "xgettext"...
https://github.com/y123456yz/reading-and-annotate-mongodb-3.6/blob/93280293672ca7586dc24af18132aa61e4ed7fcf/mongo/src/third_party/scons-2.5.0/scons-local-2.5.0/SCons/Tool/GettextCommon.py#L349-L357
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/telemetry/telemetry/internal/platform/profiler/android_profiling_helper.py
python
CreateSymFs
(device, symfs_dir, libraries, use_symlinks=True)
return output_kallsyms
Creates a symfs directory to be used for symbolizing profiles. Prepares a set of files ("symfs") to be used with profilers such as perf for converting binary addresses into human readable function names. Args: device: DeviceUtils instance identifying the target device. symfs_dir: Path where the symfs sh...
Creates a symfs directory to be used for symbolizing profiles.
[ "Creates", "a", "symfs", "directory", "to", "be", "used", "for", "symbolizing", "profiles", "." ]
def CreateSymFs(device, symfs_dir, libraries, use_symlinks=True): """Creates a symfs directory to be used for symbolizing profiles. Prepares a set of files ("symfs") to be used with profilers such as perf for converting binary addresses into human readable function names. Args: device: DeviceUtils instanc...
[ "def", "CreateSymFs", "(", "device", ",", "symfs_dir", ",", "libraries", ",", "use_symlinks", "=", "True", ")", ":", "logging", ".", "info", "(", "'Building symfs into %s.'", "%", "symfs_dir", ")", "for", "lib", "in", "libraries", ":", "device_dir", "=", "os...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/telemetry/telemetry/internal/platform/profiler/android_profiling_helper.py#L190-L263
ceph/ceph
959663007321a369c83218414a29bd9dbc8bda3a
qa/tasks/rook.py
python
task
(ctx, config)
Deploy rook-ceph cluster tasks: - kubeadm: - rook: branch: wip-foo spec: mon: count: 1 The spec item is deep-merged against the cluster.yaml. The branch, sha1, or image items are used to determine the Ceph container image.
Deploy rook-ceph cluster
[ "Deploy", "rook", "-", "ceph", "cluster" ]
def task(ctx, config): """ Deploy rook-ceph cluster tasks: - kubeadm: - rook: branch: wip-foo spec: mon: count: 1 The spec item is deep-merged against the cluster.yaml. The branch, sha1, or image items are used to determine the Ceph cont...
[ "def", "task", "(", "ctx", ",", "config", ")", ":", "if", "not", "config", ":", "config", "=", "{", "}", "assert", "isinstance", "(", "config", ",", "dict", ")", ",", "\"task only supports a dictionary for configuration\"", "log", ".", "info", "(", "'Rook st...
https://github.com/ceph/ceph/blob/959663007321a369c83218414a29bd9dbc8bda3a/qa/tasks/rook.py#L574-L677
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/dom/minidom.py
python
ElementInfo.isEmpty
(self)
return False
Returns true iff this element is declared to have an EMPTY content model.
Returns true iff this element is declared to have an EMPTY content model.
[ "Returns", "true", "iff", "this", "element", "is", "declared", "to", "have", "an", "EMPTY", "content", "model", "." ]
def isEmpty(self): """Returns true iff this element is declared to have an EMPTY content model.""" return False
[ "def", "isEmpty", "(", "self", ")", ":", "return", "False" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/xml/dom/minidom.py#L1492-L1495
bulletphysics/bullet3
f0f2a952e146f016096db6f85cf0c44ed75b0b9a
examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_rainbow_dash.py
python
MinitaurRainbowDash._ResetPoseForLeg
(self, leg_id, add_constraint)
Reset the initial pose for the leg. Args: leg_id: It should be 0, 1, 2, or 3, which represents the leg at front_left, back_left, front_right and back_right. add_constraint: Whether to add a constraint at the joints of two feet.
Reset the initial pose for the leg.
[ "Reset", "the", "initial", "pose", "for", "the", "leg", "." ]
def _ResetPoseForLeg(self, leg_id, add_constraint): """Reset the initial pose for the leg. Args: leg_id: It should be 0, 1, 2, or 3, which represents the leg at front_left, back_left, front_right and back_right. add_constraint: Whether to add a constraint at the joints of two feet. """ ...
[ "def", "_ResetPoseForLeg", "(", "self", ",", "leg_id", ",", "add_constraint", ")", ":", "knee_friction_force", "=", "0", "half_pi", "=", "math", ".", "pi", "/", "2.0", "knee_angle", "=", "-", "2.1834", "leg_position", "=", "minitaur", ".", "LEG_POSITION", "[...
https://github.com/bulletphysics/bullet3/blob/f0f2a952e146f016096db6f85cf0c44ed75b0b9a/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_rainbow_dash.py#L91-L170
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/propgrid.py
python
PGArrayEditorDialog.SetDialogValue
(*args, **kwargs)
return _propgrid.PGArrayEditorDialog_SetDialogValue(*args, **kwargs)
SetDialogValue(self, wxVariant value)
SetDialogValue(self, wxVariant value)
[ "SetDialogValue", "(", "self", "wxVariant", "value", ")" ]
def SetDialogValue(*args, **kwargs): """SetDialogValue(self, wxVariant value)""" return _propgrid.PGArrayEditorDialog_SetDialogValue(*args, **kwargs)
[ "def", "SetDialogValue", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_propgrid", ".", "PGArrayEditorDialog_SetDialogValue", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/propgrid.py#L3190-L3192
eclipse/sumo
7132a9b8b6eea734bdec38479026b4d8c4336d03
tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py
python
AddODflowTool.deactivate
(self)
This call by metacanvas signals that the tool has been deactivated and can now interact with metacanvas.
This call by metacanvas signals that the tool has been deactivated and can now interact with metacanvas.
[ "This", "call", "by", "metacanvas", "signals", "that", "the", "tool", "has", "been", "deactivated", "and", "can", "now", "interact", "with", "metacanvas", "." ]
def deactivate(self): """ This call by metacanvas signals that the tool has been deactivated and can now interact with metacanvas. """ self._is_active = False self.unhighlight_zones() self._canvas.draw() self.deactivate_select()
[ "def", "deactivate", "(", "self", ")", ":", "self", ".", "_is_active", "=", "False", "self", ".", "unhighlight_zones", "(", ")", "self", ".", "_canvas", ".", "draw", "(", ")", "self", ".", "deactivate_select", "(", ")" ]
https://github.com/eclipse/sumo/blob/7132a9b8b6eea734bdec38479026b4d8c4336d03/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py#L369-L378
HKUST-Aerial-Robotics/Teach-Repeat-Replan
98505a7f74b13c8b501176ff838a38423dbef536
utils/pose_utils/build/devel/_setup_util.py
python
find_env_hooks
(environ, cmake_prefix_path)
return lines
Generate shell code with found environment hooks for the all workspaces.
Generate shell code with found environment hooks for the all workspaces.
[ "Generate", "shell", "code", "with", "found", "environment", "hooks", "for", "the", "all", "workspaces", "." ]
def find_env_hooks(environ, cmake_prefix_path): ''' Generate shell code with found environment hooks for the all workspaces. ''' lines = [] lines.append(comment('found environment hooks in workspaces')) generic_env_hooks = [] generic_env_hooks_workspace = [] specific_env_hooks = [] ...
[ "def", "find_env_hooks", "(", "environ", ",", "cmake_prefix_path", ")", ":", "lines", "=", "[", "]", "lines", ".", "append", "(", "comment", "(", "'found environment hooks in workspaces'", ")", ")", "generic_env_hooks", "=", "[", "]", "generic_env_hooks_workspace", ...
https://github.com/HKUST-Aerial-Robotics/Teach-Repeat-Replan/blob/98505a7f74b13c8b501176ff838a38423dbef536/utils/pose_utils/build/devel/_setup_util.py#L195-L244
gimli-org/gimli
17aa2160de9b15ababd9ef99e89b1bc3277bbb23
pygimli/solver/solver.py
python
checkCFL
(times, mesh, vMax, verbose=False)
return c
Check Courant-Friedrichs-Lewy condition. For advection and flow problems. CFL Number should be lower then 1 to ensure stability. Parameters ----------
Check Courant-Friedrichs-Lewy condition.
[ "Check", "Courant", "-", "Friedrichs", "-", "Lewy", "condition", "." ]
def checkCFL(times, mesh, vMax, verbose=False): """Check Courant-Friedrichs-Lewy condition. For advection and flow problems. CFL Number should be lower then 1 to ensure stability. Parameters ---------- """ if pg.isScalar(times): dt = times else: dt = times[1] - times[0]...
[ "def", "checkCFL", "(", "times", ",", "mesh", ",", "vMax", ",", "verbose", "=", "False", ")", ":", "if", "pg", ".", "isScalar", "(", "times", ")", ":", "dt", "=", "times", "else", ":", "dt", "=", "times", "[", "1", "]", "-", "times", "[", "0", ...
https://github.com/gimli-org/gimli/blob/17aa2160de9b15ababd9ef99e89b1bc3277bbb23/pygimli/solver/solver.py#L2512-L2545
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python/src/Lib/plat-riscos/riscospath.py
python
walk
(top, func, arg)
Directory tree walk with callback function. For each directory in the directory tree rooted at top (including top itself, but excluding '.' and '..'), call func(arg, dirname, fnames). dirname is the name of the directory, and fnames a list of the names of the files and subdirectories in dirname (exclud...
Directory tree walk with callback function.
[ "Directory", "tree", "walk", "with", "callback", "function", "." ]
def walk(top, func, arg): """Directory tree walk with callback function. For each directory in the directory tree rooted at top (including top itself, but excluding '.' and '..'), call func(arg, dirname, fnames). dirname is the name of the directory, and fnames a list of the names of the files and ...
[ "def", "walk", "(", "top", ",", "func", ",", "arg", ")", ":", "try", ":", "names", "=", "os", ".", "listdir", "(", "top", ")", "except", "os", ".", "error", ":", "return", "func", "(", "arg", ",", "top", ",", "names", ")", "for", "name", "in", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python/src/Lib/plat-riscos/riscospath.py#L355-L378
krishauser/Klampt
972cc83ea5befac3f653c1ba20f80155768ad519
Python/python2_version/klampt/sim/simulation.py
python
DefaultActuatorEmulator.process
(self,commands,dt)
return
Commands: a dictionary of values outputted from the controller module, or None if no command was issued.
Commands: a dictionary of values outputted from the controller module, or None if no command was issued.
[ "Commands", ":", "a", "dictionary", "of", "values", "outputted", "from", "the", "controller", "module", "or", "None", "if", "no", "command", "was", "issued", "." ]
def process(self,commands,dt): """Commands: a dictionary of values outputted from the controller module, or None if no command was issued. """ if commands == None: return c = self.controller defaultVals = set(['torquecmd','qcmd','dqcmd','tcmd']) if 'qcmd' in commands: ...
[ "def", "process", "(", "self", ",", "commands", ",", "dt", ")", ":", "if", "commands", "==", "None", ":", "return", "c", "=", "self", ".", "controller", "defaultVals", "=", "set", "(", "[", "'torquecmd'", ",", "'qcmd'", ",", "'dqcmd'", ",", "'tcmd'", ...
https://github.com/krishauser/Klampt/blob/972cc83ea5befac3f653c1ba20f80155768ad519/Python/python2_version/klampt/sim/simulation.py#L100-L121
neopenx/Dragon
0e639a7319035ddc81918bd3df059230436ee0a1
Dragon/python/dragon/vm/caffe/net_spec.py
python
to_proto
(*tops)
return net
Generate a NetParameter that contains all layers needed to compute all arguments.
Generate a NetParameter that contains all layers needed to compute all arguments.
[ "Generate", "a", "NetParameter", "that", "contains", "all", "layers", "needed", "to", "compute", "all", "arguments", "." ]
def to_proto(*tops): """Generate a NetParameter that contains all layers needed to compute all arguments.""" layers = OrderedDict() autonames = Counter() for top in tops: top.fn._to_proto(layers, {}, autonames) net = caffe_pb2.NetParameter() net.layer.extend(layers.values()) ret...
[ "def", "to_proto", "(", "*", "tops", ")", ":", "layers", "=", "OrderedDict", "(", ")", "autonames", "=", "Counter", "(", ")", "for", "top", "in", "tops", ":", "top", ".", "fn", ".", "_to_proto", "(", "layers", ",", "{", "}", ",", "autonames", ")", ...
https://github.com/neopenx/Dragon/blob/0e639a7319035ddc81918bd3df059230436ee0a1/Dragon/python/dragon/vm/caffe/net_spec.py#L21-L31
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/_misc.py
python
ConfigBase_Create
(*args)
return _misc_.ConfigBase_Create(*args)
ConfigBase_Create() -> ConfigBase Create and return a new global config object. This function will create the "best" implementation of wx.Config available for the current platform.
ConfigBase_Create() -> ConfigBase
[ "ConfigBase_Create", "()", "-", ">", "ConfigBase" ]
def ConfigBase_Create(*args): """ ConfigBase_Create() -> ConfigBase Create and return a new global config object. This function will create the "best" implementation of wx.Config available for the current platform. """ return _misc_.ConfigBase_Create(*args)
[ "def", "ConfigBase_Create", "(", "*", "args", ")", ":", "return", "_misc_", ".", "ConfigBase_Create", "(", "*", "args", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/_misc.py#L3467-L3475
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xmlNode.hasNsProp
(self, name, nameSpace)
return __tmp
Search for an attribute associated to a node This attribute has to be anchored in the namespace specified. This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. Note that a ...
Search for an attribute associated to a node This attribute has to be anchored in the namespace specified. This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off. Note that a ...
[ "Search", "for", "an", "attribute", "associated", "to", "a", "node", "This", "attribute", "has", "to", "be", "anchored", "in", "the", "namespace", "specified", ".", "This", "does", "the", "entity", "substitution", ".", "This", "function", "looks", "in", "DTD...
def hasNsProp(self, name, nameSpace): """Search for an attribute associated to a node This attribute has to be anchored in the namespace specified. This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values...
[ "def", "hasNsProp", "(", "self", ",", "name", ",", "nameSpace", ")", ":", "ret", "=", "libxml2mod", ".", "xmlHasNsProp", "(", "self", ".", "_o", ",", "name", ",", "nameSpace", ")", "if", "ret", "is", "None", ":", "return", "None", "__tmp", "=", "xmlA...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L3270-L3280
apache/kudu
90895ce76590f10730ad7aac3613b69d89ff5422
build-support/iwyu/fix_includes.py
python
_GetSymbolNameFromForwardDeclareLine
(line)
return symbol_name
Given a forward declare line to add from iwyu output, get symbol. Two possibilities: In or not in namespace(s). If in namespaces, then return foo::bar::sym. Else just sym.
Given a forward declare line to add from iwyu output, get symbol.
[ "Given", "a", "forward", "declare", "line", "to", "add", "from", "iwyu", "output", "get", "symbol", "." ]
def _GetSymbolNameFromForwardDeclareLine(line): """Given a forward declare line to add from iwyu output, get symbol. Two possibilities: In or not in namespace(s). If in namespaces, then return foo::bar::sym. Else just sym. """ iwyu_namespace_re = re.compile(r'namespace ([^{]*) { ') symbolname_re = re.com...
[ "def", "_GetSymbolNameFromForwardDeclareLine", "(", "line", ")", ":", "iwyu_namespace_re", "=", "re", ".", "compile", "(", "r'namespace ([^{]*) { '", ")", "symbolname_re", "=", "re", ".", "compile", "(", "r'([A-Za-z0-9_]+)'", ")", "# Turn anonymous namespaces into their p...
https://github.com/apache/kudu/blob/90895ce76590f10730ad7aac3613b69d89ff5422/build-support/iwyu/fix_includes.py#L2074-L2090
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
tools/site_compare/operators/equals.py
python
Compare
(file1, file2, **kwargs)
Compares two images to see if they're identical. Args: file1: path to first image to compare file2: path to second image to compare kwargs: unused for this operator Returns: None if the images are identical A tuple of (errorstring, image) if they're not
Compares two images to see if they're identical.
[ "Compares", "two", "images", "to", "see", "if", "they", "re", "identical", "." ]
def Compare(file1, file2, **kwargs): """Compares two images to see if they're identical. Args: file1: path to first image to compare file2: path to second image to compare kwargs: unused for this operator Returns: None if the images are identical A tuple of (errorstring, image) if they're no...
[ "def", "Compare", "(", "file1", ",", "file2", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "kwargs", "# unused parameter", "im1", "=", "Image", ".", "open", "(", "file1", ")", "im2", "=", "Image", ".", "open", "(", "file2", ")", "if", "im1", "...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/tools/site_compare/operators/equals.py#L11-L37
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/traitlets/py3/traitlets/config/configurable.py
python
Configurable.class_config_rst_doc
(cls)
return '\n'.join(lines)
Generate rST documentation for this class' config options. Excludes traits defined on parent classes.
Generate rST documentation for this class' config options.
[ "Generate", "rST", "documentation", "for", "this", "class", "config", "options", "." ]
def class_config_rst_doc(cls): """Generate rST documentation for this class' config options. Excludes traits defined on parent classes. """ lines = [] classname = cls.__name__ for k, trait in sorted(cls.class_traits(config=True).items()): ttype = trait.__clas...
[ "def", "class_config_rst_doc", "(", "cls", ")", ":", "lines", "=", "[", "]", "classname", "=", "cls", ".", "__name__", "for", "k", ",", "trait", "in", "sorted", "(", "cls", ".", "class_traits", "(", "config", "=", "True", ")", ".", "items", "(", ")",...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/traitlets/py3/traitlets/config/configurable.py#L392-L431
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/webapp2/webapp2_extras/sessions.py
python
SessionStore.__init__
(self, request, config=None)
Initializes the session store. :param request: A :class:`webapp2.Request` instance. :param config: A dictionary of configuration values to be overridden. See the available keys in :data:`default_config`.
Initializes the session store.
[ "Initializes", "the", "session", "store", "." ]
def __init__(self, request, config=None): """Initializes the session store. :param request: A :class:`webapp2.Request` instance. :param config: A dictionary of configuration values to be overridden. See the available keys in :data:`default_config`. ""...
[ "def", "__init__", "(", "self", ",", "request", ",", "config", "=", "None", ")", ":", "self", ".", "request", "=", "request", "# Base configuration.", "self", ".", "config", "=", "request", ".", "app", ".", "config", ".", "load_config", "(", "self", ".",...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/webapp2/webapp2_extras/sessions.py#L295-L310
miyosuda/TensorFlowAndroidDemo
35903e0221aa5f109ea2dbef27f20b52e317f42d
jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py
python
GmmAlgorithm._define_full_covariance_probs
(self, shard_id, shard)
Defines the full covariance probabilties per example in a class. Updates a matrix with dimension num_examples X num_classes. Args: shard_id: id of the current shard. shard: current data shard, 1 X num_examples X dimensions.
Defines the full covariance probabilties per example in a class.
[ "Defines", "the", "full", "covariance", "probabilties", "per", "example", "in", "a", "class", "." ]
def _define_full_covariance_probs(self, shard_id, shard): """Defines the full covariance probabilties per example in a class. Updates a matrix with dimension num_examples X num_classes. Args: shard_id: id of the current shard. shard: current data shard, 1 X num_examples X dimensions. """ ...
[ "def", "_define_full_covariance_probs", "(", "self", ",", "shard_id", ",", "shard", ")", ":", "diff", "=", "shard", "-", "self", ".", "_means", "cholesky", "=", "tf", ".", "batch_cholesky", "(", "self", ".", "_covs", "+", "self", ".", "_min_var", ")", "l...
https://github.com/miyosuda/TensorFlowAndroidDemo/blob/35903e0221aa5f109ea2dbef27f20b52e317f42d/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_ops.py#L220-L239
naver/sling
5671cd445a2caae0b4dd0332299e4cfede05062c
webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py
python
_LogicalStream.send_ping
(self, body='')
Overrides Stream.send_ping
Overrides Stream.send_ping
[ "Overrides", "Stream", ".", "send_ping" ]
def send_ping(self, body=''): """Overrides Stream.send_ping""" self._logger.debug('Sending ping on logical channel %d: %r' % (self._request.channel_id, body)) self._write_inner_frame(common.OPCODE_PING, body, end=True) self._ping_queue.append(body)
[ "def", "send_ping", "(", "self", ",", "body", "=", "''", ")", ":", "self", ".", "_logger", ".", "debug", "(", "'Sending ping on logical channel %d: %r'", "%", "(", "self", ".", "_request", ".", "channel_id", ",", "body", ")", ")", "self", ".", "_write_inne...
https://github.com/naver/sling/blob/5671cd445a2caae0b4dd0332299e4cfede05062c/webkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/mux.py#L1046-L1053
Polidea/SiriusObfuscator
b0e590d8130e97856afe578869b83a209e2b19be
SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py
python
SBTypeMemberFunction.GetArgumentTypeAtIndex
(self, *args)
return _lldb.SBTypeMemberFunction_GetArgumentTypeAtIndex(self, *args)
GetArgumentTypeAtIndex(self, uint32_t arg0) -> SBType
GetArgumentTypeAtIndex(self, uint32_t arg0) -> SBType
[ "GetArgumentTypeAtIndex", "(", "self", "uint32_t", "arg0", ")", "-", ">", "SBType" ]
def GetArgumentTypeAtIndex(self, *args): """GetArgumentTypeAtIndex(self, uint32_t arg0) -> SBType""" return _lldb.SBTypeMemberFunction_GetArgumentTypeAtIndex(self, *args)
[ "def", "GetArgumentTypeAtIndex", "(", "self", ",", "*", "args", ")", ":", "return", "_lldb", ".", "SBTypeMemberFunction_GetArgumentTypeAtIndex", "(", "self", ",", "*", "args", ")" ]
https://github.com/Polidea/SiriusObfuscator/blob/b0e590d8130e97856afe578869b83a209e2b19be/SymbolExtractorAndRenamer/lldb/scripts/Python/static-binding/lldb.py#L10236-L10238
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
contrib/gizmos/osx_cocoa/gizmos.py
python
TreeListCtrl.SetItemPyData
(*args, **kwargs)
return _gizmos.TreeListCtrl_SetItemPyData(*args, **kwargs)
SetItemPyData(self, TreeItemId item, PyObject obj)
SetItemPyData(self, TreeItemId item, PyObject obj)
[ "SetItemPyData", "(", "self", "TreeItemId", "item", "PyObject", "obj", ")" ]
def SetItemPyData(*args, **kwargs): """SetItemPyData(self, TreeItemId item, PyObject obj)""" return _gizmos.TreeListCtrl_SetItemPyData(*args, **kwargs)
[ "def", "SetItemPyData", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_gizmos", ".", "TreeListCtrl_SetItemPyData", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/contrib/gizmos/osx_cocoa/gizmos.py#L679-L681
natanielruiz/android-yolo
1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f
jni-build/jni/include/external/bazel_tools/tools/android/incremental_install.py
python
Adb.Push
(self, local, remote)
return self._ExecParallel(["push", local, remote])
Invoke 'adb push' in parallel.
Invoke 'adb push' in parallel.
[ "Invoke", "adb", "push", "in", "parallel", "." ]
def Push(self, local, remote): """Invoke 'adb push' in parallel.""" return self._ExecParallel(["push", local, remote])
[ "def", "Push", "(", "self", ",", "local", ",", "remote", ")", ":", "return", "self", ".", "_ExecParallel", "(", "[", "\"push\"", ",", "local", ",", "remote", "]", ")" ]
https://github.com/natanielruiz/android-yolo/blob/1ebb54f96a67a20ff83ddfc823ed83a13dc3a47f/jni-build/jni/include/external/bazel_tools/tools/android/incremental_install.py#L194-L196
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/scipy/stats/_multivariate.py
python
wishart_gen.__call__
(self, df=None, scale=None, seed=None)
return wishart_frozen(df, scale, seed)
Create a frozen Wishart distribution. See `wishart_frozen` for more information.
Create a frozen Wishart distribution.
[ "Create", "a", "frozen", "Wishart", "distribution", "." ]
def __call__(self, df=None, scale=None, seed=None): """ Create a frozen Wishart distribution. See `wishart_frozen` for more information. """ return wishart_frozen(df, scale, seed)
[ "def", "__call__", "(", "self", ",", "df", "=", "None", ",", "scale", "=", "None", ",", "seed", "=", "None", ")", ":", "return", "wishart_frozen", "(", "df", ",", "scale", ",", "seed", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/scipy/stats/_multivariate.py#L1528-L1535
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py
python
Misc.bindtags
(self, tagList=None)
Set or get the list of bindtags for this widget. With no argument return the list of all bindtags associated with this widget. With a list of strings as argument the bindtags are set to this list. The bindtags determine in which order events are processed (see bind).
Set or get the list of bindtags for this widget.
[ "Set", "or", "get", "the", "list", "of", "bindtags", "for", "this", "widget", "." ]
def bindtags(self, tagList=None): """Set or get the list of bindtags for this widget. With no argument return the list of all bindtags associated with this widget. With a list of strings as argument the bindtags are set to this list. The bindtags determine in which order events are ...
[ "def", "bindtags", "(", "self", ",", "tagList", "=", "None", ")", ":", "if", "tagList", "is", "None", ":", "return", "self", ".", "tk", ".", "splitlist", "(", "self", ".", "tk", ".", "call", "(", "'bindtags'", ",", "self", ".", "_w", ")", ")", "e...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py#L1183-L1194
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/nn/metrics/confusion_matrix.py
python
_calculate_fnr
(fn, p)
return fn, p
Calculate fnr.
Calculate fnr.
[ "Calculate", "fnr", "." ]
def _calculate_fnr(fn, p): """Calculate fnr.""" return fn, p
[ "def", "_calculate_fnr", "(", "fn", ",", "p", ")", ":", "return", "fn", ",", "p" ]
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/nn/metrics/confusion_matrix.py#L484-L486
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/signal/ltisys.py
python
StateSpace.__mul__
(self, other)
return StateSpace(np.asarray(a, dtype=common_dtype), np.asarray(b, dtype=common_dtype), np.asarray(c, dtype=common_dtype), np.asarray(d, dtype=common_dtype))
Post-multiply another system or a scalar Handles multiplication of systems in the sense of a frequency domain multiplication. That means, given two systems E1(s) and E2(s), their multiplication, H(s) = E1(s) * E2(s), means that applying H(s) to U(s) is equivalent to first applying E2(s)...
Post-multiply another system or a scalar
[ "Post", "-", "multiply", "another", "system", "or", "a", "scalar" ]
def __mul__(self, other): """ Post-multiply another system or a scalar Handles multiplication of systems in the sense of a frequency domain multiplication. That means, given two systems E1(s) and E2(s), their multiplication, H(s) = E1(s) * E2(s), means that applying H(s) to U(s)...
[ "def", "__mul__", "(", "self", ",", "other", ")", ":", "if", "not", "self", ".", "_check_binop_other", "(", "other", ")", ":", "return", "NotImplemented", "if", "isinstance", "(", "other", ",", "StateSpace", ")", ":", "# Disallow mix of discrete and continuous s...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/signal/ltisys.py#L1350-L1407
MegEngine/MegEngine
ce9ad07a27ec909fb8db4dd67943d24ba98fb93a
imperative/python/megengine/amp/grad_scaler.py
python
GradScaler.unscale
(self, grad_tensors: Iterable[Tensor])
return self
r"""Unscale all ``grad_tensors``'s grad. Args: grad_tensors: Tensors needed to unscale grads. Should be all tensors that are affected by ``target`` tensor in GradManager's backward.
r"""Unscale all ``grad_tensors``'s grad.
[ "r", "Unscale", "all", "grad_tensors", "s", "grad", "." ]
def unscale(self, grad_tensors: Iterable[Tensor]): r"""Unscale all ``grad_tensors``'s grad. Args: grad_tensors: Tensors needed to unscale grads. Should be all tensors that are affected by ``target`` tensor in GradManager's backward. """ if self.growth_interva...
[ "def", "unscale", "(", "self", ",", "grad_tensors", ":", "Iterable", "[", "Tensor", "]", ")", ":", "if", "self", ".", "growth_interval", "==", "0", ":", "# use float64 for better precision", "inv_scale", "=", "Tensor", "(", "1.0", "/", "self", ".", "scale_fa...
https://github.com/MegEngine/MegEngine/blob/ce9ad07a27ec909fb8db4dd67943d24ba98fb93a/imperative/python/megengine/amp/grad_scaler.py#L124-L149
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py
python
FancyURLopener.http_error_302
(self, url, fp, errcode, errmsg, headers, data=None)
Error 302 -- relocated (temporarily).
Error 302 -- relocated (temporarily).
[ "Error", "302", "--", "relocated", "(", "temporarily", ")", "." ]
def http_error_302(self, url, fp, errcode, errmsg, headers, data=None): """Error 302 -- relocated (temporarily).""" self.tries += 1 try: if self.maxtries and self.tries >= self.maxtries: if hasattr(self, "http_error_500"): meth = self.http_error_50...
[ "def", "http_error_302", "(", "self", ",", "url", ",", "fp", ",", "errcode", ",", "errmsg", ",", "headers", ",", "data", "=", "None", ")", ":", "self", ".", "tries", "+=", "1", "try", ":", "if", "self", ".", "maxtries", "and", "self", ".", "tries",...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py#L2154-L2170
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/setuptools/py3/setuptools/_distutils/command/register.py
python
register.send_metadata
(self)
Send the metadata to the package index server. Well, do the following: 1. figure who the user is, and then 2. send the data as a Basic auth'ed POST. First we try to read the username/password from $HOME/.pypirc, which is a ConfigParser-formatted file with a ...
Send the metadata to the package index server.
[ "Send", "the", "metadata", "to", "the", "package", "index", "server", "." ]
def send_metadata(self): ''' Send the metadata to the package index server. Well, do the following: 1. figure who the user is, and then 2. send the data as a Basic auth'ed POST. First we try to read the username/password from $HOME/.pypirc, which is ...
[ "def", "send_metadata", "(", "self", ")", ":", "# see if we can short-cut and get the username/password from the", "# config", "if", "self", ".", "has_config", ":", "choice", "=", "'1'", "username", "=", "self", ".", "username", "password", "=", "self", ".", "passwo...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/setuptools/py3/setuptools/_distutils/command/register.py#L99-L219
mantidproject/mantid
03deeb89254ec4289edb8771e0188c2090a02f32
qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/fitpropertybrowser.py
python
FitPropertyBrowser.move_x_range
(self, start_x, end_x)
Let the tool know that the Fit range has been changed in the FitPropertyBrowser. :param start_x: New value of StartX :param end_x: New value of EndX
Let the tool know that the Fit range has been changed in the FitPropertyBrowser. :param start_x: New value of StartX :param end_x: New value of EndX
[ "Let", "the", "tool", "know", "that", "the", "Fit", "range", "has", "been", "changed", "in", "the", "FitPropertyBrowser", ".", ":", "param", "start_x", ":", "New", "value", "of", "StartX", ":", "param", "end_x", ":", "New", "value", "of", "EndX" ]
def move_x_range(self, start_x, end_x): """ Let the tool know that the Fit range has been changed in the FitPropertyBrowser. :param start_x: New value of StartX :param end_x: New value of EndX """ if self.tool is not None: new_range = sorted([start_x, end_x]) ...
[ "def", "move_x_range", "(", "self", ",", "start_x", ",", "end_x", ")", ":", "if", "self", ".", "tool", "is", "not", "None", ":", "new_range", "=", "sorted", "(", "[", "start_x", ",", "end_x", "]", ")", "bounds", "=", "self", ".", "tool", ".", "fit_...
https://github.com/mantidproject/mantid/blob/03deeb89254ec4289edb8771e0188c2090a02f32/qt/python/mantidqt/mantidqt/widgets/fitpropertybrowser/fitpropertybrowser.py#L289-L301
Kitware/ParaView
f760af9124ff4634b23ebbeab95a4f56e0261955
ThirdParty/cinema/paraview/tpl/cinema_python/images/querymaker_specb.py
python
QueryMaker_SpecB.translateQuery
(self, query, colorDefinitions={})
return allLayers
Receives a UI query and returns a set of LayerRasters consisting of all the different layers to composite. See the base class documentation for detail.
Receives a UI query and returns a set of LayerRasters consisting of all the different layers to composite. See the base class documentation for detail.
[ "Receives", "a", "UI", "query", "and", "returns", "a", "set", "of", "LayerRasters", "consisting", "of", "all", "the", "different", "layers", "to", "composite", ".", "See", "the", "base", "class", "documentation", "for", "detail", "." ]
def translateQuery(self, query, colorDefinitions={}): ''' Receives a UI query and returns a set of LayerRasters consisting of all the different layers to composite. See the base class documentation for detail. ''' # Create a common base LayerRasters (time and camera). ...
[ "def", "translateQuery", "(", "self", ",", "query", ",", "colorDefinitions", "=", "{", "}", ")", ":", "# Create a common base LayerRasters (time and camera).", "baseLayer", "=", "self", ".", "_QueryMaker__createBaseLayerFromQuery", "(", "query", ")", "# Create all the Lay...
https://github.com/Kitware/ParaView/blob/f760af9124ff4634b23ebbeab95a4f56e0261955/ThirdParty/cinema/paraview/tpl/cinema_python/images/querymaker_specb.py#L243-L256
ricardoquesada/Spidermonkey
4a75ea2543408bd1b2c515aa95901523eeef7858
media/webrtc/trunk/tools/gyp/pylib/gyp/generator/make.py
python
MakefileWriter.WriteList
(self, value_list, variable=None, prefix='', quoter=QuoteIfNecessary)
Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style.
Write a variable definition that is a list of values.
[ "Write", "a", "variable", "definition", "that", "is", "a", "list", "of", "values", "." ]
def WriteList(self, value_list, variable=None, prefix='', quoter=QuoteIfNecessary): """Write a variable definition that is a list of values. E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out foo = blaha blahb but in a pretty-printed style. """ values = '' if va...
[ "def", "WriteList", "(", "self", ",", "value_list", ",", "variable", "=", "None", ",", "prefix", "=", "''", ",", "quoter", "=", "QuoteIfNecessary", ")", ":", "values", "=", "''", "if", "value_list", ":", "value_list", "=", "[", "quoter", "(", "prefix", ...
https://github.com/ricardoquesada/Spidermonkey/blob/4a75ea2543408bd1b2c515aa95901523eeef7858/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/make.py#L1625-L1637
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/gtk/_misc.py
python
ConfigBase.GetAppName
(*args, **kwargs)
return _misc_.ConfigBase_GetAppName(*args, **kwargs)
GetAppName(self) -> String
GetAppName(self) -> String
[ "GetAppName", "(", "self", ")", "-", ">", "String" ]
def GetAppName(*args, **kwargs): """GetAppName(self) -> String""" return _misc_.ConfigBase_GetAppName(*args, **kwargs)
[ "def", "GetAppName", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "ConfigBase_GetAppName", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/gtk/_misc.py#L3413-L3415
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/zipapp.py
python
create_archive
(source, target=None, interpreter=None, main=None, filter=None, compressed=False)
Create an application archive from SOURCE. The SOURCE can be the name of a directory, or a filename or a file-like object referring to an existing archive. The content of SOURCE is packed into an application archive in TARGET, which can be a filename or a file-like object. If SOURCE is a directory, ...
Create an application archive from SOURCE.
[ "Create", "an", "application", "archive", "from", "SOURCE", "." ]
def create_archive(source, target=None, interpreter=None, main=None, filter=None, compressed=False): """Create an application archive from SOURCE. The SOURCE can be the name of a directory, or a filename or a file-like object referring to an existing archive. The content of SOURCE i...
[ "def", "create_archive", "(", "source", ",", "target", "=", "None", ",", "interpreter", "=", "None", ",", "main", "=", "None", ",", "filter", "=", "None", ",", "compressed", "=", "False", ")", ":", "# Are we copying an existing archive?", "source_is_file", "="...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/zipapp.py#L76-L147
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
Clipboard.Get
(*args, **kwargs)
return _misc_.Clipboard_Get(*args, **kwargs)
Get() -> Clipboard Returns global instance (wxTheClipboard) of the object.
Get() -> Clipboard
[ "Get", "()", "-", ">", "Clipboard" ]
def Get(*args, **kwargs): """ Get() -> Clipboard Returns global instance (wxTheClipboard) of the object. """ return _misc_.Clipboard_Get(*args, **kwargs)
[ "def", "Get", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "Clipboard_Get", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L5906-L5912
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/masked/timectrl.py
python
TimeCtrl.SetInsertionPoint
(self, pos)
This override records the specified position and associated cell before calling base class' function. This is necessary to handle the optional spin button, because the insertion point is lost when the focus shifts to the spin button.
This override records the specified position and associated cell before calling base class' function. This is necessary to handle the optional spin button, because the insertion point is lost when the focus shifts to the spin button.
[ "This", "override", "records", "the", "specified", "position", "and", "associated", "cell", "before", "calling", "base", "class", "function", ".", "This", "is", "necessary", "to", "handle", "the", "optional", "spin", "button", "because", "the", "insertion", "poi...
def SetInsertionPoint(self, pos): """ This override records the specified position and associated cell before calling base class' function. This is necessary to handle the optional spin button, because the insertion point is lost when the focus shifts to the spin button. ...
[ "def", "SetInsertionPoint", "(", "self", ",", "pos", ")", ":", "## dbg('TimeCtrl::SetInsertionPoint', pos, indent=1)", "BaseMaskedTextCtrl", ".", "SetInsertionPoint", "(", "self", ",", "pos", ")", "# (causes EVT_TEXT event to fire)", "self", ".", "__posCurrent", "=",...
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/masked/timectrl.py#L1126-L1135
LiquidPlayer/LiquidCore
9405979363f2353ac9a71ad8ab59685dd7f919c9
deps/node-10.15.3/deps/v8/PRESUBMIT.py
python
_CheckHeadersHaveIncludeGuards
(input_api, output_api)
Ensures that all header files have include guards.
Ensures that all header files have include guards.
[ "Ensures", "that", "all", "header", "files", "have", "include", "guards", "." ]
def _CheckHeadersHaveIncludeGuards(input_api, output_api): """Ensures that all header files have include guards.""" file_inclusion_pattern = r'src/.+\.h' def FilterFile(affected_file): black_list = (_EXCLUDED_PATHS + input_api.DEFAULT_BLACK_LIST) return input_api.FilterSourceFile( ...
[ "def", "_CheckHeadersHaveIncludeGuards", "(", "input_api", ",", "output_api", ")", ":", "file_inclusion_pattern", "=", "r'src/.+\\.h'", "def", "FilterFile", "(", "affected_file", ")", ":", "black_list", "=", "(", "_EXCLUDED_PATHS", "+", "input_api", ".", "DEFAULT_BLAC...
https://github.com/LiquidPlayer/LiquidCore/blob/9405979363f2353ac9a71ad8ab59685dd7f919c9/deps/node-10.15.3/deps/v8/PRESUBMIT.py#L156-L209
CoolProp/CoolProp
381c8535e5dec3eec27ad430ebbfff8bc9dfc008
dev/scripts/fit_ancillary_ODRPACK.py
python
saturation_density
(Ref, ClassName, form='A', LV='L', perc_error_allowed=0.3, fName=None, add_critical=True)
return the_string
Parameters ---------- Ref : string The fluid name for the fluid that will be used to generate the saturation data ClassName : The name of the class that will be used in the C++ code form : string If ``'A'``, use a term of the form
[]
def saturation_density(Ref, ClassName, form='A', LV='L', perc_error_allowed=0.3, fName=None, add_critical=True): """ Parameters ---------- Ref : string The fluid name for the fluid that will be used to generate the saturation data ClassName : The name of the class that will be used in the C...
[ "def", "saturation_density", "(", "Ref", ",", "ClassName", ",", "form", "=", "'A'", ",", "LV", "=", "'L'", ",", "perc_error_allowed", "=", "0.3", ",", "fName", "=", "None", ",", "add_critical", "=", "True", ")", ":", "if", "fName", "is", "None", ":", ...
https://github.com/CoolProp/CoolProp/blob/381c8535e5dec3eec27ad430ebbfff8bc9dfc008/dev/scripts/fit_ancillary_ODRPACK.py#L22-L181
KratosMultiphysics/Kratos
0000833054ed0503424eb28205d6508d9ca6cbbc
applications/CoSimulationApplication/CoSimulationApplication.py
python
__ModuleInitDetail
()
Create a DataCommunicator that only contains rank zero and is undefined in other ranks This is necessary for solvers that can only run in serial It is defined as a function to avoid polluting the Kratos namespace with local variables.
Create a DataCommunicator that only contains rank zero and is undefined in other ranks This is necessary for solvers that can only run in serial It is defined as a function to avoid polluting the Kratos namespace with local variables.
[ "Create", "a", "DataCommunicator", "that", "only", "contains", "rank", "zero", "and", "is", "undefined", "in", "other", "ranks", "This", "is", "necessary", "for", "solvers", "that", "can", "only", "run", "in", "serial", "It", "is", "defined", "as", "a", "f...
def __ModuleInitDetail(): """ Create a DataCommunicator that only contains rank zero and is undefined in other ranks This is necessary for solvers that can only run in serial It is defined as a function to avoid polluting the Kratos namespace with local variables. """ import KratosMultiphysics a...
[ "def", "__ModuleInitDetail", "(", ")", ":", "import", "KratosMultiphysics", "as", "KM", "if", "KM", ".", "IsDistributedRun", "(", ")", ":", "from", "KratosMultiphysics", ".", "mpi", "import", "DataCommunicatorFactory", "data_comm_name", "=", "\"co_simulation_data_comm...
https://github.com/KratosMultiphysics/Kratos/blob/0000833054ed0503424eb28205d6508d9ca6cbbc/applications/CoSimulationApplication/CoSimulationApplication.py#L9-L21
bundy-dns/bundy
3d41934996b82b0cd2fe22dd74d2abc1daba835d
tools/query_cmp/src/lib/compare_rrset.py
python
header_cmp
(buf, msg1, msg2, diff)
return(True)
Compare the header of msg1 and msg2. @param buf: the formatted difference for output. @type buf: dict @param diff: the key is each flag in the header, the value is True for different and False for same @type diff: dict
Compare the header of msg1 and msg2.
[ "Compare", "the", "header", "of", "msg1", "and", "msg2", "." ]
def header_cmp(buf, msg1, msg2, diff): """ Compare the header of msg1 and msg2. @param buf: the formatted difference for output. @type buf: dict @param diff: the key is each flag in the header, the value is True for different and False for same @type diff: dict """ header1 = get_header_field(msg1) ...
[ "def", "header_cmp", "(", "buf", ",", "msg1", ",", "msg2", ",", "diff", ")", ":", "header1", "=", "get_header_field", "(", "msg1", ")", "header2", "=", "get_header_field", "(", "msg2", ")", "list", "=", "[", "'id'", ",", "'qr'", ",", "'opcode'", ",", ...
https://github.com/bundy-dns/bundy/blob/3d41934996b82b0cd2fe22dd74d2abc1daba835d/tools/query_cmp/src/lib/compare_rrset.py#L46-L77
Slicer/Slicer
ba9fadf332cb0303515b68d8d06a344c82e3e3e5
Base/Python/slicer/util.py
python
updateVolumeFromArray
(volumeNode, narray)
Sets voxels of a volume node from a numpy array. :raises RuntimeError: in case of failure Voxels values are deep-copied, therefore if the numpy array is modified after calling this method, voxel values in the volume node will not change. Dimensions and data size of the source numpy array does not have to matc...
Sets voxels of a volume node from a numpy array.
[ "Sets", "voxels", "of", "a", "volume", "node", "from", "a", "numpy", "array", "." ]
def updateVolumeFromArray(volumeNode, narray): """Sets voxels of a volume node from a numpy array. :raises RuntimeError: in case of failure Voxels values are deep-copied, therefore if the numpy array is modified after calling this method, voxel values in the volume node will not change. Dimensions and data ...
[ "def", "updateVolumeFromArray", "(", "volumeNode", ",", "narray", ")", ":", "vshape", "=", "tuple", "(", "reversed", "(", "narray", ".", "shape", ")", ")", "if", "len", "(", "vshape", ")", "==", "3", ":", "# Scalar volume", "vcomponents", "=", "1", "elif...
https://github.com/Slicer/Slicer/blob/ba9fadf332cb0303515b68d8d06a344c82e3e3e5/Base/Python/slicer/util.py#L1950-L1997
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_carbon/_misc.py
python
DateTime_GetCurrentMonth
(*args, **kwargs)
return _misc_.DateTime_GetCurrentMonth(*args, **kwargs)
DateTime_GetCurrentMonth(int cal=Gregorian) -> int
DateTime_GetCurrentMonth(int cal=Gregorian) -> int
[ "DateTime_GetCurrentMonth", "(", "int", "cal", "=", "Gregorian", ")", "-", ">", "int" ]
def DateTime_GetCurrentMonth(*args, **kwargs): """DateTime_GetCurrentMonth(int cal=Gregorian) -> int""" return _misc_.DateTime_GetCurrentMonth(*args, **kwargs)
[ "def", "DateTime_GetCurrentMonth", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_misc_", ".", "DateTime_GetCurrentMonth", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_carbon/_misc.py#L4245-L4247
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/quantize_wrapper.py
python
QuantizeWrapper._weight_name
(name)
return name.split(':')[0].split('/')[-1]
Extracts the weight name from the full TensorFlow variable name. For example, returns 'kernel' for 'dense_2/kernel:0'. Args: name: TensorFlow variable name. Returns: Extracted weight name.
Extracts the weight name from the full TensorFlow variable name.
[ "Extracts", "the", "weight", "name", "from", "the", "full", "TensorFlow", "variable", "name", "." ]
def _weight_name(name): """Extracts the weight name from the full TensorFlow variable name. For example, returns 'kernel' for 'dense_2/kernel:0'. Args: name: TensorFlow variable name. Returns: Extracted weight name. """ return name.split(':')[0].split('/')[-1]
[ "def", "_weight_name", "(", "name", ")", ":", "return", "name", ".", "split", "(", "':'", ")", "[", "0", "]", ".", "split", "(", "'/'", ")", "[", "-", "1", "]" ]
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/quantize_wrapper.py#L79-L90
RobotLocomotion/drake
0e18a34604c45ed65bc9018a54f7610f91cdad5b
tools/performance/benchmark_tool.py
python
CpuSpeedSettings.set_cpu_governor
(self, governor)
Set the CPU governor to the given name string.
Set the CPU governor to the given name string.
[ "Set", "the", "CPU", "governor", "to", "the", "given", "name", "string", "." ]
def set_cpu_governor(self, governor): """Set the CPU governor to the given name string.""" sudo('cpupower', 'frequency-set', '--governor', governor)
[ "def", "set_cpu_governor", "(", "self", ",", "governor", ")", ":", "sudo", "(", "'cpupower'", ",", "'frequency-set'", ",", "'--governor'", ",", "governor", ")" ]
https://github.com/RobotLocomotion/drake/blob/0e18a34604c45ed65bc9018a54f7610f91cdad5b/tools/performance/benchmark_tool.py#L89-L91
google/mysql-protobuf
467cda676afaa49e762c5c9164a43f6ad31a1fbf
protobuf/python/google/protobuf/service_reflection.py
python
_ServiceStubBuilder.__init__
(self, service_descriptor)
Initializes an instance of the service stub class builder. Args: service_descriptor: ServiceDescriptor to use when constructing the stub class.
Initializes an instance of the service stub class builder.
[ "Initializes", "an", "instance", "of", "the", "service", "stub", "class", "builder", "." ]
def __init__(self, service_descriptor): """Initializes an instance of the service stub class builder. Args: service_descriptor: ServiceDescriptor to use when constructing the stub class. """ self.descriptor = service_descriptor
[ "def", "__init__", "(", "self", ",", "service_descriptor", ")", ":", "self", ".", "descriptor", "=", "service_descriptor" ]
https://github.com/google/mysql-protobuf/blob/467cda676afaa49e762c5c9164a43f6ad31a1fbf/protobuf/python/google/protobuf/service_reflection.py#L242-L249
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/mailbox.py
python
Mailbox.get_message
(self, key)
Return a Message representation or raise a KeyError.
Return a Message representation or raise a KeyError.
[ "Return", "a", "Message", "representation", "or", "raise", "a", "KeyError", "." ]
def get_message(self, key): """Return a Message representation or raise a KeyError.""" raise NotImplementedError('Method must be implemented by subclass')
[ "def", "get_message", "(", "self", ",", "key", ")", ":", "raise", "NotImplementedError", "(", "'Method must be implemented by subclass'", ")" ]
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/mailbox.py#L78-L80
pmq20/node-packer
12c46c6e44fbc14d9ee645ebd17d5296b324f7e0
lts/tools/inspector_protocol/jinja2/debug.py
python
ProcessedTraceback.render_as_text
(self, limit=None)
return ''.join(lines).rstrip()
Return a string with the traceback.
Return a string with the traceback.
[ "Return", "a", "string", "with", "the", "traceback", "." ]
def render_as_text(self, limit=None): """Return a string with the traceback.""" lines = traceback.format_exception(self.exc_type, self.exc_value, self.frames[0], limit=limit) return ''.join(lines).rstrip()
[ "def", "render_as_text", "(", "self", ",", "limit", "=", "None", ")", ":", "lines", "=", "traceback", ".", "format_exception", "(", "self", ".", "exc_type", ",", "self", ".", "exc_value", ",", "self", ".", "frames", "[", "0", "]", ",", "limit", "=", ...
https://github.com/pmq20/node-packer/blob/12c46c6e44fbc14d9ee645ebd17d5296b324f7e0/lts/tools/inspector_protocol/jinja2/debug.py#L97-L101
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/scipy/py3/scipy/interpolate/_fitpack_impl.py
python
bisplev
(x, y, tck, dx=0, dy=0)
return z[0][0]
Evaluate a bivariate B-spline and its derivatives. Return a rank-2 array of spline function values (or spline derivative values) at points given by the cross-product of the rank-1 arrays `x` and `y`. In special cases, return an array or just a float if either `x` or `y` or both are floats. Based on B...
Evaluate a bivariate B-spline and its derivatives.
[ "Evaluate", "a", "bivariate", "B", "-", "spline", "and", "its", "derivatives", "." ]
def bisplev(x, y, tck, dx=0, dy=0): """ Evaluate a bivariate B-spline and its derivatives. Return a rank-2 array of spline function values (or spline derivative values) at points given by the cross-product of the rank-1 arrays `x` and `y`. In special cases, return an array or just a float if eithe...
[ "def", "bisplev", "(", "x", ",", "y", ",", "tck", ",", "dx", "=", "0", ",", "dy", "=", "0", ")", ":", "tx", ",", "ty", ",", "c", ",", "kx", ",", "ky", "=", "tck", "if", "not", "(", "0", "<=", "dx", "<", "kx", ")", ":", "raise", "ValueEr...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/scipy/py3/scipy/interpolate/_fitpack_impl.py#L991-L1057
ApolloAuto/apollo-platform
86d9dc6743b496ead18d597748ebabd34a513289
ros/ros_comm/rospy/src/rospy/topics.py
python
_PublisherImpl.get_stats
(self)
return (self.resolved_name, self.message_data_sent, [(c.id, c.stat_bytes, c.stat_num_msg, not c.done) for c in conn] )
Get the stats for this topic publisher @return: stats for topic in getBusStats() publisher format:: [topicName, messageDataBytes, connStats], where connStats is:: [id, bytes, numMessages, connected]* @rtype: list
Get the stats for this topic publisher
[ "Get", "the", "stats", "for", "this", "topic", "publisher" ]
def get_stats(self): # STATS """ Get the stats for this topic publisher @return: stats for topic in getBusStats() publisher format:: [topicName, messageDataBytes, connStats], where connStats is:: [id, bytes, numMessages, connected]* @rtype: list """ ...
[ "def", "get_stats", "(", "self", ")", ":", "# STATS", "# save reference to avoid lock", "conn", "=", "self", ".", "connections", "return", "(", "self", ".", "resolved_name", ",", "self", ".", "message_data_sent", ",", "[", "(", "c", ".", "id", ",", "c", "....
https://github.com/ApolloAuto/apollo-platform/blob/86d9dc6743b496ead18d597748ebabd34a513289/ros/ros_comm/rospy/src/rospy/topics.py#L952-L964
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/encoding_stage.py
python
_tf_style_update_state
(update_state_fn)
return actual_initial_state_fn
Method decorator for `tf_style_adaptive_encoding_stage`.
Method decorator for `tf_style_adaptive_encoding_stage`.
[ "Method", "decorator", "for", "tf_style_adaptive_encoding_stage", "." ]
def _tf_style_update_state(update_state_fn): """Method decorator for `tf_style_adaptive_encoding_stage`.""" def actual_initial_state_fn(self, state, state_update_tensors, name=None): """Modified `update_state` method.""" values = list(state.values()) + list(state_update_tensors.values()) with tf.compat...
[ "def", "_tf_style_update_state", "(", "update_state_fn", ")", ":", "def", "actual_initial_state_fn", "(", "self", ",", "state", ",", "state_update_tensors", ",", "name", "=", "None", ")", ":", "\"\"\"Modified `update_state` method.\"\"\"", "values", "=", "list", "(", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/internal/tensor_encoding/core/encoding_stage.py#L640-L653
Komnomnomnom/swigibpy
cfd307fdbfaffabc69a2dc037538d7e34a8b8daf
swigibpy.py
python
EClient.replaceFA
(self, pFaDataType, cxml)
return _swigibpy.EClient_replaceFA(self, pFaDataType, cxml)
replaceFA(EClient self, faDataType pFaDataType, IBString const & cxml)
replaceFA(EClient self, faDataType pFaDataType, IBString const & cxml)
[ "replaceFA", "(", "EClient", "self", "faDataType", "pFaDataType", "IBString", "const", "&", "cxml", ")" ]
def replaceFA(self, pFaDataType, cxml): """replaceFA(EClient self, faDataType pFaDataType, IBString const & cxml)""" return _swigibpy.EClient_replaceFA(self, pFaDataType, cxml)
[ "def", "replaceFA", "(", "self", ",", "pFaDataType", ",", "cxml", ")", ":", "return", "_swigibpy", ".", "EClient_replaceFA", "(", "self", ",", "pFaDataType", ",", "cxml", ")" ]
https://github.com/Komnomnomnom/swigibpy/blob/cfd307fdbfaffabc69a2dc037538d7e34a8b8daf/swigibpy.py#L1210-L1212
tensorflow/tensorflow
419e3a6b650ea4bd1b0cba23c4348f8a69f3272e
tensorflow/python/ops/math_ops.py
python
angle
(input, name=None)
r"""Returns the element-wise argument of a complex (or real) tensor. Given a tensor `input`, this operation returns a tensor of type `float` that is the argument of each element in `input` considered as a complex number. The elements in `input` are considered to be complex numbers of the form \\(a + bj\\), wh...
r"""Returns the element-wise argument of a complex (or real) tensor.
[ "r", "Returns", "the", "element", "-", "wise", "argument", "of", "a", "complex", "(", "or", "real", ")", "tensor", "." ]
def angle(input, name=None): r"""Returns the element-wise argument of a complex (or real) tensor. Given a tensor `input`, this operation returns a tensor of type `float` that is the argument of each element in `input` considered as a complex number. The elements in `input` are considered to be complex numbers...
[ "def", "angle", "(", "input", ",", "name", "=", "None", ")", ":", "with", "ops", ".", "name_scope", "(", "name", ",", "\"Angle\"", ",", "[", "input", "]", ")", "as", "name", ":", "input", "=", "ops", ".", "convert_to_tensor", "(", "input", ",", "na...
https://github.com/tensorflow/tensorflow/blob/419e3a6b650ea4bd1b0cba23c4348f8a69f3272e/tensorflow/python/ops/math_ops.py#L866-L901
BitMEX/api-connectors
37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812
auto-generated/python/swagger_client/models/instrument.py
python
Instrument.opening_timestamp
(self)
return self._opening_timestamp
Gets the opening_timestamp of this Instrument. # noqa: E501 :return: The opening_timestamp of this Instrument. # noqa: E501 :rtype: datetime
Gets the opening_timestamp of this Instrument. # noqa: E501
[ "Gets", "the", "opening_timestamp", "of", "this", "Instrument", ".", "#", "noqa", ":", "E501" ]
def opening_timestamp(self): """Gets the opening_timestamp of this Instrument. # noqa: E501 :return: The opening_timestamp of this Instrument. # noqa: E501 :rtype: datetime """ return self._opening_timestamp
[ "def", "opening_timestamp", "(", "self", ")", ":", "return", "self", ".", "_opening_timestamp" ]
https://github.com/BitMEX/api-connectors/blob/37a3a5b806ad5d0e0fc975ab86d9ed43c3bcd812/auto-generated/python/swagger_client/models/instrument.py#L1759-L1766
miyosuda/TensorFlowAndroidMNIST
7b5a4603d2780a8a2834575706e9001977524007
jni-build/jni/include/tensorflow/python/summary/event_file_inspector.py
python
inspect
(logdir='', event_file='', tag='')
Main function for inspector that prints out a digest of event files. Args: logdir: A log directory that contains event files. event_file: Or, a particular event file path. tag: An optional tag name to query for. Raises: ValueError: If neither logdir and event_file are given, or both are given.
Main function for inspector that prints out a digest of event files.
[ "Main", "function", "for", "inspector", "that", "prints", "out", "a", "digest", "of", "event", "files", "." ]
def inspect(logdir='', event_file='', tag=''): """Main function for inspector that prints out a digest of event files. Args: logdir: A log directory that contains event files. event_file: Or, a particular event file path. tag: An optional tag name to query for. Raises: ValueError: If neither log...
[ "def", "inspect", "(", "logdir", "=", "''", ",", "event_file", "=", "''", ",", "tag", "=", "''", ")", ":", "if", "logdir", "and", "event_file", ":", "raise", "ValueError", "(", "'Must specify either --logdir or --event_file, but not both.'", ")", "if", "not", ...
https://github.com/miyosuda/TensorFlowAndroidMNIST/blob/7b5a4603d2780a8a2834575706e9001977524007/jni-build/jni/include/tensorflow/python/summary/event_file_inspector.py#L389-L423
deepmind/streetlearn
ccf1d60b9c45154894d45a897748aee85d7eb69b
streetlearn/python/environment/instructions_base.py
python
InstructionsBase._update_shortest_path
(self, streetlearn, start_pano_id)
Update the target of the shortest paths and color panos along that path. Args: streetlearn: the streetlearn environment. start_pano_id: a string for the current pano ID, for computing the optimal path.
Update the target of the shortest paths and color panos along that path.
[ "Update", "the", "target", "of", "the", "shortest", "paths", "and", "color", "panos", "along", "that", "path", "." ]
def _update_shortest_path(self, streetlearn, start_pano_id): """Update the target of the shortest paths and color panos along that path. Args: streetlearn: the streetlearn environment. start_pano_id: a string for the current pano ID, for computing the optimal path. """ step = self...
[ "def", "_update_shortest_path", "(", "self", ",", "streetlearn", ",", "start_pano_id", ")", ":", "step", "=", "self", ".", "_current_step", "+", "1", "logging", ".", "info", "(", "self", ".", "_pano_by_step", ")", "logging", ".", "info", "(", "'Reached step ...
https://github.com/deepmind/streetlearn/blob/ccf1d60b9c45154894d45a897748aee85d7eb69b/streetlearn/python/environment/instructions_base.py#L237-L253
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/curses/wrapper.py
python
wrapper
(func, *args, **kwds)
Wrapper function that initializes curses and calls another function, restoring normal keyboard/screen behavior on error. The callable object 'func' is then passed the main window 'stdscr' as its first argument, followed by any other arguments passed to wrapper().
Wrapper function that initializes curses and calls another function, restoring normal keyboard/screen behavior on error. The callable object 'func' is then passed the main window 'stdscr' as its first argument, followed by any other arguments passed to wrapper().
[ "Wrapper", "function", "that", "initializes", "curses", "and", "calls", "another", "function", "restoring", "normal", "keyboard", "/", "screen", "behavior", "on", "error", ".", "The", "callable", "object", "func", "is", "then", "passed", "the", "main", "window",...
def wrapper(func, *args, **kwds): """Wrapper function that initializes curses and calls another function, restoring normal keyboard/screen behavior on error. The callable object 'func' is then passed the main window 'stdscr' as its first argument, followed by any other arguments passed to wrapper()....
[ "def", "wrapper", "(", "func", ",", "*", "args", ",", "*", "*", "kwds", ")", ":", "try", ":", "# Initialize curses", "stdscr", "=", "curses", ".", "initscr", "(", ")", "# Turn off echoing of keys, and enter cbreak mode,", "# where no buffering is performed on keyboard...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/curses/wrapper.py#L12-L50
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py
python
RawTurtle._write
(self, txt, align, font)
return end
Performs the writing for write()
Performs the writing for write()
[ "Performs", "the", "writing", "for", "write", "()" ]
def _write(self, txt, align, font): """Performs the writing for write() """ item, end = self.screen._write(self._position, txt, align, font, self._pencolor) self.items.append(item) if self.undobuffer: self.undo...
[ "def", "_write", "(", "self", ",", "txt", ",", "align", ",", "font", ")", ":", "item", ",", "end", "=", "self", ".", "screen", ".", "_write", "(", "self", ".", "_position", ",", "txt", ",", "align", ",", "font", ",", "self", ".", "_pencolor", ")"...
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/x86/toolchain/lib/python2.7/lib-tk/turtle.py#L3266-L3274
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
createEntityParserCtxt
(URL, ID, base)
return parserCtxt(_obj=ret)
Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.
Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.
[ "Create", "a", "parser", "context", "for", "an", "external", "entity", "Automatic", "support", "for", "ZLIB", "/", "Compress", "compressed", "document", "is", "provided", "by", "default", "if", "found", "at", "compile", "-", "time", "." ]
def createEntityParserCtxt(URL, ID, base): """Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. """ ret = libxml2mod.xmlCreateEntityParserCtxt(URL, ID, base) if ret is None:raise parserError('x...
[ "def", "createEntityParserCtxt", "(", "URL", ",", "ID", ",", "base", ")", ":", "ret", "=", "libxml2mod", ".", "xmlCreateEntityParserCtxt", "(", "URL", ",", "ID", ",", "base", ")", "if", "ret", "is", "None", ":", "raise", "parserError", "(", "'xmlCreateEnti...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L1465-L1471
intel/caffe
3f494b442ee3f9d17a07b09ecbd5fa2bbda00836
examples/rfcn/tools/rpn_generate.py
python
parse_args
()
return args
Parse input arguments
Parse input arguments
[ "Parse", "input", "arguments" ]
def parse_args(): """ Parse input arguments """ parser = argparse.ArgumentParser(description='Test a Fast R-CNN network') parser.add_argument('--gpu', dest='gpu_id', help='GPU id to use', default=0, type=int) parser.add_argument('--def', dest='prototxt', ...
[ "def", "parse_args", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Test a Fast R-CNN network'", ")", "parser", ".", "add_argument", "(", "'--gpu'", ",", "dest", "=", "'gpu_id'", ",", "help", "=", "'GPU id to use'", ...
https://github.com/intel/caffe/blob/3f494b442ee3f9d17a07b09ecbd5fa2bbda00836/examples/rfcn/tools/rpn_generate.py#L23-L53
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/ultimatelistctrl.py
python
UltimateListCtrl.DeleteColumn
(self, col)
return True
Deletes the specified column. :param `col`: the index of the column to delete.
Deletes the specified column.
[ "Deletes", "the", "specified", "column", "." ]
def DeleteColumn(self, col): """ Deletes the specified column. :param `col`: the index of the column to delete. """ self._mainWin.DeleteColumn(col) return True
[ "def", "DeleteColumn", "(", "self", ",", "col", ")", ":", "self", ".", "_mainWin", ".", "DeleteColumn", "(", "col", ")", "return", "True" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/ultimatelistctrl.py#L11974-L11982
domino-team/openwrt-cc
8b181297c34d14d3ca521cc9f31430d561dbc688
package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/utils.py
python
LRUCache.items
(self)
return result
Return a list of items.
Return a list of items.
[ "Return", "a", "list", "of", "items", "." ]
def items(self): """Return a list of items.""" result = [(key, self._mapping[key]) for key in list(self._queue)] result.reverse() return result
[ "def", "items", "(", "self", ")", ":", "result", "=", "[", "(", "key", ",", "self", ".", "_mapping", "[", "key", "]", ")", "for", "key", "in", "list", "(", "self", ".", "_queue", ")", "]", "result", ".", "reverse", "(", ")", "return", "result" ]
https://github.com/domino-team/openwrt-cc/blob/8b181297c34d14d3ca521cc9f31430d561dbc688/package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/jinja2/jinja2/utils.py#L443-L447
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2class.py
python
ValidCtxt.validateRoot
(self, doc)
return ret
Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element
Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element
[ "Try", "to", "validate", "a", "the", "root", "element", "basically", "it", "does", "the", "following", "check", "as", "described", "by", "the", "XML", "-", "1", ".", "0", "recommendation", ":", "-", "[", "VC", ":", "Root", "Element", "Type", "]", "it",...
def validateRoot(self, doc): """Try to validate a the root element basically it does the following check as described by the XML-1.0 recommendation: - [ VC: Root Element Type ] it doesn't try to recurse or apply other check to the element """ if doc is None: doc__o = None ...
[ "def", "validateRoot", "(", "self", ",", "doc", ")", ":", "if", "doc", "is", "None", ":", "doc__o", "=", "None", "else", ":", "doc__o", "=", "doc", ".", "_o", "ret", "=", "libxml2mod", ".", "xmlValidateRoot", "(", "self", ".", "_o", ",", "doc__o", ...
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2class.py#L6455-L6463
NVIDIA/DALI
bf16cc86ba8f091b145f91962f21fe1b6aff243d
docs/examples/use_cases/tensorflow/efficientdet/pipeline/tf/preprocessor.py
python
_compute_new_dynamic_size
(image, min_dimension, max_dimension)
return tf.stack(tf.unstack(new_size) + [num_channels])
Compute new dynamic shape for resize_to_range method.
Compute new dynamic shape for resize_to_range method.
[ "Compute", "new", "dynamic", "shape", "for", "resize_to_range", "method", "." ]
def _compute_new_dynamic_size(image, min_dimension, max_dimension): """Compute new dynamic shape for resize_to_range method.""" image_shape = tf.shape(image) orig_height = tf.to_float(image_shape[0]) orig_width = tf.to_float(image_shape[1]) num_channels = image_shape[2] orig_min_dim = tf.minimum...
[ "def", "_compute_new_dynamic_size", "(", "image", ",", "min_dimension", ",", "max_dimension", ")", ":", "image_shape", "=", "tf", ".", "shape", "(", "image", ")", "orig_height", "=", "tf", ".", "to_float", "(", "image_shape", "[", "0", "]", ")", "orig_width"...
https://github.com/NVIDIA/DALI/blob/bf16cc86ba8f091b145f91962f21fe1b6aff243d/docs/examples/use_cases/tensorflow/efficientdet/pipeline/tf/preprocessor.py#L241-L278
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py
python
PathFinder._path_importer_cache
(cls, path)
return finder
Get the finder for the path entry from sys.path_importer_cache. If the path entry is not in the cache, find the appropriate finder and cache it. If no finder is available, store None.
Get the finder for the path entry from sys.path_importer_cache.
[ "Get", "the", "finder", "for", "the", "path", "entry", "from", "sys", ".", "path_importer_cache", "." ]
def _path_importer_cache(cls, path): """Get the finder for the path entry from sys.path_importer_cache. If the path entry is not in the cache, find the appropriate finder and cache it. If no finder is available, store None. """ if path == '': try: pa...
[ "def", "_path_importer_cache", "(", "cls", ",", "path", ")", ":", "if", "path", "==", "''", ":", "try", ":", "path", "=", "_os", ".", "getcwd", "(", ")", "except", "FileNotFoundError", ":", "# Don't cache the failure as the cwd can easily change to", "# a valid di...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/tools/python3/src/Lib/importlib/_bootstrap_external.py#L1338-L1357
Xilinx/Vitis-AI
fc74d404563d9951b57245443c73bef389f3657f
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/ops/sparse_ops.py
python
_multiplier_helper
(shape)
return multipliers
Returns moving offset for each dimension given shape.
Returns moving offset for each dimension given shape.
[ "Returns", "moving", "offset", "for", "each", "dimension", "given", "shape", "." ]
def _multiplier_helper(shape): """Returns moving offset for each dimension given shape.""" multipliers = [] for dim in reversed(shape): if multipliers: multipliers.append(dim * multipliers[-1]) else: multipliers.append(dim) multipliers.reverse() return multipliers
[ "def", "_multiplier_helper", "(", "shape", ")", ":", "multipliers", "=", "[", "]", "for", "dim", "in", "reversed", "(", "shape", ")", ":", "if", "multipliers", ":", "multipliers", ".", "append", "(", "dim", "*", "multipliers", "[", "-", "1", "]", ")", ...
https://github.com/Xilinx/Vitis-AI/blob/fc74d404563d9951b57245443c73bef389f3657f/tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/layers/python/ops/sparse_ops.py#L29-L38
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/curses/textpad.py
python
Textbox.edit
(self, validate=None)
return self.gather()
Edit in the widget window and collect the results.
Edit in the widget window and collect the results.
[ "Edit", "in", "the", "widget", "window", "and", "collect", "the", "results", "." ]
def edit(self, validate=None): "Edit in the widget window and collect the results." while 1: ch = self.win.getch() if validate: ch = validate(ch) if not ch: continue if not self.do_command(ch): break ...
[ "def", "edit", "(", "self", ",", "validate", "=", "None", ")", ":", "while", "1", ":", "ch", "=", "self", ".", "win", ".", "getch", "(", ")", "if", "validate", ":", "ch", "=", "validate", "(", "ch", ")", "if", "not", "ch", ":", "continue", "if"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/linux_x64/lib/python3.7/curses/textpad.py#L177-L188
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py
python
get_pkg_info
(pkgname, dirs=None)
return read_config(pkgname, dirs)
Return library info for the given package. Parameters ---------- pkgname : str Name of the package (should match the name of the .ini file, without the extension, e.g. foo for the file foo.ini). dirs : sequence, optional If given, should be a sequence of additional directories w...
Return library info for the given package.
[ "Return", "library", "info", "for", "the", "given", "package", "." ]
def get_pkg_info(pkgname, dirs=None): """ Return library info for the given package. Parameters ---------- pkgname : str Name of the package (should match the name of the .ini file, without the extension, e.g. foo for the file foo.ini). dirs : sequence, optional If given...
[ "def", "get_pkg_info", "(", "pkgname", ",", "dirs", "=", "None", ")", ":", "from", "numpy", ".", "distutils", ".", "npy_pkg_config", "import", "read_config", "if", "dirs", ":", "dirs", ".", "append", "(", "get_npy_pkg_dir", "(", ")", ")", "else", ":", "d...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Gems/CloudGemMetric/v1/AWS/common-code/Lib/numpy/distutils/misc_util.py#L2149-L2185
sdhash/sdhash
b9eff63e4e5867e910f41fd69032bbb1c94a2a5e
sdhash-ui/cherrypy/_cpdispatch.py
python
test_callable_spec
(callable, callable_args, callable_kwargs)
Inspect callable and test to see if the given args are suitable for it. When an error occurs during the handler's invoking stage there are 2 erroneous cases: 1. Too many parameters passed to a function which doesn't define one of *args or **kwargs. 2. Too little parameters are passed to the f...
Inspect callable and test to see if the given args are suitable for it.
[ "Inspect", "callable", "and", "test", "to", "see", "if", "the", "given", "args", "are", "suitable", "for", "it", "." ]
def test_callable_spec(callable, callable_args, callable_kwargs): """ Inspect callable and test to see if the given args are suitable for it. When an error occurs during the handler's invoking stage there are 2 erroneous cases: 1. Too many parameters passed to a function which doesn't define ...
[ "def", "test_callable_spec", "(", "callable", ",", "callable_args", ",", "callable_kwargs", ")", ":", "show_mismatched_params", "=", "getattr", "(", "cherrypy", ".", "serving", ".", "request", ",", "'show_mismatched_params'", ",", "False", ")", "try", ":", "(", ...
https://github.com/sdhash/sdhash/blob/b9eff63e4e5867e910f41fd69032bbb1c94a2a5e/sdhash-ui/cherrypy/_cpdispatch.py#L46-L172
psnonis/FinBERT
c0c555d833a14e2316a3701e59c0b5156f804b4e
bert/run_classifier.py
python
_truncate_seq_pair
(tokens_a, tokens_b, max_length)
Truncates a sequence pair in place to the maximum length.
Truncates a sequence pair in place to the maximum length.
[ "Truncates", "a", "sequence", "pair", "in", "place", "to", "the", "maximum", "length", "." ]
def _truncate_seq_pair(tokens_a, tokens_b, max_length): """Truncates a sequence pair in place to the maximum length.""" # This is a simple heuristic which will always truncate the longer sequence # one token at a time. This makes more sense than truncating an equal percent # of tokens from each, since if one s...
[ "def", "_truncate_seq_pair", "(", "tokens_a", ",", "tokens_b", ",", "max_length", ")", ":", "# This is a simple heuristic which will always truncate the longer sequence", "# one token at a time. This makes more sense than truncating an equal percent", "# of tokens from each, since if one seq...
https://github.com/psnonis/FinBERT/blob/c0c555d833a14e2316a3701e59c0b5156f804b4e/bert/run_classifier.py#L557-L571
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pandas/py2/pandas/core/internals/blocks.py
python
CategoricalBlock._try_coerce_result
(self, result)
return result
reverse of try_coerce_args
reverse of try_coerce_args
[ "reverse", "of", "try_coerce_args" ]
def _try_coerce_result(self, result): """ reverse of try_coerce_args """ # GH12564: CategoricalBlock is 1-dim only # while returned results could be any dim if ((not is_categorical_dtype(result)) and isinstance(result, np.ndarray)): result = _block_shape(resu...
[ "def", "_try_coerce_result", "(", "self", ",", "result", ")", ":", "# GH12564: CategoricalBlock is 1-dim only", "# while returned results could be any dim", "if", "(", "(", "not", "is_categorical_dtype", "(", "result", ")", ")", "and", "isinstance", "(", "result", ",", ...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pandas/py2/pandas/core/internals/blocks.py#L2952-L2961
mindspore-ai/mindspore
fb8fd3338605bb34fa5cea054e535a8b1d753fab
mindspore/python/mindspore/ops/operations/nn_ops.py
python
LSTM.__init__
(self, input_size, hidden_size, num_layers, has_bias, bidirectional, dropout)
Initialize LSTM.
Initialize LSTM.
[ "Initialize", "LSTM", "." ]
def __init__(self, input_size, hidden_size, num_layers, has_bias, bidirectional, dropout): """Initialize LSTM.""" self.input_size = validator.check_positive_int(input_size, "input_size", self.name) self.hidden_size = validator.check_positive_int(hidden_size, "hidden_size", self.name) sel...
[ "def", "__init__", "(", "self", ",", "input_size", ",", "hidden_size", ",", "num_layers", ",", "has_bias", ",", "bidirectional", ",", "dropout", ")", ":", "self", ".", "input_size", "=", "validator", ".", "check_positive_int", "(", "input_size", ",", "\"input_...
https://github.com/mindspore-ai/mindspore/blob/fb8fd3338605bb34fa5cea054e535a8b1d753fab/mindspore/python/mindspore/ops/operations/nn_ops.py#L3707-L3720
yrnkrn/zapcc
c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50
tools/clang/bindings/python/clang/cindex.py
python
Cursor.tls_kind
(self)
return TLSKind.from_id(self._tls_kind)
Return the thread-local storage (TLS) kind of this cursor.
Return the thread-local storage (TLS) kind of this cursor.
[ "Return", "the", "thread", "-", "local", "storage", "(", "TLS", ")", "kind", "of", "this", "cursor", "." ]
def tls_kind(self): """Return the thread-local storage (TLS) kind of this cursor.""" if not hasattr(self, '_tls_kind'): self._tls_kind = conf.lib.clang_getCursorTLSKind(self) return TLSKind.from_id(self._tls_kind)
[ "def", "tls_kind", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_tls_kind'", ")", ":", "self", ".", "_tls_kind", "=", "conf", ".", "lib", ".", "clang_getCursorTLSKind", "(", "self", ")", "return", "TLSKind", ".", "from_id", "(", "...
https://github.com/yrnkrn/zapcc/blob/c6a8aa30006d997eff0d60fd37b0e62b8aa0ea50/tools/clang/bindings/python/clang/cindex.py#L1569-L1574
generalized-intelligence/GAAS
29ab17d3e8a4ba18edef3a57c36d8db6329fac73
deprecated/algorithms/sfm/dataset.py
python
DataSet._exif_overrides_file
(self)
return os.path.join(self.data_path, 'exif_overrides.json')
Path to the EXIF overrides file.
Path to the EXIF overrides file.
[ "Path", "to", "the", "EXIF", "overrides", "file", "." ]
def _exif_overrides_file(self): """Path to the EXIF overrides file.""" return os.path.join(self.data_path, 'exif_overrides.json')
[ "def", "_exif_overrides_file", "(", "self", ")", ":", "return", "os", ".", "path", ".", "join", "(", "self", ".", "data_path", ",", "'exif_overrides.json'", ")" ]
https://github.com/generalized-intelligence/GAAS/blob/29ab17d3e8a4ba18edef3a57c36d8db6329fac73/deprecated/algorithms/sfm/dataset.py#L670-L672
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
wx/lib/agw/fourwaysplitter.py
python
FourWaySplitter.OnSize
(self, event)
Handles the ``wx.EVT_SIZE`` event for :class:`FourWaySplitter`. :param `event`: a :class:`SizeEvent` event to be processed.
Handles the ``wx.EVT_SIZE`` event for :class:`FourWaySplitter`.
[ "Handles", "the", "wx", ".", "EVT_SIZE", "event", "for", ":", "class", ":", "FourWaySplitter", "." ]
def OnSize(self, event): """ Handles the ``wx.EVT_SIZE`` event for :class:`FourWaySplitter`. :param `event`: a :class:`SizeEvent` event to be processed. """ parent = wx.GetTopLevelParent(self) if parent.IsIconized(): event.Skip() return ...
[ "def", "OnSize", "(", "self", ",", "event", ")", ":", "parent", "=", "wx", ".", "GetTopLevelParent", "(", "self", ")", "if", "parent", ".", "IsIconized", "(", ")", ":", "event", ".", "Skip", "(", ")", "return", "self", ".", "_SizeWindows", "(", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/wx/lib/agw/fourwaysplitter.py#L859-L871
hanpfei/chromium-net
392cc1fa3a8f92f42e4071ab6e674d8e0482f83f
third_party/catapult/third_party/WebOb/webob/response.py
python
Response.encode_content
(self, encoding='gzip', lazy=False)
Encode the content with the given encoding (only gzip and identity are supported).
Encode the content with the given encoding (only gzip and identity are supported).
[ "Encode", "the", "content", "with", "the", "given", "encoding", "(", "only", "gzip", "and", "identity", "are", "supported", ")", "." ]
def encode_content(self, encoding='gzip', lazy=False): """ Encode the content with the given encoding (only gzip and identity are supported). """ assert encoding in ('identity', 'gzip'), \ "Unknown encoding: %r" % encoding if encoding == 'identity': ...
[ "def", "encode_content", "(", "self", ",", "encoding", "=", "'gzip'", ",", "lazy", "=", "False", ")", ":", "assert", "encoding", "in", "(", "'identity'", ",", "'gzip'", ")", ",", "\"Unknown encoding: %r\"", "%", "encoding", "if", "encoding", "==", "'identity...
https://github.com/hanpfei/chromium-net/blob/392cc1fa3a8f92f42e4071ab6e674d8e0482f83f/third_party/catapult/third_party/WebOb/webob/response.py#L950-L968
msracver/Deep-Image-Analogy
632b9287b42552e32dad64922967c8c9ec7fc4d3
scripts/cpp_lint.py
python
FindPreviousMatchingAngleBracket
(clean_lines, linenum, init_prefix)
return False
Find the corresponding < that started a template. Args: clean_lines: A CleansedLines instance containing the file. linenum: Current line number. init_prefix: Part of the current line before the initial >. Returns: True if a matching bracket exists.
Find the corresponding < that started a template.
[ "Find", "the", "corresponding", "<", "that", "started", "a", "template", "." ]
def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix): """Find the corresponding < that started a template. Args: clean_lines: A CleansedLines instance containing the file. linenum: Current line number. init_prefix: Part of the current line before the initial >. Returns: True i...
[ "def", "FindPreviousMatchingAngleBracket", "(", "clean_lines", ",", "linenum", ",", "init_prefix", ")", ":", "line", "=", "init_prefix", "nesting_stack", "=", "[", "'>'", "]", "while", "True", ":", "# Find the previous operator", "match", "=", "Search", "(", "r'^(...
https://github.com/msracver/Deep-Image-Analogy/blob/632b9287b42552e32dad64922967c8c9ec7fc4d3/scripts/cpp_lint.py#L2586-L2640
microsoft/ivy
9f3c7ecc0b2383129fdd0953e10890d98d09a82d
ivy/ivy_logic_utils.py
python
or_clauses2
(clauses1,clauses2)
return clauses1 + clauses2
Take the logical or of two clause sets.
Take the logical or of two clause sets.
[ "Take", "the", "logical", "or", "of", "two", "clause", "sets", "." ]
def or_clauses2(clauses1,clauses2): """ Take the logical or of two clause sets. """ if not clauses1 or not clauses2: return [] if [] in clauses1: return clauses2 if [] in clauses2: return clauses1 used = used_symbols_clauses(clauses1 + clauses2); v = bool_const(UniqueRenamer('__ts',used)()) ...
[ "def", "or_clauses2", "(", "clauses1", ",", "clauses2", ")", ":", "if", "not", "clauses1", "or", "not", "clauses2", ":", "return", "[", "]", "if", "[", "]", "in", "clauses1", ":", "return", "clauses2", "if", "[", "]", "in", "clauses2", ":", "return", ...
https://github.com/microsoft/ivy/blob/9f3c7ecc0b2383129fdd0953e10890d98d09a82d/ivy/ivy_logic_utils.py#L1115-L1127
cvmfs/cvmfs
4637bdb5153178eadf885c1acf37bdc5c685bf8a
cpplint.py
python
CheckCStyleCast
(filename, clean_lines, linenum, cast_type, pattern, error)
return True
Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. cast_type: The string for the C++ cast to recommend. This is either reinterpret_cast, static_...
Checks for a C-style cast by looking for the pattern.
[ "Checks", "for", "a", "C", "-", "style", "cast", "by", "looking", "for", "the", "pattern", "." ]
def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error): """Checks for a C-style cast by looking for the pattern. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. cast_type: The ...
[ "def", "CheckCStyleCast", "(", "filename", ",", "clean_lines", ",", "linenum", ",", "cast_type", ",", "pattern", ",", "error", ")", ":", "line", "=", "clean_lines", ".", "elided", "[", "linenum", "]", "match", "=", "Search", "(", "pattern", ",", "line", ...
https://github.com/cvmfs/cvmfs/blob/4637bdb5153178eadf885c1acf37bdc5c685bf8a/cpplint.py#L5344-L5445
microsoft/CNTK
e9396480025b9ca457d26b6f33dd07c474c6aa04
Examples/Image/Detection/FastRCNN/BrainScript/fastRCNN/imdb.py
python
imdb.competition_mode
(self, on)
Turn competition mode on or off.
Turn competition mode on or off.
[ "Turn", "competition", "mode", "on", "or", "off", "." ]
def competition_mode(self, on): """Turn competition mode on or off.""" pass
[ "def", "competition_mode", "(", "self", ",", "on", ")", ":", "pass" ]
https://github.com/microsoft/CNTK/blob/e9396480025b9ca457d26b6f33dd07c474c6aa04/Examples/Image/Detection/FastRCNN/BrainScript/fastRCNN/imdb.py#L199-L201
citizenfx/fivem
88276d40cc7baf8285d02754cc5ae42ec7a8563f
vendor/chromium/mojo/public/tools/bindings/pylib/mojom/generate/translate.py
python
_Parameter
(module, parsed_param, interface)
return parameter
Args: module: {mojom.Module} Module currently being constructed. parsed_param: {ast.Parameter} Parsed parameter. union: {mojom.Interface} Interface this parameter belongs to. Returns: {mojom.Parameter} AST parameter.
Args: module: {mojom.Module} Module currently being constructed. parsed_param: {ast.Parameter} Parsed parameter. union: {mojom.Interface} Interface this parameter belongs to.
[ "Args", ":", "module", ":", "{", "mojom", ".", "Module", "}", "Module", "currently", "being", "constructed", ".", "parsed_param", ":", "{", "ast", ".", "Parameter", "}", "Parsed", "parameter", ".", "union", ":", "{", "mojom", ".", "Interface", "}", "Inte...
def _Parameter(module, parsed_param, interface): """ Args: module: {mojom.Module} Module currently being constructed. parsed_param: {ast.Parameter} Parsed parameter. union: {mojom.Interface} Interface this parameter belongs to. Returns: {mojom.Parameter} AST parameter. """ parameter = mojom.P...
[ "def", "_Parameter", "(", "module", ",", "parsed_param", ",", "interface", ")", ":", "parameter", "=", "mojom", ".", "Parameter", "(", ")", "parameter", ".", "mojom_name", "=", "parsed_param", ".", "mojom_name", "parameter", ".", "kind", "=", "_Kind", "(", ...
https://github.com/citizenfx/fivem/blob/88276d40cc7baf8285d02754cc5ae42ec7a8563f/vendor/chromium/mojo/public/tools/bindings/pylib/mojom/generate/translate.py#L365-L384
hszhao/PSPNet
cf7e5a99ba37e46118026e96be5821a9bc63bde0
scripts/cpp_lint.py
python
_ClassifyInclude
(fileinfo, include, is_system)
return _OTHER_HEADER
Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _XXX_HEADER constants. For example: >>> _ClassifyIn...
Figures out what kind of header 'include' is.
[ "Figures", "out", "what", "kind", "of", "header", "include", "is", "." ]
def _ClassifyInclude(fileinfo, include, is_system): """Figures out what kind of header 'include' is. Args: fileinfo: The current file cpplint is running over. A FileInfo instance. include: The path to a #included file. is_system: True if the #include used <> rather than "". Returns: One of the _...
[ "def", "_ClassifyInclude", "(", "fileinfo", ",", "include", ",", "is_system", ")", ":", "# This is a list of all standard c++ header files, except", "# those already checked for above.", "is_cpp_h", "=", "include", "in", "_CPP_HEADERS", "if", "is_system", ":", "if", "is_cpp...
https://github.com/hszhao/PSPNet/blob/cf7e5a99ba37e46118026e96be5821a9bc63bde0/scripts/cpp_lint.py#L3620-L3676
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py
python
BaseContainer.__ne__
(self, other)
return not self == other
Checks if another instance isn't equal to this one.
Checks if another instance isn't equal to this one.
[ "Checks", "if", "another", "instance", "isn", "t", "equal", "to", "this", "one", "." ]
def __ne__(self, other): """Checks if another instance isn't equal to this one.""" # The concrete classes should define __eq__. return not self == other
[ "def", "__ne__", "(", "self", ",", "other", ")", ":", "# The concrete classes should define __eq__.", "return", "not", "self", "==", "other" ]
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/internal/containers.py#L70-L73
kamyu104/LeetCode-Solutions
77605708a927ea3b85aee5a479db733938c7c211
Python/range-sum-query-immutable.py
python
NumArray.__init__
(self, nums)
initialize your data structure here. :type nums: List[int]
initialize your data structure here. :type nums: List[int]
[ "initialize", "your", "data", "structure", "here", ".", ":", "type", "nums", ":", "List", "[", "int", "]" ]
def __init__(self, nums): """ initialize your data structure here. :type nums: List[int] """ self.accu = [0] for num in nums: self.accu.append(self.accu[-1] + num),
[ "def", "__init__", "(", "self", ",", "nums", ")", ":", "self", ".", "accu", "=", "[", "0", "]", "for", "num", "in", "nums", ":", "self", ".", "accu", ".", "append", "(", "self", ".", "accu", "[", "-", "1", "]", "+", "num", ")", "," ]
https://github.com/kamyu104/LeetCode-Solutions/blob/77605708a927ea3b85aee5a479db733938c7c211/Python/range-sum-query-immutable.py#L6-L13
priyankchheda/algorithms
c361aa9071573fa9966d5b02d05e524815abcf2b
priority_queue/minheap.py
python
MinHeap.get_min
(self)
return self.data[1]
get_min returns the minimum value (i.e. root) in the heap, without removing it. Returns None, if the heap is empty.
get_min returns the minimum value (i.e. root) in the heap, without removing it. Returns None, if the heap is empty.
[ "get_min", "returns", "the", "minimum", "value", "(", "i", ".", "e", ".", "root", ")", "in", "the", "heap", "without", "removing", "it", ".", "Returns", "None", "if", "the", "heap", "is", "empty", "." ]
def get_min(self): """ get_min returns the minimum value (i.e. root) in the heap, without removing it. Returns None, if the heap is empty. """ if self.is_empty(): return None return self.data[1]
[ "def", "get_min", "(", "self", ")", ":", "if", "self", ".", "is_empty", "(", ")", ":", "return", "None", "return", "self", ".", "data", "[", "1", "]" ]
https://github.com/priyankchheda/algorithms/blob/c361aa9071573fa9966d5b02d05e524815abcf2b/priority_queue/minheap.py#L28-L34
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/pexpect/pexpect/screen.py
python
screen.cursor_unsave
(self)
Restores cursor position after a Save Cursor.
Restores cursor position after a Save Cursor.
[ "Restores", "cursor", "position", "after", "a", "Save", "Cursor", "." ]
def cursor_unsave (self): # <ESC>[u '''Restores cursor position after a Save Cursor.''' self.cursor_restore_attrs()
[ "def", "cursor_unsave", "(", "self", ")", ":", "# <ESC>[u", "self", ".", "cursor_restore_attrs", "(", ")" ]
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/pexpect/pexpect/screen.py#L323-L326
CRYTEK/CRYENGINE
232227c59a220cbbd311576f0fbeba7bb53b2a8c
Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py
python
resolve_ssl_version
(candidate)
return candidate
like resolve_cert_reqs
like resolve_cert_reqs
[ "like", "resolve_cert_reqs" ]
def resolve_ssl_version(candidate): """ like resolve_cert_reqs """ if candidate is None: return PROTOCOL_SSLv23 if isinstance(candidate, str): res = getattr(ssl, candidate, None) if res is None: res = getattr(ssl, 'PROTOCOL_' + candidate) return res ...
[ "def", "resolve_ssl_version", "(", "candidate", ")", ":", "if", "candidate", "is", "None", ":", "return", "PROTOCOL_SSLv23", "if", "isinstance", "(", "candidate", ",", "str", ")", ":", "res", "=", "getattr", "(", "ssl", ",", "candidate", ",", "None", ")", ...
https://github.com/CRYTEK/CRYENGINE/blob/232227c59a220cbbd311576f0fbeba7bb53b2a8c/Editor/Python/windows/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py#L165-L178
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py
python
HTTPConnectionPool.close
(self)
Close all pooled connections and disable the pool.
Close all pooled connections and disable the pool.
[ "Close", "all", "pooled", "connections", "and", "disable", "the", "pool", "." ]
def close(self): """ Close all pooled connections and disable the pool. """ if self.pool is None: return # Disable access to the pool old_pool, self.pool = self.pool, None try: while True: conn = old_pool.get(block=False) ...
[ "def", "close", "(", "self", ")", ":", "if", "self", ".", "pool", "is", "None", ":", "return", "# Disable access to the pool", "old_pool", ",", "self", ".", "pool", "=", "self", ".", "pool", ",", "None", "try", ":", "while", "True", ":", "conn", "=", ...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/windows/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py#L479-L495
wxWidgets/wxPython-Classic
19571e1ae65f1ac445f5491474121998c97a1bf0
src/osx_cocoa/aui.py
python
AuiNotebook.ShowWindowMenu
(*args, **kwargs)
return _aui.AuiNotebook_ShowWindowMenu(*args, **kwargs)
ShowWindowMenu(self) -> bool
ShowWindowMenu(self) -> bool
[ "ShowWindowMenu", "(", "self", ")", "-", ">", "bool" ]
def ShowWindowMenu(*args, **kwargs): """ShowWindowMenu(self) -> bool""" return _aui.AuiNotebook_ShowWindowMenu(*args, **kwargs)
[ "def", "ShowWindowMenu", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "_aui", ".", "AuiNotebook_ShowWindowMenu", "(", "*", "args", ",", "*", "*", "kwargs", ")" ]
https://github.com/wxWidgets/wxPython-Classic/blob/19571e1ae65f1ac445f5491474121998c97a1bf0/src/osx_cocoa/aui.py#L1373-L1375
wlanjie/AndroidFFmpeg
7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf
tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py
python
Place.place_forget
(self)
Unmap this widget.
Unmap this widget.
[ "Unmap", "this", "widget", "." ]
def place_forget(self): """Unmap this widget.""" self.tk.call('place', 'forget', self._w)
[ "def", "place_forget", "(", "self", ")", ":", "self", ".", "tk", ".", "call", "(", "'place'", ",", "'forget'", ",", "self", ".", "_w", ")" ]
https://github.com/wlanjie/AndroidFFmpeg/blob/7baf9122f4b8e1c74e7baf4be5c422c7a5ba5aaf/tools/fdk-aac-build/armeabi/toolchain/lib/python2.7/lib-tk/Tkinter.py#L1921-L1923
benoitsteiner/tensorflow-opencl
cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5
tensorflow/python/debug/cli/analyzer_cli.py
python
DebugAnalyzer.get_tensor_filter
(self, filter_name)
return self._tensor_filters[filter_name]
Retrieve filter function by name. Args: filter_name: Name of the filter set during add_tensor_filter() call. Returns: The callable associated with the filter name. Raises: ValueError: If there is no tensor filter of the specified filter name.
Retrieve filter function by name.
[ "Retrieve", "filter", "function", "by", "name", "." ]
def get_tensor_filter(self, filter_name): """Retrieve filter function by name. Args: filter_name: Name of the filter set during add_tensor_filter() call. Returns: The callable associated with the filter name. Raises: ValueError: If there is no tensor filter of the specified filter n...
[ "def", "get_tensor_filter", "(", "self", ",", "filter_name", ")", ":", "if", "filter_name", "not", "in", "self", ".", "_tensor_filters", ":", "raise", "ValueError", "(", "\"There is no tensor filter named \\\"%s\\\"\"", "%", "filter_name", ")", "return", "self", "."...
https://github.com/benoitsteiner/tensorflow-opencl/blob/cb7cb40a57fde5cfd4731bc551e82a1e2fef43a5/tensorflow/python/debug/cli/analyzer_cli.py#L447-L463
catboost/catboost
167f64f237114a4d10b2b4ee42adb4569137debe
contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py
python
merge_processors
(processors: List[Processor])
return _MergedProcessor(processors)
Merge multiple `Processor` objects into one.
Merge multiple `Processor` objects into one.
[ "Merge", "multiple", "Processor", "objects", "into", "one", "." ]
def merge_processors(processors: List[Processor]) -> Processor: """ Merge multiple `Processor` objects into one. """ if len(processors) == 0: return DummyProcessor() if len(processors) == 1: return processors[0] # Nothing to merge. return _MergedProcessor(processors)
[ "def", "merge_processors", "(", "processors", ":", "List", "[", "Processor", "]", ")", "->", "Processor", ":", "if", "len", "(", "processors", ")", "==", "0", ":", "return", "DummyProcessor", "(", ")", "if", "len", "(", "processors", ")", "==", "1", ":...
https://github.com/catboost/catboost/blob/167f64f237114a4d10b2b4ee42adb4569137debe/contrib/python/prompt-toolkit/py3/prompt_toolkit/layout/processors.py#L965-L975
apple/turicreate
cce55aa5311300e3ce6af93cb45ba791fd1bdf49
deps/src/libxml2-2.9.1/python/libxml2.py
python
xpathContext.xpathRegisterAllFunctions
(self)
Registers all default XPath functions in this context
Registers all default XPath functions in this context
[ "Registers", "all", "default", "XPath", "functions", "in", "this", "context" ]
def xpathRegisterAllFunctions(self): """Registers all default XPath functions in this context """ libxml2mod.xmlXPathRegisterAllFunctions(self._o)
[ "def", "xpathRegisterAllFunctions", "(", "self", ")", ":", "libxml2mod", ".", "xmlXPathRegisterAllFunctions", "(", "self", ".", "_o", ")" ]
https://github.com/apple/turicreate/blob/cce55aa5311300e3ce6af93cb45ba791fd1bdf49/deps/src/libxml2-2.9.1/python/libxml2.py#L7366-L7368
aws/lumberyard
f85344403c1c2e77ec8c75deb2c116e97b713217
dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/base64.py
python
b64decode
(s, altchars=None, validate=False)
return binascii.a2b_base64(s)
Decode the Base64 encoded bytes-like object or ASCII string s. Optional altchars must be a bytes-like object or ASCII string of length 2 which specifies the alternative alphabet used instead of the '+' and '/' characters. The result is returned as a bytes object. A binascii.Error is raised if s i...
Decode the Base64 encoded bytes-like object or ASCII string s.
[ "Decode", "the", "Base64", "encoded", "bytes", "-", "like", "object", "or", "ASCII", "string", "s", "." ]
def b64decode(s, altchars=None, validate=False): """Decode the Base64 encoded bytes-like object or ASCII string s. Optional altchars must be a bytes-like object or ASCII string of length 2 which specifies the alternative alphabet used instead of the '+' and '/' characters. The result is returned a...
[ "def", "b64decode", "(", "s", ",", "altchars", "=", "None", ",", "validate", "=", "False", ")", ":", "s", "=", "_bytes_from_decode_data", "(", "s", ")", "if", "altchars", "is", "not", "None", ":", "altchars", "=", "_bytes_from_decode_data", "(", "altchars"...
https://github.com/aws/lumberyard/blob/f85344403c1c2e77ec8c75deb2c116e97b713217/dev/Tools/Python/3.7.10/mac/Python.framework/Versions/3.7/lib/python3.7/base64.py#L65-L87
ValveSoftware/source-sdk-2013
0d8dceea4310fde5706b3ce1c70609d72a38efdf
sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py
python
_AddSerializeToStringMethod
(message_descriptor, cls)
Helper for _AddMessageMethods().
Helper for _AddMessageMethods().
[ "Helper", "for", "_AddMessageMethods", "()", "." ]
def _AddSerializeToStringMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def SerializeToString(self): # Check if the message has all of its required fields set. errors = [] if not self.IsInitialized(): raise message_mod.EncodeError( 'Message is missing required f...
[ "def", "_AddSerializeToStringMethod", "(", "message_descriptor", ",", "cls", ")", ":", "def", "SerializeToString", "(", "self", ")", ":", "# Check if the message has all of its required fields set.", "errors", "=", "[", "]", "if", "not", "self", ".", "IsInitialized", ...
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/thirdparty/protobuf-2.3.0/python/google/protobuf/reflection.py#L787-L798
yuxng/PoseCNN
9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04
lib/gt_single_data_layer/layer.py
python
GtSingleDataLayer._shuffle_roidb_inds
(self)
Randomly permute the training roidb.
Randomly permute the training roidb.
[ "Randomly", "permute", "the", "training", "roidb", "." ]
def _shuffle_roidb_inds(self): """Randomly permute the training roidb.""" self._perm = np.random.permutation(np.arange(len(self._roidb))) #print self._roidb[self._perm[14]]['meta_data'] #print self._roidb[self._perm[15]]['meta_data'] #print self._roidb[self._perm[16]]['meta_data'...
[ "def", "_shuffle_roidb_inds", "(", "self", ")", ":", "self", ".", "_perm", "=", "np", ".", "random", ".", "permutation", "(", "np", ".", "arange", "(", "len", "(", "self", ".", "_roidb", ")", ")", ")", "#print self._roidb[self._perm[14]]['meta_data']", "#pri...
https://github.com/yuxng/PoseCNN/blob/9f3dd7b7bce21dcafc05e8f18ccc90da3caabd04/lib/gt_single_data_layer/layer.py#L27-L33
windystrife/UnrealEngine_NVIDIAGameWorks
b50e6338a7c5b26374d66306ebc7807541ff815e
Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/fractions.py
python
Fraction._richcmp
(self, other, op)
Helper for comparison operators, for internal use only. Implement comparison between a Rational instance `self`, and either another Rational instance or a float `other`. If `other` is not a Rational instance or a float, return NotImplemented. `op` should be one of the six standard ...
Helper for comparison operators, for internal use only.
[ "Helper", "for", "comparison", "operators", "for", "internal", "use", "only", "." ]
def _richcmp(self, other, op): """Helper for comparison operators, for internal use only. Implement comparison between a Rational instance `self`, and either another Rational instance or a float `other`. If `other` is not a Rational instance or a float, return NotImplemented. `...
[ "def", "_richcmp", "(", "self", ",", "other", ",", "op", ")", ":", "# convert other to a Rational instance where reasonable.", "if", "isinstance", "(", "other", ",", "Rational", ")", ":", "return", "op", "(", "self", ".", "_numerator", "*", "other", ".", "deno...
https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Extras/ThirdPartyNotUE/emsdk/Win64/python/2.7.5.3_64bit/Lib/fractions.py#L546-L570