content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# -*- coding: utf-8 -*- # Copyright 2021 Cohesity Inc. class TenantProxy(object): """Implementation of the 'TenantProxy' model. Specifies the data for tenant proxy which has been deployed in tenant's enviroment. Attributes: constituent_id (long|int): Specifies the constituent id of the proxy. ip_address (string): Specifies the ip address of the proxy. tenant_id (string): Specifies the unique id of the tenant. version (string): Specifies the version of the proxy. """ # Create a mapping from Model property names to API property names _names = { "constituent_id":'constituentId', "ip_address":'ipAddress', "tenant_id":'tenantId', "version":'version' } def __init__(self, constituent_id=None, ip_address=None, tenant_id=None, version=None): """Constructor for the TenantProxy class""" # Initialize members of the class self.constituent_id = constituent_id self.ip_address = ip_address self.tenant_id = tenant_id self.version = version @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the server's response. The keys MUST match property names in the API description. Returns: object: An instance of this structure class. """ if dictionary is None: return None # Extract variables from the dictionary constituent_id = dictionary.get('constituentId') ip_address = dictionary.get('ipAddress') tenant_id = dictionary.get('tenantId') version = dictionary.get('version') # Return an object of this model return cls(constituent_id, ip_address, tenant_id, version)
class Tenantproxy(object): """Implementation of the 'TenantProxy' model. Specifies the data for tenant proxy which has been deployed in tenant's enviroment. Attributes: constituent_id (long|int): Specifies the constituent id of the proxy. ip_address (string): Specifies the ip address of the proxy. tenant_id (string): Specifies the unique id of the tenant. version (string): Specifies the version of the proxy. """ _names = {'constituent_id': 'constituentId', 'ip_address': 'ipAddress', 'tenant_id': 'tenantId', 'version': 'version'} def __init__(self, constituent_id=None, ip_address=None, tenant_id=None, version=None): """Constructor for the TenantProxy class""" self.constituent_id = constituent_id self.ip_address = ip_address self.tenant_id = tenant_id self.version = version @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the server's response. The keys MUST match property names in the API description. Returns: object: An instance of this structure class. """ if dictionary is None: return None constituent_id = dictionary.get('constituentId') ip_address = dictionary.get('ipAddress') tenant_id = dictionary.get('tenantId') version = dictionary.get('version') return cls(constituent_id, ip_address, tenant_id, version)
# generated from catkin/cmake/template/order_packages.context.py.in source_root_dir = '/home/sim2real/ep_ws/src' whitelisted_packages = ''.split(';') if '' != '' else [] blacklisted_packages = ''.split(';') if '' != '' else [] underlay_workspaces = '/home/sim2real/carto_ws/devel_isolated/cartographer_rviz;/home/sim2real/carto_ws/install_isolated;/home/sim2real/ep_ws/devel;/opt/ros/noetic'.split(';') if '/home/sim2real/carto_ws/devel_isolated/cartographer_rviz;/home/sim2real/carto_ws/install_isolated;/home/sim2real/ep_ws/devel;/opt/ros/noetic' != '' else []
source_root_dir = '/home/sim2real/ep_ws/src' whitelisted_packages = ''.split(';') if '' != '' else [] blacklisted_packages = ''.split(';') if '' != '' else [] underlay_workspaces = '/home/sim2real/carto_ws/devel_isolated/cartographer_rviz;/home/sim2real/carto_ws/install_isolated;/home/sim2real/ep_ws/devel;/opt/ros/noetic'.split(';') if '/home/sim2real/carto_ws/devel_isolated/cartographer_rviz;/home/sim2real/carto_ws/install_isolated;/home/sim2real/ep_ws/devel;/opt/ros/noetic' != '' else []
# # PySNMP MIB module CISCOSB-RMON (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCOSB-RMON # Produced by pysmi-0.3.4 at Wed May 1 12:23:18 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) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint") switch001, = mibBuilder.importSymbols("CISCOSB-MIB", "switch001") EntryStatus, OwnerString = mibBuilder.importSymbols("RMON-MIB", "EntryStatus", "OwnerString") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") ObjectIdentity, iso, Gauge32, TimeTicks, Counter64, Counter32, Bits, NotificationType, Integer32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, Unsigned32, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "iso", "Gauge32", "TimeTicks", "Counter64", "Counter32", "Bits", "NotificationType", "Integer32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "Unsigned32", "IpAddress") TruthValue, TextualConvention, RowStatus, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "TextualConvention", "RowStatus", "DisplayString") rlRmonControl = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49)) rlRmonControl.setRevisions(('2004-06-01 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: rlRmonControl.setRevisionsDescriptions(('Initial version of this MIB.',)) if mibBuilder.loadTexts: rlRmonControl.setLastUpdated('200406010000Z') if mibBuilder.loadTexts: rlRmonControl.setOrganization('Cisco Small Business') if mibBuilder.loadTexts: rlRmonControl.setContactInfo('Postal: 170 West Tasman Drive San Jose , CA 95134-1706 USA Website: Cisco Small Business Home http://www.cisco.com/smb>;, Cisco Small Business Support Community <http://www.cisco.com/go/smallbizsupport>') if mibBuilder.loadTexts: rlRmonControl.setDescription('The private MIB module definition for switch001 RMON MIB.') rlRmonControlMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlRmonControlMibVersion.setStatus('current') if mibBuilder.loadTexts: rlRmonControlMibVersion.setDescription("The MIB's version. The current version is 1") rlRmonControlHistoryControlQuotaBucket = MibScalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(8)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlRmonControlHistoryControlQuotaBucket.setStatus('current') if mibBuilder.loadTexts: rlRmonControlHistoryControlQuotaBucket.setDescription('Maximum number of buckets to be used by each History Control group entry. changed to read only, value is derived from rsMaxRmonEtherHistoryEntrie') rlRmonControlHistoryControlMaxGlobalBuckets = MibScalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(300)).setMaxAccess("readonly") if mibBuilder.loadTexts: rlRmonControlHistoryControlMaxGlobalBuckets.setStatus('current') if mibBuilder.loadTexts: rlRmonControlHistoryControlMaxGlobalBuckets.setDescription('Maximum number of buckets to be used by all History Control group entries together.') rlHistoryControlTable = MibTable((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4), ) if mibBuilder.loadTexts: rlHistoryControlTable.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlTable.setDescription('A list of rlHistory control entries. This table is exactly like the corresponding RMON I History control group table, but is used to sample statistics of counters not specified by the RMON I statistics group.') rlHistoryControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1), ).setIndexNames((0, "CISCOSB-RMON", "rlHistoryControlIndex")) if mibBuilder.loadTexts: rlHistoryControlEntry.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlEntry.setDescription('A list of parameters that set up a periodic sampling of statistics. As an example, an instance of the rlHistoryControlInterval object might be named rlHistoryControlInterval.2') rlHistoryControlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlHistoryControlIndex.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlIndex.setDescription('An index that uniquely identifies an entry in the rlHistoryControl table. Each such entry defines a set of samples at a particular interval for a sampled counter.') rlHistoryControlDataSource = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 2), ObjectIdentifier()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlHistoryControlDataSource.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlDataSource.setDescription('This object identifies the source of the data for which historical data was collected and placed in the rlHistory table. This object may not be modified if the associated rlHistoryControlStatus object is equal to valid(1).') rlHistoryControlBucketsRequested = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(50)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlHistoryControlBucketsRequested.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlBucketsRequested.setDescription('The requested number of discrete time intervals over which data is to be saved in the part of the rlHistory table associated with this rlHistoryControlEntry. When this object is created or modified, the probe should set rlHistoryControlBucketsGranted as closely to this object as is possible for the particular probe implementation and available resources.') rlHistoryControlBucketsGranted = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlHistoryControlBucketsGranted.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlBucketsGranted.setDescription('The number of discrete sampling intervals over which data shall be saved in the part of the rlHistory table associated with this rlHistoryControlEntry. When the associated rlHistoryControlBucketsRequested object is created or modified, the probe should set this object as closely to the requested value as is possible for the particular probe implementation and available resources. The probe must not lower this value except as a result of a modification to the associated rlHistoryControlBucketsRequested object. There will be times when the actual number of buckets associated with this entry is less than the value of this object. In this case, at the end of each sampling interval, a new bucket will be added to the rlHistory table. When the number of buckets reaches the value of this object and a new bucket is to be added to the media-specific table, the oldest bucket associated with this rlHistoryControlEntry shall be deleted by the agent so that the new bucket can be added. When the value of this object changes to a value less than the current value, entries are deleted from the rlHistory table. Enough of the oldest of these entries shall be deleted by the agent so that their number remains less than or equal to the new value of this object. When the value of this object changes to a value greater than the current value, the number of associated rlHistory table entries may be allowed to grow.') rlHistoryControlInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3600)).clone(1800)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlHistoryControlInterval.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlInterval.setDescription('The interval in seconds over which the data is sampled for each bucket in the part of the rlHistory table associated with this rlHistoryControlEntry. This interval can be set to any number of seconds between 1 and 3600 (1 hour). Because the counters in a bucket may overflow at their maximum value with no indication, a prudent manager will take into account the possibility of overflow in any of the associated counters. It is important to consider the minimum time in which any counter could overflow and set the rlHistoryControlInterval object to a value This object may not be modified if the associated rlHistoryControlStatus object is equal to valid(1).') rlHistoryControlOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 6), OwnerString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlHistoryControlOwner.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlOwner.setDescription('The entity that configured this entry and is therefore using the resources assigned to it.') rlHistoryControlStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 7), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlHistoryControlStatus.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlStatus.setDescription('The status of this rlHistoryControl entry. Each instance of the rlHistory table associated with this rlHistoryControlEntry will be deleted by the agent if this rlHistoryControlEntry is not equal to valid(1).') rlHistoryTable = MibTable((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5), ) if mibBuilder.loadTexts: rlHistoryTable.setStatus('current') if mibBuilder.loadTexts: rlHistoryTable.setDescription('A list of history entries.') rlHistoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1), ).setIndexNames((0, "CISCOSB-RMON", "rlHistoryIndex"), (0, "CISCOSB-RMON", "rlHistorySampleIndex")) if mibBuilder.loadTexts: rlHistoryEntry.setStatus('current') if mibBuilder.loadTexts: rlHistoryEntry.setDescription('An historical statistics sample of a counter specified by the corresponding history control entry. This sample is associated with the rlHistoryControlEntry which set up the parameters for a regular collection of these samples. As an example, an instance of the rlHistoryPkts object might be named rlHistoryPkts.2.89') rlHistoryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlHistoryIndex.setStatus('current') if mibBuilder.loadTexts: rlHistoryIndex.setDescription('The history of which this entry is a part. The history identified by a particular value of this index is the same history as identified by the same value of rlHistoryControlIndex.') rlHistorySampleIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlHistorySampleIndex.setStatus('current') if mibBuilder.loadTexts: rlHistorySampleIndex.setDescription('An index that uniquely identifies the particular sample this entry represents among all samples associated with the same rlHistoryControlEntry. This index starts at 1 and increases by one as each new sample is taken.') rlHistoryIntervalStart = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1, 3), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlHistoryIntervalStart.setStatus('current') if mibBuilder.loadTexts: rlHistoryIntervalStart.setDescription('The value of sysUpTime at the start of the interval over which this sample was measured. If the probe keeps track of the time of day, it should start the first sample of the history at a time such that when the next hour of the day begins, a sample is started at that instant. Note that following this rule may require the probe to delay collecting the first sample of the history, as each sample must be of the same interval. Also note that the sample which is currently being collected is not accessible in this table until the end of its interval.') rlHistoryValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlHistoryValue.setStatus('current') if mibBuilder.loadTexts: rlHistoryValue.setDescription('The value of the sampled counter at the time of this sampling.') rlControlHistoryControlQuotaBucket = MibScalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(8)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlControlHistoryControlQuotaBucket.setStatus('current') if mibBuilder.loadTexts: rlControlHistoryControlQuotaBucket.setDescription('Maximum number of buckets to be used by each rlHistoryControlTable entry.') rlControlHistoryControlMaxGlobalBuckets = MibScalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(300)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlControlHistoryControlMaxGlobalBuckets.setStatus('current') if mibBuilder.loadTexts: rlControlHistoryControlMaxGlobalBuckets.setDescription('Maximum number of buckets to be used by all rlHistoryControlTable entries together.') rlControlHistoryMaxEntries = MibScalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(300)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlControlHistoryMaxEntries.setStatus('current') if mibBuilder.loadTexts: rlControlHistoryMaxEntries.setDescription('Maximum number of rlHistoryTable entries.') mibBuilder.exportSymbols("CISCOSB-RMON", rlHistoryControlIndex=rlHistoryControlIndex, rlHistoryTable=rlHistoryTable, rlHistoryControlOwner=rlHistoryControlOwner, rlControlHistoryMaxEntries=rlControlHistoryMaxEntries, rlRmonControl=rlRmonControl, rlHistoryControlBucketsRequested=rlHistoryControlBucketsRequested, rlHistoryValue=rlHistoryValue, rlHistoryControlDataSource=rlHistoryControlDataSource, PYSNMP_MODULE_ID=rlRmonControl, rlControlHistoryControlQuotaBucket=rlControlHistoryControlQuotaBucket, rlHistoryControlEntry=rlHistoryControlEntry, rlRmonControlHistoryControlQuotaBucket=rlRmonControlHistoryControlQuotaBucket, rlHistoryIntervalStart=rlHistoryIntervalStart, rlHistoryEntry=rlHistoryEntry, rlHistoryIndex=rlHistoryIndex, rlHistorySampleIndex=rlHistorySampleIndex, rlHistoryControlBucketsGranted=rlHistoryControlBucketsGranted, rlHistoryControlTable=rlHistoryControlTable, rlControlHistoryControlMaxGlobalBuckets=rlControlHistoryControlMaxGlobalBuckets, rlRmonControlHistoryControlMaxGlobalBuckets=rlRmonControlHistoryControlMaxGlobalBuckets, rlRmonControlMibVersion=rlRmonControlMibVersion, rlHistoryControlStatus=rlHistoryControlStatus, rlHistoryControlInterval=rlHistoryControlInterval)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, constraints_union, single_value_constraint, value_size_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ConstraintsUnion', 'SingleValueConstraint', 'ValueSizeConstraint', 'ValueRangeConstraint') (switch001,) = mibBuilder.importSymbols('CISCOSB-MIB', 'switch001') (entry_status, owner_string) = mibBuilder.importSymbols('RMON-MIB', 'EntryStatus', 'OwnerString') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (object_identity, iso, gauge32, time_ticks, counter64, counter32, bits, notification_type, integer32, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, unsigned32, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'iso', 'Gauge32', 'TimeTicks', 'Counter64', 'Counter32', 'Bits', 'NotificationType', 'Integer32', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'Unsigned32', 'IpAddress') (truth_value, textual_convention, row_status, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TruthValue', 'TextualConvention', 'RowStatus', 'DisplayString') rl_rmon_control = module_identity((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49)) rlRmonControl.setRevisions(('2004-06-01 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: rlRmonControl.setRevisionsDescriptions(('Initial version of this MIB.',)) if mibBuilder.loadTexts: rlRmonControl.setLastUpdated('200406010000Z') if mibBuilder.loadTexts: rlRmonControl.setOrganization('Cisco Small Business') if mibBuilder.loadTexts: rlRmonControl.setContactInfo('Postal: 170 West Tasman Drive San Jose , CA 95134-1706 USA Website: Cisco Small Business Home http://www.cisco.com/smb>;, Cisco Small Business Support Community <http://www.cisco.com/go/smallbizsupport>') if mibBuilder.loadTexts: rlRmonControl.setDescription('The private MIB module definition for switch001 RMON MIB.') rl_rmon_control_mib_version = mib_scalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlRmonControlMibVersion.setStatus('current') if mibBuilder.loadTexts: rlRmonControlMibVersion.setDescription("The MIB's version. The current version is 1") rl_rmon_control_history_control_quota_bucket = mib_scalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)).clone(8)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlRmonControlHistoryControlQuotaBucket.setStatus('current') if mibBuilder.loadTexts: rlRmonControlHistoryControlQuotaBucket.setDescription('Maximum number of buckets to be used by each History Control group entry. changed to read only, value is derived from rsMaxRmonEtherHistoryEntrie') rl_rmon_control_history_control_max_global_buckets = mib_scalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)).clone(300)).setMaxAccess('readonly') if mibBuilder.loadTexts: rlRmonControlHistoryControlMaxGlobalBuckets.setStatus('current') if mibBuilder.loadTexts: rlRmonControlHistoryControlMaxGlobalBuckets.setDescription('Maximum number of buckets to be used by all History Control group entries together.') rl_history_control_table = mib_table((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4)) if mibBuilder.loadTexts: rlHistoryControlTable.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlTable.setDescription('A list of rlHistory control entries. This table is exactly like the corresponding RMON I History control group table, but is used to sample statistics of counters not specified by the RMON I statistics group.') rl_history_control_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1)).setIndexNames((0, 'CISCOSB-RMON', 'rlHistoryControlIndex')) if mibBuilder.loadTexts: rlHistoryControlEntry.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlEntry.setDescription('A list of parameters that set up a periodic sampling of statistics. As an example, an instance of the rlHistoryControlInterval object might be named rlHistoryControlInterval.2') rl_history_control_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlHistoryControlIndex.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlIndex.setDescription('An index that uniquely identifies an entry in the rlHistoryControl table. Each such entry defines a set of samples at a particular interval for a sampled counter.') rl_history_control_data_source = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 2), object_identifier()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlHistoryControlDataSource.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlDataSource.setDescription('This object identifies the source of the data for which historical data was collected and placed in the rlHistory table. This object may not be modified if the associated rlHistoryControlStatus object is equal to valid(1).') rl_history_control_buckets_requested = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)).clone(50)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlHistoryControlBucketsRequested.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlBucketsRequested.setDescription('The requested number of discrete time intervals over which data is to be saved in the part of the rlHistory table associated with this rlHistoryControlEntry. When this object is created or modified, the probe should set rlHistoryControlBucketsGranted as closely to this object as is possible for the particular probe implementation and available resources.') rl_history_control_buckets_granted = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlHistoryControlBucketsGranted.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlBucketsGranted.setDescription('The number of discrete sampling intervals over which data shall be saved in the part of the rlHistory table associated with this rlHistoryControlEntry. When the associated rlHistoryControlBucketsRequested object is created or modified, the probe should set this object as closely to the requested value as is possible for the particular probe implementation and available resources. The probe must not lower this value except as a result of a modification to the associated rlHistoryControlBucketsRequested object. There will be times when the actual number of buckets associated with this entry is less than the value of this object. In this case, at the end of each sampling interval, a new bucket will be added to the rlHistory table. When the number of buckets reaches the value of this object and a new bucket is to be added to the media-specific table, the oldest bucket associated with this rlHistoryControlEntry shall be deleted by the agent so that the new bucket can be added. When the value of this object changes to a value less than the current value, entries are deleted from the rlHistory table. Enough of the oldest of these entries shall be deleted by the agent so that their number remains less than or equal to the new value of this object. When the value of this object changes to a value greater than the current value, the number of associated rlHistory table entries may be allowed to grow.') rl_history_control_interval = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 3600)).clone(1800)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlHistoryControlInterval.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlInterval.setDescription('The interval in seconds over which the data is sampled for each bucket in the part of the rlHistory table associated with this rlHistoryControlEntry. This interval can be set to any number of seconds between 1 and 3600 (1 hour). Because the counters in a bucket may overflow at their maximum value with no indication, a prudent manager will take into account the possibility of overflow in any of the associated counters. It is important to consider the minimum time in which any counter could overflow and set the rlHistoryControlInterval object to a value This object may not be modified if the associated rlHistoryControlStatus object is equal to valid(1).') rl_history_control_owner = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 6), owner_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlHistoryControlOwner.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlOwner.setDescription('The entity that configured this entry and is therefore using the resources assigned to it.') rl_history_control_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 4, 1, 7), entry_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlHistoryControlStatus.setStatus('current') if mibBuilder.loadTexts: rlHistoryControlStatus.setDescription('The status of this rlHistoryControl entry. Each instance of the rlHistory table associated with this rlHistoryControlEntry will be deleted by the agent if this rlHistoryControlEntry is not equal to valid(1).') rl_history_table = mib_table((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5)) if mibBuilder.loadTexts: rlHistoryTable.setStatus('current') if mibBuilder.loadTexts: rlHistoryTable.setDescription('A list of history entries.') rl_history_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1)).setIndexNames((0, 'CISCOSB-RMON', 'rlHistoryIndex'), (0, 'CISCOSB-RMON', 'rlHistorySampleIndex')) if mibBuilder.loadTexts: rlHistoryEntry.setStatus('current') if mibBuilder.loadTexts: rlHistoryEntry.setDescription('An historical statistics sample of a counter specified by the corresponding history control entry. This sample is associated with the rlHistoryControlEntry which set up the parameters for a regular collection of these samples. As an example, an instance of the rlHistoryPkts object might be named rlHistoryPkts.2.89') rl_history_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlHistoryIndex.setStatus('current') if mibBuilder.loadTexts: rlHistoryIndex.setDescription('The history of which this entry is a part. The history identified by a particular value of this index is the same history as identified by the same value of rlHistoryControlIndex.') rl_history_sample_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlHistorySampleIndex.setStatus('current') if mibBuilder.loadTexts: rlHistorySampleIndex.setDescription('An index that uniquely identifies the particular sample this entry represents among all samples associated with the same rlHistoryControlEntry. This index starts at 1 and increases by one as each new sample is taken.') rl_history_interval_start = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1, 3), time_ticks()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlHistoryIntervalStart.setStatus('current') if mibBuilder.loadTexts: rlHistoryIntervalStart.setDescription('The value of sysUpTime at the start of the interval over which this sample was measured. If the probe keeps track of the time of day, it should start the first sample of the history at a time such that when the next hour of the day begins, a sample is started at that instant. Note that following this rule may require the probe to delay collecting the first sample of the history, as each sample must be of the same interval. Also note that the sample which is currently being collected is not accessible in this table until the end of its interval.') rl_history_value = mib_table_column((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 5, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlHistoryValue.setStatus('current') if mibBuilder.loadTexts: rlHistoryValue.setDescription('The value of the sampled counter at the time of this sampling.') rl_control_history_control_quota_bucket = mib_scalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 6), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)).clone(8)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlControlHistoryControlQuotaBucket.setStatus('current') if mibBuilder.loadTexts: rlControlHistoryControlQuotaBucket.setDescription('Maximum number of buckets to be used by each rlHistoryControlTable entry.') rl_control_history_control_max_global_buckets = mib_scalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 7), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)).clone(300)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlControlHistoryControlMaxGlobalBuckets.setStatus('current') if mibBuilder.loadTexts: rlControlHistoryControlMaxGlobalBuckets.setDescription('Maximum number of buckets to be used by all rlHistoryControlTable entries together.') rl_control_history_max_entries = mib_scalar((1, 3, 6, 1, 4, 1, 9, 6, 1, 101, 49, 8), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535)).clone(300)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlControlHistoryMaxEntries.setStatus('current') if mibBuilder.loadTexts: rlControlHistoryMaxEntries.setDescription('Maximum number of rlHistoryTable entries.') mibBuilder.exportSymbols('CISCOSB-RMON', rlHistoryControlIndex=rlHistoryControlIndex, rlHistoryTable=rlHistoryTable, rlHistoryControlOwner=rlHistoryControlOwner, rlControlHistoryMaxEntries=rlControlHistoryMaxEntries, rlRmonControl=rlRmonControl, rlHistoryControlBucketsRequested=rlHistoryControlBucketsRequested, rlHistoryValue=rlHistoryValue, rlHistoryControlDataSource=rlHistoryControlDataSource, PYSNMP_MODULE_ID=rlRmonControl, rlControlHistoryControlQuotaBucket=rlControlHistoryControlQuotaBucket, rlHistoryControlEntry=rlHistoryControlEntry, rlRmonControlHistoryControlQuotaBucket=rlRmonControlHistoryControlQuotaBucket, rlHistoryIntervalStart=rlHistoryIntervalStart, rlHistoryEntry=rlHistoryEntry, rlHistoryIndex=rlHistoryIndex, rlHistorySampleIndex=rlHistorySampleIndex, rlHistoryControlBucketsGranted=rlHistoryControlBucketsGranted, rlHistoryControlTable=rlHistoryControlTable, rlControlHistoryControlMaxGlobalBuckets=rlControlHistoryControlMaxGlobalBuckets, rlRmonControlHistoryControlMaxGlobalBuckets=rlRmonControlHistoryControlMaxGlobalBuckets, rlRmonControlMibVersion=rlRmonControlMibVersion, rlHistoryControlStatus=rlHistoryControlStatus, rlHistoryControlInterval=rlHistoryControlInterval)
#!/usr/bin/env/ python3 """SoloLearn > Code Coach > Hovercraft""" sales = int(input('How many did you sell? ')) * 3 expense = 21 if sales > expense: print('Profit') elif sales < expense: print('Loss') else: print('Broke Even')
"""SoloLearn > Code Coach > Hovercraft""" sales = int(input('How many did you sell? ')) * 3 expense = 21 if sales > expense: print('Profit') elif sales < expense: print('Loss') else: print('Broke Even')
class SearchResult(object): """Class representing a return object for a search query. Attributes: path: An array representing the path from a start node to the end node, empty if there is no path. path_len: The length of the path represented by path, 0 if path is empty. ele_gain: The cumulative elevation gain through the path, 0 if path is empty. """ def __init__(self, path=[], path_len=0, ele_gain=0): self.path = path self.path_len = path_len self.ele_gain = ele_gain
class Searchresult(object): """Class representing a return object for a search query. Attributes: path: An array representing the path from a start node to the end node, empty if there is no path. path_len: The length of the path represented by path, 0 if path is empty. ele_gain: The cumulative elevation gain through the path, 0 if path is empty. """ def __init__(self, path=[], path_len=0, ele_gain=0): self.path = path self.path_len = path_len self.ele_gain = ele_gain
class Stats: writes: int reads: int accesses: int def __init__(self) -> None: self.reset() def reset(self) -> None: self.writes = 0 self.reads = 0 self.accesses = 0 def add_reads(self, count: int = 1) -> None: self.reads += count self.accesses += count def add_writes(self, count: int = 1) -> None: self.writes += count self.accesses += count
class Stats: writes: int reads: int accesses: int def __init__(self) -> None: self.reset() def reset(self) -> None: self.writes = 0 self.reads = 0 self.accesses = 0 def add_reads(self, count: int=1) -> None: self.reads += count self.accesses += count def add_writes(self, count: int=1) -> None: self.writes += count self.accesses += count
colors = ['black', 'white'] sizes = ['S', 'M', 'L'] tshirts = [ (color, size) for color in colors for size in sizes ] print(f"Cartesian products from {colors} and {sizes}: {tshirts}")
colors = ['black', 'white'] sizes = ['S', 'M', 'L'] tshirts = [(color, size) for color in colors for size in sizes] print(f'Cartesian products from {colors} and {sizes}: {tshirts}')
class Eventseverity(basestring): """ EMERGENCY|ALERT|CRITICAL|ERROR|WARNING|NOTICE|INFORMATIONAL|DEBUG Possible values: <ul> <li> "emergency" - System is unusable, <li> "alert" - Action must be taken immediately, <li> "critical" - Critical condition, <li> "error" - Error condition, <li> "warning" - Warning condition, <li> "notice" - Normal but significant condition, <li> "informational" - Information message, <li> "debug" - A debugging message </ul> """ @staticmethod def get_api_name(): return "eventseverity"
class Eventseverity(basestring): """ EMERGENCY|ALERT|CRITICAL|ERROR|WARNING|NOTICE|INFORMATIONAL|DEBUG Possible values: <ul> <li> "emergency" - System is unusable, <li> "alert" - Action must be taken immediately, <li> "critical" - Critical condition, <li> "error" - Error condition, <li> "warning" - Warning condition, <li> "notice" - Normal but significant condition, <li> "informational" - Information message, <li> "debug" - A debugging message </ul> """ @staticmethod def get_api_name(): return 'eventseverity'
MAX_SENTENCE = 30 MAX_ALL = 50 MAX_SENT_LENGTH=MAX_SENTENCE MAX_SENTS=MAX_ALL max_entity_num = 10 num = 100 num1 = 200 num2 = 100 npratio=4
max_sentence = 30 max_all = 50 max_sent_length = MAX_SENTENCE max_sents = MAX_ALL max_entity_num = 10 num = 100 num1 = 200 num2 = 100 npratio = 4
""" File defining the classes Normalize and Standardize used respectively to normalize and standardize the data set. """ class Normalize(object): """ Data pre-processing class to normalize data so the values are in the range [new_min, new_max]. """ def __init__(self, min_, max_, new_min=0, new_max=1): """ Initializer. :param min_: Min of the un-normalized data. :param max_: Max of the un-normalized data. :param new_min: Min of the new data. :param new_max: Max of the new data. """ self.min = min_ self.max = max_ self.new_min = new_min self.new_max = new_max def __call__(self, data): """ Normalize a given data point. :param data: Data point to normalize. :return: Normalized data. """ data = (self.new_max - self.new_min)*(data - self.min)/(self.max - self.min) + self.new_min return data class Standardize(object): """ Data pre-processing class to standardize data so the values have a fixed mean and standard deviation. """ def __init__(self, mean, std): """ Initializer. :param mean: Mean of the un-standardized data. :param std: Std of the un-standardized data. """ self.mean = mean self.std = std def __call__(self, data): """ Standardize a given data point. :param data: Data point to standardize. :return: Standardized data. """ data = (data - self.mean)/self.std return data
""" File defining the classes Normalize and Standardize used respectively to normalize and standardize the data set. """ class Normalize(object): """ Data pre-processing class to normalize data so the values are in the range [new_min, new_max]. """ def __init__(self, min_, max_, new_min=0, new_max=1): """ Initializer. :param min_: Min of the un-normalized data. :param max_: Max of the un-normalized data. :param new_min: Min of the new data. :param new_max: Max of the new data. """ self.min = min_ self.max = max_ self.new_min = new_min self.new_max = new_max def __call__(self, data): """ Normalize a given data point. :param data: Data point to normalize. :return: Normalized data. """ data = (self.new_max - self.new_min) * (data - self.min) / (self.max - self.min) + self.new_min return data class Standardize(object): """ Data pre-processing class to standardize data so the values have a fixed mean and standard deviation. """ def __init__(self, mean, std): """ Initializer. :param mean: Mean of the un-standardized data. :param std: Std of the un-standardized data. """ self.mean = mean self.std = std def __call__(self, data): """ Standardize a given data point. :param data: Data point to standardize. :return: Standardized data. """ data = (data - self.mean) / self.std return data
n=1 def f(x): print(n) f(0)
n = 1 def f(x): print(n) f(0)
# creates a list and prints it days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] # traversing without an index for day in days: print(day) # traversing with an index for i in range(len(days)): print(f"Day {i} is {days[i]}") days[1] = "Lunes" print("Day[1] is now ",days[1]) for day in days: print(day)
days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] for day in days: print(day) for i in range(len(days)): print(f'Day {i} is {days[i]}') days[1] = 'Lunes' print('Day[1] is now ', days[1]) for day in days: print(day)
# -*- coding: utf-8 -*- # Memory addresses ADDRESS_R15 = 0x400f ADDRESS_ADC_POWER = 0x4062 ADDRESS_ADC_BATTERY = 0x4063 ADDRESS_LEVELA = 0x4064 ADDRESS_LEVELB = 0x4065 ADDRESS_PUSH_BUTTON = 0x4068 ADDRESS_COMMAND_1 = 0x4070 ADDRESS_COMMAND_2 = 0x4071 ADDRESS_MA_MIN_VALUE = 0x4086 ADDRESS_MA_MAX_VALUE = 0x4087 ADDRESS_CURRENT_MODE = 0x407b ADDRESS_LCD_WRITE_PARAMETER_1 = 0x4180 ADDRESS_LCD_WRITE_PARAMETER_2 = 0x4181 ADDRESS_POWER_LEVEL = 0x41f4 ADDRESS_BATTERY_LEVEL = 0x4203 ADDRESS_LEVELMA = 0x420D ADDRESS_KEY = 0x4213 # EEPROM addresses EEPROM_ADDRESS_POWER_LEVEL = 0x8009 EEPROM_ADDRESS_FAVORITE_MODE = 0x800C # Commands COMMAND_START_FAVORITE_MODULE = 0x00 COMMAND_EXIT_MENU = 0x04 COMMAND_SHOW_MAIN_MENU = 0x0a COMMAND_NEW_MODE = 0x12 COMMAND_WRITE_STRING_TO_LCD = 0x15 COMMAND_NO_COMMAND = 0xff # Modes MODE_POWERON = 0x00 MODE_UNKNOWN = 0x01 MODE_WAVES = 0x76 MODE_STROKE = 0x77 MODE_CLIMB = 0x78 MODE_COMBO = 0x79 MODE_INTENSE = 0x7a MODE_RYTHM = 0x7b MODE_AUDIO1 = 0x7c MODE_AUDIO2 = 0x7d MODE_AUDIO3 = 0x7e MODE_SPLIT = 0x7f MODE_RANDOM1 = 0x80 MODE_RANDOM2 = 0x81 MODE_TOGGLE = 0x82 MODE_ORGASM = 0x83 MODE_TORMENT = 0x84 MODE_PHASE1 = 0x85 MODE_PHASE2 = 0x86 MODE_PHASE3 = 0x87 MODE_USER1 = 0x88 MODE_USER2 = 0x89 MODE_USER3 = 0x8a MODE_USER4 = 0x8b MODE_USER5 = 0x8c MODE_USER6 = 0x8d MODE_USER7 = 0x8e # Power Level POWERLEVEL_LOW = 0x01 POWERLEVEL_NORMAL = 0x02 POWERLEVEL_HIGH = 0x03 # Register 15 Bits REGISTER_15_ADCDISABLE = 0 # Buttons BUTTON_MENU = 0x80 BUTTON_OK = 0x20 BUTTON_RIGHT = 0x40 BUTTON_LEFT = 0x10
address_r15 = 16399 address_adc_power = 16482 address_adc_battery = 16483 address_levela = 16484 address_levelb = 16485 address_push_button = 16488 address_command_1 = 16496 address_command_2 = 16497 address_ma_min_value = 16518 address_ma_max_value = 16519 address_current_mode = 16507 address_lcd_write_parameter_1 = 16768 address_lcd_write_parameter_2 = 16769 address_power_level = 16884 address_battery_level = 16899 address_levelma = 16909 address_key = 16915 eeprom_address_power_level = 32777 eeprom_address_favorite_mode = 32780 command_start_favorite_module = 0 command_exit_menu = 4 command_show_main_menu = 10 command_new_mode = 18 command_write_string_to_lcd = 21 command_no_command = 255 mode_poweron = 0 mode_unknown = 1 mode_waves = 118 mode_stroke = 119 mode_climb = 120 mode_combo = 121 mode_intense = 122 mode_rythm = 123 mode_audio1 = 124 mode_audio2 = 125 mode_audio3 = 126 mode_split = 127 mode_random1 = 128 mode_random2 = 129 mode_toggle = 130 mode_orgasm = 131 mode_torment = 132 mode_phase1 = 133 mode_phase2 = 134 mode_phase3 = 135 mode_user1 = 136 mode_user2 = 137 mode_user3 = 138 mode_user4 = 139 mode_user5 = 140 mode_user6 = 141 mode_user7 = 142 powerlevel_low = 1 powerlevel_normal = 2 powerlevel_high = 3 register_15_adcdisable = 0 button_menu = 128 button_ok = 32 button_right = 64 button_left = 16
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 13 11:34:33 2019 @author: manninan """
""" Created on Thu Jun 13 11:34:33 2019 @author: manninan """
r""" .. include::../README.md :start-line: 1 """
""" .. include::../README.md :start-line: 1 """
# http://www.codewars.com/kata/55f73f66d160f1f1db000059/ def combine_names(first_name, last_name): return "{0} {1}".format(first_name, last_name)
def combine_names(first_name, last_name): return '{0} {1}'.format(first_name, last_name)
class DefaultPreferences(type): """The type for Default Preferences that cannot be modified""" def __setattr__(cls, key, value): if key == "defaults": raise AttributeError("Cannot override defaults") else: return type.__setattr__(cls, key, value) def __delattr__(cls, item): if item == "defaults": raise AttributeError("Cannot delete defaults") else: return type.__delattr__(cls, item) class Preferences(object): """The base Preferences class""" __metaclass__ = DefaultPreferences def list(self): print(self.__dict__) return self.__dict__ def defaults(self): return tuple(self.__dict__.values()) class GraphPreferences(object): """Handles graphing preferences.""" class Plot(object): boxplot = True histogram = True cdf = False oneway = True probplot = True scatter = True tukey = False histogram_borders = False boxplot_borders = False defaults = (boxplot, histogram, cdf, oneway, probplot, scatter, tukey, histogram_borders, boxplot_borders) distribution = {'counts': False, 'violin': False, 'boxplot': True, 'fit': False, 'fit_style': 'r--', 'fit_width': '2', 'cdf_style': 'k-', 'distribution': 'norm', 'bins': 20, 'color': 'green' } bivariate = {'points': True, 'point_style': 'k.', 'contours': False, 'contour_width': 1.25, 'fit': True, 'fit_style': 'r-', 'fit_width': 1, 'boxplot': True, 'violin': True, 'bins': 20, 'color': 'green' } oneway = {'boxplot': True, 'violin': False, 'point_style': '^', 'line_style': '-' }
class Defaultpreferences(type): """The type for Default Preferences that cannot be modified""" def __setattr__(cls, key, value): if key == 'defaults': raise attribute_error('Cannot override defaults') else: return type.__setattr__(cls, key, value) def __delattr__(cls, item): if item == 'defaults': raise attribute_error('Cannot delete defaults') else: return type.__delattr__(cls, item) class Preferences(object): """The base Preferences class""" __metaclass__ = DefaultPreferences def list(self): print(self.__dict__) return self.__dict__ def defaults(self): return tuple(self.__dict__.values()) class Graphpreferences(object): """Handles graphing preferences.""" class Plot(object): boxplot = True histogram = True cdf = False oneway = True probplot = True scatter = True tukey = False histogram_borders = False boxplot_borders = False defaults = (boxplot, histogram, cdf, oneway, probplot, scatter, tukey, histogram_borders, boxplot_borders) distribution = {'counts': False, 'violin': False, 'boxplot': True, 'fit': False, 'fit_style': 'r--', 'fit_width': '2', 'cdf_style': 'k-', 'distribution': 'norm', 'bins': 20, 'color': 'green'} bivariate = {'points': True, 'point_style': 'k.', 'contours': False, 'contour_width': 1.25, 'fit': True, 'fit_style': 'r-', 'fit_width': 1, 'boxplot': True, 'violin': True, 'bins': 20, 'color': 'green'} oneway = {'boxplot': True, 'violin': False, 'point_style': '^', 'line_style': '-'}
# ------------------------------------------ # # Program created by Maksim Kumundzhiev # # # email: kumundzhievmaxim@gmail.com # github: https://github.com/KumundzhievMaxim # ------------------------------------------- BATCH_SIZE = 10 IMG_SIZE = (160, 160) MODEL_PATH = 'checkpoints/model'
batch_size = 10 img_size = (160, 160) model_path = 'checkpoints/model'
#1 num = int(input("Enter a number : ")) largest_divisor = 0 #2 for i in range(2, num): #3 if num % i == 0: #4 largest_divisor = i #5 print("Largest divisor of {} is {}".format(num,largest_divisor))
num = int(input('Enter a number : ')) largest_divisor = 0 for i in range(2, num): if num % i == 0: largest_divisor = i print('Largest divisor of {} is {}'.format(num, largest_divisor))
class ObjectProperties: def __init__(self, object_id, extra_data=None, ticket_type=None, quantity=None): if extra_data: self.extraData = extra_data self.objectId = object_id if ticket_type: self.ticketType = ticket_type if quantity: self.quantity = quantity
class Objectproperties: def __init__(self, object_id, extra_data=None, ticket_type=None, quantity=None): if extra_data: self.extraData = extra_data self.objectId = object_id if ticket_type: self.ticketType = ticket_type if quantity: self.quantity = quantity
class Solution: def lengthOfLongestSubstring(self, s: str) -> int: if len(s) == 0: return 0 m = 1 for _ in range(len(s)): i = 0 S = set() for x in range(_, len(s)): if s[x] not in S: S.add(s[x]) i += 1 else: break m = max(i, m) return m
class Solution: def length_of_longest_substring(self, s: str) -> int: if len(s) == 0: return 0 m = 1 for _ in range(len(s)): i = 0 s = set() for x in range(_, len(s)): if s[x] not in S: S.add(s[x]) i += 1 else: break m = max(i, m) return m
lookup = [ (10, "x"), (9, "ix"), (5, "v"), (4, "iv"), (1, "i"), ] def to_roman(integer): # """ """ for decimal, roman in lookup: if decimal <= integer: return roman + to_roman(integer - decimal) return "" def main(): print(to_roman(1)) print(to_roman(2)) print(to_roman(4)) print(to_roman(5)) print(to_roman(6)) print(to_roman(9)) print(to_roman(10)) print(to_roman(11)) print(to_roman(36)) if __name__ == "__main__": main()
lookup = [(10, 'x'), (9, 'ix'), (5, 'v'), (4, 'iv'), (1, 'i')] def to_roman(integer): """ """ for (decimal, roman) in lookup: if decimal <= integer: return roman + to_roman(integer - decimal) return '' def main(): print(to_roman(1)) print(to_roman(2)) print(to_roman(4)) print(to_roman(5)) print(to_roman(6)) print(to_roman(9)) print(to_roman(10)) print(to_roman(11)) print(to_roman(36)) if __name__ == '__main__': main()
class Stack: def __init__(self): self.items = [] def is_empty(self): # test to see whether the stack is empty. return self.items == [] def push(self, item): # adds a new item to the top of the stack. self.items.append(item) def pop(self): # removes the top item from the stack. return self.items.pop() def peek(self): # return the top item from the stack. return self.items[len(self.items) - 1] def size(self): # returns the number of items on the stack. return len(self.items) def base_converter(dec_number, base): digits = "0123456789ABCDEF" rem_stack = Stack() while dec_number > 0: rem = dec_number % base rem_stack.push(rem) dec_number = dec_number // base new_string = "" while not rem_stack.is_empty(): new_string = new_string + digits[rem_stack.pop()] return new_string print(base_converter(196, 2)) print(base_converter(25, 8)) print(base_converter(26, 16))
class Stack: def __init__(self): self.items = [] def is_empty(self): return 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 base_converter(dec_number, base): digits = '0123456789ABCDEF' rem_stack = stack() while dec_number > 0: rem = dec_number % base rem_stack.push(rem) dec_number = dec_number // base new_string = '' while not rem_stack.is_empty(): new_string = new_string + digits[rem_stack.pop()] return new_string print(base_converter(196, 2)) print(base_converter(25, 8)) print(base_converter(26, 16))
class Book: def __init__(self, title, author, location): self.title = title self.author = author self.location = location self.page = 0 def turn_page(self, page): self.page = page
class Book: def __init__(self, title, author, location): self.title = title self.author = author self.location = location self.page = 0 def turn_page(self, page): self.page = page
class Entity(object): ''' An entity has: - energy - position(x,y) - size(length, width) An entity may have a parent entity An entity may have child entities ''' def __init__( self, p, parent=None, children=None): self.p = p self.energy = p.getfloat("ENTITY", "energy") self.x_pos = p.getfloat("ENTITY", "x_pos") self.y_pos = p.getfloat("ENTITY", "y_pos") self.length = p.getint("ENTITY", "length") self.width = p.getint("ENTITY", "width") self.parent = parent if children is None: self.children = [] else: self.children = children def add_child(self, entity): self.children.append(entity) def remove_child(self, entity): self.children.remove(entity) def remove_self(self): if self.parent is not None: self.parent.children.remove(self) def number_children(self): if self.children: return len(self.children) else: return 0 def total_energy(self): ''' returns the sum of all energy ''' total_energy = self.energy for child in self.children: total_energy += child.energy return total_energy def set_bounds(self, x, y): ''' Ensure that x, y are within the bounds of this entity. Reset x,y so that a torus is formed ''' if x < 0.0: x = self.length if x > self.length: x = 0.0 if y < 0.0: y = self.width if y > self.width: y = 0.0 return x, y
class Entity(object): """ An entity has: - energy - position(x,y) - size(length, width) An entity may have a parent entity An entity may have child entities """ def __init__(self, p, parent=None, children=None): self.p = p self.energy = p.getfloat('ENTITY', 'energy') self.x_pos = p.getfloat('ENTITY', 'x_pos') self.y_pos = p.getfloat('ENTITY', 'y_pos') self.length = p.getint('ENTITY', 'length') self.width = p.getint('ENTITY', 'width') self.parent = parent if children is None: self.children = [] else: self.children = children def add_child(self, entity): self.children.append(entity) def remove_child(self, entity): self.children.remove(entity) def remove_self(self): if self.parent is not None: self.parent.children.remove(self) def number_children(self): if self.children: return len(self.children) else: return 0 def total_energy(self): """ returns the sum of all energy """ total_energy = self.energy for child in self.children: total_energy += child.energy return total_energy def set_bounds(self, x, y): """ Ensure that x, y are within the bounds of this entity. Reset x,y so that a torus is formed """ if x < 0.0: x = self.length if x > self.length: x = 0.0 if y < 0.0: y = self.width if y > self.width: y = 0.0 return (x, y)
""" https://leetcode.com/problems/longest-substring-without-repeating-characters/ Given a string, find the length of the longest substring without repeating characters. """ class Solution: def lengthOfLongestSubstring(self, s): longest = 0 longest_substr = "" for ch in s: if ch not in longest_substr: longest_substr += ch else: if len(longest_substr) > longest: longest = len(longest_substr) longest_substr = longest_substr[(longest_substr.find(ch)+1):] + ch return max(longest, len(longest_substr)) s=Solution() print(s.lengthOfLongestSubstring("umvejcuuk"))
""" https://leetcode.com/problems/longest-substring-without-repeating-characters/ Given a string, find the length of the longest substring without repeating characters. """ class Solution: def length_of_longest_substring(self, s): longest = 0 longest_substr = '' for ch in s: if ch not in longest_substr: longest_substr += ch else: if len(longest_substr) > longest: longest = len(longest_substr) longest_substr = longest_substr[longest_substr.find(ch) + 1:] + ch return max(longest, len(longest_substr)) s = solution() print(s.lengthOfLongestSubstring('umvejcuuk'))
N = int(input()) A = list(map(int, input().split())) d = {} for i in range(N - 1): if A[i] in d: d[A[i]].append(i + 2) else: d[A[i]] = [i + 2] for i in range(1, N + 1): if i in d: print(len(d[i])) else: print(0)
n = int(input()) a = list(map(int, input().split())) d = {} for i in range(N - 1): if A[i] in d: d[A[i]].append(i + 2) else: d[A[i]] = [i + 2] for i in range(1, N + 1): if i in d: print(len(d[i])) else: print(0)
GENERIC = [ 'Half of US adults have had family jailed', 'Judge stopped me winning election', 'Stock markets stabilise after earlier sell-off' ] NON_GENERIC = [ 'Leicester helicopter rotor controls failed', 'Pizza Express founder Peter Boizot dies aged 89', 'Senior Tory suggests vote could be delayed' ]
generic = ['Half of US adults have had family jailed', 'Judge stopped me winning election', 'Stock markets stabilise after earlier sell-off'] non_generic = ['Leicester helicopter rotor controls failed', 'Pizza Express founder Peter Boizot dies aged 89', 'Senior Tory suggests vote could be delayed']
class Solution: def uniqueLetterString(self, S: str) -> int: idxes = {ch : (-1, -1) for ch in string.ascii_uppercase} ans = 0 for idx, ch in enumerate(S): i, j = idxes[ch] ans += (j - i) * (idx - j) idxes[ch] = j, idx for i, j in idxes.values(): ans += (j - i) * (len(S) - j) return ans % (int(1e9) + 7)
class Solution: def unique_letter_string(self, S: str) -> int: idxes = {ch: (-1, -1) for ch in string.ascii_uppercase} ans = 0 for (idx, ch) in enumerate(S): (i, j) = idxes[ch] ans += (j - i) * (idx - j) idxes[ch] = (j, idx) for (i, j) in idxes.values(): ans += (j - i) * (len(S) - j) return ans % (int(1000000000.0) + 7)
class Image_Anotation: def __init__(self, id, image, path_image): self.id = id self.FOV = [0.30,0.60] self.image = image self.list_roi=[] self.list_compose_ROI=[] self.id_roi=0 self.path_image = path_image def set_image(self, image): self.image = image def get_image(self): return self.image def get_id(self): return self.id def get_path(self): return self.path_image def get_list_roi(self): return self.list_roi def add_ROI(self, roi): self.id_roi += 1 roi.set_id(self.id_roi) self.list_roi.append(roi) #return roi to get the id return roi def delet_ROI(self, id): for element in self.list_roi: if element.get_id() == id: self.list_roi.remove(element) self.id_roi -= 1 break for element in self.list_roi: if element.get_id() > id: new_id = element.get_id() - 1 element.set_id(new_id) def edit_roi(self, roi): self.list_roi[(roi.get_id()-1)] = roi def delet_list_roi(self): self.list_roi.clear() def add_compose_ROI(self, compose_ROI): self.list_compose_ROI.append(compose_ROI) def get_list_compose_ROI(self): return self.list_compose_ROI def get_compose_ROI(self, id): for roi in self.list_compose_ROI: if roi.get_id() == id: return roi return None def delete_compose_ROI(self, id): for element in self.list_compose_ROI: if element.get_id() == id: self.list_compose_ROI.remove(element) break for element in self.list_compose_ROI: if element.get_id() > id: new_id = element.get_id() - 1 element.set_id(new_id) def modify_compose_ROI(self, id, compose_ROI): self.list_compose_ROI[id]= compose_ROI
class Image_Anotation: def __init__(self, id, image, path_image): self.id = id self.FOV = [0.3, 0.6] self.image = image self.list_roi = [] self.list_compose_ROI = [] self.id_roi = 0 self.path_image = path_image def set_image(self, image): self.image = image def get_image(self): return self.image def get_id(self): return self.id def get_path(self): return self.path_image def get_list_roi(self): return self.list_roi def add_roi(self, roi): self.id_roi += 1 roi.set_id(self.id_roi) self.list_roi.append(roi) return roi def delet_roi(self, id): for element in self.list_roi: if element.get_id() == id: self.list_roi.remove(element) self.id_roi -= 1 break for element in self.list_roi: if element.get_id() > id: new_id = element.get_id() - 1 element.set_id(new_id) def edit_roi(self, roi): self.list_roi[roi.get_id() - 1] = roi def delet_list_roi(self): self.list_roi.clear() def add_compose_roi(self, compose_ROI): self.list_compose_ROI.append(compose_ROI) def get_list_compose_roi(self): return self.list_compose_ROI def get_compose_roi(self, id): for roi in self.list_compose_ROI: if roi.get_id() == id: return roi return None def delete_compose_roi(self, id): for element in self.list_compose_ROI: if element.get_id() == id: self.list_compose_ROI.remove(element) break for element in self.list_compose_ROI: if element.get_id() > id: new_id = element.get_id() - 1 element.set_id(new_id) def modify_compose_roi(self, id, compose_ROI): self.list_compose_ROI[id] = compose_ROI
NEO_HOST = "seed3.neo.org" MAINNET_HTTP_RPC_PORT = 10332 MAINNET_HTTPS_RPC_PORT = 10331 TESTNET_HTTP_RPC_PORT = 20332 TESTNET_HTTPS_RPC_PORT = 20331
neo_host = 'seed3.neo.org' mainnet_http_rpc_port = 10332 mainnet_https_rpc_port = 10331 testnet_http_rpc_port = 20332 testnet_https_rpc_port = 20331
# first.n.squares.manual.method.py def get_squares_gen(n): for x in range(n): yield x ** 2 squares = get_squares_gen(3) print(squares.__next__()) # prints: 0 print(squares.__next__()) # prints: 1 print(squares.__next__()) # prints: 4 # the following raises StopIteration, the generator is exhausted, # any further call to next will keep raising StopIteration print(squares.__next__())
def get_squares_gen(n): for x in range(n): yield (x ** 2) squares = get_squares_gen(3) print(squares.__next__()) print(squares.__next__()) print(squares.__next__()) print(squares.__next__())
class binary_tree: def __init__(self): pass class Node(binary_tree): __field_0 : int __field_1 : binary_tree __field_2 : binary_tree def __init__(self, arg_0 : int , arg_1 : binary_tree , arg_2 : binary_tree ): self.__field_0 = arg_0 self.__field_1 = arg_1 self.__field_2 = arg_2 def __iter__(self): yield self.__field_0 yield self.__field_1 yield self.__field_2 class Leaf(binary_tree): __field_0 : int def __init__(self, arg_0 : int ): self.__field_0 = arg_0 def __iter__(self): yield self.__field_0
class Binary_Tree: def __init__(self): pass class Node(binary_tree): __field_0: int __field_1: binary_tree __field_2: binary_tree def __init__(self, arg_0: int, arg_1: binary_tree, arg_2: binary_tree): self.__field_0 = arg_0 self.__field_1 = arg_1 self.__field_2 = arg_2 def __iter__(self): yield self.__field_0 yield self.__field_1 yield self.__field_2 class Leaf(binary_tree): __field_0: int def __init__(self, arg_0: int): self.__field_0 = arg_0 def __iter__(self): yield self.__field_0
def main(): _ = input() string = input() if _ == 0 or _ == 1: return 0 if _ == 2: if string[0] == string[1]: return 1 return 0 last = string[0] cnt = 0 for i in range(1, len(string)): if string[i] == last: cnt += 1 last = string[i] return cnt print(main())
def main(): _ = input() string = input() if _ == 0 or _ == 1: return 0 if _ == 2: if string[0] == string[1]: return 1 return 0 last = string[0] cnt = 0 for i in range(1, len(string)): if string[i] == last: cnt += 1 last = string[i] return cnt print(main())
num = int(input("Enter a number: ")) sum = 0; size = 0; temp = num; temp2 = num while(temp2!=0): size += 1 temp2 = int(temp2/10) while(temp!=0): remainder = temp%10 sum += remainder**size temp = int(temp/10) if(sum == num): print("It's an armstrong number") else: print("It's not an armstrong number")
num = int(input('Enter a number: ')) sum = 0 size = 0 temp = num temp2 = num while temp2 != 0: size += 1 temp2 = int(temp2 / 10) while temp != 0: remainder = temp % 10 sum += remainder ** size temp = int(temp / 10) if sum == num: print("It's an armstrong number") else: print("It's not an armstrong number")
#!/usr/bin/env python3 """This is a simple python3 calculator for demonstration purposes some to-do's but we'll get to that""" __author__ = "Sebastian Meier zu Biesen" __copyright__ = "2000-2019 by MzB Solutions" __email__ = "smzb@mitos-kalandiel.me" class Calculator(object): @property def isDebug(self): return self._isDebug @isDebug.setter def isDebug(self, bDebug): self._isDebug = bDebug @isDebug.deleter def isDebug(self): del self._isDebug @property def isInteractive(self): return self._isInteractive @isInteractive.setter def isInteractive(self, bInteractive): self._isInteractive = bInteractive @isInteractive.deleter def isInteractive(self): del self._isInteractive @property def Operation(self): return self._Operation @Operation.setter def Operation(self, iOperation): self._Operation = iOperation @Operation.deleter def Operation(self): del self._Operation @property def Num1(self): return self._Num1 @Num1.setter def Num1(self, iNum): if not isinstance(iNum, int): raise TypeError self._Num1 = iNum @Num1.deleter def Num1(self): del self._Num1 @property def Num2(self): return self._Num2 @Num2.setter def Num2(self, iNum): if not isinstance(iNum, int): raise TypeError self._Num2 = iNum @Num2.deleter def Num2(self): del self._Num2 def __init__(self): self._isDebug = False self._isInteractive = False self._Operation = None self._Num1 = None self._Num2 = None def add(self): """This functions adds two numbers""" return self._Num1 + self._Num2 def subtract(self): """This is a simple subtraction function""" return self._Num1 - self._Num2 def multiply(self): """Again a simple multiplication""" return self._Num1 * self._Num2 def divide(self): """division function todo: (smzb/js) make division by 0 impossible""" return self._Num1 / self._Num2 def ask_op(self): """Lets ask what the user wants to do""" print("Please select operation -\n" "1. Add\n" "2. Subtract\n" "3. Multiply\n" "4. Divide\n") # Take input from the user result = input("Select operations from 1, 2, 3, 4 :") return int(result) def ask_number(self): """Get a number from the user""" num = int(input("Enter an operand: ")) return num def eval_operation(self): """Now evaluate what operation the user wants, and run the consecutive function""" if self._Operation == 1: print(self._Num1, "+", self._Num2, "=", Calculator.add(self)) elif self._Operation == 2: print(self._Num1, "-", self._Num2, "=", Calculator.subtract(self)) elif self._Operation == 3: print(self._Num1, "*", self._Num2, "=", Calculator.multiply(self)) elif self._Operation == 4: print(self._Num1, "/", self._Num2, "=", Calculator.divide(self)) elif self._Operation == 0: return else: print("Invalid operation")
"""This is a simple python3 calculator for demonstration purposes some to-do's but we'll get to that""" __author__ = 'Sebastian Meier zu Biesen' __copyright__ = '2000-2019 by MzB Solutions' __email__ = 'smzb@mitos-kalandiel.me' class Calculator(object): @property def is_debug(self): return self._isDebug @isDebug.setter def is_debug(self, bDebug): self._isDebug = bDebug @isDebug.deleter def is_debug(self): del self._isDebug @property def is_interactive(self): return self._isInteractive @isInteractive.setter def is_interactive(self, bInteractive): self._isInteractive = bInteractive @isInteractive.deleter def is_interactive(self): del self._isInteractive @property def operation(self): return self._Operation @Operation.setter def operation(self, iOperation): self._Operation = iOperation @Operation.deleter def operation(self): del self._Operation @property def num1(self): return self._Num1 @Num1.setter def num1(self, iNum): if not isinstance(iNum, int): raise TypeError self._Num1 = iNum @Num1.deleter def num1(self): del self._Num1 @property def num2(self): return self._Num2 @Num2.setter def num2(self, iNum): if not isinstance(iNum, int): raise TypeError self._Num2 = iNum @Num2.deleter def num2(self): del self._Num2 def __init__(self): self._isDebug = False self._isInteractive = False self._Operation = None self._Num1 = None self._Num2 = None def add(self): """This functions adds two numbers""" return self._Num1 + self._Num2 def subtract(self): """This is a simple subtraction function""" return self._Num1 - self._Num2 def multiply(self): """Again a simple multiplication""" return self._Num1 * self._Num2 def divide(self): """division function todo: (smzb/js) make division by 0 impossible""" return self._Num1 / self._Num2 def ask_op(self): """Lets ask what the user wants to do""" print('Please select operation -\n1. Add\n2. Subtract\n3. Multiply\n4. Divide\n') result = input('Select operations from 1, 2, 3, 4 :') return int(result) def ask_number(self): """Get a number from the user""" num = int(input('Enter an operand: ')) return num def eval_operation(self): """Now evaluate what operation the user wants, and run the consecutive function""" if self._Operation == 1: print(self._Num1, '+', self._Num2, '=', Calculator.add(self)) elif self._Operation == 2: print(self._Num1, '-', self._Num2, '=', Calculator.subtract(self)) elif self._Operation == 3: print(self._Num1, '*', self._Num2, '=', Calculator.multiply(self)) elif self._Operation == 4: print(self._Num1, '/', self._Num2, '=', Calculator.divide(self)) elif self._Operation == 0: return else: print('Invalid operation')
data_size_plus_header = 1000001 train_dir = 'train' subset_train_dir = 'sub_train.txt' fullfile = open(train_dir, 'r') subfile = open(subset_train_dir,'w') for i in range(data_size_plus_header): subfile.write(fullfile.readline()) fullfile.close() subfile.close()
data_size_plus_header = 1000001 train_dir = 'train' subset_train_dir = 'sub_train.txt' fullfile = open(train_dir, 'r') subfile = open(subset_train_dir, 'w') for i in range(data_size_plus_header): subfile.write(fullfile.readline()) fullfile.close() subfile.close()
long_number = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450" list_mults = [] for i in range(0, 988): section = long_number[0+i:13+i] cumulative_mult = 1 for j in section: cumulative_mult = cumulative_mult * int(j) list_mults.append(cumulative_mult) print(max(list_mults)) # 23514624000
long_number = '7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450' list_mults = [] for i in range(0, 988): section = long_number[0 + i:13 + i] cumulative_mult = 1 for j in section: cumulative_mult = cumulative_mult * int(j) list_mults.append(cumulative_mult) print(max(list_mults))
class Game: def __init__(self,span=[0,100],sub_fun="Square"): self.span=span self.func_dict = { "Square":lambda x: pow(x,2), "Odd":lambda x: 1 + (x-1)*2, "Even":lambda x: x*2, "Identity":lambda x: x, "Logarithm":lambda x: pow(10,x-1) } self.sub_fun = self.func_dict[sub_fun] def calculate(self): #winning_pos is an array. It determines if landing in the current position will give you a win. #True = Win, False = Loss, None = Not yet determined. As per the rules of the game, 0 is initialized as False. #This is since if you start on 0, that means your opponent won the previous round. #All others are None at the start of the calculation. The lenght is equal to the start and end point, plus 1. winning_pos = [False]+[None]*(self.span[1]-self.span[0]) #Iterate until there no longer are any None-s. while winning_pos.count(None)>0: #Start with the highest False. Add numbers drawn from sub_fun to it and set those positions to True. #If you land on those positions, you can win, because you can then put your opponent in a loosing position. hi_false=[i for i,x in enumerate(winning_pos) if x==False][-1] i = 1 while hi_false + self.sub_fun(i) <= self.span[1]: winning_pos[hi_false + self.sub_fun(i)] = True i+=1 #Then, set the lowest None to False. From that position, you will always put your opponent in a winning position #There might be no None positions left, in that case, a value error is raised. try: lo_none=winning_pos.index(None) except ValueError: break winning_pos[lo_none]=False return winning_pos if __name__ == "__main__": game=Game() result=game.calculate() print(str(result[-1]))
class Game: def __init__(self, span=[0, 100], sub_fun='Square'): self.span = span self.func_dict = {'Square': lambda x: pow(x, 2), 'Odd': lambda x: 1 + (x - 1) * 2, 'Even': lambda x: x * 2, 'Identity': lambda x: x, 'Logarithm': lambda x: pow(10, x - 1)} self.sub_fun = self.func_dict[sub_fun] def calculate(self): winning_pos = [False] + [None] * (self.span[1] - self.span[0]) while winning_pos.count(None) > 0: hi_false = [i for (i, x) in enumerate(winning_pos) if x == False][-1] i = 1 while hi_false + self.sub_fun(i) <= self.span[1]: winning_pos[hi_false + self.sub_fun(i)] = True i += 1 try: lo_none = winning_pos.index(None) except ValueError: break winning_pos[lo_none] = False return winning_pos if __name__ == '__main__': game = game() result = game.calculate() print(str(result[-1]))
# -*- coding: utf-8 -*- # @Time : 2021/01/05 22:53:23 # @Author : ddvv # @Site : https://ddvvmmzz.github.io # @File : about.py # @Software: Visual Studio Code __all__ = [ "__author__", "__copyright__", "__email__", "__license__", "__summary__", "__title__", "__uri__", "__version__", ] __title__ = "python_mmdt" __summary__ = "Python wrapper for the mmdt library" __uri__ = "https://github.com/a232319779/python_mmdt" __version__ = "0.2.3" __author__ = "ddvv" __email__ = "dadavivi512@gmail.com" __license__ = "MIT" __copyright__ = "Copyright 2021 %s" % __author__
__all__ = ['__author__', '__copyright__', '__email__', '__license__', '__summary__', '__title__', '__uri__', '__version__'] __title__ = 'python_mmdt' __summary__ = 'Python wrapper for the mmdt library' __uri__ = 'https://github.com/a232319779/python_mmdt' __version__ = '0.2.3' __author__ = 'ddvv' __email__ = 'dadavivi512@gmail.com' __license__ = 'MIT' __copyright__ = 'Copyright 2021 %s' % __author__
#!/usr/bin/env python # -*- coding: utf-8 -*- def main(): A,B,M = map(int,input().split()) A_prise = list(map(int,input().split())) B_prise = list(map(int,input().split())) Most_low_prise = min(A_prise)+min(B_prise) for i in range(M): x,y,c = map(int,input().split()) Post_coupon_orientation_prise = A_prise[x-1]+B_prise[y-1]-c Most_low_prise = min(Most_low_prise,Post_coupon_orientation_prise) print(Most_low_prise) if __name__ == '__main__': main()
def main(): (a, b, m) = map(int, input().split()) a_prise = list(map(int, input().split())) b_prise = list(map(int, input().split())) most_low_prise = min(A_prise) + min(B_prise) for i in range(M): (x, y, c) = map(int, input().split()) post_coupon_orientation_prise = A_prise[x - 1] + B_prise[y - 1] - c most_low_prise = min(Most_low_prise, Post_coupon_orientation_prise) print(Most_low_prise) if __name__ == '__main__': main()
#!/usr/bin/env python3 # 2018-10-13 (cc) <paul4hough@gmail.com> ''' pips: - testinfra - molecule - tox ''' class test_role_ans_dev (object): ''' test_role_ans_dev useless class ''' assert packages.installed( yaml.array( pkgs[common], pkgs[os][common], pkgs[os][major], ) ) assert pips.installed() assert validate.python("https://github.com/python/stuff")
""" pips: - testinfra - molecule - tox """ class Test_Role_Ans_Dev(object): """ test_role_ans_dev useless class """ assert packages.installed(yaml.array(pkgs[common], pkgs[os][common], pkgs[os][major])) assert pips.installed() assert validate.python('https://github.com/python/stuff')
"""1122. Relative Sort Array""" class Solution(object): def relativeSortArray(self, arr1, arr2): """ :type arr1: List[int] :type arr2: List[int] :rtype: List[int] """ #### pos = {num:i for i, num in enumerate(arr2)} return sorted(arr1, key=lambda x: pos.get(x, 1000+x)) #### return sorted(arr1, key = (arr2 + sorted(arr1)).index)
"""1122. Relative Sort Array""" class Solution(object): def relative_sort_array(self, arr1, arr2): """ :type arr1: List[int] :type arr2: List[int] :rtype: List[int] """ pos = {num: i for (i, num) in enumerate(arr2)} return sorted(arr1, key=lambda x: pos.get(x, 1000 + x)) return sorted(arr1, key=(arr2 + sorted(arr1)).index)
"""About this package.""" __all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] __title__ = "argo-events" __summary__ = "Community Maintained Python client for Argo Events" __uri__ = "https://github.com/argoproj-labs/argo-events-client-python" __version__ = "v0.1.0" __author__ = "Yudi Xue" __email__ = "binarycrayon@gmail.com" __license__ = "Apache2" __copyright__ = "Copyright 2020 {0}".format(__author__)
"""About this package.""" __all__ = ['__title__', '__summary__', '__uri__', '__version__', '__author__', '__email__', '__license__', '__copyright__'] __title__ = 'argo-events' __summary__ = 'Community Maintained Python client for Argo Events' __uri__ = 'https://github.com/argoproj-labs/argo-events-client-python' __version__ = 'v0.1.0' __author__ = 'Yudi Xue' __email__ = 'binarycrayon@gmail.com' __license__ = 'Apache2' __copyright__ = 'Copyright 2020 {0}'.format(__author__)
# # @lc app=leetcode id=657 lang=python3 # # [657] Robot Return to Origin # # https://leetcode.com/problems/robot-return-to-origin/description/ # # algorithms # Easy (73.67%) # Likes: 1228 # Dislikes: 692 # Total Accepted: 274.1K # Total Submissions: 371K # Testcase Example: '"UD"' # # There is a robot starting at position (0, 0), the origin, on a 2D plane. # Given a sequence of its moves, judge if this robot ends up at (0, 0) after it # completes its moves. # # The move sequence is represented by a string, and the character moves[i] # represents its ith move. Valid moves are R (right), L (left), U (up), and D # (down). If the robot returns to the origin after it finishes all of its # moves, return true. Otherwise, return false. # # Note: The way that the robot is "facing" is irrelevant. "R" will always make # the robot move to the right once, "L" will always make it move left, etc. # Also, assume that the magnitude of the robot's movement is the same for each # move. # # # Example 1: # # # Input: moves = "UD" # Output: true # Explanation: The robot moves up once, and then down once. All moves have the # same magnitude, so it ended up at the origin where it started. Therefore, we # return true. # # # Example 2: # # # Input: moves = "LL" # Output: false # Explanation: The robot moves left twice. It ends up two "moves" to the left # of the origin. We return false because it is not at the origin at the end of # its moves. # # # Example 3: # # # Input: moves = "RRDD" # Output: false # # # Example 4: # # # Input: moves = "LDRRLRUULR" # Output: false # # # # Constraints: # # # 1 <= moves.length <= 2 * 10^4 # moves only contains the characters 'U', 'D', 'L' and 'R'. # # # # @lc code=start class Solution: def judgeCircle(self, moves: str) -> bool: start = [0, 0] for move in moves: if move == "U": start[0], start[1] = start[0] + 0, start[1] + 1 elif move == "R": start[0], start[1] = start[0] + 1, start[1] + 0 elif move == "D": start[0], start[1] = start[0] + 0, start[1] + (-1) else: start[0], start[1] = start[0] + (-1), start[1] + 0 return start == [0, 0] # @lc code=end
class Solution: def judge_circle(self, moves: str) -> bool: start = [0, 0] for move in moves: if move == 'U': (start[0], start[1]) = (start[0] + 0, start[1] + 1) elif move == 'R': (start[0], start[1]) = (start[0] + 1, start[1] + 0) elif move == 'D': (start[0], start[1]) = (start[0] + 0, start[1] + -1) else: (start[0], start[1]) = (start[0] + -1, start[1] + 0) return start == [0, 0]
# get_incrementer.py """Helper function to create counter strings with a set length throughout.""" __version__ = '0.2' __author__ = 'Rob Dupre (KU)' def get_incrementer(num, num_digits): if num >= 10**num_digits: print('NUMBER IS LARGER THAN THE MAX POSSIBLE BASED ON num_digits') return -1 else: if num > 9999999: number_length = 8 elif num > 999999: number_length = 7 elif num > 99999: number_length = 6 elif num > 9999: number_length = 5 elif num > 999: number_length = 4 elif num > 99: number_length = 3 elif num > 9: number_length = 2 else: number_length = 1 char = '' for i in range(num_digits - number_length): char = char + '0' return char + str(num) def get_num_length(num): if type(num) == int: return len(str(num)) else: print('Number is not an Int. Length will include the decimal') return len(str(num))
"""Helper function to create counter strings with a set length throughout.""" __version__ = '0.2' __author__ = 'Rob Dupre (KU)' def get_incrementer(num, num_digits): if num >= 10 ** num_digits: print('NUMBER IS LARGER THAN THE MAX POSSIBLE BASED ON num_digits') return -1 elif num > 9999999: number_length = 8 elif num > 999999: number_length = 7 elif num > 99999: number_length = 6 elif num > 9999: number_length = 5 elif num > 999: number_length = 4 elif num > 99: number_length = 3 elif num > 9: number_length = 2 else: number_length = 1 char = '' for i in range(num_digits - number_length): char = char + '0' return char + str(num) def get_num_length(num): if type(num) == int: return len(str(num)) else: print('Number is not an Int. Length will include the decimal') return len(str(num))
def test_open_home_page(driver, request): url = 'opencart/' return driver.get("".join([request.config.getoption("--address"), url])) element = driver.find_elements_by_xpath("//base[contains(@href, 'http://192.168.56.103/opencart/]") assert element == 'http://192.168.56.103/opencart/' assert driver.find_element_by_class_name('col-sm-4').text == 'Your Store'
def test_open_home_page(driver, request): url = 'opencart/' return driver.get(''.join([request.config.getoption('--address'), url])) element = driver.find_elements_by_xpath("//base[contains(@href, 'http://192.168.56.103/opencart/]") assert element == 'http://192.168.56.103/opencart/' assert driver.find_element_by_class_name('col-sm-4').text == 'Your Store'
"""Tests for compiler options processing functions.""" load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest") load("//test:utils.bzl", "stringify_dict") # buildifier: disable=bzl-visibility load("//xcodeproj/internal:opts.bzl", "testable") process_compiler_opts = testable.process_compiler_opts def _process_compiler_opts_test_impl(ctx): env = unittest.begin(ctx) build_settings = {} search_paths = process_compiler_opts( conlyopts = ctx.attr.conlyopts, cxxopts = ctx.attr.cxxopts, full_swiftcopts = ctx.attr.full_swiftcopts, user_swiftcopts = ctx.attr.user_swiftcopts, package_bin_dir = ctx.attr.package_bin_dir, build_settings = build_settings, ) string_build_settings = stringify_dict(build_settings) json_search_paths = json.encode(search_paths) expected_build_settings = { "SWIFT_OBJC_INTERFACE_HEADER_NAME": "", "SWIFT_OPTIMIZATION_LEVEL": "-Onone", "SWIFT_VERSION": "5", } expected_build_settings.update(ctx.attr.expected_build_settings) asserts.equals( env, expected_build_settings, string_build_settings, "build_settings", ) asserts.equals( env, ctx.attr.expected_search_paths, json_search_paths, "search_paths", ) return unittest.end(env) process_compiler_opts_test = unittest.make( impl = _process_compiler_opts_test_impl, attrs = { "conlyopts": attr.string_list(mandatory = True), "cxxopts": attr.string_list(mandatory = True), "expected_build_settings": attr.string_dict(mandatory = True), "expected_search_paths": attr.string(mandatory = True), "package_bin_dir": attr.string(mandatory = True), "full_swiftcopts": attr.string_list(mandatory = True), "user_swiftcopts": attr.string_list(mandatory = True), }, ) def process_compiler_opts_test_suite(name): """Test suite for `process_compiler_opts`. Args: name: The base name to be used in things created by this macro. Also the name of the test suite. """ test_names = [] def _add_test( *, name, expected_build_settings, expected_search_paths = {"quote_includes": [], "includes": [], "system_includes": []}, conlyopts = [], cxxopts = [], full_swiftcopts = [], user_swiftcopts = [], package_bin_dir = ""): test_names.append(name) process_compiler_opts_test( name = name, conlyopts = conlyopts, cxxopts = cxxopts, full_swiftcopts = full_swiftcopts, user_swiftcopts = user_swiftcopts, package_bin_dir = package_bin_dir, expected_build_settings = stringify_dict(expected_build_settings), expected_search_paths = json.encode(expected_search_paths), timeout = "short", ) # Base _add_test( name = "{}_swift_integration".format(name), full_swiftcopts = [ "-target", "arm64-apple-ios15.0-simulator", "-sdk", "__BAZEL_XCODE_SDKROOT__", "-F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks", "-F__BAZEL_XCODE_SDKROOT__/Developer/Library/Frameworks", "-I__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/iPhoneSimulator.platform/Developer/usr/lib", "-emit-object", "-output-file-map", "bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/examples/ExampleUITests/ExampleUITests.library.output_file_map.json", "-Xfrontend", "-no-clang-module-breadcrumbs", "-emit-module-path", "bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/examples/ExampleUITests/ExampleUITests.swiftmodule", "-DDEBUG", "-Onone", "-Xfrontend", "-serialize-debugging-options", "-enable-testing", "-application-extension", "weird", "-gline-tables-only", "-Xwrapped-swift=-debug-prefix-pwd-is-dot", "-Xwrapped-swift=-ephemeral-module-cache", "-Xcc", "-iquote.", "-Xcc", "-iquotebazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin", "-Xfrontend", "-color-diagnostics", "-enable-batch-mode", "-unhandled", "-module-name", "ExampleUITests", "-parse-as-library", "-Xcc", "-O0", "-Xcc", "-DDEBUG=1", "examples/xcode_like/ExampleUITests/ExampleUITests.swift", "examples/xcode_like/ExampleUITests/ExampleUITestsLaunchTests.swift", ], user_swiftcopts = [], expected_build_settings = { "ENABLE_TESTABILITY": "True", "APPLICATION_EXTENSION_API_ONLY": "True", "OTHER_SWIFT_FLAGS": "weird -unhandled", "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG", }, ) _add_test( name = "{}_empty".format(name), conlyopts = [], cxxopts = [], full_swiftcopts = [], user_swiftcopts = [], expected_build_settings = {}, ) # Skips ## C and C++ # Anything with __BAZEL_XCODE_ # -isysroot # -mios-simulator-version-min # -miphoneos-version-min # -mmacosx-version-min # -mtvos-simulator-version-min # -mtvos-version-min # -mwatchos-simulator-version-min # -mwatchos-version-min # -target ## Swift: # Anything with __BAZEL_XCODE_ # -Ipath # -emit-module-path # -emit-object # -enable-batch-mode # -gline-tables-only # -module-name # -num-threads # -output-file-map # -parse-as-library # -sdk # -target # -Xcc # -Xfrontend # -Xwrapped-swift # Other things that end with ".swift", but don't start with "-" _add_test( name = "{}_skips".format(name), conlyopts = [ "-mtvos-simulator-version-min=8.0", "-passthrough", "-isysroot", "other", "-mios-simulator-version-min=11.2", "-miphoneos-version-min=9.0", "-passthrough", "-mtvos-version-min=12.1", "-I__BAZEL_XCODE_SOMETHING_/path", "-mwatchos-simulator-version-min=10.1", "-passthrough", "-mwatchos-version-min=9.2", "-target", "ios", "-mmacosx-version-min=12.0", "-passthrough", ], cxxopts = [ "-isysroot", "something", "-miphoneos-version-min=9.4", "-mmacosx-version-min=10.9", "-passthrough", "-mtvos-version-min=12.2", "-mwatchos-simulator-version-min=9.3", "-passthrough", "-mtvos-simulator-version-min=12.1", "-mwatchos-version-min=10.2", "-I__BAZEL_XCODE_BOSS_", "-target", "macos", "-passthrough", "-mios-simulator-version-min=14.0", ], full_swiftcopts = [ "-output-file-map", "path", "-passthrough", "-emit-module-path", "path", "-passthrough", "-Xfrontend", "-hidden", "-emit-object", "-enable-batch-mode", "-passthrough", "-gline-tables-only", "-sdk", "something", "-module-name", "name", "-passthrough", "-I__BAZEL_XCODE_SOMETHING_/path", "-num-threads", "6", "-passthrough", "-Ibazel-out/...", "-parse-as-library", "-passthrough", "-parse-as-library", "-keep-me=something.swift", "reject-me.swift", "-target", "ios", "-Xcc", "-weird", "-Xwrapped-swift", "-passthrough", ], expected_build_settings = { "OTHER_CFLAGS": [ "-passthrough", "-passthrough", "-passthrough", "-passthrough", ], "OTHER_CPLUSPLUSFLAGS": [ "-passthrough", "-passthrough", "-passthrough", ], "OTHER_SWIFT_FLAGS": """\ -passthrough \ -passthrough \ -passthrough \ -passthrough \ -passthrough \ -passthrough \ -keep-me=something.swift \ -passthrough\ """, }, ) # Specific Xcode build settings # CLANG_CXX_LANGUAGE_STANDARD _add_test( name = "{}_options-std".format(name), conlyopts = ["-std=c++42"], cxxopts = ["-std=c++42"], expected_build_settings = { "CLANG_CXX_LANGUAGE_STANDARD": "c++42", "OTHER_CFLAGS": ["-std=c++42"], }, ) _add_test( name = "{}_options-std=c++0x".format(name), cxxopts = ["-std=c++11"], expected_build_settings = { "CLANG_CXX_LANGUAGE_STANDARD": "c++0x", }, ) # CLANG_CXX_LIBRARY _add_test( name = "{}_options-stdlib".format(name), conlyopts = ["-stdlib=random"], cxxopts = ["-stdlib=random"], expected_build_settings = { "CLANG_CXX_LIBRARY": "random", "OTHER_CFLAGS": ["-stdlib=random"], }, ) ## ENABLE_TESTABILITY _add_test( name = "{}_swift_option-enable-testing".format(name), full_swiftcopts = ["-enable-testing"], expected_build_settings = { "ENABLE_TESTABILITY": "True", }, ) ## APPLICATION_EXTENSION_API_ONLY _add_test( name = "{}_swift_option-application-extension".format(name), full_swiftcopts = ["-application-extension"], expected_build_settings = { "APPLICATION_EXTENSION_API_ONLY": "True", }, ) ## GCC_OPTIMIZATION_LEVEL _add_test( name = "{}_differing_gcc_optimization_level".format(name), conlyopts = ["-O0"], cxxopts = ["-O1"], expected_build_settings = { "OTHER_CFLAGS": ["-O0"], "OTHER_CPLUSPLUSFLAGS": ["-O1"], }, ) _add_test( name = "{}_differing_gcc_optimization_level_common_first".format(name), conlyopts = ["-O1", "-O0"], cxxopts = ["-O1", "-O2"], expected_build_settings = { "GCC_OPTIMIZATION_LEVEL": "1", "OTHER_CFLAGS": ["-O0"], "OTHER_CPLUSPLUSFLAGS": ["-O2"], }, ) _add_test( name = "{}_multiple_gcc_optimization_levels".format(name), conlyopts = ["-O1", "-O0"], cxxopts = ["-O0", "-O1"], expected_build_settings = { "OTHER_CFLAGS": ["-O1", "-O0"], "OTHER_CPLUSPLUSFLAGS": ["-O0", "-O1"], }, ) _add_test( name = "{}_common_gcc_optimization_level".format(name), conlyopts = ["-O1"], cxxopts = ["-O1"], expected_build_settings = { "GCC_OPTIMIZATION_LEVEL": "1", }, ) ## GCC_PREPROCESSOR_DEFINITIONS _add_test( name = "{}_gcc_optimization_preprocessor_definitions".format(name), conlyopts = ["-DDEBUG", "-DDEBUG", "-DA=1", "-DZ=1", "-DB", "-DE"], cxxopts = ["-DDEBUG", "-DDEBUG", "-DA=1", "-DZ=2", "-DC", "-DE"], expected_build_settings = { "GCC_PREPROCESSOR_DEFINITIONS": ["DEBUG", "A=1"], "OTHER_CFLAGS": ["-DZ=1", "-DB", "-DE"], "OTHER_CPLUSPLUSFLAGS": ["-DZ=2", "-DC", "-DE"], }, ) ## SWIFT_ACTIVE_COMPILATION_CONDITIONS _add_test( name = "{}_defines".format(name), full_swiftcopts = [ "-DDEBUG", "-DBAZEL", "-DDEBUG", "-DBAZEL", ], expected_build_settings = { "SWIFT_ACTIVE_COMPILATION_CONDITIONS": "DEBUG BAZEL", }, ) ## SWIFT_COMPILATION_MODE _add_test( name = "{}_multiple_swift_compilation_modes".format(name), full_swiftcopts = [ "-wmo", "-no-whole-module-optimization", ], expected_build_settings = { "SWIFT_COMPILATION_MODE": "singlefile", }, ) _add_test( name = "{}_swift_option-incremental".format(name), full_swiftcopts = ["-incremental"], expected_build_settings = { "SWIFT_COMPILATION_MODE": "singlefile", }, ) _add_test( name = "{}_swift_option-whole-module-optimization".format(name), full_swiftcopts = ["-whole-module-optimization"], expected_build_settings = { "SWIFT_COMPILATION_MODE": "wholemodule", }, ) _add_test( name = "{}_swift_option-wmo".format(name), full_swiftcopts = ["-wmo"], expected_build_settings = { "SWIFT_COMPILATION_MODE": "wholemodule", }, ) _add_test( name = "{}_swift_option-no-whole-module-optimization".format(name), full_swiftcopts = ["-no-whole-module-optimization"], expected_build_settings = { "SWIFT_COMPILATION_MODE": "singlefile", }, ) ## SWIFT_OBJC_INTERFACE_HEADER_NAME _add_test( name = "{}_generated_header".format(name), full_swiftcopts = [ "-emit-objc-header-path", "a/b/c/TestingUtils-Custom.h", ], package_bin_dir = "a/b", expected_build_settings = { "SWIFT_OBJC_INTERFACE_HEADER_NAME": "c/TestingUtils-Custom.h", }, ) ## SWIFT_OPTIMIZATION_LEVEL _add_test( name = "{}_multiple_swift_optimization_levels".format(name), full_swiftcopts = [ "-Osize", "-Onone", "-O", ], expected_build_settings = { "SWIFT_OPTIMIZATION_LEVEL": "-O", }, ) _add_test( name = "{}_swift_option-Onone".format(name), full_swiftcopts = ["-Onone"], expected_build_settings = { "SWIFT_OPTIMIZATION_LEVEL": "-Onone", }, ) _add_test( name = "{}_swift_option-O".format(name), full_swiftcopts = ["-O"], expected_build_settings = { "SWIFT_OPTIMIZATION_LEVEL": "-O", }, ) _add_test( name = "{}_swift_option-Osize".format(name), full_swiftcopts = ["-Osize"], expected_build_settings = { "SWIFT_OPTIMIZATION_LEVEL": "-Osize", }, ) ## SWIFT_VERSION _add_test( name = "{}_swift_option-swift-version".format(name), full_swiftcopts = ["-swift-version=42"], expected_build_settings = { "SWIFT_VERSION": "42", }, ) # Search Paths _add_test( name = "{}_search_paths".format(name), conlyopts = [ "-iquote", "a/b/c", "-Ix/y/z", "-I", "1/2/3", "-iquote", "0/9", "-isystem", "s1/s2", ], cxxopts = [ "-iquote", "y/z", "-Ix/y/z", "-I", "aa/bb", "-isystem", "s3/s4", ], user_swiftcopts = ["-Xcc", "-Ic/d/e", "-Xcc", "-iquote4/5", "-Xcc", "-isystems5/s6"], expected_build_settings = {}, expected_search_paths = { "quote_includes": [ "a/b/c", "0/9", "y/z", "4/5", ], "includes": [ "x/y/z", "1/2/3", "aa/bb", "c/d/e", ], "system_includes": [ "s1/s2", "s3/s4", "s5/s6", ], }, ) # Test suite native.test_suite( name = name, tests = test_names, )
"""Tests for compiler options processing functions.""" load('@bazel_skylib//lib:unittest.bzl', 'asserts', 'unittest') load('//test:utils.bzl', 'stringify_dict') load('//xcodeproj/internal:opts.bzl', 'testable') process_compiler_opts = testable.process_compiler_opts def _process_compiler_opts_test_impl(ctx): env = unittest.begin(ctx) build_settings = {} search_paths = process_compiler_opts(conlyopts=ctx.attr.conlyopts, cxxopts=ctx.attr.cxxopts, full_swiftcopts=ctx.attr.full_swiftcopts, user_swiftcopts=ctx.attr.user_swiftcopts, package_bin_dir=ctx.attr.package_bin_dir, build_settings=build_settings) string_build_settings = stringify_dict(build_settings) json_search_paths = json.encode(search_paths) expected_build_settings = {'SWIFT_OBJC_INTERFACE_HEADER_NAME': '', 'SWIFT_OPTIMIZATION_LEVEL': '-Onone', 'SWIFT_VERSION': '5'} expected_build_settings.update(ctx.attr.expected_build_settings) asserts.equals(env, expected_build_settings, string_build_settings, 'build_settings') asserts.equals(env, ctx.attr.expected_search_paths, json_search_paths, 'search_paths') return unittest.end(env) process_compiler_opts_test = unittest.make(impl=_process_compiler_opts_test_impl, attrs={'conlyopts': attr.string_list(mandatory=True), 'cxxopts': attr.string_list(mandatory=True), 'expected_build_settings': attr.string_dict(mandatory=True), 'expected_search_paths': attr.string(mandatory=True), 'package_bin_dir': attr.string(mandatory=True), 'full_swiftcopts': attr.string_list(mandatory=True), 'user_swiftcopts': attr.string_list(mandatory=True)}) def process_compiler_opts_test_suite(name): """Test suite for `process_compiler_opts`. Args: name: The base name to be used in things created by this macro. Also the name of the test suite. """ test_names = [] def _add_test(*, name, expected_build_settings, expected_search_paths={'quote_includes': [], 'includes': [], 'system_includes': []}, conlyopts=[], cxxopts=[], full_swiftcopts=[], user_swiftcopts=[], package_bin_dir=''): test_names.append(name) process_compiler_opts_test(name=name, conlyopts=conlyopts, cxxopts=cxxopts, full_swiftcopts=full_swiftcopts, user_swiftcopts=user_swiftcopts, package_bin_dir=package_bin_dir, expected_build_settings=stringify_dict(expected_build_settings), expected_search_paths=json.encode(expected_search_paths), timeout='short') _add_test(name='{}_swift_integration'.format(name), full_swiftcopts=['-target', 'arm64-apple-ios15.0-simulator', '-sdk', '__BAZEL_XCODE_SDKROOT__', '-F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks', '-F__BAZEL_XCODE_SDKROOT__/Developer/Library/Frameworks', '-I__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/iPhoneSimulator.platform/Developer/usr/lib', '-emit-object', '-output-file-map', 'bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/examples/ExampleUITests/ExampleUITests.library.output_file_map.json', '-Xfrontend', '-no-clang-module-breadcrumbs', '-emit-module-path', 'bazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin/examples/ExampleUITests/ExampleUITests.swiftmodule', '-DDEBUG', '-Onone', '-Xfrontend', '-serialize-debugging-options', '-enable-testing', '-application-extension', 'weird', '-gline-tables-only', '-Xwrapped-swift=-debug-prefix-pwd-is-dot', '-Xwrapped-swift=-ephemeral-module-cache', '-Xcc', '-iquote.', '-Xcc', '-iquotebazel-out/ios-sim_arm64-min15.0-applebin_ios-ios_sim_arm64-fastbuild-ST-4e6c2a19403f/bin', '-Xfrontend', '-color-diagnostics', '-enable-batch-mode', '-unhandled', '-module-name', 'ExampleUITests', '-parse-as-library', '-Xcc', '-O0', '-Xcc', '-DDEBUG=1', 'examples/xcode_like/ExampleUITests/ExampleUITests.swift', 'examples/xcode_like/ExampleUITests/ExampleUITestsLaunchTests.swift'], user_swiftcopts=[], expected_build_settings={'ENABLE_TESTABILITY': 'True', 'APPLICATION_EXTENSION_API_ONLY': 'True', 'OTHER_SWIFT_FLAGS': 'weird -unhandled', 'SWIFT_ACTIVE_COMPILATION_CONDITIONS': 'DEBUG'}) _add_test(name='{}_empty'.format(name), conlyopts=[], cxxopts=[], full_swiftcopts=[], user_swiftcopts=[], expected_build_settings={}) _add_test(name='{}_skips'.format(name), conlyopts=['-mtvos-simulator-version-min=8.0', '-passthrough', '-isysroot', 'other', '-mios-simulator-version-min=11.2', '-miphoneos-version-min=9.0', '-passthrough', '-mtvos-version-min=12.1', '-I__BAZEL_XCODE_SOMETHING_/path', '-mwatchos-simulator-version-min=10.1', '-passthrough', '-mwatchos-version-min=9.2', '-target', 'ios', '-mmacosx-version-min=12.0', '-passthrough'], cxxopts=['-isysroot', 'something', '-miphoneos-version-min=9.4', '-mmacosx-version-min=10.9', '-passthrough', '-mtvos-version-min=12.2', '-mwatchos-simulator-version-min=9.3', '-passthrough', '-mtvos-simulator-version-min=12.1', '-mwatchos-version-min=10.2', '-I__BAZEL_XCODE_BOSS_', '-target', 'macos', '-passthrough', '-mios-simulator-version-min=14.0'], full_swiftcopts=['-output-file-map', 'path', '-passthrough', '-emit-module-path', 'path', '-passthrough', '-Xfrontend', '-hidden', '-emit-object', '-enable-batch-mode', '-passthrough', '-gline-tables-only', '-sdk', 'something', '-module-name', 'name', '-passthrough', '-I__BAZEL_XCODE_SOMETHING_/path', '-num-threads', '6', '-passthrough', '-Ibazel-out/...', '-parse-as-library', '-passthrough', '-parse-as-library', '-keep-me=something.swift', 'reject-me.swift', '-target', 'ios', '-Xcc', '-weird', '-Xwrapped-swift', '-passthrough'], expected_build_settings={'OTHER_CFLAGS': ['-passthrough', '-passthrough', '-passthrough', '-passthrough'], 'OTHER_CPLUSPLUSFLAGS': ['-passthrough', '-passthrough', '-passthrough'], 'OTHER_SWIFT_FLAGS': '-passthrough -passthrough -passthrough -passthrough -passthrough -passthrough -keep-me=something.swift -passthrough'}) _add_test(name='{}_options-std'.format(name), conlyopts=['-std=c++42'], cxxopts=['-std=c++42'], expected_build_settings={'CLANG_CXX_LANGUAGE_STANDARD': 'c++42', 'OTHER_CFLAGS': ['-std=c++42']}) _add_test(name='{}_options-std=c++0x'.format(name), cxxopts=['-std=c++11'], expected_build_settings={'CLANG_CXX_LANGUAGE_STANDARD': 'c++0x'}) _add_test(name='{}_options-stdlib'.format(name), conlyopts=['-stdlib=random'], cxxopts=['-stdlib=random'], expected_build_settings={'CLANG_CXX_LIBRARY': 'random', 'OTHER_CFLAGS': ['-stdlib=random']}) _add_test(name='{}_swift_option-enable-testing'.format(name), full_swiftcopts=['-enable-testing'], expected_build_settings={'ENABLE_TESTABILITY': 'True'}) _add_test(name='{}_swift_option-application-extension'.format(name), full_swiftcopts=['-application-extension'], expected_build_settings={'APPLICATION_EXTENSION_API_ONLY': 'True'}) _add_test(name='{}_differing_gcc_optimization_level'.format(name), conlyopts=['-O0'], cxxopts=['-O1'], expected_build_settings={'OTHER_CFLAGS': ['-O0'], 'OTHER_CPLUSPLUSFLAGS': ['-O1']}) _add_test(name='{}_differing_gcc_optimization_level_common_first'.format(name), conlyopts=['-O1', '-O0'], cxxopts=['-O1', '-O2'], expected_build_settings={'GCC_OPTIMIZATION_LEVEL': '1', 'OTHER_CFLAGS': ['-O0'], 'OTHER_CPLUSPLUSFLAGS': ['-O2']}) _add_test(name='{}_multiple_gcc_optimization_levels'.format(name), conlyopts=['-O1', '-O0'], cxxopts=['-O0', '-O1'], expected_build_settings={'OTHER_CFLAGS': ['-O1', '-O0'], 'OTHER_CPLUSPLUSFLAGS': ['-O0', '-O1']}) _add_test(name='{}_common_gcc_optimization_level'.format(name), conlyopts=['-O1'], cxxopts=['-O1'], expected_build_settings={'GCC_OPTIMIZATION_LEVEL': '1'}) _add_test(name='{}_gcc_optimization_preprocessor_definitions'.format(name), conlyopts=['-DDEBUG', '-DDEBUG', '-DA=1', '-DZ=1', '-DB', '-DE'], cxxopts=['-DDEBUG', '-DDEBUG', '-DA=1', '-DZ=2', '-DC', '-DE'], expected_build_settings={'GCC_PREPROCESSOR_DEFINITIONS': ['DEBUG', 'A=1'], 'OTHER_CFLAGS': ['-DZ=1', '-DB', '-DE'], 'OTHER_CPLUSPLUSFLAGS': ['-DZ=2', '-DC', '-DE']}) _add_test(name='{}_defines'.format(name), full_swiftcopts=['-DDEBUG', '-DBAZEL', '-DDEBUG', '-DBAZEL'], expected_build_settings={'SWIFT_ACTIVE_COMPILATION_CONDITIONS': 'DEBUG BAZEL'}) _add_test(name='{}_multiple_swift_compilation_modes'.format(name), full_swiftcopts=['-wmo', '-no-whole-module-optimization'], expected_build_settings={'SWIFT_COMPILATION_MODE': 'singlefile'}) _add_test(name='{}_swift_option-incremental'.format(name), full_swiftcopts=['-incremental'], expected_build_settings={'SWIFT_COMPILATION_MODE': 'singlefile'}) _add_test(name='{}_swift_option-whole-module-optimization'.format(name), full_swiftcopts=['-whole-module-optimization'], expected_build_settings={'SWIFT_COMPILATION_MODE': 'wholemodule'}) _add_test(name='{}_swift_option-wmo'.format(name), full_swiftcopts=['-wmo'], expected_build_settings={'SWIFT_COMPILATION_MODE': 'wholemodule'}) _add_test(name='{}_swift_option-no-whole-module-optimization'.format(name), full_swiftcopts=['-no-whole-module-optimization'], expected_build_settings={'SWIFT_COMPILATION_MODE': 'singlefile'}) _add_test(name='{}_generated_header'.format(name), full_swiftcopts=['-emit-objc-header-path', 'a/b/c/TestingUtils-Custom.h'], package_bin_dir='a/b', expected_build_settings={'SWIFT_OBJC_INTERFACE_HEADER_NAME': 'c/TestingUtils-Custom.h'}) _add_test(name='{}_multiple_swift_optimization_levels'.format(name), full_swiftcopts=['-Osize', '-Onone', '-O'], expected_build_settings={'SWIFT_OPTIMIZATION_LEVEL': '-O'}) _add_test(name='{}_swift_option-Onone'.format(name), full_swiftcopts=['-Onone'], expected_build_settings={'SWIFT_OPTIMIZATION_LEVEL': '-Onone'}) _add_test(name='{}_swift_option-O'.format(name), full_swiftcopts=['-O'], expected_build_settings={'SWIFT_OPTIMIZATION_LEVEL': '-O'}) _add_test(name='{}_swift_option-Osize'.format(name), full_swiftcopts=['-Osize'], expected_build_settings={'SWIFT_OPTIMIZATION_LEVEL': '-Osize'}) _add_test(name='{}_swift_option-swift-version'.format(name), full_swiftcopts=['-swift-version=42'], expected_build_settings={'SWIFT_VERSION': '42'}) _add_test(name='{}_search_paths'.format(name), conlyopts=['-iquote', 'a/b/c', '-Ix/y/z', '-I', '1/2/3', '-iquote', '0/9', '-isystem', 's1/s2'], cxxopts=['-iquote', 'y/z', '-Ix/y/z', '-I', 'aa/bb', '-isystem', 's3/s4'], user_swiftcopts=['-Xcc', '-Ic/d/e', '-Xcc', '-iquote4/5', '-Xcc', '-isystems5/s6'], expected_build_settings={}, expected_search_paths={'quote_includes': ['a/b/c', '0/9', 'y/z', '4/5'], 'includes': ['x/y/z', '1/2/3', 'aa/bb', 'c/d/e'], 'system_includes': ['s1/s2', 's3/s4', 's5/s6']}) native.test_suite(name=name, tests=test_names)
TOMASULO_DEFAULT_PARAMETERS = { "num_register": 32, "num_rob": 128, "num_cdb": 1, "cdb_buffer_size": 0, "nop_latency": 1, "nop_unit_pipelined": 1, "integer_adder_latency": 1, "integer_adder_rs": 5, "integer_adder_pipelined": 0, "float_adder_latency": 3, "float_adder_rs": 3, "float_adder_pipelined": 1, "float_multiplier_latency": 20, "float_multiplier_rs": 2, "float_multiplier_pipelined": 1, "memory_unit_latency": 1, "memory_unit_ram_latency": 4, "memory_unit_queue_latency": 1, "memory_unit_ram_size": 1024, "memory_unit_queue_size": 8, }
tomasulo_default_parameters = {'num_register': 32, 'num_rob': 128, 'num_cdb': 1, 'cdb_buffer_size': 0, 'nop_latency': 1, 'nop_unit_pipelined': 1, 'integer_adder_latency': 1, 'integer_adder_rs': 5, 'integer_adder_pipelined': 0, 'float_adder_latency': 3, 'float_adder_rs': 3, 'float_adder_pipelined': 1, 'float_multiplier_latency': 20, 'float_multiplier_rs': 2, 'float_multiplier_pipelined': 1, 'memory_unit_latency': 1, 'memory_unit_ram_latency': 4, 'memory_unit_queue_latency': 1, 'memory_unit_ram_size': 1024, 'memory_unit_queue_size': 8}
# Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def addTwoNumbers(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode """ ret = NodeList(0) val = 0 last = ret while True: if l1 is not None: val += l1.val l1 = l1.next if l2 is not None: val += l2.val l2 = l2.next if ret is None: ret = ListNode(val) last = ret else: last.next = ListNode(val) last = last.next if l1 is None and l2 is None and val == 0: break if ret is None: ret = ListNode(0) return ret def printList(head): while head is not None: print(head.val, end=' ') head = head.next print() def makeList(l): if len(l) == 0: return None head = ListNode(l[0]) cur = head for a in l[1:]: cur.next = ListNode(a) cur = cur.next return head sol = Solution() one=makeList([1,2,3]) two=makeList([4,5,6]) expect=makeList([5,7,9]) result=sol.addTwoNumbers(one, two) print('Expect:') printList(expect) print('Result:') printList(result) one=makeList([7,2,1]) two=makeList([4,5,6]) expect=makeList([1,8,7]) result=sol.addTwoNumbers(one, two) print('Expect:') printList(expect) print('Result:') printList(result) one=makeList([2,2,9]) two=makeList([4,5,6]) expect=makeList([6,7,5,1]) result=sol.addTwoNumbers(one, two) print('Expect:') printList(expect) print('Result:') printList(result) one=makeList([0]) two=makeList([0]) expect=makeList([0]) result=sol.addTwoNumbers(one, two) print('Expect:') printList(expect) print('Result:') printList(result) one=makeList([1, 3, 4]) two=makeList([5, 2]) expect=makeList([6, 5, 4]) result=sol.addTwoNumbers(one, two) print('Expect:') printList(expect) print('Result:') printList(result) two=makeList([5, 2]) one=makeList([1, 3, 4]) expect=makeList([6, 5, 4]) result=sol.addTwoNumbers(one, two) print('Expect:') printList(expect) print('Result:') printList(result) two=makeList([5, 9]) one=makeList([1, 3, 4]) expect=makeList([6, 2, 5]) result=sol.addTwoNumbers(one, two) print('Expect:') printList(expect) print('Result:') printList(result) two=makeList([2, 3, 0, 1]) one=makeList([1, 3, 0, 4]) expect=makeList([3, 6, 0, 5]) result=sol.addTwoNumbers(one, two) print('Expect:') printList(expect) print('Result:') printList(result)
class Listnode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def add_two_numbers(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode """ ret = node_list(0) val = 0 last = ret while True: if l1 is not None: val += l1.val l1 = l1.next if l2 is not None: val += l2.val l2 = l2.next if ret is None: ret = list_node(val) last = ret else: last.next = list_node(val) last = last.next if l1 is None and l2 is None and (val == 0): break if ret is None: ret = list_node(0) return ret def print_list(head): while head is not None: print(head.val, end=' ') head = head.next print() def make_list(l): if len(l) == 0: return None head = list_node(l[0]) cur = head for a in l[1:]: cur.next = list_node(a) cur = cur.next return head sol = solution() one = make_list([1, 2, 3]) two = make_list([4, 5, 6]) expect = make_list([5, 7, 9]) result = sol.addTwoNumbers(one, two) print('Expect:') print_list(expect) print('Result:') print_list(result) one = make_list([7, 2, 1]) two = make_list([4, 5, 6]) expect = make_list([1, 8, 7]) result = sol.addTwoNumbers(one, two) print('Expect:') print_list(expect) print('Result:') print_list(result) one = make_list([2, 2, 9]) two = make_list([4, 5, 6]) expect = make_list([6, 7, 5, 1]) result = sol.addTwoNumbers(one, two) print('Expect:') print_list(expect) print('Result:') print_list(result) one = make_list([0]) two = make_list([0]) expect = make_list([0]) result = sol.addTwoNumbers(one, two) print('Expect:') print_list(expect) print('Result:') print_list(result) one = make_list([1, 3, 4]) two = make_list([5, 2]) expect = make_list([6, 5, 4]) result = sol.addTwoNumbers(one, two) print('Expect:') print_list(expect) print('Result:') print_list(result) two = make_list([5, 2]) one = make_list([1, 3, 4]) expect = make_list([6, 5, 4]) result = sol.addTwoNumbers(one, two) print('Expect:') print_list(expect) print('Result:') print_list(result) two = make_list([5, 9]) one = make_list([1, 3, 4]) expect = make_list([6, 2, 5]) result = sol.addTwoNumbers(one, two) print('Expect:') print_list(expect) print('Result:') print_list(result) two = make_list([2, 3, 0, 1]) one = make_list([1, 3, 0, 4]) expect = make_list([3, 6, 0, 5]) result = sol.addTwoNumbers(one, two) print('Expect:') print_list(expect) print('Result:') print_list(result)
# answer = 5 # print("please guess number between 1 and 10: ") # guess = int(input()) # # if guess < answer: # print("Please guess higher") # elif guess > answer: # print ( "Please guess lower") # else: # print("You got it first time") answer = 5 print ("Please guess number between 1 and 10: ") guess = int(input()) # when there is : we indent the code if guess != answer: if guess < answer: print("Please guess higher") guess = int(input()) if guess == answer: print("Well done, you guessed it") else: print("Sorry, you have not guessed correctly") else: print("You got it first time")
answer = 5 print('Please guess number between 1 and 10: ') guess = int(input()) if guess != answer: if guess < answer: print('Please guess higher') guess = int(input()) if guess == answer: print('Well done, you guessed it') else: print('Sorry, you have not guessed correctly') else: print('You got it first time')
# -*- coding: utf-8 -*- # Copyright 2019 Cohesity Inc. class VserverNetworkInterface(object): """Implementation of the 'Vserver Network Interface.' model. Specifies information about a logical network interface on a NetApp Vserver. The interface's IP address is the mount point for a specific data protocol, such as NFS or CIFS. Attributes: data_protocols (list of DataProtocolEnum): Array of Data Protocols. Specifies the set of data protocols supported by this interface. 'kNfs' indicates NFS connections. 'kCifs' indicates SMB (CIFS) connections. 'kIscsi' indicates iSCSI connections. 'kFc' indicates Fiber Channel connections. 'kFcache' indicates Flex Cache connections. 'kHttp' indicates HTTP connections. 'kNdmp' indicates NDMP connections. 'kManagement' indicates non-data connections used for management purposes. ip_address (string): Specifies the IP address of this interface. name (string): Specifies the name of this interface. """ # Create a mapping from Model property names to API property names _names = { "data_protocols":'dataProtocols', "ip_address":'ipAddress', "name":'name' } def __init__(self, data_protocols=None, ip_address=None, name=None): """Constructor for the VserverNetworkInterface class""" # Initialize members of the class self.data_protocols = data_protocols self.ip_address = ip_address self.name = name @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the server's response. The keys MUST match property names in the API description. Returns: object: An instance of this structure class. """ if dictionary is None: return None # Extract variables from the dictionary data_protocols = dictionary.get('dataProtocols') ip_address = dictionary.get('ipAddress') name = dictionary.get('name') # Return an object of this model return cls(data_protocols, ip_address, name)
class Vservernetworkinterface(object): """Implementation of the 'Vserver Network Interface.' model. Specifies information about a logical network interface on a NetApp Vserver. The interface's IP address is the mount point for a specific data protocol, such as NFS or CIFS. Attributes: data_protocols (list of DataProtocolEnum): Array of Data Protocols. Specifies the set of data protocols supported by this interface. 'kNfs' indicates NFS connections. 'kCifs' indicates SMB (CIFS) connections. 'kIscsi' indicates iSCSI connections. 'kFc' indicates Fiber Channel connections. 'kFcache' indicates Flex Cache connections. 'kHttp' indicates HTTP connections. 'kNdmp' indicates NDMP connections. 'kManagement' indicates non-data connections used for management purposes. ip_address (string): Specifies the IP address of this interface. name (string): Specifies the name of this interface. """ _names = {'data_protocols': 'dataProtocols', 'ip_address': 'ipAddress', 'name': 'name'} def __init__(self, data_protocols=None, ip_address=None, name=None): """Constructor for the VserverNetworkInterface class""" self.data_protocols = data_protocols self.ip_address = ip_address self.name = name @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the server's response. The keys MUST match property names in the API description. Returns: object: An instance of this structure class. """ if dictionary is None: return None data_protocols = dictionary.get('dataProtocols') ip_address = dictionary.get('ipAddress') name = dictionary.get('name') return cls(data_protocols, ip_address, name)
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def isPalindrome(self, head): """ :type head: ListNode :rtype: bool """ if not head or not head.next: return True slow, fast = head, head while fast and fast.next: slow, fast = slow.next, fast.next.next if fast: slow = slow.next pre = None while slow: temp = slow.next slow.next = pre pre = slow slow = temp while pre and head: if pre.val != head.val: return False pre, head = pre.next, head.next return True
class Solution(object): def is_palindrome(self, head): """ :type head: ListNode :rtype: bool """ if not head or not head.next: return True (slow, fast) = (head, head) while fast and fast.next: (slow, fast) = (slow.next, fast.next.next) if fast: slow = slow.next pre = None while slow: temp = slow.next slow.next = pre pre = slow slow = temp while pre and head: if pre.val != head.val: return False (pre, head) = (pre.next, head.next) return True
print("linear search") si=int(input("\nEnter the size:")) data=list() for i in range(0,si): n=int(input()) data.append(n) cot=0 print("\nEnter the number you want to search:") val=int(input()) for i in range(0,len(data)): if(data[i]==val): break; else: cot=cot+1 print(cot)#linear search result=4 #binary search print("\nBinary Search") cot=0 beg=0 end=len(data) mid=(beg+end)/2 mid=int(mid) while beg<end and val!=data[mid]: if val>data[mid]: beg=mid+1 else: end=mid-1 mid=int((beg+end)/2) cot=cot+1 if 14==data[mid]: print("\nDATA FOUND") print(cot)
print('linear search') si = int(input('\nEnter the size:')) data = list() for i in range(0, si): n = int(input()) data.append(n) cot = 0 print('\nEnter the number you want to search:') val = int(input()) for i in range(0, len(data)): if data[i] == val: break else: cot = cot + 1 print(cot) print('\nBinary Search') cot = 0 beg = 0 end = len(data) mid = (beg + end) / 2 mid = int(mid) while beg < end and val != data[mid]: if val > data[mid]: beg = mid + 1 else: end = mid - 1 mid = int((beg + end) / 2) cot = cot + 1 if 14 == data[mid]: print('\nDATA FOUND') print(cot)
#Pio_prefs prefsdict = { ###modify or add preferences below #below are the database preferences. "sqluser" : "user", "sqldb" : "database", "sqlhost" : "127.0.0.1", #authorization must come from same address - extra security #valid values yes/no "staticip" : "no", #below is to do logging of qrystmts. "piolog" : "yes", #below are the show pobj and the show pinp preferences. #pobj's get converted to <xpobj and pinp get converted to <xpinp and ppref get converted to <xppref #any value other than yes is a no. #ppref's of showpobj and showppref can be included in html. (showpinp is ignored because pprefs are actually processed after pinp, pifs. #for ppref tag to override the value below, it must be the first ppref...otherwise it will only the show value for it and any following ppref #example: <ppref name="showpobj" value="no"> "showpobj" : 'no', "showpinp" : 'no', "showppref" : 'no', #below are the error preferences #values for pobjerror are "bottom", "top", "" or "ignore", or a page, as in "error.html" #bottom places errors at the end of the page, top at the begining, "" or ignore shows no error #and a page (indicated with a ".") will open that return that page. #example: <ppref name="pobjerror" value="ignore"> "pobjerror" : "bottom", "pobjautherrorfile" : "Pio_login.html", "pobjautherror" : "top", "piosiderrorfile" : "none", "piosiderror" : "bottom", "loginerror" : "Pio_login.html", #below is the administrator email "pioadminemail" : "user@yourdomain.com", #below is the upload folder "uploadpath" : "/Library/WebServer/Documents/upload/", #below is the 404 file not found preference "pio404" : 'Pio_404.html', #below is the error code for when an include file is not found #if the value is "comment" the program will show the error as a comment in html, otherwise it will show it as normal text "include404" : "nocomment", #below are special user preferences you can include in your own programs "dictionarykey" : "value" ###modify or add preferences above ## ##prefs can be overridden on a page by including a tag such as <ppref pref="pobjautherror" value="ignore'> } def gimme(dictkey): if prefsdict.has_key(dictkey): returnvalue = prefsdict[dictkey] else: returnvalue = "" return returnvalue def gimmedict(): return prefsdict
prefsdict = {'sqluser': 'user', 'sqldb': 'database', 'sqlhost': '127.0.0.1', 'staticip': 'no', 'piolog': 'yes', 'showpobj': 'no', 'showpinp': 'no', 'showppref': 'no', 'pobjerror': 'bottom', 'pobjautherrorfile': 'Pio_login.html', 'pobjautherror': 'top', 'piosiderrorfile': 'none', 'piosiderror': 'bottom', 'loginerror': 'Pio_login.html', 'pioadminemail': 'user@yourdomain.com', 'uploadpath': '/Library/WebServer/Documents/upload/', 'pio404': 'Pio_404.html', 'include404': 'nocomment', 'dictionarykey': 'value'} def gimme(dictkey): if prefsdict.has_key(dictkey): returnvalue = prefsdict[dictkey] else: returnvalue = '' return returnvalue def gimmedict(): return prefsdict
# Time: O(n) # Space: O(h) # Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None # iterative stack solution class Solution(object): def maxAncestorDiff(self, root): """ :type root: TreeNode :rtype: int """ result = 0 stack = [(root, 0, float("inf"))] while stack: node, mx, mn = stack.pop() if not node: continue result = max(result, mx-node.val, node.val-mn) mx = max(mx, node.val) mn = min(mn, node.val) stack.append((node.left, mx, mn)) stack.append((node.right, mx, mn)) return result # Time: O(n) # Space: O(h) # recursive solution class Solution2(object): def maxAncestorDiff(self, root): """ :type root: TreeNode :rtype: int """ def maxAncestorDiffHelper(node, mx, mn): if not node: return 0 result = max(mx-node.val, node.val-mn) mx = max(mx, node.val) mn = min(mn, node.val) result = max(result, maxAncestorDiffHelper(node.left, mx, mn)) result = max(result, maxAncestorDiffHelper(node.right, mx, mn)) return result return maxAncestorDiffHelper(root, 0, float("inf"))
class Treenode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def max_ancestor_diff(self, root): """ :type root: TreeNode :rtype: int """ result = 0 stack = [(root, 0, float('inf'))] while stack: (node, mx, mn) = stack.pop() if not node: continue result = max(result, mx - node.val, node.val - mn) mx = max(mx, node.val) mn = min(mn, node.val) stack.append((node.left, mx, mn)) stack.append((node.right, mx, mn)) return result class Solution2(object): def max_ancestor_diff(self, root): """ :type root: TreeNode :rtype: int """ def max_ancestor_diff_helper(node, mx, mn): if not node: return 0 result = max(mx - node.val, node.val - mn) mx = max(mx, node.val) mn = min(mn, node.val) result = max(result, max_ancestor_diff_helper(node.left, mx, mn)) result = max(result, max_ancestor_diff_helper(node.right, mx, mn)) return result return max_ancestor_diff_helper(root, 0, float('inf'))
""" Declarations for the .NET SDK Downloads URLs and version These are the URLs to download the .NET SDKs for each of the supported operating systems. These URLs are accessible from: https://dotnet.microsoft.com/download/dotnet-core. """ DOTNET_SDK_VERSION = "3.1.100" DOTNET_SDK = { "windows": { "url": "https://download.visualstudio.microsoft.com/download/pr/28a2c4ff-6154-473b-bd51-c62c76171551/ea47eab2219f323596c039b3b679c3d6/dotnet-sdk-3.1.100-win-x64.zip", "hash": "abcd034b230365d9454459e271e118a851969d82516b1529ee0bfea07f7aae52", }, "linux": { "url": "https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz", "hash": "3687b2a150cd5fef6d60a4693b4166994f32499c507cd04f346b6dda38ecdc46", }, "osx": { "url": "https://download.visualstudio.microsoft.com/download/pr/bea99127-a762-4f9e-aac8-542ad8aa9a94/afb5af074b879303b19c6069e9e8d75f/dotnet-sdk-3.1.100-osx-x64.tar.gz", "hash": "b38e6f8935d4b82b283d85c6b83cd24b5253730bab97e0e5e6f4c43e2b741aab", }, } RUNTIME_TFM = "netcoreapp3.1" RUNTIME_FRAMEWORK_VERSION = "3.1.0"
""" Declarations for the .NET SDK Downloads URLs and version These are the URLs to download the .NET SDKs for each of the supported operating systems. These URLs are accessible from: https://dotnet.microsoft.com/download/dotnet-core. """ dotnet_sdk_version = '3.1.100' dotnet_sdk = {'windows': {'url': 'https://download.visualstudio.microsoft.com/download/pr/28a2c4ff-6154-473b-bd51-c62c76171551/ea47eab2219f323596c039b3b679c3d6/dotnet-sdk-3.1.100-win-x64.zip', 'hash': 'abcd034b230365d9454459e271e118a851969d82516b1529ee0bfea07f7aae52'}, 'linux': {'url': 'https://download.visualstudio.microsoft.com/download/pr/d731f991-8e68-4c7c-8ea0-fad5605b077a/49497b5420eecbd905158d86d738af64/dotnet-sdk-3.1.100-linux-x64.tar.gz', 'hash': '3687b2a150cd5fef6d60a4693b4166994f32499c507cd04f346b6dda38ecdc46'}, 'osx': {'url': 'https://download.visualstudio.microsoft.com/download/pr/bea99127-a762-4f9e-aac8-542ad8aa9a94/afb5af074b879303b19c6069e9e8d75f/dotnet-sdk-3.1.100-osx-x64.tar.gz', 'hash': 'b38e6f8935d4b82b283d85c6b83cd24b5253730bab97e0e5e6f4c43e2b741aab'}} runtime_tfm = 'netcoreapp3.1' runtime_framework_version = '3.1.0'
''' Module for basic averaging of system states across multiple trials. Used in plotting. @author: Joe Schaul <joe.schaul@gmail.com> ''' class TrialState(object): def __init__(self, trial_id, times, systemStates, uniqueStates, stateCounterForStateX): self.trial_id = trial_id self.times = times self.systemStates = systemStates self.uniqueStates = uniqueStates self.stateCounterForStateX = stateCounterForStateX class TrialStats(object): def __init__(self, allTrialStateTuples, allTrialTopologyTuples): self.stateTuples = allTrialStateTuples self.topoTuples = allTrialTopologyTuples self.trialstates = [] self.trialAverage = None self.calculateAllStateCounts() self.calculateAverageStateCount() def calculateAllStateCounts(self): for trial in range(len(self.stateTuples)): times = [t for (t,s) in self.stateTuples[trial]] systemStates = [s for (t,s) in self.stateTuples[trial]] uniqueStates = reduce(lambda x, y: set(y).union(set(x)), systemStates) stateCounterDict = {} for x in uniqueStates: stateXCounts = [state.count(x) for state in systemStates] stateCounterDict[x] = stateXCounts #store info about this trial self.trialstates.append(TrialState(trial, times, systemStates, uniqueStates, stateCounterDict)) def calculateAverageStateCount(self): times = self.trialstates[0].times uniqueStates = self.trialstates[0].uniqueStates for trial in self.trialstates: try: uniqueStates = set(trial.uniqueStates).union(set(uniqueStates)) except: pass stateCounterDict = {} dummy = [0 for x in trial.systemStates] for x in uniqueStates: array = [trial.stateCounterForStateX.get(x, dummy) for trial in self.trialstates] averages = [sum(value)/len(self.trialstates) for value in zip(*array)] stateCounterDict[x] = averages self.trialAverage = TrialState(-1, times, None, uniqueStates, stateCounterDict)
""" Module for basic averaging of system states across multiple trials. Used in plotting. @author: Joe Schaul <joe.schaul@gmail.com> """ class Trialstate(object): def __init__(self, trial_id, times, systemStates, uniqueStates, stateCounterForStateX): self.trial_id = trial_id self.times = times self.systemStates = systemStates self.uniqueStates = uniqueStates self.stateCounterForStateX = stateCounterForStateX class Trialstats(object): def __init__(self, allTrialStateTuples, allTrialTopologyTuples): self.stateTuples = allTrialStateTuples self.topoTuples = allTrialTopologyTuples self.trialstates = [] self.trialAverage = None self.calculateAllStateCounts() self.calculateAverageStateCount() def calculate_all_state_counts(self): for trial in range(len(self.stateTuples)): times = [t for (t, s) in self.stateTuples[trial]] system_states = [s for (t, s) in self.stateTuples[trial]] unique_states = reduce(lambda x, y: set(y).union(set(x)), systemStates) state_counter_dict = {} for x in uniqueStates: state_x_counts = [state.count(x) for state in systemStates] stateCounterDict[x] = stateXCounts self.trialstates.append(trial_state(trial, times, systemStates, uniqueStates, stateCounterDict)) def calculate_average_state_count(self): times = self.trialstates[0].times unique_states = self.trialstates[0].uniqueStates for trial in self.trialstates: try: unique_states = set(trial.uniqueStates).union(set(uniqueStates)) except: pass state_counter_dict = {} dummy = [0 for x in trial.systemStates] for x in uniqueStates: array = [trial.stateCounterForStateX.get(x, dummy) for trial in self.trialstates] averages = [sum(value) / len(self.trialstates) for value in zip(*array)] stateCounterDict[x] = averages self.trialAverage = trial_state(-1, times, None, uniqueStates, stateCounterDict)
trees = [] with open("input.txt", "r") as f: for line in f.readlines(): trees.append(line[:-1]) # curr pos x, y = 0, 0 count = 0 while True: x += 3 y += 1 if y >= len(trees): break if trees[y][x % len(trees[y])] == '#': count += 1 print(count)
trees = [] with open('input.txt', 'r') as f: for line in f.readlines(): trees.append(line[:-1]) (x, y) = (0, 0) count = 0 while True: x += 3 y += 1 if y >= len(trees): break if trees[y][x % len(trees[y])] == '#': count += 1 print(count)
#35011 #a3_p10.py #Miruthula Ramesh #mramesh@jacobs-university.de n = int(input("Enter the width")) w = int(input("Enter the length")) c = input("Enter a character") space=" " def print_frame(n, w): for i in range(n): if i == 0 or i == n-1: print(w*c) else: print(c + space*(w-2) + c) print_frame(n,w)
n = int(input('Enter the width')) w = int(input('Enter the length')) c = input('Enter a character') space = ' ' def print_frame(n, w): for i in range(n): if i == 0 or i == n - 1: print(w * c) else: print(c + space * (w - 2) + c) print_frame(n, w)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 18 10:36:17 2019 @author: tuyenta """ s = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450" largestProduct = 0 for i in range(0, len(s) - 13): product = 1 for j in range(i, i + 13): product *= int(s[j: j + 1]) if product > largestProduct: largestProduct = product print (largestProduct)
""" Created on Tue Jun 18 10:36:17 2019 @author: tuyenta """ s = '7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450' largest_product = 0 for i in range(0, len(s) - 13): product = 1 for j in range(i, i + 13): product *= int(s[j:j + 1]) if product > largestProduct: largest_product = product print(largestProduct)
a = int(input()) sum = 0 while True: if ( a == 0): print (int(sum)) break if ( a <= 2): print (-1) break if (a%5 != 0): a = a - 3 sum = sum + 1 else: sum = sum + int(a/5) a = 0
a = int(input()) sum = 0 while True: if a == 0: print(int(sum)) break if a <= 2: print(-1) break if a % 5 != 0: a = a - 3 sum = sum + 1 else: sum = sum + int(a / 5) a = 0
"""IntegerHeap.py Priority queues of integer keys based on van Emde Boas trees. Only the keys are stored; caller is responsible for keeping track of any data associated with the keys in a separate dictionary. We use a version of vEB trees in which all accesses to subtrees are performed indirectly through a hash table and the data structures for the subtrees are only created when they are nonempty. As a consequence, the data structure takes only linear space (linear in the number of keys stored in the heap) while still preserving the O(log log U) time per operation of vEB trees. For better performance, we switch to bitvectors for sufficiently small integer sizes. Usage: Q = BitVectorHeap() # Bit-vector based heap for integers Q = FlatHeap(i) # Flat heap for 2^i-bit integers Q = LinearHeap() # Set-based heap with linear-time min operation Q = IntegerHeap(i) # Choose between BVH and FH depending on i Q.add(x) # Include x among the values in the heap Q.remove(x) # Remove x from the values in the heap Q.min() # Return the minimum value in the heap if Q # True if Q is nonempty, false if empty Because the min operation in LinearHeap is a Python primitive rather than a sequence of interpreted Python instructions, it is actually quite fast; testing indicates that, for 32-bit keys, FlatHeap(5) beats LinearHeap only for heaps of 250 or more items. This breakeven point would likely be different for different numbers of bits per word or when runtime optimizers such as psyco are in use. D. Eppstein, January 2010 """ def IntegerHeap(i): """Return an integer heap for 2^i-bit integers. We use a BitVectorHeap for small i and a FlatHeap for large i. Timing tests indicate that the cutoff i <= 3 is slightly faster than the also-plausible cutoff i <= 2, and that both are much faster than the way-too-large cutoff i <= 4. The resulting IntegerHeap objects will use 255-bit long integers, still small compared to the overhead of a FlatHeap.""" if i <= 3: return BitVectorHeap() return FlatHeap(i) Log2Table = {} # Table of powers of two, with their logs def Log2(b): """Return log_2(b), where b must be a power of two.""" while b not in Log2Table: i = len(Log2Table) Log2Table[1 << i] = i return Log2Table[b] # ====================================================================== # BitVectorHeap # ====================================================================== class BitVectorHeap(object): """Maintain the minimum of a set of integers using bitvector operations.""" def __init__(self): """Create a new BitVectorHeap.""" self._S = 0 def __nonzero__(self): """True if this heap is nonempty, false if empty.""" return self._S != 0 def __bool__(self): """True if this heap is nonempty, false if empty.""" return self._S != 0 def add(self, x): """Include x among the values in the heap.""" self._S |= 1 << x def remove(self, x): """Remove x from the values in the heap.""" self._S &= ~1 << x def min(self): """Return the minimum value in the heap.""" if not self._S: raise ValueError("BitVectorHeap is empty") return Log2(self._S & ~(self._S - 1)) # ====================================================================== # FlatHeap # ====================================================================== class FlatHeap(object): """Maintain the minimum of a set of 2^i-bit integer values.""" def __init__(self, i): """Create a new FlatHeap for 2^i-bit integers.""" self._min = None self._order = i self._shift = 1 << (i - 1) self._max = (1 << (1 << i)) - 1 self._HQ = IntegerHeap(i - 1) # Heap of high halfwords self._LQ = {} # Map high half to heaps of low halfwords def _rangecheck(self, x): """Make sure x is a number we can include in this FlatHeap.""" if x < 0 or x > self._max: raise ValueError("FlatHeap: {0!s} out of range".format(repr(x))) def __nonzero__(self): """True if this heap is nonempty, false if empty.""" return self._min is not None def __bool__(self): """True if this heap is nonempty, false if empty.""" return self._min is not None def min(self): """Return the minimum value in the heap.""" if self._min is None: raise ValueError("FlatHeap is empty") return self._min def add(self, x): """Include x among the values in the heap.""" self._rangecheck(x) if self._min is None or self._min == x: # adding to an empty heap is easy self._min = x return if x < self._min: # swap to make sure the value we're adding is non-minimal x, self._min = self._min, x H = x >> self._shift # split into high and low halfwords L = x - (H << self._shift) if H not in self._LQ: self._HQ.add(H) self._LQ[H] = IntegerHeap(self._order - 1) self._LQ[H].add(L) def remove(self, x): """Remove x from the values in the heap.""" self._rangecheck(x) if self._min == x: # Removing minimum, move next value into place # and prepare to remove that next value from secondary heaps if not self._HQ: self._min = None return H = self._HQ.min() L = self._LQ[H].min() x = self._min = (H << self._shift) + L else: H = x >> self._shift # split into high and low halfwords L = x - (H << self._shift) if H not in self._LQ: return # ignore removal when not in heap self._LQ[H].remove(L) if not self._LQ[H]: del self._LQ[H] self._HQ.remove(H) # ====================================================================== # LinearHeap # ====================================================================== class LinearHeap(object): """Maintain the minimum of a set of integers using a set object.""" def __init__(self): """Create a new BitVectorHeap.""" self._S = set() def __nonzero__(self): """True if this heap is nonempty, false if empty.""" return len(self._S) > 0 def __bool__(self): """True if this heap is nonempty, false if empty.""" return len(self._S) > 0 def add(self, x): """Include x among the values in the heap.""" self._S.add(x) def remove(self, x): """Remove x from the values in the heap.""" self._S.remove(x) def min(self): """Return the minimum value in the heap.""" return min(self._S)
"""IntegerHeap.py Priority queues of integer keys based on van Emde Boas trees. Only the keys are stored; caller is responsible for keeping track of any data associated with the keys in a separate dictionary. We use a version of vEB trees in which all accesses to subtrees are performed indirectly through a hash table and the data structures for the subtrees are only created when they are nonempty. As a consequence, the data structure takes only linear space (linear in the number of keys stored in the heap) while still preserving the O(log log U) time per operation of vEB trees. For better performance, we switch to bitvectors for sufficiently small integer sizes. Usage: Q = BitVectorHeap() # Bit-vector based heap for integers Q = FlatHeap(i) # Flat heap for 2^i-bit integers Q = LinearHeap() # Set-based heap with linear-time min operation Q = IntegerHeap(i) # Choose between BVH and FH depending on i Q.add(x) # Include x among the values in the heap Q.remove(x) # Remove x from the values in the heap Q.min() # Return the minimum value in the heap if Q # True if Q is nonempty, false if empty Because the min operation in LinearHeap is a Python primitive rather than a sequence of interpreted Python instructions, it is actually quite fast; testing indicates that, for 32-bit keys, FlatHeap(5) beats LinearHeap only for heaps of 250 or more items. This breakeven point would likely be different for different numbers of bits per word or when runtime optimizers such as psyco are in use. D. Eppstein, January 2010 """ def integer_heap(i): """Return an integer heap for 2^i-bit integers. We use a BitVectorHeap for small i and a FlatHeap for large i. Timing tests indicate that the cutoff i <= 3 is slightly faster than the also-plausible cutoff i <= 2, and that both are much faster than the way-too-large cutoff i <= 4. The resulting IntegerHeap objects will use 255-bit long integers, still small compared to the overhead of a FlatHeap.""" if i <= 3: return bit_vector_heap() return flat_heap(i) log2_table = {} def log2(b): """Return log_2(b), where b must be a power of two.""" while b not in Log2Table: i = len(Log2Table) Log2Table[1 << i] = i return Log2Table[b] class Bitvectorheap(object): """Maintain the minimum of a set of integers using bitvector operations.""" def __init__(self): """Create a new BitVectorHeap.""" self._S = 0 def __nonzero__(self): """True if this heap is nonempty, false if empty.""" return self._S != 0 def __bool__(self): """True if this heap is nonempty, false if empty.""" return self._S != 0 def add(self, x): """Include x among the values in the heap.""" self._S |= 1 << x def remove(self, x): """Remove x from the values in the heap.""" self._S &= ~1 << x def min(self): """Return the minimum value in the heap.""" if not self._S: raise value_error('BitVectorHeap is empty') return log2(self._S & ~(self._S - 1)) class Flatheap(object): """Maintain the minimum of a set of 2^i-bit integer values.""" def __init__(self, i): """Create a new FlatHeap for 2^i-bit integers.""" self._min = None self._order = i self._shift = 1 << i - 1 self._max = (1 << (1 << i)) - 1 self._HQ = integer_heap(i - 1) self._LQ = {} def _rangecheck(self, x): """Make sure x is a number we can include in this FlatHeap.""" if x < 0 or x > self._max: raise value_error('FlatHeap: {0!s} out of range'.format(repr(x))) def __nonzero__(self): """True if this heap is nonempty, false if empty.""" return self._min is not None def __bool__(self): """True if this heap is nonempty, false if empty.""" return self._min is not None def min(self): """Return the minimum value in the heap.""" if self._min is None: raise value_error('FlatHeap is empty') return self._min def add(self, x): """Include x among the values in the heap.""" self._rangecheck(x) if self._min is None or self._min == x: self._min = x return if x < self._min: (x, self._min) = (self._min, x) h = x >> self._shift l = x - (H << self._shift) if H not in self._LQ: self._HQ.add(H) self._LQ[H] = integer_heap(self._order - 1) self._LQ[H].add(L) def remove(self, x): """Remove x from the values in the heap.""" self._rangecheck(x) if self._min == x: if not self._HQ: self._min = None return h = self._HQ.min() l = self._LQ[H].min() x = self._min = (H << self._shift) + L else: h = x >> self._shift l = x - (H << self._shift) if H not in self._LQ: return self._LQ[H].remove(L) if not self._LQ[H]: del self._LQ[H] self._HQ.remove(H) class Linearheap(object): """Maintain the minimum of a set of integers using a set object.""" def __init__(self): """Create a new BitVectorHeap.""" self._S = set() def __nonzero__(self): """True if this heap is nonempty, false if empty.""" return len(self._S) > 0 def __bool__(self): """True if this heap is nonempty, false if empty.""" return len(self._S) > 0 def add(self, x): """Include x among the values in the heap.""" self._S.add(x) def remove(self, x): """Remove x from the values in the heap.""" self._S.remove(x) def min(self): """Return the minimum value in the heap.""" return min(self._S)
def add_num(x, y): return x + y def sub_num(x, y): return x - y class MathFunctions(object): pass
def add_num(x, y): return x + y def sub_num(x, y): return x - y class Mathfunctions(object): pass
if __name__ == '__main__': N = int(input()) main_list=[] for iterate in range(N): entered_string=input().split() if entered_string[0] == 'insert': main_list.insert(int(entered_string[1]),int(entered_string[2])) elif entered_string[0] == 'print': print(main_list) elif entered_string[0] == 'remove': main_list.remove(int(entered_string[1])) elif entered_string[0] == 'append': main_list.append(int(entered_string[1])) elif entered_string[0] == 'sort': main_list.sort() elif entered_string[0] == 'pop': main_list.pop() elif entered_string[0] == 'reverse': main_list.reverse()
if __name__ == '__main__': n = int(input()) main_list = [] for iterate in range(N): entered_string = input().split() if entered_string[0] == 'insert': main_list.insert(int(entered_string[1]), int(entered_string[2])) elif entered_string[0] == 'print': print(main_list) elif entered_string[0] == 'remove': main_list.remove(int(entered_string[1])) elif entered_string[0] == 'append': main_list.append(int(entered_string[1])) elif entered_string[0] == 'sort': main_list.sort() elif entered_string[0] == 'pop': main_list.pop() elif entered_string[0] == 'reverse': main_list.reverse()
with open('input.txt', 'r') as file: input = file.readlines() input = [ step.split() for step in input ] input = [ {step[0]: int(step[1])} for step in input ] def part1(): x = 0 y = 0 for step in input: x += step.get('forward', 0) y += step.get('down', 0) y -= step.get('up', 0) print(x,y) return x * y def part2(): x = 0 y = 0 a = 0 for step in input: x += step.get('forward', 0) y += step.get('forward', 0) * a #y += step.get('down', 0) a += step.get('down', 0) #y -= step.get('up', 0) a -= step.get('up', 0) print(x,y,a) return x * y print(part2())
with open('input.txt', 'r') as file: input = file.readlines() input = [step.split() for step in input] input = [{step[0]: int(step[1])} for step in input] def part1(): x = 0 y = 0 for step in input: x += step.get('forward', 0) y += step.get('down', 0) y -= step.get('up', 0) print(x, y) return x * y def part2(): x = 0 y = 0 a = 0 for step in input: x += step.get('forward', 0) y += step.get('forward', 0) * a a += step.get('down', 0) a -= step.get('up', 0) print(x, y, a) return x * y print(part2())
def f(x): if x: x = 1 else: x = 'zero' y = x return y f(1)
def f(x): if x: x = 1 else: x = 'zero' y = x return y f(1)
class Pattern_Twenty_Six: '''Pattern twenty_six *** * * * * *** * * * * *** ''' def __init__(self, strings='*'): if not isinstance(strings, str): strings = str(strings) for i in range(7): if i in [0, 6]: print(f' {strings * 3}') elif i in [1, 4, 5]: print(f'{strings} {strings}') elif i == 3: print(f'{strings} {strings * 3}') else: print(strings) if __name__ == '__main__': Pattern_Twenty_Six()
class Pattern_Twenty_Six: """Pattern twenty_six *** * * * * *** * * * * *** """ def __init__(self, strings='*'): if not isinstance(strings, str): strings = str(strings) for i in range(7): if i in [0, 6]: print(f' {strings * 3}') elif i in [1, 4, 5]: print(f'{strings} {strings}') elif i == 3: print(f'{strings} {strings * 3}') else: print(strings) if __name__ == '__main__': pattern__twenty__six()
def debug_transformer(func): def wrapper(): print(f'Function `{func.__name__}` called') func() print(f'Function `{func.__name__}` finished') return wrapper @debug_transformer def walkout(): print('Bye Felicia') walkout()
def debug_transformer(func): def wrapper(): print(f'Function `{func.__name__}` called') func() print(f'Function `{func.__name__}` finished') return wrapper @debug_transformer def walkout(): print('Bye Felicia') walkout()
def preprocess(text): text=text.replace('\n', '\n\r') return text def getLetter(): return open("./input/letter.txt", "r").read()
def preprocess(text): text = text.replace('\n', '\n\r') return text def get_letter(): return open('./input/letter.txt', 'r').read()
MainWindow.clearData() MainWindow.openPreWindow() box = CAD.Box() box.setName('Box_1') box.setLocation(0,0,0) box.setPara(10,10,10) box.create() cylinder = CAD.Cylinder() cylinder.setName('Cylinder_2') cylinder.setLocation(0,0,0) cylinder.setRadius(5) cylinder.setLength(10) cylinder.setAxis(0,0,1) cylinder.create() booloperation = CAD.BooLOperation() booloperation.setBoolType('Fause') booloperation.setIndexOfSolid1InGeo(1,0) booloperation.setIndexOfSolid2InGeo(2,0) booloperation.create() gmsher = Mesher.Gmsher() gmsher.setDim(3) gmsher.appendSolid(3,0) gmsher.setElementType("Tet") gmsher.setElementOrder(1) gmsher.setMethod(1) gmsher.setSizeFactor(1) gmsher.setMinSize(0) gmsher.setMaxSize(1.0) gmsher.cleanGeo() gmsher.startGenerationThread()
MainWindow.clearData() MainWindow.openPreWindow() box = CAD.Box() box.setName('Box_1') box.setLocation(0, 0, 0) box.setPara(10, 10, 10) box.create() cylinder = CAD.Cylinder() cylinder.setName('Cylinder_2') cylinder.setLocation(0, 0, 0) cylinder.setRadius(5) cylinder.setLength(10) cylinder.setAxis(0, 0, 1) cylinder.create() booloperation = CAD.BooLOperation() booloperation.setBoolType('Fause') booloperation.setIndexOfSolid1InGeo(1, 0) booloperation.setIndexOfSolid2InGeo(2, 0) booloperation.create() gmsher = Mesher.Gmsher() gmsher.setDim(3) gmsher.appendSolid(3, 0) gmsher.setElementType('Tet') gmsher.setElementOrder(1) gmsher.setMethod(1) gmsher.setSizeFactor(1) gmsher.setMinSize(0) gmsher.setMaxSize(1.0) gmsher.cleanGeo() gmsher.startGenerationThread()
class Parrot(): def __init__(self, squawk, is_alive=True): self.squawk = squawk self.is_alive = is_alive african_grey = Parrot('Polly want a Cracker?') norwegian_blue = Parrot('', is_alive=False) def squawk(self): if self.is_alive: return self.squawk else: return None african_grey.squawk() norwegian_blue.squawk() def set_alive(self, is_alive): self.is_alive = is_alive
class Parrot: def __init__(self, squawk, is_alive=True): self.squawk = squawk self.is_alive = is_alive african_grey = parrot('Polly want a Cracker?') norwegian_blue = parrot('', is_alive=False) def squawk(self): if self.is_alive: return self.squawk else: return None african_grey.squawk() norwegian_blue.squawk() def set_alive(self, is_alive): self.is_alive = is_alive
def solution(S, K): # write your code in Python 3.6 day_dict = {0:'Mon', 1:'Tue', 2:'Wed', 3:'Thu', 4:'Fri', 5:'Sat', 6:'Sun'} return day_dict[list(day_dict.values()).index(S)+K] S='Wed' K=2 print(solution(S,K))
def solution(S, K): day_dict = {0: 'Mon', 1: 'Tue', 2: 'Wed', 3: 'Thu', 4: 'Fri', 5: 'Sat', 6: 'Sun'} return day_dict[list(day_dict.values()).index(S) + K] s = 'Wed' k = 2 print(solution(S, K))
produtos = {1: 4.0, 2: 4.5, 3: 5.0, 4: 2.0, 5: 1.5} produto, quantidade = [int(num) for num in input().split()] total = produtos[produto] * quantidade print('Total: R$ {:.2f}'.format(total))
produtos = {1: 4.0, 2: 4.5, 3: 5.0, 4: 2.0, 5: 1.5} (produto, quantidade) = [int(num) for num in input().split()] total = produtos[produto] * quantidade print('Total: R$ {:.2f}'.format(total))
# Code Listing #3 """ Prime number iterator class """ class Prime(object): """ A prime number iterator for first 'n' primes """ def __init__(self, n): self.n = n self.count = 0 self.value = 0 def __iter__(self): return self def __next__(self): """ Return next item in iterator """ if self.count == self.n: raise StopIteration("end of iteration") return self.compute() # Uncomment next line for profiling with line profiler # or memory profiler. # @profile def is_prime(self): """ Whether current value is prime ? """ vroot = int(self.value ** 0.5) + 1 for i in range(3, vroot, 2): if self.value % i == 0: return False return True def compute(self): """ Compute next prime """ # Second time, reset value if self.count == 1: self.value = 1 while True: self.value += 2 if self.is_prime(): self.count += 1 break return self.value if __name__ == "__main__": l = list(Prime(1000))
""" Prime number iterator class """ class Prime(object): """ A prime number iterator for first 'n' primes """ def __init__(self, n): self.n = n self.count = 0 self.value = 0 def __iter__(self): return self def __next__(self): """ Return next item in iterator """ if self.count == self.n: raise stop_iteration('end of iteration') return self.compute() def is_prime(self): """ Whether current value is prime ? """ vroot = int(self.value ** 0.5) + 1 for i in range(3, vroot, 2): if self.value % i == 0: return False return True def compute(self): """ Compute next prime """ if self.count == 1: self.value = 1 while True: self.value += 2 if self.is_prime(): self.count += 1 break return self.value if __name__ == '__main__': l = list(prime(1000))
def merge_dicts(*dicts): """ Given any number of dicts, shallow copy and merge into a new dict, precedence goes to key value pairs in latter dicts. """ result = {} for d in dicts: result.update(d) return result def evaluate_term(term, **kwargs): return term.evaluate(**kwargs) if hasattr(term, 'evaluate') else term
def merge_dicts(*dicts): """ Given any number of dicts, shallow copy and merge into a new dict, precedence goes to key value pairs in latter dicts. """ result = {} for d in dicts: result.update(d) return result def evaluate_term(term, **kwargs): return term.evaluate(**kwargs) if hasattr(term, 'evaluate') else term
arr=[int(x) for x in input().split()] sum=0 for i in range(1,(arr[2]+1)): sum+=arr[0]*i if sum<=arr[1]: print(0) else: print(sum-arr[1])
arr = [int(x) for x in input().split()] sum = 0 for i in range(1, arr[2] + 1): sum += arr[0] * i if sum <= arr[1]: print(0) else: print(sum - arr[1])
# Binary search of an item in a (sorted) list def binary_search(alist, item): first = 0 last = len(alist) - 1 found = False while first <= last and not found: middle = (first + last) // 2 if alist[middle] == item: found = True else: if item < alist[middle]: # Search in the left part last = middle - 1 else: first = middle + 1 return found alist = [1, 4, 6, 7, 9, 15, 33, 45, 68, 90] print(binary_search(alist, 68))
def binary_search(alist, item): first = 0 last = len(alist) - 1 found = False while first <= last and (not found): middle = (first + last) // 2 if alist[middle] == item: found = True elif item < alist[middle]: last = middle - 1 else: first = middle + 1 return found alist = [1, 4, 6, 7, 9, 15, 33, 45, 68, 90] print(binary_search(alist, 68))
""" Experiments with infix operator dispatch >>> kadd = KnowsAdd() >>> kadd + 1 (<KnowsAdd object>, 1) >>> kadd * 1 """ class KnowsAdd: def __add__(self, other): return self, other def __repr__(self): return '<{} object>'.format(type(self).__name__)
""" Experiments with infix operator dispatch >>> kadd = KnowsAdd() >>> kadd + 1 (<KnowsAdd object>, 1) >>> kadd * 1 """ class Knowsadd: def __add__(self, other): return (self, other) def __repr__(self): return '<{} object>'.format(type(self).__name__)
def resolve(): ''' code here ''' N = int(input()) A_list = [int(item) for item in input().split()] hp = sum(A_list) #leaf is_slove = True res = 1 # root prev = 1 prev_add_num = 0 delete_cnt = 0 if hp > 2**N: is_slove = False elif A_list[0] == 1: if len(A_list) >= 2: if sum(A_list[1:]) >= 1: is_slove = False else: for i in range(1, N+1): if 2**i >= A_list[i]: add_num = min(2**(i-1) - prev_add_num, hp) res += add_num hp -= A_list[i] prev = A_list[i] prev_add_num = add_num else: is_slove = False break print(i, prev, hp, res) print(res) if is_slove else print(-1) if __name__ == "__main__": resolve()
def resolve(): """ code here """ n = int(input()) a_list = [int(item) for item in input().split()] hp = sum(A_list) is_slove = True res = 1 prev = 1 prev_add_num = 0 delete_cnt = 0 if hp > 2 ** N: is_slove = False elif A_list[0] == 1: if len(A_list) >= 2: if sum(A_list[1:]) >= 1: is_slove = False else: for i in range(1, N + 1): if 2 ** i >= A_list[i]: add_num = min(2 ** (i - 1) - prev_add_num, hp) res += add_num hp -= A_list[i] prev = A_list[i] prev_add_num = add_num else: is_slove = False break print(i, prev, hp, res) print(res) if is_slove else print(-1) if __name__ == '__main__': resolve()
class Solution: def reverseWords(self, s: str) -> str: s = s.split(" ") s = [i for i in s if i != ""] return " ".join(s[::-1])
class Solution: def reverse_words(self, s: str) -> str: s = s.split(' ') s = [i for i in s if i != ''] return ' '.join(s[::-1])
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right # if root.left and root.right: # if v <= root.left.val or v >= root.right.val: return False # elif root.left: # if v <= root.left.val: return False # elif root.right: # if v >= root.right.val: return False class Solution: def isValidBST(self, root: TreeNode) -> bool: self.prev = None return self.recur(root) def recur(self, root): if not root: return True left = self.recur(root.left) if self.prev and self.prev.val >= root.val: return False self.prev = root right = self.recur(root.right) return left and right
class Solution: def is_valid_bst(self, root: TreeNode) -> bool: self.prev = None return self.recur(root) def recur(self, root): if not root: return True left = self.recur(root.left) if self.prev and self.prev.val >= root.val: return False self.prev = root right = self.recur(root.right) return left and right
class hparams: sample_rate = 16000 n_fft = 1024 #fft_bins = n_fft // 2 + 1 num_mels = 80 hop_length = 256 win_length = 1024 fmin = 90 fmax = 7600 min_level_db = -100 ref_level_db = 20 seq_len_factor = 64 bits = 12 seq_len = seq_len_factor * hop_length dim_neck = 32 dim_emb = 256 dim_pre = 512 freq = 32 ## wavenet vocoder builder = 'wavenet' hop_size = 256 log_scale_min = float(-32.23619130191664) out_channels = 10 * 3 layers = 24 stacks = 4 residual_channels = 512 gate_channels = 512 skip_out_channels = 256 dropout = 1 - 0.95 kernel_size = 3 cin_channels = 80 upsample_conditional_features = True upsample_scales = [4, 4, 4, 4] freq_axis_kernel_size = 3 gin_channels = -1 n_speakers = -1 weight_normalization = True legacy = True
class Hparams: sample_rate = 16000 n_fft = 1024 num_mels = 80 hop_length = 256 win_length = 1024 fmin = 90 fmax = 7600 min_level_db = -100 ref_level_db = 20 seq_len_factor = 64 bits = 12 seq_len = seq_len_factor * hop_length dim_neck = 32 dim_emb = 256 dim_pre = 512 freq = 32 builder = 'wavenet' hop_size = 256 log_scale_min = float(-32.23619130191664) out_channels = 10 * 3 layers = 24 stacks = 4 residual_channels = 512 gate_channels = 512 skip_out_channels = 256 dropout = 1 - 0.95 kernel_size = 3 cin_channels = 80 upsample_conditional_features = True upsample_scales = [4, 4, 4, 4] freq_axis_kernel_size = 3 gin_channels = -1 n_speakers = -1 weight_normalization = True legacy = True
# Material buttonType = ['Arrow button', 'Radio button', 'Switch button', 'Option'] requestLUT = [ { 'name' : 'Radio', 'on' : 'OSD_ImgFolder/radio_on.png', 'off' : 'OSD_ImgFolder/radio_off.png', 'default' : 'off', 'hint_path' : 'OSD_ImgFolder/L4 off.png', 'hint': 0 }, { 'name' : 'Switch', 'on' : 'OSD_ImgFolder/switch_on.png', 'off' : 'OSD_ImgFolder/switch_off.png', 'default' : 'off', 'hint_path' : 'OSD_ImgFolder/L4 off.png', 'hint' : 0 }, { 'name' : 'Switch_clue', 'on' : 'OSD_ImgFolder/switch_on.png', 'off' : 'OSD_ImgFolder/switch_off.png', 'default' : 'off', 'hint_path' : 'OSD_ImgFolder/L4 off.png', 'hint' : 1 } ] backgroundLUT = [ { 'name' : 'Background', 'position' : (0, 0), 'path' : 'OSD_ImgFolder/MainFrame.png' }, { 'name' : 'Lay_1', 'position' : (-405, -30), 'path' : 'OSD_ImgFolder/Layer_1.png' }, { 'name' : 'Lay_2', 'position' : (-235, -30), 'path' : 'OSD_ImgFolder/Layer_2.png' }, { 'name' : 'Lay_3', 'position' : (35, -30), 'path' : 'OSD_ImgFolder/Layer_3.png' }, { 'name' : 'Lay_4', 'position' : (305, -30), 'path' : 'OSD_ImgFolder/Layer_4.png' } ] strLUT = [ { 'name' : 'L1 str', 'position' : (-405, -30), 'path' : 'OSD_ImgFolder/aLayer_1.png', 'hint' : 'OSD_ImgFolder/aLayer_1.png' }, { 'name' : 'L2_str', 'position' : (-235, -30), 'path' : 'OSD_ImgFolder/L2 str.png', 'hint' : 'OSD_ImgFolder/L2 str.png' }, { 'name' : 'L3_str', 'position' : (35, -30), 'path' : 'OSD_ImgFolder/L3 str.png', 'hint' : 'OSD_ImgFolder/L3 off.png' }, { 'name' : 'L4_str', 'position' : (305, -30), 'path' : 'OSD_ImgFolder/L4 str.png', 'hint' : 'OSD_ImgFolder/L4 off.png' } ] indicatorLUT = [ { 'name' : 'L1 selector', 'width' : 68, 'height' : 70, 'position' : [(-405, 110), (-405, 40), (-405, -30), (-405, -100), (-405, -170)] }, { 'name' : 'L2 selector', 'width' : 268, 'height' : 70, 'position' : [(-235, 110), (-235, 40), (-235, -30), (-235, -100), (-235, -170)] }, { 'name' : 'L3 selector', 'width' : 268, 'height' : 70, 'position' : [(35, 110), (35, 40), (35, -30), (35, -100), (35, -170)] }, { 'name' : 'L4 selector', 'width' : 268, 'height' : 70, 'position' : [(305, 110), (305, 40), (305, -30), (305, -100), (305, -170)] } ]
button_type = ['Arrow button', 'Radio button', 'Switch button', 'Option'] request_lut = [{'name': 'Radio', 'on': 'OSD_ImgFolder/radio_on.png', 'off': 'OSD_ImgFolder/radio_off.png', 'default': 'off', 'hint_path': 'OSD_ImgFolder/L4 off.png', 'hint': 0}, {'name': 'Switch', 'on': 'OSD_ImgFolder/switch_on.png', 'off': 'OSD_ImgFolder/switch_off.png', 'default': 'off', 'hint_path': 'OSD_ImgFolder/L4 off.png', 'hint': 0}, {'name': 'Switch_clue', 'on': 'OSD_ImgFolder/switch_on.png', 'off': 'OSD_ImgFolder/switch_off.png', 'default': 'off', 'hint_path': 'OSD_ImgFolder/L4 off.png', 'hint': 1}] background_lut = [{'name': 'Background', 'position': (0, 0), 'path': 'OSD_ImgFolder/MainFrame.png'}, {'name': 'Lay_1', 'position': (-405, -30), 'path': 'OSD_ImgFolder/Layer_1.png'}, {'name': 'Lay_2', 'position': (-235, -30), 'path': 'OSD_ImgFolder/Layer_2.png'}, {'name': 'Lay_3', 'position': (35, -30), 'path': 'OSD_ImgFolder/Layer_3.png'}, {'name': 'Lay_4', 'position': (305, -30), 'path': 'OSD_ImgFolder/Layer_4.png'}] str_lut = [{'name': 'L1 str', 'position': (-405, -30), 'path': 'OSD_ImgFolder/aLayer_1.png', 'hint': 'OSD_ImgFolder/aLayer_1.png'}, {'name': 'L2_str', 'position': (-235, -30), 'path': 'OSD_ImgFolder/L2 str.png', 'hint': 'OSD_ImgFolder/L2 str.png'}, {'name': 'L3_str', 'position': (35, -30), 'path': 'OSD_ImgFolder/L3 str.png', 'hint': 'OSD_ImgFolder/L3 off.png'}, {'name': 'L4_str', 'position': (305, -30), 'path': 'OSD_ImgFolder/L4 str.png', 'hint': 'OSD_ImgFolder/L4 off.png'}] indicator_lut = [{'name': 'L1 selector', 'width': 68, 'height': 70, 'position': [(-405, 110), (-405, 40), (-405, -30), (-405, -100), (-405, -170)]}, {'name': 'L2 selector', 'width': 268, 'height': 70, 'position': [(-235, 110), (-235, 40), (-235, -30), (-235, -100), (-235, -170)]}, {'name': 'L3 selector', 'width': 268, 'height': 70, 'position': [(35, 110), (35, 40), (35, -30), (35, -100), (35, -170)]}, {'name': 'L4 selector', 'width': 268, 'height': 70, 'position': [(305, 110), (305, 40), (305, -30), (305, -100), (305, -170)]}]
"""8. String to Integer (atoi) Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases. Notes: It is intended for this problem to be specified vaguely (ie, no given input specs). You are responsible to gather all the input requirements up front. """ class Solution: def myAtoi(self, str): """ :type str: str :rtype: int """ str = str.strip() if str is None or len(str) == 0: return 0 ret, start, isPositive = 0, 0, 1 include = ["%d" % i for i in range(10)] if str[0] == '-' or str[0] == '+': isPositive = 1 if str[0] == '+' else -1 start += 1 for i in range(start, len(str)): if str[i] not in include: break ret = ret * 10 + int(str[i]) ret = ret * isPositive return max(-2**31, min(2**31 - 1, ret))
"""8. String to Integer (atoi) Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases. Notes: It is intended for this problem to be specified vaguely (ie, no given input specs). You are responsible to gather all the input requirements up front. """ class Solution: def my_atoi(self, str): """ :type str: str :rtype: int """ str = str.strip() if str is None or len(str) == 0: return 0 (ret, start, is_positive) = (0, 0, 1) include = ['%d' % i for i in range(10)] if str[0] == '-' or str[0] == '+': is_positive = 1 if str[0] == '+' else -1 start += 1 for i in range(start, len(str)): if str[i] not in include: break ret = ret * 10 + int(str[i]) ret = ret * isPositive return max(-2 ** 31, min(2 ** 31 - 1, ret))
database = "database" user = "postgres" password = "password" host = "localhost" port = "5432"
database = 'database' user = 'postgres' password = 'password' host = 'localhost' port = '5432'
def mul(a, b): return a * b mul(3, 4) #12 def mul5(a): return mul(5,a) mul5(2) #10 def mul(a): def helper(b): return a * b return helper mul(5)(2) #10 def fun1(a): x = a * 3 def fun2(b): nonlocal x return b + x return fun2 test_fun = fun1(4) test_fun(7) #19
def mul(a, b): return a * b mul(3, 4) def mul5(a): return mul(5, a) mul5(2) def mul(a): def helper(b): return a * b return helper mul(5)(2) def fun1(a): x = a * 3 def fun2(b): nonlocal x return b + x return fun2 test_fun = fun1(4) test_fun(7)
seagate_sense_codes = {0: {0: {0: {0: 'No error.', 'L1': 'No Sense', 'L2': 'No Sense'}, 31: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Logical unit transitioning to another power condition'}}, 94: {0: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Drive is in power save mode for unknown reasons'}, 1: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle Condition Activated by timer'}, 2: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Standby condition activated by timer'}, 3: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle condition activated by host command'}, 4: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Standby condition activated by host command'}, 5: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle B condition activated by timer'}, 6: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle B condition activated by host command'}, 7: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle C condition activated by timer'}, 8: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle C condition activated by host command'}, 9: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Standby Y condition activated by timer'}, 10: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Standby Y conditition activated by host command'}}}, 1: {1: {0: {157: "Recovered Media Manager's anticipatory autoseek (ATS2) XFR error.", 'L1': 'Recovered Error', 'L2': 'No Index/Logical Block Signal'}}, 3: {0: {0: 'FRU code comes from the contents of the lower 8-bit of the servo fault register (address 38h). A description of this register is attached at the end of this document.', 'L1': 'Recovered Error', 'L2': 'Peripheral Device Write Fault'}}, 9: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Track Following Error'}, 1: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Servo Fault'}, 13: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Write to at least one copy of a redundant file failed'}, 14: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Redundant files have < 50% good copies'}, 248: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Calibration is needed but the QST is set without the Recal Only bit'}, 255: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Servo cal completed as part of self-test'}}, 11: {0: {6: 'Non Volatile Cache now is volatile', 48: 'Recovered Erase Error Rate Warning', 50: 'Recovered Read Error Rate Warning', 66: 'Recovered Program Error Rate Warning', 'L1': 'Recovered Error', 'L2': 'Recovered Error Rates Warnings'}, 1: {0: 'Warning \xe2\x80\x93 Specified temperature exceeded.', 'L1': 'Recovered Error', 'L2': 'Warning \xe2\x80\x93 Specified temperature exceeded'}, 2: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Warning, Enclosure Degraded'}, 3: {0: 'Warning \xe2\x80\x93 Specified temperature exceeded.', 'L1': 'Recovered Error', 'L2': 'Warning \xe2\x80\x93 Flash temperature exceeded'}, 4: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Warning - Flash Read Cache Capacity Degraded'}, 6: {0: 'Warning \xe2\x80\x93 NVC now volatile. NVC specified temperature exceeded.', 'L1': 'Recovered Error', 'L2': 'Warning - Non-Volatile Cache now volatile'}, 7: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Warning, spare sector margin exceeded. NVC_WCD disabled.'}, 38: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Warning - Power loss management warning threshold exceeded'}, 93: {0: 'Pre Warning.', 'L1': 'Recovered Error', 'L2': 'Pre-SMART Warning'}, 225: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Drive is exiting RAW mode, returning from high temperature'}, 226: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Drive is exiting RAW mode, returning from low temperature'}, 241: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Drive is entering RAW mode due to high temperature'}, 242: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Drive is entering RAW mode due to low temperature'}}, 12: {1: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Write Error Recovered with Auto-Reallocation'}, 2: {1: 'Data written with retries. Auto-reallocation failed.', 2: 'Data written with retries. Auto-reallocation failed with critical error, triggering Write Protection.', 'L1': 'Recovered Error', 'L2': 'Write Error Recovered, Auto-Reallocation failed'}}, 17: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Unrecovered Read Error'}}, 21: {1: {0: 'Mechanical Positioning Error.', 1: 'Mechanical positioning error - Recovered servo command.', 2: 'Mechanical positioning error - Recovered servo command during spinup.', 'L1': 'Recovered Error', 'L2': 'Mechanical Positioning Error'}}, 22: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Data Synchronization Mark Error'}}, 23: {1: {0: 'No specific FRU code.', 17: 'PRESCAN - Recovered data with error recovery.', 18: 'RAW - Recovered data with error recovery.', 'L1': 'Recovered Error', 'L2': 'Recovered Data Using Retries'}, 2: {0: 'No specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Recovered Data Using Positive Offset'}, 3: {0: 'No specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Recovered Data Using Negative Offset'}}, 24: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ECC, no retry attempted'}, 1: {0: 'Recovered data with ECC and retries applied.', 1: 'F2 \xe2\x80\x93 Recovered data with ECC and retries applied, but did normal ECC during erasure correction step.', 2: 'BERP \xe2\x80\x93 Recovered data with BERP Erasure Recovery (Erasure Pointer) and retries applied.', 3: 'BERP \xe2\x80\x93 Recovered data with BERP Sliding Window and retries applied.', 4: 'BERP \xe2\x80\x93 Recovered data with BERP Extended Iterations and retries applied.', 5: 'BERP \xe2\x80\x93 Recovered data with BERP LLR Scaling and retries applied.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ECC and Retries Applied'}, 2: {0: 'No specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ECC and/or Retries, Data Auto-Reallocated'}, 3: {0: 'Data recovered with ATIC and retries applied.', 1: 'Data recovered with ATIC and retries applied, and auto-reallocated.', 2: 'Data recovered with ATIC and retries applied, and re-written.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ATIC and Retries Applied'}, 4: {0: 'Data recovered with SERV and retries applied.', 1: 'Data recovered with SERV and retries applied, and auto-reallocated.', 2: 'Data recovered with SERV and retries applied, and re-written.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with SERV and Retries Applied'}, 5: {1: 'Data recovered. Auto-reallocation failed.', 2: 'Data recovered. Auto-reallocation failed with critical error, triggering Write Protection.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ECC and/or Retries, Auto-Reallocation Failed'}, 7: {0: 'No specific FRU code.', 'L1': 'Recovered Error', 'L2': 'ECC and/or retries, data re-written'}, 8: {0: 'Data Recovered with BIPS/SP', 1: 'Data Recovered with BIPS/SP, and auto-reallocated.', 2: 'Data Recovered with BIPS/SP, and re-written.', 3: 'Data Recovered with Intermediate Super Parity.', 4: 'Data Recovered with Intermediate Super Parity, and auto-reallocated.', 5: 'Data Recovered with Intermediate Super Parity, and re-written.', 'L1': 'Recovered Error', 'L2': 'Recovered Data With Intermediate Super Parity'}, 9: {0: 'Recovered the sector found to bad during IRAW scan with the IRAW process.', 'L1': 'Recovered Error', 'L2': 'Recovered the sector found to bad during IRAW scan'}}, 25: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Defect List Error'}}, 28: {0: {0: 'Defect list not found.', 1: 'Invalid Defect list format data request.', 'L1': 'Recovered Error', 'L2': 'Defect List Not Found'}}, 31: {0: {0: 'Partial defect list transfer.', 'L1': 'Recovered Error', 'L2': 'Number of defects overflows the allocated space that the Read Defect command can handle'}}, 55: {0: {0: 'Parameter Rounded.', 1: 'Limit the BytesPerSector to Maximum Sector Size.', 2: 'Limit the BytesPerSector to Minimum Sector Size.', 3: 'Rounded the odd BytesPerSector.', 4: 'Parameter rounded in the mode page check.', 5: 'Rounded the VBAR size.', 'L1': 'Recovered Error', 'L2': 'Parameter Rounded'}}, 63: {128: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Buffer Contents Have Changed'}}, 64: {1: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'DRAM Parity Error'}, 2: {128: 'Spinup error recovered with buzz retries.', 129: 'Spinup error recovered without buzz retries.', 'L1': 'Recovered Error', 'L2': 'Spinup Error recovered with retries'}}, 68: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Internal Target Failure'}}, 93: {0: {0: 'No Specific FRU code.', 1: 'Fail Max Recovered Error threshold during DST', 4: 'Reallocation.', 5: 'Reallocation AST table.', 6: 'Reallocation DDT table.', 8: 'Auto Reallocation Failure', 9: 'Impending Failure - Throughput Performance: Insufficient spare to back all NVC cache.', 10: 'NVC has failed to save Torn Write data more times than the threshold (currently 10)', 11: 'Failure Prediction Max Temperature Exceeded', 16: 'Hardware failure.', 20: 'Excessive reassigns.', 22: 'Start times failure.', 24: 'Instruction DBA error found during idle task. Fixed.', 32: 'General failure.', 39: 'SSD Early Retired Blocks Failure', 40: 'SSD Flash Life Left', 41: 'Exceeded time allocated to complete Zero Disk test (seq write)', 48: 'Recovered erase error rate (SSD-Jaeger only)', 49: 'Head failure.', 50: 'Recovered data error rate.', 55: 'Recovered TA.', 56: 'Hard TA event.', 64: 'Head flip.', 65: 'SSE (servo seek error).', 66: 'Write fault.', 67: 'Seek failure.', 68: 'Erase Error.', 69: 'Track following errors (Hit66).', 74: 'Seek performance failure.', 91: 'Spinup failure.', 96: 'Firmware Failure condition', 97: 'RVFF system failure.', 98: 'Gain adaptation failure.', 99: 'Fluid Dynamic Bearing Motor leakage detection test failed.', 100: 'Saving Media Cache Map Table (MCMT) to reserved zone failed.', 116: 'SED NOR Key store near to end of life', 117: 'Multiply threshold config.', 239: 'No control table on disk.', 'L1': 'Recovered Error', 'L2': 'Failure Prediction Threshold Exceeded'}, 16: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Failure Prediction Threshold Exceeded'}, 255: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'False Failure Prediction Threshold Exceeded'}}, 133: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': '5V threshold exceeded'}}, 140: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': '12V threshold exceeded'}}}, 2: {4: {0: {0: 'Logical Unit Not Ready, Cause Not Reportable.', 1: 'No Specific FRU code.', 2: 'Logical unit not ready, Change Definition Command in progress.', 128: 'R/W system not ready.', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Cause Not Reportable'}, 1: {0: 'No Specific FRU code.', 1: 'Logical unit not ready, excess particle sweep time required', 2: 'Wait for good power loss management status.', 'L1': 'Not Ready', 'L2': 'Logical Unit is in Process of Becoming Ready'}, 2: {0: 'No Specific FRU code.', 1: 'Supply voltage levels not within spec', 'L1': 'Not Ready', 'L2': 'Drive Not Ready \xe2\x80\x93 START UNIT Required'}, 3: {0: 'Logical Unit Not Ready, Manual Intervention Required.', 1: 'Logical unit not ready, manual intervention required, Servo doesn\xe2\x80\x99t support MDW Delta-L, Servo doesn\xe2\x80\x99t support VBAR.', 2: 'Logical unit not ready, manual intervention required \xe2\x80\x94CFW is configured for medium latency, but channel family is not capable of supporting medium latency.', 3: 'Logical unit not ready, R/W sub-system failure.', 4: 'Logical unit not ready, Drive is unmated', 5: 'Logical unit not ready, R/W sub-system init failed; Invalid Servo Firmware', 6: 'Logical unit not ready, R/W sub-system init failed; Invalid Servo Adaptives', 7: 'Logical unit not ready, Read failure on all System Data Table copies', 8: 'Logical unit not ready, Forward table read error during restore', 9: 'Logical unit not ready, Scram metadata read error during restore', 10: 'Logical unit not ready, GCU info restore failed', 11: 'Logical unit not ready, Defect table restore failed', 12: 'Logical unit not ready, Scram restore failed', 13: 'Logical unit not ready, Bxor Critical Failure', 15: 'Logical unit not ready, Media is corrupted but data successfully recovered via media scan', 16: 'Logical unit not ready, suspect list read error', 17: 'Logical unit not ready, reverse directory error during restore', 18: 'Logical unit not ready, system recovery format completed but drive lost critical system data', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Manual Intervention Required'}, 4: {0: 'Logical unit not ready, Scram restore failed', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Format in Progress'}, 7: {0: 'Logical unit not ready, Scram restore failed', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Format in Progress'}, 9: {0: 'Logical unit not ready, self-test in progress.', 1: 'Logical unit not ready, short background self-test in progress.', 2: 'Logical unit not ready, extended background self-test in progress.', 3: 'Logical unit not ready, short foreground self-test in progress.', 4: 'Logical unit not ready, extended foreground self-test in progress.', 5: 'Logical unit not ready, firmware download in progress.', 6: 'Logical unit not ready, initial volume download in progress.', 7: 'Logical unit not ready, session opened.', 8: 'No Specific FRU code', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, H2SAT measurement is Progress'}, 12: {0: 'No Specific FRU code.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, Field Adjustable Adaptive Fly Height (FAAFH) in progress'}, 13: {7: 'Logical unit not ready, Session is already Open.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, Session is already Open'}, 17: {2: 'Logical Unit Not Ready, Notify (Enable Spinup) required', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Notify (Enable Spinup) required'}, 26: {0: 'Logical Unit Not Ready, Start Stop Unit Command in Progress', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Start Stop Unit Command in Progress'}, 27: {0: 'Logical unit not ready, sanitize in progress.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, sanitize in progress.'}, 28: {0: 'No specific FRU code.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, additional power use not yet granted'}, 34: {1: 'Spindle Error (Spinup Failure)', 2: 'SMIF Traning Failed after 5 times attempt', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, power cycle required.'}, 240: {0: 'Logical unit not ready, super certify in progress.', 1: 'Counterfeit attempt detected (ETF log SN or SAP SN mismatch)', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, super certify in progress'}, 242: {0: 'Drive has been placed in special firmware due to assert storm threshold being exceeded.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, Assert Storm Threshold being exceeded.'}}, 53: {2: {1: 'Enclosure not ready, no ENCL_ACK assert.', 'L1': 'Not Ready', 'L2': 'Enclosure Services Unavailable'}}, 132: {0: {0: 'Remanufacturing State.', 'L1': 'Not Ready', 'L2': 'Remanufacturing State'}}}, 3: {3: {0: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Peripheral Device Write Fault'}}, 9: {0: {0: 'Track following error.', 254: 'Head flip during power cycle.', 255: 'Track following error.', 'L1': 'Medium Error', 'L2': 'Track Following Error'}, 4: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Head Select Fault'}}, 10: {1: {0: 'No Specific FRU code.', 1: 'Failed to write super certify log file from media backend', 'L1': 'Medium Error', 'L2': 'Failed to write super certify log file'}, 2: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Failed to read super certify log file'}}, 12: {0: {0: 'Peripheral device write fault.', 1: 'Write error during single sector recovery.', 2: 'Write error during gc relocation', 3: 'Write is revirtualized because of a channel error - SSD', 4: 'Read during preamp unsafe fault.', 5: 'Flash Media Request aborted due to Graceful Channel Reset', 7: 'Save SMART error log failed', 8: 'Write error from media backend', 9: 'SSD Uncorrectable Write Error from Media backend', 10: 'SSD Erase Error.', 11: 'SSD PSM Runt Buffer Page Mismatch Error', 17: 'Unrecovered read error on READ step of PRESCAN.', 18: 'Unrecovered read error on READ step of WRITE converted to WRITE VERIFY during RAW operation.', 22: 'Unrecovered read error on READ step of Read-modify-write', 128: 'BVD update error.', 129: 'BVD Correctable IOEDC error.', 'L1': 'Medium Error', 'L2': 'Write Error'}, 2: {0: 'Unrecovered write error - Auto reallocation failed.', 1: 'Reallocate Block - Write alternate block failed, no servo defects.', 2: 'Reallocate Block - Alternate block compare test failed.', 3: 'Reallocate Block - Alternate block sync mark error.', 4: 'Reallocate Block - Maximum allowed alternate selection exhausted.', 5: 'Reallocate Block - Resource is not available for a repetitive reallocation.', 6: 'Reallocate Block Failed', 7: 'Reallocate Block Failed - Write Protect', 8: 'Write error, autoreallocation failed from media backend', 'L1': 'Medium Error', 'L2': 'Write Error \xe2\x80\x93 Auto Reallocation Failed'}, 3: {0: 'Write Error \xe2\x80\x93 Recommend Reassignment', 'L1': 'Medium Error', 'L2': 'Write Error \xe2\x80\x93 Recommend Reassignment'}, 4: {0: 'WORM Error - Invalid Overlapping Address Range.', 1: 'WORM Error - Written WORM Area Infringement.', 2: 'WORM Error - No further writes allowed on WORM drive', 3: 'WORM Error - SIM Registry Read Failed', 4: 'WORM Error - SIM Registry Write Failed', 5: 'WORM Error - Illegal write request after Lock', 'L1': 'Illigal Request', 'L2': 'Write Error - WORM'}, 128: {3: 'Disc trace write (to clear it) failed 02.', 5: 'Disc trace write failed.', 6: 'Save UDS DRAM trace frames to disc failed.', 8: 'Write Long disc transfer failed.', 'L1': 'Medium Error', 'L2': 'Write Error \xe2\x80\x93 Unified Debug System'}, 255: {1: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Write Error \xe2\x80\x93 Too many error recovery revs'}}, 17: {0: {0: 'Unrecovered Read Error.', 1: 'Unrecovered Read Error, too many recovery revs.', 2: 'Unrecovered read error, could not read UDS save-on-update trace', 3: 'Unrecovered read error, could not read UDS finished frame index file', 4: 'Unrecovered read error, could not read SMART to include it in UDS', 5: 'Unrecovered read error, UDS read of a finished frame file failed', 6: 'Read SMART error log failed', 7: 'Unrecovered read BBM on partial reallocation', 8: 'Unrecovered read error on media backend', 9: 'SSD Unrecovered Read Error due to ECC Failure', 10: 'SSD Unrecovered Read Error due to Corrupt Bit', 11: 'Unrecovered read flagged error, created with flagged write uncorrectable command', 12: 'Unrecovered read error due to flash channel reset', 128: 'Read during preamp unsafe fault.', 129: 'EDAC HW uncorrectable error.', 130: 'EDAC overrun error.', 131: 'LBA corrupted with Write Long COR_DIS mode.', 132: 'LBA was in Media cache, hardened upon unrec. read error during cleaning', 133: 'EDAC HW uncorrectable error, Super parity or ISP valid and parity recovery attempted.', 134: 'EDAC HW uncorrectable error, Super parity and ISP Invalid.', 160: 'Read preamp unsafe fault with short/open fault set', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error'}, 4: {0: 'Unrecovered Read Error \xe2\x80\x93 Auto Reallocation Failed', 128: 'Write alternate block failed, no servo defects.', 129: 'Alternate block compare test failed.', 130: 'Alternate block sync mark error.', 131: 'Maximum allowed alternate selection exhausted.', 132: 'Resource is not available for a repetitive reallocation.', 133: 'SERV HW EDAC failure.', 134: 'SERV SID failure.', 135: 'Number of reallocation pending Super Block exceeded limit.', 136: 'Reallocation pending sector encountered during Super Block read.', 137: 'Reallocation pending sector encountered during Super Block write.', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error \xe2\x80\x93 Auto Reallocation Failed'}, 20: {0: 'Unrecovered read error- read pseudo-unrecovered from a WRITE LONG', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error \xe2\x80\x93 LBA marked bad by application'}, 255: {1: 'Unrecovered read error- timelimit exceeded.', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error \xe2\x80\x93 Too many error recovery revs'}}, 20: {1: {0: 'Record Not Found.', 128: 'Search exhaust error or congen mode page directory not found', 129: 'Reallocation LBA is restricted from write access or congen compressed XML not found', 130: 'Reallocation LBA is restricted from read access.', 131: 'Read from or Write to log page data on reserved zone failed.', 'L1': 'Medium Error', 'L2': 'Record Not Found'}}, 21: {1: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Mechanical Positioning Error'}, 3: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Unrecovered write errors due to grown servo flaws'}}, 22: {0: {0: 'Data synchronization mark error.', 128: 'Data sync timeout error.', 129: 'Formatter FIFO parity error 01.', 130: 'Formatter FIFO parity error 02.', 131: 'Super Sector - Data sync timeout error', 132: 'Disc Xfr - Data sync timeout error on sector splits', 'L1': 'Medium Error', 'L2': 'Data Synchronization Mark Error'}, 1: {0: 'Data missed sync mark error. FRU code is bits mask indicating which fragment(s) have missed sync error. Bit n represents fragment n.', 'L1': 'Medium Error', 'L2': 'Data Synchronization Mark Error'}}, 49: {0: {0: 'Medium Format Corrupted.', 1: 'Corruption result of a Mode Select command.', 2: 'Corruption result of a sparing changed condition.', 3: 'Corruption the result of a failed LBA pattern write in Format command.', 4: 'Corruption result of failed user table recovery.', 5: 'Corruption of NVC global header', 6: 'Medium format corrupted from media backend', 7: 'Medium Format Corrupt due to flash identify failure', 8: 'Medium Format Corrupt as a result of failed NVC write or invalid NVC meta data', 9: 'Medium Format Corrupt due to NVC WCD Meta data corruption', 10: 'Media Format Corrupt due to Write failure during MC WCD data restore to disc', 11: 'Medium Format Corrupt because NVC did not burn flash', 12: 'Medium Format Corrupt because Pseudo Error Masks lost after power loss', 13: 'Medium Format Corrupt because unexpected Media Cache Segment Sequence Number', 14: 'Medium Format Corrupt\xc2\xa0due to system reset without saving NVC data', 15: 'Medium Format Corrupt due to firmware reset (jump to 0) without saving NVC data', 16: 'Medium Format Corrupt due to incomplete burn but no actual power loss', 18: 'Medium Format Corrupt because watchdog timer reset', 19: 'Medium Format Corrupted On Assert (intentionally)', 20: 'Medium Format Corrupt due to IP timeout during SCRAM', 21: 'Medium Format Corrupt due to Write Parameter Error', 22: 'Medium Format Corrupt due to GCU Metadata Error', 24: 'Medium Format Corrupt due to System Metadata restore failure', 32: 'Format Corrupt due to Download changes.', 34: 'Scram user NVC restore failed', 'L1': 'Medium Error', 'L2': 'Medium Format Corrupted'}, 1: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Corruption in R/W format request.'}, 3: {0: 'Sanitize Command Failed', 1: 'Sanitize Command Failed due to file access error', 'L1': 'Medium Error', 'L2': 'Sanitize Command Failed'}, 145: {13: 'Corrupt WWN in drive information file.', 'L1': 'Medium Error', 'L2': 'Corrupt WWN in drive information file'}}, 50: {1: {0: 'Defect list update failure.', 128: 'Failed to save defect files.', 129: 'Failed to save defect files post format 01.', 130: 'Failed to save defect files post format 02.', 131: 'Failed to save defect files post format 03.', 'L1': 'Medium Error', 'L2': 'Defect List Update Error'}, 3: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Defect list longer than allocated memory.'}}, 51: {0: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Flash not ready for access.'}}, 68: {0: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Internal Target Failure'}}, 93: {0: {1: 'Max Unrecovered Read Error', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error'}}}, 4: {1: {0: {0: 'No index or sector pulses found.', 128: 'Spin up - Media Manager error encountered.', 129: 'Data field timeout error.', 130: "Media Manager's TDT FIFO Counter error.", 131: "Media Manager's Servo Counter error.", 132: "Media Manager's Latency error.", 133: "Media Manager's Index error.", 134: "Media Manager's Servo error.", 135: 'Media Manager errors could not be cleared successfully.', 136: 'Clearing of MM errors due to a servo error failed.', 137: 'SWCE/SGate overlap error.', 138: 'Servo gate timeout error 01.', 139: 'Servo gate timeout error 02.', 140: 'Servo gate timeout error 03.', 141: 'Servo gate timeout error 04.', 142: 'Servo gate timeout error 05.', 143: 'Super Sector - Handshake error.', 144: 'Super Sector - Servo gate timeout error 01.', 145: 'Super Sector - Servo gate timeout error 02.', 146: 'Super Sector - Servo gate timeout error 03.', 147: 'Super Sector - Servo gate timeout error 04.', 148: 'Super Sector - Servo gate timeout error 05.', 149: 'Servo gate timeout error during generation of Aseek Req.', 150: 'BVD check timeout error.', 151: 'NRZ sequencer completion timeout error.', 152: 'Sequencer timeout on Media Manager event..', 153: 'NRZ xfr error on Media Manager event.', 154: 'Disc sequencer handshake error.', 155: 'Medium Latency channel synchronization handshake error.', 156: 'Fast dPES missed servo sample error.', 157: "Media Manager's anticipatory autoseek (ATS2) XFR error.", 158: 'When a reassigned sector is encountered, wait for the NRZ to finish the previous sector', 159: 'Fast IO Data Collection out of sync with sequencer', 160: 'Channel not ready rev count exhausted. Apply to LDPC LLI channels', 161: "Media Manager's anticipatory autoseek (ATS2) Servo error.", 162: 'Media Manager\xe2\x80\x99s anticipatory autoseek (ATS2) Disc Pause Condition', 163: 'BERP infinite loop condition', 164: 'Brownout fault detected during write transfer.', 165: 'Sequencer completion timeout error at reassigned sector.', 166: 'Sequencer S-gate timeout error during start of sector read.', 167: 'Sequencer S-gate timeout error during skipping of a new sector.', 'L1': 'Hardware Error', 'L2': 'No Index/Logical Block Signal'}}, 3: {0: {2: 'Gated Channel Fault', 3: 'Write Preamp Unsafe Fault', 4: 'Write Servo Unsafe Fault', 5: 'Read/write channel fault.', 6: 'SFF fault.', 7: 'Write servo field fault.', 8: 'Write Servo unsafe fault.', 9: 'SSD: Peripheral device write fault (flush cache failed)', 16: 'Write Servo sector fault.', 32: 'Read/Write channel fault.', 64: 'Servo fault.', 128: 'Detect of new servo flaws failed.', 129: 'PSG environment fault.', 130: 'Shock event occurred.', 131: 'Unexpected Extended WGATE fault.', 132: 'Channel detected fault during write.', 133: 'Disc locked clock fault detected.', 134: 'Skip Write Detect Dvgas fault', 135: 'Skip Write Detect Rvgas fault', 136: 'Skip Write Detect Fvgas fault', 137: 'Skip Write Detect Dvgas+Rvgas+Fvgas sum threshold exceeded - last SWD fault Dvgas', 138: 'Skip Write Detect Dvgas+Rvgas+Fvgas sum threshold exceeded - last SWD fault Rvgas', 139: 'Skip Write Detect Dvgas+Rvgas+Fvgas sum threshold exceeded - last SWD fault Fvgas', 140: 'Drive free-fall event occurred', 141: 'Large Shock event occured', 144: 'NRZ Write Parity fault.', 145: 'Marvell 8830 TBG Unlock fault.', 146: 'Marvell 8830 WClk Loss fault.', 147: 'EBMS Fault Detect(EFD) Contact fault during write.', 148: 'EBMS Fault Detect(EFD) Contact fault during read.', 149: 'EBMS Fault Detect(EFD) SWOT fault.', 150: 'Marvell SRC SFG Unlock fault.', 255: "LSI 6 channel preamp attempting to write without heat, condition detected by servo and passed as servo fault ( i.e. Preamp error condition indicated by servo fault condition ). This should be recovered by a 'seek away ' performed as part of recovery step", 'L1': 'Hardware Error', 'L2': 'Peripheral Device Write Fault'}}, 9: {0: {0: 'Servo track following error.', 64: 'Servo fault, Normally 04/0900/80 would be changed to 04/0900/40 by the firmware.', 128: 'Servo fault, Normally 04/0900/80 would be changed to 04/0900/40 by the firmware.', 129: 'Servo unsafe fault during write.', 130: 'EDAC block address error.', 131: 'Missing MDW information reported by servo detection.', 132: 'Servo command timed out.', 133: 'Seek command timed out.', 134: 'Seek exceeded recovery time limit.', 135: 'Service drive free fall condition timed out.', 136: 'The altitude has exceeded the limit', 137: 'Seek command timed out on alternate sector', 138: 'Super Block marked dirty.', 139: 'Verify of Super Block data failed.', 140: 'Servo fatal error indicated', 141: 'Super Parity long word Cross Check error', 142: 'Super Parity low word Cross Check error', 143: 'Super Parity high word Cross Check error', 144: 'Super Parity data miscompare', 145: 'Invalid Anticipatry Track Seek request.', 146: 'Enhance Super parity regeneration failure.', 147: 'Super parity regeneration failure.', 'L1': 'Hardware Error', 'L2': 'Track Following Error'}, 1: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Servo Fault'}, 4: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Head Select Fault'}, 255: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Servo cal failed as part of self-test'}}, 21: {1: {0: 'Mechanical Positioning Error.', 128: 'Servo error encountered during drive spin-up.', 129: 'Servo error encountered during drive spin-down.', 130: 'Spindle failed error.', 131: 'Unrecovered seek error encountered.', 132: 'Servo command failed.', 133: 'Servo heater timing failed.', 134: 'Servo Free-Fall Protection command failed.', 135: 'Servo Disc Slip Full TMFF recalibration failed.', 136: 'Servo Disc Slip Head Switch Timing recalibration failed.', 137: 'Servo Disc Slip Head Switch Track recalibration failed.', 138: 'Servo read heat fast I/O command failed.', 139: 'Spin-up attempt during G2P merge process failed.', 140: 'Spin-down attempt during PList processing failed.', 141: 'Spin-up attempt during PList processing failed.', 'L1': 'Hardware Error', 'L2': 'Mechanical Positioning Error'}}, 22: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Data Synchronization Mark Error'}}, 25: {0: {0: 'Defect list error.', 1: 'Save user table error.', 2: 'SIM file transfer error.', 3: 'Persistent Reserve Save to disc fail.', 4: 'Defect list error media backend', 128: 'Format - Recover of saved Grown DST file failed.', 129: 'Recovery of saved Non-Resident DST failed.', 130: 'Clear R/W Slip List - Save of R/W Operating Parmaters file failed.', 131: 'Restore Alt List File From media - Failed restoration from media file.', 132: 'Save of Servo Disc Slip Parms to media failed.', 133: 'Read of Servo Disc Slip Parms from media failed 1.', 134: 'Read of Servo Disc Slip Parms from media failed 2.', 135: 'Servo Disc Slip file - invalid format revision.', 136: 'GList to PList - Recover of saved Grown DST file failed.', 137: 'Clear Non-resident Grown DST - Save to media failed.', 'L1': 'Hardware Error', 'L2': 'Defect List Error'}}, 28: {0: {0: 'Defect list not found.', 1: 'Defect list processing error.', 2: 'Read Manufacturing Info File failure.', 3: 'Read Manufacturing Info File failure.', 4: 'Defect list not found from media backend', 50: 'Read Manufacturing Info File failure.', 52: 'Read Manufacturing Info File failure.', 129: 'Failure to read Primary Defects file for reporting.', 130: 'Invalid entry count in Plist file.', 131: 'Invalid byte extent value in Plist entry.', 132: 'Process Defect Lists - Sort error due to invalid offset.', 133: 'Process Defect Lists - Sort error due to invalid head.', 134: 'Process Defect Lists - Sort error due to invalid cylinder.', 135: 'Process Defect Lists - Unable to recover the Primary Defect files.', 136: 'Failed to seek to defect files for reassign.', 137: 'Failed to seek to defect files for undo-reassign.', 138: 'Failure to write defects report lists file to media.', 139: 'Read of defects report file from media failed.', 140: 'An invalid defects report file is encountered 01.', 141: 'An invalid defects report file is encountered 02', 142: 'Restore of R/W User Operating Parameters file failed.', 143: 'Invalid Primary Servo Flaws data encountered.', 144: 'Failed to save defect files due to miscompare error.', 146: 'PList overflow error while merging PSFT and PList for reporting.', 147: 'Maximum certify passes of a zone exceeded.', 148: 'Maximum write passes of a zone exceeded.', 149: 'Primary Servo Flaws data retrieval - Unable to read file on disc.', 150: 'Primary Servo Flaws data retrieval - Invalid entry count in file.', 151: 'Defective Sectors List data retrieval - Unable to read file on disc.', 152: 'Defective Sectors List data retrieval - Invalid file header data.', 153: 'PList data retrieval - Invalid entry count in Plist file.', 154: 'PList data retrieval - Unable to read Plist file on disc.', 155: 'System Format - invalid entry count.', 156: 'Primary TA data retrieval - Unable to read file on disc.', 157: 'Primary TA data retrieval - Invalid count.', 158: 'Primary TA data retrieval - Invalid sort.', 159: "Process Defect Lists - Defect doesn't exist in audit space.", 160: 'Retrieve Defects Report List - Not All Entries Available', 161: 'Format - Invalid LBA range in PVT before update of dirty blocks.', 162: 'Format - Invalid Parity Validity Table after clean of dirty blocks.', 163: 'Format - Clean of dirty blocks failed.', 164: 'Format - Save of Parity Validity Table to media failed.', 'L1': 'Hardware Error', 'L2': 'Defect List Not Found'}}, 38: {48: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Writing to the Flash Failed'}, 49: {0: 'Failed to program PIC code with new firmware', 'L1': 'Hardware Error', 'L2': 'Writing to the PIC Failed'}}, 41: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Flashing LED occurred.'}}, 50: {0: {8: 'No defect spare location available', 9: 'No defect spare location available for reassign block.', 128: 'Processing of pending reallocation failed.', 129: 'Failed to insert defect to DST.', 130: 'Failed to insert Plist defect to DST.', 131: 'Grown DST file full 01.', 132: 'Grown DST file full 02.', 133: 'Resident DST file full.', 134: 'Failed to insert defective sectors associated w/grown servo flaw.', 135: 'Failure to invalidate Defects Report disc files.', 136: 'Format System Partition \xe2\x80\x93 Failed to insert defective system sectors associated w/ grown servo flaw.', 137: 'Format System Partition \xe2\x80\x93 Failed to insert defective system sectors.', 138: 'Format System Partition \xe2\x80\x93 System Defects file full.', 139: 'Process Defect Lists \xe2\x80\x93 Failed to insert a client specified defect in the defect file.', 140: 'ASFT \xe2\x80\x93 Max # of servo flaws per track exceeded (path #1).', 141: 'ASFT \xe2\x80\x93 Max # of servo flaws per track exceeded (path #2).', 142: 'ASFT full (path #1).', 143: 'ASFT full (path #2).', 144: 'Addition to Reassign Pending List failed.', 145: 'Resource is not available for a new reallocation.', 146: 'No alternates available (path #1).', 147: 'Failed to insert defective sectors associated w/grown servo flaw.', 148: 'Failed to deallocate compromised defects.', 149: 'Format System Partition \xe2\x80\x93 Failed to deallocate compromised.', 150: 'Insertion of DDT entry failed.', 151: 'Compressed DDT file full.', 152: 'Format \xe2\x80\x93 Failed to insert defective sectors associated w/primary servo flaw.', 153: 'Defective Tracks List \xe2\x80\x93 Failed to insert grown defective sectors associated with defective track.', 154: 'Defective Tracks List \xe2\x80\x93 Failed to insert primary defective sectors associated with defective track.', 155: 'Defective Tracks List \xe2\x80\x93 Failed to add new entry to list.', 156: 'Reallocate Block \xe2\x80\x93 Resource is not available for a partial reallocation.', 157: 'Resource is not available for a partial reallocation.', 158: 'Not enough non-defective sectors to allocate for BIPS parity Sectors.', 159: 'BIPS defect table operation failed \xe2\x80\x93 case 1.', 160: 'BIPS defect table operation failed \xe2\x80\x93 case 2.', 161: 'Format \xe2\x80\x93 Failed to add defective track to DST.', 162: 'Format \xe2\x80\x93 Failed to allocate spare sectors.', 163: 'Pad and Fill Defects \xe2\x80\x93 Max number of skipped tracks exceeded.', 164: 'Format \xe2\x80\x93 Failed to allocate spare sectors.', 165: 'Format \xe2\x80\x93 More LBAs than PBAs.', 166: 'Format \xe2\x80\x93 Failed to allocate spare sectors.', 167: 'Format \xe2\x80\x93 Failed to allocate spare sectors.', 168: 'Format \xe2\x80\x93 Failed to allocate spare sectors.', 169: 'Format \xe2\x80\x93 Excessive number of slips not supported by hardware.', 170: 'Invalid HW parity data for parity sector reallocation.', 171: 'Format \xe2\x80\x93 Could not allocate required guard/pad around media cache area on disc', 172: 'Format \xe2\x80\x93 Will not be able to save ISP/MC metadata after the format (a mis-configuration problematic to try to address before this point)', 173: 'Format - Failed to allocate spare sectors.', 174: 'Format - Failed to allocate spare sectors.', 175: 'Format - Failed to allocate spare sectors.', 176: 'Format - Failed to allocate spare sectors.', 177: 'Format - Failed to update parity sectors slip list.', 178: 'Format - Invalid track sector range encountered.', 179: 'Format \xe2\x80\x93 Could not allocate required guard/pad around intermediate super parity area on disc', 180: 'Format \xe2\x80\x93 Media Cache starting DDT entry not found.', 193: 'Format - Attempt to add pad between user area and start/end of Distributed Media Cache failed', 'L1': 'Hardware Error', 'L2': 'DMC area padding failed'}, 1: {0: 'Defect list update failure.', 23: 'Saving of the ASFT during idle time failed', 129: 'Plist file overflow error.', 130: 'PSFT file overflow error.', 131: 'Unable to write defect files.', 132: 'Unable to update operating parms file.', 133: 'Plist file overflow error.', 134: 'Plist file overflow error.', 'L1': 'Hardware Error', 'L2': 'Defect List Update Error'}}, 53: {0: {8: 'LIP occurred during discovery.', 9: 'LIP occurred during an 8067 command.', 10: 'LIP occurred during an 8045 read.', 11: 'LIP occurred during an 8067 read.', 12: 'LIP occurred during an 8067 write.', 13: 'Parallel ESI deasserted during discovery.', 14: 'Parallel ESI deasserted during an 8067 command.', 15: 'Parallel ESI deasserted during an 8045 read.', 16: 'Parallel ESI deasserted during an 8067 read.', 17: 'Parallel ESI deasserted during an 8067 write.', 'L1': 'Hardware Error', 'L2': 'Unspecified Enclosure Services Failure'}, 3: {2: 'Enclosure found but not ready \xe2\x80\x93 No Encl_Ack Negate.', 4: 'Read Data Transfer Enclosure Timeout.', 5: 'Write Data Transfer Enclosure Timeout.', 13: 'Read Data Transfer Bad Checksum.', 14: 'Write Data Transfer Enclosure Timeout.', 15: 'Read Data Transfer Enclosure Timeout.', 'L1': 'Hardware Error', 'L2': 'Enclosure Transfer Failure'}, 4: {4: 'Read Data Transfer Refused by Enclosure.', 5: 'Write Data Transfer Refused by Enclosure.', 'L1': 'Hardware Error', 'L2': 'Enclosure Transfer Refused'}}, 62: {3: {0: 'No Specific FRU code.', 1: 'Logical Unit Failed Self Test \xe2\x80\x93 TestWriteRead', 2: 'Logical Unit Failed Self Test \xe2\x80\x93 TestRandomRead', 3: 'Logical Unit Failed Self Test \xe2\x80\x93 ScanOuterDiameter', 4: 'Logical Unit Failed Self Test \xe2\x80\x93 ScanInnerDiameter', 5: 'Logical Unit Failed Self Test from media backend', 'L1': 'Hardware Error', 'L2': 'Logical Unit Failed Self Test'}, 4: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'H2SAT Foreground Test Failure'}}, 64: {0: {128: 'Format \xe2\x80\x93 Exceeded max number of track rewrites during certify retries.', 'L1': 'Hardware Error', 'L2': 'Miscellaneous Error'}, 1: {0: 'Buffer memory parity error.', 1: 'Buffer FIFO parity error.', 2: 'IOEDC error.', 3: 'VBM parity error.', 'L1': 'Hardware Error', 'L2': 'DRAM Parity Error'}, 145: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Cryptographic Hardware Power-On Self-Test Failure'}, 146: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Cryptographic Algorithm Power-On Self-Test Failure'}, 147: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Conditional Random Number Generation Self-Test Failure'}, 148: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Hidden Root Key Error During Command Execution'}, 149: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Entropy Power-On Self-Test Failure'}, 150: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Conditional Entropy Self-Test Failure'}, 151: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Boot Firmware SHA-256 Power-On Self-Test Failure'}, 152: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Boot Firmware RSA Power-On Self-Test Failure'}}, 66: {0: {0: 'Power-on or self-test failure.', 1: 'DST failure.', 2: 'SIM Spinning-up state transition failure.', 3: 'SIM Drive Initialization state transition failure.', 4: 'Read/write thread initialization failed.', 20: 'DIC exceeds the time limits consecutively over count limit', 'L1': 'Hardware Error', 'L2': 'Power-On or Self-Test Failure'}, 10: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Port A failed loopback test'}, 11: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Port B failed loopback test'}}, 68: {0: {0: 'Internal target failure', 1: 'Self test buffer test failure.', 2: 'Write read test failure.', 3: 'Data sync timeout error.', 4: 'SSD Test access error (DST)', 5: 'Backend (SSD) DRAM failure (DST)', 6: 'Backend (SSD) SRAM failure (DST)', 7: 'Internal target failure META data test', 8: 'Internal target failure System Area Check', 9: 'wait for ACP to get ready for reset took too long', 10: 'wait for AMP to get ready for reset took too long', 11: 'FDBMotor Leakage detected.', 12: 'wait for I2C to be available took too long', 128: 'Write during preamp unsafe fault.', 129: 'Read write channel fault.', 130: 'Small form factor fault.', 131: 'Write during servo field fault.', 132: 'Media Manager\xe2\x80\x99s TPBA FIFO Counter error.', 133: 'Media Manager\xe2\x80\x99s TPBA FIFO Under-run error.', 134: 'Media Manager\xe2\x80\x99s DDT FIFO Counter error.', 135: 'Media Manager\xe2\x80\x99s DDT FIFO Under-run error.', 136: 'Media Manager\xe2\x80\x99s Parity error.', 137: 'Media Manager\xe2\x80\x99s TDT FIFO Under-run error.', 138: 'Media Manager\xe2\x80\x99s Skip Mask Under-run error.', 139: 'Get Temperature request resulted in invalid temperature.', 140: 'Detected unsupported H/W in a Set Voltage Margin request.', 141: 'Unused Error Code.', 142: 'SMART Initial buffer not ready', 143: 'Formatter EDAC correction memory parity error.', 144: 'NX \xe2\x80\x93 RLL1 error.', 145: 'Disc Buffer parity error.', 146: 'Sequencer encountered an EXE/SGATE overlap error.', 147: 'Formatter Correction Buffer underrun error.', 148: 'Formatter Correction Buffer overrun error.', 149: 'Formatted detected NRZ interface protocol error.', 150: 'Media Manager\xe2\x80\x99s MX Overrun error.', 151: 'Media Manager\xe2\x80\x99s NX Overrun error.', 152: 'Media Manager\xe2\x80\x99s TDT Request error.', 153: 'Media Manager\xe2\x80\x99s SST Overrun error.', 154: 'Servo PZT calibration failed.', 155: 'Fast I/O- Servo Data Update Timeout error.', 156: 'Fast I/O- First wedge Servo data Timeout error.', 157: 'Fast I/O- Max samples per collection exceeded.', 158: 'CR memory EDC error', 159: 'SP block detected an EDC error', 160: 'Preamp heater open/short fault.', 161: 'RW Channel fault- Memory buffer overflow or underflow or parity error during write.', 162: 'RW Channel fault- Memory buffer overflow or read data path FIFO underflow in legacy NRZ mode.', 163: 'RW Channel fault- Preamp fault during R/W.', 164: 'RW Channel fault- SGATE, RGATE, or WGATE overlap.', 165: 'RW Channel fault- Mismatch in split sector controls or sector size controls.', 166: 'RW Channel fault- Write clock or NRZ clock is not running.', 167: 'RW Channel fault- SGATE, RGATE, or WGATE asserted during calibration.', 168: 'RW Channel fault- RWBI changed during a read or write event.', 169: 'RW Channel fault- Mode overlap flag.', 170: 'RW Channel fault- Inappropriate WPLO or RPLO behavior.', 171: 'RW Channel fault- Write aborted.', 172: 'RW Channel fault- Bit count late.', 173: 'RW Channel fault- Servo overlap error', 174: 'RW Channel fault- Last data fault', 176: 'PES threshold in field is too far from the same value calculated in the factory.', 177: 'Not enough Harmonic Ratio samples were gathered', 178: 'Sigma of Harmonic Ratio samples after all discards exceeded the limit', 179: 'No EBMS contact fault, even at lowest threshold value', 180: 'EBMS fault still detected at highest threshold value', 181: 'Formatter detected BFI error.', 182: 'Formatter FIFO Interface error.', 183: 'Media sequencer- Disc sequencer Data transfer size mismatch.', 184: 'Correction buffer active while disc sequencer timeout error (this error code is used to fix the hardware skip mask read transfer issue).', 185: 'Seagate Iterative Decoder \xe2\x80\x93 Channel RSM fault', 186: 'Seagate Iterative Decoder \xe2\x80\x93 Channel WSM fault', 187: 'Seagate Iterative Decoder \xe2\x80\x93 Channel BCI fault', 188: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SRC fault', 189: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SAB fault', 190: 'Seagate Iterative Decoder \xe2\x80\x93 Channel read gate overflow error', 192: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SMB Bus B parity error', 193: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SMB buffer error on write', 194: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SOB buffer error on write', 195: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SOB parity error', 196: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SAB buffer error', 197: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SAB bend error', 198: 'Seagate Iterative Decoder \xe2\x80\x93 Channel LLI buffer sync error', 199: 'Seagate Iterative Decoder \xe2\x80\x93 Channel LLI data length error on write', 200: 'Seagate Iterative Decoder \xe2\x80\x93 Channel LLI framing error on write', 201: 'Seagate Iterative Decoder \xe2\x80\x93 Channel LLI write status error', 202: 'Seagate Iterative Decoder \xe2\x80\x93 Channel LLI pipe state error (Bonanza), - Channel RSM Gross Error (Caribou- Luxor)', 203: 'Seagate Iterative Decoder \xe2\x80\x93 Channel decoder microcode error', 204: 'Seagate Iterative Decoder \xe2\x80\x93 Channel encoder microcode error', 205: 'Seagate Iterative Decoder \xe2\x80\x93 Channel NRZ parity error', 206: 'Seagate Iterative Decoder \xe2\x80\x93 Symbols per Sector mismatch error', 207: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SMB Bus A parity error', 208: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SMB NRZ parity error', 209: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SOB Buffer error on read', 210: 'Seagate Iterative Decoder \xe2\x80\x93 Channel SMB Buffer error on read', 211: 'Seagate Iterative Decoder \xe2\x80\x93 Channel LLI data length error on read', 212: 'Seagate Iterative Decoder \xe2\x80\x93 Channel LLI framing error on read', 217: 'Seagate Iterative Decoder \xe2\x80\x93 Channel WSM Gross error', 218: 'Seagate Iterative Decoder \xe2\x80\x93 Channel ERF buffer error', 224: 'Preamp low voltage error', 225: 'Preamp low write data frequency at common point error', 226: 'Preamp write head open error', 227: 'Preamp write head shorted to ground error', 228: 'Preamp TA sensor open error', 229: 'Preamp temperature error', 230: 'Preamp write without heat error', 231: 'Preamp writer off in write error', 232: 'Preamp writer output buffer error', 233: 'Preamp low write data frequency at the head error', 234: 'Preamp FOS error', 235: 'Preamp TA or contact detect error', 236: 'Preamp SWOT error', 237: 'Preamp serial port communication error', 238: 'HSC magnitude overflow error', 240: 'RW Channel \xe2\x80\x93 RDATA valid overlap fault', 241: 'RW Channel \xe2\x80\x93 RD valid gap fault', 244: 'RW Channel \xe2\x80\x93 W Parity not ready', 247: 'RW Channel \xe2\x80\x93 Wrong sector length', 248: 'RW Channel \xe2\x80\x93 Encoder overflow error', 249: 'RW Channel \xe2\x80\x93 Encoder early termination fault', 250: 'RW Channel \xe2\x80\x93 Iteration parameter error', 251: 'RW Channel \xe2\x80\x93 MXP write fault', 252: 'RW Channel \xe2\x80\x93 Symbol count error', 253: 'RW Channel \xe2\x80\x93 RD Incomplete error', 254: 'RW Channel \xe2\x80\x93 RD Data VGA error', 255: 'RW Channel \xe2\x80\x93 RD Data TA error', 'L1': 'Hardware Error', 'L2': 'Internal Target Failure'}, 1: {2: 'RW Channel \xe2\x80\x93 RFM Wrong sector length', 3: 'RW Channel \xe2\x80\x93 RFM FIFO underflow', 4: 'RW Channel \xe2\x80\x93 RFM FIFO Overflow', 5: 'RW Channel \xe2\x80\x93 Vector flow errors', 32: 'HSC - An error occurred when attempting to open the file to be used for Harmonic Sensor Circuitry data collection.', 33: 'HSC - The Standard Deviation of the VGAS data collected by the Harmonic Sensor Circuitry was zero.', 34: 'HSC - The Standard Deviation of the 3rd Harmonic data collected by the Harmonic Sensor Circuitry was zero.', 35: 'HSC - The Servo Loop Code returned at the completion of Harmonic Sensor Circuitry data collection was not 0.', 36: 'HSC - An invalid write pattern was specified Harmonic Sensor Circuitry data collection.', 37: 'AR Sensor - The AR Sensor DAC to Target calculation encountered the need to take the square root of a negative value.', 38: 'AR Sensor - The AR Sensor encountered an error when attempting to open the Background Task file.', 39: 'AR Sensor - The AR Sensor encountered an error when attempting to open the General Purpose Task file.', 40: "AR Sensor - The size of the Background Task file is inadequate to satisfy the AR Sensor's requirements.", 41: "AR Sensor - The size of the General Purpose Task file is inadequate to satisfy the AR Sensor's requirements.", 42: 'AR Sensor - The FAFH Parameter File revision is incompatible with the AR Sensor.', 43: 'AR Sensor - The AR Sensor Descriptor in the FAFH Parameter File is invalid.', 44: 'AR Sensor - The Iterative Call Index specified when invoking the AR Sensor exceeds the maximum supported value.', 45: 'AR Sensor - The AR Sensor encountered an error when performing a Track Position request.', 46: 'AR Sensor - The Servo Data Sample Count specified when invoking the AR Sensor exceeds the maximum supported value.', 47: 'AR Sensor - The AR Sensor encountered an error when attempting to set the read channel frequency.', 48: 'AR Sensor - The 3rd Harmonic value measured by the AR Sensor was 0.', 96: 'RW Channel - LOSSLOCKR fault', 97: 'RW Channel - BLICNT fault', 98: 'RW Channel - LLI ABORT fault', 99: 'RW Channel - WG FILLR fault', 100: 'RW Channel - WG FILLW fault', 101: 'RW Channel - CHAN fault', 102: 'RW Channel - FRAG NUM fault', 103: 'RW Channel - WTG fault', 104: 'RW Channel - CTG fault', 105: 'RW Channel -\xc2\xa0NZRCLR fault', 106: 'RW Channel - \xc2\xa0Read synthesizer prechange fail fault', 107: 'RW Channel -\xc2\xa0Servo synthesizer prechange fail fault', 108: 'RW Channel - Servo Error detected prior to halting Calibration Processor', 109: 'RW Channel -\xc2\xa0Unable to Halt Calibration Processor', 110: 'RW Channel -\xc2\xa0ADC Calibrations already disabled', 111: 'RW Channel -\xc2\xa0Calibration Processor Registers have already been saved', 112: 'RW Channel -\xc2\xa0Address where Calibration Processor Registers are to be saved is invalid', 113: 'RW Channel -\xc2\xa0Array for saving Calibration Processor Register values is too small', 114: 'RW Channel -\xc2\xa0Calibration Processor Register values to be used for AR are invalid', 115: 'RW Channel -\xc2\xa0Synchronous abort complete fault', 116: 'RW Channel -\xc2\xa0Preamble length fault', 117: 'RW Channel -\xc2\xa0TA or media defect event fault', 118: 'RW Channel -\xc2\xa0DPLL frequency overflow/underflow fault', 119: 'RW Channel -\xc2\xa0Zero gain threshold exceeded fault', 120: 'RW Channel -\xc2\xa0DPLL frequency deviation fault', 121: 'RW Channel -\xc2\xa0Extended EVGA overflow/underflow fault', 128: 'RW Channel -\xc2\xa0\xc2\xa0Read VGA gain fault', 129: 'RW Channel -\xc2\xa0Acquire Peak Amplitude flag fault', 130: 'RW Channel -\xc2\xa0Massive drop-out fault', 131: 'RW Channel -\xc2\xa0Low Quality sync mark fault', 132: 'RW Channel -\xc2\xa0NPLD load error fault', 133: 'RW Channel -\xc2\xa0Write path memory fault status bit fault', 134: 'RW Channel -\xc2\xa0WRPO disabled fault', 135: 'RW Channel -\xc2\xa0Preamble quality monitor fault', 136: 'RW Channel -\xc2\xa0Reset detection flag fault', 137: 'RW Channel -\xc2\xa0Packet write fault', 138: 'RW Channel -\xc2\xa0Gate command queue overflow fault', 139: 'RW Channel -\xc2\xa0Gate command queue underflow fault', 140: 'RW Channel -\xc2\xa0Ending write splice fault status fault', 141: 'RW Channel -\xc2\xa0Write-through gap servo collision fault', 142: 'RW Channel - Read Gate Fault', 143: 'Error reading the Preamp Gain register during an HSC operation', 144: 'Error writing the Preamp Gain register during an HSC operation', 145: 'RW Channel - Calibration Processor not halted', 146: 'RW Channel - Background Calibrations already stopped', 147: 'RW Channel -\xc2\xa0Background Calibrations not stopped', 148: 'RW Channel - Calibration Processor halt error', 149: 'RW Channel - Save AR Calibration Processor registers error', 150: 'RW Channel - Load AR Calibration Processor registers error', 151: 'RW Channel - Restore AR Calibration Processor registers error', 152: 'RW Channel - Write Markov Modulation Code Failure Type 0', 153: 'RW Channel - Write Markov Modulation Code Failure Type 1', 154: 'RW Channel - Write Markov Modulation Code Failure Type 2', 155: 'RW Formatter - NRZ Interface Parity Randomizer Nyquist Error', 156: 'RW Formatter - NRZ Interface Parity Randomizer Run Error', 157: 'RW Formatter - DLT Fifo Underrun Error', 158: 'RW Formatter - WDT Fifo Underrun Error', 159: 'RW Formatter - M2 MI error', 'L1': 'Hardware Error', 'L2': 'Internal Target Failure'}, 224: {0: 'Failure writing firmware to disc.', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 225: {0: 'Failed to reinitialize the NVC Host', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 226: {0: 'Failed to erase the NVC Header', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 227: {0: 'Failed to write NVC client data to disc', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 228: {0: 'Failed to initialize the NVC header', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 229: {0: 'Failed to initialize the NVC Host', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 230: {0: 'Failed to write MCMT during initialization', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 231: {0: 'Failed to write the ISPT during format', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 232: {0: 'Failed to clear logs during format', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 242: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Data Integrity Check Failed on verify'}, 246: {0: 'FRU 00 \xe2\x80\x93 09 stand for error on head 0 \xe2\x80\x93 9.', 16: 'Power-on self-test failed.', 'L1': 'Hardware Error', 'L2': 'Data Integrity Check Failed during write'}, 251: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Failed to enter Raid Partial Copy Diagnostic mode'}, 255: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'XOR CDB check error'}}, 93: {0: {1: 'Number of Command Timeouts Exceeded', 'L1': 'Hardware Error', 'L2': 'Command Timeout'}}, 101: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Voltage fault.'}}, 128: {134: {0: 'Host IOEDC Error on Read detected by host', 1: 'IOEDC error on read.', 2: 'IOECC error on read.', 3: 'FDE IOECC error on read.', 4: 'SSD IOEDC error on read', 5: 'SSD Erased Page Error', 6: 'FDE Sector-bypass datatype mismatch', 'L1': 'Hardware Error', 'L2': 'IOEDC - DataType Error on Read'}, 135: {0: 'Host IOEDC Error on Write, this is unused', 1: 'FDE IOEDC Error on Write detected by the FDE logic', 2: 'SSD IOEDC Error on Write', 128: 'Disk IOEDC parity error on write detected by formatter', 129: 'IOECC and IOEDC errors occurred, which is highly probable (when IOECC is enabled) for multiple or single bit corruption.', 130: 'IOECC parity error on write.', 131: 'IOECC error (correctable).', 'L1': 'Hardware Error', 'L2': 'IOEDC Error on Write'}, 136: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host Parity Check Failed'}, 137: {128: 'IOEDC parity error on read detected by formatter', 'L1': 'Hardware Error', 'L2': 'IOEDC error on read detected by formatter'}, 138: {'L1': 'Hardware Error', 'L2': 'Host FIFO Parity Error detected by Common Buffer', 'fru': ['xx is 00, 01, 02 or 03 ( channel number )']}, 139: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host FIFO Parity Error detected by frame buffer logic'}, 140: {0: 'No Specific FRU code.', 1: 'For Read Host Data Frame Buffer Parity Error.', 2: 'For Write Host Data Frame Buffer Parity Error.', 3: 'SSD Buffer Memory Parity Error', 4: 'Host Data Frame Buffer Uncorrectable ECC Error.', 'L1': 'Hardware Error', 'L2': 'Host Data Frame Buffer Uncorrectable ECC Error'}, 141: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host Data Frame Buffer Protection Error'}, 142: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host FIFO overrun or underrun rrror'}, 143: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host FIFO unknown error'}}, 129: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'LA Check Error, LCM bit = 0'}}, 130: {0: {0: 'No Specific FRU code.', 1: 'Insufficient return buffer.', 'L1': 'Hardware Error', 'L2': 'Diag internal client detected insufficient buffer'}}, 131: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'DOS Scalars are out of range'}}}, 5: {26: {0: {0: 'Parameter list length error.', 1: 'Format Parameter list length error.', 2: 'Mode Select command Parameter list length error.', 3: 'Extended Mode select command Parameter list length error.', 4: 'Mode Select operation Parameter list length error.', 5: 'Check mode page Parameter list length error.', 6: 'Reassign Block command Parameter list length error.', 7: 'Parameter list length error.', 8: 'Parameter data list length error.', 'L1': 'Illegal Request', 'L2': 'Parameter List Length Error'}}, 32: {0: {0: 'Invalid Command Operation Code', 1: 'Primary Invalid Command Operation Code', 2: 'Unique command not unlocked code.', 7: 'Glist to Plist Unlock command not unlocked code.', 8: 'Invalid Command Operation Code for SSD Backend', 'L1': 'Illegal Request', 'L2': 'Invalid Command Operation Code'}, 243: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Invalid linked command operation code'}}, 33: {0: {1: 'Logical block address out of range', 2: 'Invalid LBA in synchronize cache', 3: 'Invalid LBA in read capacity', 4: 'Invalid LB in write same', 5: 'Invalid LBA in read/write long', 6: 'Invalid LBA in seek', 7: 'Logical block address out of range from media backend', 'L1': 'Illegal Request', 'L2': 'Logical Block Address Out of Range'}}, 36: {0: {0: 'Invalid field in CDB', 1: 'Bad CDB error.', 2: 'Invalid field in CDB. (Format command)', 3: 'Invalid field in CDB. (Setup R/W Long command)', 4: 'Invalid field in CDB. (Log sense page)', 5: 'Invalid field in CDB. (Log sense parameter)', 6: 'Invalid field in CDB. (Log select command)', 7: 'Invalid Field in CDB \xe2\x80\x93 UDS trigger command.', 8: 'Invalid Field in CDB \xe2\x80\x93 buffer overflow check.', 9: 'Invalid power transition request', 10: 'Invalid power transition mode bit', 11: 'Invalid power transition PCM', 12: 'Invalid page and subpage combination (Log sense)', 13: 'Invalid field in CDB. (Report Zones command- SMR)', 22: 'Invalid field in CDB. (Skip Mask)', 48: 'Invalid Combination of CDB.', 49: 'Change Definition Illegal Parameter.', 50: 'Change Definition Illegal Password', 51: 'Change Definition Unlock Command Error', 52: 'Change Definition Not Supported', 53: 'Change Definition Mismatch in port mode (Single/Dual port: SAS only)', 54: 'Invalid field in CDB from media backend', 'L1': 'Illegal Request', 'L2': 'Invalid Field in CDB'}, 1: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Illegal Queue Type for CDB (Low priority commands must be SIMPLE queue)'}, 46: {0: 'The Byte Offset exceeds the length of the SMART frame data.', 'L1': 'Illegal Request', 'L2': 'Invalid field in CDB for E6 SMART Dump command, unique to NetApp.'}, 240: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Invalid LBA in linked command'}, 242: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Invalid linked command operation code'}, 243: {128: 'G->P operation requested while drive was formatted w/o PLIST.', 129: 'Servo Flaw already exists in ASFT or PSFT.', 130: 'G->P operation encountered a G-list entry that overlaps an existing P-list entry.', 131: 'G->P operation encountered a Growth Servo Flaw which overlapped an existing Primary defect Servo Flaw.', 132: 'Defects report lists not available for retrieval.', 133: "Servo Flaw doesn't exist in ASFT.", 'L1': 'Illegal Request', 'L2': 'Illegal Servo Flaw operation request'}}, 37: {0: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Logical unit not supported'}}, 38: {0: {0: 'Invalid Field in Parameter List.', 1: 'Invalid Field in Format Parameter List.', 2: 'Field in RetrieveThirdPartyID Parameter List.', 3: 'Invalid Field in ModeSelectOperation Parameter List.', 4: 'Invalid Field in CheckModePage Parameter List.', 5: 'Invalid Field in ReassignBlocksCmd Parameter List.', 6: 'Invalid Field in PersistentReserveOutCmd Parameter List.', 7: 'Invalid Field Invalid in LogSelectCmd Parameter List.', 8: 'Invalid LogSelectCmd Parameter List length.', 9: 'Invalid Field in WriteBufferCmd Parameter List.', 10: 'Invalid Field in SendDiagnosticCmd Parameter List.', 11: 'Invalid Field in BuildTranslateAddrPage Parameter List.', 12: 'An E0 packet to UDS was too small', 13: 'Invalid FCN ID in E0 packet to UDS.', 14: 'Invalid Field in Retrieved Trace Information packet to UDS (E0).', 15: 'Cannot clear UDS trace, because UDS was not allowed to return it all', 16: 'Cannot enable/disable UDS trace, drive not ready', 17: 'Unsupported block size.', 18: 'UDS trigger command.', 19: 'Invalid remanufacturing command.', 20: 'Invalid command while SMART reporting disabled.', 21: 'Invalid field in parameter list from media backend', 128: 'Invalid input cylinder.', 129: 'Invalid input head.', 130: 'Invalid input sector.', 131: 'Input user LBA is invalid 01.', 132: 'Input user LBA is invalid 02.', 133: 'Input user LBA is invalid 03.', 134: 'Input system LBA is invalid.', 135: 'Client defect list size is invalid.', 136: 'Sort error due to invalid offset.', 137: 'Sort error due to invalid head.', 138: 'Sort error due to invalid cylinder.', 139: 'Failed to validate a client specified byte extent info.', 140: 'Failed to validate a client specified sector extent info.', 141: 'Invalid track in client defect list entry.', 142: 'Input track is invalid.', 143: 'First LBA of input track is invalid.', 144: 'Invalid servo data block length.', 145: 'Invalid servo program block length.', 146: 'Address translation \xe2\x80\x93 input PBA is invalid', 147: 'Address translation \xe2\x80\x93 input symbol extent is invalid.', 148: 'Super sector transfer \xe2\x80\x93 invalid wedge transfer size.', 149: 'Track ZLR Transfer \xe2\x80\x93 Invalid partition.', 150: 'Track ZLR Transfer \xe2\x80\x93 Invalid LBA range on target track.', 151: 'Track ZLR Transfer \xe2\x80\x93 Reallocated LBA found on target track.', 152: 'Input user LBA is invalid 04.', 153: 'Input user LBA is invalid 05.', 154: 'Convert Sector to RLL Data \xe2\x80\x93 Unsupported sector size.', 155: 'Add Servo Flaw \xe2\x80\x93 Invalid input specified.', 156: 'Invalid condition for enabling servo free fall protection (drive not spinning).', 157: 'Invalid condition for disabling servo free fall protection (drive not spinning).', 158: 'Invalid condition for disabling servo free fall protection (protection already disabled).', 159: 'Invalid condition for disabling servo free fall protection (protection already de-activated).', 160: 'Invalid condition for disabling servo free fall protection (free-fall condition is currently active).', 161: 'Invalid drive free-fall control option specified.', 162: 'Check free-fall event failed \xe2\x80\x93 protection not functional.', 163: 'Invalid sector range specified.', 164: 'Invalid count value specified for update.', 165: 'Invalid channel memory select specified for access.', 166: 'Invalid buffer index specified for read channel memory access.', 167: 'Invalid start address specified for read channel memory access.', 168: 'Invalid transfer length specified for read channel memory access.', 169: 'Invalid sector extent info', 175: 'Band translation - invalid input type specified', 176: 'Band translation - invalid output type specified', 177: 'Band translation - invalid input Band ID', 178: 'Band translation - invalid input Band ID', 179: 'Band translation - invalid input track position', 180: 'Band translation - invalid input RAP zone, head', 185: 'Invalid band number.', 186: 'Invalid band lba offset.', 187: 'Invalid user lba.', 189: 'Invalid parameter', 193: 'DITS Buffer ( Dummy Cache ) too small', 'L1': 'Illegal Request', 'L2': 'DITS Buffer ( Dummy Cache ) too small'}, 1: {0: 'No Specific FRU code.', 1: 'Log pages unavailable for inclusion in UDS dump.', 'L1': 'Illegal Request', 'L2': 'Parameter Not Supported'}, 2: {0: 'No Specific FRU code.', 1: 'DIAG: Invalid input cylinder.', 2: 'DIAG: Invalid input head.', 3: 'DIAG: Invalid input sector.', 4: 'DIAG: Invalid Wedge.', 5: 'DIAG: Invalid LBA.', 6: 'DIAG: Invalid file selection.', 7: 'DIAG: Invalid file length.', 8: 'DIAG: Invalid start offset.', 9: 'DIAG: Write Overflow.', 10: 'DIAG: Backplane Bypass selection invalid.', 11: 'DIAG: Invalid serial number.', 12: 'DIAG: Incomplete DFB.', 13: 'DIAG: Unsupported DFB revision.', 14: 'DIAG: Invalid Temperature selection.', 15: 'DIAG: Invalid Transfer Length.', 16: 'DIAG: Unsupported memory area.', 17: 'DIAG: Invalid command.', 18: 'DIAG: File copy invalid.', 19: 'DIAG: Insufficient data sent from initiator.', 20: 'DIAG: Unsupported DIAG command.', 21: 'DIAG: Flash segment invalid.', 22: 'DIAG: Req flash segment copy invalid.', 23: 'DIAG: Flash access failed.', 24: 'DIAG: Flash segment length invalid.', 25: 'DIAG: File checksum invalid.', 26: 'DIAG: Host DFB Length Invalid', 27: 'DIAG: Unaligned transfer.', 28: 'DIAG: Unsupported operation.', 29: 'DIAG: Backend invalid.', 30: 'DIAG: Flash plane invalid.', 31: 'DIAG: ISP node not found.', 32: 'DIAG: Invalid parameter.', 33: 'DIAG: Format corrupt condition required.', 34: 'DIAG: Clear all scan unit counts not allowed', 35: 'DIAG:\xc2\xa0 Unsupported Flash Device', 36: 'DIAG:\xc2\xa0 Raw flash blocks in MList', 37: 'DIAG:\xc2\xa0 Raw flash format table mismatch', 38: 'DIAG:\xc2\xa0 Raw flash Unused format slot', 39: 'DIAG:\xc2\xa0 Raw flash cannot decide format table', 40: 'DIAG:\xc2\xa0 Raw flash invalid error code', 41: 'DIAG:\xc2\xa0 Write protect condition', 42: 'DIAG: Requested for a Pre-erased block in Nor flash', 57: 'Parameter Data out of range.', 58: 'Parameter Data over write.', 64: 'DIAG: Diag write failed', 65: 'DIAG: DIAG_DST_IS_IN_PROGRESS', 66: 'DIAG: DIAG_TEST_RANGE_IN_SET', 68: 'DIAG: DIAG_BMS_IS_ENABLED', 72: 'DIAG: DIAG_INVALID_START_LBA', 73: 'DIAG: DIAG_INVALID_END_LBA', 'L1': 'Illegal Request', 'L2': 'Parameter Value Invalid'}, 3: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Threshold Parameter not supported'}, 4: {0: 'Invalid Release of Active Persistent Reserve', 1: 'Invalid release of persistent reservation. (reservation type mismatch)', 'L1': 'Illegal Request', 'L2': 'Invalid Release of Active Persistent Reserve'}, 5: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Fail to read valid log dump data'}, 152: {0: 'No Specific FRU code.', 1: 'FDE checksum error.', 2: 'Failed Flash Verification on Newly Downloaded Component.', 'L1': 'Illegal Request', 'L2': 'Invalid Field Parameter \xe2\x80\x93 Check Sum'}, 153: {1: 'Segment type mismatch.', 2: 'Customer ID mismatch.', 3: 'Drive type mismatch.', 4: 'HW configuration mismatch.', 5: 'Compatibility configuration mismatch.', 6: 'Servo firmware product family mismatch.', 7: 'QNR download is not supported.', 8: 'CAP product family mismatch.', 9: 'RAP product family mismatch.', 10: 'Download segment length too large.', 11: 'Download length invalid.', 12: 'CTPM missing.', 13: 'CFW and CAP mismatch 01.', 14: 'CFW and CAP mismatch 02.', 15: 'CFW and CAP mismatch 03.', 16: 'CFW and RAP mismatch 01.', 17: 'CFW and RAP mismatch 02.', 18: 'CFW and RAP mismatch 03.', 19: 'CFW and SAP mismatch 01.', 20: 'CFW and SAP mismatch 02.', 21: 'CFW and SAP mismatch 03.', 22: 'CFW and SFW mismatch 01.', 23: 'SAP Product family mistmatch', 24: 'CFW and SFW mismatch 03.', 25: 'Download buffer offset invalid.', 26: 'Address translation invalid.', 27: 'CFW and IAP mismatch.', 28: 'Quick Download in Progress.', 29: 'Invalid unlock tags \xe2\x80\x93 customer does not match', 30: 'Invalid unlock tags \xe2\x80\x93 customer does not match', 31: 'Invalid unlock tags \xe2\x80\x93 checksum failure', 32: 'Firmware not backward compatible.', 33: 'Download overlay incompatible.', 34: 'Overlay download failure 1.', 35: 'Overlay download failure 2.', 36: 'Overlay download failure 3.', 37: 'General download failure', 38: 'Trying to download bridge code for wrong product family', 39: 'Factory flags mismatch.', 40: 'Illegal combination \xe2\x80\x93 Missing BootFW module.', 41: 'Illegal combination \xe2\x80\x93 Missing Customer FW Feature Flags module.', 42: 'Illegal combination \xe2\x80\x93 Programmable Inquiry download not supported.', 43: 'Illegal combination \xe2\x80\x93 Missing CustomerFW module.', 44: 'Download Congen header failure', 46: 'Download Congen XML failure', 47: 'Download Congen version failure', 48: 'Download Congen XML SIM MakeLocalFile failure', 49: 'Download Congen mode data failure \xe2\x80\x93 could not save mode header.', 50: 'Download Congen mode data failure \xe2\x80\x93 mode page had sent length/spec length miscompare.', 51: 'Download Congen mode data failure \xe2\x80\x93 mode page had invalid contents.', 52: 'Download Congen mode data failure \xe2\x80\x93 mode page tried to change contents not allowed by change mask.', 53: 'Download Congen mode data failure \xe2\x80\x93 save all mode pages could not write to media.', 54: 'Download Congen mode data failure \xe2\x80\x93 save partial mode pages could not write to media.', 55: 'Download Congen mode data failure \xe2\x80\x93 mode change callbacks did not complete successfully.', 56: 'Package Enforcement Failure \xe2\x80\x93 Package didn\xe2\x80\x99t contain valid SFW component', 57: 'Invalid link rate', 59: 'Unlock code not allowed to be DL if dets is locked', 60: 'DETS is locked, code download is blocked', 61: 'Code download is blocked if DETS is locked', 62: 'Download is blocked due to system area incompatibility with new code', 63: 'Invalid SD&D customer family for customer cross-market-segment downloads.', 64: 'Unlock File failed to be written to the flash', 65: 'Unlock File secuirty headers do not match', 80: 'Download header length invalid', 81: 'Download length is not a multiple of the buffer word size', 82: 'Download length and segment length mismatch', 161: 'Unknown firmware tag type.', 162: 'Attempt to R/W locked LBA band', 163: 'SSD download combined code has mismatched frontend and backend', 164: 'SSD download backend code \xe2\x80\x93 recovery required', 165: 'SSD download a firmware which is mismatched with resident firmware', 166: 'SSD download standalone (non-bundle) firmware in boot mode.', 'L1': 'Illegal Request', 'L2': 'Invalid Field Parameter \xe2\x80\x93 Firmware Tag'}, 154: {0: 'Invalid Security Field Parameter in secure download packaging.', 1: 'Attempt to perform secure download with drive not spun up', 2: 'Attempt to download signed non-fde firmware in use state or fail state', 3: 'Attempt to download signed sed code onto a non-sed drive.', 4: 'Download inner signature key index does not match the outer signature key index.', 16: 'Inner firmware signature validation failure.', 18: 'Power Governor feature requires that both CFW and SFW support same number of seek profiles. This sense code indicates an attempt to download a code with mismatching seek profiles count', 20: 'DOS Table Size has been reduced', 'L1': 'Illegal Request', 'L2': 'Invalid Field Parameter \xe2\x80\x93 Firmware Tag'}, 155: {0: 'SSD download code mismatched with running frontend code FRU indicate running frontend compatibility number 00-FF', 'L1': 'Illegal Request', 'L2': 'SSD Compatibility Error'}}, 44: {0: {0: 'Command Sequence Error.', 1: 'Command Sequence Error. (R/W Buffer command)', 2: 'Command Sequence Error. (Retrieve SDBPP Packet)', 3: 'Command Sequence Error. (Diag Locked)', 4: 'Command Sequence Error. (Concurrent UDS service attempt)', 5: 'Command Sequence Error. (UDS retrieval: back-to-back E0)', 6: 'Command Sequence Error. (Unexpected retrieve trace packet received during non-handshaked UDS retrieval)', 7: 'Command Sequence Error. (Back-to-back E1 commands, illegal during handshaked UDS retrieval and illegal during non-handshaked when it\xe2\x80\x99s time to retrieve the last trace packet)', 8: 'Command Sequence Error. (Send Diag cmd. Before Write Buffer cmd)', 9: 'Command Sequence Error. (Channel BCI logging in online mode)', 10: 'Stop command execution disallowed when Raid Rebuild mode is active/enabled', 11: 'Foreground H2SAT operation currently not allowed.', 'L1': 'Illegal Request', 'L2': 'Command Sequence Error'}, 5: {0: 'No Specific FRU code.', 1: 'Power Management frozen (OBSOLETE)', 'L1': 'Illegal Request', 'L2': 'Illegal Power Condition Request'}, 128: {0: 'Command Sequence Error. (Illegal to request MC flush while cleaning is disabled.)', 'L1': 'Illegal Request', 'L2': 'Command Sequence Error'}}, 50: {1: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Defect List Update Error'}}, 53: {1: {3: 'No enclosure found.', 7: 'Unsupported 8045 Enclosure Request.', 'L1': 'Illegal Request', 'L2': 'Unsupported Enclosure Function'}}, 71: {6: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'SAS - Physical Test in Progress'}}, 73: {0: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Illegal request, Invalid message error'}}, 85: {4: {1: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'PRKT table is full'}}}, 6: {11: {1: {0: 'No Specific FRU code.', 1: 'Temperature is lower than the low temperature threshold.', 'L1': 'Unit Attention', 'L2': 'Warning \xe2\x80\x93 Specified temperature exceeded'}}, 41: {0: {0: 'Power on, reset, or bus device reset occurred. (SPI flash LED)', 1: 'CDB trigger dump and reset occurred..', 2: 'LIP trigger dump and reset occurreD', 3: 'Performing some type of logout, either N_PORT, FCP, or both.', 202: 'The Flight Recorder area in FLASH contains data', 'L1': 'Unit Attention', 'L2': 'Power-On, Reset, or Bus Device Reset Occurred'}, 1: {0: 'Power-on reset occurred. (SPI)', 1: 'Power-on reset occurred. (SSI)', 6: 'Power-on reset occurred when rezero with 0xEF in byte 1', 7: 'Power-on reset occurred due to HW controller watchdog expiration', 8: 'Power-on reset initiated by firmware (e.g. to remove lockup conditions)', 9: 'Power-on reset occurred when servo watchdog timer expires', 'L1': 'Unit Attention', 'L2': 'Power-On Reset Occurred'}, 2: {0: 'SCSI bus reset occurred.', 2: 'Warm reset occurred.', 'L1': 'Unit Attention', 'L2': 'SCSI Bus Reset Occurred'}, 3: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Bus Device Reset'}, 4: {0: 'No Specific FRU code.', 1: 'Internal Reset due to Assert Storm Threshold being exceeded.', 3: 'NVC WCD has marked corrupted sector dirty.', 'L1': 'Unit Attention', 'L2': 'Internal Reset'}, 5: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Transceiver Mode Changed to SE'}, 6: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Transceiver Mode Changed to LVD'}, 7: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'IT Nexus Loss'}, 8: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Write Log Dump data to disk fail'}, 9: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Write Log Dump Entry information fail'}, 10: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Reserved disc space is full'}, 11: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'SDBP test service contained an error, examine status packet(s) for details'}, 12: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'SDBP incoming buffer overflow (incoming packet too big)'}, 205: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Flashing LED occurred. (Cold reset)'}, 206: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Flashing LED occurred. (Warm reset)'}}, 42: {1: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Mode Parameters Changed'}, 2: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Log Parameters Changed'}, 3: {0: 'Reservations preempted.', 1: 'Reservations preempted. (Clear service action)', 'L1': 'Unit Attention', 'L2': 'Reservations Preempted'}, 4: {0: 'Reservations released.', 1: 'Reservations released. (Registration with reg key = 0)', 2: 'Reservations Released. (Preempt service action)', 3: 'Reservations Released. (Release service action)', 'L1': 'Unit Attention', 'L2': 'Reservations Released'}, 5: {0: 'Registrations preempted.', 1: 'Registrations preempted 01.', 'L1': 'Unit Attention', 'L2': 'Registrations Preempted'}, 9: {0: 'Capacity data changed', 'L1': 'Unit Attention', 'L2': 'Capacity data changed'}}, 47: {0: {0: 'No Specific FRU code.', 1: 'Target is already unlocked by another initiator', 'L1': 'Unit Attention', 'L2': 'Tagged Commands Cleared By another Initiator'}, 1: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Commands cleared due to power-off warning'}}, 63: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Target operating conditions have changed'}, 1: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Download Occurred'}, 2: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Changed Operating Definition'}, 3: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Inquiry Data Has Changed'}, 5: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Device Identifier Changed'}, 145: {1: 'WWN in ETFLOG does not match CAPM WWN.', 'L1': 'Unit Attention', 'L2': 'WWN in ETFLOG does not match CAPM WWN'}}, 91: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Log Exception'}}, 92: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'RPL Status Change'}}, 93: {0: {0: 'No Specific FRU code.', 4: 'Reallocation.', 5: 'Reallocation AST table.', 6: 'Reallocation DDT table.', 16: 'Hardware failure.', 20: 'Excessive reassigns.', 32: 'General failure.', 40: 'Flash Life Left Failure', 49: 'Head failure.', 50: 'Recovered data error rate.', 51: 'Recovered data error rate during early life (Xiotech SSD Only)', 55: 'Recovered TA.', 56: 'Hard TA event.', 64: 'Head flip.', 65: 'SSE (servo seek error).', 66: 'Write fault.', 67: 'Seek failure.', 69: 'Track following errors (Hit66).', 74: 'Seek performance failure.', 91: 'Spinup failure.', 107: 'Flash spinup failure', 117: 'Multiply threshold config.', 239: 'No control table on disk.(OBSOLETE)', 'L1': 'Unit Attention', 'L2': 'Failure Prediction Threshold Exceeded'}, 255: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'False Failure Prediction Threshold Exceeded'}}, 128: {144: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Host Read Redundancy Check Error'}, 145: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Host Write Redundancy Check Error'}, 146: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Disc Read Redundancy Check Error'}, 147: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Disc Write Redundancy Check Error'}, 148: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Xor Redundancy Check Error'}}, 180: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Unreported Deferred Errors have been logged on log page 34h'}}, 255: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'FC SEL_ID changed'}}}, 7: {3: {0: {0: 'No Specific FRU code.', 'L1': 'Data Protect', 'L2': 'Peripheral device write fault'}}, 32: {2: {0: 'No Access Rights. Attempt to access security locked LBA.', 1: 'No Access Rights. Sanitize command pre-condition not met.', 'L1': 'Data Protect', 'L2': 'Access Denied'}}, 39: {0: {0: 'Write protected.', 1: 'Write protected during ready check.', 2: 'Write protected media backend', 3: 'Write protected due to PIC failure', 4: 'Write protected due to reserved blocks exceeded threshold', 5: 'Write protected due to defects per die exceeded threshold', 6: 'Write protected due to retired blocks exceeded threshold', 7: 'Write protected due to write failure (Nand error)', 8: 'Write Protected due to Auto status command write failure', 9: 'Write protected due to spare blocks exceeded threshold', 10: 'Write protected due to GCU for system data is not available', 11: 'Write protected due to defect table read error during restore', 12: 'Zone is read only ( SMR Only)', 13: 'Write protected due to defect block list overflow', 'L1': 'Data Protect', 'L2': 'Write Protected'}}}, 9: {8: {0: {0: 'No Specific FRU code.', 'L1': 'Firmware Error Constants', 'L2': 'Logical Unit Communication Failure'}}, 128: {0: {0: 'General firmware error.', 1: 'Firmware error during CDB check.', 2: 'Error recovering log tables.', 3: 'UDS has no packet to send back, but it neglected to make this clear to the SDBP layer (E1 command).', 4: 'Processed unsupported UDS session (UDS should have rejected).', 5: 'Packet retrieval allowed by upper levels of UDS when no UDS trace retrieval was active.', 6: 'UDS trace retrieval is trying to include an empty finished frame trace file.', 7: 'Unexpected content split across UDS retrieved trace packets.', 8: 'UDS trace retrieval sense data without FAIL status or vice versa.', 9: 'UDS trace retrieval: Internal confusion over amount of trace.', 10: 'UDS \xe2\x80\x93 retrieval failure.', 11: '\xe2\x80\x9cDummy Cache\xe2\x80\x9d file request failed', 12: 'Failed to fix up system parameters during head depop.', 13: 'Write same command call to XOR data copy failed.', 14: 'Write same command call to create cache segment from buffer failed to allocate sufficient space.', 15: 'Request to read servo data timed out.', 16: 'Loading Disc Firmware failed', 17: 'Disc Firmware Signature Verification Failed.', 18: 'WriteAndOrVerifyCmd Xor copy failure', 19: 'WriteAndOrVerifyCmd request cache segment allocation failed', 20: 'Write Buffer detected an Unknown Error.', 21: 'Write Buffer detected a Corrupted Data Error.', 22: 'Write Buffer detected a Permanent Error.', 23: 'Write Buffer detected a Service Delivery/Target Failure Error.', 24: 'Phy Log Retrieval Failed', 25: 'failed to issue command to auxiliary processor', 26: "failed memory allocation on auxiliary processor's heap", 27: 'Loading PIC Firmware Failed', 28: 'Loading FME Firmware Failed', 29: 'LDevFormat() failed to allocate sufficient space.', 30: 'LDevFormat() call to XorCopyData() failed', 45: 'InitSurface() failed to allocate sufficient space.', 46: 'InitSurface () call to XorCopyData() failed', 61: 'Log Page cache not allocated', 62: 'Log Page cache not allocated', 63: 'Log Page not enough cache available', 64: 'SMART Frame Index corrupted on disc and not recoverable via f/w.', 65: 'NVC Disabled by error condition', 66: 'Log data save to disc failed', 67: 'Wait for phy after reset too long', 68: 'H2SAT unexpected condition occurred', 70: 'Memory allocation failed during Reassign Blocks command', 74: 'Diag command attempted to execute missing or incompatible Overlay code', 75: 'Wait for phy after reset too long', 80: 'Flash management access failed', 128: 'Invalid prime request.', 129: 'Request cannot be processed.', 130: 'Unsupported fault.', 131: 'Track address fault.', 132: 'Servo-Disc synchronization error.', 133: 'End of transfer reached prematurely.', 134: 'Unexpected sequencer timeout error.', 135: 'Unknown error in the NRZ Transfer logic.', 136: 'Unknown EDAC error.', 137: "Unknown Media Manager's error.", 138: 'Invalid disc halt.', 139: 'Unexpected sequencer halt condition.', 140: 'Unexpected sequencer halt.', 141: 'Unknown sequencer timeout error.', 142: 'Unknown NRZ interface error.', 143: 'Disc was soft halted.', 144: 'Fault condition error.', 145: 'Correct Buffer Completion timeout error.', 146: 'Maximum write passes of a zone exceeded. (Changed to 04/1C00/93)', 147: 'Maximum certify passes of a zone exceeded. (Changed to 04/1C00/94)', 148: 'Recovered seek error encountered.', 149: 'Forced to enter error recovery before error is encountered.', 150: 'Recovered servo command error.', 151: 'Partial reallocation performed.', 152: 'Transfer was truncated.', 153: 'Transfer completed.', 154: 'Track transfer completed.', 155: 'Scan Defect - Allocated scan time exceeded.', 156: 'IOEDIOECC parity error on write', 157: 'IOECC parity error on write', 158: 'IOECC error (correctable)', 159: 'EDAC stopped for FW erasure', 160: 'Reallocate Block - Input was not marked for pending reallocation.', 161: 'Input LBA was not found in the RST.', 162: 'Input PBA was not found in the resident DST 1', 163: 'Input PBA was not found in the resident DST 2', 164: 'DST Mgr - Skootch failed 1', 165: 'DST Mgr - Skootch failed 2', 166: 'DST Mgr - Insert failed', 167: 'Correction Buffer over-run, under-run, or EDC error', 168: 'Form FIFO over/under run error', 169: 'Failed to transition to active power', 170: 'Input LBA was marked as logged', 171: 'Format - Max number of servo flaws per track exceeded in servo coast', 172: 'Format - Write servo unsafe errors when the track already has multiple flaws', 173: "Formatter's parity RAM progress is not in sync with transfer.", 174: 'Disc Xfr - Conflict of R/W request resource.', 175: 'Conflict of R/W resource during write attempt of super block data.', 176: "Formatter's parity RAM progress not in sync with alt transfer.", 177: "Formatter's parity RAM is invalid for parity sectors update.", 178: "Formatter's parity RAM is invalid for parity sectors alt-update.", 179: 'Parity secs read of expected reallocated sectors not reallocated.', 180: 'Parity sectors write of expected reallocated sectors not reallocated.', 181: 'PVT not showing all super blocks valid on successful format.', 182: 'Sector Data Regen - Restart of transfer is required.', 183: 'Sector Data Regen - Restart of transfer failed on a reallocated blk.', 184: 'Sector Data Regeneration - Restart of transfer failed.', 185: 'Format - Dirty super blk on nedia not reported in PVT.', 186: 'Super Block Read - No user sectors available.', 187: 'Full R/W reallocation code support is not available.', 188: 'Full R/W reallocation code support is not available.', 189: 'Full R/W reallocation code support is not available.', 190: 'Super Block Read - Recovered Data using SuperC Block.', 191: 'ATIC DERPR Retry - Recovered Data using DERP ATIC retry.', 192: 'Unexpected Servo Response - Retry count equals zero for a non-PZT request', 193: 'Recovered Data using Intermediate Super Parity', 194: 'Overlapping Defect Blocks', 195: 'Missing Defect Blocks', 196: 'Input LBA was not protected from torn write', 197: 'Formatter transfer did not halt properly', 198: 'Servo DC calibration failed', 199: 'Invalid band LBA range encountered during dirty super blocks update attempt', 200: 'Detect Formatter FIFO pointer synchronization loss error', 201: 'Detect Formatter FIFO pointer synchronization loss error', 202: 'Full reallocation support not available', 203: 'Invalid block for unmark DART pending reallocation', 204: 'Mark pending DART skipped', 205: 'Outercode recovery scratchpad buffer size insufficient', 206: 'Recovered data using firmware Iterative OuterCode(IOC)', 207: 'AFH Heater DAC is <= 0', 208: 'AFH Calculated Heater DAC value is >= max allocated memory for heater DAC', 209: 'AFH DAC value supplied to the DAC actuation path is > -b/2a', 210: 'ATS2 Seek Error occurred along with Track address fault error', 211: 'Buffer overflow detected in Legacy mode read.', 'L1': 'Firmware Error Constants', 'L2': 'General Firmware Error Qualifier'}, 82: {'L1': 'Firmware Error Constants', 'L2': 'General Firmware Error Qualifier', 'fru': ['Error byte returned by PMC code for various DITS APIs']}}}, 11: {0: {30: {0: 'Invoke within a TCG session', 'L1': 'Aborted Command', 'L2': 'Sanitize command aborted'}}, 8: {0: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical unit communication failure'}, 1: {0: 'Logical Unit Communication Time-Out.', 128: 'Servo command timed out.', 129: 'Seek operation timed out.', 130: 'Seek operation has exceeded the recovery time limit.', 'L1': 'Aborted Command', 'L2': 'Logical Unit Communication Time-Out'}}, 12: {16: {0: 'Write command requires initial access to a mapped out head.', 1: 'Write command attempted a seek to access a mapped out head.', 2: 'Write command encountered an alternate block mapped to a bad head.', 'L1': 'Aborted Command', 'L2': 'Command aborted due to multiple write errors'}}, 14: {1: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'SAS abort command (10.2.3)'}, 2: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'SAS abort command (9.2.6.3.3.8.1)'}}, 16: {1: {0: 'No specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical Block guard check failed'}, 2: {0: 'No specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical Block application tag check failed'}, 3: {0: 'No specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical Block reference tag check failed'}}, 17: {3: {1: 'Read command requires initial access to a mapped out head.', 2: 'Read command attempted a seek to access a mapped out head.', 3: 'Read command encountered an alternate block mapped to a bad head.', 4: 'Prefetch command for FIM has detected a failed LBA in the range', 'L1': 'Aborted Command', 'L2': 'Command aborted due to multiple read errors'}}, 63: {15: {0: 'Echo buffer overwritten.', 1: 'Read buffer echo error.', 'L1': 'Aborted Command', 'L2': 'Echo buffer overwritten'}}, 67: {0: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Message reject error'}}, 68: {0: {0: 'Timed out while waiting in queue.', 1: 'Timed out during error recovery.', 2: 'Timed out while executing command.', 'L1': 'Aborted Command', 'L2': 'Overall Command Timeout'}, 246: {0: 'FRU 00 \xe2\x80\x93 09 stand for error on head 0 \xe2\x80\x93 9.', 'L1': 'Aborted Command', 'L2': 'Data Integrity Check Failed during write'}}, 69: {0: {0: 'Select/Reselection Failure.', 1: 'Select/Reselection time out.', 'L1': 'Aborted Command', 'L2': 'Select/Reselection Failure'}}, 71: {0: {0: 'SCSI Parity Error in message phase.', 1: 'SCSI parity error in command phase.', 3: 'SCSI parity error in data phase.', 8: 'SCSI CRC error in data phase.', 'L1': 'Aborted Command', 'L2': 'SCSI Parity Error'}, 3: {1: 'SCSI CRC error in command IU.', 8: 'SCSI CRC error in data (out) IU.', 'L1': 'Aborted Command', 'L2': 'Information Unit CRC Error'}, 128: {9: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Fibre Channel Sequence Error'}}, 72: {0: {1: 'Initiator detected error message received, selection path.', 2: 'Initiator detected error message received, reselection path.', 'L1': 'Aborted Command', 'L2': 'Initiator Detected Error Message Received'}}, 73: {0: {1: 'Invalid message received, selection path.', 2: 'Invalid message received, reselection path.', 'L1': 'Aborted Command', 'L2': 'Invalid message received'}}, 75: {0: {0: 'No Specific FRU code.', 2: 'Invalid source ID.', 3: 'Invalid destination ID.', 4: 'Running Disparity error.', 5: 'Invalid CRC.', 16: 'Invalid data frame during transfer and no xfr done.', 'L1': 'Aborted Command', 'L2': 'DATA phase error'}, 1: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Invalid transfer tag'}, 2: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Too much write data'}, 3: {0: 'No Specific FRU code.', 1: 'Link reset occurred during transfer.', 5: 'Break received in the middle of a data frame', 6: 'Break received but unbalanced ACK/NAKs', 'L1': 'Aborted Command', 'L2': 'ACK NAK Timeout'}, 4: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'NAK received'}, 5: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Data offset error'}, 6: {0: 'No Specific FRU code.', 1: 'Break Response Timeout', 2: 'Done Response Timeout', 3: 'SAS Credit Timeout', 'L1': 'Aborted Command', 'L2': 'Initiator Response Timeout'}, 32: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'SAS Credit Timeout'}, 255: {0: 'Drive type mismatch \xe2\x80\x93 download firmware', 'L1': 'Aborted Command', 'L2': 'Check FW Tags'}}, 78: {0: {0: 'No Specific FRU code.', 1: 'SAS - Overlapped Commands Attempted.', 2: 'UDS trigger on non-queued cmd with outstanding NCQ cmds', 'L1': 'Aborted Command', 'L2': 'Overlapped Commands Attempted'}}, 85: {4: {0: 'Cannot reassign if Media cache is not empty', 'L1': 'Aborted Command', 'L2': 'Insufficient Resources'}}, 116: {8: {5: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Invalid Field Parameter \xe2\x80\x93 Check Sum'}}, 128: {0: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical Unit Access Not Authorized.'}}, 129: {0: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'LA Check Error.'}, 1: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Unexpected Boot FW execution delay.'}, 2: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Unexpected Customer FW execution delay.'}, 3: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Unexpected FW download delay.'}}, 251: {1: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Command maps to a head marked as bad'}}}, 13: {33: {0: {0: 'No Specific FRU code.', 1: 'UDS Trace retrieval complete.', 'L1': 'Volume Overflow Constants', 'L2': 'Logical Block Address Out of Range'}}}, 14: {29: {0: {0: 'Miscompare During Verify Operation.', 128: 'Data miscompare error.', 129: 'Data miscompare error at erasure correction.', 'L1': 'Data Miscompare', 'L2': 'Miscompare During Verify Operation'}}}}
seagate_sense_codes = {0: {0: {0: {0: 'No error.', 'L1': 'No Sense', 'L2': 'No Sense'}, 31: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Logical unit transitioning to another power condition'}}, 94: {0: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Drive is in power save mode for unknown reasons'}, 1: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle Condition Activated by timer'}, 2: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Standby condition activated by timer'}, 3: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle condition activated by host command'}, 4: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Standby condition activated by host command'}, 5: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle B condition activated by timer'}, 6: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle B condition activated by host command'}, 7: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle C condition activated by timer'}, 8: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Idle C condition activated by host command'}, 9: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Standby Y condition activated by timer'}, 10: {0: 'No Specific FRU code.', 'L1': 'No Sense', 'L2': 'Standby Y conditition activated by host command'}}}, 1: {1: {0: {157: "Recovered Media Manager's anticipatory autoseek (ATS2) XFR error.", 'L1': 'Recovered Error', 'L2': 'No Index/Logical Block Signal'}}, 3: {0: {0: 'FRU code comes from the contents of the lower 8-bit of the servo fault register (address 38h). A description of this register is attached at the end of this document.', 'L1': 'Recovered Error', 'L2': 'Peripheral Device Write Fault'}}, 9: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Track Following Error'}, 1: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Servo Fault'}, 13: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Write to at least one copy of a redundant file failed'}, 14: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Redundant files have < 50% good copies'}, 248: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Calibration is needed but the QST is set without the Recal Only bit'}, 255: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Servo cal completed as part of self-test'}}, 11: {0: {6: 'Non Volatile Cache now is volatile', 48: 'Recovered Erase Error Rate Warning', 50: 'Recovered Read Error Rate Warning', 66: 'Recovered Program Error Rate Warning', 'L1': 'Recovered Error', 'L2': 'Recovered Error Rates Warnings'}, 1: {0: 'Warning â\x80\x93 Specified temperature exceeded.', 'L1': 'Recovered Error', 'L2': 'Warning â\x80\x93 Specified temperature exceeded'}, 2: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Warning, Enclosure Degraded'}, 3: {0: 'Warning â\x80\x93 Specified temperature exceeded.', 'L1': 'Recovered Error', 'L2': 'Warning â\x80\x93 Flash temperature exceeded'}, 4: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Warning - Flash Read Cache Capacity Degraded'}, 6: {0: 'Warning â\x80\x93 NVC now volatile. NVC specified temperature exceeded.', 'L1': 'Recovered Error', 'L2': 'Warning - Non-Volatile Cache now volatile'}, 7: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Warning, spare sector margin exceeded. NVC_WCD disabled.'}, 38: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Warning - Power loss management warning threshold exceeded'}, 93: {0: 'Pre Warning.', 'L1': 'Recovered Error', 'L2': 'Pre-SMART Warning'}, 225: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Drive is exiting RAW mode, returning from high temperature'}, 226: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Drive is exiting RAW mode, returning from low temperature'}, 241: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Drive is entering RAW mode due to high temperature'}, 242: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Drive is entering RAW mode due to low temperature'}}, 12: {1: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Write Error Recovered with Auto-Reallocation'}, 2: {1: 'Data written with retries. Auto-reallocation failed.', 2: 'Data written with retries. Auto-reallocation failed with critical error, triggering Write Protection.', 'L1': 'Recovered Error', 'L2': 'Write Error Recovered, Auto-Reallocation failed'}}, 17: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Unrecovered Read Error'}}, 21: {1: {0: 'Mechanical Positioning Error.', 1: 'Mechanical positioning error - Recovered servo command.', 2: 'Mechanical positioning error - Recovered servo command during spinup.', 'L1': 'Recovered Error', 'L2': 'Mechanical Positioning Error'}}, 22: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Data Synchronization Mark Error'}}, 23: {1: {0: 'No specific FRU code.', 17: 'PRESCAN - Recovered data with error recovery.', 18: 'RAW - Recovered data with error recovery.', 'L1': 'Recovered Error', 'L2': 'Recovered Data Using Retries'}, 2: {0: 'No specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Recovered Data Using Positive Offset'}, 3: {0: 'No specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Recovered Data Using Negative Offset'}}, 24: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ECC, no retry attempted'}, 1: {0: 'Recovered data with ECC and retries applied.', 1: 'F2 â\x80\x93 Recovered data with ECC and retries applied, but did normal ECC during erasure correction step.', 2: 'BERP â\x80\x93 Recovered data with BERP Erasure Recovery (Erasure Pointer) and retries applied.', 3: 'BERP â\x80\x93 Recovered data with BERP Sliding Window and retries applied.', 4: 'BERP â\x80\x93 Recovered data with BERP Extended Iterations and retries applied.', 5: 'BERP â\x80\x93 Recovered data with BERP LLR Scaling and retries applied.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ECC and Retries Applied'}, 2: {0: 'No specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ECC and/or Retries, Data Auto-Reallocated'}, 3: {0: 'Data recovered with ATIC and retries applied.', 1: 'Data recovered with ATIC and retries applied, and auto-reallocated.', 2: 'Data recovered with ATIC and retries applied, and re-written.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ATIC and Retries Applied'}, 4: {0: 'Data recovered with SERV and retries applied.', 1: 'Data recovered with SERV and retries applied, and auto-reallocated.', 2: 'Data recovered with SERV and retries applied, and re-written.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with SERV and Retries Applied'}, 5: {1: 'Data recovered. Auto-reallocation failed.', 2: 'Data recovered. Auto-reallocation failed with critical error, triggering Write Protection.', 'L1': 'Recovered Error', 'L2': 'Recovered Data with ECC and/or Retries, Auto-Reallocation Failed'}, 7: {0: 'No specific FRU code.', 'L1': 'Recovered Error', 'L2': 'ECC and/or retries, data re-written'}, 8: {0: 'Data Recovered with BIPS/SP', 1: 'Data Recovered with BIPS/SP, and auto-reallocated.', 2: 'Data Recovered with BIPS/SP, and re-written.', 3: 'Data Recovered with Intermediate Super Parity.', 4: 'Data Recovered with Intermediate Super Parity, and auto-reallocated.', 5: 'Data Recovered with Intermediate Super Parity, and re-written.', 'L1': 'Recovered Error', 'L2': 'Recovered Data With Intermediate Super Parity'}, 9: {0: 'Recovered the sector found to bad during IRAW scan with the IRAW process.', 'L1': 'Recovered Error', 'L2': 'Recovered the sector found to bad during IRAW scan'}}, 25: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Defect List Error'}}, 28: {0: {0: 'Defect list not found.', 1: 'Invalid Defect list format data request.', 'L1': 'Recovered Error', 'L2': 'Defect List Not Found'}}, 31: {0: {0: 'Partial defect list transfer.', 'L1': 'Recovered Error', 'L2': 'Number of defects overflows the allocated space that the Read Defect command can handle'}}, 55: {0: {0: 'Parameter Rounded.', 1: 'Limit the BytesPerSector to Maximum Sector Size.', 2: 'Limit the BytesPerSector to Minimum Sector Size.', 3: 'Rounded the odd BytesPerSector.', 4: 'Parameter rounded in the mode page check.', 5: 'Rounded the VBAR size.', 'L1': 'Recovered Error', 'L2': 'Parameter Rounded'}}, 63: {128: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Buffer Contents Have Changed'}}, 64: {1: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'DRAM Parity Error'}, 2: {128: 'Spinup error recovered with buzz retries.', 129: 'Spinup error recovered without buzz retries.', 'L1': 'Recovered Error', 'L2': 'Spinup Error recovered with retries'}}, 68: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Internal Target Failure'}}, 93: {0: {0: 'No Specific FRU code.', 1: 'Fail Max Recovered Error threshold during DST', 4: 'Reallocation.', 5: 'Reallocation AST table.', 6: 'Reallocation DDT table.', 8: 'Auto Reallocation Failure', 9: 'Impending Failure - Throughput Performance: Insufficient spare to back all NVC cache.', 10: 'NVC has failed to save Torn Write data more times than the threshold (currently 10)', 11: 'Failure Prediction Max Temperature Exceeded', 16: 'Hardware failure.', 20: 'Excessive reassigns.', 22: 'Start times failure.', 24: 'Instruction DBA error found during idle task. Fixed.', 32: 'General failure.', 39: 'SSD Early Retired Blocks Failure', 40: 'SSD Flash Life Left', 41: 'Exceeded time allocated to complete Zero Disk test (seq write)', 48: 'Recovered erase error rate (SSD-Jaeger only)', 49: 'Head failure.', 50: 'Recovered data error rate.', 55: 'Recovered TA.', 56: 'Hard TA event.', 64: 'Head flip.', 65: 'SSE (servo seek error).', 66: 'Write fault.', 67: 'Seek failure.', 68: 'Erase Error.', 69: 'Track following errors (Hit66).', 74: 'Seek performance failure.', 91: 'Spinup failure.', 96: 'Firmware Failure condition', 97: 'RVFF system failure.', 98: 'Gain adaptation failure.', 99: 'Fluid Dynamic Bearing Motor leakage detection test failed.', 100: 'Saving Media Cache Map Table (MCMT) to reserved zone failed.', 116: 'SED NOR Key store near to end of life', 117: 'Multiply threshold config.', 239: 'No control table on disk.', 'L1': 'Recovered Error', 'L2': 'Failure Prediction Threshold Exceeded'}, 16: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'Failure Prediction Threshold Exceeded'}, 255: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': 'False Failure Prediction Threshold Exceeded'}}, 133: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': '5V threshold exceeded'}}, 140: {0: {0: 'No Specific FRU code.', 'L1': 'Recovered Error', 'L2': '12V threshold exceeded'}}}, 2: {4: {0: {0: 'Logical Unit Not Ready, Cause Not Reportable.', 1: 'No Specific FRU code.', 2: 'Logical unit not ready, Change Definition Command in progress.', 128: 'R/W system not ready.', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Cause Not Reportable'}, 1: {0: 'No Specific FRU code.', 1: 'Logical unit not ready, excess particle sweep time required', 2: 'Wait for good power loss management status.', 'L1': 'Not Ready', 'L2': 'Logical Unit is in Process of Becoming Ready'}, 2: {0: 'No Specific FRU code.', 1: 'Supply voltage levels not within spec', 'L1': 'Not Ready', 'L2': 'Drive Not Ready â\x80\x93 START UNIT Required'}, 3: {0: 'Logical Unit Not Ready, Manual Intervention Required.', 1: 'Logical unit not ready, manual intervention required, Servo doesnâ\x80\x99t support MDW Delta-L, Servo doesnâ\x80\x99t support VBAR.', 2: 'Logical unit not ready, manual intervention required â\x80\x94CFW is configured for medium latency, but channel family is not capable of supporting medium latency.', 3: 'Logical unit not ready, R/W sub-system failure.', 4: 'Logical unit not ready, Drive is unmated', 5: 'Logical unit not ready, R/W sub-system init failed; Invalid Servo Firmware', 6: 'Logical unit not ready, R/W sub-system init failed; Invalid Servo Adaptives', 7: 'Logical unit not ready, Read failure on all System Data Table copies', 8: 'Logical unit not ready, Forward table read error during restore', 9: 'Logical unit not ready, Scram metadata read error during restore', 10: 'Logical unit not ready, GCU info restore failed', 11: 'Logical unit not ready, Defect table restore failed', 12: 'Logical unit not ready, Scram restore failed', 13: 'Logical unit not ready, Bxor Critical Failure', 15: 'Logical unit not ready, Media is corrupted but data successfully recovered via media scan', 16: 'Logical unit not ready, suspect list read error', 17: 'Logical unit not ready, reverse directory error during restore', 18: 'Logical unit not ready, system recovery format completed but drive lost critical system data', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Manual Intervention Required'}, 4: {0: 'Logical unit not ready, Scram restore failed', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Format in Progress'}, 7: {0: 'Logical unit not ready, Scram restore failed', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Format in Progress'}, 9: {0: 'Logical unit not ready, self-test in progress.', 1: 'Logical unit not ready, short background self-test in progress.', 2: 'Logical unit not ready, extended background self-test in progress.', 3: 'Logical unit not ready, short foreground self-test in progress.', 4: 'Logical unit not ready, extended foreground self-test in progress.', 5: 'Logical unit not ready, firmware download in progress.', 6: 'Logical unit not ready, initial volume download in progress.', 7: 'Logical unit not ready, session opened.', 8: 'No Specific FRU code', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, H2SAT measurement is Progress'}, 12: {0: 'No Specific FRU code.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, Field Adjustable Adaptive Fly Height (FAAFH) in progress'}, 13: {7: 'Logical unit not ready, Session is already Open.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, Session is already Open'}, 17: {2: 'Logical Unit Not Ready, Notify (Enable Spinup) required', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Notify (Enable Spinup) required'}, 26: {0: 'Logical Unit Not Ready, Start Stop Unit Command in Progress', 'L1': 'Not Ready', 'L2': 'Logical Unit Not Ready, Start Stop Unit Command in Progress'}, 27: {0: 'Logical unit not ready, sanitize in progress.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, sanitize in progress.'}, 28: {0: 'No specific FRU code.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, additional power use not yet granted'}, 34: {1: 'Spindle Error (Spinup Failure)', 2: 'SMIF Traning Failed after 5 times attempt', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, power cycle required.'}, 240: {0: 'Logical unit not ready, super certify in progress.', 1: 'Counterfeit attempt detected (ETF log SN or SAP SN mismatch)', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, super certify in progress'}, 242: {0: 'Drive has been placed in special firmware due to assert storm threshold being exceeded.', 'L1': 'Not Ready', 'L2': 'Logical unit not ready, Assert Storm Threshold being exceeded.'}}, 53: {2: {1: 'Enclosure not ready, no ENCL_ACK assert.', 'L1': 'Not Ready', 'L2': 'Enclosure Services Unavailable'}}, 132: {0: {0: 'Remanufacturing State.', 'L1': 'Not Ready', 'L2': 'Remanufacturing State'}}}, 3: {3: {0: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Peripheral Device Write Fault'}}, 9: {0: {0: 'Track following error.', 254: 'Head flip during power cycle.', 255: 'Track following error.', 'L1': 'Medium Error', 'L2': 'Track Following Error'}, 4: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Head Select Fault'}}, 10: {1: {0: 'No Specific FRU code.', 1: 'Failed to write super certify log file from media backend', 'L1': 'Medium Error', 'L2': 'Failed to write super certify log file'}, 2: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Failed to read super certify log file'}}, 12: {0: {0: 'Peripheral device write fault.', 1: 'Write error during single sector recovery.', 2: 'Write error during gc relocation', 3: 'Write is revirtualized because of a channel error - SSD', 4: 'Read during preamp unsafe fault.', 5: 'Flash Media Request aborted due to Graceful Channel Reset', 7: 'Save SMART error log failed', 8: 'Write error from media backend', 9: 'SSD Uncorrectable Write Error from Media backend', 10: 'SSD Erase Error.', 11: 'SSD PSM Runt Buffer Page Mismatch Error', 17: 'Unrecovered read error on READ step of PRESCAN.', 18: 'Unrecovered read error on READ step of WRITE converted to WRITE VERIFY during RAW operation.', 22: 'Unrecovered read error on READ step of Read-modify-write', 128: 'BVD update error.', 129: 'BVD Correctable IOEDC error.', 'L1': 'Medium Error', 'L2': 'Write Error'}, 2: {0: 'Unrecovered write error - Auto reallocation failed.', 1: 'Reallocate Block - Write alternate block failed, no servo defects.', 2: 'Reallocate Block - Alternate block compare test failed.', 3: 'Reallocate Block - Alternate block sync mark error.', 4: 'Reallocate Block - Maximum allowed alternate selection exhausted.', 5: 'Reallocate Block - Resource is not available for a repetitive reallocation.', 6: 'Reallocate Block Failed', 7: 'Reallocate Block Failed - Write Protect', 8: 'Write error, autoreallocation failed from media backend', 'L1': 'Medium Error', 'L2': 'Write Error â\x80\x93 Auto Reallocation Failed'}, 3: {0: 'Write Error â\x80\x93 Recommend Reassignment', 'L1': 'Medium Error', 'L2': 'Write Error â\x80\x93 Recommend Reassignment'}, 4: {0: 'WORM Error - Invalid Overlapping Address Range.', 1: 'WORM Error - Written WORM Area Infringement.', 2: 'WORM Error - No further writes allowed on WORM drive', 3: 'WORM Error - SIM Registry Read Failed', 4: 'WORM Error - SIM Registry Write Failed', 5: 'WORM Error - Illegal write request after Lock', 'L1': 'Illigal Request', 'L2': 'Write Error - WORM'}, 128: {3: 'Disc trace write (to clear it) failed 02.', 5: 'Disc trace write failed.', 6: 'Save UDS DRAM trace frames to disc failed.', 8: 'Write Long disc transfer failed.', 'L1': 'Medium Error', 'L2': 'Write Error â\x80\x93 Unified Debug System'}, 255: {1: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Write Error â\x80\x93 Too many error recovery revs'}}, 17: {0: {0: 'Unrecovered Read Error.', 1: 'Unrecovered Read Error, too many recovery revs.', 2: 'Unrecovered read error, could not read UDS save-on-update trace', 3: 'Unrecovered read error, could not read UDS finished frame index file', 4: 'Unrecovered read error, could not read SMART to include it in UDS', 5: 'Unrecovered read error, UDS read of a finished frame file failed', 6: 'Read SMART error log failed', 7: 'Unrecovered read BBM on partial reallocation', 8: 'Unrecovered read error on media backend', 9: 'SSD Unrecovered Read Error due to ECC Failure', 10: 'SSD Unrecovered Read Error due to Corrupt Bit', 11: 'Unrecovered read flagged error, created with flagged write uncorrectable command', 12: 'Unrecovered read error due to flash channel reset', 128: 'Read during preamp unsafe fault.', 129: 'EDAC HW uncorrectable error.', 130: 'EDAC overrun error.', 131: 'LBA corrupted with Write Long COR_DIS mode.', 132: 'LBA was in Media cache, hardened upon unrec. read error during cleaning', 133: 'EDAC HW uncorrectable error, Super parity or ISP valid and parity recovery attempted.', 134: 'EDAC HW uncorrectable error, Super parity and ISP Invalid.', 160: 'Read preamp unsafe fault with short/open fault set', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error'}, 4: {0: 'Unrecovered Read Error â\x80\x93 Auto Reallocation Failed', 128: 'Write alternate block failed, no servo defects.', 129: 'Alternate block compare test failed.', 130: 'Alternate block sync mark error.', 131: 'Maximum allowed alternate selection exhausted.', 132: 'Resource is not available for a repetitive reallocation.', 133: 'SERV HW EDAC failure.', 134: 'SERV SID failure.', 135: 'Number of reallocation pending Super Block exceeded limit.', 136: 'Reallocation pending sector encountered during Super Block read.', 137: 'Reallocation pending sector encountered during Super Block write.', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error â\x80\x93 Auto Reallocation Failed'}, 20: {0: 'Unrecovered read error- read pseudo-unrecovered from a WRITE LONG', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error â\x80\x93 LBA marked bad by application'}, 255: {1: 'Unrecovered read error- timelimit exceeded.', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error â\x80\x93 Too many error recovery revs'}}, 20: {1: {0: 'Record Not Found.', 128: 'Search exhaust error or congen mode page directory not found', 129: 'Reallocation LBA is restricted from write access or congen compressed XML not found', 130: 'Reallocation LBA is restricted from read access.', 131: 'Read from or Write to log page data on reserved zone failed.', 'L1': 'Medium Error', 'L2': 'Record Not Found'}}, 21: {1: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Mechanical Positioning Error'}, 3: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Unrecovered write errors due to grown servo flaws'}}, 22: {0: {0: 'Data synchronization mark error.', 128: 'Data sync timeout error.', 129: 'Formatter FIFO parity error 01.', 130: 'Formatter FIFO parity error 02.', 131: 'Super Sector - Data sync timeout error', 132: 'Disc Xfr - Data sync timeout error on sector splits', 'L1': 'Medium Error', 'L2': 'Data Synchronization Mark Error'}, 1: {0: 'Data missed sync mark error. FRU code is bits mask indicating which fragment(s) have missed sync error. Bit n represents fragment n.', 'L1': 'Medium Error', 'L2': 'Data Synchronization Mark Error'}}, 49: {0: {0: 'Medium Format Corrupted.', 1: 'Corruption result of a Mode Select command.', 2: 'Corruption result of a sparing changed condition.', 3: 'Corruption the result of a failed LBA pattern write in Format command.', 4: 'Corruption result of failed user table recovery.', 5: 'Corruption of NVC global header', 6: 'Medium format corrupted from media backend', 7: 'Medium Format Corrupt due to flash identify failure', 8: 'Medium Format Corrupt as a result of failed NVC write or invalid NVC meta data', 9: 'Medium Format Corrupt due to NVC WCD Meta data corruption', 10: 'Media Format Corrupt due to Write failure during MC WCD data restore to disc', 11: 'Medium Format Corrupt because NVC did not burn flash', 12: 'Medium Format Corrupt because Pseudo Error Masks lost after power loss', 13: 'Medium Format Corrupt because unexpected Media Cache Segment Sequence Number', 14: 'Medium Format CorruptÂ\xa0due to system reset without saving NVC data', 15: 'Medium Format Corrupt due to firmware reset (jump to 0) without saving NVC data', 16: 'Medium Format Corrupt due to incomplete burn but no actual power loss', 18: 'Medium Format Corrupt because watchdog timer reset', 19: 'Medium Format Corrupted On Assert (intentionally)', 20: 'Medium Format Corrupt due to IP timeout during SCRAM', 21: 'Medium Format Corrupt due to Write Parameter Error', 22: 'Medium Format Corrupt due to GCU Metadata Error', 24: 'Medium Format Corrupt due to System Metadata restore failure', 32: 'Format Corrupt due to Download changes.', 34: 'Scram user NVC restore failed', 'L1': 'Medium Error', 'L2': 'Medium Format Corrupted'}, 1: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Corruption in R/W format request.'}, 3: {0: 'Sanitize Command Failed', 1: 'Sanitize Command Failed due to file access error', 'L1': 'Medium Error', 'L2': 'Sanitize Command Failed'}, 145: {13: 'Corrupt WWN in drive information file.', 'L1': 'Medium Error', 'L2': 'Corrupt WWN in drive information file'}}, 50: {1: {0: 'Defect list update failure.', 128: 'Failed to save defect files.', 129: 'Failed to save defect files post format 01.', 130: 'Failed to save defect files post format 02.', 131: 'Failed to save defect files post format 03.', 'L1': 'Medium Error', 'L2': 'Defect List Update Error'}, 3: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Defect list longer than allocated memory.'}}, 51: {0: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Flash not ready for access.'}}, 68: {0: {0: 'No Specific FRU code.', 'L1': 'Medium Error', 'L2': 'Internal Target Failure'}}, 93: {0: {1: 'Max Unrecovered Read Error', 'L1': 'Medium Error', 'L2': 'Unrecovered Read Error'}}}, 4: {1: {0: {0: 'No index or sector pulses found.', 128: 'Spin up - Media Manager error encountered.', 129: 'Data field timeout error.', 130: "Media Manager's TDT FIFO Counter error.", 131: "Media Manager's Servo Counter error.", 132: "Media Manager's Latency error.", 133: "Media Manager's Index error.", 134: "Media Manager's Servo error.", 135: 'Media Manager errors could not be cleared successfully.', 136: 'Clearing of MM errors due to a servo error failed.', 137: 'SWCE/SGate overlap error.', 138: 'Servo gate timeout error 01.', 139: 'Servo gate timeout error 02.', 140: 'Servo gate timeout error 03.', 141: 'Servo gate timeout error 04.', 142: 'Servo gate timeout error 05.', 143: 'Super Sector - Handshake error.', 144: 'Super Sector - Servo gate timeout error 01.', 145: 'Super Sector - Servo gate timeout error 02.', 146: 'Super Sector - Servo gate timeout error 03.', 147: 'Super Sector - Servo gate timeout error 04.', 148: 'Super Sector - Servo gate timeout error 05.', 149: 'Servo gate timeout error during generation of Aseek Req.', 150: 'BVD check timeout error.', 151: 'NRZ sequencer completion timeout error.', 152: 'Sequencer timeout on Media Manager event..', 153: 'NRZ xfr error on Media Manager event.', 154: 'Disc sequencer handshake error.', 155: 'Medium Latency channel synchronization handshake error.', 156: 'Fast dPES missed servo sample error.', 157: "Media Manager's anticipatory autoseek (ATS2) XFR error.", 158: 'When a reassigned sector is encountered, wait for the NRZ to finish the previous sector', 159: 'Fast IO Data Collection out of sync with sequencer', 160: 'Channel not ready rev count exhausted. Apply to LDPC LLI channels', 161: "Media Manager's anticipatory autoseek (ATS2) Servo error.", 162: 'Media Managerâ\x80\x99s anticipatory autoseek (ATS2) Disc Pause Condition', 163: 'BERP infinite loop condition', 164: 'Brownout fault detected during write transfer.', 165: 'Sequencer completion timeout error at reassigned sector.', 166: 'Sequencer S-gate timeout error during start of sector read.', 167: 'Sequencer S-gate timeout error during skipping of a new sector.', 'L1': 'Hardware Error', 'L2': 'No Index/Logical Block Signal'}}, 3: {0: {2: 'Gated Channel Fault', 3: 'Write Preamp Unsafe Fault', 4: 'Write Servo Unsafe Fault', 5: 'Read/write channel fault.', 6: 'SFF fault.', 7: 'Write servo field fault.', 8: 'Write Servo unsafe fault.', 9: 'SSD: Peripheral device write fault (flush cache failed)', 16: 'Write Servo sector fault.', 32: 'Read/Write channel fault.', 64: 'Servo fault.', 128: 'Detect of new servo flaws failed.', 129: 'PSG environment fault.', 130: 'Shock event occurred.', 131: 'Unexpected Extended WGATE fault.', 132: 'Channel detected fault during write.', 133: 'Disc locked clock fault detected.', 134: 'Skip Write Detect Dvgas fault', 135: 'Skip Write Detect Rvgas fault', 136: 'Skip Write Detect Fvgas fault', 137: 'Skip Write Detect Dvgas+Rvgas+Fvgas sum threshold exceeded - last SWD fault Dvgas', 138: 'Skip Write Detect Dvgas+Rvgas+Fvgas sum threshold exceeded - last SWD fault Rvgas', 139: 'Skip Write Detect Dvgas+Rvgas+Fvgas sum threshold exceeded - last SWD fault Fvgas', 140: 'Drive free-fall event occurred', 141: 'Large Shock event occured', 144: 'NRZ Write Parity fault.', 145: 'Marvell 8830 TBG Unlock fault.', 146: 'Marvell 8830 WClk Loss fault.', 147: 'EBMS Fault Detect(EFD) Contact fault during write.', 148: 'EBMS Fault Detect(EFD) Contact fault during read.', 149: 'EBMS Fault Detect(EFD) SWOT fault.', 150: 'Marvell SRC SFG Unlock fault.', 255: "LSI 6 channel preamp attempting to write without heat, condition detected by servo and passed as servo fault ( i.e. Preamp error condition indicated by servo fault condition ). This should be recovered by a 'seek away ' performed as part of recovery step", 'L1': 'Hardware Error', 'L2': 'Peripheral Device Write Fault'}}, 9: {0: {0: 'Servo track following error.', 64: 'Servo fault, Normally 04/0900/80 would be changed to 04/0900/40 by the firmware.', 128: 'Servo fault, Normally 04/0900/80 would be changed to 04/0900/40 by the firmware.', 129: 'Servo unsafe fault during write.', 130: 'EDAC block address error.', 131: 'Missing MDW information reported by servo detection.', 132: 'Servo command timed out.', 133: 'Seek command timed out.', 134: 'Seek exceeded recovery time limit.', 135: 'Service drive free fall condition timed out.', 136: 'The altitude has exceeded the limit', 137: 'Seek command timed out on alternate sector', 138: 'Super Block marked dirty.', 139: 'Verify of Super Block data failed.', 140: 'Servo fatal error indicated', 141: 'Super Parity long word Cross Check error', 142: 'Super Parity low word Cross Check error', 143: 'Super Parity high word Cross Check error', 144: 'Super Parity data miscompare', 145: 'Invalid Anticipatry Track Seek request.', 146: 'Enhance Super parity regeneration failure.', 147: 'Super parity regeneration failure.', 'L1': 'Hardware Error', 'L2': 'Track Following Error'}, 1: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Servo Fault'}, 4: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Head Select Fault'}, 255: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Servo cal failed as part of self-test'}}, 21: {1: {0: 'Mechanical Positioning Error.', 128: 'Servo error encountered during drive spin-up.', 129: 'Servo error encountered during drive spin-down.', 130: 'Spindle failed error.', 131: 'Unrecovered seek error encountered.', 132: 'Servo command failed.', 133: 'Servo heater timing failed.', 134: 'Servo Free-Fall Protection command failed.', 135: 'Servo Disc Slip Full TMFF recalibration failed.', 136: 'Servo Disc Slip Head Switch Timing recalibration failed.', 137: 'Servo Disc Slip Head Switch Track recalibration failed.', 138: 'Servo read heat fast I/O command failed.', 139: 'Spin-up attempt during G2P merge process failed.', 140: 'Spin-down attempt during PList processing failed.', 141: 'Spin-up attempt during PList processing failed.', 'L1': 'Hardware Error', 'L2': 'Mechanical Positioning Error'}}, 22: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Data Synchronization Mark Error'}}, 25: {0: {0: 'Defect list error.', 1: 'Save user table error.', 2: 'SIM file transfer error.', 3: 'Persistent Reserve Save to disc fail.', 4: 'Defect list error media backend', 128: 'Format - Recover of saved Grown DST file failed.', 129: 'Recovery of saved Non-Resident DST failed.', 130: 'Clear R/W Slip List - Save of R/W Operating Parmaters file failed.', 131: 'Restore Alt List File From media - Failed restoration from media file.', 132: 'Save of Servo Disc Slip Parms to media failed.', 133: 'Read of Servo Disc Slip Parms from media failed 1.', 134: 'Read of Servo Disc Slip Parms from media failed 2.', 135: 'Servo Disc Slip file - invalid format revision.', 136: 'GList to PList - Recover of saved Grown DST file failed.', 137: 'Clear Non-resident Grown DST - Save to media failed.', 'L1': 'Hardware Error', 'L2': 'Defect List Error'}}, 28: {0: {0: 'Defect list not found.', 1: 'Defect list processing error.', 2: 'Read Manufacturing Info File failure.', 3: 'Read Manufacturing Info File failure.', 4: 'Defect list not found from media backend', 50: 'Read Manufacturing Info File failure.', 52: 'Read Manufacturing Info File failure.', 129: 'Failure to read Primary Defects file for reporting.', 130: 'Invalid entry count in Plist file.', 131: 'Invalid byte extent value in Plist entry.', 132: 'Process Defect Lists - Sort error due to invalid offset.', 133: 'Process Defect Lists - Sort error due to invalid head.', 134: 'Process Defect Lists - Sort error due to invalid cylinder.', 135: 'Process Defect Lists - Unable to recover the Primary Defect files.', 136: 'Failed to seek to defect files for reassign.', 137: 'Failed to seek to defect files for undo-reassign.', 138: 'Failure to write defects report lists file to media.', 139: 'Read of defects report file from media failed.', 140: 'An invalid defects report file is encountered 01.', 141: 'An invalid defects report file is encountered 02', 142: 'Restore of R/W User Operating Parameters file failed.', 143: 'Invalid Primary Servo Flaws data encountered.', 144: 'Failed to save defect files due to miscompare error.', 146: 'PList overflow error while merging PSFT and PList for reporting.', 147: 'Maximum certify passes of a zone exceeded.', 148: 'Maximum write passes of a zone exceeded.', 149: 'Primary Servo Flaws data retrieval - Unable to read file on disc.', 150: 'Primary Servo Flaws data retrieval - Invalid entry count in file.', 151: 'Defective Sectors List data retrieval - Unable to read file on disc.', 152: 'Defective Sectors List data retrieval - Invalid file header data.', 153: 'PList data retrieval - Invalid entry count in Plist file.', 154: 'PList data retrieval - Unable to read Plist file on disc.', 155: 'System Format - invalid entry count.', 156: 'Primary TA data retrieval - Unable to read file on disc.', 157: 'Primary TA data retrieval - Invalid count.', 158: 'Primary TA data retrieval - Invalid sort.', 159: "Process Defect Lists - Defect doesn't exist in audit space.", 160: 'Retrieve Defects Report List - Not All Entries Available', 161: 'Format - Invalid LBA range in PVT before update of dirty blocks.', 162: 'Format - Invalid Parity Validity Table after clean of dirty blocks.', 163: 'Format - Clean of dirty blocks failed.', 164: 'Format - Save of Parity Validity Table to media failed.', 'L1': 'Hardware Error', 'L2': 'Defect List Not Found'}}, 38: {48: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Writing to the Flash Failed'}, 49: {0: 'Failed to program PIC code with new firmware', 'L1': 'Hardware Error', 'L2': 'Writing to the PIC Failed'}}, 41: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Flashing LED occurred.'}}, 50: {0: {8: 'No defect spare location available', 9: 'No defect spare location available for reassign block.', 128: 'Processing of pending reallocation failed.', 129: 'Failed to insert defect to DST.', 130: 'Failed to insert Plist defect to DST.', 131: 'Grown DST file full 01.', 132: 'Grown DST file full 02.', 133: 'Resident DST file full.', 134: 'Failed to insert defective sectors associated w/grown servo flaw.', 135: 'Failure to invalidate Defects Report disc files.', 136: 'Format System Partition â\x80\x93 Failed to insert defective system sectors associated w/ grown servo flaw.', 137: 'Format System Partition â\x80\x93 Failed to insert defective system sectors.', 138: 'Format System Partition â\x80\x93 System Defects file full.', 139: 'Process Defect Lists â\x80\x93 Failed to insert a client specified defect in the defect file.', 140: 'ASFT â\x80\x93 Max # of servo flaws per track exceeded (path #1).', 141: 'ASFT â\x80\x93 Max # of servo flaws per track exceeded (path #2).', 142: 'ASFT full (path #1).', 143: 'ASFT full (path #2).', 144: 'Addition to Reassign Pending List failed.', 145: 'Resource is not available for a new reallocation.', 146: 'No alternates available (path #1).', 147: 'Failed to insert defective sectors associated w/grown servo flaw.', 148: 'Failed to deallocate compromised defects.', 149: 'Format System Partition â\x80\x93 Failed to deallocate compromised.', 150: 'Insertion of DDT entry failed.', 151: 'Compressed DDT file full.', 152: 'Format â\x80\x93 Failed to insert defective sectors associated w/primary servo flaw.', 153: 'Defective Tracks List â\x80\x93 Failed to insert grown defective sectors associated with defective track.', 154: 'Defective Tracks List â\x80\x93 Failed to insert primary defective sectors associated with defective track.', 155: 'Defective Tracks List â\x80\x93 Failed to add new entry to list.', 156: 'Reallocate Block â\x80\x93 Resource is not available for a partial reallocation.', 157: 'Resource is not available for a partial reallocation.', 158: 'Not enough non-defective sectors to allocate for BIPS parity Sectors.', 159: 'BIPS defect table operation failed â\x80\x93 case 1.', 160: 'BIPS defect table operation failed â\x80\x93 case 2.', 161: 'Format â\x80\x93 Failed to add defective track to DST.', 162: 'Format â\x80\x93 Failed to allocate spare sectors.', 163: 'Pad and Fill Defects â\x80\x93 Max number of skipped tracks exceeded.', 164: 'Format â\x80\x93 Failed to allocate spare sectors.', 165: 'Format â\x80\x93 More LBAs than PBAs.', 166: 'Format â\x80\x93 Failed to allocate spare sectors.', 167: 'Format â\x80\x93 Failed to allocate spare sectors.', 168: 'Format â\x80\x93 Failed to allocate spare sectors.', 169: 'Format â\x80\x93 Excessive number of slips not supported by hardware.', 170: 'Invalid HW parity data for parity sector reallocation.', 171: 'Format â\x80\x93 Could not allocate required guard/pad around media cache area on disc', 172: 'Format â\x80\x93 Will not be able to save ISP/MC metadata after the format (a mis-configuration problematic to try to address before this point)', 173: 'Format - Failed to allocate spare sectors.', 174: 'Format - Failed to allocate spare sectors.', 175: 'Format - Failed to allocate spare sectors.', 176: 'Format - Failed to allocate spare sectors.', 177: 'Format - Failed to update parity sectors slip list.', 178: 'Format - Invalid track sector range encountered.', 179: 'Format â\x80\x93 Could not allocate required guard/pad around intermediate super parity area on disc', 180: 'Format â\x80\x93 Media Cache starting DDT entry not found.', 193: 'Format - Attempt to add pad between user area and start/end of Distributed Media Cache failed', 'L1': 'Hardware Error', 'L2': 'DMC area padding failed'}, 1: {0: 'Defect list update failure.', 23: 'Saving of the ASFT during idle time failed', 129: 'Plist file overflow error.', 130: 'PSFT file overflow error.', 131: 'Unable to write defect files.', 132: 'Unable to update operating parms file.', 133: 'Plist file overflow error.', 134: 'Plist file overflow error.', 'L1': 'Hardware Error', 'L2': 'Defect List Update Error'}}, 53: {0: {8: 'LIP occurred during discovery.', 9: 'LIP occurred during an 8067 command.', 10: 'LIP occurred during an 8045 read.', 11: 'LIP occurred during an 8067 read.', 12: 'LIP occurred during an 8067 write.', 13: 'Parallel ESI deasserted during discovery.', 14: 'Parallel ESI deasserted during an 8067 command.', 15: 'Parallel ESI deasserted during an 8045 read.', 16: 'Parallel ESI deasserted during an 8067 read.', 17: 'Parallel ESI deasserted during an 8067 write.', 'L1': 'Hardware Error', 'L2': 'Unspecified Enclosure Services Failure'}, 3: {2: 'Enclosure found but not ready â\x80\x93 No Encl_Ack Negate.', 4: 'Read Data Transfer Enclosure Timeout.', 5: 'Write Data Transfer Enclosure Timeout.', 13: 'Read Data Transfer Bad Checksum.', 14: 'Write Data Transfer Enclosure Timeout.', 15: 'Read Data Transfer Enclosure Timeout.', 'L1': 'Hardware Error', 'L2': 'Enclosure Transfer Failure'}, 4: {4: 'Read Data Transfer Refused by Enclosure.', 5: 'Write Data Transfer Refused by Enclosure.', 'L1': 'Hardware Error', 'L2': 'Enclosure Transfer Refused'}}, 62: {3: {0: 'No Specific FRU code.', 1: 'Logical Unit Failed Self Test â\x80\x93 TestWriteRead', 2: 'Logical Unit Failed Self Test â\x80\x93 TestRandomRead', 3: 'Logical Unit Failed Self Test â\x80\x93 ScanOuterDiameter', 4: 'Logical Unit Failed Self Test â\x80\x93 ScanInnerDiameter', 5: 'Logical Unit Failed Self Test from media backend', 'L1': 'Hardware Error', 'L2': 'Logical Unit Failed Self Test'}, 4: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'H2SAT Foreground Test Failure'}}, 64: {0: {128: 'Format â\x80\x93 Exceeded max number of track rewrites during certify retries.', 'L1': 'Hardware Error', 'L2': 'Miscellaneous Error'}, 1: {0: 'Buffer memory parity error.', 1: 'Buffer FIFO parity error.', 2: 'IOEDC error.', 3: 'VBM parity error.', 'L1': 'Hardware Error', 'L2': 'DRAM Parity Error'}, 145: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Cryptographic Hardware Power-On Self-Test Failure'}, 146: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Cryptographic Algorithm Power-On Self-Test Failure'}, 147: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Conditional Random Number Generation Self-Test Failure'}, 148: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Hidden Root Key Error During Command Execution'}, 149: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Entropy Power-On Self-Test Failure'}, 150: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Conditional Entropy Self-Test Failure'}, 151: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Boot Firmware SHA-256 Power-On Self-Test Failure'}, 152: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Boot Firmware RSA Power-On Self-Test Failure'}}, 66: {0: {0: 'Power-on or self-test failure.', 1: 'DST failure.', 2: 'SIM Spinning-up state transition failure.', 3: 'SIM Drive Initialization state transition failure.', 4: 'Read/write thread initialization failed.', 20: 'DIC exceeds the time limits consecutively over count limit', 'L1': 'Hardware Error', 'L2': 'Power-On or Self-Test Failure'}, 10: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Port A failed loopback test'}, 11: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Port B failed loopback test'}}, 68: {0: {0: 'Internal target failure', 1: 'Self test buffer test failure.', 2: 'Write read test failure.', 3: 'Data sync timeout error.', 4: 'SSD Test access error (DST)', 5: 'Backend (SSD) DRAM failure (DST)', 6: 'Backend (SSD) SRAM failure (DST)', 7: 'Internal target failure META data test', 8: 'Internal target failure System Area Check', 9: 'wait for ACP to get ready for reset took too long', 10: 'wait for AMP to get ready for reset took too long', 11: 'FDBMotor Leakage detected.', 12: 'wait for I2C to be available took too long', 128: 'Write during preamp unsafe fault.', 129: 'Read write channel fault.', 130: 'Small form factor fault.', 131: 'Write during servo field fault.', 132: 'Media Managerâ\x80\x99s TPBA FIFO Counter error.', 133: 'Media Managerâ\x80\x99s TPBA FIFO Under-run error.', 134: 'Media Managerâ\x80\x99s DDT FIFO Counter error.', 135: 'Media Managerâ\x80\x99s DDT FIFO Under-run error.', 136: 'Media Managerâ\x80\x99s Parity error.', 137: 'Media Managerâ\x80\x99s TDT FIFO Under-run error.', 138: 'Media Managerâ\x80\x99s Skip Mask Under-run error.', 139: 'Get Temperature request resulted in invalid temperature.', 140: 'Detected unsupported H/W in a Set Voltage Margin request.', 141: 'Unused Error Code.', 142: 'SMART Initial buffer not ready', 143: 'Formatter EDAC correction memory parity error.', 144: 'NX â\x80\x93 RLL1 error.', 145: 'Disc Buffer parity error.', 146: 'Sequencer encountered an EXE/SGATE overlap error.', 147: 'Formatter Correction Buffer underrun error.', 148: 'Formatter Correction Buffer overrun error.', 149: 'Formatted detected NRZ interface protocol error.', 150: 'Media Managerâ\x80\x99s MX Overrun error.', 151: 'Media Managerâ\x80\x99s NX Overrun error.', 152: 'Media Managerâ\x80\x99s TDT Request error.', 153: 'Media Managerâ\x80\x99s SST Overrun error.', 154: 'Servo PZT calibration failed.', 155: 'Fast I/O- Servo Data Update Timeout error.', 156: 'Fast I/O- First wedge Servo data Timeout error.', 157: 'Fast I/O- Max samples per collection exceeded.', 158: 'CR memory EDC error', 159: 'SP block detected an EDC error', 160: 'Preamp heater open/short fault.', 161: 'RW Channel fault- Memory buffer overflow or underflow or parity error during write.', 162: 'RW Channel fault- Memory buffer overflow or read data path FIFO underflow in legacy NRZ mode.', 163: 'RW Channel fault- Preamp fault during R/W.', 164: 'RW Channel fault- SGATE, RGATE, or WGATE overlap.', 165: 'RW Channel fault- Mismatch in split sector controls or sector size controls.', 166: 'RW Channel fault- Write clock or NRZ clock is not running.', 167: 'RW Channel fault- SGATE, RGATE, or WGATE asserted during calibration.', 168: 'RW Channel fault- RWBI changed during a read or write event.', 169: 'RW Channel fault- Mode overlap flag.', 170: 'RW Channel fault- Inappropriate WPLO or RPLO behavior.', 171: 'RW Channel fault- Write aborted.', 172: 'RW Channel fault- Bit count late.', 173: 'RW Channel fault- Servo overlap error', 174: 'RW Channel fault- Last data fault', 176: 'PES threshold in field is too far from the same value calculated in the factory.', 177: 'Not enough Harmonic Ratio samples were gathered', 178: 'Sigma of Harmonic Ratio samples after all discards exceeded the limit', 179: 'No EBMS contact fault, even at lowest threshold value', 180: 'EBMS fault still detected at highest threshold value', 181: 'Formatter detected BFI error.', 182: 'Formatter FIFO Interface error.', 183: 'Media sequencer- Disc sequencer Data transfer size mismatch.', 184: 'Correction buffer active while disc sequencer timeout error (this error code is used to fix the hardware skip mask read transfer issue).', 185: 'Seagate Iterative Decoder â\x80\x93 Channel RSM fault', 186: 'Seagate Iterative Decoder â\x80\x93 Channel WSM fault', 187: 'Seagate Iterative Decoder â\x80\x93 Channel BCI fault', 188: 'Seagate Iterative Decoder â\x80\x93 Channel SRC fault', 189: 'Seagate Iterative Decoder â\x80\x93 Channel SAB fault', 190: 'Seagate Iterative Decoder â\x80\x93 Channel read gate overflow error', 192: 'Seagate Iterative Decoder â\x80\x93 Channel SMB Bus B parity error', 193: 'Seagate Iterative Decoder â\x80\x93 Channel SMB buffer error on write', 194: 'Seagate Iterative Decoder â\x80\x93 Channel SOB buffer error on write', 195: 'Seagate Iterative Decoder â\x80\x93 Channel SOB parity error', 196: 'Seagate Iterative Decoder â\x80\x93 Channel SAB buffer error', 197: 'Seagate Iterative Decoder â\x80\x93 Channel SAB bend error', 198: 'Seagate Iterative Decoder â\x80\x93 Channel LLI buffer sync error', 199: 'Seagate Iterative Decoder â\x80\x93 Channel LLI data length error on write', 200: 'Seagate Iterative Decoder â\x80\x93 Channel LLI framing error on write', 201: 'Seagate Iterative Decoder â\x80\x93 Channel LLI write status error', 202: 'Seagate Iterative Decoder â\x80\x93 Channel LLI pipe state error (Bonanza), - Channel RSM Gross Error (Caribou- Luxor)', 203: 'Seagate Iterative Decoder â\x80\x93 Channel decoder microcode error', 204: 'Seagate Iterative Decoder â\x80\x93 Channel encoder microcode error', 205: 'Seagate Iterative Decoder â\x80\x93 Channel NRZ parity error', 206: 'Seagate Iterative Decoder â\x80\x93 Symbols per Sector mismatch error', 207: 'Seagate Iterative Decoder â\x80\x93 Channel SMB Bus A parity error', 208: 'Seagate Iterative Decoder â\x80\x93 Channel SMB NRZ parity error', 209: 'Seagate Iterative Decoder â\x80\x93 Channel SOB Buffer error on read', 210: 'Seagate Iterative Decoder â\x80\x93 Channel SMB Buffer error on read', 211: 'Seagate Iterative Decoder â\x80\x93 Channel LLI data length error on read', 212: 'Seagate Iterative Decoder â\x80\x93 Channel LLI framing error on read', 217: 'Seagate Iterative Decoder â\x80\x93 Channel WSM Gross error', 218: 'Seagate Iterative Decoder â\x80\x93 Channel ERF buffer error', 224: 'Preamp low voltage error', 225: 'Preamp low write data frequency at common point error', 226: 'Preamp write head open error', 227: 'Preamp write head shorted to ground error', 228: 'Preamp TA sensor open error', 229: 'Preamp temperature error', 230: 'Preamp write without heat error', 231: 'Preamp writer off in write error', 232: 'Preamp writer output buffer error', 233: 'Preamp low write data frequency at the head error', 234: 'Preamp FOS error', 235: 'Preamp TA or contact detect error', 236: 'Preamp SWOT error', 237: 'Preamp serial port communication error', 238: 'HSC magnitude overflow error', 240: 'RW Channel â\x80\x93 RDATA valid overlap fault', 241: 'RW Channel â\x80\x93 RD valid gap fault', 244: 'RW Channel â\x80\x93 W Parity not ready', 247: 'RW Channel â\x80\x93 Wrong sector length', 248: 'RW Channel â\x80\x93 Encoder overflow error', 249: 'RW Channel â\x80\x93 Encoder early termination fault', 250: 'RW Channel â\x80\x93 Iteration parameter error', 251: 'RW Channel â\x80\x93 MXP write fault', 252: 'RW Channel â\x80\x93 Symbol count error', 253: 'RW Channel â\x80\x93 RD Incomplete error', 254: 'RW Channel â\x80\x93 RD Data VGA error', 255: 'RW Channel â\x80\x93 RD Data TA error', 'L1': 'Hardware Error', 'L2': 'Internal Target Failure'}, 1: {2: 'RW Channel â\x80\x93 RFM Wrong sector length', 3: 'RW Channel â\x80\x93 RFM FIFO underflow', 4: 'RW Channel â\x80\x93 RFM FIFO Overflow', 5: 'RW Channel â\x80\x93 Vector flow errors', 32: 'HSC - An error occurred when attempting to open the file to be used for Harmonic Sensor Circuitry data collection.', 33: 'HSC - The Standard Deviation of the VGAS data collected by the Harmonic Sensor Circuitry was zero.', 34: 'HSC - The Standard Deviation of the 3rd Harmonic data collected by the Harmonic Sensor Circuitry was zero.', 35: 'HSC - The Servo Loop Code returned at the completion of Harmonic Sensor Circuitry data collection was not 0.', 36: 'HSC - An invalid write pattern was specified Harmonic Sensor Circuitry data collection.', 37: 'AR Sensor - The AR Sensor DAC to Target calculation encountered the need to take the square root of a negative value.', 38: 'AR Sensor - The AR Sensor encountered an error when attempting to open the Background Task file.', 39: 'AR Sensor - The AR Sensor encountered an error when attempting to open the General Purpose Task file.', 40: "AR Sensor - The size of the Background Task file is inadequate to satisfy the AR Sensor's requirements.", 41: "AR Sensor - The size of the General Purpose Task file is inadequate to satisfy the AR Sensor's requirements.", 42: 'AR Sensor - The FAFH Parameter File revision is incompatible with the AR Sensor.', 43: 'AR Sensor - The AR Sensor Descriptor in the FAFH Parameter File is invalid.', 44: 'AR Sensor - The Iterative Call Index specified when invoking the AR Sensor exceeds the maximum supported value.', 45: 'AR Sensor - The AR Sensor encountered an error when performing a Track Position request.', 46: 'AR Sensor - The Servo Data Sample Count specified when invoking the AR Sensor exceeds the maximum supported value.', 47: 'AR Sensor - The AR Sensor encountered an error when attempting to set the read channel frequency.', 48: 'AR Sensor - The 3rd Harmonic value measured by the AR Sensor was 0.', 96: 'RW Channel - LOSSLOCKR fault', 97: 'RW Channel - BLICNT fault', 98: 'RW Channel - LLI ABORT fault', 99: 'RW Channel - WG FILLR fault', 100: 'RW Channel - WG FILLW fault', 101: 'RW Channel - CHAN fault', 102: 'RW Channel - FRAG NUM fault', 103: 'RW Channel - WTG fault', 104: 'RW Channel - CTG fault', 105: 'RW Channel -Â\xa0NZRCLR fault', 106: 'RW Channel - Â\xa0Read synthesizer prechange fail fault', 107: 'RW Channel -Â\xa0Servo synthesizer prechange fail fault', 108: 'RW Channel - Servo Error detected prior to halting Calibration Processor', 109: 'RW Channel -Â\xa0Unable to Halt Calibration Processor', 110: 'RW Channel -Â\xa0ADC Calibrations already disabled', 111: 'RW Channel -Â\xa0Calibration Processor Registers have already been saved', 112: 'RW Channel -Â\xa0Address where Calibration Processor Registers are to be saved is invalid', 113: 'RW Channel -Â\xa0Array for saving Calibration Processor Register values is too small', 114: 'RW Channel -Â\xa0Calibration Processor Register values to be used for AR are invalid', 115: 'RW Channel -Â\xa0Synchronous abort complete fault', 116: 'RW Channel -Â\xa0Preamble length fault', 117: 'RW Channel -Â\xa0TA or media defect event fault', 118: 'RW Channel -Â\xa0DPLL frequency overflow/underflow fault', 119: 'RW Channel -Â\xa0Zero gain threshold exceeded fault', 120: 'RW Channel -Â\xa0DPLL frequency deviation fault', 121: 'RW Channel -Â\xa0Extended EVGA overflow/underflow fault', 128: 'RW Channel -Â\xa0Â\xa0Read VGA gain fault', 129: 'RW Channel -Â\xa0Acquire Peak Amplitude flag fault', 130: 'RW Channel -Â\xa0Massive drop-out fault', 131: 'RW Channel -Â\xa0Low Quality sync mark fault', 132: 'RW Channel -Â\xa0NPLD load error fault', 133: 'RW Channel -Â\xa0Write path memory fault status bit fault', 134: 'RW Channel -Â\xa0WRPO disabled fault', 135: 'RW Channel -Â\xa0Preamble quality monitor fault', 136: 'RW Channel -Â\xa0Reset detection flag fault', 137: 'RW Channel -Â\xa0Packet write fault', 138: 'RW Channel -Â\xa0Gate command queue overflow fault', 139: 'RW Channel -Â\xa0Gate command queue underflow fault', 140: 'RW Channel -Â\xa0Ending write splice fault status fault', 141: 'RW Channel -Â\xa0Write-through gap servo collision fault', 142: 'RW Channel - Read Gate Fault', 143: 'Error reading the Preamp Gain register during an HSC operation', 144: 'Error writing the Preamp Gain register during an HSC operation', 145: 'RW Channel - Calibration Processor not halted', 146: 'RW Channel - Background Calibrations already stopped', 147: 'RW Channel -Â\xa0Background Calibrations not stopped', 148: 'RW Channel - Calibration Processor halt error', 149: 'RW Channel - Save AR Calibration Processor registers error', 150: 'RW Channel - Load AR Calibration Processor registers error', 151: 'RW Channel - Restore AR Calibration Processor registers error', 152: 'RW Channel - Write Markov Modulation Code Failure Type 0', 153: 'RW Channel - Write Markov Modulation Code Failure Type 1', 154: 'RW Channel - Write Markov Modulation Code Failure Type 2', 155: 'RW Formatter - NRZ Interface Parity Randomizer Nyquist Error', 156: 'RW Formatter - NRZ Interface Parity Randomizer Run Error', 157: 'RW Formatter - DLT Fifo Underrun Error', 158: 'RW Formatter - WDT Fifo Underrun Error', 159: 'RW Formatter - M2 MI error', 'L1': 'Hardware Error', 'L2': 'Internal Target Failure'}, 224: {0: 'Failure writing firmware to disc.', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 225: {0: 'Failed to reinitialize the NVC Host', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 226: {0: 'Failed to erase the NVC Header', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 227: {0: 'Failed to write NVC client data to disc', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 228: {0: 'Failed to initialize the NVC header', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 229: {0: 'Failed to initialize the NVC Host', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 230: {0: 'Failed to write MCMT during initialization', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 231: {0: 'Failed to write the ISPT during format', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 232: {0: 'Failed to clear logs during format', 'L1': 'Hardware Error', 'L2': 'Writing to Disc Failed'}, 242: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Data Integrity Check Failed on verify'}, 246: {0: 'FRU 00 â\x80\x93 09 stand for error on head 0 â\x80\x93 9.', 16: 'Power-on self-test failed.', 'L1': 'Hardware Error', 'L2': 'Data Integrity Check Failed during write'}, 251: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Failed to enter Raid Partial Copy Diagnostic mode'}, 255: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'XOR CDB check error'}}, 93: {0: {1: 'Number of Command Timeouts Exceeded', 'L1': 'Hardware Error', 'L2': 'Command Timeout'}}, 101: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Voltage fault.'}}, 128: {134: {0: 'Host IOEDC Error on Read detected by host', 1: 'IOEDC error on read.', 2: 'IOECC error on read.', 3: 'FDE IOECC error on read.', 4: 'SSD IOEDC error on read', 5: 'SSD Erased Page Error', 6: 'FDE Sector-bypass datatype mismatch', 'L1': 'Hardware Error', 'L2': 'IOEDC - DataType Error on Read'}, 135: {0: 'Host IOEDC Error on Write, this is unused', 1: 'FDE IOEDC Error on Write detected by the FDE logic', 2: 'SSD IOEDC Error on Write', 128: 'Disk IOEDC parity error on write detected by formatter', 129: 'IOECC and IOEDC errors occurred, which is highly probable (when IOECC is enabled) for multiple or single bit corruption.', 130: 'IOECC parity error on write.', 131: 'IOECC error (correctable).', 'L1': 'Hardware Error', 'L2': 'IOEDC Error on Write'}, 136: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host Parity Check Failed'}, 137: {128: 'IOEDC parity error on read detected by formatter', 'L1': 'Hardware Error', 'L2': 'IOEDC error on read detected by formatter'}, 138: {'L1': 'Hardware Error', 'L2': 'Host FIFO Parity Error detected by Common Buffer', 'fru': ['xx is 00, 01, 02 or 03 ( channel number )']}, 139: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host FIFO Parity Error detected by frame buffer logic'}, 140: {0: 'No Specific FRU code.', 1: 'For Read Host Data Frame Buffer Parity Error.', 2: 'For Write Host Data Frame Buffer Parity Error.', 3: 'SSD Buffer Memory Parity Error', 4: 'Host Data Frame Buffer Uncorrectable ECC Error.', 'L1': 'Hardware Error', 'L2': 'Host Data Frame Buffer Uncorrectable ECC Error'}, 141: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host Data Frame Buffer Protection Error'}, 142: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host FIFO overrun or underrun rrror'}, 143: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'Host FIFO unknown error'}}, 129: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'LA Check Error, LCM bit = 0'}}, 130: {0: {0: 'No Specific FRU code.', 1: 'Insufficient return buffer.', 'L1': 'Hardware Error', 'L2': 'Diag internal client detected insufficient buffer'}}, 131: {0: {0: 'No Specific FRU code.', 'L1': 'Hardware Error', 'L2': 'DOS Scalars are out of range'}}}, 5: {26: {0: {0: 'Parameter list length error.', 1: 'Format Parameter list length error.', 2: 'Mode Select command Parameter list length error.', 3: 'Extended Mode select command Parameter list length error.', 4: 'Mode Select operation Parameter list length error.', 5: 'Check mode page Parameter list length error.', 6: 'Reassign Block command Parameter list length error.', 7: 'Parameter list length error.', 8: 'Parameter data list length error.', 'L1': 'Illegal Request', 'L2': 'Parameter List Length Error'}}, 32: {0: {0: 'Invalid Command Operation Code', 1: 'Primary Invalid Command Operation Code', 2: 'Unique command not unlocked code.', 7: 'Glist to Plist Unlock command not unlocked code.', 8: 'Invalid Command Operation Code for SSD Backend', 'L1': 'Illegal Request', 'L2': 'Invalid Command Operation Code'}, 243: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Invalid linked command operation code'}}, 33: {0: {1: 'Logical block address out of range', 2: 'Invalid LBA in synchronize cache', 3: 'Invalid LBA in read capacity', 4: 'Invalid LB in write same', 5: 'Invalid LBA in read/write long', 6: 'Invalid LBA in seek', 7: 'Logical block address out of range from media backend', 'L1': 'Illegal Request', 'L2': 'Logical Block Address Out of Range'}}, 36: {0: {0: 'Invalid field in CDB', 1: 'Bad CDB error.', 2: 'Invalid field in CDB. (Format command)', 3: 'Invalid field in CDB. (Setup R/W Long command)', 4: 'Invalid field in CDB. (Log sense page)', 5: 'Invalid field in CDB. (Log sense parameter)', 6: 'Invalid field in CDB. (Log select command)', 7: 'Invalid Field in CDB â\x80\x93 UDS trigger command.', 8: 'Invalid Field in CDB â\x80\x93 buffer overflow check.', 9: 'Invalid power transition request', 10: 'Invalid power transition mode bit', 11: 'Invalid power transition PCM', 12: 'Invalid page and subpage combination (Log sense)', 13: 'Invalid field in CDB. (Report Zones command- SMR)', 22: 'Invalid field in CDB. (Skip Mask)', 48: 'Invalid Combination of CDB.', 49: 'Change Definition Illegal Parameter.', 50: 'Change Definition Illegal Password', 51: 'Change Definition Unlock Command Error', 52: 'Change Definition Not Supported', 53: 'Change Definition Mismatch in port mode (Single/Dual port: SAS only)', 54: 'Invalid field in CDB from media backend', 'L1': 'Illegal Request', 'L2': 'Invalid Field in CDB'}, 1: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Illegal Queue Type for CDB (Low priority commands must be SIMPLE queue)'}, 46: {0: 'The Byte Offset exceeds the length of the SMART frame data.', 'L1': 'Illegal Request', 'L2': 'Invalid field in CDB for E6 SMART Dump command, unique to NetApp.'}, 240: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Invalid LBA in linked command'}, 242: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Invalid linked command operation code'}, 243: {128: 'G->P operation requested while drive was formatted w/o PLIST.', 129: 'Servo Flaw already exists in ASFT or PSFT.', 130: 'G->P operation encountered a G-list entry that overlaps an existing P-list entry.', 131: 'G->P operation encountered a Growth Servo Flaw which overlapped an existing Primary defect Servo Flaw.', 132: 'Defects report lists not available for retrieval.', 133: "Servo Flaw doesn't exist in ASFT.", 'L1': 'Illegal Request', 'L2': 'Illegal Servo Flaw operation request'}}, 37: {0: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Logical unit not supported'}}, 38: {0: {0: 'Invalid Field in Parameter List.', 1: 'Invalid Field in Format Parameter List.', 2: 'Field in RetrieveThirdPartyID Parameter List.', 3: 'Invalid Field in ModeSelectOperation Parameter List.', 4: 'Invalid Field in CheckModePage Parameter List.', 5: 'Invalid Field in ReassignBlocksCmd Parameter List.', 6: 'Invalid Field in PersistentReserveOutCmd Parameter List.', 7: 'Invalid Field Invalid in LogSelectCmd Parameter List.', 8: 'Invalid LogSelectCmd Parameter List length.', 9: 'Invalid Field in WriteBufferCmd Parameter List.', 10: 'Invalid Field in SendDiagnosticCmd Parameter List.', 11: 'Invalid Field in BuildTranslateAddrPage Parameter List.', 12: 'An E0 packet to UDS was too small', 13: 'Invalid FCN ID in E0 packet to UDS.', 14: 'Invalid Field in Retrieved Trace Information packet to UDS (E0).', 15: 'Cannot clear UDS trace, because UDS was not allowed to return it all', 16: 'Cannot enable/disable UDS trace, drive not ready', 17: 'Unsupported block size.', 18: 'UDS trigger command.', 19: 'Invalid remanufacturing command.', 20: 'Invalid command while SMART reporting disabled.', 21: 'Invalid field in parameter list from media backend', 128: 'Invalid input cylinder.', 129: 'Invalid input head.', 130: 'Invalid input sector.', 131: 'Input user LBA is invalid 01.', 132: 'Input user LBA is invalid 02.', 133: 'Input user LBA is invalid 03.', 134: 'Input system LBA is invalid.', 135: 'Client defect list size is invalid.', 136: 'Sort error due to invalid offset.', 137: 'Sort error due to invalid head.', 138: 'Sort error due to invalid cylinder.', 139: 'Failed to validate a client specified byte extent info.', 140: 'Failed to validate a client specified sector extent info.', 141: 'Invalid track in client defect list entry.', 142: 'Input track is invalid.', 143: 'First LBA of input track is invalid.', 144: 'Invalid servo data block length.', 145: 'Invalid servo program block length.', 146: 'Address translation â\x80\x93 input PBA is invalid', 147: 'Address translation â\x80\x93 input symbol extent is invalid.', 148: 'Super sector transfer â\x80\x93 invalid wedge transfer size.', 149: 'Track ZLR Transfer â\x80\x93 Invalid partition.', 150: 'Track ZLR Transfer â\x80\x93 Invalid LBA range on target track.', 151: 'Track ZLR Transfer â\x80\x93 Reallocated LBA found on target track.', 152: 'Input user LBA is invalid 04.', 153: 'Input user LBA is invalid 05.', 154: 'Convert Sector to RLL Data â\x80\x93 Unsupported sector size.', 155: 'Add Servo Flaw â\x80\x93 Invalid input specified.', 156: 'Invalid condition for enabling servo free fall protection (drive not spinning).', 157: 'Invalid condition for disabling servo free fall protection (drive not spinning).', 158: 'Invalid condition for disabling servo free fall protection (protection already disabled).', 159: 'Invalid condition for disabling servo free fall protection (protection already de-activated).', 160: 'Invalid condition for disabling servo free fall protection (free-fall condition is currently active).', 161: 'Invalid drive free-fall control option specified.', 162: 'Check free-fall event failed â\x80\x93 protection not functional.', 163: 'Invalid sector range specified.', 164: 'Invalid count value specified for update.', 165: 'Invalid channel memory select specified for access.', 166: 'Invalid buffer index specified for read channel memory access.', 167: 'Invalid start address specified for read channel memory access.', 168: 'Invalid transfer length specified for read channel memory access.', 169: 'Invalid sector extent info', 175: 'Band translation - invalid input type specified', 176: 'Band translation - invalid output type specified', 177: 'Band translation - invalid input Band ID', 178: 'Band translation - invalid input Band ID', 179: 'Band translation - invalid input track position', 180: 'Band translation - invalid input RAP zone, head', 185: 'Invalid band number.', 186: 'Invalid band lba offset.', 187: 'Invalid user lba.', 189: 'Invalid parameter', 193: 'DITS Buffer ( Dummy Cache ) too small', 'L1': 'Illegal Request', 'L2': 'DITS Buffer ( Dummy Cache ) too small'}, 1: {0: 'No Specific FRU code.', 1: 'Log pages unavailable for inclusion in UDS dump.', 'L1': 'Illegal Request', 'L2': 'Parameter Not Supported'}, 2: {0: 'No Specific FRU code.', 1: 'DIAG: Invalid input cylinder.', 2: 'DIAG: Invalid input head.', 3: 'DIAG: Invalid input sector.', 4: 'DIAG: Invalid Wedge.', 5: 'DIAG: Invalid LBA.', 6: 'DIAG: Invalid file selection.', 7: 'DIAG: Invalid file length.', 8: 'DIAG: Invalid start offset.', 9: 'DIAG: Write Overflow.', 10: 'DIAG: Backplane Bypass selection invalid.', 11: 'DIAG: Invalid serial number.', 12: 'DIAG: Incomplete DFB.', 13: 'DIAG: Unsupported DFB revision.', 14: 'DIAG: Invalid Temperature selection.', 15: 'DIAG: Invalid Transfer Length.', 16: 'DIAG: Unsupported memory area.', 17: 'DIAG: Invalid command.', 18: 'DIAG: File copy invalid.', 19: 'DIAG: Insufficient data sent from initiator.', 20: 'DIAG: Unsupported DIAG command.', 21: 'DIAG: Flash segment invalid.', 22: 'DIAG: Req flash segment copy invalid.', 23: 'DIAG: Flash access failed.', 24: 'DIAG: Flash segment length invalid.', 25: 'DIAG: File checksum invalid.', 26: 'DIAG: Host DFB Length Invalid', 27: 'DIAG: Unaligned transfer.', 28: 'DIAG: Unsupported operation.', 29: 'DIAG: Backend invalid.', 30: 'DIAG: Flash plane invalid.', 31: 'DIAG: ISP node not found.', 32: 'DIAG: Invalid parameter.', 33: 'DIAG: Format corrupt condition required.', 34: 'DIAG: Clear all scan unit counts not allowed', 35: 'DIAG:Â\xa0 Unsupported Flash Device', 36: 'DIAG:Â\xa0 Raw flash blocks in MList', 37: 'DIAG:Â\xa0 Raw flash format table mismatch', 38: 'DIAG:Â\xa0 Raw flash Unused format slot', 39: 'DIAG:Â\xa0 Raw flash cannot decide format table', 40: 'DIAG:Â\xa0 Raw flash invalid error code', 41: 'DIAG:Â\xa0 Write protect condition', 42: 'DIAG: Requested for a Pre-erased block in Nor flash', 57: 'Parameter Data out of range.', 58: 'Parameter Data over write.', 64: 'DIAG: Diag write failed', 65: 'DIAG: DIAG_DST_IS_IN_PROGRESS', 66: 'DIAG: DIAG_TEST_RANGE_IN_SET', 68: 'DIAG: DIAG_BMS_IS_ENABLED', 72: 'DIAG: DIAG_INVALID_START_LBA', 73: 'DIAG: DIAG_INVALID_END_LBA', 'L1': 'Illegal Request', 'L2': 'Parameter Value Invalid'}, 3: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Threshold Parameter not supported'}, 4: {0: 'Invalid Release of Active Persistent Reserve', 1: 'Invalid release of persistent reservation. (reservation type mismatch)', 'L1': 'Illegal Request', 'L2': 'Invalid Release of Active Persistent Reserve'}, 5: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Fail to read valid log dump data'}, 152: {0: 'No Specific FRU code.', 1: 'FDE checksum error.', 2: 'Failed Flash Verification on Newly Downloaded Component.', 'L1': 'Illegal Request', 'L2': 'Invalid Field Parameter â\x80\x93 Check Sum'}, 153: {1: 'Segment type mismatch.', 2: 'Customer ID mismatch.', 3: 'Drive type mismatch.', 4: 'HW configuration mismatch.', 5: 'Compatibility configuration mismatch.', 6: 'Servo firmware product family mismatch.', 7: 'QNR download is not supported.', 8: 'CAP product family mismatch.', 9: 'RAP product family mismatch.', 10: 'Download segment length too large.', 11: 'Download length invalid.', 12: 'CTPM missing.', 13: 'CFW and CAP mismatch 01.', 14: 'CFW and CAP mismatch 02.', 15: 'CFW and CAP mismatch 03.', 16: 'CFW and RAP mismatch 01.', 17: 'CFW and RAP mismatch 02.', 18: 'CFW and RAP mismatch 03.', 19: 'CFW and SAP mismatch 01.', 20: 'CFW and SAP mismatch 02.', 21: 'CFW and SAP mismatch 03.', 22: 'CFW and SFW mismatch 01.', 23: 'SAP Product family mistmatch', 24: 'CFW and SFW mismatch 03.', 25: 'Download buffer offset invalid.', 26: 'Address translation invalid.', 27: 'CFW and IAP mismatch.', 28: 'Quick Download in Progress.', 29: 'Invalid unlock tags â\x80\x93 customer does not match', 30: 'Invalid unlock tags â\x80\x93 customer does not match', 31: 'Invalid unlock tags â\x80\x93 checksum failure', 32: 'Firmware not backward compatible.', 33: 'Download overlay incompatible.', 34: 'Overlay download failure 1.', 35: 'Overlay download failure 2.', 36: 'Overlay download failure 3.', 37: 'General download failure', 38: 'Trying to download bridge code for wrong product family', 39: 'Factory flags mismatch.', 40: 'Illegal combination â\x80\x93 Missing BootFW module.', 41: 'Illegal combination â\x80\x93 Missing Customer FW Feature Flags module.', 42: 'Illegal combination â\x80\x93 Programmable Inquiry download not supported.', 43: 'Illegal combination â\x80\x93 Missing CustomerFW module.', 44: 'Download Congen header failure', 46: 'Download Congen XML failure', 47: 'Download Congen version failure', 48: 'Download Congen XML SIM MakeLocalFile failure', 49: 'Download Congen mode data failure â\x80\x93 could not save mode header.', 50: 'Download Congen mode data failure â\x80\x93 mode page had sent length/spec length miscompare.', 51: 'Download Congen mode data failure â\x80\x93 mode page had invalid contents.', 52: 'Download Congen mode data failure â\x80\x93 mode page tried to change contents not allowed by change mask.', 53: 'Download Congen mode data failure â\x80\x93 save all mode pages could not write to media.', 54: 'Download Congen mode data failure â\x80\x93 save partial mode pages could not write to media.', 55: 'Download Congen mode data failure â\x80\x93 mode change callbacks did not complete successfully.', 56: 'Package Enforcement Failure â\x80\x93 Package didnâ\x80\x99t contain valid SFW component', 57: 'Invalid link rate', 59: 'Unlock code not allowed to be DL if dets is locked', 60: 'DETS is locked, code download is blocked', 61: 'Code download is blocked if DETS is locked', 62: 'Download is blocked due to system area incompatibility with new code', 63: 'Invalid SD&D customer family for customer cross-market-segment downloads.', 64: 'Unlock File failed to be written to the flash', 65: 'Unlock File secuirty headers do not match', 80: 'Download header length invalid', 81: 'Download length is not a multiple of the buffer word size', 82: 'Download length and segment length mismatch', 161: 'Unknown firmware tag type.', 162: 'Attempt to R/W locked LBA band', 163: 'SSD download combined code has mismatched frontend and backend', 164: 'SSD download backend code â\x80\x93 recovery required', 165: 'SSD download a firmware which is mismatched with resident firmware', 166: 'SSD download standalone (non-bundle) firmware in boot mode.', 'L1': 'Illegal Request', 'L2': 'Invalid Field Parameter â\x80\x93 Firmware Tag'}, 154: {0: 'Invalid Security Field Parameter in secure download packaging.', 1: 'Attempt to perform secure download with drive not spun up', 2: 'Attempt to download signed non-fde firmware in use state or fail state', 3: 'Attempt to download signed sed code onto a non-sed drive.', 4: 'Download inner signature key index does not match the outer signature key index.', 16: 'Inner firmware signature validation failure.', 18: 'Power Governor feature requires that both CFW and SFW support same number of seek profiles. This sense code indicates an attempt to download a code with mismatching seek profiles count', 20: 'DOS Table Size has been reduced', 'L1': 'Illegal Request', 'L2': 'Invalid Field Parameter â\x80\x93 Firmware Tag'}, 155: {0: 'SSD download code mismatched with running frontend code FRU indicate running frontend compatibility number 00-FF', 'L1': 'Illegal Request', 'L2': 'SSD Compatibility Error'}}, 44: {0: {0: 'Command Sequence Error.', 1: 'Command Sequence Error. (R/W Buffer command)', 2: 'Command Sequence Error. (Retrieve SDBPP Packet)', 3: 'Command Sequence Error. (Diag Locked)', 4: 'Command Sequence Error. (Concurrent UDS service attempt)', 5: 'Command Sequence Error. (UDS retrieval: back-to-back E0)', 6: 'Command Sequence Error. (Unexpected retrieve trace packet received during non-handshaked UDS retrieval)', 7: 'Command Sequence Error. (Back-to-back E1 commands, illegal during handshaked UDS retrieval and illegal during non-handshaked when itâ\x80\x99s time to retrieve the last trace packet)', 8: 'Command Sequence Error. (Send Diag cmd. Before Write Buffer cmd)', 9: 'Command Sequence Error. (Channel BCI logging in online mode)', 10: 'Stop command execution disallowed when Raid Rebuild mode is active/enabled', 11: 'Foreground H2SAT operation currently not allowed.', 'L1': 'Illegal Request', 'L2': 'Command Sequence Error'}, 5: {0: 'No Specific FRU code.', 1: 'Power Management frozen (OBSOLETE)', 'L1': 'Illegal Request', 'L2': 'Illegal Power Condition Request'}, 128: {0: 'Command Sequence Error. (Illegal to request MC flush while cleaning is disabled.)', 'L1': 'Illegal Request', 'L2': 'Command Sequence Error'}}, 50: {1: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Defect List Update Error'}}, 53: {1: {3: 'No enclosure found.', 7: 'Unsupported 8045 Enclosure Request.', 'L1': 'Illegal Request', 'L2': 'Unsupported Enclosure Function'}}, 71: {6: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'SAS - Physical Test in Progress'}}, 73: {0: {0: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Illegal request, Invalid message error'}}, 85: {4: {1: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'PRKT table is full'}}}, 6: {11: {1: {0: 'No Specific FRU code.', 1: 'Temperature is lower than the low temperature threshold.', 'L1': 'Unit Attention', 'L2': 'Warning â\x80\x93 Specified temperature exceeded'}}, 41: {0: {0: 'Power on, reset, or bus device reset occurred. (SPI flash LED)', 1: 'CDB trigger dump and reset occurred..', 2: 'LIP trigger dump and reset occurreD', 3: 'Performing some type of logout, either N_PORT, FCP, or both.', 202: 'The Flight Recorder area in FLASH contains data', 'L1': 'Unit Attention', 'L2': 'Power-On, Reset, or Bus Device Reset Occurred'}, 1: {0: 'Power-on reset occurred. (SPI)', 1: 'Power-on reset occurred. (SSI)', 6: 'Power-on reset occurred when rezero with 0xEF in byte 1', 7: 'Power-on reset occurred due to HW controller watchdog expiration', 8: 'Power-on reset initiated by firmware (e.g. to remove lockup conditions)', 9: 'Power-on reset occurred when servo watchdog timer expires', 'L1': 'Unit Attention', 'L2': 'Power-On Reset Occurred'}, 2: {0: 'SCSI bus reset occurred.', 2: 'Warm reset occurred.', 'L1': 'Unit Attention', 'L2': 'SCSI Bus Reset Occurred'}, 3: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Bus Device Reset'}, 4: {0: 'No Specific FRU code.', 1: 'Internal Reset due to Assert Storm Threshold being exceeded.', 3: 'NVC WCD has marked corrupted sector dirty.', 'L1': 'Unit Attention', 'L2': 'Internal Reset'}, 5: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Transceiver Mode Changed to SE'}, 6: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Transceiver Mode Changed to LVD'}, 7: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'IT Nexus Loss'}, 8: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Write Log Dump data to disk fail'}, 9: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Write Log Dump Entry information fail'}, 10: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Reserved disc space is full'}, 11: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'SDBP test service contained an error, examine status packet(s) for details'}, 12: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'SDBP incoming buffer overflow (incoming packet too big)'}, 205: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Flashing LED occurred. (Cold reset)'}, 206: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Flashing LED occurred. (Warm reset)'}}, 42: {1: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Mode Parameters Changed'}, 2: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Log Parameters Changed'}, 3: {0: 'Reservations preempted.', 1: 'Reservations preempted. (Clear service action)', 'L1': 'Unit Attention', 'L2': 'Reservations Preempted'}, 4: {0: 'Reservations released.', 1: 'Reservations released. (Registration with reg key = 0)', 2: 'Reservations Released. (Preempt service action)', 3: 'Reservations Released. (Release service action)', 'L1': 'Unit Attention', 'L2': 'Reservations Released'}, 5: {0: 'Registrations preempted.', 1: 'Registrations preempted 01.', 'L1': 'Unit Attention', 'L2': 'Registrations Preempted'}, 9: {0: 'Capacity data changed', 'L1': 'Unit Attention', 'L2': 'Capacity data changed'}}, 47: {0: {0: 'No Specific FRU code.', 1: 'Target is already unlocked by another initiator', 'L1': 'Unit Attention', 'L2': 'Tagged Commands Cleared By another Initiator'}, 1: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Commands cleared due to power-off warning'}}, 63: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Target operating conditions have changed'}, 1: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Download Occurred'}, 2: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Changed Operating Definition'}, 3: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Inquiry Data Has Changed'}, 5: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Device Identifier Changed'}, 145: {1: 'WWN in ETFLOG does not match CAPM WWN.', 'L1': 'Unit Attention', 'L2': 'WWN in ETFLOG does not match CAPM WWN'}}, 91: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Log Exception'}}, 92: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'RPL Status Change'}}, 93: {0: {0: 'No Specific FRU code.', 4: 'Reallocation.', 5: 'Reallocation AST table.', 6: 'Reallocation DDT table.', 16: 'Hardware failure.', 20: 'Excessive reassigns.', 32: 'General failure.', 40: 'Flash Life Left Failure', 49: 'Head failure.', 50: 'Recovered data error rate.', 51: 'Recovered data error rate during early life (Xiotech SSD Only)', 55: 'Recovered TA.', 56: 'Hard TA event.', 64: 'Head flip.', 65: 'SSE (servo seek error).', 66: 'Write fault.', 67: 'Seek failure.', 69: 'Track following errors (Hit66).', 74: 'Seek performance failure.', 91: 'Spinup failure.', 107: 'Flash spinup failure', 117: 'Multiply threshold config.', 239: 'No control table on disk.(OBSOLETE)', 'L1': 'Unit Attention', 'L2': 'Failure Prediction Threshold Exceeded'}, 255: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'False Failure Prediction Threshold Exceeded'}}, 128: {144: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Host Read Redundancy Check Error'}, 145: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Host Write Redundancy Check Error'}, 146: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Disc Read Redundancy Check Error'}, 147: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Disc Write Redundancy Check Error'}, 148: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Xor Redundancy Check Error'}}, 180: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'Unreported Deferred Errors have been logged on log page 34h'}}, 255: {0: {0: 'No Specific FRU code.', 'L1': 'Unit Attention', 'L2': 'FC SEL_ID changed'}}}, 7: {3: {0: {0: 'No Specific FRU code.', 'L1': 'Data Protect', 'L2': 'Peripheral device write fault'}}, 32: {2: {0: 'No Access Rights. Attempt to access security locked LBA.', 1: 'No Access Rights. Sanitize command pre-condition not met.', 'L1': 'Data Protect', 'L2': 'Access Denied'}}, 39: {0: {0: 'Write protected.', 1: 'Write protected during ready check.', 2: 'Write protected media backend', 3: 'Write protected due to PIC failure', 4: 'Write protected due to reserved blocks exceeded threshold', 5: 'Write protected due to defects per die exceeded threshold', 6: 'Write protected due to retired blocks exceeded threshold', 7: 'Write protected due to write failure (Nand error)', 8: 'Write Protected due to Auto status command write failure', 9: 'Write protected due to spare blocks exceeded threshold', 10: 'Write protected due to GCU for system data is not available', 11: 'Write protected due to defect table read error during restore', 12: 'Zone is read only ( SMR Only)', 13: 'Write protected due to defect block list overflow', 'L1': 'Data Protect', 'L2': 'Write Protected'}}}, 9: {8: {0: {0: 'No Specific FRU code.', 'L1': 'Firmware Error Constants', 'L2': 'Logical Unit Communication Failure'}}, 128: {0: {0: 'General firmware error.', 1: 'Firmware error during CDB check.', 2: 'Error recovering log tables.', 3: 'UDS has no packet to send back, but it neglected to make this clear to the SDBP layer (E1 command).', 4: 'Processed unsupported UDS session (UDS should have rejected).', 5: 'Packet retrieval allowed by upper levels of UDS when no UDS trace retrieval was active.', 6: 'UDS trace retrieval is trying to include an empty finished frame trace file.', 7: 'Unexpected content split across UDS retrieved trace packets.', 8: 'UDS trace retrieval sense data without FAIL status or vice versa.', 9: 'UDS trace retrieval: Internal confusion over amount of trace.', 10: 'UDS â\x80\x93 retrieval failure.', 11: 'â\x80\x9cDummy Cacheâ\x80\x9d file request failed', 12: 'Failed to fix up system parameters during head depop.', 13: 'Write same command call to XOR data copy failed.', 14: 'Write same command call to create cache segment from buffer failed to allocate sufficient space.', 15: 'Request to read servo data timed out.', 16: 'Loading Disc Firmware failed', 17: 'Disc Firmware Signature Verification Failed.', 18: 'WriteAndOrVerifyCmd Xor copy failure', 19: 'WriteAndOrVerifyCmd request cache segment allocation failed', 20: 'Write Buffer detected an Unknown Error.', 21: 'Write Buffer detected a Corrupted Data Error.', 22: 'Write Buffer detected a Permanent Error.', 23: 'Write Buffer detected a Service Delivery/Target Failure Error.', 24: 'Phy Log Retrieval Failed', 25: 'failed to issue command to auxiliary processor', 26: "failed memory allocation on auxiliary processor's heap", 27: 'Loading PIC Firmware Failed', 28: 'Loading FME Firmware Failed', 29: 'LDevFormat() failed to allocate sufficient space.', 30: 'LDevFormat() call to XorCopyData() failed', 45: 'InitSurface() failed to allocate sufficient space.', 46: 'InitSurface () call to XorCopyData() failed', 61: 'Log Page cache not allocated', 62: 'Log Page cache not allocated', 63: 'Log Page not enough cache available', 64: 'SMART Frame Index corrupted on disc and not recoverable via f/w.', 65: 'NVC Disabled by error condition', 66: 'Log data save to disc failed', 67: 'Wait for phy after reset too long', 68: 'H2SAT unexpected condition occurred', 70: 'Memory allocation failed during Reassign Blocks command', 74: 'Diag command attempted to execute missing or incompatible Overlay code', 75: 'Wait for phy after reset too long', 80: 'Flash management access failed', 128: 'Invalid prime request.', 129: 'Request cannot be processed.', 130: 'Unsupported fault.', 131: 'Track address fault.', 132: 'Servo-Disc synchronization error.', 133: 'End of transfer reached prematurely.', 134: 'Unexpected sequencer timeout error.', 135: 'Unknown error in the NRZ Transfer logic.', 136: 'Unknown EDAC error.', 137: "Unknown Media Manager's error.", 138: 'Invalid disc halt.', 139: 'Unexpected sequencer halt condition.', 140: 'Unexpected sequencer halt.', 141: 'Unknown sequencer timeout error.', 142: 'Unknown NRZ interface error.', 143: 'Disc was soft halted.', 144: 'Fault condition error.', 145: 'Correct Buffer Completion timeout error.', 146: 'Maximum write passes of a zone exceeded. (Changed to 04/1C00/93)', 147: 'Maximum certify passes of a zone exceeded. (Changed to 04/1C00/94)', 148: 'Recovered seek error encountered.', 149: 'Forced to enter error recovery before error is encountered.', 150: 'Recovered servo command error.', 151: 'Partial reallocation performed.', 152: 'Transfer was truncated.', 153: 'Transfer completed.', 154: 'Track transfer completed.', 155: 'Scan Defect - Allocated scan time exceeded.', 156: 'IOEDIOECC parity error on write', 157: 'IOECC parity error on write', 158: 'IOECC error (correctable)', 159: 'EDAC stopped for FW erasure', 160: 'Reallocate Block - Input was not marked for pending reallocation.', 161: 'Input LBA was not found in the RST.', 162: 'Input PBA was not found in the resident DST 1', 163: 'Input PBA was not found in the resident DST 2', 164: 'DST Mgr - Skootch failed 1', 165: 'DST Mgr - Skootch failed 2', 166: 'DST Mgr - Insert failed', 167: 'Correction Buffer over-run, under-run, or EDC error', 168: 'Form FIFO over/under run error', 169: 'Failed to transition to active power', 170: 'Input LBA was marked as logged', 171: 'Format - Max number of servo flaws per track exceeded in servo coast', 172: 'Format - Write servo unsafe errors when the track already has multiple flaws', 173: "Formatter's parity RAM progress is not in sync with transfer.", 174: 'Disc Xfr - Conflict of R/W request resource.', 175: 'Conflict of R/W resource during write attempt of super block data.', 176: "Formatter's parity RAM progress not in sync with alt transfer.", 177: "Formatter's parity RAM is invalid for parity sectors update.", 178: "Formatter's parity RAM is invalid for parity sectors alt-update.", 179: 'Parity secs read of expected reallocated sectors not reallocated.', 180: 'Parity sectors write of expected reallocated sectors not reallocated.', 181: 'PVT not showing all super blocks valid on successful format.', 182: 'Sector Data Regen - Restart of transfer is required.', 183: 'Sector Data Regen - Restart of transfer failed on a reallocated blk.', 184: 'Sector Data Regeneration - Restart of transfer failed.', 185: 'Format - Dirty super blk on nedia not reported in PVT.', 186: 'Super Block Read - No user sectors available.', 187: 'Full R/W reallocation code support is not available.', 188: 'Full R/W reallocation code support is not available.', 189: 'Full R/W reallocation code support is not available.', 190: 'Super Block Read - Recovered Data using SuperC Block.', 191: 'ATIC DERPR Retry - Recovered Data using DERP ATIC retry.', 192: 'Unexpected Servo Response - Retry count equals zero for a non-PZT request', 193: 'Recovered Data using Intermediate Super Parity', 194: 'Overlapping Defect Blocks', 195: 'Missing Defect Blocks', 196: 'Input LBA was not protected from torn write', 197: 'Formatter transfer did not halt properly', 198: 'Servo DC calibration failed', 199: 'Invalid band LBA range encountered during dirty super blocks update attempt', 200: 'Detect Formatter FIFO pointer synchronization loss error', 201: 'Detect Formatter FIFO pointer synchronization loss error', 202: 'Full reallocation support not available', 203: 'Invalid block for unmark DART pending reallocation', 204: 'Mark pending DART skipped', 205: 'Outercode recovery scratchpad buffer size insufficient', 206: 'Recovered data using firmware Iterative OuterCode(IOC)', 207: 'AFH Heater DAC is <= 0', 208: 'AFH Calculated Heater DAC value is >= max allocated memory for heater DAC', 209: 'AFH DAC value supplied to the DAC actuation path is > -b/2a', 210: 'ATS2 Seek Error occurred along with Track address fault error', 211: 'Buffer overflow detected in Legacy mode read.', 'L1': 'Firmware Error Constants', 'L2': 'General Firmware Error Qualifier'}, 82: {'L1': 'Firmware Error Constants', 'L2': 'General Firmware Error Qualifier', 'fru': ['Error byte returned by PMC code for various DITS APIs']}}}, 11: {0: {30: {0: 'Invoke within a TCG session', 'L1': 'Aborted Command', 'L2': 'Sanitize command aborted'}}, 8: {0: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical unit communication failure'}, 1: {0: 'Logical Unit Communication Time-Out.', 128: 'Servo command timed out.', 129: 'Seek operation timed out.', 130: 'Seek operation has exceeded the recovery time limit.', 'L1': 'Aborted Command', 'L2': 'Logical Unit Communication Time-Out'}}, 12: {16: {0: 'Write command requires initial access to a mapped out head.', 1: 'Write command attempted a seek to access a mapped out head.', 2: 'Write command encountered an alternate block mapped to a bad head.', 'L1': 'Aborted Command', 'L2': 'Command aborted due to multiple write errors'}}, 14: {1: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'SAS abort command (10.2.3)'}, 2: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'SAS abort command (9.2.6.3.3.8.1)'}}, 16: {1: {0: 'No specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical Block guard check failed'}, 2: {0: 'No specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical Block application tag check failed'}, 3: {0: 'No specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical Block reference tag check failed'}}, 17: {3: {1: 'Read command requires initial access to a mapped out head.', 2: 'Read command attempted a seek to access a mapped out head.', 3: 'Read command encountered an alternate block mapped to a bad head.', 4: 'Prefetch command for FIM has detected a failed LBA in the range', 'L1': 'Aborted Command', 'L2': 'Command aborted due to multiple read errors'}}, 63: {15: {0: 'Echo buffer overwritten.', 1: 'Read buffer echo error.', 'L1': 'Aborted Command', 'L2': 'Echo buffer overwritten'}}, 67: {0: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Message reject error'}}, 68: {0: {0: 'Timed out while waiting in queue.', 1: 'Timed out during error recovery.', 2: 'Timed out while executing command.', 'L1': 'Aborted Command', 'L2': 'Overall Command Timeout'}, 246: {0: 'FRU 00 â\x80\x93 09 stand for error on head 0 â\x80\x93 9.', 'L1': 'Aborted Command', 'L2': 'Data Integrity Check Failed during write'}}, 69: {0: {0: 'Select/Reselection Failure.', 1: 'Select/Reselection time out.', 'L1': 'Aborted Command', 'L2': 'Select/Reselection Failure'}}, 71: {0: {0: 'SCSI Parity Error in message phase.', 1: 'SCSI parity error in command phase.', 3: 'SCSI parity error in data phase.', 8: 'SCSI CRC error in data phase.', 'L1': 'Aborted Command', 'L2': 'SCSI Parity Error'}, 3: {1: 'SCSI CRC error in command IU.', 8: 'SCSI CRC error in data (out) IU.', 'L1': 'Aborted Command', 'L2': 'Information Unit CRC Error'}, 128: {9: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Fibre Channel Sequence Error'}}, 72: {0: {1: 'Initiator detected error message received, selection path.', 2: 'Initiator detected error message received, reselection path.', 'L1': 'Aborted Command', 'L2': 'Initiator Detected Error Message Received'}}, 73: {0: {1: 'Invalid message received, selection path.', 2: 'Invalid message received, reselection path.', 'L1': 'Aborted Command', 'L2': 'Invalid message received'}}, 75: {0: {0: 'No Specific FRU code.', 2: 'Invalid source ID.', 3: 'Invalid destination ID.', 4: 'Running Disparity error.', 5: 'Invalid CRC.', 16: 'Invalid data frame during transfer and no xfr done.', 'L1': 'Aborted Command', 'L2': 'DATA phase error'}, 1: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Invalid transfer tag'}, 2: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Too much write data'}, 3: {0: 'No Specific FRU code.', 1: 'Link reset occurred during transfer.', 5: 'Break received in the middle of a data frame', 6: 'Break received but unbalanced ACK/NAKs', 'L1': 'Aborted Command', 'L2': 'ACK NAK Timeout'}, 4: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'NAK received'}, 5: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Data offset error'}, 6: {0: 'No Specific FRU code.', 1: 'Break Response Timeout', 2: 'Done Response Timeout', 3: 'SAS Credit Timeout', 'L1': 'Aborted Command', 'L2': 'Initiator Response Timeout'}, 32: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'SAS Credit Timeout'}, 255: {0: 'Drive type mismatch â\x80\x93 download firmware', 'L1': 'Aborted Command', 'L2': 'Check FW Tags'}}, 78: {0: {0: 'No Specific FRU code.', 1: 'SAS - Overlapped Commands Attempted.', 2: 'UDS trigger on non-queued cmd with outstanding NCQ cmds', 'L1': 'Aborted Command', 'L2': 'Overlapped Commands Attempted'}}, 85: {4: {0: 'Cannot reassign if Media cache is not empty', 'L1': 'Aborted Command', 'L2': 'Insufficient Resources'}}, 116: {8: {5: 'No Specific FRU code.', 'L1': 'Illegal Request', 'L2': 'Invalid Field Parameter â\x80\x93 Check Sum'}}, 128: {0: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Logical Unit Access Not Authorized.'}}, 129: {0: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'LA Check Error.'}, 1: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Unexpected Boot FW execution delay.'}, 2: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Unexpected Customer FW execution delay.'}, 3: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Unexpected FW download delay.'}}, 251: {1: {0: 'No Specific FRU code.', 'L1': 'Aborted Command', 'L2': 'Command maps to a head marked as bad'}}}, 13: {33: {0: {0: 'No Specific FRU code.', 1: 'UDS Trace retrieval complete.', 'L1': 'Volume Overflow Constants', 'L2': 'Logical Block Address Out of Range'}}}, 14: {29: {0: {0: 'Miscompare During Verify Operation.', 128: 'Data miscompare error.', 129: 'Data miscompare error at erasure correction.', 'L1': 'Data Miscompare', 'L2': 'Miscompare During Verify Operation'}}}}
""" try: from .NotReceived import NotReceived from .errors import * from .classreader import * from .checkpoint import Checkpoint except Exception as e: from NotReceived import NotReceived from errors import * from classreader import * from checkpoint import Checkpoint """ """ import sys print(sys.path)"""
""" try: from .NotReceived import NotReceived from .errors import * from .classreader import * from .checkpoint import Checkpoint except Exception as e: from NotReceived import NotReceived from errors import * from classreader import * from checkpoint import Checkpoint """ '\nimport sys\nprint(sys.path)'
frase = str(input('Digite a frase: ')).strip().upper() palavras = frase.split() juntarPalavras = ''.join(palavras) trocar = juntarPalavras[::-1] print(trocar)
frase = str(input('Digite a frase: ')).strip().upper() palavras = frase.split() juntar_palavras = ''.join(palavras) trocar = juntarPalavras[::-1] print(trocar)
def log_normal_pdf(sample, mean, logvar, raxis=1): log2pi = tf.math.log(2. * np.pi) return tf.reduce_sum( -.5 * ((sample - mean) ** 2. * tf.exp(-logvar) + logvar + log2pi), axis=raxis) def compute_loss(model, x): mean, logvar = model.encode(x) z = model.reparameterize(mean, logvar) x_logit = model.decode(z) cross_ent = tf.nn.sigmoid_cross_entropy_with_logits(logits=x_logit, labels=x) logpx_z = -tf.reduce_sum(cross_ent, axis=[1, 2, 3]) logpz = log_normal_pdf(z, 0., 0.) logqz_x = log_normal_pdf(z, mean, logvar) return -tf.reduce_mean(logpx_z + logpz - logqz_x)
def log_normal_pdf(sample, mean, logvar, raxis=1): log2pi = tf.math.log(2.0 * np.pi) return tf.reduce_sum(-0.5 * ((sample - mean) ** 2.0 * tf.exp(-logvar) + logvar + log2pi), axis=raxis) def compute_loss(model, x): (mean, logvar) = model.encode(x) z = model.reparameterize(mean, logvar) x_logit = model.decode(z) cross_ent = tf.nn.sigmoid_cross_entropy_with_logits(logits=x_logit, labels=x) logpx_z = -tf.reduce_sum(cross_ent, axis=[1, 2, 3]) logpz = log_normal_pdf(z, 0.0, 0.0) logqz_x = log_normal_pdf(z, mean, logvar) return -tf.reduce_mean(logpx_z + logpz - logqz_x)
my_name = "Jan" my_age = 23 print(f"Age: { my_age }, Name: { my_name }")
my_name = 'Jan' my_age = 23 print(f'Age: {my_age}, Name: {my_name}')
__all__ = ("ComparsionMixin", "LazyLoadMixin") class ComparsionMixin(object): """ Mixin to help compare two instances """ def __eq__(self, other): """ Compare two items """ if not issubclass(type(other), self.__class__): return False if (self.body == other.body and self._id == other._id and self._rev == other._rev): return True keys = lambda o: [key for key in o.body.keys() if key not in self.IGNORE_KEYS] # compare keys only if keys(self) != keys(other): return False # compare bodies but ignore sys keys if (self.body is not None and other.body is not None): for key in keys(other): if self.body.get(key, None) != other.body.get(key, None): return False if (self._id is not None and self._rev is not None and (self._id != other._id or str(self._rev) != str(other._rev))): return False return True class LazyLoadMixin(object): """ Mixin to lazily load some objects before processing some of methods. Required attributes: * LAZY_LOAD_HANDLERS - list of methods which should be handled * lazy_loader - method which should check status of loading and make decision about loading something or simply process next method in chain * _lazy_loaded - property which provide status of the lazy loading, should be False by default """ def __getattribute__(self, name): """Fetching lazy document""" if name in object.__getattribute__(self, "LAZY_LOAD_HANDLERS"): object.__getattribute__(self, "_handle_lazy")() return object.__getattribute__(self, name) def _handle_lazy(self): if self._lazy_loaded is False: self._lazy_loaded = True self.lazy_loader()
__all__ = ('ComparsionMixin', 'LazyLoadMixin') class Comparsionmixin(object): """ Mixin to help compare two instances """ def __eq__(self, other): """ Compare two items """ if not issubclass(type(other), self.__class__): return False if self.body == other.body and self._id == other._id and (self._rev == other._rev): return True keys = lambda o: [key for key in o.body.keys() if key not in self.IGNORE_KEYS] if keys(self) != keys(other): return False if self.body is not None and other.body is not None: for key in keys(other): if self.body.get(key, None) != other.body.get(key, None): return False if self._id is not None and self._rev is not None and (self._id != other._id or str(self._rev) != str(other._rev)): return False return True class Lazyloadmixin(object): """ Mixin to lazily load some objects before processing some of methods. Required attributes: * LAZY_LOAD_HANDLERS - list of methods which should be handled * lazy_loader - method which should check status of loading and make decision about loading something or simply process next method in chain * _lazy_loaded - property which provide status of the lazy loading, should be False by default """ def __getattribute__(self, name): """Fetching lazy document""" if name in object.__getattribute__(self, 'LAZY_LOAD_HANDLERS'): object.__getattribute__(self, '_handle_lazy')() return object.__getattribute__(self, name) def _handle_lazy(self): if self._lazy_loaded is False: self._lazy_loaded = True self.lazy_loader()
# Yunfan Ye 10423172 def Fibonacci(n): if n == 1: return 1 elif n == 2: return 1 else: return Fibonacci(n - 1) + Fibonacci(n - 2) # arr = [1,2,3,4,5,6,7,8,9,10] # for i in arr: # print(Fibonacci(i))
def fibonacci(n): if n == 1: return 1 elif n == 2: return 1 else: return fibonacci(n - 1) + fibonacci(n - 2)
class UrlPath: @staticmethod def combine(*args): result = '' for path in args: result += path if path.endswith('/') else '{}/'.format(path) #result = result[:-1] return result
class Urlpath: @staticmethod def combine(*args): result = '' for path in args: result += path if path.endswith('/') else '{}/'.format(path) return result
class Error(): def __init__(self): print("An error has occured !") class TypeError(Error): def __init__(self): print("This is Type Error\nThere is a type mismatch.. ! Please fix it.")
class Error: def __init__(self): print('An error has occured !') class Typeerror(Error): def __init__(self): print('This is Type Error\nThere is a type mismatch.. ! Please fix it.')
class Node(object): def __init__(self, value, next=None, prev=None): self.value = value self.next = next self.prev = prev class LinkedList(object): def __init__(self): self.head = None self.tail = None self.length = 0 def push(self, value): new_node = Node(value) if not self.head: self.head = self.tail = new_node else: new_node.prev = self.tail self.tail.next = new_node self.tail = new_node self.length += 1 def pop(self): node = self.tail if node is None or node.prev is None: self.head = self.tail = None else: self.tail = self.tail.prev self.tail.next = None self.length -= 1 return node.value def shift(self): node = self.head if node is None or node.next is None: self.head = self.tail = None else: self.head = self.head.next self.head.prev = None self.length -= 1 return node.value def unshift(self, value): new_node = Node(value) if not self.head: self.head = self.tail = new_node else: new_node.next = self.head self.head.prev = new_node self.head = new_node self.length += 1 def __len__(self): return self.length def __iter__(self): current_node = self.head while (current_node): yield current_node.value current_node = current_node.next
class Node(object): def __init__(self, value, next=None, prev=None): self.value = value self.next = next self.prev = prev class Linkedlist(object): def __init__(self): self.head = None self.tail = None self.length = 0 def push(self, value): new_node = node(value) if not self.head: self.head = self.tail = new_node else: new_node.prev = self.tail self.tail.next = new_node self.tail = new_node self.length += 1 def pop(self): node = self.tail if node is None or node.prev is None: self.head = self.tail = None else: self.tail = self.tail.prev self.tail.next = None self.length -= 1 return node.value def shift(self): node = self.head if node is None or node.next is None: self.head = self.tail = None else: self.head = self.head.next self.head.prev = None self.length -= 1 return node.value def unshift(self, value): new_node = node(value) if not self.head: self.head = self.tail = new_node else: new_node.next = self.head self.head.prev = new_node self.head = new_node self.length += 1 def __len__(self): return self.length def __iter__(self): current_node = self.head while current_node: yield current_node.value current_node = current_node.next
def params_create_rels_unwind_from_objects(relationships, property_identifier=None): """ Format Relationship properties into a one level dictionary matching the query generated in `query_create_rels_from_list`. This is necessary because you cannot access nested dictionairies in the UNWIND query. UNWIND { rels } AS rel MATCH (a:Gene), (b:GeneSymbol) WHERE a.sid = rel.start_sid AND b.sid = rel.end_sid AND b.taxid = rel.end_taxid CREATE (a)-[r:MAPS]->(b) SET r = rel.properties Call with params: {'start_sid': 1, 'end_sid': 2, 'end_taxid': '9606', 'properties': {'foo': 'bar} } :param relationships: List of Relationships. :return: List of parameter dictionaries. """ if not property_identifier: property_identifier = 'rels' output = [] for r in relationships: d = {} for k, v in r.start_node_properties.items(): d['start_{}'.format(k)] = v for k, v in r.end_node_properties.items(): d['end_{}'.format(k)] = v d['properties'] = r.properties output.append(d) return {property_identifier: output}
def params_create_rels_unwind_from_objects(relationships, property_identifier=None): """ Format Relationship properties into a one level dictionary matching the query generated in `query_create_rels_from_list`. This is necessary because you cannot access nested dictionairies in the UNWIND query. UNWIND { rels } AS rel MATCH (a:Gene), (b:GeneSymbol) WHERE a.sid = rel.start_sid AND b.sid = rel.end_sid AND b.taxid = rel.end_taxid CREATE (a)-[r:MAPS]->(b) SET r = rel.properties Call with params: {'start_sid': 1, 'end_sid': 2, 'end_taxid': '9606', 'properties': {'foo': 'bar} } :param relationships: List of Relationships. :return: List of parameter dictionaries. """ if not property_identifier: property_identifier = 'rels' output = [] for r in relationships: d = {} for (k, v) in r.start_node_properties.items(): d['start_{}'.format(k)] = v for (k, v) in r.end_node_properties.items(): d['end_{}'.format(k)] = v d['properties'] = r.properties output.append(d) return {property_identifier: output}
# Check if the value is in the list? words = ['apple', 'banana', 'peach', '42'] if 'apple' in words: print('found apple') if 'a' in words: print('found a') else: print('NOT found a') if 42 in words: print('found 42') else: print('NOT found 42') # found apple # NOT found a # NOT found 42
words = ['apple', 'banana', 'peach', '42'] if 'apple' in words: print('found apple') if 'a' in words: print('found a') else: print('NOT found a') if 42 in words: print('found 42') else: print('NOT found 42')
__author__ = 'renderle' class OpenWeatherParser: def __init__(self, data): self.data = data def getValueFor(self, idx): return self.data['list'][idx] def getTemperature(self): earlymorningValue = self.getValueFor(0)['main']['temp_max'] morningValue = self.getValueFor(1)['main']['temp_max'] mixedTemp = (earlymorningValue + 2*morningValue)/3 return mixedTemp; def getCloudFactor(self): earlymorningValue = self.getValueFor(0)['clouds']['all'] morningValue = self.getValueFor(1)['clouds']['all'] mixedCloudFactor = (earlymorningValue + 3*morningValue)/4 return mixedCloudFactor def getOverallWeatherCondition(self): morningValue = self.getValueFor(1)['weather'][0]['id'] return morningValue
__author__ = 'renderle' class Openweatherparser: def __init__(self, data): self.data = data def get_value_for(self, idx): return self.data['list'][idx] def get_temperature(self): earlymorning_value = self.getValueFor(0)['main']['temp_max'] morning_value = self.getValueFor(1)['main']['temp_max'] mixed_temp = (earlymorningValue + 2 * morningValue) / 3 return mixedTemp def get_cloud_factor(self): earlymorning_value = self.getValueFor(0)['clouds']['all'] morning_value = self.getValueFor(1)['clouds']['all'] mixed_cloud_factor = (earlymorningValue + 3 * morningValue) / 4 return mixedCloudFactor def get_overall_weather_condition(self): morning_value = self.getValueFor(1)['weather'][0]['id'] return morningValue