content
stringlengths 7
1.05M
|
|---|
# 将一个给定字符串根据给定的行数,以从上往下、从左到右进行 Z 字形排列。
# 比如输入字符串为 "LEETCODEISHIRING" 行数为 3 时,排列如下:
# L C I R
# E T O E S I I G
# E D H N
# 之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:"LCIRETOESIIGEDHN"。
# 请你实现这个将字符串进行指定行数变换的函数:
# string convert(string s, int numRows);
# 示例 1:
# 输入: s = "LEETCODEISHIRING", numRows = 3
# 输出: "LCIRETOESIIGEDHN"
# 示例 2:
# 输入: s = "LEETCODEISHIRING", numRows = 4
# 输出: "LDREOEIIECIHNTSG"
# 解释:
# L D R
# E O E I I
# E C I H N
# T S G
# 来源:力扣(LeetCode)
# 链接:https://leetcode-cn.com/problems/zigzag-conversion
# 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
class Solution:
def convert(self, s: str, numRows: int) -> str:
ln = len(s)
temp = [[] for i in range(numRows)]
one = 2*numRows - 2
i = 0
for x in s:
if i < numRows:
temp[i].append(x)
elif i < one:
temp[one-i].append(x)
else:
i = 0
temp[i].append(x)
i += 1
rev = ""
for t in temp:
rev += "".join(t)
return rev
if __name__ == "__main__":
s = Solution()
print(s.convert("leetcodeishiring", 4))
|
def factorial(n):
if n < 2:
return 1
return n * factorial(n - 1)
def main():
n=6
print(factorial(n))
main()
|
numbers = [int(n) for n in input().split(' ')]
n = len(numbers)
for i in range(n):
for j in range(0, n - i - 1):
if numbers[j] > numbers[j + 1]:
numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j]
print(' '.join([str(n) for n in numbers]))
|
def write_keyfile(data , generator):
'''
将data写成 semeval 2018 task7 key file的格式
entity名:doc_id.entity_number
'''
relations = generator.relations
#gene_no_rel = generator.gene_no_rel
#no_rel = generator.no_rel
cont = ""
for x in data:
got_relations = [] # format: (u,v) for u < v
for r in x.ans:
u,v = r.u,r.v
reverse = False
if u > v:
u,v = v,u
reverse = True
got_relations.append((u,v))
u,v = x.id2ent_name(u) , x.id2ent_name(v)
cont += "%s(%s,%s%s)\n" % (relations[r.type] , u , v , ",REVERSE" if reverse else "")
#if gene_no_rel:
# for i in range(len(x.ents)):
# for j in range(i):
# if (j,i) not in got_relations:
# cont += "%s(%s,%s)\n" % (relations[no_rel] , x.ents[j].name , x.ents[i].name)
return cont
|
# coding: utf8
# try something like
def index():
'''main page that allows searching for and displaying audio listings'''
#create search form
formSearch = FORM(INPUT(_id='searchInput', requires=[IS_NOT_EMPTY(error_message='you have to enter something to search for'),
IS_LENGTH(50, error_message='you can\'t have such a long search term, limit is 50 characters')]),
INPUT(_type='submit', _id='searchButton'), _action='', _onsubmit='return search()', _method='get')
return dict(formSearch=formSearch)
|
class Result:
"""Class description."""
def __init__(self):
"""
Initialization of the class.
"""
pass
def __str__(self):
return
|
class Building(object):
"""Class representing all the data for a building
'attribute name': 'type'
swagger_types = {
'buildingId': 'str',
'nameList': 'list[str]',
'numWashers': 'int',
'numDryers': 'int',
}
'attribute name': 'Attribute name in Swagger Docs'
attribute_map = {
'buildingId': 'buildingId',
'nameList': 'nameList',
'numWashers': 'numWashers',
'numDryers': 'numDryers'
}
"""
def __init__(self, buildingId, nameList, numWashers, numDryers):
"""Class instatiation
Check if all the attributes are valid and assigns them if they are
Raises ValueError if attributes are invalid
"""
if buildingId is None:
raise ValueError("Invalid value for 'buildingId', must not be 'None'")
if nameList is None:
raise ValueError("Invalid value for 'nameList', must not be 'None'")
if numWashers is None:
raise ValueError("Invalid value for 'numWashers', must not be 'None'")
if type(numWashers) is not int:
raise ValueError("Invalid value for 'numWashers', must be an integer")
if numWashers < 0:
raise ValueError("Invalid value for 'numWashers', must not be negative")
if numDryers is None:
raise ValueError("Invalid value for 'numDryers', must not be'None'")
if type(numDryers) is not int:
raise ValueError("Invalid value for 'numDryers', must be an integer")
if numDryers < 0:
raise ValueError("Invalid value for 'numDryers', must not be negative")
self.buildingId = buildingId
self.nameList = nameList
self.numWashers = numWashers
self.numDryers = numDryers
|
# Register the HourglassTree report addon
register(REPORT,
id = 'hourglass_chart',
name = _("Hourglass Tree"),
description = _("Produces a graphical report combining an ancestor tree and a descendant tree."),
version = '1.0.0',
gramps_target_version = '5.1',
status = STABLE,
fname = 'hourglasstree.py',
authors = ["Peter Zingg"],
authors_email = ["peter.zingg@gmail.com"],
category = CATEGORY_DRAW,
require_active = True,
reportclass = 'HourglassTree',
optionclass = 'HourglassTreeOptions',
report_modes = [REPORT_MODE_GUI, REPORT_MODE_CLI],
)
if False:
register(REPORT,
id = 'family_hourglass_chart',
name = _("Family Hourglass Tree"),
description = _("Produces a graphical report combining an ancestor tree and a descendant tree."),
version = '1.0.0',
gramps_target_version = '5.1',
status = STABLE,
fname = 'hourglasstree.py',
authors = ["Peter Zingg"],
authors_email = ["peter.zingg@gmail.com"],
category = CATEGORY_DRAW,
require_active = True,
reportclass = 'HourglassTree',
optionclass = 'HourglassTreeOptions',
report_modes = [REPORT_MODE_GUI, REPORT_MODE_CLI],
)
|
class SolidSurfaceLoads:
def sfa(self, area="", lkey="", lab="", value="", value2="", **kwargs):
"""Specifies surface loads on the selected areas.
APDL Command: SFA
Parameters
----------
area
Area to which surface load applies. If ALL, apply load to all
selected areas [ASEL]. A component may be substituted for Area.
lkey
Load key associated with surface load (defaults to 1). Load keys
(1,2,3, etc.) are listed under "Surface Loads" in the input data
table for each element type in the Element Reference. LKEY is
ignored if the area is the face of a volume region meshed with
volume elements.
lab
Valid surface load label. Load labels are listed under "Surface
Loads" in the input table for each area type in the Element
Reference.
value
Surface load value or table name reference for specifying tabular
boundary conditions.
value2
Second surface load value (if any).
Notes
-----
Surface loads may be transferred from areas to elements with the SFTRAN
or SBCTRAN commands. See the SFGRAD command for an alternate tapered
load capability.
Tabular boundary conditions (VALUE = %tabname% and/or VALUE2 =
%tabname%) are available for the following surface load labels (Lab)
only: : PRES (real and/or imaginary components), CONV (film coefficient
and/or bulk temperature) or HFLUX, and RAD (surface emissivity and
ambient temperature). Use the *DIM command to define a table.
This command is also valid in PREP7.
Examples
--------
Select areas with coordinates in the range ``0.4 < Y < 1.0``
>>> mapdl.asel('S', 'LOC', 'Y', 0.4, 1.0)
Set pressure to 250e3 on all areas.
>>> mapdl.sfa('ALL', '', 'PRES', 250e3)
"""
command = f"SFA,{area},{lkey},{lab},{value},{value2}"
return self.run(command, **kwargs)
def sfadele(self, area="", lkey="", lab="", **kwargs):
"""Deletes surface loads from areas.
APDL Command: SFADELE
Parameters
----------
area
Area to which surface load deletion applies. If ALL, delete load
from all selected areas [ASEL]. A component name may be substituted for AREA.
lkey
Load key associated with surface load (defaults to 1). See the SFA
command for details.
lab
Valid surface load label. If ALL, use all appropriate labels. See
the SFA command for labels.
Notes
-----
Deletes surface loads (and all corresponding finite element loads) from
selected areas.
This command is also valid in PREP7.
Examples
--------
Delete all convections applied to all areas where ``-1 < X < -0.5``
>>> mapdl.asel('S', 'LOC', 'X', -1, -0.5)
>>> mapdl.sfadele('ALL', 'CONV')
"""
command = f"SFADELE,{area},{lkey},{lab}"
return self.run(command, **kwargs)
def sfalist(self, area="", lab="", **kwargs):
"""Lists the surface loads for the specified area.
APDL Command: SFALIST
Parameters
----------
area
Area at which surface load is to be listed. If ALL (or blank),
list for all selected areas [ASEL]. If AREA = P, graphical picking
is enabled and all remaining command fields are ignored (valid only
in the GUI). A component name may be substituted for AREA.
lab
Valid surface load label. If ALL (or blank), use all appropriate
labels. See the SFA command for labels.
Notes
-----
This command is valid in any processor.
"""
command = f"SFALIST,{area},{lab}"
return self.run(command, **kwargs)
def sfl(self, line="", lab="", vali="", valj="", val2i="", val2j="",
**kwargs):
"""Specifies surface loads on lines of an area.
APDL Command: SFL
Parameters
----------
line
Line to which surface load applies. If ALL, apply load to all
selected lines [LSEL]. If Line = P, graphical picking is enabled
and all remaining command fields are ignored (valid only in the
GUI). A component name may be substituted for Line.
lab
Valid surface load label. Load labels are listed under "Surface
Loads" in the input table for each element type in the Element
Reference.
vali, valj
Surface load values at the first keypoint (VALI) and at the second
keypoint (VALJ) of the line, or table name for specifying tabular
boundary conditions. If VALJ is blank, it defaults to VALI. If
VALJ is zero, a zero is used. If Lab = CONV, VALI and VALJ are the
film coefficients and VAL2I and VAL2J are the bulk temperatures.
To specify a table, enclose the table name in percent signs (%),
e.g., %tabname%. Use the *DIM command to define a table. If Lab =
CONV and VALI = -N, the film coefficient may be a function of
temperature and is determined from the HF property table for
material N [MP]. If Lab = RAD, VALI and VALJ values are surface
emissivities and VAL2I and VAL2J are ambient temperatures. The
temperature used to evaluate the film coefficient is usually the
average between the bulk and wall temperatures, but may be user
defined for some elements. If Lab = RDSF, VALI is the emissivity
value; the following condition apply: If VALI = -N, the emissivity
may be a function of the temperature and is determined from the
EMISS property table for material N [MP]. If Lab = FSIN in a Multi-
field solver (single or multiple code coupling) analysis, VALI is
the surface interface number. If Lab = FSIN in a unidirectional
ANSYS to CFX analysis, VALJ is the surface interface number (not
available from within the GUI) and VALI is not used unless the
ANSYS analysis is performed using the Multi-field solver.
val2i, val2j
Second surface load values (if any). If Lab = CONV, VAL2I and
VAL2J are the bulk temperatures. If Lab = RAD, VAL2I and VAL2J are
the ambient temperatures. If Lab = RDSF, VAL2I is the enclosure
number. Radiation will occur between surfaces flagged with the same
enclosure numbers. If the enclosure is open, radiation will occur
to the ambient. VAL2I and VAL2J are not used for other surface load
labels. If VAL2J is blank, it defaults to VAL2I. If VAL2J is
zero, a zero is used. To specify a table (Lab = CONV), enclose the
table name in percent signs (%), e.g., %tabname%. Use the *DIM
command to define a table.
Notes
-----
Specifies surface loads on the selected lines of area regions. The
lines represent either the edges of area elements or axisymmetric shell
elements themselves. Surface loads may be transferred from lines to
elements with the SFTRAN or SBCTRAN commands. See the SFE command for
a description of surface loads. Loads input on this command may be
tapered. See the SFGRAD command for an alternate tapered load
capability.
You can specify a table name only when using structural (PRES) and
thermal (CONV [film coefficient and/or bulk temperature], HFLUX), and
surface emissivity and ambient temperature (RAD) surface load labels.
VALJ and VAL2J are ignored for tabular boundary conditions.
This command is also valid in PREP7.
"""
command = f"SFL,{line},{lab},{vali},{valj},{val2i},{val2j}"
return self.run(command, **kwargs)
def sfldele(self, line="", lab="", **kwargs):
"""Deletes surface loads from lines.
APDL Command: SFLDELE
Parameters
----------
line
Line to which surface load deletion applies. If ALL, delete load
from all selected lines [LSEL]. If LINE = P, graphical picking is
enabled and all remaining command fields are ignored (valid only in
the GUI). A component name may be substituted for LINE.
lab
Valid surface load label. If ALL, use all appropriate labels. See
the SFL command for labels.
Notes
-----
Deletes surface loads (and all corresponding finite element loads) from
selected lines.
This command is also valid in PREP7.
"""
command = f"SFLDELE,{line},{lab}"
return self.run(command, **kwargs)
def sfllist(self, line="", lab="", **kwargs):
"""Lists the surface loads for lines.
APDL Command: SFLLIST
Parameters
----------
line
Line at which surface load is to be listed. If ALL (or blank),
list for all selected lines [LSEL]. If LINE = P, graphical picking
is enabled and all remaining command fields are ignored (valid only
in the GUI). A component name may be substituted for LINE.
lab
Valid surface load label. If ALL (or blank), use all appropriate
labels. See the SFL command for labels.
Notes
-----
Lists the surface loads for the specified line.
This command is valid in any processor.
"""
command = f"SFLLIST,{line},{lab}"
return self.run(command, **kwargs)
def sftran(self, **kwargs):
"""Transfer the solid model surface loads to the finite element model.
APDL Command: SFTRAN
Notes
-----
Surface loads are transferred only from selected lines and areas to all
selected elements. The SFTRAN operation is also done if the SBCTRAN
command is issued or automatically done upon initiation of the solution
calculations [SOLVE].
This command is also valid in PREP7.
"""
command = f"SFTRAN,"
return self.run(command, **kwargs)
|
class RLPException(Exception):
"""Base class for exceptions raised by this package."""
pass
class EncodingError(RLPException):
"""Exception raised if encoding fails.
:ivar obj: the object that could not be encoded
"""
def __init__(self, message, obj):
super(EncodingError, self).__init__(message)
self.obj = obj
class DecodingError(RLPException):
"""Exception raised if decoding fails.
:ivar rlp: the RLP string that could not be decoded
"""
def __init__(self, message, rlp):
super(DecodingError, self).__init__(message)
self.rlp = rlp
class SerializationError(RLPException):
"""Exception raised if serialization fails.
:ivar obj: the object that could not be serialized
"""
def __init__(self, message, obj):
super(SerializationError, self).__init__(message)
self.obj = obj
class DeserializationError(RLPException):
"""Exception raised if deserialization fails.
:ivar serial: the decoded RLP string that could not be deserialized
"""
def __init__(self, message, serial):
super(DeserializationError, self).__init__(message)
self.serial = serial
|
def make_car(manufacturer, model, **extra_info):
"""Make a car dictionary using input information."""
car = {}
car['manufacturer'] = manufacturer
car['model'] = model
for key, value in extra_info.items():
car[key] = value
return car
car = make_car('subaru', 'outback', color='blue', tow_package=True)
print(car)
|
#
# PySNMP MIB module Nortel-Magellan-Passport-PppMIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Nortel-Magellan-Passport-PppMIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:18:42 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion")
Integer32, RowStatus, Gauge32, StorageType, Counter32, Unsigned32, DisplayString, InterfaceIndex = mibBuilder.importSymbols("Nortel-Magellan-Passport-StandardTextualConventionsMIB", "Integer32", "RowStatus", "Gauge32", "StorageType", "Counter32", "Unsigned32", "DisplayString", "InterfaceIndex")
NonReplicated, Link = mibBuilder.importSymbols("Nortel-Magellan-Passport-TextualConventionsMIB", "NonReplicated", "Link")
components, passportMIBs = mibBuilder.importSymbols("Nortel-Magellan-Passport-UsefulDefinitionsMIB", "components", "passportMIBs")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Integer32, iso, TimeTicks, MibIdentifier, NotificationType, Gauge32, Counter32, ModuleIdentity, Unsigned32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter64, Bits, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "iso", "TimeTicks", "MibIdentifier", "NotificationType", "Gauge32", "Counter32", "ModuleIdentity", "Unsigned32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter64", "Bits", "ObjectIdentity")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
pppMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33))
ppp = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102))
pppRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1), )
if mibBuilder.loadTexts: pppRowStatusTable.setStatus('mandatory')
pppRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppRowStatusEntry.setStatus('mandatory')
pppRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppRowStatus.setStatus('mandatory')
pppComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppComponentName.setStatus('mandatory')
pppStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppStorageType.setStatus('mandatory')
pppIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: pppIndex.setStatus('mandatory')
pppCidDataTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 20), )
if mibBuilder.loadTexts: pppCidDataTable.setStatus('mandatory')
pppCidDataEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 20, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppCidDataEntry.setStatus('mandatory')
pppCustomerIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 20, 1, 1), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 8191), ))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppCustomerIdentifier.setStatus('mandatory')
pppIfEntryTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 21), )
if mibBuilder.loadTexts: pppIfEntryTable.setStatus('mandatory')
pppIfEntryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 21, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppIfEntryEntry.setStatus('mandatory')
pppIfAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 21, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3))).clone('up')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppIfAdminStatus.setStatus('mandatory')
pppIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 21, 1, 2), InterfaceIndex().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppIfIndex.setStatus('mandatory')
pppMpTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 22), )
if mibBuilder.loadTexts: pppMpTable.setStatus('mandatory')
pppMpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 22, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppMpEntry.setStatus('mandatory')
pppLinkToProtocolPort = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 22, 1, 1), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLinkToProtocolPort.setStatus('mandatory')
pppStateTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23), )
if mibBuilder.loadTexts: pppStateTable.setStatus('mandatory')
pppStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppStateEntry.setStatus('mandatory')
pppAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("locked", 0), ("unlocked", 1), ("shuttingDown", 2))).clone('unlocked')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppAdminState.setStatus('mandatory')
pppOperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppOperationalState.setStatus('mandatory')
pppUsageState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 23, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("idle", 0), ("active", 1), ("busy", 2))).clone('idle')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppUsageState.setStatus('mandatory')
pppOperStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 24), )
if mibBuilder.loadTexts: pppOperStatusTable.setStatus('mandatory')
pppOperStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 24, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"))
if mibBuilder.loadTexts: pppOperStatusEntry.setStatus('mandatory')
pppSnmpOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 24, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("testing", 3))).clone('up')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppSnmpOperStatus.setStatus('mandatory')
pppLnk = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2))
pppLnkRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1), )
if mibBuilder.loadTexts: pppLnkRowStatusTable.setStatus('mandatory')
pppLnkRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLnkIndex"))
if mibBuilder.loadTexts: pppLnkRowStatusEntry.setStatus('mandatory')
pppLnkRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkRowStatus.setStatus('mandatory')
pppLnkComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkComponentName.setStatus('mandatory')
pppLnkStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkStorageType.setStatus('mandatory')
pppLnkIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppLnkIndex.setStatus('mandatory')
pppLnkProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10), )
if mibBuilder.loadTexts: pppLnkProvTable.setStatus('mandatory')
pppLnkProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLnkIndex"))
if mibBuilder.loadTexts: pppLnkProvEntry.setStatus('mandatory')
pppLnkConfigInitialMru = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(68, 18000)).clone(18000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkConfigInitialMru.setStatus('mandatory')
pppLnkConfigMagicNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkConfigMagicNumber.setStatus('mandatory')
pppLnkRestartTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1000, 10000)).clone(3000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkRestartTimer.setStatus('mandatory')
pppLnkContinuityMonitor = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkContinuityMonitor.setStatus('mandatory')
pppLnkNegativeAckTries = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkNegativeAckTries.setStatus('mandatory')
pppLnkQualityThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(10, 99)).clone(90)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkQualityThreshold.setStatus('mandatory')
pppLnkQualityWindow = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(10, 400)).clone(30)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkQualityWindow.setStatus('mandatory')
pppLnkTerminateRequestTries = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 11), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkTerminateRequestTries.setStatus('mandatory')
pppLnkConfigureRequestTries = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 10, 1, 12), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295)).clone(1000000000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLnkConfigureRequestTries.setStatus('mandatory')
pppLnkOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11), )
if mibBuilder.loadTexts: pppLnkOperTable.setStatus('mandatory')
pppLnkOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLnkIndex"))
if mibBuilder.loadTexts: pppLnkOperEntry.setStatus('mandatory')
pppLnkOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkOperState.setStatus('mandatory')
pppLnkLineCondition = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 3, 4))).clone(namedValues=NamedValues(("ok", 0), ("looped", 1), ("noClock", 3), ("badLineCondition", 4))).clone('ok')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkLineCondition.setStatus('mandatory')
pppLnkBadAddresses = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkBadAddresses.setStatus('mandatory')
pppLnkBadControls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkBadControls.setStatus('mandatory')
pppLnkPacketTooLongs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkPacketTooLongs.setStatus('mandatory')
pppLnkBadFcss = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkBadFcss.setStatus('mandatory')
pppLnkLocalMru = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483648)).clone(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkLocalMru.setStatus('mandatory')
pppLnkRemoteMru = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483648))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkRemoteMru.setStatus('mandatory')
pppLnkTransmitFcsSize = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 16), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkTransmitFcsSize.setStatus('mandatory')
pppLnkReceiveFcsSize = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 2, 11, 1, 17), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 128))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLnkReceiveFcsSize.setStatus('mandatory')
pppLqm = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3))
pppLqmRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1), )
if mibBuilder.loadTexts: pppLqmRowStatusTable.setStatus('mandatory')
pppLqmRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLqmIndex"))
if mibBuilder.loadTexts: pppLqmRowStatusEntry.setStatus('mandatory')
pppLqmRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmRowStatus.setStatus('mandatory')
pppLqmComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmComponentName.setStatus('mandatory')
pppLqmStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmStorageType.setStatus('mandatory')
pppLqmIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppLqmIndex.setStatus('mandatory')
pppLqmProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 10), )
if mibBuilder.loadTexts: pppLqmProvTable.setStatus('mandatory')
pppLqmProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLqmIndex"))
if mibBuilder.loadTexts: pppLqmProvEntry.setStatus('mandatory')
pppLqmConfigPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 10, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLqmConfigPeriod.setStatus('mandatory')
pppLqmConfigStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLqmConfigStatus.setStatus('mandatory')
pppLqmOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11), )
if mibBuilder.loadTexts: pppLqmOperTable.setStatus('mandatory')
pppLqmOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLqmIndex"))
if mibBuilder.loadTexts: pppLqmOperEntry.setStatus('mandatory')
pppLqmQuality = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("good", 1), ("bad", 2), ("notDetermined", 3))).clone('notDetermined')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmQuality.setStatus('mandatory')
pppLqmInGoodOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmInGoodOctets.setStatus('mandatory')
pppLqmLocalPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)).clone(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmLocalPeriod.setStatus('mandatory')
pppLqmRemotePeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)).clone(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmRemotePeriod.setStatus('mandatory')
pppLqmOutLqrs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmOutLqrs.setStatus('mandatory')
pppLqmInLqrs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 3, 11, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLqmInLqrs.setStatus('mandatory')
pppNcp = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4))
pppNcpRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1), )
if mibBuilder.loadTexts: pppNcpRowStatusTable.setStatus('mandatory')
pppNcpRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpRowStatusEntry.setStatus('mandatory')
pppNcpRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpRowStatus.setStatus('mandatory')
pppNcpComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpComponentName.setStatus('mandatory')
pppNcpStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpStorageType.setStatus('mandatory')
pppNcpIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppNcpIndex.setStatus('mandatory')
pppNcpBprovTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 11), )
if mibBuilder.loadTexts: pppNcpBprovTable.setStatus('mandatory')
pppNcpBprovEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpBprovEntry.setStatus('mandatory')
pppNcpBConfigTinygram = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 11, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppNcpBConfigTinygram.setStatus('mandatory')
pppNcpBConfigLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 11, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('enabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppNcpBConfigLanId.setStatus('mandatory')
pppNcpIpOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 12), )
if mibBuilder.loadTexts: pppNcpIpOperTable.setStatus('mandatory')
pppNcpIpOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpIpOperEntry.setStatus('mandatory')
pppNcpIpOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 12, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpIpOperState.setStatus('mandatory')
pppNcpBoperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14), )
if mibBuilder.loadTexts: pppNcpBoperTable.setStatus('mandatory')
pppNcpBoperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpBoperEntry.setStatus('mandatory')
pppNcpBOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBOperState.setStatus('mandatory')
pppNcpBLocalToRemoteTinygramComp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBLocalToRemoteTinygramComp.setStatus('mandatory')
pppNcpBRemoteToLocalTinygramComp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBRemoteToLocalTinygramComp.setStatus('mandatory')
pppNcpBLocalToRemoteLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBLocalToRemoteLanId.setStatus('mandatory')
pppNcpBRemoteToLocalLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 14, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBRemoteToLocalLanId.setStatus('mandatory')
pppNcpOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16), )
if mibBuilder.loadTexts: pppNcpOperTable.setStatus('mandatory')
pppNcpOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"))
if mibBuilder.loadTexts: pppNcpOperEntry.setStatus('mandatory')
pppNcpAppletalkOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpAppletalkOperState.setStatus('mandatory')
pppNcpIpxOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpIpxOperState.setStatus('mandatory')
pppNcpXnsOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpXnsOperState.setStatus('mandatory')
pppNcpDecnetOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 16, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("initial", 0), ("starting", 1), ("closed", 2), ("stopped", 3), ("closing", 4), ("stopping", 5), ("reqsent", 6), ("ackrcvd", 7), ("acksent", 8), ("opened", 9))).clone('initial')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpDecnetOperState.setStatus('mandatory')
pppNcpBmcEntry = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2))
pppNcpBmcEntryRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1), )
if mibBuilder.loadTexts: pppNcpBmcEntryRowStatusTable.setStatus('mandatory')
pppNcpBmcEntryRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpBmcEntryMacTypeIndex"))
if mibBuilder.loadTexts: pppNcpBmcEntryRowStatusEntry.setStatus('mandatory')
pppNcpBmcEntryRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppNcpBmcEntryRowStatus.setStatus('mandatory')
pppNcpBmcEntryComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmcEntryComponentName.setStatus('mandatory')
pppNcpBmcEntryStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmcEntryStorageType.setStatus('mandatory')
pppNcpBmcEntryMacTypeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("ethernet", 1), ("tokenBus", 2), ("tokenRing", 3), ("fddi", 4))))
if mibBuilder.loadTexts: pppNcpBmcEntryMacTypeIndex.setStatus('mandatory')
pppNcpBmcEntryProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 10), )
if mibBuilder.loadTexts: pppNcpBmcEntryProvTable.setStatus('mandatory')
pppNcpBmcEntryProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpBmcEntryMacTypeIndex"))
if mibBuilder.loadTexts: pppNcpBmcEntryProvEntry.setStatus('mandatory')
pppNcpBmcEntryLocalStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 2, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("accept", 1))).clone('accept')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppNcpBmcEntryLocalStatus.setStatus('mandatory')
pppNcpBmEntry = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3))
pppNcpBmEntryRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1), )
if mibBuilder.loadTexts: pppNcpBmEntryRowStatusTable.setStatus('mandatory')
pppNcpBmEntryRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpBmEntryMacTypeIndex"))
if mibBuilder.loadTexts: pppNcpBmEntryRowStatusEntry.setStatus('mandatory')
pppNcpBmEntryRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryRowStatus.setStatus('mandatory')
pppNcpBmEntryComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryComponentName.setStatus('mandatory')
pppNcpBmEntryStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryStorageType.setStatus('mandatory')
pppNcpBmEntryMacTypeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("ethernet", 1), ("tokenBus", 2), ("tokenRing", 3), ("fddi", 4))))
if mibBuilder.loadTexts: pppNcpBmEntryMacTypeIndex.setStatus('mandatory')
pppNcpBmEntryOperTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 10), )
if mibBuilder.loadTexts: pppNcpBmEntryOperTable.setStatus('mandatory')
pppNcpBmEntryOperEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppNcpBmEntryMacTypeIndex"))
if mibBuilder.loadTexts: pppNcpBmEntryOperEntry.setStatus('mandatory')
pppNcpBmEntryLocalStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 10, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("accept", 1), ("dontAccept", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryLocalStatus.setStatus('mandatory')
pppNcpBmEntryRemoteStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 4, 3, 10, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("accept", 1), ("dontAccept", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppNcpBmEntryRemoteStatus.setStatus('mandatory')
pppFramer = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5))
pppFramerRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1), )
if mibBuilder.loadTexts: pppFramerRowStatusTable.setStatus('mandatory')
pppFramerRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerRowStatusEntry.setStatus('mandatory')
pppFramerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1, 1), RowStatus()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerRowStatus.setStatus('mandatory')
pppFramerComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerComponentName.setStatus('mandatory')
pppFramerStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerStorageType.setStatus('mandatory')
pppFramerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppFramerIndex.setStatus('mandatory')
pppFramerProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 10), )
if mibBuilder.loadTexts: pppFramerProvTable.setStatus('mandatory')
pppFramerProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerProvEntry.setStatus('mandatory')
pppFramerInterfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 10, 1, 1), Link()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppFramerInterfaceName.setStatus('mandatory')
pppFramerStateTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12), )
if mibBuilder.loadTexts: pppFramerStateTable.setStatus('mandatory')
pppFramerStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerStateEntry.setStatus('mandatory')
pppFramerAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("locked", 0), ("unlocked", 1), ("shuttingDown", 2))).clone('unlocked')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerAdminState.setStatus('mandatory')
pppFramerOperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerOperationalState.setStatus('mandatory')
pppFramerUsageState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 12, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("idle", 0), ("active", 1), ("busy", 2))).clone('idle')).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerUsageState.setStatus('mandatory')
pppFramerStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13), )
if mibBuilder.loadTexts: pppFramerStatsTable.setStatus('mandatory')
pppFramerStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerStatsEntry.setStatus('mandatory')
pppFramerFrmToIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerFrmToIf.setStatus('mandatory')
pppFramerFrmFromIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerFrmFromIf.setStatus('mandatory')
pppFramerAborts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerAborts.setStatus('mandatory')
pppFramerCrcErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerCrcErrors.setStatus('mandatory')
pppFramerLrcErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerLrcErrors.setStatus('mandatory')
pppFramerNonOctetErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerNonOctetErrors.setStatus('mandatory')
pppFramerOverruns = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerOverruns.setStatus('mandatory')
pppFramerUnderruns = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerUnderruns.setStatus('mandatory')
pppFramerLargeFrmErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 13, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerLargeFrmErrors.setStatus('mandatory')
pppFramerUtilTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 14), )
if mibBuilder.loadTexts: pppFramerUtilTable.setStatus('mandatory')
pppFramerUtilEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppFramerIndex"))
if mibBuilder.loadTexts: pppFramerUtilEntry.setStatus('mandatory')
pppFramerNormPrioLinkUtilToIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 14, 1, 1), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerNormPrioLinkUtilToIf.setStatus('mandatory')
pppFramerNormPrioLinkUtilFromIf = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 5, 14, 1, 3), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppFramerNormPrioLinkUtilFromIf.setStatus('mandatory')
pppLeq = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6))
pppLeqRowStatusTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1), )
if mibBuilder.loadTexts: pppLeqRowStatusTable.setStatus('mandatory')
pppLeqRowStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqRowStatusEntry.setStatus('mandatory')
pppLeqRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1, 1), RowStatus()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqRowStatus.setStatus('mandatory')
pppLeqComponentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqComponentName.setStatus('mandatory')
pppLeqStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1, 4), StorageType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqStorageType.setStatus('mandatory')
pppLeqIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 1, 1, 10), NonReplicated())
if mibBuilder.loadTexts: pppLeqIndex.setStatus('mandatory')
pppLeqProvTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10), )
if mibBuilder.loadTexts: pppLeqProvTable.setStatus('mandatory')
pppLeqProvEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqProvEntry.setStatus('mandatory')
pppLeqMaxPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2048))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqMaxPackets.setStatus('mandatory')
pppLeqMaxMsecData = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(100, 60000)).clone(10000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqMaxMsecData.setStatus('mandatory')
pppLeqMaxPercentMulticast = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 100)).clone(50)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqMaxPercentMulticast.setStatus('mandatory')
pppLeqTimeToLive = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 10, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(100, 60000)).clone(10000)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: pppLeqTimeToLive.setStatus('mandatory')
pppLeqStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11), )
if mibBuilder.loadTexts: pppLeqStatsTable.setStatus('mandatory')
pppLeqStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqStatsEntry.setStatus('mandatory')
pppLeqTimedOutPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTimedOutPkt.setStatus('mandatory')
pppLeqHardwareForcedPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqHardwareForcedPkt.setStatus('mandatory')
pppLeqForcedPktDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqForcedPktDiscards.setStatus('mandatory')
pppLeqQueuePurgeDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 11, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqQueuePurgeDiscards.setStatus('mandatory')
pppLeqTStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12), )
if mibBuilder.loadTexts: pppLeqTStatsTable.setStatus('mandatory')
pppLeqTStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqTStatsEntry.setStatus('mandatory')
pppLeqTotalPktHandled = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalPktHandled.setStatus('mandatory')
pppLeqTotalPktForwarded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalPktForwarded.setStatus('mandatory')
pppLeqTotalPktQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalPktQueued.setStatus('mandatory')
pppLeqTotalMulticastPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalMulticastPkt.setStatus('mandatory')
pppLeqTotalPktDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 12, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqTotalPktDiscards.setStatus('mandatory')
pppLeqCStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13), )
if mibBuilder.loadTexts: pppLeqCStatsTable.setStatus('mandatory')
pppLeqCStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqCStatsEntry.setStatus('mandatory')
pppLeqCurrentPktQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13, 1, 1), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqCurrentPktQueued.setStatus('mandatory')
pppLeqCurrentBytesQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13, 1, 2), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqCurrentBytesQueued.setStatus('mandatory')
pppLeqCurrentMulticastQueued = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 13, 1, 3), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqCurrentMulticastQueued.setStatus('mandatory')
pppLeqThrStatsTable = MibTable((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14), )
if mibBuilder.loadTexts: pppLeqThrStatsTable.setStatus('mandatory')
pppLeqThrStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1), ).setIndexNames((0, "Nortel-Magellan-Passport-PppMIB", "pppIndex"), (0, "Nortel-Magellan-Passport-PppMIB", "pppLeqIndex"))
if mibBuilder.loadTexts: pppLeqThrStatsEntry.setStatus('mandatory')
pppLeqQueuePktThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqQueuePktThreshold.setStatus('mandatory')
pppLeqPktThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqPktThresholdExceeded.setStatus('mandatory')
pppLeqQueueByteThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqQueueByteThreshold.setStatus('mandatory')
pppLeqByteThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqByteThresholdExceeded.setStatus('mandatory')
pppLeqQueueMulticastThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqQueueMulticastThreshold.setStatus('mandatory')
pppLeqMulThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqMulThresholdExceeded.setStatus('mandatory')
pppLeqMemThresholdExceeded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 2, 4, 1, 102, 6, 14, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pppLeqMemThresholdExceeded.setStatus('mandatory')
pppGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 1))
pppGroupBC = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 1, 3))
pppGroupBC02 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 1, 3, 3))
pppGroupBC02A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 1, 3, 3, 2))
pppCapabilities = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 3))
pppCapabilitiesBC = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 3, 3))
pppCapabilitiesBC02 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 3, 3, 3))
pppCapabilitiesBC02A = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 2, 4, 2, 33, 3, 3, 3, 2))
mibBuilder.exportSymbols("Nortel-Magellan-Passport-PppMIB", pppLeqTimeToLive=pppLeqTimeToLive, pppLnkStorageType=pppLnkStorageType, pppLqmOutLqrs=pppLqmOutLqrs, pppLeqRowStatus=pppLeqRowStatus, pppFramerInterfaceName=pppFramerInterfaceName, pppNcpBConfigLanId=pppNcpBConfigLanId, pppFramerRowStatusEntry=pppFramerRowStatusEntry, pppLnkTransmitFcsSize=pppLnkTransmitFcsSize, pppLnkQualityWindow=pppLnkQualityWindow, pppNcpBmcEntryLocalStatus=pppNcpBmcEntryLocalStatus, pppLeqThrStatsTable=pppLeqThrStatsTable, pppNcpBmEntryOperEntry=pppNcpBmEntryOperEntry, pppCidDataTable=pppCidDataTable, pppLnkConfigInitialMru=pppLnkConfigInitialMru, pppNcpIndex=pppNcpIndex, pppLeqTotalPktQueued=pppLeqTotalPktQueued, pppGroupBC02A=pppGroupBC02A, pppMpTable=pppMpTable, pppNcp=pppNcp, pppNcpBprovEntry=pppNcpBprovEntry, pppNcpBmEntry=pppNcpBmEntry, pppNcpIpOperEntry=pppNcpIpOperEntry, pppLeqStorageType=pppLeqStorageType, pppLqmQuality=pppLqmQuality, pppNcpBprovTable=pppNcpBprovTable, pppNcpBLocalToRemoteLanId=pppNcpBLocalToRemoteLanId, pppIfAdminStatus=pppIfAdminStatus, pppCapabilitiesBC02A=pppCapabilitiesBC02A, pppFramerAdminState=pppFramerAdminState, pppLnkProvEntry=pppLnkProvEntry, pppNcpBmEntryRowStatusTable=pppNcpBmEntryRowStatusTable, pppLeqThrStatsEntry=pppLeqThrStatsEntry, pppLqmConfigStatus=pppLqmConfigStatus, pppNcpRowStatus=pppNcpRowStatus, pppFramerNormPrioLinkUtilFromIf=pppFramerNormPrioLinkUtilFromIf, pppFramerStateTable=pppFramerStateTable, pppLnk=pppLnk, pppGroupBC=pppGroupBC, pppLnkReceiveFcsSize=pppLnkReceiveFcsSize, pppNcpBmcEntryRowStatusTable=pppNcpBmcEntryRowStatusTable, pppLnkConfigMagicNumber=pppLnkConfigMagicNumber, ppp=ppp, pppLeqForcedPktDiscards=pppLeqForcedPktDiscards, pppNcpRowStatusEntry=pppNcpRowStatusEntry, pppLnkContinuityMonitor=pppLnkContinuityMonitor, pppLeqHardwareForcedPkt=pppLeqHardwareForcedPkt, pppNcpBmEntryRemoteStatus=pppNcpBmEntryRemoteStatus, pppNcpBmEntryLocalStatus=pppNcpBmEntryLocalStatus, pppFramerUnderruns=pppFramerUnderruns, pppFramerNormPrioLinkUtilToIf=pppFramerNormPrioLinkUtilToIf, pppLeqStatsEntry=pppLeqStatsEntry, pppLeqRowStatusTable=pppLeqRowStatusTable, pppNcpBmEntryMacTypeIndex=pppNcpBmEntryMacTypeIndex, pppLeqProvEntry=pppLeqProvEntry, pppLeqMulThresholdExceeded=pppLeqMulThresholdExceeded, pppLeqCurrentBytesQueued=pppLeqCurrentBytesQueued, pppGroup=pppGroup, pppFramerOperationalState=pppFramerOperationalState, pppLeq=pppLeq, pppNcpBOperState=pppNcpBOperState, pppFramer=pppFramer, pppLqmRowStatusEntry=pppLqmRowStatusEntry, pppNcpIpOperState=pppNcpIpOperState, pppNcpXnsOperState=pppNcpXnsOperState, pppLqmIndex=pppLqmIndex, pppNcpBmcEntryProvTable=pppNcpBmcEntryProvTable, pppLnkLineCondition=pppLnkLineCondition, pppLqmComponentName=pppLqmComponentName, pppLeqMaxPackets=pppLeqMaxPackets, pppLqmStorageType=pppLqmStorageType, pppLeqTimedOutPkt=pppLeqTimedOutPkt, pppLeqTotalPktHandled=pppLeqTotalPktHandled, pppNcpIpxOperState=pppNcpIpxOperState, pppLeqTotalPktForwarded=pppLeqTotalPktForwarded, pppRowStatusTable=pppRowStatusTable, pppLqmInLqrs=pppLqmInLqrs, pppLnkRemoteMru=pppLnkRemoteMru, pppLnkTerminateRequestTries=pppLnkTerminateRequestTries, pppLnkConfigureRequestTries=pppLnkConfigureRequestTries, pppLnkBadAddresses=pppLnkBadAddresses, pppNcpBmcEntryProvEntry=pppNcpBmcEntryProvEntry, pppStateTable=pppStateTable, pppCapabilities=pppCapabilities, pppFramerNonOctetErrors=pppFramerNonOctetErrors, pppIfEntryEntry=pppIfEntryEntry, pppLqm=pppLqm, pppNcpBRemoteToLocalLanId=pppNcpBRemoteToLocalLanId, pppIndex=pppIndex, pppUsageState=pppUsageState, pppLqmConfigPeriod=pppLqmConfigPeriod, pppLnkOperEntry=pppLnkOperEntry, pppLqmRemotePeriod=pppLqmRemotePeriod, pppLeqProvTable=pppLeqProvTable, pppLeqMaxMsecData=pppLeqMaxMsecData, pppGroupBC02=pppGroupBC02, pppFramerUtilTable=pppFramerUtilTable, pppCapabilitiesBC02=pppCapabilitiesBC02, pppCapabilitiesBC=pppCapabilitiesBC, pppFramerLargeFrmErrors=pppFramerLargeFrmErrors, pppLnkRowStatusTable=pppLnkRowStatusTable, pppLnkBadControls=pppLnkBadControls, pppLeqByteThresholdExceeded=pppLeqByteThresholdExceeded, pppLeqPktThresholdExceeded=pppLeqPktThresholdExceeded, pppStorageType=pppStorageType, pppFramerIndex=pppFramerIndex, pppFramerOverruns=pppFramerOverruns, pppLeqCStatsEntry=pppLeqCStatsEntry, pppNcpOperTable=pppNcpOperTable, pppLnkRowStatusEntry=pppLnkRowStatusEntry, pppLeqStatsTable=pppLeqStatsTable, pppOperStatusEntry=pppOperStatusEntry, pppLeqCurrentPktQueued=pppLeqCurrentPktQueued, pppLeqQueueMulticastThreshold=pppLeqQueueMulticastThreshold, pppLeqTStatsEntry=pppLeqTStatsEntry, pppLnkProvTable=pppLnkProvTable, pppRowStatus=pppRowStatus, pppNcpBLocalToRemoteTinygramComp=pppNcpBLocalToRemoteTinygramComp, pppNcpComponentName=pppNcpComponentName, pppLqmOperEntry=pppLqmOperEntry, pppLeqCStatsTable=pppLeqCStatsTable, pppLqmProvTable=pppLqmProvTable, pppNcpBmEntryRowStatus=pppNcpBmEntryRowStatus, pppLeqTStatsTable=pppLeqTStatsTable, pppFramerLrcErrors=pppFramerLrcErrors, pppLqmRowStatusTable=pppLqmRowStatusTable, pppNcpBmEntryComponentName=pppNcpBmEntryComponentName, pppFramerProvTable=pppFramerProvTable, pppNcpAppletalkOperState=pppNcpAppletalkOperState, pppNcpBConfigTinygram=pppNcpBConfigTinygram, pppFramerStorageType=pppFramerStorageType, pppCustomerIdentifier=pppCustomerIdentifier, pppLnkQualityThreshold=pppLnkQualityThreshold, pppNcpBmcEntryComponentName=pppNcpBmcEntryComponentName, pppNcpBmcEntryRowStatusEntry=pppNcpBmcEntryRowStatusEntry, pppLeqMaxPercentMulticast=pppLeqMaxPercentMulticast, pppNcpBoperTable=pppNcpBoperTable, pppLnkLocalMru=pppLnkLocalMru, pppFramerCrcErrors=pppFramerCrcErrors, pppNcpRowStatusTable=pppNcpRowStatusTable, pppLeqMemThresholdExceeded=pppLeqMemThresholdExceeded, pppLnkBadFcss=pppLnkBadFcss, pppNcpBoperEntry=pppNcpBoperEntry, pppCidDataEntry=pppCidDataEntry, pppNcpBRemoteToLocalTinygramComp=pppNcpBRemoteToLocalTinygramComp, pppIfEntryTable=pppIfEntryTable, pppFramerStatsTable=pppFramerStatsTable, pppNcpBmEntryRowStatusEntry=pppNcpBmEntryRowStatusEntry, pppLnkIndex=pppLnkIndex, pppStateEntry=pppStateEntry, pppLeqIndex=pppLeqIndex, pppFramerStateEntry=pppFramerStateEntry, pppComponentName=pppComponentName, pppLnkComponentName=pppLnkComponentName, pppNcpBmEntryStorageType=pppNcpBmEntryStorageType, pppLeqRowStatusEntry=pppLeqRowStatusEntry, pppLeqComponentName=pppLeqComponentName, pppLeqTotalMulticastPkt=pppLeqTotalMulticastPkt, pppAdminState=pppAdminState, pppSnmpOperStatus=pppSnmpOperStatus, pppRowStatusEntry=pppRowStatusEntry, pppNcpBmcEntry=pppNcpBmcEntry, pppNcpBmEntryOperTable=pppNcpBmEntryOperTable, pppLeqQueueByteThreshold=pppLeqQueueByteThreshold, pppMpEntry=pppMpEntry, pppLnkPacketTooLongs=pppLnkPacketTooLongs, pppFramerStatsEntry=pppFramerStatsEntry, pppLeqQueuePurgeDiscards=pppLeqQueuePurgeDiscards, pppLnkRestartTimer=pppLnkRestartTimer, pppIfIndex=pppIfIndex, pppFramerRowStatusTable=pppFramerRowStatusTable, pppFramerRowStatus=pppFramerRowStatus, pppNcpBmcEntryMacTypeIndex=pppNcpBmcEntryMacTypeIndex, pppLnkNegativeAckTries=pppLnkNegativeAckTries, pppFramerFrmToIf=pppFramerFrmToIf, pppOperationalState=pppOperationalState, pppLnkOperTable=pppLnkOperTable, pppLqmRowStatus=pppLqmRowStatus, pppFramerAborts=pppFramerAborts, pppNcpIpOperTable=pppNcpIpOperTable, pppNcpDecnetOperState=pppNcpDecnetOperState, pppMIB=pppMIB, pppLqmOperTable=pppLqmOperTable, pppLeqQueuePktThreshold=pppLeqQueuePktThreshold, pppLinkToProtocolPort=pppLinkToProtocolPort, pppNcpBmcEntryRowStatus=pppNcpBmcEntryRowStatus, pppLqmLocalPeriod=pppLqmLocalPeriod, pppLnkOperState=pppLnkOperState, pppNcpBmcEntryStorageType=pppNcpBmcEntryStorageType, pppNcpOperEntry=pppNcpOperEntry, pppFramerUsageState=pppFramerUsageState, pppFramerUtilEntry=pppFramerUtilEntry, pppOperStatusTable=pppOperStatusTable, pppLeqCurrentMulticastQueued=pppLeqCurrentMulticastQueued, pppLnkRowStatus=pppLnkRowStatus, pppLeqTotalPktDiscards=pppLeqTotalPktDiscards, pppFramerComponentName=pppFramerComponentName, pppLqmProvEntry=pppLqmProvEntry, pppNcpStorageType=pppNcpStorageType, pppFramerFrmFromIf=pppFramerFrmFromIf, pppFramerProvEntry=pppFramerProvEntry, pppLqmInGoodOctets=pppLqmInGoodOctets)
|
"""
Write a class called MyCounter that counts
how many times it was initialised, so the
following code:
for _ in range(10):
c1 = MyCounter()
print MyCounter.count
should print 10
"""
|
#
# This file contains the Python code from Program 9.8 of
# "Data Structures and Algorithms
# with Object-Oriented Design Patterns in Python"
# by Bruno R. Preiss.
#
# Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved.
#
# http://www.brpreiss.com/books/opus7/programs/pgm09_08.txt
#
class Tree(Container):
def accept(self, visitor):
assert isinstance(visitor, Visitor)
self.depthFirstTraversal(PreOrder(visitor))
# ...
|
x = int(input("Insert some numbers: "))
ev = 0
od = 0
while x > 0:
if x%2 ==0:
ev += 1
else:
od += 1
x = x//10
print("Even numbers = %d, Odd numbers = %d" % (ev,od))
|
'''A special two digit number is a number such that when the sum of its digits is added to the product of its digits, the result should be equal to the original two-digit number.
Implement a program to accept a two digit number and check whether it is a special two digit number or not.
Input Format
a two digit number
Constraints
10<=n<=99
Output Format
Yes or No
Sample Input 0
59
Sample Output 0
Yes
Sample Input 1
69
Sample Output 1
Yes
Sample Input 2
11
Sample Output 2
No'''
#solution
def special(num):
summ = 0
prod = 1
for i in str(num):
summ+=int(i)
prod*=int(i)
return "Yes" if num == (summ+prod) else "No"
print(special(int(input())))
|
def latex_template(name, title):
return '\n'.join((r"\begin{figure}[H]",
r" \centering",
rf" \incfig[0.8]{{{name}}}",
rf" \caption{{{title}}}",
rf" \label{{fig:{name}}}",
r" \vspace{-0.5cm}",
r"\end{figure}"))
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Замыкание функций которое увеличивает аргумент на 3
def func(a):
# Функция, несмотря на отсутсвие аргументов, успешно вычисляет а+3
def mul():
return a + 3
return mul()
|
# -*- coding: utf-8 -*-
__author__ = 'nakaokataiki'
def get_htmltemplate():
"""
レスポンスとして返すHTMLのうち、定形部分を返す。
"""
html_body = u"""
<!DOCTYPE html>
<html>
<head>
<title>{title}</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link rel="stylesheet" href="css/default.css">
<link rel="stylesheet" href="css/bootstrap.css">
<script type="text/javascript">{script}</script>
</head>
<body>
<div>
<div class="container">
<div class="row">
<div class="head">
<h1>{title}</h1>
</div>
</div>
<div class="row">
<div class ="span12">
<div id="timer">
<div id="timer-inner">
{body}
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>"""
return html_body
|
# @kwargs - extendable parameter list of the form var1=[a1, a2, .., an], var2=[b1, b2, ..., bn], ...
# @value - list of parameter permutations of the form [(a1, b1, ...), (a1, b2, ...), (a2, b1, ...), ...]
def cv_grid(**kwargs):
"""Returns a list of parameter tuples from the grid.
Each tuple is a unique permutation of parameters specified in kwargs"""
key_list = list(kwargs.keys())
return __assemble(key_list, kwargs, 0)
# Recursively called function which traverses the parameter tree to compose the list of all possible permutations
# @key_list - list of variable names, for which we need a cv-grid
# @param_select-dict - map of parameters matched with the lists of possible values,
# {var1: [a1, a2, .., an], var2:[b1, b2, ..., bn], ...}
# @key_inx - indicator variable for bookkeeping the variable which is currently processed.
# If it is the same as the number of parameters, it means we have composed 1 unique permutations,
# and the lowest recursion level (last variable) returns
# @value - returns a list, which represents a partial permutation of CV-grid parameters
# (includes either some of them, or all of them if the whole tree has been traversed)
def __assemble(key_list, param_select_dict, key_inx):
if key_inx < (len(key_list) - 1):
f_combination_list = __assemble(key_list, param_select_dict, key_inx + 1)
else:
f_combination_list = []
for param in param_select_dict[key_list[key_inx]]:
f_combination_list.append({key_list[key_inx]: param})
return f_combination_list
c_combination_list = []
for param in param_select_dict[key_list[key_inx]]:
for f_dict in f_combination_list:
c_dict = {key_list[key_inx]: param}
c_dict.update(f_dict)
c_combination_list.append(c_dict)
return c_combination_list
|
"""
MIT License
Copyright (c) 2020-2022 EntySec
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
class PostTools:
""" Subclass of pex.post module.
This subclass of pex.post module is intended for providing
implementations of some helpful tools for pex.post.
"""
@staticmethod
def bytes_to_octal(bytes_obj: bytes, extra_zero: bool = False) -> str:
""" Convert bytes to their octal representation.
:param bytes bytes_obj: bytes to convert
:param bool extra_zero: add extra_zero to the result
:return str: octal representation of bytes
"""
byte_octals = []
for byte in bytes_obj:
byte_octal = '\\0' if extra_zero else '\\'
byte_octal += oct(byte)[2:]
byte_octals.append(byte_octal)
return ''.join(byte_octals)
@staticmethod
def post_command(sender, command: str, args: dict) -> str:
""" Post command to sender and recieve the result.
:param sender: sender function
:param str command: command to post
:param dict args: sender function arguments
:return str: post command result
"""
return sender(**{
'command': command,
**args
})
|
# -*- coding: utf-8 -*-
# Статусы заказов
STATUS_CREATED = 0
STATUS_SUCCESS = 1
STATUS_FAIL = 2
STATUS = (
(STATUS_CREATED, 'Created'),
(STATUS_SUCCESS, 'Success'),
(STATUS_FAIL, 'Fail'),
)
# Статусы заказа в Robokassa todo проверять через XML-интерфейс
ROBOKASSA_STATUS = (
(5, 'Initialized'),
(10, 'Cancelled'),
(50, 'Received payment, sending to store account'),
(60, 'Returned to customer account'),
(80, 'Stopped or restricted'),
(100, 'Successfully paid'),
)
|
"""
ID: duweira1
LANG: PYTHON2
TASK: test
"""
fin = open ('test.in', 'r')
fout = open ('test.out', 'w')
x,y = map(int, fin.readline().split())
sum = x+y
fout.write (str(sum) + '\n')
fout.close()
|
"""Quiz Game using Dictionary"""
"""
Stpes:
1. Create a dictionary containing questions and answers
2. Loop through diction
3.
"""
question_and_answer = {
"What is the capital of India?": "New Delhi",
"What is the capital of USA?": "Washington",
"What is the capital of UK?": "London",
"What is the capital of Germany?": "Berlin",
"What is the capital of France?": "Paris",
"What is the capital of Italy?": "Rome",
"What is the capital of Australia?": "Canberra",
"What is the capital of Canada?": "Ottawa",
"What is the capital of New Zealand?": "Wellington",
"What is the capital of South Africa?": "Pretoria",
"What is the capital of the Netherlands?": "Amsterdam",
"What is the capital of the United Kingdom?": "London",
"What is the capital of the United States?": "Washington",
"What is the capital of the United Arab Emirates?": "Abu Dhabi",
"What is the capital of the United Kingdom?": "London",
"What is the capital of the United States?": "Washington",
}
|
# Python3
# 有限制修改區域
def twinsScore(b, m):
return [*map(sum, zip(b, m))]
|
# [카카오] 비밀지도
def solution(n, arr1, arr2):
result = []
for i in range(n):
result.append((arr1[i] | arr2[i]))
ret = []
for i in range(n):
string = ""
for j in range(n):
if result[i] & (1 << j):
string = "#" + string
else:
string = " " + string
ret.append(string)
return ret
if __name__ == "__main__":
n = 5
arr1 = [9, 20, 28, 18, 11]
arr2 = [30, 1, 21, 17, 28]
print(solution(n, arr1, arr2))
|
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
This file contains indexing suite v2 code
"""
file_name = "indexing_suite/slice.hpp"
code = """// Header file slice.hpp
//
// Copyright (c) 2003 Raoul M. Gough
//
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
// at http://www.boost.org/LICENSE_1_0.txt)
//
// History
// =======
// 2003/ 9/10 rmg File creation
// 2008/12/08 Roman Change indexing suite layout
//
// $Id: slice.hpp,v 1.1.2.10 2003/11/24 14:28:31 raoulgough Exp $
//
// 2008 November 27 Roman Yakovenko
// implementation of the member functions was moved from cpp to header.
// this was done to simplify "installation" procedure.
#ifndef BOOST_PYTHON_INDEXING_SLICE_HPP
#define BOOST_PYTHON_INDEXING_SLICE_HPP
#include <boost/python/object.hpp>
#include <boost/python/errors.hpp>
#include <boost/python/converter/pytype_object_mgr_traits.hpp>
#include <algorithm>
namespace boost { namespace python { namespace indexing {
struct /*BOOST_PYTHON_DECL*/ slice : public boost::python::object
{
// This is just a thin wrapper around boost::python::object
// so that it is possible to register a special converter for
// PySlice_Type and overload C++ functions on slice
#if defined (BOOST_NO_MEMBER_TEMPLATES)
// MSVC6 doesn't seem to be able to invoke the templated
// constructor, so provide explicit overloads to match the
// (currently) known boost::python::object constructors
explicit slice (::boost::python::handle<> const& p)
: object (p)
{}
explicit slice (::boost::python::detail::borrowed_reference p)
: object (p)
{}
explicit slice (::boost::python::detail::new_reference p)
: object (p)
{}
explicit slice (::boost::python::detail::new_non_null_reference p)
: object (p)
{}
#else
// Better compilers make life easier
template<typename T> inline slice (T const &ref);
#endif
slice (slice const & copy) // Copy constructor
: object (copy)
{}
};
struct /*BOOST_PYTHON_DECL*/ integer_slice
{
// This class provides a convenient interface to Python slice
// objects that contain integer bound and stride values.
#if PY_VERSION_HEX < 0x02050000
typedef int index_type;
#else
typedef Py_ssize_t index_type;
#endif
integer_slice (slice const & sl, index_type length)
: m_slice (sl) // Leave index members uninitialized
{
PySlice_GetIndices(
#if PY_VERSION_HEX > 0x03020000
reinterpret_cast<PyObject *> (m_slice.ptr()),
#else
reinterpret_cast<PySliceObject *> (m_slice.ptr()),
#endif
length,
&m_start,
&m_stop,
&m_step);
if (m_step == 0)
{
// Can happen with Python prior to 2.3
PyErr_SetString (PyExc_ValueError, "slice step cannot be zero");
boost::python::throw_error_already_set ();
}
//GetIndices should do the job, m_stop==0 breaks (::-1) slice
//m_start = std::max (static_cast<index_type> (0), std::min (length, m_start));
//m_stop = std::max (static_cast<index_type> (0), std::min (length, m_stop));
m_direction = (m_step > 0) ? 1 : -1;
}
// integer_slice must know how big the container is so it can
// adjust for negative indexes, etc...
index_type start() const { return m_start; }
index_type step() const { return m_step; }
index_type stop() const { return m_stop; }
index_type size() const { return (m_stop - m_start) / m_step; }
bool in_range (index_type index)
{ return ((m_stop - index) * m_direction) > 0; }
private:
slice m_slice;
index_type m_start;
index_type m_step;
index_type m_stop;
index_type m_direction;
};
} } }
#if !defined (BOOST_NO_MEMBER_TEMPLATES)
template<typename T>
boost::python::indexing::slice::slice (T const &ref)
: boost::python::object (ref)
{
if (!PySlice_Check (this->ptr()))
{
PyErr_SetString(
PyExc_TypeError, "slice constructor: passed a non-slice object");
boost::python::throw_error_already_set();
}
}
#endif
namespace boost { namespace python { namespace converter {
// Specialized converter to handle PySlice_Type objects
template<>
struct object_manager_traits<boost::python::indexing::slice>
: pytype_object_manager_traits<
&PySlice_Type, ::boost::python::indexing::slice>
{
};
}}}
#endif // BOOST_PYTHON_INDEXING_SLICE_HPP
"""
|
"""
File: anagram.py
Name:
----------------------------------
This program recursively finds all the anagram(s)
for the word input by user and terminates when the
input string matches the EXIT constant defined
at line 19
If you correctly implement this program, you should see the
number of anagrams for each word listed below:
* arm -> 3 anagrams
* contains -> 5 anagrams
* stop -> 6 anagrams
* tesla -> 10 anagrams
* spear -> 12 anagrams
"""
# Constants
FILE = 'dictionary.txt' # This is the filename of an English dictionary
EXIT = '-1' # Controls when to stop the loop
vocab_list = []
ans_lst = []
switch = True
def main():
s = input('Find anagrams for:').lower()
read_dictionary(FILE)
find_anagrams(s)
def read_dictionary(file):
global vocab_list
with open(file, 'r') as f:
for line in f:
vocab_list.append(line[0: len(line)-1])
def find_anagrams(s):
"""
:param s:
:return:
"""
find_anagrams_helper(s, '', [])
print(f'{len(ans_lst)} anagrams: {ans_lst}')
def find_anagrams_helper(s, word, word_index):
global vocab_list, switch
if len(word) == len(s):
if switch is True:
print('Searching...')
switch = False
if word in vocab_list and word not in ans_lst:
print(word)
switch = True
ans_lst.append(word)
else:
if has_prefix(word): # 字典裡有此開頭
for i in range(len(s)):
if str(i) not in word_index: # 字元沒有重複被使用(用index看)
# choose
word_index.append(str(i))
word += s[i]
# search
find_anagrams_helper(s, word, word_index)
# un-choose
word_index.pop()
word = word[:len(word)-1]
def has_prefix(sub_s):
"""
:param sub_s:
:return:
"""
global vocab_list
tempo_vocab_list =[]
for word in vocab_list:
if word.startswith(sub_s):
return True
return False
{'apple', }
if __name__ == '__main__':
main()
|
houses = {(0, 0)}
with open('Day 3 - input', 'r') as f:
directions = f.readline()
current_location = [0, 0]
for direction in directions[::2]:
if direction == '^':
current_location[1] += 1
houses.add(tuple(current_location))
elif direction == '>':
current_location[0] += 1
houses.add(tuple(current_location))
elif direction == 'v':
current_location[1] -= 1
houses.add(tuple(current_location))
else:
current_location[0] -= 1
houses.add(tuple(current_location))
current_location = [0, 0]
for direction in directions[1::2]:
if direction == '^':
current_location[1] += 1
houses.add(tuple(current_location))
elif direction == '>':
current_location[0] += 1
houses.add(tuple(current_location))
elif direction == 'v':
current_location[1] -= 1
houses.add(tuple(current_location))
else:
current_location[0] -= 1
houses.add(tuple(current_location))
print(len(houses))
|
print('1. Was sind Maskierungssequenzen?')
input()
print('Maskierungszeichen stehen für Zeichen die sonst nur\nschwer in einem Code wiedergeben lassen')
print(r'Beispiele: \n für newline \t für tabulator \\ für backslash ... ')
print('')
input()
print('2. Wofür stehen die Maskierungssequenzen \\t und \\n')
input()
print(r'\n steht für Newline und \t für Tabulator')
print('')
input()
print(r'3. Wie können sie einen Backslash (\) in einen String einfügen?')
input()
print('Es gibt zwei Möglichkeiten.')
print(r"Einmal mittels mittels '\\' und einmal mittels r'\'")
print('')
input()
print('4. "How\'s your day?" ist ein gültiger Stringwert. \nWarum führt das als Apostroph verwendete einfache\nAnführungszeichen in How\'s nicht zu einem Problem \nobwohl es nicht maskiert ist?')
input()
print('Da der String mit doppelten Anführungszeichen\ngeschrieben wurde werden die einfachen\nAnführungszeichen innerhalb des Strings nicht\nausgewertet.')
print('')
input()
print('5. Wie können sie einen String mit Zeilenumbruch schreiben ohne \\n zu verwenden?')
input()
print('Man kann die Zeilenumbrüche auch direkt in Strings verwenden ohne \\n nutzen zu müssen.')
print('')
input()
print('6. Wozu werden folgende Ausdrücke ausgewertet?\n\'Hello World\'[1]\n\'Hello World\'[0:5]\n\'Hello World\'[:5]\n\'Hello World\'[3:]')
input()
print('1. e - 2. Hello - 3. Hello - 4. lo World')
print('')
input()
print('7. Wozu werden folgende Ausdrücke ausgewertet?\n\'Hello\'.upper()\n\'Hello\'.upper().isupper()\n\'Hello\'.upper().lower()')
input()
print('1. HELLO - 2. True - 3. hello')
print('')
input()
print('8. Wozu werden folgende Ausdrücke ausgewertet?\n\'Remember, remember, the fifth of november.\'.split()\n\'-\'.join(\'There can be only one.\'.split())')
input()
print('1. [ \'Remember,\', \'remember,\', \'the\', \'fifth\', \'of\', \'november.\' ]')
print('2. There-can-be-only-one.')
input()
print('9. Mit welchen Stringmethoden können sie einen String\nRechtsbünding, Zentriert oder Linksbündig ausrichten?')
input()
print('Mit den Methoden string.center(n), string.rjust(n) und string.ljust(n)')
print('')
input()
print('10. Wie können Weissraumzeichen/Leerschläge am Ende\n und am Anfang eines Strings entfernt werden?')
input()
print('Mit string.strip(), string.lstrip() und string.rstrip()')
print('')
input()
|
class Profile:
def __init__(self, id, username, email, allowed_buy,
first_name, last_name, is_staff, is_current, **kwargs):
self.id = id
self.user_name = username
self.email = email
self.allowed_buy = allowed_buy
self.first_name = first_name
self.last_name = last_name
self.is_staff = is_staff
self.is_current = is_current
@property
def name(self):
name = ''
if len(self.first_name) > 0:
name += self.first_name
if len(self.last_name) > 0:
name += ' ' + self.last_name
if len(name) == 0:
name += self.user_name
return name
class Product:
def __init__(self, id, name, quantity, price_cent, displayed, **kwargs):
self.id = id
self.name = name
self.quantity = quantity
self.price_cent = price_cent
self.displayed = displayed
class SaleEntry:
def __init__(self, id, profile, product, date, **kwargs):
self.id = id
self.profile = profile
self.product = product
self.date = date
class Event:
def __init__(self, id, name, price_group, active, **kwargs):
self.id = id
self.name = name
self.price_group = price_group
self.active = active
class Comment:
def __init__(self, profile, comment, **kwargs):
self.profile = profile
self.comment = comment
|
#!/usr/bin/env python
class Graph:
def __init__(self, n, edges):
# n is the number of vertices
# edges is a list of tuples which represents one edge
self.n = n
self.V = set(list(range(n)))
self.E = [set() for i in range(n)]
for e in edges:
v, w = e
self.E[v].add(w)
self.E[w].add(v)
def __str__(self):
ret = ''
ret += 'There are %d vertices.\n' % self.n
for v in self.V:
ret += 'Vertex %d has edges to: %s\n' % (v, self.E[v])
return ret
if __name__ == '__main__':
n = 4
edges = [[1, 0], [1, 2], [1, 3]]
g1 = Graph(n, edges)
n = 6
edges = [[0, 3], [1, 3], [2, 3], [4, 3], [5, 4]]
g2 = Graph(n, edges)
print(g1)
print(g2)
|
'''
Adapt the code from one of the functions above to create a new function called 'multiplier'.
The user should be able to input two numbers that are stored in variables.
The function should multiply the two variables together and return the result to a variable in the main program.
The main program should output the variable containing the result returned from the function.
'''
input_one= int(input("enter a number "))
input_two= int(input("enter another number "))
def multiplier():
return input_one * input_two
output_num = multiplier()
print(output_num)
|
my_dictionary={
'nama': 'Elyas',
'usia': 19,
'status': 'mahasiswa'
}
my_dictionary["usia"]=20
print(my_dictionary)
|
"""
n = 4
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
count: i + 1
f(i, j) = i (i + 1) / 2 + 1 + j
1 + 2 + 3 + 4 + ... + n = n (n + 1) / 2
"""
n = int(input())
# k = 1
# for i in range(n):
# for _ in range(i + 1):
# print(k, end=' ')
# k += 1
# print()
"""
Time Complexity: O(n^2)
Space Complexity: O(1)
"""
for i in range(n):
for j in range(i + 1):
print(i * (i + 1) // 2 + 1 + j, end=' ')
print()
|
#!/usr/bin/env python3
#encoding=utf-8
#------------------------------------------------
# Usage: python3 3-decorator2.py
# Description: Tracer call with key-word only
#------------------------------------------------
class Tracer: # state via instance attributes
def __init__(self, func): # on @ decorator
self.func = func
self.calls = 0 # save func for later call
def __call__(self, *args, **kwargs):
self.calls += 1
print('call %s to %s' % (self.calls, self.func.__name__))
return self.func(*args, **kwargs)
@Tracer
def spam(a, b, c): # Same as: spam = Tracer(spam)
print(a + b + c) # Triggers Tracer.__init__
@Tracer
def eggs(x, y): # Same as: eggs = Tracer(eggs)
print(x ** y) # Wrap eggs in Tracer object
if __name__ == '__main__':
spam(1, 2, 3) # Really calls Tracer instance: runs tracer.__call__
spam(a=4, b=5, c=6) # spam is an instance attribute
eggs(2, 16) # Really calls Tracer instance, self.func is eggs
eggs(4, y=7) # self.calls is per-decoration here
|
# -*- coding: utf-8 -*-
'''
File name: code\counting_the_number_of_hollow_square_laminae_that_can_form_one_two_three__distinct_arrangements\sol_174.py
Author: Vaidic Joshi
Date created: Oct 20, 2018
Python Version: 3.x
'''
# Solution to Project Euler Problem #174 :: Counting the number of "hollow" square laminae that can form one, two, three, ... distinct arrangements
#
# For more information see:
# https://projecteuler.net/problem=174
# Problem Statement
'''
We shall define a square lamina to be a square outline with a square "hole" so that the shape possesses vertical and horizontal symmetry.
Given eight tiles it is possible to form a lamina in only one way: 3x3 square with a 1x1 hole in the middle. However, using thirty-two tiles it is possible to form two distinct laminae.
If t represents the number of tiles used, we shall say that t = 8 is type L(1) and t = 32 is type L(2).
Let N(n) be the number of t ≤ 1000000 such that t is type L(n); for example, N(15) = 832.
What is ∑ N(n) for 1 ≤ n ≤ 10?
'''
# Solution
# Solution Approach
'''
'''
|
"""
The `~certbot_dns_google.dns_google` plugin automates the process of
completing a ``dns-01`` challenge (`~acme.challenges.DNS01`) by creating, and
subsequently removing, TXT records using the Google Cloud DNS API.
Named Arguments
---------------
======================================== =====================================
``--dns-google-credentials`` Google Cloud Platform credentials_
JSON file.
(Required - Optional on Google Compute Engine)
``--dns-google-propagation-seconds`` The number of seconds to wait for DNS
to propagate before asking the ACME
server to verify the DNS record.
(Default: 60)
======================================== =====================================
Credentials
-----------
Use of this plugin requires Google Cloud Platform API credentials
for an account with the following permissions:
* ``dns.changes.create``
* ``dns.changes.get``
* ``dns.managedZones.list``
* ``dns.resourceRecordSets.create``
* ``dns.resourceRecordSets.delete``
Google provides instructions for `creating a service account <https://developers
.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount>`_ and
`information about the required permissions <https://cloud.google.com/dns/access
-control#permissions_and_roles>`_. If you're running on Google Compute Engine,
you can `assign the service account to the instance <https://cloud.google.com/
compute/docs/access/create-enable-service-accounts-for-instances>`_ which
is running certbot. A credentials file is not required in this case, as they
are automatically obtained by certbot through the `metadata service
<https://cloud.google.com/compute/docs/storing-retrieving-metadata>`_ .
.. code-block:: json
:name: credentials.json
:caption: Example credentials file:
{
"type": "service_account",
...
}
The path to this file can be provided interactively or using the
``--dns-google-credentials`` command-line argument. Certbot records the path
to this file for use during renewal, but does not store the file's contents.
.. caution::
You should protect these API credentials as you would a password. Users who
can read this file can use these credentials to issue some types of API calls
on your behalf, limited by the permissions assigned to the account. Users who
can cause Certbot to run using these credentials can complete a ``dns-01``
challenge to acquire new certificates or revoke existing certificates for
domains these credentials are authorized to manage.
Certbot will emit a warning if it detects that the credentials file can be
accessed by other users on your system. The warning reads "Unsafe permissions
on credentials configuration file", followed by the path to the credentials
file. This warning will be emitted each time Certbot uses the credentials file,
including for renewal, and cannot be silenced except by addressing the issue
(e.g., by using a command like ``chmod 600`` to restrict access to the file).
Examples
--------
.. code-block:: bash
:caption: To acquire a certificate for ``example.com``
certbot certonly \\
--dns-google \\
--dns-google-credentials ~/.secrets/certbot/google.json \\
-d example.com
.. code-block:: bash
:caption: To acquire a single certificate for both ``example.com`` and
``www.example.com``
certbot certonly \\
--dns-google \\
--dns-google-credentials ~/.secrets/certbot/google.json \\
-d example.com \\
-d www.example.com
.. code-block:: bash
:caption: To acquire a certificate for ``example.com``, waiting 120 seconds
for DNS propagation
certbot certonly \\
--dns-google \\
--dns-google-credentials ~/.secrets/certbot/google.ini \\
--dns-google-propagation-seconds 120 \\
-d example.com
"""
|
"""Constants for the Subaru integration."""
DOMAIN = "subaru"
FETCH_INTERVAL = 300
UPDATE_INTERVAL = 7200
CONF_UPDATE_ENABLED = "update_enabled"
CONF_COUNTRY = "country"
# entry fields
ENTRY_CONTROLLER = "controller"
ENTRY_COORDINATOR = "coordinator"
ENTRY_VEHICLES = "vehicles"
# update coordinator name
COORDINATOR_NAME = "subaru_data"
# info fields
VEHICLE_VIN = "vin"
VEHICLE_NAME = "display_name"
VEHICLE_HAS_EV = "is_ev"
VEHICLE_API_GEN = "api_gen"
VEHICLE_HAS_REMOTE_START = "has_res"
VEHICLE_HAS_REMOTE_SERVICE = "has_remote"
VEHICLE_HAS_SAFETY_SERVICE = "has_safety"
VEHICLE_LAST_UPDATE = "last_update"
VEHICLE_STATUS = "status"
API_GEN_1 = "g1"
API_GEN_2 = "g2"
MANUFACTURER = "Subaru Corp."
SUPPORTED_PLATFORMS = [
"sensor",
]
ICONS = {
"Avg Fuel Consumption": "mdi:leaf",
"EV Time to Full Charge": "mdi:car-electric",
"EV Range": "mdi:ev-station",
"Odometer": "mdi:road-variant",
"Range": "mdi:gas-station",
"Tire Pressure FL": "mdi:gauge",
"Tire Pressure FR": "mdi:gauge",
"Tire Pressure RL": "mdi:gauge",
"Tire Pressure RR": "mdi:gauge",
}
|
# Faça um programa que leia três números e mostre
# qual é o Maior e qual é o Menor.
a = int(input('\033[34;43mPrimeiro valor:\033[m '))
b = int(input('\033[32;44mSegundo valor:\033[m '))
c = int(input('\033[32;47mTerceiro valor:\033[m '))
# Verificando quem é o menor
menor = a
if b < a and b < c:
menor = b
if c < a and c < b:
menor = c
# Verificando quem é o maior
maior = a
if b > a and b > c:
maior = b
if c > a and c > b:
maior = c
print(f'\033[44mO menor valor digitado foi\033[m\033[4;33;41m {menor} \033[m')
print(f'\033[45mO maior valor digitado foi\033[m \033[4;31;43m {maior} \033[m')
'''Alternativa01
if a<b and a<c:
menor = a
if b<a and b<c:
menor = b
if c<a and c<b:
menor = c
'''
|
# Enter your code here. Read input from STDIN. Print output to STDOUT
class TwoStackQueue:
def __init__(self):
self.forward_stack = []
self.reverse_stack = []
def dequeue(self):
if not self.reverse_stack:
while self.forward_stack:
self.reverse_stack.append(self.forward_stack.pop())
return self.reverse_stack.pop()
def enqueue(self, element):
self.forward_stack.append(element)
def front(self):
front = self.dequeue()
# adding back to reverse as we only need to seek the front element
self.reverse_stack.append(front)
return front
def main():
queue = TwoStackQueue()
n = int(input())
for i in range(n):
query_input = input().split()
query_type = int(query_input[0])
if query_type == 1:
queue.enqueue(int(query_input[1]))
elif query_type == 2:
queue.dequeue()
elif query_type == 3:
print(queue.front())
else:
raise Exception("invalid input")
main()
|
##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""ZODB connection registry
"""
class ConnectionRegistry:
'''ZODB connection registry
This registry can hold either ZODB.Connection objects or OFS.Application
objects. In the latter case, a close operation will close the REQUEST as
well as the Connection referenced by the Application's _p_jar attribute.
'''
def __init__(self):
self._conns = []
def register(self, conn):
self._conns.append(conn)
def contains(self, conn):
return conn in self._conns
def __len__(self):
return len(self._conns)
def count(self):
return len(self)
def close(self, conn):
if self.contains(conn):
self._conns.remove(conn)
self._do_close(conn)
def closeAll(self):
for conn in self._conns:
self._do_close(conn)
self._conns = []
def _do_close(self, conn):
if hasattr(conn, 'close'):
conn.close()
else:
conn.REQUEST.close()
conn._p_jar.close()
registry = ConnectionRegistry()
register = registry.register
contains = registry.contains
count = registry.count
close = registry.close
closeAll = registry.closeAll
|
N, K = map(int, input().split())
result = 0
while N != 0:
result += 1
N //= K
print(result)
|
EXPECTED_SECRETS = [
"EQ_SERVER_SIDE_STORAGE_USER_ID_SALT",
"EQ_SERVER_SIDE_STORAGE_USER_IK_SALT",
"EQ_SERVER_SIDE_STORAGE_ENCRYPTION_USER_PEPPER",
"EQ_SECRET_KEY",
"EQ_RABBITMQ_USERNAME",
"EQ_RABBITMQ_PASSWORD",
]
def validate_required_secrets(secrets):
for required_secret in EXPECTED_SECRETS:
if required_secret not in secrets["secrets"]:
raise Exception("Missing Secret [{}]".format(required_secret))
class SecretStore:
def __init__(self, secrets):
self.secrets = secrets.get("secrets", {})
def get_secret_by_name(self, secret_name):
return self.secrets.get(secret_name)
|
"""Top-level package for NEMO CF."""
__author__ = """Willi Rath"""
__email__ = 'wrath@geomar.de'
__version__ = '0.1.0'
|
{
"targets": [{
"target_name": "fuse",
"include_dirs": [
"<!(node -e \"require('napi-macros')\")",
"<!(node -e \"require('fuse-shared-library/include')\")",
],
"libraries": [
"<!(node -e \"require('fuse-shared-library/lib')\")",
],
"sources": [
"fuse-native.c"
],
'xcode_settings': {
'OTHER_CFLAGS': [
'-g',
'-O3',
'-Wall'
]
},
'cflags': [
'-g',
'-O3',
'-Wall'
],
}, {
"target_name": "postinstall",
"type": "none",
"dependencies": ["fuse"],
"copies": [{
"destination": "build/Release",
"files": [ "<!(node -e \"require('fuse-shared-library/lib')\")" ],
}]
}]
}
|
def split_list(list, n):
target_list = []
cut = int(len(list) / n)
if cut == 0:
list = [[x] for x in list]
none_array = [[] for i in range(0, n - len(list))]
return list + none_array
for i in range(0, n - 1):
target_list.append(list[cut * i:cut * (1 + i)])
target_list.append(list[cut * (n - 1):len(list)])
return target_list
if __name__ == '__main__':
list = [x for x in range(1040)]
result = split_list(list, 50)
print(result)
|
#
# This file contains the Python code from Program 15.18 of
# "Data Structures and Algorithms
# with Object-Oriented Design Patterns in Python"
# by Bruno R. Preiss.
#
# Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved.
#
# http://www.brpreiss.com/books/opus7/programs/pgm15_18.txt
#
class RadixSorter(Sorter):
r = 8
R = 1 << r
p = (32 + r - 1) / r
def __init__(self):
self._count = Array(self.R)
self._tempArray = None
# ...
|
# KATA MODULO 07
# EJERCICIO 01
#
# Declara dos variables
planets = []
# Comenzando con las variables que acabas de crear, crearás un ciclo while.
# El ciclo while se ejecutará mientras el new_planet no sea igual a la palabra 'done'.
# Dentro del ciclo, comprobarás si la variable new_planet contiene un valor,
# que debería ser el nombre de un planeta. Esta es una forma rápida de ver si el usuario ha introducido un valor.
# Si lo han hecho, tu código agregará (append) ese valor a la variable planets.
# Finalmente, usarás input para solicitar al usuario que ingrese un nuevo nombre de planeta o que
# escriba done si ha terminado de ingresar nombres de planeta. Almacenará el valor de input en la variable new_planet.
# Escribe el ciclo while solicitado
flagPlanetlanet = True
while flagPlanetlanet == True:
newPlanet = input("Enter the name of the planet: ")
if newPlanet == "done":
flagPlanetlanet = False
break
else:
newPlanet = newPlanet.title()
planets.append(newPlanet)
flagPlanetlanet = True
print(planets)
|
extensions = dict(
required_params=[], # empty to override defaults in gen_defaults
validate_required_params="""
# Required args: either model_key or path
if (is.null(model_key) && is.null(path)) stop("argument 'model_key' or 'path' must be provided")
""",
set_required_params="",
)
doc = dict(
preamble="""
Imports a generic model into H2O. Such model can be used then used for scoring and obtaining
additional information about the model. The imported model has to be supported by H2O.
""",
examples="""
# library(h2o)
# h2o.init()
# generic_model <- h2o.genericModel(path="/path/to/model.zip", model_id="my_model")
# predictions <- h2o.predict(generic_model, dataset)
"""
)
|
somthing = 'F5fjDxitafeZwPdwsmBL-Q'
key_api = 'MiT75-jn5D_6MENzkehT5EReeVdYhp_86hQKYQp-3o10wIVXAbOakIT6khg8Y-_PBiy2fKPuAQFp9x7W80Ubn3xdiS8eCfy-nc7qtLNvs6oyAzdU2CsCRHEniyJUYHYx'
|
"""
link: https://leetcode.com/problems/evaluate-division
problem: 离线解不定方程,给定 a/b=x1 , b/c=x2, 求解 a/c
solution: 询问较多,用字典预算出所有可能的组合,时间复杂度O(n^2),将每个结果尝试相乘或相除看能否得到新的组合。
"""
class Solution:
def calcEquation(self, equations: List[List[str]], values: List[float], queries: List[List[str]]) -> List[float]:
q, v = [], {}
for i in range(len(equations)):
t = (equations[i][0], equations[i][1], values[i])
q.append(t)
while q:
k = q.pop()
t = {}
v[(k[0], k[1])] = k[2]
for x in v:
if x[0] == k[0]:
t[(x[1], k[1])] = k[2] / v[x]
if x[0] == k[1]:
t[(k[0], x[1])] = k[2] * v[x]
if x[1] == k[1]:
t[(x[0], k[0])] = v[x] / k[2]
if x[1] == k[0]:
t[(x[0], k[1])] = v[x] * k[2]
for x in t:
tt = (x[0], x[1], t[x])
if (x[0], x[1]) not in v and (x[1], x[0]) not in v:
q.append(tt)
res = []
for x in queries:
if (x[0], x[1]) in v:
res.append(v[(x[0], x[1])])
elif (x[1], x[0]) in v:
res.append(1 / v[(x[1], x[0])])
else:
res.append(-1.0)
return res
|
class ListView(Control,IComponent,IDisposable,IOleControl,IOleObject,IOleInPlaceObject,IOleInPlaceActiveObject,IOleWindow,IViewObject,IViewObject2,IPersist,IPersistStreamInit,IPersistPropertyBag,IPersistStorage,IQuickActivate,ISupportOleDropSource,IDropTarget,ISynchronizeInvoke,IWin32Window,IArrangedElement,IBindableComponent):
"""
Represents a Windows list view control,which displays a collection of items that can be displayed using one of four different views.
ListView()
"""
def AccessibilityNotifyClients(self,*args):
"""
AccessibilityNotifyClients(self: Control,accEvent: AccessibleEvents,objectID: int,childID: int)
Notifies the accessibility client applications of the specified
System.Windows.Forms.AccessibleEvents for the specified child control .
accEvent: The System.Windows.Forms.AccessibleEvents to notify the accessibility client applications of.
objectID: The identifier of the System.Windows.Forms.AccessibleObject.
childID: The child System.Windows.Forms.Control to notify of the accessible event.
AccessibilityNotifyClients(self: Control,accEvent: AccessibleEvents,childID: int)
Notifies the accessibility client applications of the specified
System.Windows.Forms.AccessibleEvents for the specified child control.
accEvent: The System.Windows.Forms.AccessibleEvents to notify the accessibility client applications of.
childID: The child System.Windows.Forms.Control to notify of the accessible event.
"""
pass
def ArrangeIcons(self,value=None):
"""
ArrangeIcons(self: ListView)
Arranges items in the control when they are displayed as icons based on the value of the
System.Windows.Forms.ListView.Alignment property.
ArrangeIcons(self: ListView,value: ListViewAlignment)
Arranges items in the control when they are displayed as icons with a specified alignment
setting.
value: One of the System.Windows.Forms.ListViewAlignment values.
"""
pass
def AutoResizeColumn(self,columnIndex,headerAutoResize):
"""
AutoResizeColumn(self: ListView,columnIndex: int,headerAutoResize: ColumnHeaderAutoResizeStyle)
Resizes the width of the given column as indicated by the resize style.
columnIndex: The zero-based index of the column to resize.
headerAutoResize: One of the System.Windows.Forms.ColumnHeaderAutoResizeStyle values.
"""
pass
def AutoResizeColumns(self,headerAutoResize):
"""
AutoResizeColumns(self: ListView,headerAutoResize: ColumnHeaderAutoResizeStyle)
Resizes the width of the columns as indicated by the resize style.
headerAutoResize: One of the System.Windows.Forms.ColumnHeaderAutoResizeStyle values.
"""
pass
def BeginUpdate(self):
"""
BeginUpdate(self: ListView)
Prevents the control from drawing until the System.Windows.Forms.ListView.EndUpdate method is
called.
"""
pass
def Clear(self):
"""
Clear(self: ListView)
Removes all items and columns from the control.
"""
pass
def CreateAccessibilityInstance(self,*args):
"""
CreateAccessibilityInstance(self: Control) -> AccessibleObject
Creates a new accessibility object for the control.
Returns: A new System.Windows.Forms.AccessibleObject for the control.
"""
pass
def CreateControlsInstance(self,*args):
"""
CreateControlsInstance(self: Control) -> ControlCollection
Creates a new instance of the control collection for the control.
Returns: A new instance of System.Windows.Forms.Control.ControlCollection assigned to the control.
"""
pass
def CreateHandle(self,*args):
""" CreateHandle(self: ListView) """
pass
def DefWndProc(self,*args):
"""
DefWndProc(self: Control,m: Message) -> Message
Sends the specified message to the default window procedure.
m: The Windows System.Windows.Forms.Message to process.
"""
pass
def DestroyHandle(self,*args):
"""
DestroyHandle(self: Control)
Destroys the handle associated with the control.
"""
pass
def Dispose(self):
"""
Dispose(self: ListView,disposing: bool)
Releases the unmanaged resources used by the System.Windows.Forms.ListView and optionally
releases the managed resources.
disposing: true to release both managed and unmanaged resources; false to release only unmanaged resources.
"""
pass
def EndUpdate(self):
"""
EndUpdate(self: ListView)
Resumes drawing of the list view control after drawing is suspended by the
System.Windows.Forms.ListView.BeginUpdate method.
"""
pass
def EnsureVisible(self,index):
"""
EnsureVisible(self: ListView,index: int)
Ensures that the specified item is visible within the control,scrolling the contents of the
control if necessary.
index: The zero-based index of the item to scroll into view.
"""
pass
def FindItemWithText(self,text,includeSubItemsInSearch=None,startIndex=None,isPrefixSearch=None):
"""
FindItemWithText(self: ListView,text: str,includeSubItemsInSearch: bool,startIndex: int,isPrefixSearch: bool) -> ListViewItem
Finds the first System.Windows.Forms.ListViewItem or
System.Windows.Forms.ListViewItem.ListViewSubItem,if indicated,that begins with the specified
text value. The search starts at the specified index.
text: The text to search for.
includeSubItemsInSearch: true to include subitems in the search; otherwise,false.
startIndex: The index of the item at which to start the search.
isPrefixSearch: true to allow partial matches; otherwise,false.
Returns: The first System.Windows.Forms.ListViewItem that begins with the specified text value.
FindItemWithText(self: ListView,text: str,includeSubItemsInSearch: bool,startIndex: int) -> ListViewItem
Finds the first System.Windows.Forms.ListViewItem or
System.Windows.Forms.ListViewItem.ListViewSubItem,if indicated,that begins with the specified
text value. The search starts at the specified index.
text: The text to search for.
includeSubItemsInSearch: true to include subitems in the search; otherwise,false.
startIndex: The index of the item at which to start the search.
Returns: The first System.Windows.Forms.ListViewItem that begins with the specified text value.
FindItemWithText(self: ListView,text: str) -> ListViewItem
Finds the first System.Windows.Forms.ListViewItem that begins with the specified text value.
text: The text to search for.
Returns: The first System.Windows.Forms.ListViewItem that begins with the specified text value.
"""
pass
def FindNearestItem(self,*__args):
"""
FindNearestItem(self: ListView,searchDirection: SearchDirectionHint,x: int,y: int) -> ListViewItem
Finds the next item from the given x- and y-coordinates,searching in the specified direction.
searchDirection: One of the System.Windows.Forms.SearchDirectionHint values.
x: The x-coordinate for the point at which to begin searching.
y: The y-coordinate for the point at which to begin searching.
Returns: The System.Windows.Forms.ListViewItem that is closest to the given coordinates,searching in the
specified direction.
FindNearestItem(self: ListView,dir: SearchDirectionHint,point: Point) -> ListViewItem
Finds the next item from the given point,searching in the specified direction
dir: One of the System.Windows.Forms.SearchDirectionHint values.
point: The point at which to begin searching.
Returns: The System.Windows.Forms.ListViewItem that is closest to the given point,searching in the
specified direction.
"""
pass
def GetAccessibilityObjectById(self,*args):
"""
GetAccessibilityObjectById(self: Control,objectId: int) -> AccessibleObject
Retrieves the specified System.Windows.Forms.AccessibleObject.
objectId: An Int32 that identifies the System.Windows.Forms.AccessibleObject to retrieve.
Returns: An System.Windows.Forms.AccessibleObject.
"""
pass
def GetAutoSizeMode(self,*args):
"""
GetAutoSizeMode(self: Control) -> AutoSizeMode
Retrieves a value indicating how a control will behave when its
System.Windows.Forms.Control.AutoSize property is enabled.
Returns: One of the System.Windows.Forms.AutoSizeMode values.
"""
pass
def GetItemAt(self,x,y):
"""
GetItemAt(self: ListView,x: int,y: int) -> ListViewItem
Retrieves the item at the specified location.
x: The x-coordinate of the location to search for an item (expressed in client coordinates).
y: The y-coordinate of the location to search for an item (expressed in client coordinates).
Returns: A System.Windows.Forms.ListViewItem that represents the item at the specified position. If there
is no item at the specified location,the method returns null.
"""
pass
def GetItemRect(self,index,portion=None):
"""
GetItemRect(self: ListView,index: int,portion: ItemBoundsPortion) -> Rectangle
Retrieves the specified portion of the bounding rectangle for a specific item within the list
view control.
index: The zero-based index of the item within the System.Windows.Forms.ListView.ListViewItemCollection
whose bounding rectangle you want to return.
portion: One of the System.Windows.Forms.ItemBoundsPortion values that represents a portion of the
System.Windows.Forms.ListViewItem for which to retrieve the bounding rectangle.
Returns: A System.Drawing.Rectangle that represents the bounding rectangle for the specified portion of
the specified System.Windows.Forms.ListViewItem.
GetItemRect(self: ListView,index: int) -> Rectangle
Retrieves the bounding rectangle for a specific item within the list view control.
index: The zero-based index of the item within the System.Windows.Forms.ListView.ListViewItemCollection
whose bounding rectangle you want to return.
Returns: A System.Drawing.Rectangle that represents the bounding rectangle of the specified
System.Windows.Forms.ListViewItem.
"""
pass
def GetScaledBounds(self,*args):
"""
GetScaledBounds(self: Control,bounds: Rectangle,factor: SizeF,specified: BoundsSpecified) -> Rectangle
Retrieves the bounds within which the control is scaled.
bounds: A System.Drawing.Rectangle that specifies the area for which to retrieve the display bounds.
factor: The height and width of the control's bounds.
specified: One of the values of System.Windows.Forms.BoundsSpecified that specifies the bounds of the
control to use when defining its size and position.
Returns: A System.Drawing.Rectangle representing the bounds within which the control is scaled.
"""
pass
def GetService(self,*args):
"""
GetService(self: Component,service: Type) -> object
Returns an object that represents a service provided by the System.ComponentModel.Component or
by its System.ComponentModel.Container.
service: A service provided by the System.ComponentModel.Component.
Returns: An System.Object that represents a service provided by the System.ComponentModel.Component,or
null if the System.ComponentModel.Component does not provide the specified service.
"""
pass
def GetStyle(self,*args):
"""
GetStyle(self: Control,flag: ControlStyles) -> bool
Retrieves the value of the specified control style bit for the control.
flag: The System.Windows.Forms.ControlStyles bit to return the value from.
Returns: true if the specified control style bit is set to true; otherwise,false.
"""
pass
def GetTopLevel(self,*args):
"""
GetTopLevel(self: Control) -> bool
Determines if the control is a top-level control.
Returns: true if the control is a top-level control; otherwise,false.
"""
pass
def HitTest(self,*__args):
"""
HitTest(self: ListView,x: int,y: int) -> ListViewHitTestInfo
Provides item information,given x- and y-coordinates.
x: The x-coordinate at which to retrieve the item information. The coordinate is relative to the
upper-left corner of the control.
y: The y-coordinate at which to retrieve the item information. The coordinate is relative to the
upper-left corner of the control.
Returns: A System.Windows.Forms.ListViewHitTestInfo.
HitTest(self: ListView,point: Point) -> ListViewHitTestInfo
Provides item information,given a point.
point: The System.Drawing.Point at which to retrieve the item information. The coordinates are relative
to the upper-left corner of the control.
Returns: A System.Windows.Forms.ListViewHitTestInfo.
"""
pass
def InitLayout(self,*args):
"""
InitLayout(self: Control)
Called after the control has been added to another container.
"""
pass
def InvokeGotFocus(self,*args):
"""
InvokeGotFocus(self: Control,toInvoke: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.GotFocus event for the specified control.
toInvoke: The System.Windows.Forms.Control to assign the event to.
e: An System.EventArgs that contains the event data.
"""
pass
def InvokeLostFocus(self,*args):
"""
InvokeLostFocus(self: Control,toInvoke: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.LostFocus event for the specified control.
toInvoke: The System.Windows.Forms.Control to assign the event to.
e: An System.EventArgs that contains the event data.
"""
pass
def InvokeOnClick(self,*args):
"""
InvokeOnClick(self: Control,toInvoke: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.Click event for the specified control.
toInvoke: The System.Windows.Forms.Control to assign the System.Windows.Forms.Control.Click event to.
e: An System.EventArgs that contains the event data.
"""
pass
def InvokePaint(self,*args):
"""
InvokePaint(self: Control,c: Control,e: PaintEventArgs)
Raises the System.Windows.Forms.Control.Paint event for the specified control.
c: The System.Windows.Forms.Control to assign the System.Windows.Forms.Control.Paint event to.
e: An System.Windows.Forms.PaintEventArgs that contains the event data.
"""
pass
def InvokePaintBackground(self,*args):
"""
InvokePaintBackground(self: Control,c: Control,e: PaintEventArgs)
Raises the PaintBackground event for the specified control.
c: The System.Windows.Forms.Control to assign the System.Windows.Forms.Control.Paint event to.
e: An System.Windows.Forms.PaintEventArgs that contains the event data.
"""
pass
def IsInputChar(self,*args):
"""
IsInputChar(self: Control,charCode: Char) -> bool
Determines if a character is an input character that the control recognizes.
charCode: The character to test.
Returns: true if the character should be sent directly to the control and not preprocessed; otherwise,
false.
"""
pass
def IsInputKey(self,*args):
"""
IsInputKey(self: ListView,keyData: Keys) -> bool
keyData: One of the System.Windows.Forms.Keys values.
Returns: true if the specified key is a regular input key; otherwise,false.
"""
pass
def MemberwiseClone(self,*args):
"""
MemberwiseClone(self: MarshalByRefObject,cloneIdentity: bool) -> MarshalByRefObject
Creates a shallow copy of the current System.MarshalByRefObject object.
cloneIdentity: false to delete the current System.MarshalByRefObject object's identity,which will cause the
object to be assigned a new identity when it is marshaled across a remoting boundary. A value of
false is usually appropriate. true to copy the current System.MarshalByRefObject object's
identity to its clone,which will cause remoting client calls to be routed to the remote server
object.
Returns: A shallow copy of the current System.MarshalByRefObject object.
MemberwiseClone(self: object) -> object
Creates a shallow copy of the current System.Object.
Returns: A shallow copy of the current System.Object.
"""
pass
def NotifyInvalidate(self,*args):
"""
NotifyInvalidate(self: Control,invalidatedArea: Rectangle)
Raises the System.Windows.Forms.Control.Invalidated event with a specified region of the control
to invalidate.
invalidatedArea: A System.Drawing.Rectangle representing the area to invalidate.
"""
pass
def OnAfterLabelEdit(self,*args):
"""
OnAfterLabelEdit(self: ListView,e: LabelEditEventArgs)
Raises the System.Windows.Forms.ListView.AfterLabelEdit event.
e: A System.Windows.Forms.LabelEditEventArgs that contains the event data.
"""
pass
def OnAutoSizeChanged(self,*args):
"""
OnAutoSizeChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.AutoSizeChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnBackColorChanged(self,*args):
"""
OnBackColorChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.BackColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnBackgroundImageChanged(self,*args):
"""
OnBackgroundImageChanged(self: ListView,e: EventArgs)
Raises the System.Windows.Forms.Control.BackgroundImageChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnBackgroundImageLayoutChanged(self,*args):
"""
OnBackgroundImageLayoutChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.BackgroundImageLayoutChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnBeforeLabelEdit(self,*args):
"""
OnBeforeLabelEdit(self: ListView,e: LabelEditEventArgs)
Raises the System.Windows.Forms.ListView.BeforeLabelEdit event.
e: A System.Windows.Forms.LabelEditEventArgs that contains the event data.
"""
pass
def OnBindingContextChanged(self,*args):
"""
OnBindingContextChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.BindingContextChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnCacheVirtualItems(self,*args):
"""
OnCacheVirtualItems(self: ListView,e: CacheVirtualItemsEventArgs)
Raises the System.Windows.Forms.ListView.CacheVirtualItems event.
e: A System.Windows.Forms.CacheVirtualItemsEventArgs that contains the event data.
"""
pass
def OnCausesValidationChanged(self,*args):
"""
OnCausesValidationChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.CausesValidationChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnChangeUICues(self,*args):
"""
OnChangeUICues(self: Control,e: UICuesEventArgs)
Raises the System.Windows.Forms.Control.ChangeUICues event.
e: A System.Windows.Forms.UICuesEventArgs that contains the event data.
"""
pass
def OnClick(self,*args):
"""
OnClick(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.Click event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnClientSizeChanged(self,*args):
"""
OnClientSizeChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.ClientSizeChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnColumnClick(self,*args):
"""
OnColumnClick(self: ListView,e: ColumnClickEventArgs)
Raises the System.Windows.Forms.ListView.ColumnClick event.
e: A System.Windows.Forms.ColumnClickEventArgs that contains the event data.
"""
pass
def OnColumnReordered(self,*args):
"""
OnColumnReordered(self: ListView,e: ColumnReorderedEventArgs)
Raises the System.Windows.Forms.ListView.ColumnReordered event.
e: The System.Windows.Forms.ColumnReorderedEventArgs that contains the event data.
"""
pass
def OnColumnWidthChanged(self,*args):
"""
OnColumnWidthChanged(self: ListView,e: ColumnWidthChangedEventArgs)
Raises the System.Windows.Forms.ListView.ColumnWidthChanged event.
e: A System.Windows.Forms.ColumnWidthChangedEventArgs that contains the event data.
"""
pass
def OnColumnWidthChanging(self,*args):
"""
OnColumnWidthChanging(self: ListView,e: ColumnWidthChangingEventArgs)
Raises the System.Windows.Forms.ListView.ColumnWidthChanging event.
e: A System.Windows.Forms.ColumnWidthChangingEventArgs that contains the event data.
"""
pass
def OnContextMenuChanged(self,*args):
"""
OnContextMenuChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.ContextMenuChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnContextMenuStripChanged(self,*args):
"""
OnContextMenuStripChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.ContextMenuStripChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnControlAdded(self,*args):
"""
OnControlAdded(self: Control,e: ControlEventArgs)
Raises the System.Windows.Forms.Control.ControlAdded event.
e: A System.Windows.Forms.ControlEventArgs that contains the event data.
"""
pass
def OnControlRemoved(self,*args):
"""
OnControlRemoved(self: Control,e: ControlEventArgs)
Raises the System.Windows.Forms.Control.ControlRemoved event.
e: A System.Windows.Forms.ControlEventArgs that contains the event data.
"""
pass
def OnCreateControl(self,*args):
"""
OnCreateControl(self: Control)
Raises the System.Windows.Forms.Control.CreateControl method.
"""
pass
def OnCursorChanged(self,*args):
"""
OnCursorChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.CursorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDockChanged(self,*args):
"""
OnDockChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.DockChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDoubleClick(self,*args):
"""
OnDoubleClick(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.DoubleClick event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDpiChangedAfterParent(self,*args):
""" OnDpiChangedAfterParent(self: Control,e: EventArgs) """
pass
def OnDpiChangedBeforeParent(self,*args):
""" OnDpiChangedBeforeParent(self: Control,e: EventArgs) """
pass
def OnDragDrop(self,*args):
"""
OnDragDrop(self: Control,drgevent: DragEventArgs)
Raises the System.Windows.Forms.Control.DragDrop event.
drgevent: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def OnDragEnter(self,*args):
"""
OnDragEnter(self: Control,drgevent: DragEventArgs)
Raises the System.Windows.Forms.Control.DragEnter event.
drgevent: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def OnDragLeave(self,*args):
"""
OnDragLeave(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.DragLeave event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDragOver(self,*args):
"""
OnDragOver(self: Control,drgevent: DragEventArgs)
Raises the System.Windows.Forms.Control.DragOver event.
drgevent: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def OnDrawColumnHeader(self,*args):
"""
OnDrawColumnHeader(self: ListView,e: DrawListViewColumnHeaderEventArgs)
Raises the System.Windows.Forms.ListView.DrawColumnHeader event.
e: A System.Windows.Forms.DrawListViewColumnHeaderEventArgs that contains the event data.
"""
pass
def OnDrawItem(self,*args):
"""
OnDrawItem(self: ListView,e: DrawListViewItemEventArgs)
Raises the System.Windows.Forms.ListView.DrawItem event.
e: A System.Windows.Forms.DrawListViewItemEventArgs that contains the event data.
"""
pass
def OnDrawSubItem(self,*args):
"""
OnDrawSubItem(self: ListView,e: DrawListViewSubItemEventArgs)
Raises the System.Windows.Forms.ListView.DrawSubItem event.
e: A System.Windows.Forms.DrawListViewSubItemEventArgs that contains the event data.
"""
pass
def OnEnabledChanged(self,*args):
"""
OnEnabledChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.EnabledChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnEnter(self,*args):
"""
OnEnter(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.Enter event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnFontChanged(self,*args):
"""
OnFontChanged(self: ListView,e: EventArgs)
Raises the FontChanged event.
e: The System.EventArgs that contains the event data.
"""
pass
def OnForeColorChanged(self,*args):
"""
OnForeColorChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.ForeColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnGiveFeedback(self,*args):
"""
OnGiveFeedback(self: Control,gfbevent: GiveFeedbackEventArgs)
Raises the System.Windows.Forms.Control.GiveFeedback event.
gfbevent: A System.Windows.Forms.GiveFeedbackEventArgs that contains the event data.
"""
pass
def OnGotFocus(self,*args):
"""
OnGotFocus(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.GotFocus event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnHandleCreated(self,*args):
"""
OnHandleCreated(self: ListView,e: EventArgs)
e: An System.EventArgs that contains the event data.
"""
pass
def OnHandleDestroyed(self,*args):
"""
OnHandleDestroyed(self: ListView,e: EventArgs)
e: An System.EventArgs that contains the event data.
"""
pass
def OnHelpRequested(self,*args):
"""
OnHelpRequested(self: Control,hevent: HelpEventArgs)
Raises the System.Windows.Forms.Control.HelpRequested event.
hevent: A System.Windows.Forms.HelpEventArgs that contains the event data.
"""
pass
def OnImeModeChanged(self,*args):
"""
OnImeModeChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.ImeModeChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnInvalidated(self,*args):
"""
OnInvalidated(self: Control,e: InvalidateEventArgs)
Raises the System.Windows.Forms.Control.Invalidated event.
e: An System.Windows.Forms.InvalidateEventArgs that contains the event data.
"""
pass
def OnItemActivate(self,*args):
"""
OnItemActivate(self: ListView,e: EventArgs)
Raises the System.Windows.Forms.ListView.ItemActivate event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnItemCheck(self,*args):
"""
OnItemCheck(self: ListView,ice: ItemCheckEventArgs)
Raises the System.Windows.Forms.ListView.ItemCheck event.
ice: An System.Windows.Forms.ItemCheckEventArgs that contains the event data.
"""
pass
def OnItemChecked(self,*args):
"""
OnItemChecked(self: ListView,e: ItemCheckedEventArgs)
Raises the System.Windows.Forms.ListView.ItemChecked event.
e: An System.Windows.Forms.ItemCheckedEventArgs that contains the event data.
"""
pass
def OnItemDrag(self,*args):
"""
OnItemDrag(self: ListView,e: ItemDragEventArgs)
Raises the System.Windows.Forms.ListView.ItemDrag event.
e: An System.Windows.Forms.ItemDragEventArgs that contains the event data.
"""
pass
def OnItemMouseHover(self,*args):
"""
OnItemMouseHover(self: ListView,e: ListViewItemMouseHoverEventArgs)
Raises the System.Windows.Forms.ListView.ItemMouseHover event.
e: A System.Windows.Forms.ListViewItemMouseHoverEventArgs that contains the event data.
"""
pass
def OnItemSelectionChanged(self,*args):
"""
OnItemSelectionChanged(self: ListView,e: ListViewItemSelectionChangedEventArgs)
Raises the System.Windows.Forms.ListView.ItemSelectionChanged event.
e: A System.Windows.Forms.ListViewItemSelectionChangedEventArgs that contains the event data.
"""
pass
def OnKeyDown(self,*args):
"""
OnKeyDown(self: Control,e: KeyEventArgs)
Raises the System.Windows.Forms.Control.KeyDown event.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
"""
pass
def OnKeyPress(self,*args):
"""
OnKeyPress(self: Control,e: KeyPressEventArgs)
Raises the System.Windows.Forms.Control.KeyPress event.
e: A System.Windows.Forms.KeyPressEventArgs that contains the event data.
"""
pass
def OnKeyUp(self,*args):
"""
OnKeyUp(self: Control,e: KeyEventArgs)
Raises the System.Windows.Forms.Control.KeyUp event.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
"""
pass
def OnLayout(self,*args):
"""
OnLayout(self: Control,levent: LayoutEventArgs)
Raises the System.Windows.Forms.Control.Layout event.
levent: A System.Windows.Forms.LayoutEventArgs that contains the event data.
"""
pass
def OnLeave(self,*args):
"""
OnLeave(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.Leave event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnLocationChanged(self,*args):
"""
OnLocationChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.LocationChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnLostFocus(self,*args):
"""
OnLostFocus(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.LostFocus event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMarginChanged(self,*args):
"""
OnMarginChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.MarginChanged event.
e: A System.EventArgs that contains the event data.
"""
pass
def OnMouseCaptureChanged(self,*args):
"""
OnMouseCaptureChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.MouseCaptureChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseClick(self,*args):
"""
OnMouseClick(self: Control,e: MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseClick event.
e: An System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMouseDoubleClick(self,*args):
"""
OnMouseDoubleClick(self: Control,e: MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseDoubleClick event.
e: An System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMouseDown(self,*args):
"""
OnMouseDown(self: Control,e: MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseDown event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMouseEnter(self,*args):
"""
OnMouseEnter(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.MouseEnter event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseHover(self,*args):
"""
OnMouseHover(self: ListView,e: EventArgs)
Raises the System.Windows.Forms.Control.MouseHover event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseLeave(self,*args):
"""
OnMouseLeave(self: ListView,e: EventArgs)
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseMove(self,*args):
"""
OnMouseMove(self: Control,e: MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseMove event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMouseUp(self,*args):
"""
OnMouseUp(self: Control,e: MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseUp event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMouseWheel(self,*args):
"""
OnMouseWheel(self: Control,e: MouseEventArgs)
Raises the System.Windows.Forms.Control.MouseWheel event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMove(self,*args):
"""
OnMove(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.Move event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnNotifyMessage(self,*args):
"""
OnNotifyMessage(self: Control,m: Message)
Notifies the control of Windows messages.
m: A System.Windows.Forms.Message that represents the Windows message.
"""
pass
def OnPaddingChanged(self,*args):
"""
OnPaddingChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.PaddingChanged event.
e: A System.EventArgs that contains the event data.
"""
pass
def OnPaint(self,*args):
"""
OnPaint(self: Control,e: PaintEventArgs)
Raises the System.Windows.Forms.Control.Paint event.
e: A System.Windows.Forms.PaintEventArgs that contains the event data.
"""
pass
def OnPaintBackground(self,*args):
"""
OnPaintBackground(self: Control,pevent: PaintEventArgs)
Paints the background of the control.
pevent: A System.Windows.Forms.PaintEventArgs that contains information about the control to paint.
"""
pass
def OnParentBackColorChanged(self,*args):
"""
OnParentBackColorChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.BackColorChanged event when the
System.Windows.Forms.Control.BackColor property value of the control's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentBackgroundImageChanged(self,*args):
"""
OnParentBackgroundImageChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.BackgroundImageChanged event when the
System.Windows.Forms.Control.BackgroundImage property value of the control's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentBindingContextChanged(self,*args):
"""
OnParentBindingContextChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.BindingContextChanged event when the
System.Windows.Forms.Control.BindingContext property value of the control's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentChanged(self,*args):
"""
OnParentChanged(self: ListView,e: EventArgs)
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentCursorChanged(self,*args):
"""
OnParentCursorChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.CursorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentEnabledChanged(self,*args):
"""
OnParentEnabledChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.EnabledChanged event when the
System.Windows.Forms.Control.Enabled property value of the control's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentFontChanged(self,*args):
"""
OnParentFontChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.FontChanged event when the
System.Windows.Forms.Control.Font property value of the control's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentForeColorChanged(self,*args):
"""
OnParentForeColorChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.ForeColorChanged event when the
System.Windows.Forms.Control.ForeColor property value of the control's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentRightToLeftChanged(self,*args):
"""
OnParentRightToLeftChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.RightToLeftChanged event when the
System.Windows.Forms.Control.RightToLeft property value of the control's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentVisibleChanged(self,*args):
"""
OnParentVisibleChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.VisibleChanged event when the
System.Windows.Forms.Control.Visible property value of the control's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnPreviewKeyDown(self,*args):
"""
OnPreviewKeyDown(self: Control,e: PreviewKeyDownEventArgs)
Raises the System.Windows.Forms.Control.PreviewKeyDown event.
e: A System.Windows.Forms.PreviewKeyDownEventArgs that contains the event data.
"""
pass
def OnPrint(self,*args):
"""
OnPrint(self: Control,e: PaintEventArgs)
Raises the System.Windows.Forms.Control.Paint event.
e: A System.Windows.Forms.PaintEventArgs that contains the event data.
"""
pass
def OnQueryContinueDrag(self,*args):
"""
OnQueryContinueDrag(self: Control,qcdevent: QueryContinueDragEventArgs)
Raises the System.Windows.Forms.Control.QueryContinueDrag event.
qcdevent: A System.Windows.Forms.QueryContinueDragEventArgs that contains the event data.
"""
pass
def OnRegionChanged(self,*args):
"""
OnRegionChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.RegionChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnResize(self,*args):
"""
OnResize(self: ListView,e: EventArgs)
e: An System.EventArgs that contains the event data.
"""
pass
def OnRetrieveVirtualItem(self,*args):
"""
OnRetrieveVirtualItem(self: ListView,e: RetrieveVirtualItemEventArgs)
Raises the System.Windows.Forms.ListView.RetrieveVirtualItem event.
e: A System.Windows.Forms.RetrieveVirtualItemEventArgs that contains the event data.
"""
pass
def OnRightToLeftChanged(self,*args):
"""
OnRightToLeftChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.RightToLeftChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnRightToLeftLayoutChanged(self,*args):
"""
OnRightToLeftLayoutChanged(self: ListView,e: EventArgs)
Raises the System.Windows.Forms.ListView.RightToLeftLayoutChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnSearchForVirtualItem(self,*args):
"""
OnSearchForVirtualItem(self: ListView,e: SearchForVirtualItemEventArgs)
Raises the System.Windows.Forms.ListView.SearchForVirtualItem event.
e: A System.Windows.Forms.SearchForVirtualItemEventArgs that contains the event data.
"""
pass
def OnSelectedIndexChanged(self,*args):
"""
OnSelectedIndexChanged(self: ListView,e: EventArgs)
Raises the System.Windows.Forms.ListView.SelectedIndexChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnSizeChanged(self,*args):
"""
OnSizeChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.SizeChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnStyleChanged(self,*args):
"""
OnStyleChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.StyleChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnSystemColorsChanged(self,*args):
"""
OnSystemColorsChanged(self: ListView,e: EventArgs)
e: An System.EventArgs that contains the event data.
"""
pass
def OnTabIndexChanged(self,*args):
"""
OnTabIndexChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.TabIndexChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnTabStopChanged(self,*args):
"""
OnTabStopChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.TabStopChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnTextChanged(self,*args):
"""
OnTextChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.TextChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnValidated(self,*args):
"""
OnValidated(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.Validated event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnValidating(self,*args):
"""
OnValidating(self: Control,e: CancelEventArgs)
Raises the System.Windows.Forms.Control.Validating event.
e: A System.ComponentModel.CancelEventArgs that contains the event data.
"""
pass
def OnVirtualItemsSelectionRangeChanged(self,*args):
"""
OnVirtualItemsSelectionRangeChanged(self: ListView,e: ListViewVirtualItemsSelectionRangeChangedEventArgs)
Raises the System.Windows.Forms.ListView.VirtualItemsSelectionRangeChanged event.
e: A System.Windows.Forms.ListViewVirtualItemsSelectionRangeChangedEventArgs that contains the
event data.
"""
pass
def OnVisibleChanged(self,*args):
"""
OnVisibleChanged(self: Control,e: EventArgs)
Raises the System.Windows.Forms.Control.VisibleChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def ProcessCmdKey(self,*args):
"""
ProcessCmdKey(self: Control,msg: Message,keyData: Keys) -> (bool,Message)
Processes a command key.
msg: A System.Windows.Forms.Message,passed by reference,that represents the window message to
process.
keyData: One of the System.Windows.Forms.Keys values that represents the key to process.
Returns: true if the character was processed by the control; otherwise,false.
"""
pass
def ProcessDialogChar(self,*args):
"""
ProcessDialogChar(self: Control,charCode: Char) -> bool
Processes a dialog character.
charCode: The character to process.
Returns: true if the character was processed by the control; otherwise,false.
"""
pass
def ProcessDialogKey(self,*args):
"""
ProcessDialogKey(self: Control,keyData: Keys) -> bool
Processes a dialog key.
keyData: One of the System.Windows.Forms.Keys values that represents the key to process.
Returns: true if the key was processed by the control; otherwise,false.
"""
pass
def ProcessKeyEventArgs(self,*args):
"""
ProcessKeyEventArgs(self: Control,m: Message) -> (bool,Message)
Processes a key message and generates the appropriate control events.
m: A System.Windows.Forms.Message,passed by reference,that represents the window message to
process.
Returns: true if the message was processed by the control; otherwise,false.
"""
pass
def ProcessKeyMessage(self,*args):
"""
ProcessKeyMessage(self: Control,m: Message) -> (bool,Message)
Processes a keyboard message.
m: A System.Windows.Forms.Message,passed by reference,that represents the window message to
process.
Returns: true if the message was processed by the control; otherwise,false.
"""
pass
def ProcessKeyPreview(self,*args):
"""
ProcessKeyPreview(self: Control,m: Message) -> (bool,Message)
Previews a keyboard message.
m: A System.Windows.Forms.Message,passed by reference,that represents the window message to
process.
Returns: true if the message was processed by the control; otherwise,false.
"""
pass
def ProcessMnemonic(self,*args):
"""
ProcessMnemonic(self: Control,charCode: Char) -> bool
Processes a mnemonic character.
charCode: The character to process.
Returns: true if the character was processed as a mnemonic by the control; otherwise,false.
"""
pass
def RaiseDragEvent(self,*args):
"""
RaiseDragEvent(self: Control,key: object,e: DragEventArgs)
Raises the appropriate drag event.
key: The event to raise.
e: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def RaiseKeyEvent(self,*args):
"""
RaiseKeyEvent(self: Control,key: object,e: KeyEventArgs)
Raises the appropriate key event.
key: The event to raise.
e: A System.Windows.Forms.KeyEventArgs that contains the event data.
"""
pass
def RaiseMouseEvent(self,*args):
"""
RaiseMouseEvent(self: Control,key: object,e: MouseEventArgs)
Raises the appropriate mouse event.
key: The event to raise.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def RaisePaintEvent(self,*args):
"""
RaisePaintEvent(self: Control,key: object,e: PaintEventArgs)
Raises the appropriate paint event.
key: The event to raise.
e: A System.Windows.Forms.PaintEventArgs that contains the event data.
"""
pass
def RealizeProperties(self,*args):
"""
RealizeProperties(self: ListView)
Initializes the properties of the System.Windows.Forms.ListView control that manage the
appearance of the control.
"""
pass
def RecreateHandle(self,*args):
"""
RecreateHandle(self: Control)
Forces the re-creation of the handle for the control.
"""
pass
def RedrawItems(self,startIndex,endIndex,invalidateOnly):
"""
RedrawItems(self: ListView,startIndex: int,endIndex: int,invalidateOnly: bool)
Forces a range of System.Windows.Forms.ListViewItem objects to be redrawn.
startIndex: The index for the first item in the range to be redrawn.
endIndex: The index for the last item of the range to be redrawn.
invalidateOnly: true to invalidate the range of items; false to invalidate and repaint the items.
"""
pass
def RescaleConstantsForDpi(self,*args):
""" RescaleConstantsForDpi(self: Control,deviceDpiOld: int,deviceDpiNew: int) """
pass
def ResetMouseEventArgs(self,*args):
"""
ResetMouseEventArgs(self: Control)
Resets the control to handle the System.Windows.Forms.Control.MouseLeave event.
"""
pass
def RtlTranslateAlignment(self,*args):
"""
RtlTranslateAlignment(self: Control,align: ContentAlignment) -> ContentAlignment
Converts the specified System.Drawing.ContentAlignment to the appropriate
System.Drawing.ContentAlignment to support right-to-left text.
align: One of the System.Drawing.ContentAlignment values.
Returns: One of the System.Drawing.ContentAlignment values.
RtlTranslateAlignment(self: Control,align: LeftRightAlignment) -> LeftRightAlignment
Converts the specified System.Windows.Forms.LeftRightAlignment to the appropriate
System.Windows.Forms.LeftRightAlignment to support right-to-left text.
align: One of the System.Windows.Forms.LeftRightAlignment values.
Returns: One of the System.Windows.Forms.LeftRightAlignment values.
RtlTranslateAlignment(self: Control,align: HorizontalAlignment) -> HorizontalAlignment
Converts the specified System.Windows.Forms.HorizontalAlignment to the appropriate
System.Windows.Forms.HorizontalAlignment to support right-to-left text.
align: One of the System.Windows.Forms.HorizontalAlignment values.
Returns: One of the System.Windows.Forms.HorizontalAlignment values.
"""
pass
def RtlTranslateContent(self,*args):
"""
RtlTranslateContent(self: Control,align: ContentAlignment) -> ContentAlignment
Converts the specified System.Drawing.ContentAlignment to the appropriate
System.Drawing.ContentAlignment to support right-to-left text.
align: One of the System.Drawing.ContentAlignment values.
Returns: One of the System.Drawing.ContentAlignment values.
"""
pass
def RtlTranslateHorizontal(self,*args):
"""
RtlTranslateHorizontal(self: Control,align: HorizontalAlignment) -> HorizontalAlignment
Converts the specified System.Windows.Forms.HorizontalAlignment to the appropriate
System.Windows.Forms.HorizontalAlignment to support right-to-left text.
align: One of the System.Windows.Forms.HorizontalAlignment values.
Returns: One of the System.Windows.Forms.HorizontalAlignment values.
"""
pass
def RtlTranslateLeftRight(self,*args):
"""
RtlTranslateLeftRight(self: Control,align: LeftRightAlignment) -> LeftRightAlignment
Converts the specified System.Windows.Forms.LeftRightAlignment to the appropriate
System.Windows.Forms.LeftRightAlignment to support right-to-left text.
align: One of the System.Windows.Forms.LeftRightAlignment values.
Returns: One of the System.Windows.Forms.LeftRightAlignment values.
"""
pass
def ScaleControl(self,*args):
"""
ScaleControl(self: Control,factor: SizeF,specified: BoundsSpecified)
Scales a control's location,size,padding and margin.
factor: The factor by which the height and width of the control will be scaled.
specified: A System.Windows.Forms.BoundsSpecified value that specifies the bounds of the control to use
when defining its size and position.
"""
pass
def ScaleCore(self,*args):
"""
ScaleCore(self: Control,dx: Single,dy: Single)
This method is not relevant for this class.
dx: The horizontal scaling factor.
dy: The vertical scaling factor.
"""
pass
def Select(self):
"""
Select(self: Control,directed: bool,forward: bool)
Activates a child control. Optionally specifies the direction in the tab order to select the
control from.
directed: true to specify the direction of the control to select; otherwise,false.
forward: true to move forward in the tab order; false to move backward in the tab order.
"""
pass
def SetAutoSizeMode(self,*args):
"""
SetAutoSizeMode(self: Control,mode: AutoSizeMode)
Sets a value indicating how a control will behave when its System.Windows.Forms.Control.AutoSize
property is enabled.
mode: One of the System.Windows.Forms.AutoSizeMode values.
"""
pass
def SetBoundsCore(self,*args):
"""
SetBoundsCore(self: Control,x: int,y: int,width: int,height: int,specified: BoundsSpecified)
Performs the work of setting the specified bounds of this control.
x: The new System.Windows.Forms.Control.Left property value of the control.
y: The new System.Windows.Forms.Control.Top property value of the control.
width: The new System.Windows.Forms.Control.Width property value of the control.
height: The new System.Windows.Forms.Control.Height property value of the control.
specified: A bitwise combination of the System.Windows.Forms.BoundsSpecified values.
"""
pass
def SetClientSizeCore(self,*args):
"""
SetClientSizeCore(self: Control,x: int,y: int)
Sets the size of the client area of the control.
x: The client area width,in pixels.
y: The client area height,in pixels.
"""
pass
def SetStyle(self,*args):
"""
SetStyle(self: Control,flag: ControlStyles,value: bool)
Sets a specified System.Windows.Forms.ControlStyles flag to either true or false.
flag: The System.Windows.Forms.ControlStyles bit to set.
value: true to apply the specified style to the control; otherwise,false.
"""
pass
def SetTopLevel(self,*args):
"""
SetTopLevel(self: Control,value: bool)
Sets the control as the top-level control.
value: true to set the control as the top-level control; otherwise,false.
"""
pass
def SetVisibleCore(self,*args):
"""
SetVisibleCore(self: Control,value: bool)
Sets the control to the specified visible state.
value: true to make the control visible; otherwise,false.
"""
pass
def SizeFromClientSize(self,*args):
"""
SizeFromClientSize(self: Control,clientSize: Size) -> Size
Determines the size of the entire control from the height and width of its client area.
clientSize: A System.Drawing.Size value representing the height and width of the control's client area.
Returns: A System.Drawing.Size value representing the height and width of the entire control.
"""
pass
def Sort(self):
"""
Sort(self: ListView)
Sorts the items of the list view.
"""
pass
def ToString(self):
"""
ToString(self: ListView) -> str
Returns a string representation of the System.Windows.Forms.ListView control.
Returns: A string that states the control type,the count of items in the System.Windows.Forms.ListView
control,and the type of the first item in the System.Windows.Forms.ListView,if the count is
not 0.
"""
pass
def UpdateBounds(self,*args):
"""
UpdateBounds(self: Control,x: int,y: int,width: int,height: int,clientWidth: int,clientHeight: int)
Updates the bounds of the control with the specified size,location,and client size.
x: The System.Drawing.Point.X coordinate of the control.
y: The System.Drawing.Point.Y coordinate of the control.
width: The System.Drawing.Size.Width of the control.
height: The System.Drawing.Size.Height of the control.
clientWidth: The client System.Drawing.Size.Width of the control.
clientHeight: The client System.Drawing.Size.Height of the control.
UpdateBounds(self: Control,x: int,y: int,width: int,height: int)
Updates the bounds of the control with the specified size and location.
x: The System.Drawing.Point.X coordinate of the control.
y: The System.Drawing.Point.Y coordinate of the control.
width: The System.Drawing.Size.Width of the control.
height: The System.Drawing.Size.Height of the control.
UpdateBounds(self: Control)
Updates the bounds of the control with the current size and location.
"""
pass
def UpdateExtendedStyles(self,*args):
"""
UpdateExtendedStyles(self: ListView)
Updates the extended styles applied to the list view control.
"""
pass
def UpdateStyles(self,*args):
"""
UpdateStyles(self: Control)
Forces the assigned styles to be reapplied to the control.
"""
pass
def UpdateZOrder(self,*args):
"""
UpdateZOrder(self: Control)
Updates the control in its parent's z-order.
"""
pass
def WndProc(self,*args):
"""
WndProc(self: ListView,m: Message) -> Message
Overrides System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message@).
m: The Windows System.Windows.Forms.Message to process.
"""
pass
def __enter__(self,*args):
"""
__enter__(self: IDisposable) -> object
Provides the implementation of __enter__ for objects which implement IDisposable.
"""
pass
def __exit__(self,*args):
"""
__exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object)
Provides the implementation of __exit__ for objects which implement IDisposable.
"""
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __str__(self,*args):
pass
Activation=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the type of action the user must take to activate an item.
Get: Activation(self: ListView) -> ItemActivation
Set: Activation(self: ListView)=value
"""
Alignment=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the alignment of items in the control.
Get: Alignment(self: ListView) -> ListViewAlignment
Set: Alignment(self: ListView)=value
"""
AllowColumnReorder=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the user can drag column headers to reorder columns in the control.
Get: AllowColumnReorder(self: ListView) -> bool
Set: AllowColumnReorder(self: ListView)=value
"""
AutoArrange=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets whether icons are automatically kept arranged.
Get: AutoArrange(self: ListView) -> bool
Set: AutoArrange(self: ListView)=value
"""
BackColor=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the background color.
Get: BackColor(self: ListView) -> Color
Set: BackColor(self: ListView)=value
"""
BackgroundImageLayout=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets an System.Windows.Forms.ImageLayout value.
Get: BackgroundImageLayout(self: ListView) -> ImageLayout
Set: BackgroundImageLayout(self: ListView)=value
"""
BackgroundImageTiled=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the background image of the System.Windows.Forms.ListView should be tiled.
Get: BackgroundImageTiled(self: ListView) -> bool
Set: BackgroundImageTiled(self: ListView)=value
"""
BorderStyle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the border style of the control.
Get: BorderStyle(self: ListView) -> BorderStyle
Set: BorderStyle(self: ListView)=value
"""
CanEnableIme=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the System.Windows.Forms.Control.ImeMode property can be set to an active value,to enable IME support.
"""
CanRaiseEvents=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Determines if events can be raised on the control.
"""
CheckBoxes=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether a check box appears next to each item in the control.
Get: CheckBoxes(self: ListView) -> bool
Set: CheckBoxes(self: ListView)=value
"""
CheckedIndices=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the indexes of the currently checked items in the control.
Get: CheckedIndices(self: ListView) -> CheckedIndexCollection
"""
CheckedItems=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the currently checked items in the control.
Get: CheckedItems(self: ListView) -> CheckedListViewItemCollection
"""
Columns=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the collection of all column headers that appear in the control.
Get: Columns(self: ListView) -> ColumnHeaderCollection
"""
CreateParams=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""This property is not relevant for this class.
"""
DefaultCursor=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the default cursor for the control.
"""
DefaultImeMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the default Input Method Editor (IME) mode supported by the control.
"""
DefaultMargin=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the space,in pixels,that is specified by default between controls.
"""
DefaultMaximumSize=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the length and height,in pixels,that is specified as the default maximum size of a control.
"""
DefaultMinimumSize=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the length and height,in pixels,that is specified as the default minimum size of a control.
"""
DefaultPadding=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the internal spacing,in pixels,of the contents of a control.
"""
DefaultSize=property(lambda self: object(),lambda self,v: None,lambda self: None)
DesignMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value that indicates whether the System.ComponentModel.Component is currently in design mode.
"""
DoubleBuffered=property(lambda self: object(),lambda self,v: None,lambda self: None)
Events=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the list of event handlers that are attached to this System.ComponentModel.Component.
"""
FocusedItem=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the item in the control that currently has focus.
Get: FocusedItem(self: ListView) -> ListViewItem
Set: FocusedItem(self: ListView)=value
"""
FontHeight=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the height of the font of the control.
"""
ForeColor=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the foreground color.
Get: ForeColor(self: ListView) -> Color
Set: ForeColor(self: ListView)=value
"""
FullRowSelect=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether clicking an item selects all its subitems.
Get: FullRowSelect(self: ListView) -> bool
Set: FullRowSelect(self: ListView)=value
"""
GridLines=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether grid lines appear between the rows and columns containing the items and subitems in the control.
Get: GridLines(self: ListView) -> bool
Set: GridLines(self: ListView)=value
"""
Groups=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the collection of System.Windows.Forms.ListViewGroup objects assigned to the control.
Get: Groups(self: ListView) -> ListViewGroupCollection
"""
HeaderStyle=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the column header style.
Get: HeaderStyle(self: ListView) -> ColumnHeaderStyle
Set: HeaderStyle(self: ListView)=value
"""
HideSelection=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the selected item in the control remains highlighted when the control loses focus.
Get: HideSelection(self: ListView) -> bool
Set: HideSelection(self: ListView)=value
"""
HotTracking=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the text of an item or subitem has the appearance of a hyperlink when the mouse pointer passes over it.
Get: HotTracking(self: ListView) -> bool
Set: HotTracking(self: ListView)=value
"""
HoverSelection=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether an item is automatically selected when the mouse pointer remains over the item for a few seconds.
Get: HoverSelection(self: ListView) -> bool
Set: HoverSelection(self: ListView)=value
"""
ImeModeBase=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the IME mode of a control.
"""
InsertionMark=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets an object used to indicate the expected drop location when an item is dragged within a System.Windows.Forms.ListView control.
Get: InsertionMark(self: ListView) -> ListViewInsertionMark
"""
Items=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a collection containing all items in the control.
Get: Items(self: ListView) -> ListViewItemCollection
"""
LabelEdit=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the user can edit the labels of items in the control.
Get: LabelEdit(self: ListView) -> bool
Set: LabelEdit(self: ListView)=value
"""
LabelWrap=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether item labels wrap when items are displayed in the control as icons.
Get: LabelWrap(self: ListView) -> bool
Set: LabelWrap(self: ListView)=value
"""
LargeImageList=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Forms.ImageList to use when displaying items as large icons in the control.
Get: LargeImageList(self: ListView) -> ImageList
Set: LargeImageList(self: ListView)=value
"""
ListViewItemSorter=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the sorting comparer for the control.
Get: ListViewItemSorter(self: ListView) -> IComparer
Set: ListViewItemSorter(self: ListView)=value
"""
MultiSelect=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether multiple items can be selected.
Get: MultiSelect(self: ListView) -> bool
Set: MultiSelect(self: ListView)=value
"""
OwnerDraw=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the System.Windows.Forms.ListView control is drawn by the operating system or by code that you provide.
Get: OwnerDraw(self: ListView) -> bool
Set: OwnerDraw(self: ListView)=value
"""
Padding=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the space between the System.Windows.Forms.ListView control and its contents.
Get: Padding(self: ListView) -> Padding
Set: Padding(self: ListView)=value
"""
RenderRightToLeft=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""This property is now obsolete.
"""
ResizeRedraw=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the control redraws itself when resized.
"""
RightToLeftLayout=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the control is laid out from right to left.
Get: RightToLeftLayout(self: ListView) -> bool
Set: RightToLeftLayout(self: ListView)=value
"""
ScaleChildren=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value that determines the scaling of child controls.
"""
Scrollable=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether a scroll bar is added to the control when there is not enough room to display all items.
Get: Scrollable(self: ListView) -> bool
Set: Scrollable(self: ListView)=value
"""
SelectedIndices=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the indexes of the selected items in the control.
Get: SelectedIndices(self: ListView) -> SelectedIndexCollection
"""
SelectedItems=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the items that are selected in the control.
Get: SelectedItems(self: ListView) -> SelectedListViewItemCollection
"""
ShowFocusCues=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the control should display focus rectangles.
"""
ShowGroups=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether items are displayed in groups.
Get: ShowGroups(self: ListView) -> bool
Set: ShowGroups(self: ListView)=value
"""
ShowItemToolTips=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether ToolTips are shown for the System.Windows.Forms.ListViewItem objects contained in the System.Windows.Forms.ListView.
Get: ShowItemToolTips(self: ListView) -> bool
Set: ShowItemToolTips(self: ListView)=value
"""
ShowKeyboardCues=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the user interface is in the appropriate state to show or hide keyboard accelerators.
"""
SmallImageList=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Forms.ImageList to use when displaying items as small icons in the control.
Get: SmallImageList(self: ListView) -> ImageList
Set: SmallImageList(self: ListView)=value
"""
Sorting=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the sort order for items in the control.
Get: Sorting(self: ListView) -> SortOrder
Set: Sorting(self: ListView)=value
"""
StateImageList=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Forms.ImageList associated with application-defined states in the control.
Get: StateImageList(self: ListView) -> ImageList
Set: StateImageList(self: ListView)=value
"""
Text=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""This property is not relevant for this class.
Get: Text(self: ListView) -> str
Set: Text(self: ListView)=value
"""
TileSize=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the size of the tiles shown in tile view.
Get: TileSize(self: ListView) -> Size
Set: TileSize(self: ListView)=value
"""
TopItem=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the first visible item in the control.
Get: TopItem(self: ListView) -> ListViewItem
Set: TopItem(self: ListView)=value
"""
UseCompatibleStateImageBehavior=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether the System.Windows.Forms.ListView uses state image behavior that is compatible with the .NET Framework 1.1 or the .NET Framework 2.0.
Get: UseCompatibleStateImageBehavior(self: ListView) -> bool
Set: UseCompatibleStateImageBehavior(self: ListView)=value
"""
View=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets how items are displayed in the control.
Get: View(self: ListView) -> View
Set: View(self: ListView)=value
"""
VirtualListSize=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the number of System.Windows.Forms.ListViewItem objects contained in the list when in virtual mode.
Get: VirtualListSize(self: ListView) -> int
Set: VirtualListSize(self: ListView)=value
"""
VirtualMode=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a value indicating whether you have provided your own data-management operations for the System.Windows.Forms.ListView control.
Get: VirtualMode(self: ListView) -> bool
Set: VirtualMode(self: ListView)=value
"""
AfterLabelEdit=None
BackgroundImageLayoutChanged=None
BeforeLabelEdit=None
CacheVirtualItems=None
CheckedIndexCollection=None
CheckedListViewItemCollection=None
ColumnClick=None
ColumnHeaderCollection=None
ColumnReordered=None
ColumnWidthChanged=None
ColumnWidthChanging=None
DrawColumnHeader=None
DrawItem=None
DrawSubItem=None
ItemActivate=None
ItemCheck=None
ItemChecked=None
ItemDrag=None
ItemMouseHover=None
ItemSelectionChanged=None
ListViewItemCollection=None
PaddingChanged=None
Paint=None
RetrieveVirtualItem=None
RightToLeftLayoutChanged=None
SearchForVirtualItem=None
SelectedIndexChanged=None
SelectedIndexCollection=None
SelectedListViewItemCollection=None
TextChanged=None
VirtualItemsSelectionRangeChanged=None
|
# -*- coding: utf-8 -*-
## courses table
Course = db.define_table("courses",
Field("title", label=T('Title')),
Field("short_description", "text", label=T('Short Description')),
Field("description", "text", widget=ckeditor.widget, label=T('Description')),
Field("price", "float", default=0, label=T('Price')),
Field("discount", "float", default=0, label=T('Discount')),
Field("max_students", "integer", default=10, label=T('Max Students')),
Field("total_hours", "integer", default=10, label=T('Total Hours')),
Field("banner", "upload", label=T('Banner')),
Field("icon", "upload", label=T('Icon')),
Field("course_owner", "reference auth_user", label=T('Owner'))
)
## classes table
Class = db.define_table("classes",
Field("course", "reference courses", label=T('Course')),
Field("start_date", "date", label=T('Start Date')),
Field("end_date", "date", label=T('End Date')),
Field("available_until", "date", label=T('Available Until')),
Field("status", label=T('Status'))
)
## students table
Student = db.define_table("students",
Field("student", "reference auth_user", label=T('Student')),
Field("class_id", "reference classes", label=T('Class Id'))
)
## modules table
Module = db.define_table("modules",
Field("title", label=T('Title')),
Field("description", "text", widget=ckeditor.widget, label=T('Description')),
Field("place", "integer", label=T('Place')),
Field("course_id", "reference courses", label=T('Course Id'))
)
## single lesson table
Lesson = db.define_table("lessons",
Field("title", label=T('Title')),
Field("lesson_module", "reference modules", label=T('Module')),
Field("place", "integer", label=T('Place'))
)
## schedule lessons table
Schedule_Lesson = db.define_table("schedule_lessons",
Field("lesson_id", "reference lessons", label=T('Lesson Id')),
Field("class_id", "reference classes", label=T('Class Id')),
Field("release_date", "date", label=T('Release Date'))
)
## video lesson table
Video = db.define_table("videos",
Field("video_url", label=T('Video URL')),
Field("video_upload", "upload",label=T('Upload Video')),
Field("place", "integer", label=T('Place')),
Field("lesson", "reference lessons", label=T('Lesson')),
Field("lesson_type", "integer", default=1, label=T('Lesson Type'))
)
## text lesson table
Text = db.define_table("texts",
Field("body", "text", widget=ckeditor.widget, label=T('Body')),
Field("place", "integer", label=T('Place')),
Field("lesson", "reference lessons", label=T('Lesson')),
Field("lesson_type", "integer", default=2, label=T('Lesson Type'))
)
## exercise lesson table
Exercise = db.define_table("exercises",
Field("question", "text", widget=ckeditor.widget, label=T('Question')),
Field("alternative_a", label=T('Alternative A')),
Field("alternative_b", label=T('Alternative B')),
Field("alternative_c", label=T('Alternative C')),
Field("alternative_d", label=T('Alternative D')),
Field("correct", "integer", label=T('Correct Alternative')),
Field("place", "integer", label=T('Place')),
Field("lesson", "reference lessons", label=T('Lesson')),
Field("lesson_type", "integer", default=3, label=T('Lesson Type'))
)
## track lesson table
Track = db.define_table("tracks",
Field("user_id", "reference auth_user", label=T('User Id')),
Field("user_class", "reference classes", label=T('User Class')),
Field("lesson", "reference lessons", label=T('User Lesson'))
)
## calendar table
Date = db.define_table("dates",
Field("title", label=T('Title')),
Field("marked_date", "date", label=T('Date')),
Field("class_id", "reference classes", label=T('Class Id'))
)
## forum table
Forum = db.define_table("forum",
Field("title", label=T('Title')),
Field("body", "text", widget=ckeditor.widget, label=T('Body')),
Field("class_id", "reference classes", label=T('Class Id')),
auth.signature
)
## forum comments table
Comment = db.define_table("comments",
Field("body", "text", widget=ckeditor.widget, label=T('Body')),
Field("post", "reference forum", label=T('Post')),
auth.signature
)
## course interest table
Interest = db.define_table("interests",
Field("email", label=T('E-mail')),
Field("course", "reference courses", label=T('Course')),
auth.signature
)
## teacher's announcement table
Announcement = db.define_table("announcements",
Field("title", label=T('Title')),
Field("body", "text", widget=ckeditor.widget, label=T('Body')),
Field("class_id", "reference classes", label=T('Class Id'))
)
## certificates' info
Certificate = db.define_table("certificates",
Field("bg_template", "upload", label=T('Template')),
Field("class_id", "reference classes", label=T('Class Id')),
Field("teacher_signature", "upload", label=T('Signature'))
)
######################
### PAYMENT TABLES ###
######################
## register user's orders
Order = db.define_table('orders',
Field('user_id', 'reference auth_user', label=T('User Id')),
Field('order_date', 'datetime', label=T('Order Date')),
Field('products', 'list:reference classes', label=T('Products')),
Field('amount', 'double', label=T('Amount')),
Field('status', label=T('Status')),
Field('token', label=T('Token'))
)
## stores pending transactions to connect to payment services
Pending = db.define_table('pending_transactions',
Field('order_id', 'reference orders', label=T('Order Id')),
Field('confirmed', 'boolean', default=False, label=T('Confirmed')),
auth.signature
)
## stores confirmed transactions to register user's payments
Confirmed = db.define_table('confirmed_transactions',
Field('order_id', 'reference orders', label=T('Order Id')),
Field('pending_id', 'reference pending_transactions', ondelete='SET NULL', label=T('Pending Id')),
Field('confirmation_time', 'datetime', label=T('Confirmation Time')),
auth.signature
)
|
def get_encoder_decoder_hp(model='gin', decoder=None):
if model == 'gin':
model_hp = {
"num_layers": 5,
"hidden": [64,64,64,64],
"dropout": 0.5,
"act": "relu",
"eps": "False",
"mlp_layers": 2,
"neighbor_pooling_type": "sum",
}
elif model == 'gat':
model_hp = {
# hp from model
"num_layers": 2,
"hidden": [8],
"heads": 8,
"dropout": 0.6,
"act": "elu",
}
elif model == 'gcn':
model_hp = {
"num_layers": 2,
"hidden": [16],
"dropout": 0.5,
"act": "relu"
}
elif model == 'sage':
model_hp = {
"num_layers": 2,
"hidden": [64],
"dropout": 0.5,
"act": "relu",
"agg": "mean",
}
elif model == 'topk':
model_hp = {
"num_layers": 5,
"hidden": [64, 64, 64, 64]
}
if decoder is None:
decoder_hp = {
"hidden": 64,
"dropout": 0.5,
"act": "relu",
"graph_pooling_type": "sum"
}
elif decoder == "JKSumPoolMLP":
decoder_hp = {
"dropout": 0.5,
"graph_pooling_type": "sum"
}
elif decoder == "topk":
decoder_hp = {
"dropout": 0.5
}
return model_hp, decoder_hp
|
class Solution:
def canConstruct(self, ransomNote: str, magazine: str) -> bool:
count_r={}
for c in ransomNote:
if c not in count_r:
count_r[c]=1
else:
count_r[c]+=1
print(count_r)
for cr in magazine:
if cr not in count_r or count_r[cr]==0:
# print("entered")
continue
else:
count_r[cr]-=1
print(count_r)
x=sum(count_r.values())
print(x)
if x==0:
return 1
else:
return 0
|
BOTTLE_CONTENT_MANAGER_API_PORT = 8081
BOTTLE_DEORATOR_PORTFOLIOS_API_PORT = 8082
BOTTLE_DEORATOR_TAGS_API_PORT = 8083
BOTTLE_DEORATOR_VOTES_API_PORT = 8084
USE_SOLR_AS_PERSISTENCE = True
SOLR_URL = 'http://localhost:8983/solr'
DECORATION_SOLR_FIELD_0 = 'portfolios'
DECORATION_SOLR_FIELD_1 = 'tags'
|
"""
> Task
Some people are standing in a row in a park. There are trees between them which cannot be moved.
Your task is to rearrange the people by their heights in a non-descending order without moving
the trees. People can be very tall!
> Example
For a = [-1, 150, 190, 170, -1, -1, 160, 180], the output should be [-1, 150, 160, 170, -1, -1, 180, 190].
> Input/Output
- execution time limit: 4 seconds (py3)
- input: array.integer a
If a[i] = -1, then the ith position is occupied by a tree.
Otherwise a[i] is the height of a person standing in the ith position.
- guaranteed constraints:
1 ≤ a.length ≤ 1000,
-1 ≤ a[i] ≤ 1000.
- output: array.integer
Sorted array a with all the trees untouched.
"""
def sort_by_height(a):
swap = True
while swap:
swap = False
for i in range(len(a) - 1):
j = i + 1
while a[i] == -1:
i += 1
if i == len(a):
return a
while a[j] == -1:
j += 1
if a[i] > a[j]:
a[i], a[j] = a[j], a[i]
swap = True
return a
def sort_by_height_v2(a):
print("\nunsorted: {}".format(a))
sorted_l = sorted([i for i in a if i > 0])
print("sorted: {}".format(sorted_l))
for n, i in enumerate(a):
print("n: {} | i: {} | a[{}] = {}".format(n, i, n, a[n]))
if i == -1:
sorted_l.insert(n, i)
print("sorted: {}".format(sorted_l))
return sorted_l
def sort_by_height_v3(a):
sorted_l = [n for n in a if n != -1]
sorted_l.sort()
for i in range(len(a)):
a[i] = sorted_l.pop(0) if a[i] != -1 else a[i]
return a
if __name__ == '__main__':
test_1 = [-1, 15, 19, 17, -1, -1, 16, 18]
test_2 = [-1, -1, -1, -1, -1]
test_3 = [-1]
test_4 = [4, 2, 9, 11, 2, 16]
test_5 = [2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1]
test_6 = [23, 54, -1, 43, 1, -1, -1, 77, -1, -1, -1, 3]
print("\nPit version (quite wrong)")
print(sort_by_height(test_1))
print(sort_by_height(test_2))
print(sort_by_height(test_3))
print(sort_by_height(test_4))
print(sort_by_height(test_5))
print(sort_by_height(test_6))
print("\n2nd version:")
print(sort_by_height_v2(test_1))
print(sort_by_height_v2(test_2))
print(sort_by_height_v2(test_3))
print(sort_by_height_v2(test_4))
print(sort_by_height_v2(test_5))
print(sort_by_height_v2(test_6))
print("\n3rd version")
print(sort_by_height_v3(test_1))
print(sort_by_height_v3(test_2))
print(sort_by_height_v3(test_3))
print(sort_by_height_v3(test_4))
print(sort_by_height_v3(test_5))
print(sort_by_height_v3(test_6))
|
# keep a list of the N best things we have seen, discard anything else
class nbest(object):
def __init__(self,N=1000):
self.store = []
self.N = N
def add(self,item):
self.store.append(item)
self.store.sort(reverse=True)
self.store = self.store[:self.N]
def __getitem__(self,k):
return self.store[k]
def __len__(self):
return len(self.store)
|
#f = open("datum/iris.csv")
#print (f.read())
#f.close()
#closing file is good practice
#Using ff code will make closing file unnecessary
with open("datum/iris.csv") as f:
contents = (f.read())
print(contents)
|
def main(j, args, params, tags, tasklet):
page = args.page
logpath = args.requestContext.params.get('logpath')
templatepath = args.requestContext.params.get('templatepath')
installedpath = args.requestContext.params.get('installedpath')
metapath = args.requestContext.params.get('metapath')
domain = args.requestContext.params.get('domain')
name = args.requestContext.params.get('servicename')
instance = args.requestContext.params.get('instance')
instancestr = ':%s' % instance if instance else ''
page.addHeading("Code editors for %s:%s%s" % (domain, name, instancestr), 2)
for representation, path in (('Installed', installedpath), ('Logs', logpath), ('Template', templatepath), ('Metadata', metapath)):
if not path or not j.system.fs.exists(path):
continue
page.addHeading("%s" % representation, 3)
page.addExplorer(path, readonly=False, tree=True, height=300)
params.result = page
return params
def match(j, args, params, tags, tasklet):
return True
|
# ==================================================================================== #
# base_response.py - This file is part of the YFrake package. #
# ------------------------------------------------------------------------------------ #
# #
# MIT License #
# #
# Copyright (c) 2022 Mattias Aabmets #
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy #
# of this software and associated documentation files (the "Software"), to deal #
# in the Software without restriction, including without limitation the rights #
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
# copies of the Software, and to permit persons to whom the Software is #
# furnished to do so, subject to the following conditions: #
# #
# The above copyright notice and this permission notice shall be included in all #
# copies or substantial portions of the Software. #
# #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
# SOFTWARE. #
# #
# ==================================================================================== #
class BaseResponse:
"""
Base class of the ClientResponse.
"""
_err_msg = 'Operation not available on response object attributes! (YFrake)'
# ------------------------------------------------------------------------------------ #
def __init__(self):
self._endpoint: str | None = None
self._error: dict | None = None
self._data: dict | None = None
# ------------------------------------------------------------------------------------ #
@classmethod
def _raise_error(cls) -> None:
raise TypeError(cls._err_msg)
# ------------------------------------------------------------------------------------ #
@property
def endpoint(self) -> str | None:
return self._endpoint
@endpoint.setter
def endpoint(self, _) -> None:
self._raise_error()
@endpoint.deleter
def endpoint(self) -> None:
self._raise_error()
# ------------------------------------------------------------------------------------ #
@property
def error(self) -> dict | None:
return self._error
@error.setter
def error(self, _) -> None:
self._raise_error()
@error.deleter
def error(self) -> None:
self._raise_error()
# ------------------------------------------------------------------------------------ #
@property
def data(self) -> dict | None:
return self._data
@data.setter
def data(self, _) -> None:
self._raise_error()
@data.deleter
def data(self) -> None:
self._raise_error()
|
def cargarListas(nombrearchivo,lista):
try:
archivo = open(nombrearchivo, "rt")
while True:
linea = archivo.readline()
if not linea:
break
linea = linea[:-1]
listaNombre, Articulos = linea.split("=")
if Articulos.strip() == "":
listaArticulos = []
else:
listaArticulos = Articulos.split(",")
lista.append([listaNombre,listaArticulos])
archivo.close()
except:
print("")
return lista
def salvarListas(nommbrearchivo,listas):
try:
archivo = open(nommbrearchivo, "wt")
for lista in listas:
listaarchivo = ""
for articulos in lista[1]:
listaarchivo += "{0},".format(articulos)
archivo.write(lista[0] + "=" + listaarchivo[:-1] + "\n")
archivo.close()
except:
print("\nError al Guardar Archivo")
input()
def getListaNombre(lista,lista_actual):
if len(lista) == 0:
return '** LISTA VACIA **'
else:
return lista[lista_actual][0]
def agregarLista(lista,listaNombre):
lista.append([listaNombre,[]])
return lista
def agregarArticulo(lista,listaNombre):
lista.append(listaNombre)
return lista
def borrarLista(lista,listaNumero):
lista.pop(listaNumero)
return lista
|
# Time: O(n^2 * k)
# Space: O(k)
class Solution(object):
def maxVacationDays(self, flights, days):
"""
:type flights: List[List[int]]
:type days: List[List[int]]
:rtype: int
"""
if not days or not flights:
return 0
dp = [[0] * len(days) for _ in xrange(2)]
for week in reversed(xrange(len(days[0]))):
for cur_city in xrange(len(days)):
dp[week % 2][cur_city] = days[cur_city][week] + dp[(week+1) % 2][cur_city]
for dest_city in xrange(len(days)):
if flights[cur_city][dest_city] == 1:
dp[week % 2][cur_city] = max(dp[week % 2][cur_city], \
days[dest_city][week] + dp[(week+1) % 2][dest_city])
return dp[0][0]
|
first_number = int(input())
prime_count = 0
while True:
if 1>= first_number:
break
running_number = first_number
divider = first_number // 2 if ( 0 == first_number % 2 ) else ( first_number // 2 ) + 1;
count = 0
while divider != 1:
if 0 == running_number % divider:
count += 1
divider -= 1
if count == 0:
prime_count += 1
first_number -= 1
if 1 == first_number:
break
print(prime_count)
|
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
ALLOWED_PARAM_MERGE_STRATEGIES = (OVERWRITE, MERGE, DEEP_MERGE) = (
'overwrite', 'merge', 'deep_merge')
def get_param_merge_strategy(merge_strategies, param_key):
if merge_strategies is None:
return OVERWRITE
env_default = merge_strategies.get('default', OVERWRITE)
merge_strategy = merge_strategies.get(param_key, env_default)
if merge_strategy in ALLOWED_PARAM_MERGE_STRATEGIES:
return merge_strategy
return env_default
|
# for item in ["mash","john","sera"]:
# print(item)
# for item in range(5,10,2):
# print(item)
# for x in range(4):
# for y in range(3):
# print(f"({x}, {y})")
numbers = [5, 2 , 5 ,2 ,2]
for item in numbers:
output = ""
for count in range(item):
output += "X"
print(output)
|
# Problem: https://www.hackerrank.com/challenges/30-data-types/problem
# Score: 30.0
i = 4
d = 4.0
s = 'HackerRank '
x = int(input())
y = float(input())
z = input()
print(i+x, d+y, s+z, sep='\n')
|
class ConsumerRegister:
all_consumers = {}
def __init__(self, name):
self.name = name
self.consumer_class = None
def consumer(self):
def decorator(plugin_cls):
self.consumer_class = plugin_cls
self.all_consumers[self.name] = {
'consumer_cls': self.consumer_class
}
return plugin_cls
return decorator
@classmethod
def get_consumer(cls, name):
try:
return cls.all_consumers[name]
except KeyError:
return None
|
# INSTRUCTIONS
# Translate the text and write it between the "
# EXAMPLE: original -> "This text is in english: value {0}"
# translation -> "Aquest text està en anglès: valor {0}"
# If you see sth like {0}, {1}, maintain it on the translated sentence
# Meke special attention to elements like ":", etc.
lang_3_5_0 = {
"Tooltip Appearance:": "",
"Tooltip's font, font size, font color and background": "",
"Disable tooltip's blurry background": "",
"Sync time with the internet": "",
"Internet date and time": "",
"Select internet time provider, change sync frequency": "",
"Enable internet time sync": "",
"Paste a URL from the world clock api or equivalent": "",
"Help": "",
"Internet sync frequency": "",
"10 minutes": "",
"30 minutes": "",
"1 hour": "",
"2 hours": "",
"4 hours": "",
"10 hours": "",
"24 hours": "",
}
lang_3_4_0 = lang_3_5_0 | {
"Show calendar": "",
"Disabled": "",
"Open quick settings": "",
"Show desktop": "",
"Open run dialog": "",
"Open task manager": "",
"Open start menu": "",
"Open search menu": "",
"Change task": "",
"Change the action done when the clock is clicked": "",
}
lang_3_3_2 = lang_3_4_0 | {
"ElevenClock Updater": "",
"ElevenClock is downloading updates": "",
"ElevenClock has updated to version {0} successfully\nPlease see GitHub for the changelog": "",
"Customize the clock on Windows 11": "",
"Disable the new instance checker method": "",
"Import settings from a local file": "",
"Export settings to a local file": "",
"Export": "",
"Import": "",
}
lang_3_3_1 = lang_3_3_2 | {
"Invalid time format\nPlease follow the\nC 1989 Standards": "",
"Nothing to preview": "",
"Invalid time format\nPlease modify it\nin the settings": "",
"Disable the tooltip shown when the clock is hovered": ""
}
lang_3_3 = lang_3_3_1 | {
"Custom format rules:": "",
"Any text can be placed here. To place items such as date and time, please use the 1989 C standard. More info on the following link": "",
"Python date and time formats": "",
"To disable the zero-padding effect, add a # in between the % and the code: non-zero-padded hours would be %#H, and zero-padded hours would be %H": "", # Here please don't modify the %H and %#H values
"Click on Apply to apply and preview the format": "",
"Apply": "",
"If you don't understand what is happening, please uncheck the checkbox over the text area": "",
"Set a custom date and time format": "",
"(for advanced users only)": "",
"Move this clock to the left": "",
"Move this clock to the top": "",
"Move this clock to the right": "",
"Move this clock to the bottom": "",
"Restore horizontal position": "",
"Restore vertical position": "",
}
lang_3_2_1 = lang_3_3 | {
"Open online help to troubleshoot problems": "Apri la guida in linea per risolvere i problemi",
"Reset ElevenClock preferences to defaults": "Ripristina le preferenze di ElevanClock per i valori predefiniti",
"Specify a minimum width for the clock": "Specificare una larghezza minima per l'orologio",
"Search on the settings": "Cerca sulle impostazioni",
"No results were found": "Nessun risultato trovato",
}
lang_3_2 = lang_3_2_1 | {
"Use system accent color as background color": "Utilizzare il colore di accento del sistema come colore di sfondo",
"Check only the focused window on the fullscreen check": "Controllare solo la finestra focalizzata sul controllo completo",
"Clock on monitor {0}": "Orologio sul monitor {0}",
"Move to the left": "Passa a sinistra",
"Show this clock on the left": "Mostra questo orologio a sinistra",
"Show this clock on the right": "Mostra questo orologio a destra",
"Restore clock position": "Ripristina la posizione dell'orologio",
}
lang_3_1 = lang_3_2 | {
# The initial of the word week in your language: W for week, S for setmana, etc.
"W": "S",
"Disable the notification badge": "Disabilita il distintivo della notifica",
"Override clock default height": "Override Orologio Altezza predefinita",
"Adjust horizontal clock position": "Regola la posizione dell'orologio orizzontale",
"Adjust vertical clock position": "Regola la posizione dell'orologio verticale",
"Export log as a file": "Esporta log come file",
"Copy log to clipboard": "Copia log negli Appunti",
"Announcements:": "Annunci:",
"Fetching latest announcement, please wait...": "Recuperando l'ultimo annuncio, per favore aspetta ...",
"Couldn't load the announcements. Please try again later": "Non poteva caricare gli annunci. Per favore riprova più tardi",
"ElevenClock's log": "Log ElevenClock",
"Pick a color": "Scegli un colore"
}
lang_3 = lang_3_1 | {
"Hide the clock during 10 seconds when clicked": "Nascondi l'orologio durante 10 secondi quando cliccato",
"Enable low-cpu mode": "Abilita la modalità a bassa cpu",
"You might lose functionalities, like the notification counter or the dynamic background": "Potresti perdere funzionalità, come il contatore di notifica o lo sfondo dinamico",
"Clock position and size:": "Posizione e dimensione dell'orologio:",
"Clock size preferences, position offset, clock at the left, etc.": "Preferenze di dimensioni dell'orologio, offset di posizione, orologio a sinistra, ecc.",
"Reset monitor blacklisting status": "Reset Monitor Blacklisting Status",
"Reset": "Ripristina",
"Third party licenses": "Licenze di terze parti",
"View": "Visualizza",
"ElevenClock": "ElevenClock",
"Monitor tools": "Monitor strumenti",
"Blacklist this monitor": "Blacklist questo monitor.",
"Third Party Open-Source Software in Elevenclock {0} (And their licenses)": "",
"ElevenClock is an Open-Source application made with the help of other libraries made by the community:": "",
"Ok": "",
"More Info": "",
"About Qt": "",
"Success": "",
"The monitors were unblacklisted successfully.": "",
"Now you should see the clock everywhere": "",
"Ok": "",
"Blacklist Monitor": "",
"Blacklisting a monitor will hide the clock on this monitor permanently.": "",
"This action can be reverted from the settings window, under <b>Clock position and size</b>": "",
"Are you sure do you want to blacklist the monitor \"{0}\"?": "",
"Yes": "",
"No": "",
}
lang_2_9_2 = lang_3 | {
"Reload log": "Ricarica log",
"Do not show the clock on secondary monitors": "Non mostrare l'orologio sui monitor secondari",
"Disable clock taskbar background color (make clock transparent)": "Disabilita il colore dello sfondo della barra delle applicazioni dell'orologio (crea orologio trasparente)",
"Open the welcome wizard": "Apri il wizard di benvenuto",
" (ALPHA STAGE, MAY NOT WORK)": "(Fase alfa, potrebbe non funzionare)",
"Welcome to ElevenClock": "Benvenuti in ElevenClock.",
"Skip": "Salta",
"Start": "Inizio",
"Next": "Prossima",
"Finish": "Fine",
}
lang_2_9 = lang_2_9_2 | {
"Task Manager": "Task Manager",
"Change date and time": "Cambia data e ora",
"Notification settings": "Impostazioni di notifica",
"Updates, icon tray, language": "Aggiornamenti, Icona Vassoio, Lingua",
"Hide extended options from the clock right-click menu (needs a restart to be applied)": "Nascondi opzioni estese dal menu del tasto destro del mouse dell'orologio (ha bisogno di un riavvio da applicare)",
"Fullscreen behaviour, clock position, 1st monitor clock, other miscellanious settings": "Comportamento a schermo intero, posizione dell'orologio, 1 ° monitor clock, altre impostazioni miscellanee",
'Add the "Show Desktop" button on the left corner of every clock': 'Aggiungi il pulsante "Mostra desktop" sull\'angolo sinistro di ogni orologio',
'You might need to set a custom background color for this to work. More info <a href="{0}" style="color:DodgerBlue">HERE</a>': '',
"Clock's font, font size, font color and background, text alignment": "Carattere dell'orologio, dimensione del carattere, colore del carattere e sfondo, allineamento del testo",
"Date format, Time format, seconds,weekday, weeknumber, regional settings": "Formato data, formato orario, secondi, giorni feriali, Numero della settimana, Impostazioni regionali",
"Testing features and error-fixing tools": "Caratteristiche di prova e strumenti di fissaggio degli errori",
"Language pack author(s), help translating ElevenClock": "Autore del pacchetto di lingue, aiuto per la traduzioneElevenClock ",
"Info, report a bug, submit a feature request, donate, about": "Info, segnala un bug, inviare una richiesta di funzionalità, donare, circa",
"Log, debugging information": "Log, informazioni di debug",
}
lang_2_8 = lang_2_9 | {
"Force the clock to be at the top of the screen": "Forza l'orologio ad essere nella parte superiore dello schermo",
"Show the clock on the primary screen": "Mostra l'orologio sullo schermo principale",
"Use a custom font color": "Usa un colore personalizzato per il font",
"Use a custom background color": "Usa un colore personalizzato per lo sfondo",
"Align the clock text to the center": "Allinea il testo dell'orologio al centro",
"Select custom color": "Seleziona un colore personalizzato",
"Hide the clock when a program occupies all screens": "Nascondi l'orologio quando un programma occupa tutte le schermate",
}
lang2_7_bis = lang_2_8 | {
"Use a custom font": "Usa un font personalizzato",
"Use a custom font size": "Usa una dimensione del font personalizzata",
"Enable hide when multi-monitor fullscreen apps are running": "Abilita Nascondi quando sono in esecuzione app a schermo intero multi-monitor",
"<b>{0}</b> needs to be enabled to change this setting": "<b>{0}</b> deve essere abilitato per modificare questa impostazione",
"<b>{0}</b> needs to be disabled to change this setting": "<b>{0}</b> deve essere disabilitato per modificare questa impostazione",
}
lang2_7 = lang2_7_bis | {
" (This feature has been disabled because it should work by default. If it is not, please report a bug)": "(Questa funzionalità è stata disabilitata perchè dovrebbe funzionare di default. Se non funziona, segnala un bug)",
"ElevenClock's language": "Lingua di ElevenClock"
}
lang2_6 = lang2_7 | {
"About Qt6 (PySide6)": "Circa Qt6 (PySide6)",
"About": "Circa",
"Alternative non-SSL update server (This might help with SSL errors)": "Server di aggiornamento non SSL alternativo (potrebbe aiutare con gli errori SSL)",
"Fixes and other experimental features: (Use ONLY if something is not working)": "Correzioni e altre funzionalità sperimentali: (Usale SOLO se qualcosa non funziona)",
"Show week number on the clock": "Mostra il numero della settimana",
}
lang2_5 = lang2_6 | {
"Hide the clock when RDP Client or Citrix Workspace are running": "Nascondi l'orologio quando RDP Client o Citrix Workspace sono in esecuzione",
"Clock Appearance:": "Aspetto dell'orologio",
"Force the clock to have black text": "Forza l'orologio ad avere il testo scuro",
" - It is required that the Dark Text checkbox is disabled": "È richiesto che la casella Testo Scuro sia disabilitata",
"Debbugging information:": "Informazioni di debug",
"Open ElevenClock's log": "Apri i log di ElevenClock",
}
lang2_4 = lang2_5 | {
# Added text in version 2.4
"Show the clock on the primary screen (Useful if clock is set on the left)": "Mostra l'orologio sullo schermo principale (Utile se l'orologio è impostato a sinistra)",
"Show weekday on the clock": "Visualizza il giorno della settimana",
}
lang2_3 = lang2_4 | {
# Context menu
"ElevenClock Settings": "Impostazioni ElevenClock", # Also settings title
"Reload Clocks": "Ricarica",
"ElevenClock v{0}": "ElevenClock v{0}",
"Restart ElevenClock": "Riavvia ElevenClock",
"Hide ElevenClock": "Nascondi ElevenClock",
"Quit ElevenClock": "Esci",
# General settings section
"General Settings:": "Impostazioni generali:",
"Automatically check for updates": "Rileva automaticamente gli aggiornamenti",
"Automatically install available updates": "Installa automaticamente gli aggiornamenti",
"Enable really silent updates": "Abilita aggiornamenti silenziosi",
"Bypass update provider authenticity check (NOT RECOMMENDED, AT YOUR OWN RISK)": "Ignora il controllo di autenticità del provider di aggiornamento (NON RACCOMANDATO, A TUO RISCHIO)",
"Show ElevenClock on system tray": "Visualizza ElevenClock sulla barra di sistema",
"Alternative clock alignment (may not work)": "Allineamento alternativo dell'orologio (potrebbe non funzionare)",
"Change startup behaviour": "Cambia il comportamento in avvio",
"Change": "Cambia",
"<b>Update to the latest version!</b>": "<b>Aggiorna all'ultima versione!</b>",
"Install update": "Installa l'aggiornamento",
# Clock settings
"Clock Settings:": "Impostazioni orologio:",
"Hide the clock in fullscreen mode": "Nascondi l'orologio in modalità a schermo intero",
"Hide the clock when RDP client is active": "Nascondi l'orologio quando il client RDP è attivo",
"Force the clock to be at the bottom of the screen": "Forza l'orologio ad essere al fondo dello schermo",
"Show the clock when the taskbar is set to hide automatically": "Visualizza l'orologio quando la barra delle applicazioni è impostata a Nascondi",
"Fix the hyphen/dash showing over the month": "Corregge la visualizzazione del trattino sul mese",
"Force the clock to have white text": "Forza l'orologio ad usare testo bianco",
"Show the clock at the left of the screen": "Visualizza l'orologio alla sinistra dello schermo",
# Date & time settings
"Date & Time Settings:": "Impostazioni data e Ora:",
"Show seconds on the clock": "Visualizza i secondi",
"Show date on the clock": "Visualizza la data",
"Show time on the clock": "Visualizza l'ora",
"Change date and time format (Regional settings)": "Cambia il formato di visualizzazione della data e dell'ora (Impostazioni regionali)",
"Regional settings": "Impostazioni regionali",
# About the language pack
"About the language pack:": "Informazioni sulla traduzione",
# Here, make sute to give you some credits: Translated to LANGUAGE by USER/NAME/PSEUDONYM/etc.
"Translated to English by martinet101": "Tradotto in Italiano da Parapongo, zuidstroopwafel",
"Translate ElevenClock to your language": "Traduci ElevenClock nella tua lingua",
"Get started": "Inizia",
# About ElevenClock
"About ElevenClock version {0}:": "Informazioni sulla versione {0} di ElevenClock",
"View ElevenClock's homepage": "Visualizza l'homepage di ElevenClock",
"Open": "Apri",
"Report an issue/request a feature": "Segnala un problema/richiedi una nuova funzionalità",
"Report": "Segnala",
"Support the dev: Give me a coffee☕": "Supporta lo sviluppatore: donami un caffè☕",
"Open page": "Apri la pagina",
# Here, the word "Icons8" should not be translated
"Icons by Icons8": "Icone tratte da Icons8",
"Webpage": "Pagina Web",
"Close settings": "Chiudi le impostazioni",
"Close": "Chiudi",
}
lang = lang2_3
|
n1 = float(input("Digite um número: "))
n2 = float(input("Digite outro: "))
m = (n1 + n2) / 2
print('{:.2f}'.format(m))
|
class ConfigBase:
def __init__(self,**kwargs):
for k,v in kwargs.items():
setattr(self,k,v)
@classmethod
def get_class_config_info_dict(cls):
if issubclass(cls.__base__, ConfigBase):
dic=cls.__base__.get_class_config_info_dict()
else:
dic = {}
for k, v in cls.__dict__.items():
if not k.startswith('_') and k[0].upper() == k[0] and v is not None:
dic[k] = v
return dic
def get_config_info_dict(self):
dic=self.get_class_config_info_dict()
for k, v in self.__dict__.items():
if not k.startswith('_') and k[0].upper() == k[0] and v is not None:
dic[k] = v
return dic
|
p = float(input('Digite seu peso: '))
a = float(input('Digite sua altuta: '))
imc =p / (a**2)
print('Seu IMC é {:.2f}'.format(imc))
if imc< 18.5:
print('Abaixo do peso')
elif imc < 25:
print('Peso ideal')
elif imc < 30:
print('sobre peso')
elif imc < 40:
print('Obesidade')
else:
print('obesidade morbida')
|
def mergeSort(arr):
if len(arr) >1:
mid = len(arr)//2
L = arr[:mid]
R = arr[mid:]
mergeSort(L)
mergeSort(R)
i = j = k = 0
while i < len(L) and j < len(R):
if L[i] < R[j]:
arr[k] = L[i]
i+= 1
else:
arr[k] = R[j]
j+= 1
k+= 1
while i < len(L):
arr[k] = L[i]
i+= 1
k+= 1
while j < len(R):
arr[k] = R[j]
j+= 1
k+= 1
def printList(arr):
for i in range(len(arr)):
print(arr[i], end =" ")
print()
if __name__ == '__main__':
arr = [12, 34, 11, 2, 10]
print ("Given array is", end ="\n")
printList(arr)
mergeSort(arr)
print("Sorted array is: ", end ="\n")
printList(arr)
|
"""
Concrete data service.
This Django app manages API endpoints related to managing "concrete data", or
data that serves as the foundational sources of truth for users. This is opposed
to "derived data", which is data computed via mathematical, logical /
relational, or other types of transformations. For example, a materialized view
would be considered "derived data", while a CSV upload would be considered
"concrete data".
Making this distinction helps ensure application data flow is unitary, and that
consequently, underlying data pipelines are acyclic. This methodology may reduce
likelihood of data corruption via concurrency / paralellism or other concerns,
and helps describe the data model more clearly.
"""
|
pontos = []
posicoes = []
# Para verificar se os dedos estão dobrados ou esticados,
# esta função faz a comparação da distancia entre pontos
# e adiciona a lista de posições se o dedo está esticado, acima ou abaixo da base do dedo se está próximo ou afastado do dedo subsequente.
# Para o dedo polegar, precisa de uma verificação adicional para saber se está esticado ou dobrado
# comparando a diferença dos pontos na vertical e na horizontal
def verificar_posicao_DEDOS(pontos, dedo, mao):
# invertendo o vetor para facilitar o entendimento
# EX.: o indice 0 (zero) será a ponta do dedo, o indice 4 será a base do dedo
for indx, p in enumerate(reversed(pontos)):
# print(indx, p[0])
if indx == 2:
# base do dedo
baseDedo_V = p[1]
baseDedo_H = p[0]
# print('baseDedo_V', baseDedo_V)
if indx == 1:
pontoAnterior_H = p[0]
if indx == 0:
# ponta do dedo
pontaDedo_V = p[1]
pontaDedo_H = p[0]
# print('pontaDedo_V', pontaDedo_V)
if mao == 'acima': # se a posição da mão está voltada para cima
if dedo == 'polegar': # o dedo polegar se move mais na horizontal do que na vertical
if pontaDedo_H <= pontoAnterior_H: # se a ponta do dedo polegar na horizontal for menor que o ponto anterior dele, então está dobrado
if (
baseDedo_H - pontaDedo_H) > 70: # se o dedo estiver muito dobrado, então está esticado na horizontal
return posicoes.append('esticado horizontal')
elif (baseDedo_H - pontaDedo_H) <= 30:
return posicoes.append('esticado vertical')
else: # senão está dobrado
return posicoes.append('dobrado')
elif pontaDedo_V < baseDedo_V: # se a ponta do dedo na vertical for menor que a base, então o dedo está esticado
return posicoes.append('esticado vertical')
else: # senão está dobrado
return posicoes.append('dobrado')
elif pontaDedo_V < baseDedo_V: # se o dedo não for o polegar, então verifica se a ponta do dedo na vertical for menor que a base, então o dedo está esticado
return posicoes.append('esticado vertical')
else: # senão está dobrado
return posicoes.append('dobrado')
else: # se a posição da mão estiver "abaixo"
if dedo == 'polegar': # o dedo polegar se move mais na horizontal do que na vertical
if (
baseDedo_H - pontaDedo_H) < 70: # verificar se o ponto está muito a esquerda: se o resultado for maior que 70
return posicoes.append('esticado horizontal')
elif (baseDedo_H - pontaDedo_H) >= 30:
return posicoes.append('esticado vertical')
else: # senão está dobrado
return posicoes.append('dobrado')
elif pontaDedo_V > baseDedo_V: # se o dedo não for o polegar, então verifica se a ponta do dedo na vertical for menor que a base, então o dedo está esticado
return posicoes.append('esticado vertical')
else: # senão está dobrado
return posicoes.append('dobrado')
# //////////////////////////////////FUNÇÕES PARA ANÁLISE DE POSIÇÃO DO CORPO///////////////////////////////////////////
def verificar_posicao_CORPO(pontos):
posicao1 = 0
posicao2 = 0
for indx, p in enumerate(pontos):
# print(indx, p[0])
if indx == 0:
posicao1 = p[0] + p[1]
print('posicao1', posicao1)
if indx == 1:
posicao2 = p[0] + p[1]
print('posicao2', posicao2)
if (posicao2 - posicao1) >= 0:
# print('(p3 - p2) = ',(p3 - p2), 'R1')
# print('(p2 - p1) = ',(p2 - p1), 'R2')
# print('(p1 - p0) = ',(p1 - p0), 'R3')
return 'esticado'
else:
# print('(p3 - p2) = ',(p3 - p2), 'R1')
# print('(p2 - p1) = ',(p2 - p1), 'R2')
# print('(p1 - p0) = ',(p1 - p0), 'R3')
return 'dobrado'
|
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 11 10:18:56 2020
@author: Ashish
"""
def add_num(num1, num2):
print("In module A")
return num1+num2
|
#python 3.5.2
class Stack:
def __init__(self):
self.items = []
def isEmpty(self):
self.items == []
def push(self, item):
self.items.append(item)
def pop(self):
return self.items.pop()
def peek(self):
return self.items[len(self.items)-1]
def size(self):
return len(self.items)
def converDecToBinary(decimalNo, debug):
s = Stack()
temp = decimalNo
remainder = 0
pushNo = 0
result = ""
while temp > 0:
remainder = temp%2
if remainder == 0:
if debug :
pushNo = 0
s.push('0')
else:
if debug :
pushNo = 1
s.push('1')
temp = temp//2
if debug :
print( temp , 'remainder', pushNo)
print( s.items )
print('-'*20)
print('REVERSE THE NUMBERS')
while s.size() != 0:
if debug :
print( s.items )
result = result + s.pop()
print('-'*20)
return result
print( converDecToBinary(6 , True) )
print('-'*20)
'''
3 remainder 0
['0']
--------------------
1 remainder 1
['0', '1']
--------------------
0 remainder 1
['0', '1', '1']
--------------------
REVERSE THE NUMBERS
['0', '1', '1']
['0', '1']
['0']
--------------------
110
--------------------
'''
|
# coding=utf-8
# 数据库配置
db_config = {
'db': 'cmdb'
}
page_config = {
"brand_name": '51Reboot',
'title': 'hello reboot',
"favicon": 'https://pic1.zhimg.com/6d660dd4156c64bfad13ff97d79c2f98_l.jpg',
"menu": [
{
# user配置最好不要修改,是和登陆认证相关的,直接在下面加配置即可
"name": 'user',
"title": '用户管理',
"data": [{
"name": 'username',
"title": '用户名'
}, {
"name": 'password',
"title": '密码'
}]
},
{
"name": 'table_info',
"title": '系统设置',
"data": [{
"name": "name",
"title": '数据表英文名'
},{
"name": "title",
"title": '数据表中文名'
}]
},
{
"title": '更多设置',
"sub": [
{
'name': 'string_clo',
'title': '字符串',
'data': [{
'name': 'colume_name',
'title': '字段英文名'
}, {
'name': 'colume_title',
'title': '字段中文名'
}, {
'name': 'table_name',
'title': '表名',
"type": 'select',
"select_type": 'table_info'
}]
},
{
'name': 'datetime_clo',
'title': '日期',
'data': [{
'name': 'colume_name',
'title': '字段英文名'
}, {
'name': 'colume_title',
'title': '字段中文名'
}, {
'name': 'table_name',
'title': '表名',
"type": 'select',
"select_type": 'table_info'
}]
},
{
'name': 'dynamic_select_clo',
'title': '动态选择器',
'data': [{
'name': 'colume_name',
'title': '字段英文名'
}, {
'name': 'colume_title',
'title': '字段中文名'
}, {
'name': 'table_name',
'title': '表名',
"type": 'select',
"select_type": 'table_info'
}, {
'name': 'select_table_name',
'title': '被选表名',
"type": 'select',
"select_type": 'table_info'
}]
},
{
'name': 'static_select_clo',
'title': '静态选择器',
'data': [{
'name': 'colume_name',
'title': '字段英文名'
}, {
'name': 'colume_title',
'title': '字段中文名'
}, {
'name': 'table_name',
'title': '表名',
"type": 'select',
"select_type": 'table_info'
}, {
'name': 'select_value',
'title': '配置格式 {0: "开启", 1: "关闭"}',
}]
}
]
}
]
}
page_config2 = {}
def update_page_config2():
for page in page_config["menu"]:
if "name" in page.keys():
name = page["name"]
page_config2[name] = page
if "sub" in page.keys():
for sub in page["sub"]:
name = sub["name"]
page_config2[name] = sub
update_page_config2()
# '''
# page_config2_demo = {
# "brand_name": '51Reboot',
# 'title': 'hello reboot',
# "favicon": 'https://pic1.zhimg.com/6d660dd4156c64bfad13ff97d79c2f98_l.jpg',
# "menu": {
# 'user': {
# # user配置最好不要修改,是和登陆认证相关的,直接在下面加配置即可
# "name": 'user',
# "title": '用户管理',
# "data": [{
# "name": 'username',
# "title": '用户名'
# }, {
# "name": 'password',
# "title": '密码'
# }]
# },
# 'test': {
# # user配置最好不要修改,是和登陆认证相关的,直接在下面加配置即可
# "name": 'test',
# "title": '测试',
# "data": [{
# "name": 'username',
# "title": '用户名'
# }, {
# "name": 'password',
# "title": '密码',
# "empty": "yes"
#
# }]
# },
# 'caninet': {
# "name": 'caninet',
# "title": '机柜',
# "data": [{
# "name": "name",
# "title": '机柜名'
# }]
# },
# "host": {
# "name": "host",
# "title": "服务器",
# "data": [{
# "name": "caninet",
# "title": '机柜',
# "type": 'select',
# "select_type": 'caninet'
# }, {
# "name": "hostname",
# "title": '主机名'
# }, {
# 'name': 'asset_no',
# 'title': '资产号'
# }, {
# "name": 'end_time',
# "title": "过期日期",
# "type": 'date'
# }, {
# "name": 'ups',
# "title": '是否开启',
# "type": 'select',
# "value": {0: '开启', 1: '关闭'}
# }]
# }
# }
# }
# '''
# ,{
# "name": 'host',
# "title": '服务器',
# "data": [{
# "name": 'cabinet',
# "title": '机柜'
# },{
# "name":'hostname',
# "title":'主机名'
# }]
# },{
# "title": '业务',
# "sub":[
# {
# 'name': 'product',
# 'title': '业务线',
# 'data': [{
# 'name': 'service_name',
# 'title': '服务名'
# },{
# 'name':'module_letter',
# 'title':'模块简称'
# },{
# 'name':'dev_interface',
# 'title':'开发者'
# },{
# 'name':'op_interface',
# 'title':'运维接口人'
# }]
# },
# {
# 'name': 'raidtype',
# 'title': 'Raid厂商',
# 'data': [{
# 'name': 'name',
# 'title': 'Raid厂商'
# }]
# }
# ]
# }
|
class TextManipulation:
def formatText(text):
newText = text.replace("&", "\n")
return newText
|
def define_orthonormal_basis(u):
"""
Calculates an orthonormal basis given an arbitrary vector u.
Args:
u (numpy array of floats) : arbitrary 2-dimensional vector used for new
basis
Returns:
(numpy array of floats) : new orthonormal basis
columns correspond to basis vectors
"""
# normalize vector u
u = u / np.sqrt(u[0] ** 2 + u[1] ** 2)
# calculate vector w that is orthogonal to w
w = np.array([-u[1], u[0]])
W = np.column_stack((u, w))
return W
np.random.seed(2020) # set random seed
variance_1 = 1
variance_2 = 1
corr_coef = 0.8
cov_matrix = calculate_cov_matrix(variance_1, variance_2, corr_coef)
X = get_data(cov_matrix)
u = np.array([3, 1])
# Uncomment and run below to plot the basis vectors
W = define_orthonormal_basis(u)
with plt.xkcd():
plot_basis_vectors(X, W)
|
# Map query config
QUERY_RADIUS = 3000 # mts. Radius to use on OSM data queries.
MIN_DISTANCE_FOR_NEW_QUERY = 1000 # mts. Minimum distance to query area edge before issuing a new query.
FULL_STOP_MAX_SPEED = 1.39 # m/s Max speed for considering car is stopped.
|
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing base test results classes."""
# The test passed.
PASS = 'SUCCESS'
# The test was intentionally skipped.
SKIP = 'SKIPPED'
# The test failed.
FAIL = 'FAILURE'
# The test caused the containing process to crash.
CRASH = 'CRASH'
# The test timed out.
TIMEOUT = 'TIMEOUT'
# The test ran, but we couldn't determine what happened.
UNKNOWN = 'UNKNOWN'
# The test did not run.
NOTRUN = 'NOTRUN'
|
# THIS FILE IS GENERATED FROM PYWAVELETS SETUP.PY
short_version = '0.3.0'
version = '0.3.0'
full_version = '0.3.0.dev-7ea3e91'
git_revision = '7ea3e919b1d7bbf4d7685c47d3d10c16c599cd06'
release = False
if not release:
version = full_version
|
#/usr/bin/env python3
"""
Solution to problem: https://practice.geeksforgeeks.org/problems/adding-ones/0
We reduced the runtime of algorithm from O(nm) to O(n+m) resulting in
half the time running
"""
def get_array(array, n):
"""
gets the array
Gets input and returns final computed value
Parameters:
array: list
n : integer
returns:
n : list of added ones
"""
n = [0 for _ in range(n)]
d_count = dict()
array = [i - 1 for i in array]
for i in array:
if i not in d_count:
d_count[i] = 0
d_count[i] += 1
k = 0
for i in range(len(n)):
if i not in d_count:
d_count[i] = 0
n[i] = d_count[i] + k
k = n[i]
return n
def main():
"""
This is the driver method
"""
t = int(input())
for _ in range(t):
n, k = map(int, input().rstrip().split())
array = list(map(int, input().rstrip().split()))
print(' '.join(map(str, get_array(array, n))))
if __name__ == '__main__':
main()
|
'''
Create a function that sums two arguments together. If only one argument is provided, then return a function that expects one argument and returns the sum.
For example, addTogether(2, 3) should return 5, and addTogether(2) should return a function.
Calling this returned function with a single argument will then return the sum:
var sumTwoAnd = addTogether(2);
sumTwoAnd(3) returns 5.
If either argument isn't a valid number, return undefined.
'''
def addTogether(*args):
if len(args) == 2:
return sum(args)
elif len(args) == 1:
return lambda v: v + args[0]
addTogether(2,3)
|
class ConfigHandlerException(Exception):
"""Main Config Handler Exception class"""
class ConfigHandlerFileReadException(ConfigHandlerException):
"""Config Handler ConfigFile Read Exception class"""
class ConfigHandlerNamingException(ConfigHandlerException):
"""Config Handler Naming Exception class"""
|
class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
return chr(reduce(lambda a, b: a ^ ord(b), s + t, 0))
|
exp_name = 'prenet_c32s6d5_lstm'
work_dir = f'./work_dirs/{exp_name}'
# model settings
model = dict(
type='MultiStageRestorer',
generator=dict(
type='PReNet',
in_channels=3,
out_channels=3,
mid_channels=32,
recurrent_unit='LSTM',
num_stages=6,
num_resblocks=5,
recursive_resblock=False
),
losses=[dict(type='SSIMLoss', loss_weight=1.0, reduction='mean', recurrent=False)],
)
# model training and testing settings
train_cfg = None
test_cfg = dict(metrics=['PSNR', 'SSIM'])
# dataset settings
train_dataset_type = 'DerainPairedDataset'
val_dataset_type = 'DerainPairedDataset'
train_pipeline = [
dict(
type='LoadPairedImageFromFile',
io_backend='disk',
key='gt,lq',
flag='color'
),
dict(type='ArgsCrop', keys=['lq', 'gt']),
dict(type='RescaleToZeroOne', keys=['lq', 'gt']),
dict(type='ImageToTensor', keys=['lq', 'gt']),
dict(
type='Collect',
keys=['lq', 'gt'],
meta_keys=['lq_path', 'gt_path']
)
]
test_pipeline = [
dict(
type='LoadPairedImageFromFile',
io_backend='disk',
key='gt,lq',
flag='color'
),
dict(type='RescaleToZeroOne', keys=['lq', 'gt']),
dict(type='ImageToTensor', keys=['lq', 'gt']),
dict(
type='Collect',
keys=['lq', 'gt'],
meta_keys=['lq_path', 'gt_path']
)
]
data_root = '../data/Rain200L'
data = dict(
workers_per_gpu=8,
train_dataloader=dict(samples_per_gpu=18, drop_last=True),
val_dataloader=dict(samples_per_gpu=1),
test_dataloader=dict(samples_per_gpu=1),
train=dict(
type='ExhaustivePatchDataset',
patch_size=100,
stride=80, # set to 100 for Rain1200 and Rain1400 dataset
dataset=dict(
type=train_dataset_type,
dataroot=data_root,
pipeline=train_pipeline,
test_mode=False
)
),
val=dict(
type=val_dataset_type,
dataroot=data_root,
pipeline=test_pipeline,
test_mode=True
),
test=dict(
type=val_dataset_type,
dataroot=data_root,
pipeline=test_pipeline,
test_mode=True
)
)
# optimizer
optimizers = dict(type='Adam', lr=1e-3, betas=(0.9, 0.999))
optimizer_config = dict(grad_clip=None)
# learning policy
runner = dict(type='EpochBasedRunner', max_epochs=100)
lr_config = dict(
policy='Step',
by_epoch=True,
step=[30, 50, 80],
gamma=0.2
)
checkpoint_config = dict(interval=10, save_optimizer=True, by_epoch=True)
evaluation = dict(interval=25, save_image=True, by_epoch=True)
log_config = dict(
interval=400,
hooks=[
dict(type='TextLoggerHook', by_epoch=False)
]
)
visual_config = None
# runtime settings
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = None
resume_from = None
workflow = [('train', 1)]
|
# Crie um programa que leia vários números inteiros pelo teclado. O programa só vai parar quando o usuário digitar o valor 999, que é a condição de parada. No final, mostre quantos números foram digitados e qual foi a soma entre eles (desconsiderando o flag).
n = c = soma = 0
n = int(input('Digite os numeros para obter a soma [Parar com 999]: '))
while n != 999:
soma += n
c += 1
n = int(input('Digite os numeros para obter a soma [Parar com 999]: '))
print('Resultado das somas dos {} numeros foi {}'.format(c, soma))
|
class SchedulableField(object, IDisposable):
"""
A non-calculated field eligible to be included in a schedule.
SchedulableField(fieldType: ScheduleFieldType,parameterId: ElementId)
SchedulableField(fieldType: ScheduleFieldType)
SchedulableField()
"""
def Dispose(self):
""" Dispose(self: SchedulableField) """
pass
def Equals(self, obj):
"""
Equals(self: SchedulableField,obj: object) -> bool
Determines whether the specified System.Object is equal to the current
System.Object.
obj: The other object to evaluate.
"""
pass
def GetHashCode(self):
"""
GetHashCode(self: SchedulableField) -> int
Gets the integer value of the SchedulableField as hash code
"""
pass
def GetName(self, document):
"""
GetName(self: SchedulableField,document: Document) -> str
Gets the name of the field.
document: The document in which the field will be used.
Returns: The name of the field.
"""
pass
def ReleaseUnmanagedResources(self, *args):
""" ReleaseUnmanagedResources(self: SchedulableField,disposing: bool) """
pass
def __enter__(self, *args):
""" __enter__(self: IDisposable) -> object """
pass
def __eq__(self, *args):
""" x.__eq__(y) <==> x==y """
pass
def __exit__(self, *args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod
def __new__(self, fieldType=None, parameterId=None):
"""
__new__(cls: type,fieldType: ScheduleFieldType,parameterId: ElementId)
__new__(cls: type,fieldType: ScheduleFieldType)
__new__(cls: type)
"""
pass
def __ne__(self, *args):
pass
def __repr__(self, *args):
""" __repr__(self: object) -> str """
pass
FieldType = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""The type of data displayed by the field.
Get: FieldType(self: SchedulableField) -> ScheduleFieldType
Set: FieldType(self: SchedulableField)=value
"""
IsValidObject = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Specifies whether the .NET object represents a valid Revit entity.
Get: IsValidObject(self: SchedulableField) -> bool
"""
ParameterId = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""The ID of the parameter displayed by the field.
Get: ParameterId(self: SchedulableField) -> ElementId
Set: ParameterId(self: SchedulableField)=value
"""
|
def findDecision(obj): #obj[0]: Coupon, obj[1]: Education, obj[2]: Occupation, obj[3]: Restaurant20to50, obj[4]: Distance
# {"feature": "Coupon", "instances": 127, "metric_value": 0.9671, "depth": 1}
if obj[0]>0:
# {"feature": "Occupation", "instances": 111, "metric_value": 0.9353, "depth": 2}
if obj[2]<=7.990990990990991:
# {"feature": "Restaurant20to50", "instances": 68, "metric_value": 0.8113, "depth": 3}
if obj[3]<=2.0:
# {"feature": "Distance", "instances": 61, "metric_value": 0.8537, "depth": 4}
if obj[4]>1:
# {"feature": "Education", "instances": 36, "metric_value": 0.7107, "depth": 5}
if obj[1]<=2:
return 'True'
elif obj[1]>2:
return 'True'
else: return 'True'
elif obj[4]<=1:
# {"feature": "Education", "instances": 25, "metric_value": 0.971, "depth": 5}
if obj[1]>1:
return 'False'
elif obj[1]<=1:
return 'True'
else: return 'True'
else: return 'True'
elif obj[3]>2.0:
return 'True'
else: return 'True'
elif obj[2]>7.990990990990991:
# {"feature": "Restaurant20to50", "instances": 43, "metric_value": 0.9996, "depth": 3}
if obj[3]>-1.0:
# {"feature": "Education", "instances": 41, "metric_value": 0.9996, "depth": 4}
if obj[1]<=3:
# {"feature": "Distance", "instances": 35, "metric_value": 0.9947, "depth": 5}
if obj[4]>1:
return 'False'
elif obj[4]<=1:
return 'True'
else: return 'True'
elif obj[1]>3:
# {"feature": "Distance", "instances": 6, "metric_value": 0.65, "depth": 5}
if obj[4]<=1:
return 'True'
elif obj[4]>1:
return 'True'
else: return 'True'
else: return 'True'
elif obj[3]<=-1.0:
return 'False'
else: return 'False'
else: return 'False'
elif obj[0]<=0:
# {"feature": "Education", "instances": 16, "metric_value": 0.896, "depth": 2}
if obj[1]>0:
# {"feature": "Restaurant20to50", "instances": 12, "metric_value": 0.9799, "depth": 3}
if obj[3]>0.0:
# {"feature": "Occupation", "instances": 10, "metric_value": 1.0, "depth": 4}
if obj[2]<=6:
# {"feature": "Distance", "instances": 6, "metric_value": 0.9183, "depth": 5}
if obj[4]<=2:
return 'True'
elif obj[4]>2:
return 'False'
else: return 'False'
elif obj[2]>6:
# {"feature": "Distance", "instances": 4, "metric_value": 0.8113, "depth": 5}
if obj[4]>2:
return 'True'
elif obj[4]<=2:
return 'False'
else: return 'False'
else: return 'False'
elif obj[3]<=0.0:
return 'False'
else: return 'False'
elif obj[1]<=0:
return 'False'
else: return 'False'
else: return 'False'
|
class AgentException(Exception):
""" Base exception"""
description = 'Unknown error'
statuscode = 5
def __str__(self):
return '{0}: {1}'.format(self.description, ' '.join(self.args))
class InactiveAgent(AgentException):
description = "Agent is not activated"
|
a = 1
a = a + 2
print(a)
a += 2
print(a)
word = "race"
word += " car"
print(word)
|
''' Nome: Luiz Lima Cezario Ra:11201920808
Esse programa serve para analisar se uma quantidade determinada pelo primeiro numero entrado se os proximos
fazem parte dos numeros de fibonacci
'''
def FibonateAnalise(x:int)-> str:
""" Esta funçao calcula os numeros de fibonacci, enquanto o numero fibonacci for menor que o
numero dado apos comparo se os dois sao iguais se nao envio um 0 """
i = 0
proximo = 1
anterior = 0
while(x > proximo):
proximo = proximo + anterior
anterior = proximo - anterior
if(x == proximo):
return str(proximo)
return '0'
def Principal():
y = int(input())
i = 0
response = ''
while(i < y):
x = int(input())
i += 1
res = FibonateAnalise(x)
if(res != '0'):
response = response + res + " "
if(response != ''):
print(response)
else:
print("Sabia que era místico demais!")
Principal()
|
etc_dictionary = {
'2 30대': '이삼십대',
'20~30대': '이삼십대',
'20, 30대': '이십대 삼십대',
'1+1': '원플러스원',
'3에서 6개월인': '3개월에서 육개월인',
}
english_dictionary = {
'Devsisters': '데브시스터즈',
'track': '트랙',
# krbook
'LA': '엘에이',
'LG': '엘지',
'KOREA': '코리아',
'JSA': '제이에스에이',
'PGA': '피지에이',
'GA': '지에이',
'idol': '아이돌',
'KTX': '케이티엑스',
'AC': '에이씨',
'DVD': '디비디',
'US': '유에스',
'CNN': '씨엔엔',
'LPGA': '엘피지에이',
'P': '피',
'L': '엘',
'T': '티',
'B': '비',
'C': '씨',
'BIFF': '비아이에프에프',
'GV': '지비',
# JTBC
'IT': '아이티',
'IQ': '아이큐',
'JTBC': '제이티비씨',
'trickle down effect': '트리클 다운 이펙트',
'trickle up effect': '트리클 업 이펙트',
'down': '다운',
'up': '업',
'FCK': '에프씨케이',
'AP': '에이피',
'WHERETHEWILDTHINGSARE': '',
'Rashomon Effect': '',
'O': '오',
'OO': '오오',
'B': '비',
'GDP': '지디피',
'CIPA': '씨아이피에이',
'YS': '와이에스',
'Y': '와이',
'S': '에스',
'JTBC': '제이티비씨',
'PC': '피씨',
'bill': '빌',
'Halmuny': '하모니', #####
'X': '엑스',
'SNS': '에스엔에스',
'ability': '어빌리티',
'shy': '',
'CCTV': '씨씨티비',
'IT': '아이티',
'the tenth man': '더 텐쓰 맨', ####
'L': '엘',
'PC': '피씨',
'YSDJJPMB': '', ########
'Content Attitude Timing': '컨텐트 애티튜드 타이밍',
'CAT': '캣',
'IS': '아이에스',
'SNS': '에스엔에스',
'K': '케이',
'Y': '와이',
'KDI': '케이디아이',
'DOC': '디오씨',
'CIA': '씨아이에이',
'PBS': '피비에스',
'D': '디',
'PPropertyPositionPowerPrisonP'
'S': '에스',
'francisco': '프란시스코',
'I': '아이',
'III': '아이아이', ######
'No joke': '노 조크',
'BBK': '비비케이',
'LA': '엘에이',
'Don': '',
't worry be happy': ' 워리 비 해피',
'NO': '엔오', #####
'it was our sky': '잇 워즈 아워 스카이',
'it is our sky': '잇 이즈 아워 스카이', ####
'NEIS': '엔이아이에스', #####
'IMF': '아이엠에프',
'apology': '어폴로지',
'humble': '험블',
'M': '엠',
'Nowhere Man': '노웨어 맨',
'The Tenth Man': '더 텐쓰 맨',
'PBS': '피비에스',
'BBC': '비비씨',
'MRJ': '엠알제이',
'CCTV': '씨씨티비',
'Pick me up': '픽 미 업',
'DNA': '디엔에이',
'UN': '유엔',
'STOP': '스탑', #####
'PRESS': '프레스', #####
'not to be': '낫 투비',
'Denial': '디나이얼',
'G': '지',
'IMF': '아이엠에프',
'GDP': '지디피',
'JTBC': '제이티비씨',
'Time flies like an arrow': '타임 플라이즈 라이크 언 애로우',
'DDT': '디디티',
'AI': '에이아이',
'Z': '제트',
'OECD': '오이씨디',
'N': '앤',
'A': '에이',
'MB': '엠비',
'EH': '이에이치',
'IS': '아이에스',
'TV': '티비',
'MIT': '엠아이티',
'KBO': '케이비오',
'I love America': '아이 러브 아메리카',
'SF': '에스에프',
'Q': '큐',
'KFX': '케이에프엑스',
'PM': '피엠',
'Prime Minister': '프라임 미니스터',
'Swordline': '스워드라인',
'TBS': '티비에스',
'DDT': '디디티',
'CS': '씨에스',
'Reflecting Absence': '리플렉팅 앱센스',
'PBS': '피비에스',
'Drum being beaten by everyone': '드럼 빙 비튼 바이 에브리원',
'negative pressure': '네거티브 프레셔',
'F': '에프',
'KIA': '기아',
'FTA': '에프티에이',
'Que sais-je': '',
'UFC': '유에프씨',
'P': '피',
'DJ': '디제이',
'Chaebol': '채벌',
'BBC': '비비씨',
'OECD': '오이씨디',
'BC': '삐씨',
'C': '씨',
'B': '씨',
'KY': '케이와이',
'K': '케이',
'CEO': '씨이오',
'YH': '와이에치',
'IS': '아이에스',
'who are you': '후 얼 유',
'Y': '와이',
'The Devils Advocate': '더 데빌즈 어드보카트',
'YS': '와이에스',
'so sorry': '쏘 쏘리',
'Santa': '산타',
'Big Endian': '빅 엔디안',
'Small Endian': '스몰 엔디안',
'Oh Captain My Captain': '오 캡틴 마이 캡틴',
'AIB': '에이아이비',
'K': '케이',
'PBS': '피비에스',
}
|
#
# Task description
# This is a demo task. You can read about this task and its solutions in this blog post.
#
# A zero-indexed array A consisting of N integers is given. An equilibrium index of this array is any integer P such that 0 ≤ P < N and the sum of elements of lower indices is equal to the sum of elements of higher indices, i.e.
# A[0] + A[1] + ... + A[P−1] = A[P+1] + ... + A[N−2] + A[N−1].
# Sum of zero elements is assumed to be equal to 0. This can happen if P = 0 or if P = N−1.
#
# For example, consider the following array A consisting of N = 8 elements:
#
# A[0] = -1
# A[1] = 3
# A[2] = -4
# A[3] = 5
# A[4] = 1
# A[5] = -6
# A[6] = 2
# A[7] = 1
# P = 1 is an equilibrium index of this array, because:
#
# A[0] = −1 = A[2] + A[3] + A[4] + A[5] + A[6] + A[7]
# P = 3 is an equilibrium index of this array, because:
#
# A[0] + A[1] + A[2] = −2 = A[4] + A[5] + A[6] + A[7]
# P = 7 is also an equilibrium index, because:
#
# A[0] + A[1] + A[2] + A[3] + A[4] + A[5] + A[6] = 0
# and there are no elements with indices greater than 7.
#
# P = 8 is not an equilibrium index, because it does not fulfill the condition 0 ≤ P < N.
#
# Write a function:
#
# def solution(A)
# that, given a zero-indexed array A consisting of N integers, returns any of its equilibrium indices. The function should return −1 if no equilibrium index exists.
#
# For example, given array A shown above, the function may return 1, 3 or 7, as explained above.
#
# Assume that:
#
# N is an integer within the range [0..100,000];
# each element of array A is an integer within the range [−2,147,483,648..2,147,483,647].
# Complexity:
#
# expected worst-case time complexity is O(N);
# expected worst-case space complexity is O(N), beyond input storage (not counting the storage required for input arguments).
# Elements of input arrays can be modified.
def sum_idxs(m_list):
my_sum = 0
#print(m_list)
for j in m_list:
my_sum += j
#print("my_sum is:", my_sum)
return my_sum
def solution(A):
# write your code in Python 2.7
idx = -1
#print(A)
for i,v in enumerate(A):
#print("i",i)
if sum_idxs(A[i:]) == sum_idxs(A[:i+1]):
idx = i
break
return idx
|
# compare_versions.py
# software library for question B
def compare_versions(string1, string2):
seperator = "."
# first load the strings and then seperate the individual numbers into a list by
# using the split function
string1 = string1.split(seperator)
string2 = string2.split(seperator)
# loop through all the version levels
for level in range(0, len(string1)):
# if the current two levels are equal, then continue in the loop
if string1[level] == string2[level]:
continue
# if all the levels are the same, then return that the versions are equal
return print("Version %s is equal to version %s. " %(seperator.join(string1), seperator.join(string2)))
# if the current level of string1 one is higher than string 2, return
# string 1
elif string1[level] > string2[level]:
return print("Version %s is greater than %s. " %(seperator.join(string1), seperator.join(string2)))
break
# else, return string2
else:
return print("Version %s is greater than %s. " %(seperator.join(string2), seperator.join(string1)))
break
# Another cool way to answer this question:
# Use python tuples! There is built in logic when comparing them
def compare_tuples(string1, string2):
seperator = "."
# convert the strings to tuples
string1 = tuple(string1.split(seperator))
string2 = tuple(string2.split(seperator))
# compare the tuples to each other and return whichever one is greater
if (string1 == string2):
return print("Version %s is equal to version %s. " %(seperator.join(string1), seperator.join(string2)))
elif string1 > string2:
return print("Version %s is greater than %s. " %(seperator.join(string1), seperator.join(string2)))
else:
return print("Version %s is greater than %s. " %(seperator.join(string2), seperator.join(string1)))
|
-8
# ----------------------------------------------------------------------------
# <copyright company="Aspose" file="HttpRequest.py">
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# </summary>
# ----------------------------------------------------------------------------
class HttpRequest(object):
def __init__(self, resource_path, path_params, query_params, header_params,
form_params, body_params, files, collection_formats,
auth_settings, return_http_data_only=None,
preload_content=None, request_timeout=None):
"""Makes the HTTP request (synchronous) and returns deserialized data.
To make an async request, set the async parameter.
:param resource_path: Path to method endpoint.
:param path_params: Path parameters in the url.
:param query_params: Query parameters in the url.
:param header_params: Header parameters to be placed in the request
header.
:param form_params: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param body_params: Request body.
:param files: dict key -> filename, value -> filepath,
for `multipart/form-data`.
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
:param auth_settings: Auth Settings names for the request.
:param return_http_data_only: response data without head status code
and headers
:param preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: Request thread.
"""
self.resource_path = resource_path
self.path_params = path_params
self.query_params = query_params
self.header_params = header_params
self.form_params = form_params
self.body_params = body_params
self.files = files
self.collection_formats = collection_formats
self.auth_settings = auth_settings
self.return_http_data_only = return_http_data_only or True
self.preload_content = preload_content or True
self.request_timeout = request_timeout or ''
|
class BaseSubmission:
def __init__(self, team_name, player_names):
self.team_name = team_name
self.player_names = player_names
def get_actions(self, obs):
'''
Overview:
You must implement this function.
'''
raise NotImplementedError
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.