content
stringlengths
7
1.05M
'''n = s = 0 while n != 999: n = int(input('Digite um número: ')) s += n s -= 999 print ('A soma vale {}'.format(s))''' n = s = 0 while True: n = int(input('Digite um número: ')) if n == 999: break s += n print ('A soma vale {}'.format(s))
def setup(): size(600, 400) def draw(): global theta background(0); frameRate(30); stroke(255); a = (mouseX / float(width)) * 90; theta = radians(a); translate(width/2,height); line(0,0,0,-120); translate(0,-120); branch(120); def branch(l): l *= .66 if l > 1: pushMatrix() rotate(theta) line(0, 0, 0, -l) translate(0, -l) branch(l) popMatrix() pushMatrix() rotate(-theta) line(0, 0, 0, -l) translate(0, -l) branch(l) popMatrix()
def f(x): y = x**4 - 3*x return y #pythran export integrate_f6(float64, float64, int) def integrate_f6(a, b, n): dx = (b - a) / n dx2 = dx / 2 s = f(a) * dx2 i = 0 for i in range(1, n): s += f(a + i * dx) * dx s += f(b) * dx2 return s
# O(n) time | O(1) space def reverseLinkedList(head): p1, p2 = None, head while p2 is not None: p3 = p2.next p2.next = p1 p1 = p2 p2 = p3 return p1
""" * Highe level classes should not depend on low level classes, it happens most of the time because we write low level classes first and then make the high level classes dependent on them * Abstractions (High Level Classes) should not depend on implementations (Low level class) Solve it using Bridge pattern or Singleton Design patterns are there to solve it It helps in writing tests function also Concrete business class should not depend on concreete low level class but the abstraction of those You can do this inversion using dependency injection, parameter injection or constructor injection this is gem: https://www.youtube.com/watch?v=S9awxA1wNNY&list=PLrhzvIcii6GMQceffIgKCRK98yTm0oolm&index=2 It can even reduce classes , if the concrete business class are very similar """
# Make a config.py file filling in these constants. Note: This is only a template file! clientID = 'CLIENT_ID' secretID = 'SECRET_ID' uName = 'USERNAME' password = 'PASSWORD' db_host = 'IP_ADDR_DB' db_name = 'MockSalutes' db_user = 'DB_USER' db_pass = 'DB_PASSWORD'
# cook your dish here for _ in range(int(input())): N,MINX,MAXX = map(int,input().split()) num = MAXX-MINX+1 even = num//2 odd = num-even for i in range(N): w, b = map(int,input().split()) if w%2==0 and b%2==0: even = even+odd odd=0 elif w%2==1 and b%2==1: even,odd = odd,even elif w%2==0 and b%2==1: odd= even+odd even=0 print(even,odd)
#!/usr/bin/env python3 ''' Create a function, that takes 3 numbers: a, b, c and returns True if the last digit of (the last digit of a * the last digit of b) = the last digit of c. ''' def last_dig(a, b, c): a = list(str(a)) b = list(str(b)) c = list(str(c)) val = list(str(int(a[-1]) * int(b[-1]))) return int(val[-1]) == int(c[-1]) #Alternative Solutions def last_dig(a, b, c): return str(a*b)[-1] == str(c)[-1] def last_dig(a, b, c): return ((a % 10) * (b % 10) % 10) == (c % 10)
# Definition for an interval. class Interval: def __init__(self, s=0, e=0): self.start = s self.end = e class Solution: # @param intervals, a list of Intervals # @return a list of Interval def merge(self, intervals): newInterval = [] if len(intervals) == 0: return [newInterval]
# Basic Fantasy RPG Dungeoneer Suite # Copyright 2007-2018 Chris Gonnerman # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # Redistributions of source code must retain the above copyright # notice, self list of conditions and the following disclaimer. # # Redistributions in binary form must reproduce the above copyright # notice, self list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # Neither the name of the author nor the names of any contributors # may be used to endorse or promote products derived from self software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE # AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. roomtypes = [ 0, ( 5, "Antechamber"), ( 3, "Armory"), ( 7, "Audience"), ( 2, "Aviary"), ( 7, "Banquet Room"), ( 4, "Barracks"), ( 6, "Bath"), (10, "Bedroom"), ( 2, "Bestiary"), ( 1, "Cell"), ( 1, "Chantry"), ( 2, "Chapel"), ( 1, "Cistern"), ( 3, "Classroom"), ( 8, "Closet"), ( 2, "Conjuring"), ( 5, "Corridor"), ( 1, "Courtroom"), ( 1, "Crypt"), ( 7, "Dining Room"), ( 2, "Divination Room"), ( 6, "Dormitory"), ( 4, "Dressing Room"), ( 3, "Gallery"), ( 3, "Game Room"), ( 4, "Great Hall"), ( 5, "Guardroom"), ( 6, "Hall"), ( 2, "Harem/Seraglio"), ( 2, "Kennel"), ( 6, "Kitchen"), ( 3, "Laboratory"), ( 3, "Library"), ( 7, "Lounge"), ( 3, "Meditation Room"), ( 2, "Museum"), ( 1, "Observatory"), ( 7, "Office"), ( 6, "Pantry"), ( 2, "Prison"), ( 1, "Privy"), ( 4, "Reception Room"), ( 3, "Refectory"), ( 2, "Robing Room"), ( 2, "Shrine"), ( 7, "Sitting Room"), ( 3, "Smithy"), ( 1, "Solar"), ( 4, "Stable"), ( 6, "Storage"), ( 2, "Strongroom/Vault"), ( 5, "Study"), ( 1, "Temple"), ( 1, "Throne Room"), ( 1, "Torture Chamber"), ( 2, "Training Room"), ( 2, "Trophy Room"), ( 8, "Vestibule"), ( 6, "Waiting Room"), ( 3, "Water Closet"), ( 3, "Well"), ( 4, "Workroom"), ( 6, "Workshop"), ] # end of file.
########################################################################################## # # Asteroid Version # # (c) University of Rhode Island ########################################################################################## VERSION = "0.1.0"
# Criando nossa 1ª Classe em Python # Sempre que você quiser criar uma classe, você vai fazer: # # class Nome_Classe: # # Dentro da classe, você vai criar a "função" (método) __init__ # Esse método é quem define o que acontece quando você cria uma instância da Classe # # Vamos ver um exemplo para ficar mais claro, com o caso da Televisão que a gente vinha comentando #classes class TV: #criar uma classe cor = 'preta' #atributo fixo criado para a classe TV def __init__(self, tamanho): #atributos, sempre inicia com __init__ / tamanho virou atributo para escolher self.ligada = False self.tamanho = tamanho #tamanho é uma variavel self.canal = "Netflix" self.volume = 10 def mudar_canal(self, novo_canal): #metodo da minha classe TV, novo_canal é um parametro self.canal = novo_canal print('Canal alterado para {}'.format(novo_canal)) #programa # para criar uma TV eu preciso passar os parametro que escolhi no __init__ tv_sala = TV(tamanho=55) #cria a tv da sala com a classe TV / Criando uma instancia da TV / recebendo todos os atributos tv_quarto = TV(tamanho=50) tv_sala.quarto = 'verde' tv_sala.mudar_canal("Globo") #aqui coloca o novo_canal que é o parametro tv_quarto.mudar_canal('Youtube') print(tv_sala.canal) print(tv_quarto.canal) print(tv_sala.cor)
class User: def __init__(self,account_name,card,pin): self.account_name = account_name self.card = card self.pin = pin
CFG = { 'in_ch': 3, 'out_ch': 24, 'kernel_size': 3, 'stride': 2, 'width_mult': 1, 'divisor': 8, 'actn_layer': None, 'layers': [ {'channels': 24, 'expansion': 1, 'kernel_size': 3, 'stride': 1, 'nums': 2, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 48, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 4, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 64, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 4, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 128, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 6, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 160, 'expansion': 6, 'kernel_size': 3, 'stride': 1, 'nums': 9, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 256, 'expansion': 6, 'kernel_size': 3, 'stride': 2, 'nums': 15, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True} ] } def get_default_cfg(): return CFG def get_cfg(name='efficientnetv2_s'): name = name.lower() if name == 'efficientnetv2_s': cfg = get_default_cfg() elif name == 'efficientnetv2_m': cfg = get_default_cfg() cfg['layers'] = [ {'channels': 24, 'expansion': 1, 'kernel_size': 3, 'stride': 1, 'nums': 3, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 48, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 5, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 80, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 5, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 160, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 7, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 176, 'expansion': 6, 'kernel_size': 3, 'stride': 1, 'nums': 14, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 304, 'expansion': 6, 'kernel_size': 3, 'stride': 2, 'nums': 18, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 512, 'expansion': 6, 'kernel_size': 3, 'stride': 1, 'nums': 5, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True} ] elif name == 'efficientnetv2_l': cfg = get_default_cfg() cfg['layers'] = [ {'channels': 32, 'expansion': 1, 'kernel_size': 3, 'stride': 1, 'nums': 4, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 64, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 7, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 96, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 7, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 192, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 10, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 224, 'expansion': 6, 'kernel_size': 3, 'stride': 1, 'nums': 19, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 384, 'expansion': 6, 'kernel_size': 3, 'stride': 2, 'nums': 25, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 640, 'expansion': 6, 'kernel_size': 3, 'stride': 1, 'nums': 7, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True} ] elif name == 'efficientnetv2_xl': cfg = get_default_cfg() cfg['layers'] = [ {'channels': 32, 'expansion': 1, 'kernel_size': 3, 'stride': 1, 'nums': 4, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 64, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 8, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 96, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 8, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': True, 'use_se': False}, {'channels': 192, 'expansion': 4, 'kernel_size': 3, 'stride': 2, 'nums': 16, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 256, 'expansion': 6, 'kernel_size': 3, 'stride': 1, 'nums': 24, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 512, 'expansion': 6, 'kernel_size': 3, 'stride': 2, 'nums': 32, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True}, {'channels': 640, 'expansion': 6, 'kernel_size': 3, 'stride': 1, 'nums': 8, 'norm_layer': None, 'dropout_ratio': 0.1, 'dc_ratio': 0.2, 'reduction_ratio': 0.25, 'actn_layer': None, 'fused': False, 'use_se': True} ] else: raise ValueError("No pretrained config available" " for name {}".format(name)) return cfg
# -*- coding: utf-8 -*- def main(): n = int(input()) dp = [float('inf') for _ in range(n + 1)] ng_numbers = list() # See: # https://www.slideshare.net/chokudai/abc011 for i in range(3): ng_number = int(input()) if ng_number == n: print('NO') exit() ng_numbers.append(ng_number) # KeyInsight # 直前の状態にのみ依存している: DPの可能性がある # 気がつけなかった点:管理する状態を操作回数とする dp[n] = 0 for i in range(n, -1, -1): if i in ng_numbers: continue # 範囲外参照を回避 for j in range(1, 4): if i - j < 0: continue # 気がつけなかった点: 必要な操作回数を更新 dp[i - j] = min(dp[i] + 1, dp[i - j]) if dp[0] <= 100: print('YES') else: print('NO') if __name__ == '__main__': main()
READ_DOCSTRING = """ Read the input ``table`` and return the table. Most of the default behavior for various parameters is determined by the Reader class. See also: - http://docs.astropy.org/en/stable/io/ascii/ - http://docs.astropy.org/en/stable/io/ascii/read.html Parameters ---------- table : str, file-like, list, `pathlib.Path` object Input table as a file name, file-like object, list of strings, single newline-separated string or `pathlib.Path` object . guess : bool Try to guess the table format. Defaults to None. format : str, `~astropy.io.ascii.BaseReader` Input table format Inputter : `~astropy.io.ascii.BaseInputter` Inputter class Outputter : `~astropy.io.ascii.BaseOutputter` Outputter class delimiter : str Column delimiter string comment : str Regular expression defining a comment line in table quotechar : str One-character string to quote fields containing special characters header_start : int Line index for the header line not counting comment or blank lines. A line with only whitespace is considered blank. data_start : int Line index for the start of data not counting comment or blank lines. A line with only whitespace is considered blank. data_end : int Line index for the end of data not counting comment or blank lines. This value can be negative to count from the end. converters : dict Dictionary of converters data_Splitter : `~astropy.io.ascii.BaseSplitter` Splitter class to split data columns header_Splitter : `~astropy.io.ascii.BaseSplitter` Splitter class to split header columns names : list List of names corresponding to each data column include_names : list List of names to include in output. exclude_names : list List of names to exclude from output (applied after ``include_names``) fill_values : dict specification of fill values for bad or missing table values fill_include_names : list List of names to include in fill_values. fill_exclude_names : list List of names to exclude from fill_values (applied after ``fill_include_names``) fast_reader : bool or dict Whether to use the C engine, can also be a dict with options which defaults to `False`; parameters for options dict: use_fast_converter: bool enable faster but slightly imprecise floating point conversion method parallel: bool or int multiprocessing conversion using ``cpu_count()`` or ``'number'`` processes exponent_style: str One-character string defining the exponent or ``'Fortran'`` to auto-detect Fortran-style scientific notation like ``'3.14159D+00'`` (``'E'``, ``'D'``, ``'Q'``), all case-insensitive; default ``'E'``, all other imply ``use_fast_converter`` chunk_size : int If supplied with a value > 0 then read the table in chunks of approximately ``chunk_size`` bytes. Default is reading table in one pass. chunk_generator : bool If True and ``chunk_size > 0`` then return an iterator that returns a table for each chunk. The default is to return a single stacked table for all the chunks. encoding : str Allow to specify encoding to read the file (default= ``None``). Returns ------- dat : `~astropy.table.Table` OR <generator> Output table """ WRITE_DOCSTRING = """ Write the input ``table`` to ``filename``. Most of the default behavior for various parameters is determined by the Writer class. See also: - http://docs.astropy.org/en/stable/io/ascii/ - http://docs.astropy.org/en/stable/io/ascii/write.html Parameters ---------- table : `~astropy.io.ascii.BaseReader`, array_like, str, file_like, list Input table as a Reader object, Numpy struct array, file name, file-like object, list of strings, or single newline-separated string. output : str, file_like Output [filename, file-like object]. Defaults to``sys.stdout``. format : str Output table format. Defaults to 'basic'. delimiter : str Column delimiter string comment : str String defining a comment line in table quotechar : str One-character string to quote fields containing special characters formats : dict Dictionary of format specifiers or formatting functions strip_whitespace : bool Strip surrounding whitespace from column values. names : list List of names corresponding to each data column include_names : list List of names to include in output. exclude_names : list List of names to exclude from output (applied after ``include_names``) fast_writer : bool Whether to use the fast Cython writer. overwrite : bool If ``overwrite=None`` (default) and the file exists, then a warning will be issued. In a future release this will instead generate an exception. If ``overwrite=False`` and the file exists, then an exception is raised. This parameter is ignored when the ``output`` arg is not a string (e.g., a file object). """
# -*- coding: utf-8 -*- """ Internal exceptions =================== """ class NotRegisteredError(KeyError): pass class UnknowConfigError(KeyError): pass class UnknowModeError(KeyError): pass class UnknowThemeError(KeyError): pass class CodeMirrorFieldBundleError(KeyError): pass
numero=('Zero','Um','Dois','Três','Quatro','Cinco','Seis','Sete','Oito','Nove','Dez','Onze','Doze','Treze','Quatorze','Quinze','Dezesseis','Dezessete','Dezoito','Dezenove','Vinte') while True: num= int(input('Digite um numero ente 0 e 20: ')) if 0<=num<=20: break print('tente novamente. ', end='') print(f'O número {num} por extenso é {numero[num]}') #num=int(input('Digite um número: ')) #while num>20 or num<0: #num=int(input('Digite um número')) #if num>=0 and num<=20: #print(f'O número {num} por extenso é {numero[num]}') #outro modo
pod_examples = [ dict( apiVersion='v1', kind='Pod', metadata=dict( name='good', namespace='default' ), spec=dict( serviceAccountName='default' ) ), dict( apiVersion='v1', kind='Pod', metadata=dict( name='bad', namespace='default' ), spec=dict( serviceAccountName='bad' ) ), dict( apiVersion='v1', kind='Pod', metadata=dict( name='raise', namespace='default' ), spec=dict( serviceAccountName='bad' ) ) ]
###################################################################### # # Copyright (C) 2013 # Associated Universities, Inc. Washington DC, USA, # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Library General Public License as published by # the Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This library is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public # License for more details. # # You should have received a copy of the GNU Library General Public License # along with this library; if not, write to the Free Software Foundation, # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. # # Correspondence concerning VLA Pipelines should be addressed as follows: # Please register and submit helpdesk tickets via: https://help.nrao.edu # Postal address: # National Radio Astronomy Observatory # VLA Pipeline Support Office # PO Box O # Socorro, NM, USA # ###################################################################### # Version that removes rflagging for spectral line data # CHECKING FLAGGING OF ALL CALIBRATED DATA, INCLUDING TARGET # use rflag mode of flagdata logprint("Starting EVLA_pipe_targetflag_lines.py", logfileout='logs/targetflag.log') time_list = runtiming('checkflag', 'start') QA2_targetflag = 'Pass' logprint("Checking RFI flagging of all targets", logfileout='logs/targetflag.log') # Run on all calibrator scans default('flagdata') vis = ms_active mode = 'rflag' field = '' correlation = 'ABS_' + corrstring scan = '' intent = '*CALIBRATE*' ntime = 'scan' combinescans = False datacolumn = 'corrected' winsize = 3 timedevscale = 4.0 freqdevscale = 4.0 extendflags = False action = 'apply' display = '' flagbackup = True savepars = True flagdata() # clearstat() # Save final version of flags default('flagmanager') vis = ms_active mode = 'save' versionname = 'finalflags' comment = 'Final flags saved after calibrations and rflag' merge = 'replace' flagmanager() logprint("Flag column saved to " + versionname, logfileout='logs/targetflag.log') # calculate final flag statistics default('flagdata') vis = ms_active mode = 'summary' spwchan = True spwcorr = True basecnt = True action = 'calculate' savepars = False final_flags = flagdata() frac_flagged_on_source2 = 1.0 - \ ((start_total - final_flags['flagged']) / init_on_source_vis) logprint("Final fraction of on-source data flagged = " + str(frac_flagged_on_source2), logfileout='logs/targetflag.log') if (frac_flagged_on_source2 >= 0.6): QA2_targetflag = 'Fail' logprint("QA2 score: " + QA2_targetflag, logfileout='logs/targetflag.log') logprint("Finished EVLA_pipe_targetflag_lines.py", logfileout='logs/targetflag.log') time_list = runtiming('targetflag', 'end') pipeline_save() ######################################################################
regularServingPancakes = 24 cupsOfFlourrPer24Pancakes = 4.5 noOfEggsPer24Pancakes = 4 litresOfMilkPer24Pancakes = 1 noOfPancakes = float(input("How many pancakes do you want to make: ")) expectedCupsOfFlour = ( noOfPancakes / regularServingPancakes ) * \ cupsOfFlourrPer24Pancakes expectedNoOfEggs = ( noOfPancakes / regularServingPancakes ) * \ noOfEggsPer24Pancakes expectedLitresOfMilk = ( noOfPancakes / regularServingPancakes ) * \ litresOfMilkPer24Pancakes print ( "For " + str(noOfPancakes ) + " you will need " + \ str( expectedCupsOfFlour ) + " cups of flour " + \ str( expectedNoOfEggs ) + " eggs " + \ str( expectedLitresOfMilk ) + " litres of milk" )
def generated_per_next_split(max_day): # generate a table saying how many lanternfish result from a lanternfish # which next split is on a given day table = {} for i in range(max_day+10, 0, -1): table[i] = 1 if i >= max_day else (table[i+7] + table[i+9]) return table def solve(next_splits, max_day): table = generated_per_next_split(max_day) return sum([table[next_split] for next_split in next_splits]) def parse(input_path): with open(input_path, 'r') as f: return list(map(int, f.readline().split(','))) if __name__ == "__main__": parsed = parse("data.txt") print('Part 1 :', solve(parsed, 80)) print('Part 2 :', solve(parsed, 256))
n = int(input()) xs = [] ys = [] numToPosX = dict() numToPosY = dict() for i in range(n): x, y = list(map(float, input().split())) numToPosX.setdefault(x, i) numToPosY.setdefault(y, i) xs.append(x) ys.append(y) xs.sort() ys.sort() resX = [0] * n resY = [0] * n for i in range(n): resX[numToPosX[xs[i]]] = i resY[numToPosY[ys[i]]] = i print(format(1.0 - 6.0 * sum(map(lambda x: (x[0] - x[1]) ** 2, zip(resX, resY)))/(n ** 3 - n), ".9f"))
def setup(): size(400,400) stroke(225) background(192, 64, 0) def draw(): line(200, 200, mouseX, mouseY) def mousePressed(): saveFrame("Output.png")
class random: def __init__(self, animaltype, name, canfly): self.animaltype = animaltype self.name = name self.fly = canfly def getanimaltype(self): return self.animaltype def getobjects(self): print('{} {} {}'.format(self.animaltype, self.name, self.fly)) ok = random('bird', 'penguin', 'no').getobjects()
class ValidationResult: def __init__(self, is_success, error_message=None): self.is_success = is_success self.error_message = error_message @classmethod def success(cls): return cls(True) @classmethod def error(cls, error_message): return cls(False, error_message) print(ValidationResult(True).__dict__) print(ValidationResult(False, "Some error").__dict__) print(ValidationResult.success().__dict__) print(ValidationResult.error('Another error').__dict__) class Pizza: def __init__(self, ingredients): self.ingredients = ['bread'] + ingredients @classmethod def pepperoni(cls): return cls(['tomato sauce', 'parmesan', 'pepperoni']) class ItalianPizza(Pizza): def __init__(self, ingredients): super().__init__(ingredients) self.ingredients = ['italian bread'] + ingredients print(Pizza.pepperoni().__dict__) print(Pizza(['tomato sauce', 'parmesan', 'pepperoni']).__dict__) print(ItalianPizza.pepperoni().__dict__)
def eval_chunk_size(rm): chunks = [] chunk_size = 0 for row in range(rm.max_row): for col in range(rm.max_col): if (rm.seats[row][col] == None or rm.seats[row][col].sid == -1) and chunk_size > 0: chunks.append(chunk_size) chunk_size = 0 else: chunk_size += 1 if chunk_size > 0: chunks.append(chunk_size) chunk_size = 0 score = sum(chunks) / len(chunks) # Remove decimals past 2 sigfigs score *= 100 score = round(score) / 100 print(score)
# # @lc app=leetcode id=9 lang=python3 # # [9] Palindrome Number # # https://leetcode.com/problems/palindrome-number/description/ # # algorithms # Easy (47.28%) # Total Accepted: 943.6K # Total Submissions: 2M # Testcase Example: '121' # # Determine whether an integer is a palindrome. An integer is a palindrome when # it reads the same backward as forward. # # Example 1: # # # Input: 121 # Output: true # # # Example 2: # # # Input: -121 # Output: false # Explanation: From left to right, it reads -121. From right to left, it # becomes 121-. Therefore it is not a palindrome. # # # Example 3: # # # Input: 10 # Output: false # Explanation: Reads 01 from right to left. Therefore it is not a palindrome. # # # Follow up: # # Coud you solve it without converting the integer to a string? # # class Solution: def isPalindrome(self, x: int) -> bool: if x < 0: return False mirror = 0 origin = x while x > 0: mirror = x % 10 + mirror * 10 x = x // 10 return mirror == origin
class Circle: def __init__(self,d): self.diameter=d self.__pi=3.14 def calculate_circumference(self): c=self.__pi*self.diameter return c def calculate_area(self): r=self.diameter/2 return self.__pi*(r*r) def calculate_area_of_sector(self,angle): c=self.calculate_circumference(); r=self.diameter/2 a=(angle*c)/360 sectorS=(r/2)*a return sectorS #test circle1=Circle(10) print(f"{circle1.calculate_circumference():.2f}\n{circle1.calculate_area():.2f}\n{circle1.calculate_area_of_sector(5):.2f}")
# Aqui tu funcion def palindromos(lista): return [string for string in lista if ''.join(string.lower().split()) == ''.join(string.lower()[::-1].split())] # Lo puedes probar con esta lista lista = [ "Añora la Roña", "Como que moc", "Anita lava la tina", "Eva ya hay ave", "Yo no maldigo mi suerte porque minero naci" ] print(palindromos(lista))
# cxd class Solution: def threeSumClosest(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ nums.sort() ret = nums[0] + nums[1] + nums[-1] value = abs(nums[0] + nums[1] + nums[-1] - target) i = 0 while i < len(nums)-2: k = len(nums)-1 j = i+1 while j < k: if abs(nums[i] + nums[j] + nums[k] - target) < value: ret = nums[i] + nums[j] + nums[k] value = abs(nums[i] + nums[j] + nums[k] - target) if nums[i] + nums[j] + nums[k] - target > 0: k -= 1 elif nums[i] + nums[j] + nums[k] - target < 0: j += 1 else: # value = 0 return nums[i] + nums[j] + nums[k] i += 1 while i < len(nums)-2 and nums[i] == nums[i-1]: i += 1 return ret # lmf class Solution(object): def threeSumClosest(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ if not nums: return 0 nums.sort() res = 2**32 - 1 for i in range(len(nums)-2): j = i + 1 k = len(nums) - 1 while j < k: sum = nums[i] + nums[j] + nums[k] if sum == target: return target elif sum > target: k -= 1 else: j += 1 res = sum if abs(sum - target) < abs(res - target) else res return res s = Solution() nums = [-1, 2, 1, -4] target = 1 print(s.threeSumClosest(nums, target))
class Solution: def coinChange(self, coins: List[int], amount: int) -> int: amounts = [float('inf')] * (amount + 1) amounts[0] = 0 for coin in coins: for amt in range(coin, amount + 1): amounts[amt] = min(amounts[amt], amounts[amt - coin] + 1) if amounts[amount] == float('inf'): return -1 return amounts[amount]
""" Lottery module """ class Astro: """ Create an Astro ticket """ def __init__(self): """ Initialize Astro ticket """ self.name = "Astro"
""" Tests if nose can see the test directory """ def test_true(): assert True
""" This script contains some global variables that are used throughout this specific dataset. """ # Dataset file names raw_input_file_all = '/home/travail/datasets/urban_tracker/sherbrooke/sherbrooke_annotations/sherbrooke_gt.sqlite' input_raw_image_frame_path = '/home/travail/datasets/urban_tracker/sherbrooke/sherbrooke_frames/' raw_input_file_peds = raw_input_file_all[:raw_input_file_all.rfind('.')] + '_pedestrians.sqlite' raw_input_file_cars = raw_input_file_all[:raw_input_file_all.rfind('.')] + '_cars.sqlite' raw_input_file_names = [raw_input_file_peds, raw_input_file_cars] raw_input_file_all_2 = 'C:/Users/panka/PyCharmProjects/Dataset/sherbrooke_annotations/sherbrooke_annotations/sherbrooke_gt.sqlite' input_raw_image_frame_path_2 = 'C:/Users/panka/PyCharmProjects/Dataset/sherbrooke_frames/sherbrooke_frames/' raw_input_file_peds_2 = raw_input_file_all_2[:raw_input_file_all_2.rfind('.')] + '_pedestrians.sqlite' raw_input_file_cars_2 = raw_input_file_all_2[:raw_input_file_all_2.rfind('.')] + '_cars.sqlite' raw_input_file_names_2 = [raw_input_file_peds_2, raw_input_file_cars_2] # Used for generating velocities video_data_fps = 30 best_deep_ae_model = 58
if __name__ == "__main__": s = 'A\tB\tC' print(len(s)) print(ord('\n')) s = 'A\0B\0C' print(len(s)) print(s) print('-' * 50) msg = """ aaaaaaaaa bbbbbb''''bbbbb ccccccc """ print(msg)
def partial_async_gen(f, *args): """ Returns an async generator function which is equalivalent to the passed in function, but only takes in one parameter (the first one). """ async def inner(first_param): async for x in f(first_param, *args): yield x return inner def partial_async(f, *args): """ Returns an async function which is equalivalent to the passed in function, but only takes in one parameter (the first one). """ async def inner(first_param): return await f(first_param, *args) return inner
names = ["Katya", "Max", "Oleksii", "Olesya", "Oleh", "Yaroslav", "Anastasiia"] age = [25, 54, 18, 23, 45, 21, 21] isPaid = [True, False, True, True, False, True, False] namesFromDatabaseClear = names.index("Max") ageMax = age[namesFromDatabaseClear] print(ageMax)
# -*- coding: utf-8 -*- SEXO = ( ('F', 'Feminino'), ('M', 'Masculino'), )
"""Exports Standard Interface Template boundary conditions.""" # 1. Standard python modules # 2. Third party modules # 3. Aquaveo modules # 4. Local modules __copyright__ = "(C) Copyright Aquaveo 2020" __license__ = "All rights reserved" class BoundaryConditionsWriter: """A class for writing out boundary condition data for the Standard Interface Template.""" def __init__(self, file_name, arc_to_ids, arc_points, bc_component): """ Constructor. Args: file_name (str): The name of the file to write. arc_to_ids (dict): The arc to component id of the boundary conditions component. arc_points (dict): The arc to node ids of the grid. bc_component (BoundaryCoverageComponent): The boundary conditions data to export. """ self._file_name = file_name self._data = bc_component self._arc_to_component_id = arc_to_ids self._arc_to_node_ids = arc_points def write(self): """Write the simulation file.""" with open(self._file_name, 'w') as file: file.write('###This is a boundary conditions file for Standard Interface Template.###\n') df = self._data.data.coverage_data.to_dataframe() for arc, component_id in self._arc_to_component_id.items(): df_row = df.loc[df['comp_id'] == component_id] if df_row.empty: # Write default values. file.write(f'BC {arc} A "Hello World!"\n') else: # Write values. file.write(f'BC {arc} {df_row.user_option[0]} "{df_row.user_text[0]}"\n') file.write('Points:') if arc in self._arc_to_node_ids: for node in self._arc_to_node_ids[arc]: file.write(f' {node + 1}') file.write('\n')
"""This package contains modules for working with Fireplace devices.""" __all__ = ( "fireplace", "fireplace_device", "fireplace_light_exception", "fireplace_pilot_light_event", "fireplace_state", "fireplace_state_change_event", "fireplace_timeout_event" )
""" Instruction names """ POP_TOP = 'POP_TOP' ROT_TWO = 'ROT_TWO' ROT_THREE = 'ROT_THREE' DUP_TOP = 'DUP_TOP' DUP_TOP_TWO = 'DUP_TOP_TWO' NOP = 'NOP' UNARY_POSITIVE = 'UNARY_POSITIVE' UNARY_NEGATIVE = 'UNARY_NEGATIVE' UNARY_NOT = 'UNARY_NOT' UNARY_INVERT = 'UNARY_INVERT' BINARY_MATRIX_MULTIPLY = 'BINARY_MATRIX_MULTIPLY' INPLACE_MATRIX_MULTIPLY = 'INPLACE_MATRIX_MULTIPLY' BINARY_POWER = 'BINARY_POWER' BINARY_MULTIPLY = 'BINARY_MULTIPLY' BINARY_MODULO = 'BINARY_MODULO' BINARY_ADD = 'BINARY_ADD' BINARY_SUBTRACT = 'BINARY_SUBTRACT' BINARY_SUBSCR = 'BINARY_SUBSCR' BINARY_FLOOR_DIVIDE = 'BINARY_FLOOR_DIVIDE' BINARY_TRUE_DIVIDE = 'BINARY_TRUE_DIVIDE' INPLACE_FLOOR_DIVIDE = 'INPLACE_FLOOR_DIVIDE' INPLACE_TRUE_DIVIDE = 'INPLACE_TRUE_DIVIDE' GET_AITER = 'GET_AITER' GET_ANEXT = 'GET_ANEXT' BEFORE_ASYNC_WITH = 'BEFORE_ASYNC_WITH' INPLACE_ADD = 'INPLACE_ADD' INPLACE_SUBTRACT = 'INPLACE_SUBTRACT' INPLACE_MULTIPLY = 'INPLACE_MULTIPLY' INPLACE_MODULO = 'INPLACE_MODULO' STORE_SUBSCR = 'STORE_SUBSCR' DELETE_SUBSCR = 'DELETE_SUBSCR' BINARY_LSHIFT = 'BINARY_LSHIFT' BINARY_RSHIFT = 'BINARY_RSHIFT' BINARY_AND = 'BINARY_AND' BINARY_XOR = 'BINARY_XOR' BINARY_OR = 'BINARY_OR' INPLACE_POWER = 'INPLACE_POWER' GET_ITER = 'GET_ITER' GET_YIELD_FROM_ITER = 'GET_YIELD_FROM_ITER' PRINT_EXPR = 'PRINT_EXPR' LOAD_BUILD_CLASS = 'LOAD_BUILD_CLASS' YIELD_FROM = 'YIELD_FROM' GET_AWAITABLE = 'GET_AWAITABLE' INPLACE_LSHIFT = 'INPLACE_LSHIFT' INPLACE_RSHIFT = 'INPLACE_RSHIFT' INPLACE_AND = 'INPLACE_AND' INPLACE_XOR = 'INPLACE_XOR' INPLACE_OR = 'INPLACE_OR' BREAK_LOOP = 'BREAK_LOOP' WITH_CLEANUP_START = 'WITH_CLEANUP_START' WITH_CLEANUP_FINISH = 'WITH_CLEANUP_FINISH' RETURN_VALUE = 'RETURN_VALUE' IMPORT_STAR = 'IMPORT_STAR' SETUP_ANNOTATIONS = 'SETUP_ANNOTATIONS' YIELD_VALUE = 'YIELD_VALUE' POP_BLOCK = 'POP_BLOCK' END_FINALLY = 'END_FINALLY' POP_EXCEPT = 'POP_EXCEPT' STORE_NAME = 'STORE_NAME' DELETE_NAME = 'DELETE_NAME' UNPACK_SEQUENCE = 'UNPACK_SEQUENCE' FOR_ITER = 'FOR_ITER' UNPACK_EX = 'UNPACK_EX' STORE_ATTR = 'STORE_ATTR' DELETE_ATTR = 'DELETE_ATTR' STORE_GLOBAL = 'STORE_GLOBAL' DELETE_GLOBAL = 'DELETE_GLOBAL' LOAD_CONST = 'LOAD_CONST' LOAD_NAME = 'LOAD_NAME' BUILD_TUPLE = 'BUILD_TUPLE' BUILD_LIST = 'BUILD_LIST' BUILD_SET = 'BUILD_SET' BUILD_MAP = 'BUILD_MAP' LOAD_ATTR = 'LOAD_ATTR' COMPARE_OP = 'COMPARE_OP' IMPORT_NAME = 'IMPORT_NAME' IMPORT_FROM = 'IMPORT_FROM' JUMP_FORWARD = 'JUMP_FORWARD' JUMP_IF_FALSE_OR_POP = 'JUMP_IF_FALSE_OR_POP' JUMP_IF_TRUE_OR_POP = 'JUMP_IF_TRUE_OR_POP' JUMP_ABSOLUTE = 'JUMP_ABSOLUTE' POP_JUMP_IF_FALSE = 'POP_JUMP_IF_FALSE' POP_JUMP_IF_TRUE = 'POP_JUMP_IF_TRUE' LOAD_GLOBAL = 'LOAD_GLOBAL' CONTINUE_LOOP = 'CONTINUE_LOOP' SETUP_LOOP = 'SETUP_LOOP' SETUP_EXCEPT = 'SETUP_EXCEPT' SETUP_FINALLY = 'SETUP_FINALLY' LOAD_FAST = 'LOAD_FAST' STORE_FAST = 'STORE_FAST' DELETE_FAST = 'DELETE_FAST' RAISE_VARARGS = 'RAISE_VARARGS' CALL_FUNCTION = 'CALL_FUNCTION' MAKE_FUNCTION = 'MAKE_FUNCTION' MAKE_CLOSURE = 'MAKE_CLOSURE' BUILD_SLICE = 'BUILD_SLICE' LOAD_CLOSURE = 'LOAD_CLOSURE' LOAD_DEREF = 'LOAD_DEREF' STORE_DEREF = 'STORE_DEREF' DELETE_DEREF = 'DELETE_DEREF' CALL_FUNCTION_KW = 'CALL_FUNCTION_KW' CALL_FUNCTION_EX = 'CALL_FUNCTION_EX' SETUP_WITH = 'SETUP_WITH' LIST_APPEND = 'LIST_APPEND' SET_ADD = 'SET_ADD' MAP_ADD = 'MAP_ADD' LOAD_CLASSDEREF = 'LOAD_CLASSDEREF' EXTENDED_ARG = 'EXTENDED_ARG' BUILD_LIST_UNPACK = 'BUILD_LIST_UNPACK' BUILD_MAP_UNPACK = 'BUILD_MAP_UNPACK' BUILD_MAP_UNPACK_WITH_CALL = 'BUILD_MAP_UNPACK_WITH_CALL' BUILD_TUPLE_UNPACK = 'BUILD_TUPLE_UNPACK' BUILD_SET_UNPACK = 'BUILD_SET_UNPACK' SETUP_ASYNC_WITH = 'SETUP_ASYNC_WITH' FORMAT_VALUE = 'FORMAT_VALUE' BUILD_CONST_KEY_MAP = 'BUILD_CONST_KEY_MAP' BUILD_STRING = 'BUILD_STRING' BUILD_TUPLE_UNPACK_WITH_CALL = 'BUILD_TUPLE_UNPACK_WITH_CALL' LOAD_METHOD = 'LOAD_METHOD' CALL_METHOD = 'CALL_METHOD'
h = float(input("Entre com a altura da pessoa: ")) pH = (72.7 * h) - 58 pM = (62.1 * h) - 44.7 print(f"O peso ideal de uma pessoa de {h}m é {pH:.0f}kg se for homem e {pM:.0f}kg se for mulher")
cats_path = "python_crash_course/exceptions/cats.txt" dogs_path = "python_crash_course/exceptions/dogs.txt" try: with open(cats_path) as file_object: cats = file_object.read() print("Koty:") print(cats) except FileNotFoundError: pass try: with open(dogs_path) as file_object: dogs = file_object.read() print("\nPsy:") print(dogs) except FileNotFoundError: pass
def has_unique_chars(string: str) -> bool: if len(string) == 1: return True unique = [] for item in string: if item not in unique: unique.append(item) else: return False return True
# # PySNMP MIB module ChrComPmSonetSNT-PFE-Interval-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ChrComPmSonetSNT-PFE-Interval-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:20:44 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint") chrComIfifIndex, = mibBuilder.importSymbols("ChrComIfifTable-MIB", "chrComIfifIndex") TruthValue, = mibBuilder.importSymbols("ChrTyp-MIB", "TruthValue") chrComPmSonet, = mibBuilder.importSymbols("Chromatis-MIB", "chrComPmSonet") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") TimeTicks, Bits, Gauge32, ModuleIdentity, iso, MibIdentifier, Counter64, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, Counter32, IpAddress, Integer32, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Bits", "Gauge32", "ModuleIdentity", "iso", "MibIdentifier", "Counter64", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "Counter32", "IpAddress", "Integer32", "ObjectIdentity") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") chrComPmSonetSNT_PFE_IntervalTable = MibTable((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14), ).setLabel("chrComPmSonetSNT-PFE-IntervalTable") if mibBuilder.loadTexts: chrComPmSonetSNT_PFE_IntervalTable.setStatus('current') chrComPmSonetSNT_PFE_IntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14, 1), ).setLabel("chrComPmSonetSNT-PFE-IntervalEntry").setIndexNames((0, "ChrComIfifTable-MIB", "chrComIfifIndex"), (0, "ChrComPmSonetSNT-PFE-Interval-MIB", "chrComPmSonetIntervalNumber")) if mibBuilder.loadTexts: chrComPmSonetSNT_PFE_IntervalEntry.setStatus('current') chrComPmSonetIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: chrComPmSonetIntervalNumber.setStatus('current') chrComPmSonetSuspectedInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14, 1, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: chrComPmSonetSuspectedInterval.setStatus('current') chrComPmSonetElapsedTime = MibTableColumn((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: chrComPmSonetElapsedTime.setStatus('current') chrComPmSonetSuppressedIntrvls = MibTableColumn((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14, 1, 4), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: chrComPmSonetSuppressedIntrvls.setStatus('current') chrComPmSonetES = MibTableColumn((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14, 1, 5), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: chrComPmSonetES.setStatus('current') chrComPmSonetSES = MibTableColumn((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14, 1, 6), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: chrComPmSonetSES.setStatus('current') chrComPmSonetCV = MibTableColumn((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14, 1, 7), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: chrComPmSonetCV.setStatus('current') chrComPmSonetUAS = MibTableColumn((1, 3, 6, 1, 4, 1, 3695, 1, 10, 2, 14, 1, 8), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: chrComPmSonetUAS.setStatus('current') mibBuilder.exportSymbols("ChrComPmSonetSNT-PFE-Interval-MIB", chrComPmSonetCV=chrComPmSonetCV, chrComPmSonetElapsedTime=chrComPmSonetElapsedTime, chrComPmSonetUAS=chrComPmSonetUAS, chrComPmSonetES=chrComPmSonetES, chrComPmSonetSuspectedInterval=chrComPmSonetSuspectedInterval, chrComPmSonetSNT_PFE_IntervalTable=chrComPmSonetSNT_PFE_IntervalTable, chrComPmSonetSNT_PFE_IntervalEntry=chrComPmSonetSNT_PFE_IntervalEntry, chrComPmSonetSES=chrComPmSonetSES, chrComPmSonetIntervalNumber=chrComPmSonetIntervalNumber, chrComPmSonetSuppressedIntrvls=chrComPmSonetSuppressedIntrvls)
DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'local_database.db', 'TEST_NAME': ':memory:', } } SECRET_KEY = '9(-c^&tzdv(d-*x$cefm2pddz=0!_*8iu*i8fh+krpa!5ebk)+' ROOT_URLCONF = 'test_project.urls' TEMPLATE_DIRS = ( 'templates', ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'formwizard', 'testapp', 'testapp2', ) #TEST_RUNNER = 'django-test-coverage.runner.run_tests'
class Course: def __init__(self, link, code, title, credits, campus, dept, year, semester, semester_code, faculty, courselvl, description, prereq, coreq, exclusion, breadth, apsc, flags): self.link = link.strip() self.code = code.strip() self.title = title.strip() self.credits = credits.strip() self.campus = campus.strip() self.dept = dept.strip() self.year = year.strip() self.semester = semester.strip() self.semester_code = semester_code.strip() self.faculty = faculty.strip() self.courselvl = courselvl.strip() self.description = description.strip() self.prereq = prereq.strip() self.coreq = coreq.strip() self.exclusion = exclusion.strip() self.breadth = breadth.strip() self.apsc = apsc.strip() self.flags = flags def __repr__(self): return '\nLink: ' + self.link + '\nCode: ' + self.code + '\nTitle: ' + self.title + '\nCredits: ' + self.credits + '\nCampus: ' + self.campus + '\nDepartment: ' + self.dept + '\nYear: ' + self.year + '\nSemester: ' + self.semester + '\nSemester code: ' + self.semester_code + '\nFaculty: ' + self.faculty + '\nCourse level: ' + self.courselvl + '\nDescription: ' + self.description + '\nPre-requisites: ' + self.prereq + '\nCo-requisites: ' + self.coreq + '\nExclusion: ' + self.exclusion + '\nBreadth: ' + self.breadth + '\nAPSC electives: ' + self.apsc + '\nFlags: ' + str(self.flags)
# Generates comments with the specified indentation and wrapping-length def generateComment(comment, length=100, indentation=""): out = "" for commentChunk in [ comment[i : i + length] for i in range(0, len(comment), length) ]: out += indentation + "// " + commentChunk + "\n" return out # Generates C++ pointer data references from an XML element def getDataReference(element, root): for parent in root.iter(): # Check to make sure parent is actually a parent of element if element in parent: return getDataReference(parent, root) + "->" + element.attrib["id"] return root.attrib["id"] def capitalize(string): return string.capitalize()[0] + string[1:] def getMutexReference(struct, root): return getDataReference(struct, root) + "->" + struct.attrib["id"] + "Mutex" def getGetReference(struct, field): return "get" + capitalize(struct.attrib["id"]) + capitalize(field.attrib["id"]) def getSetReference(struct, field): return "set" + capitalize(struct.attrib["id"]) + capitalize(field.attrib["id"])
"""Error definitions.""" class VictimsDBError(Exception): """Generic VictimsDB error.""" class ParseError(VictimsDBError): """Error parsing YAML files."""
# Copyright (c) 2021, NakaMetPy Develoers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause # # Original source lisence: # Copyright (c) 2008,2015,2016,2018 MetPy Developers. # # kinematics g0 = 9.81 # 重力加速度 m/s**2 g = g0 g_acceralation = g0 # 重力加速度 m/s**2 Re = 6371.229 * 1000 # m P0 = 100000 # Pa PI = 3.141592653589793 Omega = 7.2921159 * 1E-5 # thermodynamics sat_pressure_0c = 611.2 # units : Pa R = 287 # J/K Cp = 1004 # J/K kappa = R / Cp epsilone = 0.622 # (水:18/乾燥空気:28.8) LatHeatC = 2.5*10**6 # J/kg f0 = 1E-4 GammaD = g/Cp Kelvin = 273.15 Tabs = Kelvin GasC = R
# -*- coding: utf-8 -*- class Solution: def exist(self, board, word): visited = set() for i in range(len(board)): for j in range(len(board[0])): if self.startsHere(board, word, visited, 0, i, j): return True return False def startsHere(self, board, word, visited, current, i, j): if current == len(word): return True out_of_bounds = i < 0 or i >= len(board) or j < 0 or j >= len(board[0]) if out_of_bounds: return False already_visited = (i, j) in visited wrong_current_letter = board[i][j] != word[current] if already_visited or wrong_current_letter: return False visited.add((i, j)) result = ( self.startsHere(board, word, visited, current + 1, i - 1, j) or self.startsHere(board, word, visited, current + 1, i, j - 1) or self.startsHere(board, word, visited, current + 1, i + 1, j) or self.startsHere(board, word, visited, current + 1, i, j + 1) ) visited.remove((i, j)) return result if __name__ == '__main__': solution = Solution() assert solution.exist([ ['A', 'B', 'C', 'E'], ['S', 'F', 'C', 'S'], ['A', 'D', 'E', 'E'], ], 'ABCCED') assert solution.exist([ ['A', 'B', 'C', 'E'], ['S', 'F', 'C', 'S'], ['A', 'D', 'E', 'E'], ], 'SEE') assert not solution.exist([ ['A', 'B', 'C', 'E'], ['S', 'F', 'C', 'S'], ['A', 'D', 'E', 'E'], ], 'ABCB')
""" 1. Clarification 2. Possible solutions - Brute force - HashSet 3. Coding 4. Tests """ # # T=O(mn), S=O(1) # class Solution: # def numJewelsInStones(self, jewels: str, stones: str) -> int: # return sum(s in jewels for s in stones) # T=O(m+n), S=O(m) class Solution: def numJewelsInStones(self, jewels: str, stones: str) -> int: jewelsSet = set(jewels) return sum(s in jewelsSet for s in stones)
#------------------------------------------------------------------------------- # Name: Removing duplicates # Purpose: # # Author: Ben Jones # # Created: 03/02/2022 # Copyright: (c) Ben Jones 2022 #------------------------------------------------------------------------------- new_menu = ['Hawaiian', 'Margherita', 'Mushroom', 'Prosciutto', 'Meat Feast', 'Hawaiian', 'Bacon', 'Black Olive Special', 'Sausage', 'Sausage'] final_new_menu = list(dict.fromkeys(new_menu)) print(final_new_menu)
''' Created on Aug 9, 2018 @author: david avalos ''' boolean = True while boolean: operacion = input("Qué operación desea realizar?\n1.Suma\n2.Resta\n3.Multiplicación\n4.División\n5.Salir\n\n->") if operacion == "5": break try: if int(operacion) > 5: print("La opción seleccionada no es válida. Intente de nuevo.\n") continue except: print("ups! La opción que eleigió no es un número entero! Intente de nuevo!\n") continue a = input("Escriba un número entero 'a' -> ") b = input("Escriba un número entero 'b' -> ") if operacion == "1": suma = int(a) + int(b) print("\nLa suma de " + a + " + " + b + " es: ", str(suma),"\n") elif operacion == "2": resta = int(a) - int(b) print("\nLa resta de " + a + " - " + b + " es: ", str(resta),"\n") elif operacion == "3": multiplicacion = int(a) * int(b) print("\nLa multiplicación de " + a + " * " + b + " es: ", str(multiplicacion),"\n") elif operacion == "4": division = int(a) / int(b) print("\nLa multiplicación de " + a + " * " + b + " es: ", str(division),"\n") print("\nFin")
word_size = 8 num_words = 256 num_banks = 1 tech_name = "freepdk45" process_corners = ["TT"] supply_voltages = [1.0] temperatures = [25]
# Definition for a binary tree node. # class Node(object): # def __init__(self, val=" ", left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def checkEquivalence(self, root1: 'Node', root2: 'Node') -> bool: def post_order(node): ans = collections.Counter() if node is None: return ans if node.left is None and node.right is None: ans[node.val] += 1 else: l = post_order(node.left) r = post_order(node.right) for val, cnt in l.items(): ans[val] += cnt for val, cnt in r.items(): ans[val] += cnt return ans r1 = post_order(root1) r2 = post_order(root2) return r1 == r2
# Panel settings: /project/<default>/api_access PANEL_DASHBOARD = 'project' PANEL_GROUP = 'default' PANEL = 'api_access' # The default _was_ "overview", but that gives 403s. # Make this the default in this dashboard. DEFAULT_PANEL = 'api_access'
""" Representing a single file in a commit @name name of file @loc lines of code in file @authors all authors of the file @nuc number of unique changes made to the file """ class CommitFile: def __init__(self, name, loc, authors, lastchanged, owner,co_commited_files,adev): self.name = name # File name self.loc = loc # LOC in file self.authors = authors # Array of authors self.lastchanged = lastchanged # unix time stamp of when last changed self.nuc = 1 self.owner = owner self.co_commited_files = co_commited_files self.adev = adev # number of unique changes to the file
# python stack using list # my_Stack = [10, 12, 13, 11, 33, 24, 56, 78, 13, 56, 31, 32, 33, 10, 15] # array # print(my_Stack) print(my_Stack.pop()) # think python simple just pop and push # print(my_Stack.pop()) print(my_Stack.pop()) print(my_Stack.pop())
dict = {'Name': 'Zara', 'Age': 7, 'Class': 'First'} del dict['Name'] # remove entry with key 'Name' dict.clear() # remove all entries in dict del dict # delete entire dictionary print ("dict['Age']: ", dict['Age']) print ("dict['School']: ", dict['School'])
''' URL: https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses/ Difficulty: Easy Description: Maximum Nesting Depth of the Parentheses A string is a valid parentheses string (denoted VPS) if it meets one of the following: It is an empty string "", or a single character not equal to "(" or ")", It can be written as AB (A concatenated with B), where A and B are VPS's, or It can be written as (A), where A is a VPS. We can similarly define the nesting depth depth(S) of any VPS S as follows: depth("") = 0 depth(C) = 0, where C is a string with a single character not equal to "(" or ")". depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's. depth("(" + A + ")") = 1 + depth(A), where A is a VPS. For example, "", "()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's. Given a VPS represented as string s, return the nesting depth of s. Example 1: Input: s = "(1+(2*3)+((8)/4))+1" Output: 3 Explanation: Digit 8 is inside of 3 nested parentheses in the string. Example 2: Input: s = "(1)+((2))+(((3)))" Output: 3 Example 3: Input: s = "1+(2*3)/(2-1)" Output: 1 Example 4: Input: s = "1" Output: 0 Constraints: 1 <= s.length <= 100 s consists of digits 0-9 and characters '+', '-', '*', '/', '(', and ')'. It is guaranteed that parentheses expression s is a VPS. ''' class Solution: def maxDepth(self, s): maxD = -float('inf') currD = 0 for ch in s: if ch not in ["(", ")"]: continue if ch == "(": currD += 1 else: maxD = max(maxD, currD) currD -= 1 return maxD if maxD != -float('inf') else currD
# example of except/from exception usage try: 1 / 0 except Exception as E: raise NameError('bad') from E """ Traceback (most recent call last): File "except_from.py", line 4, in <module> 1 / 0 ZeroDivisionError: division by zero The above exception was the direct cause of the following exception: Traceback (most recent call last): File "except_from.py", line 6, in <module> raise NameError('bad') from E NameError: bad """ # *implicit related exception # try: # 1 / 0 # except: # wrongname # NameError # raise <exceptionnsme> from None complitly stops relation of exception
# # PySNMP MIB module CISCO-EVC-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-EVC-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:57:43 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") SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "ValueSizeConstraint") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") CiscoCosList, = mibBuilder.importSymbols("CISCO-TC", "CiscoCosList") ifIndex, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "ifIndex", "InterfaceIndexOrZero") VlanId, VlanIdOrNone = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanId", "VlanIdOrNone") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") ObjectIdentity, Unsigned32, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, IpAddress, MibIdentifier, TimeTicks, Gauge32, iso, ModuleIdentity, NotificationType, Counter64, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "Unsigned32", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "IpAddress", "MibIdentifier", "TimeTicks", "Gauge32", "iso", "ModuleIdentity", "NotificationType", "Counter64", "Counter32") RowStatus, TruthValue, MacAddress, StorageType, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TruthValue", "MacAddress", "StorageType", "DisplayString", "TextualConvention") ciscoEvcMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 613)) ciscoEvcMIB.setRevisions(('2012-05-21 00:00', '2008-05-01 00:00', '2007-12-20 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoEvcMIB.setRevisionsDescriptions(('- Added following objects to cevcSITable: * cevcSICreationType * cevcSIType - Added following objects to cevcSIForwardBdTable: * cevcSIForwardBdNumberBase * cevcSIForwardBdNumber1kBitmap * cevcSIForwardBdNumber2kBitmap * cevcSIForwardBdNumber3kBitmap * cevcSIForwardBdNumber4kBitmap - Added MacSecurityViolation OID subtree and following objects: * cevcMacAddress * cevcMaxMacConfigLimit * cevcSIID - Deprecated cevcEvcNotificationGroup and added cevcEvcNotificationGroupRev1 and added cevcMacSecurityViolationNotification - Deprecated cevcSIGroup and added cevcSIGroupRev1 and added cevcSICreationType and cevcSIType - Deprecated cevcSIForwardGroup and added cevcSIForwardGroupRev1 and added the new objects mentioned in cevcSIForwardBdTable - Added CevcMacSecurityViolationCause Textual convention - Added new ciscoEvcMIBComplianceRev2', '- Added following enums to cevcSIOperStatus: * deleted(4) * errorDisabled(5) * unknown(6) - Added following named bits to cevcSIMatchEncapValid: * payloadTypes(3) * priorityCos(4) * dot1qNativeVlan(5) * dot1adNativeVlan(6) * encapExact(7) - The Object cevcSIMatchEncapPayloadType is replaced by new object cevcSIMatchEncapPayloadTypes to support multiple payload types for service instance match criteria. - Added new object cevcSIMatchEncapPriorityCos to cevcSIMatchEncapTable. - Added new Compliance ciscoEvcMIBComplianceRev1. - Added new Object Group cevcSIMatchCriteriaGroupRev1. - Miscellaneous updates/corrections.', 'Initial version of this MIB module.',)) if mibBuilder.loadTexts: ciscoEvcMIB.setLastUpdated('201205210000Z') if mibBuilder.loadTexts: ciscoEvcMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoEvcMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-ethermibs@cisco.com') if mibBuilder.loadTexts: ciscoEvcMIB.setDescription("Metro Ethernet services can support a wide range of applications and subscriber needs easily, efficiently and cost-effectively. Using standard Ethernet interfaces, subscribers can set up secure, private Ethernet Virtual Connections, to connect their sites together and connect to business partners, suppliers and the Internet. This MIB module defines the managed objects and notifications describing Ethernet Virtual Connections. Ethernet Virtual Connections (EVC), are defined by the Metro Ethernet Forum (MEF), as an association between two or more UNIs. Frames within an EVC can only be exchanged among the associated UNIs. Frames sent into the MEN via a particular UNI must not be delivered back to the UNI from which it originated. Along an EVC path, there are demarcation flow points on associated ingress and egress interface, of every device, through which the EVC passes. A service instance represents these flow points where a service passes through an interface. From an operational perspective, a service instance serves three purposes: 1. Defines the instance of a particular EVC service on a specific interface and identifies all frames that belongs to that particular service/flow. 2. To provide the capability of applying the configured features to those frames belonging to the service. 3. To optionally define how to forward those frames in the data-path. The association of a service instance to an EVC depicts an instance of an Ethernet flow on a particular interface for an end-to-end (UNI-to-UNI) Ethernet service for a subscriber. The following diagram illustrates the association of EVC, UNIs and service instances. UNI physical ports are depicted as 'U', and service instances as 'x'. CE MEN MEN CE ------- ------- ------- ------- | | | | () | | | | | |--------Ux x|--( )--|x xU--------| | | | | | () | | | | ------- ------- ------- ------- ^ ^ | | -------- EVC --------- This MIB module addresses the functional areas of network management for EVC, including: The operational mode for interfaces that are providing Ethernet service(s). The service attributes regarding an interface behaving as UNI, such as CE-VLAN mapping and layer 2 control protocol (eg. stp, vtp, cdp) processing. The provisioning of service instances to define flow points for an Ethernet service. The operational status of EVCs for notifications of status changes, and EVC creation and deletion. Definition of terms and acronyms: B-Tag: Backbone Tag field in Ethernet 802.1ah frame CE: Customer Edge CE-VLAN: Customer Edge VLAN CoS: Class Of Service EVC: Ethernet Virtual Connection I-SID: Service Instance Identifier field in Ethernet 802.1ah frame MAC: Media Access Control MEN: Metro Ethernet Network NNI: Network to Network Interface OAM: Operations Administration and Management PPPoE: Point-to-Point Protocol over Ethernet Service frame: An Ethernet frame transmitted across the UNI toward the service provider or an Ethernet frame transmitted across the UNI toward the Subscriber. Service Instance: A flow point of an Ethernet service Service provider: The organization providing Ethernet service(s). Subscriber: The organization purchasing and/or using Ethernet service(s). UNI: User Network Interface The physical demarcation point between the responsibility of the service provider and the responsibility of the Subscriber. UNI-C: User Network Interface, subscriber side UNI-N: User Network Interface, service provider side VLAN: Virtual Local Area Network") ciscoEvcMIBNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 0)) ciscoEvcMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 1)) ciscoEvcMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 2)) cevcSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 1)) cevcPort = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2)) cevcEvc = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3)) cevcServiceInstance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4)) cevcEvcNotificationConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 5)) cevcMacSecurityViolation = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 6)) class CevcMacSecurityViolationCauseType(TextualConvention, Integer32): description = "An integer value which identifies the cause for the MAC Security Violation. If the system MAC Address limit is exceeded, the cevcMacSecurityViolationCauseType will contain 'exceedSystemLimit' value. If the Bridge domain limit is exceeded, the cevcMacSecurityViolationCauseType will contain 'exceedBdLimit' value. If the Service Instance limit is exceeded, the cevcMacSecurityViolationCauseType will contain 'exceedSILimit' value. If the MAC address is present in the Black list then cevcMacSecurityViolationCauseType will contain 'blackListDeny' value." status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4)) namedValues = NamedValues(("exceedSystemLimit", 1), ("exceedBdLimit", 2), ("exceedSILimit", 3), ("blackListDeny", 4)) class CiscoEvcIndex(TextualConvention, Unsigned32): description = 'An integer-value which uniquely identifies the EVC.' status = 'current' subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 4294967295) class CiscoEvcIndexOrZero(TextualConvention, Unsigned32): description = "This textual convention is an extension to textual convention 'CiscoEvcIndex'. It includes the value of '0' in addition to the range of 1-429496725. Value of '0' indicates that the EVC has been neither configured nor assigned." status = 'current' subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(0, 4294967295) class CevcL2ControlProtocolType(TextualConvention, Integer32): description = "Defines the different types of layer 2 control protocols: 'other' None of the following. 'cdp' Cisco Discovery Protocol. 'dtp' Dynamic Trunking Protocol. 'pagp' Port Aggregration Protocol. 'udld' UniDirectional Link Detection. 'vtp' Vlan Trunking Protocol. 'lacp' Link Aggregation Control Protocol. 'dot1x' IEEE 802.1x 'stp' Spanning Tree Protocol." status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9)) namedValues = NamedValues(("other", 1), ("cdp", 2), ("dtp", 3), ("pagp", 4), ("udld", 5), ("vtp", 6), ("lacp", 7), ("dot1x", 8), ("stp", 9)) class ServiceInstanceTarget(TextualConvention, OctetString): description = "Denotes a generic service instance target. An ServiceInstanceTarget value is always interpreted within the context of an ServiceInstanceTargetType value. Every usage of the ServiceInstanceTarget textual convention is required to specify the ServiceInstanceTargetType object which provides the context. It is suggested that the ServiceInstanceTargetType object is logically registered before the object(s) which use the ServiceInstanceTarget textual convention if they appear in the same logical row. The value of an ServiceInstanceTarget object must always be consistent with the value of the associated ServiceInstanceTargetType object. Attempts to set an ServiceInstanceTarget object to a value which is inconsistent with the associated ServiceInstanceTargetType must fail with an inconsistentValue error. When this textual convention is used as the syntax of an index object, there may be issues with the limit of 128 sub-identifiers specified in SMIv2, STD 58. In this case, the object definition MUST include a 'SIZE' clause to limit the number of potential instance sub-identifiers." status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 40) class ServiceInstanceTargetType(TextualConvention, Integer32): description = "Defines the type of interface/media to which a service instance is attached. 'other' None of the following. This value MUST be used if the value of the corresponding ServiceInstanceTarget object is a zero-length string. 'interface' Service instance is attached to the the interface defined by ServiceInstanceInterface textual convention. Each definition of a concrete ServiceInstanceTargetType value must be accompanied by a definition of a textual convention for use with that ServiceInstanceTargetType. To support future extensions, the ServiceInstanceTargetType textual convention SHOULD NOT be sub-typed in object type definitions. It MAY be sub-typed in compliance statements in order to require only a subset of these target types for a compliant implementation. Implementations must ensure that ServiceInstanceTargetType objects and any dependent objects (e.g. ServiceInstanceTarget objects) are consistent. An inconsistentValue error must be generated if an attempt to change an ServiceInstanceTargetType object would, for example, lead to an undefined ServiceInstanceTarget value. In particular, ServiceInstanceTargetType/ServiceInstanceTarget pairs must be changed together if the service instance taget type changes." status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("other", 1), ("interface", 2)) class ServiceInstanceInterface(TextualConvention, OctetString): description = "This textual convention indicates the ifIndex which identifies the interface that the service instance is attached, for which the corresponding ifType has the value of (but not limited to) 'ethernetCsmacd'. octets contents encoding 1-4 ifIndex network-byte order The corresponding ServiceInstanceTargetType value is interface(2)." status = 'current' subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(4, 4) fixedLength = 4 cevcMacAddress = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 6, 1), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcMacAddress.setStatus('current') if mibBuilder.loadTexts: cevcMacAddress.setDescription('This object indicates the MAC Address which has violated the Mac security rules.') cevcMaxMacConfigLimit = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 6, 2), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cevcMaxMacConfigLimit.setStatus('current') if mibBuilder.loadTexts: cevcMaxMacConfigLimit.setDescription('This object specifies the maximum MAC configuration limit. This is also sent as a part of MAC security violation notification. Every platform has their own forwarding table limitation. User can also set the maximum MAC configuration limit and if the limit set by user is not supported by platform then the object returns error.') cevcSIID = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 6, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcSIID.setStatus('current') if mibBuilder.loadTexts: cevcSIID.setDescription('This object indicates the service instance ID for the MAC security violation notification.') cevcViolationCause = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 6, 4), CevcMacSecurityViolationCauseType()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcViolationCause.setStatus('current') if mibBuilder.loadTexts: cevcViolationCause.setDescription("This object indicates the MAC security violation cause. When the system MAC Address limit is exceeded, the cevcMacSecurityViolationCause will contain 'exceedSystemLimit' value. When the Bridge domain limit is exceeded, the cevcMacSecurityViolationCause will contain 'exceedBdLimit' value. When the Service Instance limit is exceeded, the cevcMacSecurityViolationCause will contain 'exceedSILimit' value. If the MAC address is present in the Black list then cevcMacSecurityViolationCause will contain 'blackListDeny' value.") cevcMaxNumEvcs = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 1, 1), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcMaxNumEvcs.setStatus('current') if mibBuilder.loadTexts: cevcMaxNumEvcs.setDescription('This object indicates the maximum number of EVCs that the system supports.') cevcNumCfgEvcs = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcNumCfgEvcs.setStatus('current') if mibBuilder.loadTexts: cevcNumCfgEvcs.setDescription('This object indicates the actual number of EVCs currently configured on the system.') cevcPortTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 1), ) if mibBuilder.loadTexts: cevcPortTable.setStatus('current') if mibBuilder.loadTexts: cevcPortTable.setDescription("This table provides the operational mode and configuration limitations of the physical interfaces (ports) that provide Ethernet services for the MEN. This table has a sparse depedent relationship on the ifTable, containing a row for each ifEntry having an ifType of 'ethernetCsmacd' capable of supporting Ethernet services.") cevcPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: cevcPortEntry.setStatus('current') if mibBuilder.loadTexts: cevcPortEntry.setDescription("This entry represents a port, a physical point, at which signals can enter or leave the network en route to or from another network to provide Ethernet services for the MEN. The system automatically creates an entry for each ifEntry in the ifTable having an ifType of 'ethernetCsmacd' capable of supporting Ethernet services and entries are automatically destroyed when the corresponding row in the ifTable is destroyed.") cevcPortMode = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("uni", 1), ("nni", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cevcPortMode.setStatus('current') if mibBuilder.loadTexts: cevcPortMode.setDescription("Port denotes the physcial interface which can provide Ethernet services. This object indicates the mode of the port and its operational behaviour in the MEN. 'uni' User Network Interface The port resides on the interface between the end user and the network. Additional information related to the UNI is included in cevcUniTable. 'nni' Network to Network Interface. The port resides on the interface between two networks.") cevcPortMaxNumEVCs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 1, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcPortMaxNumEVCs.setStatus('current') if mibBuilder.loadTexts: cevcPortMaxNumEVCs.setDescription('This object indicates the maximum number of EVCs that the interface can support.') cevcPortMaxNumServiceInstances = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 1, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcPortMaxNumServiceInstances.setStatus('current') if mibBuilder.loadTexts: cevcPortMaxNumServiceInstances.setDescription('This object indicates the maximum number of service instances that the interface can support.') cevcUniTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 2), ) if mibBuilder.loadTexts: cevcUniTable.setStatus('current') if mibBuilder.loadTexts: cevcUniTable.setDescription("This table contains a list of UNIs locally configured on the system. This table has a sparse dependent relationship on the cevcPortTable, containing a row for each cevcPortEntry having a cevcPortMode column value 'uni'.") cevcUniEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: cevcUniEntry.setStatus('current') if mibBuilder.loadTexts: cevcUniEntry.setDescription("This entry represents an UNI and its service attributes. The system automatically creates an entry when the system or the EMS/NMS creates a row in the cevcPortTable with a cevcPortMode of 'uni'. Likewise, the system automatically destroys an entry when the system or the EMS/NMS destroys the corresponding row in the cevcPortTable.") cevcUniIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcUniIdentifier.setReference("MEF 16, 'Ethernet Local Management Interface (E-LMI)', January 2006") if mibBuilder.loadTexts: cevcUniIdentifier.setStatus('current') if mibBuilder.loadTexts: cevcUniIdentifier.setDescription('This object specifies a string-value assigned to a UNI for identification. When the UNI identifier is configured by the system or the EMS/NMS, it should be unique among all UNIs for the MEN. If the UNI identifier value is not specified, the value of the cevcUniIdentifier column is a zero-length string.') cevcUniPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("dot1q", 1), ("dot1ad", 2))).clone('dot1q')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcUniPortType.setStatus('current') if mibBuilder.loadTexts: cevcUniPortType.setDescription("This object specifies the UNI port type. 'dot1q' The UNI port is an IEEE 802.1q port. 'dot1ad' The UNI port is an IEEE 802.1ad port.") cevcUniServiceAttributes = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 2, 1, 3), Bits().clone(namedValues=NamedValues(("serviceMultiplexing", 0), ("bundling", 1), ("allToOneBundling", 2))).clone(namedValues=NamedValues(("serviceMultiplexing", 0), ("bundling", 1)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcUniServiceAttributes.setStatus('current') if mibBuilder.loadTexts: cevcUniServiceAttributes.setDescription("This object specifies the UNI service attributes. 'serviceMultiplexing' This bit specifies whether the UNI supports multiple EVCs. Point-to-Point EVCs and Multipoint-to-Multipoint EVCs may be multiplexed in any combination at the UNI if this bit is set to '1'. 'bundling' This bit specifies whether the UNI has the bundling attribute configured. If this bit is set to '1', more than one CE-VLAN ID can map to a particular EVC at the UNI. 'allToOneBundling' This bit specifies whether the UNI has the all to one bundling attribute. If this bit is set to '1', all CE-VLAN IDs map to a single EVC at the UNI. To summarize the valid combinations of serviceMultiplexing(0), bundling(1) and allToOneBundling(2) bits for an UNI, consider the following diagram: VALID COMBINATIONS +---------------+-------+-------+-------+-------+-------+ |UNI ATTRIBUTES | 1 | 2 | 3 | 4 | 5 | +---------------+-------+------+------------------------+ |Service | | | | | | |Multiplexing | | Y | Y | | | | | | | | | | +---------------+-------+-------+-------+-------+-------+ | | | | | | | |Bundling | | | Y | Y | | | | | | | | | +---------------+-------+-------+-------+-------+-------+ |All to One | | | | | | |Bundling | | | | | Y | | | | | | | | +---------------+-------+-------+------ +-------+-------+") cevcPortL2ControlProtocolTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 3), ) if mibBuilder.loadTexts: cevcPortL2ControlProtocolTable.setStatus('current') if mibBuilder.loadTexts: cevcPortL2ControlProtocolTable.setDescription('This table lists the layer 2 control protocol processing attributes at UNI ports. This table has an expansion dependent relationship on the cevcUniTable, containing zero or more rows for each UNI.') cevcPortL2ControlProtocolEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-EVC-MIB", "cevcPortL2ControlProtocolType")) if mibBuilder.loadTexts: cevcPortL2ControlProtocolEntry.setStatus('current') if mibBuilder.loadTexts: cevcPortL2ControlProtocolEntry.setDescription('This entry represents the layer 2 control protocol processing at the UNI. The system automatically creates an entry for each layer 2 control protocol type when an entry is created in the cevcUniTable, and entries are automatically destroyed when the system destroys the corresponding row in the cevcUniTable.') cevcPortL2ControlProtocolType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 3, 1, 1), CevcL2ControlProtocolType()) if mibBuilder.loadTexts: cevcPortL2ControlProtocolType.setStatus('current') if mibBuilder.loadTexts: cevcPortL2ControlProtocolType.setDescription('This object indicates the type of layer 2 control protocol service frame as denoted by the value of cevcPortL2ControlProtocolAction column.') cevcPortL2ControlProtocolAction = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("discard", 1), ("peer", 2), ("passToEvc", 3), ("peerAndPassToEvc", 4))).clone('discard')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcPortL2ControlProtocolAction.setStatus('current') if mibBuilder.loadTexts: cevcPortL2ControlProtocolAction.setDescription("This object specifies the action to be taken for the given layer 2 control protocol service frames which matches the cevcPortL2ControlProtocolType, including: 'discard' The port must discard all ingress service frames carrying the layer 2 control protocol service frames and the port must not generate any egress service frames carrying the layer 2 control protocol service frames. When this action is set at the port, an EVC cannot process the layer 2 control protocol service frames. 'peer' The port must act as a peer, meaning it actively participates with the Customer Equipment, in the operation of the layer 2 control protocol service frames. An example of this is port authentication service at the UNI with 802.1x or enhanced link OAM functionality by peering at the UNI with link OAM (IEEE 802.3ah). When this action is set at the port, an EVC cannot process the layer 2 control protocol service frames. 'passToEvc' The disposition of the service frames which are layer 2 control protocol service frames must be determined by the layer 2 control protocol action attribute of the EVC, (see cevcSIL2ControlProtocolAction for further details). 'peerAndPassToEvc' The layer 2 control protocol service frames will be peered at the port and also passed to one or more EVCs for tunneling. An example of this possibility is where an 802.1x authentication frame is peered at the UNI for UNI-based authentication, but also passed to a given EVC for customer end-to-end authentication.") cevcUniCEVlanEvcTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 4), ) if mibBuilder.loadTexts: cevcUniCEVlanEvcTable.setStatus('current') if mibBuilder.loadTexts: cevcUniCEVlanEvcTable.setDescription('This table contains for each UNI, a list of EVCs and the association of CE-VLANs to the EVC. The CE-VLAN mapping is locally significant to the UNI. This table has an expansion dependent relationship on the cevcUniTable, containing zero or more rows for each UNI.') cevcUniCEVlanEvcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-EVC-MIB", "cevcUniEvcIndex"), (0, "CISCO-EVC-MIB", "cevcUniCEVlanEvcBeginningVlan")) if mibBuilder.loadTexts: cevcUniCEVlanEvcEntry.setStatus('current') if mibBuilder.loadTexts: cevcUniCEVlanEvcEntry.setDescription('This entry represents an EVC and the CE-VLANs that are mapped to it at an UNI. For example, if CE-VLANs 10, 20-30, 40 are mapped to an EVC indicated by cevcUniEvcIndex = 1, at an UNI with ifIndex = 2, this table will contain following rows to represent above CE-VLAN map: cevcUniCEVlanEvcEndingVlan.2.1.10 = 0 cevcUniCEVlanEvcEndingVlan.2.1.20 = 30 cevcUniCEVlanEvcEndingVlan.2.1.40 = 0 The system automatically creates an entry when the system creates an entry in the cevcUniTable and an entry is created in cevcSICEVlanTable for a service instance which is attached to an EVC on this UNI. Likewise, the system automatically destroys an entry when the system or the EMS/NMS destroys the corresponding row in the cevcUniTable or in the cevcSICEVlanTable.') cevcUniEvcIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 4, 1, 1), CiscoEvcIndex()) if mibBuilder.loadTexts: cevcUniEvcIndex.setStatus('current') if mibBuilder.loadTexts: cevcUniEvcIndex.setDescription('This object indicates an arbitrary integer-value that uniquely identifies the EVC attached at an UNI.') cevcUniCEVlanEvcBeginningVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 4, 1, 2), VlanId()) if mibBuilder.loadTexts: cevcUniCEVlanEvcBeginningVlan.setStatus('current') if mibBuilder.loadTexts: cevcUniCEVlanEvcBeginningVlan.setDescription("If cevcUniCEVlanEvcEndingVlan is '0', then this object indicates a single VLAN in the list. If cevcUniCEVlanEvcEndingVlan is not '0', then this object indicates the first VLAN in a range of VLANs.") cevcUniCEVlanEvcEndingVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 2, 4, 1, 3), VlanIdOrNone()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcUniCEVlanEvcEndingVlan.setStatus('current') if mibBuilder.loadTexts: cevcUniCEVlanEvcEndingVlan.setDescription("This object indicates the last VLAN in a range of VLANs. If the row does not describe a range, then the value of this column must be '0'.") cevcEvcTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 1), ) if mibBuilder.loadTexts: cevcEvcTable.setStatus('current') if mibBuilder.loadTexts: cevcEvcTable.setDescription('This table contains a list of EVCs and their service attributes.') cevcEvcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 1, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcEvcIndex")) if mibBuilder.loadTexts: cevcEvcEntry.setStatus('current') if mibBuilder.loadTexts: cevcEvcEntry.setDescription("This entry represents the EVC configured on the system and its service atrributes. Entries in this table may be created and deleted via the cevcEvcRowStatus object or the management console on the system. Using SNMP, rows are created by a SET request setting the value of cevcEvcRowStatus column to 'createAndGo'or 'createAndWait'. Rows are deleted by a SET request setting the value of cevcEvcRowStatus column to 'destroy'.") cevcEvcIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 1, 1, 1), CiscoEvcIndex()) if mibBuilder.loadTexts: cevcEvcIndex.setStatus('current') if mibBuilder.loadTexts: cevcEvcIndex.setDescription('This object indicates an arbitrary integer-value that uniquely identifies the EVC.') cevcEvcRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 1, 1, 2), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcEvcRowStatus.setStatus('current') if mibBuilder.loadTexts: cevcEvcRowStatus.setDescription("This object enables a SNMP peer to create, modify, and delete rows in the cevcEvcTable. cevcEvcIdentifier column must have a valid value before a row can be set to 'active'. Writable objects in this table can be modified while the value of cevcEvcRowStatus column is 'active'. An entry cannot be deleted if there exists a service instance which is referring to the cevcEvcEntry i.e. cevcSIEvcIndex in the cevcSITable has the same value as cevcEvcIndex being deleted.") cevcEvcStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 1, 1, 3), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcEvcStorageType.setStatus('current') if mibBuilder.loadTexts: cevcEvcStorageType.setDescription("This object specifies how the SNMP entity stores the data contained by the corresponding conceptual row. This object can be set to either 'volatile' or 'nonVolatile'. Other values are not applicable for this conceptual row and are not supported.") cevcEvcIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 1, 1, 4), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 100))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcEvcIdentifier.setReference("MEF 16, 'Ethernet Local Management Interface (E-LMI)', January 2006") if mibBuilder.loadTexts: cevcEvcIdentifier.setStatus('current') if mibBuilder.loadTexts: cevcEvcIdentifier.setDescription('This object specifies a string-value identifying the EVC. This value should be unique across the MEN.') cevcEvcType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("pointToPoint", 1), ("multipointToMultipoint", 2))).clone('pointToPoint')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcEvcType.setStatus('current') if mibBuilder.loadTexts: cevcEvcType.setDescription("This object specifies the type of EVC: 'pointToPoint' Exactly two UNIs are associated with one another. An ingress service frame at one UNI must not result in an egress service frame at a UNI other than the other UNI in the EVC. 'multipointToMultipoint' Two or more UNIs are associated with one another. An ingress service frame at one UNI must not result in an egress service frame at a UNI that is not in the EVC.") cevcEvcCfgUnis = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 1, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(2, 4294967295)).clone(2)).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcEvcCfgUnis.setStatus('current') if mibBuilder.loadTexts: cevcEvcCfgUnis.setDescription("This object specifies the number of UNIs expected to be configured for the EVC in the MEN. The underlying OAM protocol can use this value of UNIs to determine the EVC operational status, cevcEvcOperStatus. For a Multipoint-to-Multipoint EVC the minimum number of Uni's would be two.") cevcEvcStateTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 2), ) if mibBuilder.loadTexts: cevcEvcStateTable.setStatus('current') if mibBuilder.loadTexts: cevcEvcStateTable.setDescription('This table lists statical/status data of the EVC. This table has an one-to-one dependent relationship on the cevcEvcTable, containing a row for each EVC.') cevcEvcStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 2, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcEvcIndex")) if mibBuilder.loadTexts: cevcEvcStateEntry.setStatus('current') if mibBuilder.loadTexts: cevcEvcStateEntry.setDescription('This entry represents status atrributes of an EVC. The system automatically creates an entry when the system or the EMS/NMS creates a row in the cevcEvcTable. Likewise, the system automatically destroys an entry when the system or the EMS/NMS destroys the corresponding row in the cevcEvcTable.') cevcEvcOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 1), ("active", 2), ("partiallyActive", 3), ("inactive", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcEvcOperStatus.setStatus('current') if mibBuilder.loadTexts: cevcEvcOperStatus.setDescription("This object specifies the operational status of the EVC: 'unknown' Not enough information available regarding the EVC to determine the operational status at this time or EVC operational status is undefined. 'active' Fully operational between the UNIs in the EVC. 'partiallyActive' Capable of transferring traffic among some but not all of the UNIs in the EVC. This operational status is applicable only for Multipoint-to-Multipoint EVCs. 'inactive' Not capable of transferring traffic among any of the UNIs in the EVC. This value is derived from data gathered by underlying OAM protocol.") cevcEvcActiveUnis = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 2, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcEvcActiveUnis.setStatus('current') if mibBuilder.loadTexts: cevcEvcActiveUnis.setDescription('This object indicates the number of active UNIs for the EVC in the MEN. This value is derived from data gathered by underlying OAM Protocol.') cevcEvcUniTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 3), ) if mibBuilder.loadTexts: cevcEvcUniTable.setStatus('current') if mibBuilder.loadTexts: cevcEvcUniTable.setDescription("This table contains a list of UNI's for each EVC configured on the device. The UNIs can be local (i.e. physically located on the system) or remote (i.e. not physically located on the device). For local UNIs, the UNI Id is the same as denoted by cevcUniIdentifier with the same ifIndex value as cevcEvcLocalUniIfIndex. For remote UNIs, the underlying OAM protocol, if capable, provides the UNI Id via its protocol messages. This table has an expansion dependent relationship on the cevcEvcTable, containing a row for each UNI that is in the EVC.") cevcEvcUniEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 3, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcEvcIndex"), (0, "CISCO-EVC-MIB", "cevcEvcUniIndex")) if mibBuilder.loadTexts: cevcEvcUniEntry.setStatus('current') if mibBuilder.loadTexts: cevcEvcUniEntry.setDescription('This entry represents a UNI, either local or remote, in the EVC. The system automatically creates an entry, when an UNI is attached to the EVC. Entries are automatically destroyed when the system or the EMS/NMS destroys the corresponding row in the cevcEvcTable or when an UNI is removed from the EVC.') cevcEvcUniIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: cevcEvcUniIndex.setStatus('current') if mibBuilder.loadTexts: cevcEvcUniIndex.setDescription('This object indicates an arbitrary integer-value that uniquely identifies the UNI in an EVC.') cevcEvcUniId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 3, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcEvcUniId.setReference('MEF 16, Ethernet Local Management Interface (E-LMI), January 2006') if mibBuilder.loadTexts: cevcEvcUniId.setStatus('current') if mibBuilder.loadTexts: cevcEvcUniId.setDescription('This object indicates the string-value identifying the UNI that is in the EVC. For UNI that is local, this value is the same as cevcUniIdentifier for the same ifIndex value as cevcEvcLocalUniIfIndex. For UNI that is not on the system, this value may be derived from the underlying OAM protocol. If the UNI identifier value is not specified for the UNI or it is unknown, the value of the cevcEvcUniId column is a zero-length string.') cevcEvcUniOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("unknown", 1), ("notReachable", 2), ("up", 3), ("down", 4), ("adminDown", 5), ("localExcessiveError", 6), ("remoteExcessiveError", 7), ("localInLoopback", 8), ("remoteInLoopback", 9), ("localOutLoopback", 10), ("remoteOutLoopback", 11)))).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcEvcUniOperStatus.setStatus('current') if mibBuilder.loadTexts: cevcEvcUniOperStatus.setDescription("This object indicates the operational status derived from data gathered by the OAM protocol for an UNI. 'unknown' Status is not known; possible reason could be caused by the OAM protocol has not provided information regarding the UNI. 'notReachable' UNI is not reachable; possible reason could be caused by the OAM protocol messages having not been received for an excessive length of time. 'up' UNI is active, up, and able to pass traffic. 'down' UNI is down and not passing traffic. 'adminDown' UNI has been administratively put in down state. 'localExcessiveError' UNI has experienced excessive number of invalid frames on the local end of the physical link between UNI-C and UNI-N. 'remoteExcessiveError' UNI has experienced excessive number of invalid frames on the remote side of the physical connection between UNI-C and UNI-N. 'localInLoopback' UNI is loopback on the local end of the physical link between UNI-C and UNI-N. 'remoteInLoopback' UNI is looped back on the remote end of the link between UNI-C and UNI-N. 'localOutLoopback' UNI just transitioned out of loopback on the local end of the physcial link between UNI-C and UNI-N. 'remoteOutLoopback' UNI just transitioned out of loopback on the remote end of the physcial link between UNI-C and UNI-N.") cevcEvcLocalUniIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 3, 3, 1, 4), InterfaceIndexOrZero()).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcEvcLocalUniIfIndex.setStatus('current') if mibBuilder.loadTexts: cevcEvcLocalUniIfIndex.setDescription("When the UNI is local on the system, this object specifies the ifIndex of the UNI. The value '0' of this column indicates remote UNI.") cevcSITable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1), ) if mibBuilder.loadTexts: cevcSITable.setStatus('current') if mibBuilder.loadTexts: cevcSITable.setDescription('This table lists each service instance and its service attributes.') cevcSIEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex")) if mibBuilder.loadTexts: cevcSIEntry.setStatus('current') if mibBuilder.loadTexts: cevcSIEntry.setDescription("This entry represents a service instance configured on the system and its service attributes. Entries in this table may be created and deleted via the cevcSIRowStatus object or the management console on the system. Using SNMP, rows are created by a SET request setting the value of cevcSIRowStatus column to 'createAndGo'or 'createAndWait'. Rows are deleted by a SET request setting the value of cevcSIRowStatus column to 'destroy'.") cevcSIIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: cevcSIIndex.setStatus('current') if mibBuilder.loadTexts: cevcSIIndex.setDescription('This object indicates an arbitrary integer-value that uniquely identifies a service instance. An implementation MAY assign an ifIndex-value assigned to the service instance to cevcSIIndex.') cevcSIRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 2), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIRowStatus.setStatus('current') if mibBuilder.loadTexts: cevcSIRowStatus.setDescription("This object enables a SNMP peer to create, modify, and delete rows in the cevcSITable. This object cannot be set to 'active' until following corresponding objects are assigned to valid values: - cevcSITargetType - cevcSITarget - cevcSIName - cevcSIType Following writable objects in this table cannot be modified while the value of cevcSIRowStatus is 'active': - cevcSITargetType - cevcSITarget - cevcSIName - cevcSIType Objects in this table and all other tables that have the same cevcSIIndex value as an index disappear when cevcSIRowStatus is set to 'destroy'.") cevcSIStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 3), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIStorageType.setStatus('current') if mibBuilder.loadTexts: cevcSIStorageType.setDescription("This object specifies how the SNMP entity stores the data contained by the corresponding conceptual row. This object can be set to either 'volatile' or 'nonVolatile'. Other values are not applicable for this conceptual row and are not supported.") cevcSITargetType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 4), ServiceInstanceTargetType()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSITargetType.setStatus('current') if mibBuilder.loadTexts: cevcSITargetType.setDescription('This object indicates the type of interface/media to which a service instance has an attachment.') cevcSITarget = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 5), ServiceInstanceTarget()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSITarget.setStatus('current') if mibBuilder.loadTexts: cevcSITarget.setDescription('This object indicates the target to which a service instance has an attachment. If the target is unknown, the value of the cevcSITarget column is a zero-length string.') cevcSIName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 6), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIName.setStatus('current') if mibBuilder.loadTexts: cevcSIName.setDescription("The textual name of the service instance. The value of this column should be the name of the component as assigned by the local interface/media type and should be be suitable for use in commands entered at the device's 'console'. This might be text name, such as 'si1' or a simple service instance number, such as '1', depending on the interface naming syntax of the device. If there is no local name or this object is otherwise not applicable, then this object contains a zero-length string.") cevcSIEvcIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 7), CiscoEvcIndexOrZero()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIEvcIndex.setStatus('current') if mibBuilder.loadTexts: cevcSIEvcIndex.setDescription("This object specifies the EVC Index that the service instance is associated. The value of '0' this column indicates that the service instance is not associated to an EVC. If the value of cevcSIEvcIndex column is not '0', there must exist an active row in the cevcEvcTable with the same index value for cevcEvcIndex.") cevcSIAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2))).clone('up')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIAdminStatus.setStatus('current') if mibBuilder.loadTexts: cevcSIAdminStatus.setDescription("This object specifies the desired state of the Service Instance. 'up' Ready to transfer traffic. When a system initializes, all service instances start with this state. 'down' The service instance is administratively down and is not capable of transferring traffic.") cevcSIForwardingType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("other", 0), ("bridgeDomain", 1)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIForwardingType.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardingType.setDescription("This object indicates technique used by a service instance to forward service frames. 'other' If the forwarding behavior of a service instance is not defined or unknown, this object is set to other(0). 'bridgeDomain' Bridge domain is used to forward service frames by a service instance. If cevcSIForwardingType is 'bridgeDomain(1)', there must exist an active row in the cevcSIForwardBdTable with the same index value of cevcSIIndex. The object cevcSIForwardBdNumber indicates the identifier of the bridge domain component being used.") cevcSICreationType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("static", 1), ("dynamic", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcSICreationType.setStatus('current') if mibBuilder.loadTexts: cevcSICreationType.setDescription("This object specifies whether the service instance created is statically configured by the user or is dynamically created. 'static' If the service instance is configured manually this object is set to static(1). 'dynamic' If the service instance is created dynamically by the first sign of life of an Ethernet frame, then this object is set to dynamic(2) for the service instance.") cevcSIType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("regular", 1), ("trunk", 2), ("l2context", 3)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIType.setStatus('current') if mibBuilder.loadTexts: cevcSIType.setDescription("This object specifies the type of the service instance. It mentions if the service instance is either a regular or trunk or l2context service instance. 'regular' If a service instance is configured without any type specified, then it is a regular service instance. 'trunk' If the service instance is configured with trunk type, then it is a trunk service instance. For a trunk service instance, its Bridge domain IDs are derived from encapsulation VLAN plus an optional offset (refer cevcSIForwardBdNumberBase object). 'l2context' If the service instance is configured with dynamic type, then it is a L2 context service instance. The Ethernet L2 Context is a statically configured service instance which contains the Ethernet Initiator for attracting the first sign of life. In other words, Ethernet L2 Context service instance is used for catching the first sign of life of Ethernet frames to create dynamic Ethernet sessions service instances.") cevcSIStateTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 2), ) if mibBuilder.loadTexts: cevcSIStateTable.setStatus('current') if mibBuilder.loadTexts: cevcSIStateTable.setDescription('This table lists statical status data of the service instance. This table has an one-to-one dependent relationship on the cevcSITable, containing a row for each service instance.') cevcSIStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 2, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex")) if mibBuilder.loadTexts: cevcSIStateEntry.setStatus('current') if mibBuilder.loadTexts: cevcSIStateEntry.setDescription('This entry represents operational status of a service instance. The system automatically creates an entry when the system or the EMS NMS creates a row in the cevcSITable. Likewise, the system automatically destroys an entry when the system or the EMS NMS destroys the corresponding row in the cevcSITable.') cevcSIOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("adminDown", 3), ("deleted", 4), ("errorDisabled", 5), ("unknown", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: cevcSIOperStatus.setStatus('current') if mibBuilder.loadTexts: cevcSIOperStatus.setDescription("This object indicates the operational status of the Service Instance. 'up' Service instance is fully operational and able to transfer traffic. 'down' Service instance is down and not capable of transferring traffic, and is not administratively configured to be down by management system. 'adminDown' Service instance has been explicitly configured to administratively down by a management system and is not capable of transferring traffic. 'deleted' Service instance has been deleted. 'errorDisabled' Service instance has been shut down due to MAC security violations. 'unknown' Operational status of service instance is unknown or undefined.") cevcSIVlanRewriteTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3), ) if mibBuilder.loadTexts: cevcSIVlanRewriteTable.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteTable.setDescription("This table lists the rewrite adjustments of the service frame's VLAN tags for service instances. This table has an expansion dependent relationship on the cevcSITable, containing a row for a VLAN adjustment for ingress and egress frames at each service instance.") cevcSIVlanRewriteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex"), (0, "CISCO-EVC-MIB", "cevcSIVlanRewriteDirection")) if mibBuilder.loadTexts: cevcSIVlanRewriteEntry.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteEntry.setDescription('Each entry represents the VLAN adjustment for a Service Instance.') cevcSIVlanRewriteDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ingress", 1), ("egress", 2)))) if mibBuilder.loadTexts: cevcSIVlanRewriteDirection.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteDirection.setDescription("This object specifies the VLAN adjustment for 'ingress' frames or 'egress' frames on the service instance.") cevcSIVlanRewriteRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3, 1, 2), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIVlanRewriteRowStatus.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteRowStatus.setDescription("This object enables a SNMP peer to create, modify, and delete rows in the cevcSIVlanRewriteTable. cevcSIVlanRewriteAction and cevcSIVlanRewriteEncapsulation must have valid values before this object can be set to 'active'. Writable objects in this table can be modified while the value of cevcSIVlanRewriteRowStatus column is 'active'.") cevcSIVlanRewriteStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3, 1, 3), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIVlanRewriteStorageType.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteStorageType.setDescription("This object specifies how the SNMP entity stores the data contained by the corresponding conceptual row. This object can be set to either 'volatile' or 'nonVolatile'. Other values are not applicable for this conceptual row and are not supported.") cevcSIVlanRewriteAction = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("push1", 1), ("push2", 2), ("pop1", 3), ("pop2", 4), ("translate1To1", 5), ("translate1To2", 6), ("translate2To1", 7), ("translate2To2", 8)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIVlanRewriteAction.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteAction.setDescription("This object specifies the rewrite action the device performs for the service instance, including: 'push1' Add cevcSIVlanRewriteVlan1 as the VLAN tag to the service frame. 'push2' Add cevcSIVlanRewriteVlan1 as the outer VLAN tag and cevcSIVlanRewriteVlan2 as the inner VLAN tag of the service frame. 'pop1' Remove the outermost VLAN tag from the service frame. 'pop2' Remove the two outermost VLAN tags from the service frame. 'translate1To1' Replace the outermost VLAN tag with the cevcSIVlanRewriteVlan1 tag. 'translate1To2' Replace the outermost VLAN tag with cevcSIVlanRewriteVlan1 and add cevcSIVlanRewriteVlan2 to the second VLAN tag of the service frame. 'translate2To1' Remove the outermost VLAN tag and replace the second VLAN tag with cevcSIVlanVlanRewriteVlan1. 'translate2To2' Replace the outermost VLAN tag with cevcSIVlanRewriteVlan1 and the second VLAN tag with cevcSIVlanRewriteVlan2.") cevcSIVlanRewriteEncapsulation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("dot1q", 1), ("dot1ad", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIVlanRewriteEncapsulation.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteEncapsulation.setDescription("This object specifies the encapsulation type to process for the service instance. 'dot1q' The IEEE 802.1q encapsulation. 'dot1ad' The IEEE 802.1ad encapsulation.") cevcSIVlanRewriteVlan1 = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3, 1, 6), VlanId()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIVlanRewriteVlan1.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteVlan1.setDescription("This object specifies the outermost VLAN ID tag of the frame for the service instance. This object is valid only when cevcSIVlanRewriteAction is 'push1', 'push2', 'translate1To1', 'translate1To2', 'translate2To1', or 'translate2To2'.") cevcSIVlanRewriteVlan2 = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3, 1, 7), VlanId()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIVlanRewriteVlan2.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteVlan2.setDescription("This object specifies the second VLAN ID tag of the frame for the service instance. This object is valid only when cevcSIVlanRewriteAction is 'push2', 'translate1To2', or 'translate2To2'.") cevcSIVlanRewriteSymmetric = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 3, 1, 8), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIVlanRewriteSymmetric.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteSymmetric.setDescription("This object is valid only when cevcSIVlanRewriteDirection is 'ingress'. The value 'true' of this column specifies that egress packets are tagged with a VLAN specified by an active row in cevcSIPrimaryVlanTable. There could only be one VLAN value assigned in the cevcSIPrimaryVlanTable, i.e. only one 'active' entry that has the same index value of cevcSIIndex column and corresponding instance of cevcSIPrimaryVlanEndingVlan column has value '0'.") cevcSIL2ControlProtocolTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 4), ) if mibBuilder.loadTexts: cevcSIL2ControlProtocolTable.setStatus('current') if mibBuilder.loadTexts: cevcSIL2ControlProtocolTable.setDescription('This table lists the layer 2 control protocol processing attributes at service instances. This table has an expansion dependent relationship on the cevcSITable, containing a row for each layer 2 control protocol disposition at each service instance.') cevcSIL2ControlProtocolEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 4, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex"), (0, "CISCO-EVC-MIB", "cevcSIL2ControlProtocolType")) if mibBuilder.loadTexts: cevcSIL2ControlProtocolEntry.setStatus('current') if mibBuilder.loadTexts: cevcSIL2ControlProtocolEntry.setDescription('This entry represents the layer 2 control protocol processing at a service instance. The system automatically creates an entry for each layer 2 control protocol type when an entry is created in the cevcSITable, and entries are automatically destroyed when the system destroys the corresponding row in the cevcSITable.') cevcSIL2ControlProtocolType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 4, 1, 1), CevcL2ControlProtocolType()) if mibBuilder.loadTexts: cevcSIL2ControlProtocolType.setStatus('current') if mibBuilder.loadTexts: cevcSIL2ControlProtocolType.setDescription('The layer 2 control protocol service frame that the service instance is to process as defined by object cevcSIL2ControlProtocolAction.') cevcSIL2ControlProtocolAction = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("discard", 1), ("tunnel", 2), ("forward", 3))).clone('discard')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIL2ControlProtocolAction.setStatus('current') if mibBuilder.loadTexts: cevcSIL2ControlProtocolAction.setDescription("The actions to be taken for a given layer 2 control protocol service frames that matches cevcSIL2ControlProtocolType, including: 'discard' The MEN must discard all ingress service frames carrying the layer 2 control protocol service frames on the EVC and the MEN must not generate any egress service frames carrying the layer 2 control protocol frames on the EVC. 'tunnel' Forward the layer 2 control protocol service frames with the MAC address changed as defined by the individual layer 2 control protocol. The EVC does not process the layer 2 protocol service frames. If a layer 2 control protocol service frame is to be tunneled, all the UNIs in the EVC must be configured to pass the layer 2 control protocol service frames to the EVC, cevcPortL2ControlProtocolAction column has the value of 'passToEvc' or 'peerAndPassToEvc'. 'forward' Forward the layer 2 conrol protocol service frames as data; similar to tunnel but layer 2 control protocol service frames are forwarded without changing the MAC address.") cevcSICEVlanTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 5), ) if mibBuilder.loadTexts: cevcSICEVlanTable.setStatus('current') if mibBuilder.loadTexts: cevcSICEVlanTable.setDescription('This table contains the CE-VLAN map list for each Service Instance. This table has an expansion dependent relationship on the cevcSITable, containing a row for each CE-VLAN or a range of CE-VLANs that are mapped to a service instance.') cevcSICEVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 5, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex"), (0, "CISCO-EVC-MIB", "cevcSICEVlanBeginningVlan")) if mibBuilder.loadTexts: cevcSICEVlanEntry.setStatus('current') if mibBuilder.loadTexts: cevcSICEVlanEntry.setDescription("This entry contains the CE-VLANs that are mapped at a Service Instance. Entries in this table may be created and deleted via the cevcSICEVlanRowStatus object or the management console on the system. Using SNMP, rows are created by a SET request setting the value of cevcSICEVlanRowStatus column to 'createAndGo' or 'createAndWait'. Rows are deleted by a SET request setting the value of cevcSICEVlanRowStatus column to 'destroy'.") cevcSICEVlanBeginningVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 5, 1, 1), VlanId()) if mibBuilder.loadTexts: cevcSICEVlanBeginningVlan.setStatus('current') if mibBuilder.loadTexts: cevcSICEVlanBeginningVlan.setDescription("If cevcSICEVlanEndingVlan is '0', then this object indicates a single VLAN in the list. If cevcSICEVlanEndingVlan is not '0', then this object indicates the first VLAN in a range of VLANs.") cevcSICEVlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 5, 1, 2), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSICEVlanRowStatus.setStatus('current') if mibBuilder.loadTexts: cevcSICEVlanRowStatus.setDescription("This object enables a SNMP peer to create, modify, and delete rows in the cevcSICEVlanTable. This object cannot be set to 'active' until all objects have been assigned valid values. Writable objects in this table can be modified while the value of the cevcSICEVlanRowStatus column is 'active'.") cevcSICEVlanStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 5, 1, 3), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSICEVlanStorageType.setStatus('current') if mibBuilder.loadTexts: cevcSICEVlanStorageType.setDescription("This object specifies how the SNMP entity stores the data contained by the corresponding conceptual row. This object can be set to either 'volatile' or 'nonVolatile'. Other values are not applicable for this conceptual row and are not supported.") cevcSICEVlanEndingVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 5, 1, 4), VlanIdOrNone()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSICEVlanEndingVlan.setStatus('current') if mibBuilder.loadTexts: cevcSICEVlanEndingVlan.setDescription("This object indicates the last VLAN in a range of VLANs. If the row does not describe a range, then the value of this column must be '0'.") cevcSIMatchCriteriaTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 6), ) if mibBuilder.loadTexts: cevcSIMatchCriteriaTable.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchCriteriaTable.setDescription('This table contains the match criteria for each Service Instance. This table has an expansion dependent relationship on the cevcSITable, containing a row for each group of match criteria of each service instance.') cevcSIMatchCriteriaEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 6, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex"), (0, "CISCO-EVC-MIB", "cevcSIMatchCriteriaIndex")) if mibBuilder.loadTexts: cevcSIMatchCriteriaEntry.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchCriteriaEntry.setDescription("This entry represents a group of match criteria for a service instance. Each entry in the table with the same cevcSIIndex and different cevcSIMatchCriteriaIndex represents an OR operation of the match criteria for the service instance. Entries in this table may be created and deleted via the cevcSIMatchRowStatus object or the management console on the system. Using SNMP, rows are created by a SET request setting the value of cevcSIMatchRowStatus column to 'createAndGo' or 'createAndWait'. Rows are deleted by a SET request setting the value of cevcSIMatchRowStatus column to 'destroy'.") cevcSIMatchCriteriaIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 6, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: cevcSIMatchCriteriaIndex.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchCriteriaIndex.setDescription('This object indicates an arbitrary integer-value that uniquely identifies a match criteria for a service instance.') cevcSIMatchRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 6, 1, 2), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchRowStatus.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchRowStatus.setDescription("This object enables a SNMP peer to create, modify, and delete rows in the cevcSIMatchCriteriaTable. If the value of cevcSIMatchCriteriaType column is 'dot1q(1)' or 'dot1ad(2)' or 'untaggedAndDot1q' or 'untaggedAndDot1ad, then cevcSIMatchCriteriaRowStatus can not be set to 'active' until there exist an active row in the cevcSIMatchEncapTable with the same index value for cevcSIIndex and cevcSIMatchCriteriaIndex. Writable objects in this table can be modified while the value of the cevcSIMatchRowStatus column is 'active'.") cevcSIMatchStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 6, 1, 3), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchStorageType.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchStorageType.setDescription("This object specifies how the SNMP entity stores the data contained by the corresponding conceptual row. This object can be set to either 'volatile' or 'nonVolatile'. Other values are not applicable for this conceptual row and are not supported.") cevcSIMatchCriteriaType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("unknown", 1), ("dot1q", 2), ("dot1ad", 3), ("untagged", 4), ("untaggedAndDot1q", 5), ("untaggedAndDot1ad", 6), ("priorityTagged", 7), ("defaultTagged", 8)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchCriteriaType.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchCriteriaType.setDescription("This object specifies the criteria used to match a service instance. 'unknown' Match criteria for the service instance is not defined or unknown. 'dot1q' The IEEE 802.1q encapsulation is used as a match criteria for the service instance. The ether type value of the IEEE 802.1q tag is specified by the object cevcSIEncapEncapsulation with the same index value of cevcSIIndex and cevcSIMatchCreriaIndex. 'dot1ad' The IEEE 802.1ad encapsulation is used as a match criteria for the service instance. The ether type value of the IEEE 802.1ad tag is specified by the cevcSIEncapEncapsulation column with the same index value of cevcSIIndex and cevcSIMatchCreriaIndex. 'untagged' Service instance processes untagged service frames. Only one service instance on the interface/media type can use untagged frames as a match criteria. 'untaggedAndDot1q' Both untagged frames and the IEEE 802.1q encapsulation are used as a match criteria for the service instance. Only one service instance on the interface/media type can use untagged frames as a match criteria. The ether type value of the IEEE 802.1q tag is specified by the cevcSIEncapEncapsulation column with the same index value of cevcSIIndex and cevcSIMatchCreriaIndex. 'untaggedAndDot1ad' Both untagged frames and the IEEE 802.1ad encapsulation are used as a match criteria for the service instance. Only one service instance on the interface/media type can use untagged frames as a match criteria. The ether type value of the IEEE 802.1ad tag is specified by the cevcSIEncapEncapsulation column with the same index value of cevcSIIndex and cevcSIMatchCreriaIndex. 'priorityTagged' Service instance processes priority tagged frames. Only one service instance on the interface/media type can use priority tagged frames as a match criteria. 'defaultTagged' Service instance is a default service instance. The default service instance processes frames with VLANs that do not match to any other service instances configured on the interface/media type. Only one service instance on the interface/media type can be the default service instance.") cevcSIMatchEncapTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7), ) if mibBuilder.loadTexts: cevcSIMatchEncapTable.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapTable.setDescription("This table contains the encapsulation based match criteria for each service instance. This table has a sparse dependent relationship on the cevcSIMatchCriteriaTable, containing a row for each match criteria having one of the following values for cevcSIMatchCriteriaType: - 'dot1q' - 'dot1ad' - 'untaggedAndDot1q' - 'untaggedAndDot1ad' - 'priorityTagged'") cevcSIMatchEncapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex"), (0, "CISCO-EVC-MIB", "cevcSIMatchCriteriaIndex")) if mibBuilder.loadTexts: cevcSIMatchEncapEntry.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapEntry.setDescription("This entry represents a group of encapulation match criteria for a service instance. Entries in this table may be created and deleted via the cevcSIMatchEncapRowStatus object or the management console on the system. Using SNMP, rows are created by a SET request setting the value of cevcSIMatchEncapRowStatus column to 'createAndGo' or 'createAndWait'. Rows are deleted by a SET request setting the value of cevcSIMatchEncapRowStatus column to 'destroy'.") cevcSIMatchEncapRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1, 1), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchEncapRowStatus.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapRowStatus.setDescription("This object enables a SNMP peer to create, modify, and delete rows in the cevcSIMatchEncapTable. This object cannot be set to 'active' until cevcSIEncapEncapsulation and objects referred by cevcSIMatchEncapValid have been assigned their respective valid values. Writable objects in this table can be modified while the value of the cevcSIEncapMatchRowStatus column is 'active'.") cevcSIMatchEncapStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1, 2), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchEncapStorageType.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapStorageType.setDescription("This object specifies how the SNMP entity stores the data contained by the corresponding conceptual row. This object can be set to either 'volatile' or 'nonVolatile'. Other values are not applicable for this conceptual row and are not supported.") cevcSIMatchEncapValid = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1, 3), Bits().clone(namedValues=NamedValues(("primaryCos", 0), ("secondaryCos", 1), ("payloadType", 2), ("payloadTypes", 3), ("priorityCos", 4), ("dot1qNativeVlan", 5), ("dot1adNativeVlan", 6), ("encapExact", 7)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchEncapValid.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapValid.setDescription("This object specifies the encapsulation criteria used to match a service instance. 'primaryCos' The 'primaryCos' bit set to '1' specifies the Class of Service is used as service match criteria for the service instance. When this bit is set to '1' there must exist aleast one active rows in the cevcSIPrimaryVlanTable which has the same index values of cevcSIIndex and cevcSIMatchCriteriaIndex. When 'primaryCos' bit is '1', the cevcSIPrimaryCos column indicates the CoS value(s). 'secondaryCos' The 'secondaryCos' bit set to '1' specifies the Class of Service is used as service match criteria for the service instance. When this bit is set to '1' there must exist aleast one active rows in the cevcSISecondaryVlanTable which has the same index values of cevcSIIndex and cevcSIMatchCriteriaIndex. When 'secondaryCos' bit is '1', the cevcSISecondaryCos column indicates the CoS value(s). 'payloadType' This bit set to '1' specifies that the value of corresponding instance of cevcSIMatchEncapPayloadType is used as service match criteria for the service instance. 'payloadTypes' This bit set to '1' specifies that the value of corresponding instance of cevcSIMatchEncapPayloadTypes is used as service match criteria for the service instance. 'priorityCos' This bit set to '1' specifies that the value of corresponding instance of cevcSIMatchEncapPriorityCos is used as service match criteria for the service instance. 'dot1qNativeVlan' This bit set to '1' specifies that the IEEE 802.1q tag with native vlan is used as service match criteria for the service instance. 'dot1adNativeVlan' This bit set to '1' specifies that the IEEE 802.1ad tag with native vlan is used as service match criteria for the service instance. 'encapExact' This bit set to '1' specifies that a service frame is mapped to the service instance only if it matches exactly to the encapsulation specified by the service instance.") cevcSIMatchEncapEncapsulation = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("dot1qEthertype0x8100", 1), ("dot1qEthertype0x9100", 2), ("dot1qEthertype0x9200", 3), ("dot1qEthertype0x88A8", 4), ("dot1adEthertype0x88A8", 5), ("dot1ahEthertype0x88A8", 6)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchEncapEncapsulation.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapEncapsulation.setDescription("This object specifies the encapsulation type used as service match criteria. The object also specifies the Ethertype for egress packets on the service instance. 'dot1qEthertype0x8100' The IEEE 801.1q encapsulation with ether type value 0x8100. 'dot1qEthertype0x9100' The IEEE 801.1q encapsulation with ether type value 0x9100. 'dot1qEthertype0x9200' The IEEE 801.1q encapsulation with ether type value 0x9200. 'dot1qEthertype0x88A8' The IEEE 801.1q encapsulation with ether type value 0x88A8. 'dot1adEthertype0x88A8' The IEEE 801.1ad encapsulation with ether type value 0x88A8. 'dot1ahEthertype0x88A8' The IEEE 801.1ah encapsulation with ether type value 0x88A8.") cevcSIMatchEncapPrimaryCos = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1, 5), CiscoCosList()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchEncapPrimaryCos.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapPrimaryCos.setDescription("This object specifies the CoS values which the Service Instance uses as service match criteria. This object is valid only when 'primaryVlans' and 'primaryCos' bits are set to '1' in corresponding instance of the object cevcSIMatchEncapValid.") cevcSIMatchEncapSecondaryCos = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1, 6), CiscoCosList()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchEncapSecondaryCos.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapSecondaryCos.setDescription("This object specifies the CoS values which the Service Instance uses as service match criteria. This object is valid only when 'secondaryVlans' and 'secondaryCos' bits are set to '1' in corresponding instance of the object cevcSIMatchEncapValid.") cevcSIMatchEncapPayloadType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("payloadType0x0800ip", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchEncapPayloadType.setStatus('deprecated') if mibBuilder.loadTexts: cevcSIMatchEncapPayloadType.setDescription("This object specifies the PayloadType(etype/protocol type) values that the service instance uses as a service match criteria. This object is required when the forwarding of layer-2 ethernet packet is done through the payloadType i.e IP etc. 'other' None of the following. 'payloadType0x0800ip' Payload type value for IP is 0x0800. This object is valid only when 'payloadType' bit is set to '1' in corresponding instance of the object cevcSIMatchEncapValid. This object is deprecated by cevcSIMatchEncapPayloadTypes.") cevcSIMatchEncapPayloadTypes = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1, 8), Bits().clone(namedValues=NamedValues(("payloadTypeIPv4", 0), ("payloadTypeIPv6", 1), ("payloadTypePPPoEDiscovery", 2), ("payloadTypePPPoESession", 3), ("payloadTypePPPoEAll", 4)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchEncapPayloadTypes.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapPayloadTypes.setDescription("This object specifies the etype/protocol type values that service instance uses as a service match criteria. This object is required when the forwarding of layer-2 ethernet packet is done through the payload ether type i.e IP etc. 'payloadTypeIPv4' Ethernet payload type value for IPv4 protocol. 'payloadTypeIPv6' Ethernet payload type value for IPv6 protocol. 'payloadTypePPPoEDiscovery' Ethernet payload type value for PPPoE discovery stage. 'payloadTypePPPoESession' Ethernet payload type value for PPPoE session stage. 'payloadTypePPPoEAll' All ethernet payload type values for PPPoE protocol. This object is valid only when 'payloadTypes' bit is set to '1' in corresponding instance of the object cevcSIMatchEncapValid. This object deprecates cevcSIMatchEncapPayloadType.") cevcSIMatchEncapPriorityCos = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 7, 1, 9), CiscoCosList()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIMatchEncapPriorityCos.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchEncapPriorityCos.setDescription("This object specifies the priority CoS values which the service instance uses as service match criteria. This object is valid only when 'priorityCos' bit is set to '1' in corresponding instance of the object cevcSIMatchEncapValid.") cevcSIPrimaryVlanTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 8), ) if mibBuilder.loadTexts: cevcSIPrimaryVlanTable.setStatus('current') if mibBuilder.loadTexts: cevcSIPrimaryVlanTable.setDescription('This table contains the primary VLAN ID list for each Service Instance. This table has an expansion dependent relationship on the cevcSIMatchEncapTable, containing zero or more rows for each encapsulation match criteria.') cevcSIPrimaryVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 8, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex"), (0, "CISCO-EVC-MIB", "cevcSIMatchCriteriaIndex"), (0, "CISCO-EVC-MIB", "cevcSIPrimaryVlanBeginningVlan")) if mibBuilder.loadTexts: cevcSIPrimaryVlanEntry.setStatus('current') if mibBuilder.loadTexts: cevcSIPrimaryVlanEntry.setDescription("This entry specifies a single VLAN or a range of VLANs contained in the primary VLAN list that's part of the encapsulation match criteria. Entries in this table may be created and deleted via the cevcSIPrimaryVlanRowStatus object or the management console on the system. Using SNMP, rows are created by a SET request setting the value of the cevcSIPrimaryVlanRowStatus column to 'createAndGo' or 'createAndWait'. Rows are deleted by a SET request setting the value of the cevcSIPrimaryVlanRowStatus column to 'destroy'.") cevcSIPrimaryVlanBeginningVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 8, 1, 1), VlanId()) if mibBuilder.loadTexts: cevcSIPrimaryVlanBeginningVlan.setStatus('current') if mibBuilder.loadTexts: cevcSIPrimaryVlanBeginningVlan.setDescription("If cevcSIPrimaryVlanEndingVlan is '0', then this object indicates a single VLAN in the list. If cevcSIPrimaryVlanEndingVlan is not '0', then this object indicates the first VLAN in a range of VLANs.") cevcSIPrimaryVlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 8, 1, 2), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIPrimaryVlanRowStatus.setStatus('current') if mibBuilder.loadTexts: cevcSIPrimaryVlanRowStatus.setDescription("This object enables a SNMP peer to create, modify, and delete rows in the cevcSIPrimaryVlanTable. This column cannot be set to 'active' until all objects have been assigned valid values. Writable objects in this table can be modified while the value of the cevcSIPrimaryVlanRowStatus column is 'active'.") cevcSIPrimaryVlanStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 8, 1, 3), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIPrimaryVlanStorageType.setStatus('current') if mibBuilder.loadTexts: cevcSIPrimaryVlanStorageType.setDescription("This object specifies how the SNMP entity stores the data contained by the corresponding conceptual row. This object can be set to either 'volatile' or 'nonVolatile'. Other values are not applicable for this conceptual row and are not supported.") cevcSIPrimaryVlanEndingVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 8, 1, 4), VlanIdOrNone()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIPrimaryVlanEndingVlan.setStatus('current') if mibBuilder.loadTexts: cevcSIPrimaryVlanEndingVlan.setDescription("This object indicates the last VLAN in a range of VLANs. If the row does not describe a range, then the value of this column must be '0'.") cevcSISecondaryVlanTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 9), ) if mibBuilder.loadTexts: cevcSISecondaryVlanTable.setStatus('current') if mibBuilder.loadTexts: cevcSISecondaryVlanTable.setDescription('This table contains the seconadary VLAN ID list for each service instance. This table has an expansion dependent relationship on the cevcSIMatchEncapTable, containing zero or more rows for each encapsulation match criteria.') cevcSISecondaryVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 9, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex"), (0, "CISCO-EVC-MIB", "cevcSIMatchCriteriaIndex"), (0, "CISCO-EVC-MIB", "cevcSISecondaryVlanBeginningVlan")) if mibBuilder.loadTexts: cevcSISecondaryVlanEntry.setStatus('current') if mibBuilder.loadTexts: cevcSISecondaryVlanEntry.setDescription("This entry specifies a single VLAN or a range of VLANs contained in the secondary VLAN list that's part of the encapsulation match criteria. Entries in this table may be created and deleted via the cevcSISecondaryVlanRowStatus object or the management console on the system. Using SNMP, rows are created by a SET request setting the value of the cevcSISecondaryVlanRowStatus column to 'createAndGo' or 'createAndWait'. Rows are deleted by a SET request setting the value of the cevcSISecondaryVlanRowStatus column to 'destroy'.") cevcSISecondaryVlanBeginningVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 9, 1, 1), VlanId()) if mibBuilder.loadTexts: cevcSISecondaryVlanBeginningVlan.setStatus('current') if mibBuilder.loadTexts: cevcSISecondaryVlanBeginningVlan.setDescription("If cevcSISecondaryVlanEndingVlan is '0', then this object indicates a single VLAN in the list. If cevcSISecondaryVlanEndingVlan is not '0', then this object indicates the first VLAN in a range of VLANs.") cevcSISecondaryVlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 9, 1, 2), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSISecondaryVlanRowStatus.setStatus('current') if mibBuilder.loadTexts: cevcSISecondaryVlanRowStatus.setDescription("This object enables a SNMP peer to create, modify, and delete rows in the cevcSISecondaryVlanTable. This column can not be set to 'active' until all objects have been assigned valid values. Writable objects in this table can be modified while the value of cevcSISecondaryVlanRowStatus column is 'active'.") cevcSISecondaryVlanStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 9, 1, 3), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSISecondaryVlanStorageType.setStatus('current') if mibBuilder.loadTexts: cevcSISecondaryVlanStorageType.setDescription("This object specifies how the SNMP entity stores the data contained by the corresponding conceptual row. This object can be set to either 'volatile' or 'nonVolatile'. Other values are not applicable for this conceptual row and are not supported.") cevcSISecondaryVlanEndingVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 9, 1, 4), VlanIdOrNone()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSISecondaryVlanEndingVlan.setStatus('current') if mibBuilder.loadTexts: cevcSISecondaryVlanEndingVlan.setDescription("This object indicates the last VLAN in a range of VLANs. If the row does not describe a range, then the value of this column must be '0'.") cevcSIForwardBdTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10), ) if mibBuilder.loadTexts: cevcSIForwardBdTable.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardBdTable.setDescription("This table contains the forwarding bridge domain information for each service instance. This table has a sparse dependent relationship on the cevcSITable, containing a row for each service instance having a cevcSIForwardingType of 'bridgeDomain'.") cevcSIForwardBdEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10, 1), ).setIndexNames((0, "CISCO-EVC-MIB", "cevcSIIndex")) if mibBuilder.loadTexts: cevcSIForwardBdEntry.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardBdEntry.setDescription("This entry represents an bridged domain used to forward service frames by the service instance. Entries in this table may be created and deleted via the cevcSIForwardBdRowStatus object or the management console on the system. Using SNMP, rows are created by a SET request setting the value of the cevcSIForwardBdRowStatus column to 'createAndGo' or 'createAndWait'. Rows are deleted by a SET request setting the value of the cevcSIForwardBdRowStatus column to 'destroy'.") cevcSIForwardBdRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10, 1, 1), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIForwardBdRowStatus.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardBdRowStatus.setDescription("This object enables a SNMP peer to create, modify, and delete rows in the cevcSIForwardBdTable. This column can not be set to 'active' until all objects have been assigned valid values. Writable objects in this table can be modified while the value of the cevcSIForwardBdRowStatus column is 'active'.") cevcSIForwardBdStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10, 1, 2), StorageType().clone('volatile')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIForwardBdStorageType.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardBdStorageType.setDescription("This object specifies how the SNMP entity stores the data contained by the corresponding conceptual row. This object can be set to either 'volatile' or 'nonVolatile'. Other values are not applicable for this conceptual row and are not supported.") cevcSIForwardBdNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10, 1, 3), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIForwardBdNumber.setStatus('deprecated') if mibBuilder.loadTexts: cevcSIForwardBdNumber.setDescription('The bridge domain identifier that is associated with the service instance. A bridge domain refers to a layer 2 broadcast domain spanning a set of physical or virtual ports. Frames are switched Multicast and unknown destination unicast frames are flooded within the confines of the bridge domain.') cevcSIForwardBdNumberBase = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 4096, 8192, 12288, 16384))).clone(namedValues=NamedValues(("bdNumBase0", 0), ("bdNumBase4096", 4096), ("bdNumBase8192", 8192), ("bdNumBase12288", 12288), ("bdNumBase16384", 16384)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIForwardBdNumberBase.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardBdNumberBase.setDescription('This object specifies the base of bridge domain. The bridge domain range is 1~16k, cevcSIForwardBdNumberBase is to track what is the base of each 4k bitmap. In this way we can specify all the 16k bridge domains using four 1k bitmaps and having the base which describes that is the base of each 4k bitmap. The four 1k bitmaps, cevcSIForwardBdNumber1kBitmap represents 0~1023, cevcSIForwardBdNumber2kBitmap represents 1024~2047, cevcSIForwardBdNumber3kBitmap represents 2048~3071, cevcSIForwardBdNumber4kBitmap represents 3072~4095 And cevcSIForwardBdNumberBase is one of 0, 4096, 8192, 12288, 16384. SNMP Administrator can use cevcSIForwardBdNumberBase + (position of the set bit in four 1k bitmaps) to get BD number of a service instance.') cevcSIForwardBdNumber1kBitmap = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIForwardBdNumber1kBitmap.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardBdNumber1kBitmap.setDescription("This object specifies a string of octets containing one bit per Bridge domain per service instance(generally we have one bridge domain per nontrunk service instance but can have more than one bridge configured with a trunk service instance). The first octet corresponds to Bridge domains with Bridge domain ID values of 0 through 7; the second octet to Bridge domains 8 through 15; etc. Thus, this 128-octet bitmap represents bridge domain ID value 0~1023. For each Bridge domain configured, the bit corresponding to that bridge domain is set to '1'. SNMP Administrator uses cevcSIForwardBdNumberBase + (position of the set bit in bitmap)to calculate BD number of a service instance. Note that if the length of this string is less than 128 octets, any 'missing' octets are assumed to contain the value zero. An NMS may omit any zero-valued octets from the end of this string in order to reduce SetPDU size, and the agent may also omit zero-valued trailing octets, to reduce the size of GetResponse PDUs.") cevcSIForwardBdNumber2kBitmap = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIForwardBdNumber2kBitmap.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardBdNumber2kBitmap.setDescription("This object specifies a string of octets containing one bit per Bridge domain per service instance(generally we have one bridge domain per nontrunk service instance but can have more than one bridge configured with a trunk service instance). The first octet corresponds to Bridge domains with Bridge domain ID values of 1024 through 1031; the second octet to Bridge domains 1032 through 1039; etc. Thus, this 128-octet bitmap represents bridge domain ID value 1024~2047. For each Bridge domain configured, the bit corresponding to that bridge domain is set to 1. SNMP Administrator uses cevcSIForwardBdNumberBase + (position of the set bit in bitmap)to calculate BD number of a service instance. Note that if the length of this string is less than 128 octets, any 'missing' octets are assumed to contain the value zero. An NMS may omit any zero-valued octets from the end of this string in order to reduce SetPDU size, and the agent may also omit zero-valued trailing octets, to reduce the size of GetResponse PDUs.") cevcSIForwardBdNumber3kBitmap = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIForwardBdNumber3kBitmap.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardBdNumber3kBitmap.setDescription("This object specifies a string of octets containing one bit per Bridge domain per service instance(generally we have one bridge domain per non-trunk service instance but can have more than one bridge configured with a trunk service instance). The first octet corresponds to Bridge domains with Bridgedomain ID values of 2048 through 2055; the second octet to Bridge domains 2056 through 2063; etc. Thus, this 128-octet bitmap represents bridge domain ID value 2048~3071. For each Bridge domain configured, the bit corresponding to that bridge domain is set to 1. SNMP Administrator uses cevcSIForwardBdNumberBase + (position of the set bit in bitmap)to calculate BD number of a service instance. Note that if the length of this string is less than 128 octets, any 'missing' octets are assumed to contain the value zero. An NMS may omit any zero-valued octets from the end of this string in order to reduce SetPDU size, and the agent may also omit zero-valued trailing octets, to reduce the size of GetResponse PDUs.") cevcSIForwardBdNumber4kBitmap = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 4, 10, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cevcSIForwardBdNumber4kBitmap.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardBdNumber4kBitmap.setDescription("This object specifies a string of octets containing one bit per Bridge domain per service instance(generally we have one bridge domain per non-trunk service instance but can have more than one bridge configured with a trunk service instance). The first octet corresponds to Bridge domains with Bridgedomain ID values of 3078 through 3085; the second octet to Bridge domains 3086 through 3093; etc. Thus, this 128-octet bitmap represents bridge domain ID value 3072~4095. For each Bridge domain configured, the bit corresponding to that bridge domain is set to 1. SNMP Administrator uses cevcSIForwardBdNumberBase + (position of the set bit in bitmap)to calculate BD number of a service instance. Note that if the length of this string is less than 128 octets, any 'missing' octets are assumed to contain the value zero. An NMS may omit any zero-valued octets from the end of this string in order to reduce SetPDU size, and the agent may also omit zero-valued trailing octets, to reduce the size of GetResponse PDUs.") cevcEvcNotifyEnabled = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 613, 1, 5, 1), Bits().clone(namedValues=NamedValues(("status", 0), ("creation", 1), ("deletion", 2), ("macSecurityViolation", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cevcEvcNotifyEnabled.setStatus('current') if mibBuilder.loadTexts: cevcEvcNotifyEnabled.setDescription("This object specifies the system generation of notification, including: 'status' This bit set to '1' specifies the system generation of cevcEvcStatusChangedNotification. 'creation' This bit set to '1' specifies the system generation of cevcEvcCreationNotification. 'deletion' This bit set to '1' specifices the system generation of cevcEvcDeletionNotification. 'macSecurityViolation' This bit set to '1' specifies the system generation of cevcMacSecurityViolation.") ciscoEvcNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 0, 0)) cevcEvcStatusChangedNotification = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 613, 0, 0, 1)).setObjects(("CISCO-EVC-MIB", "cevcEvcOperStatus"), ("CISCO-EVC-MIB", "cevcEvcCfgUnis"), ("CISCO-EVC-MIB", "cevcEvcActiveUnis")) if mibBuilder.loadTexts: cevcEvcStatusChangedNotification.setStatus('current') if mibBuilder.loadTexts: cevcEvcStatusChangedNotification.setDescription("A device generates this notification when an EVC's operational status changes, or the number of active UNIs associated with the EVC (cevcNumActiveUnis) changes.") cevcEvcCreationNotification = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 613, 0, 0, 2)).setObjects(("CISCO-EVC-MIB", "cevcEvcOperStatus")) if mibBuilder.loadTexts: cevcEvcCreationNotification.setStatus('current') if mibBuilder.loadTexts: cevcEvcCreationNotification.setDescription('A device generates this notification upon the creation of an EVC.') cevcEvcDeletionNotification = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 613, 0, 0, 3)).setObjects(("CISCO-EVC-MIB", "cevcEvcOperStatus")) if mibBuilder.loadTexts: cevcEvcDeletionNotification.setStatus('current') if mibBuilder.loadTexts: cevcEvcDeletionNotification.setDescription('A device generates this notification upon the deletion of an EVC.') cevcMacSecurityViolationNotification = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 613, 0, 0, 4)).setObjects(("IF-MIB", "ifIndex"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumberBase"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumber1kBitmap"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumber2kBitmap"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumber3kBitmap"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumber4kBitmap"), ("CISCO-EVC-MIB", "cevcSIID"), ("CISCO-EVC-MIB", "cevcMacAddress"), ("CISCO-EVC-MIB", "cevcMaxMacConfigLimit"), ("CISCO-EVC-MIB", "cevcViolationCause")) if mibBuilder.loadTexts: cevcMacSecurityViolationNotification.setStatus('current') if mibBuilder.loadTexts: cevcMacSecurityViolationNotification.setDescription("A SNMP entity generates this notification in the following cases: When the system MAC Address limit is exceeded, the cevcMacSecurityViolationCauseType will contain 'exceedSystemLimit' value. When the Bridge domain limit is exceeded, the cevcMacSecurityViolationCauseType will contain 'exceedBdLimit' value. When the Service Instance limit is exceeded, the cevcMacSecurityViolationCauseType will contain 'exceedSILimit' value. If the MAC address is present in the Black list then cevcMacSecurityViolationCauseType will contain 'blackListDeny' value. Description of all the varbinds for this Notification is as follows: ifIndex indicates the interface index which identifies the interface that the service instance is attached. cevcSIForwardBdNumberBase indicates the base of bridge domain. The bridge domain range is 1~16k, this object is to track the base of each 4k bitmap. cevcSIForwardBdNumber1kBitmap indicates a string of octets containing one bit per Bridge domain per service instance. This 128-octet bitmap represents bridge domain ID values 0~1023. cevcSIForwardBdNumber2kBitmap indicates a string of octets containing one bit per Bridge domain per service instance. This 128-octet bitmap represents bridge domain ID values 1024~2047. cevcSIForwardBdNumber3kBitmap indicates a string of octets containing one bit per Bridge domain per service instance. This 128-octet bitmap represents bridge domain ID values 2048~3071. cevcSIForwardBdNumber4kBitmap indicates a string of octets containing one bit per Bridge domain per service instance. This 128-octet bitmap represents bridge domain ID values 3072~4095. cevcSIID indicates the service instance ID for the Mac security violation notification. cevcMacAddress indicates the Mac address which has violated the Mac security rules. cevcMaxMacConfigLimit indicates the maximum Mac configuration limit. This is also sent as a part of Mac security violation notification. cevcViolationCause indicates the Mac security violation cause.") ciscoEvcMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 1)) ciscoEvcMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2)) ciscoEvcMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 1, 1)).setObjects(("CISCO-EVC-MIB", "cevcSystemGroup"), ("CISCO-EVC-MIB", "cevcPortGroup"), ("CISCO-EVC-MIB", "cevcEvcGroup"), ("CISCO-EVC-MIB", "cevcSIGroup"), ("CISCO-EVC-MIB", "cevcEvcNotificationConfigGroup"), ("CISCO-EVC-MIB", "cevcEvcNotificationGroup"), ("CISCO-EVC-MIB", "cevcSICosMatchCriteriaGroup"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteGroup"), ("CISCO-EVC-MIB", "cevcSIMatchCriteriaGroup"), ("CISCO-EVC-MIB", "cevcSIForwardGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoEvcMIBCompliance = ciscoEvcMIBCompliance.setStatus('deprecated') if mibBuilder.loadTexts: ciscoEvcMIBCompliance.setDescription('The new compliance statement for entities which implement the CISCO-EVC-MIB.') ciscoEvcMIBComplianceRev1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 1, 2)).setObjects(("CISCO-EVC-MIB", "cevcSystemGroup"), ("CISCO-EVC-MIB", "cevcPortGroup"), ("CISCO-EVC-MIB", "cevcEvcGroup"), ("CISCO-EVC-MIB", "cevcSIGroup"), ("CISCO-EVC-MIB", "cevcEvcNotificationConfigGroup"), ("CISCO-EVC-MIB", "cevcEvcNotificationGroup"), ("CISCO-EVC-MIB", "cevcSICosMatchCriteriaGroup"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteGroup"), ("CISCO-EVC-MIB", "cevcSIMatchCriteriaGroupRev1"), ("CISCO-EVC-MIB", "cevcSIForwardGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoEvcMIBComplianceRev1 = ciscoEvcMIBComplianceRev1.setStatus('deprecated') if mibBuilder.loadTexts: ciscoEvcMIBComplianceRev1.setDescription('The compliance statement for entities which implement the CISCO-EVC-MIB. This compliance module deprecates ciscoEvcMIBCompliance.') ciscoEvcMIBComplianceRev2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 1, 3)).setObjects(("CISCO-EVC-MIB", "cevcSystemGroup"), ("CISCO-EVC-MIB", "cevcPortGroup"), ("CISCO-EVC-MIB", "cevcEvcGroup"), ("CISCO-EVC-MIB", "cevcSIGroupRev1"), ("CISCO-EVC-MIB", "cevcEvcNotificationConfigGroup"), ("CISCO-EVC-MIB", "cevcEvcNotificationGroupRev1"), ("CISCO-EVC-MIB", "cevcSICosMatchCriteriaGroup"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteGroup"), ("CISCO-EVC-MIB", "cevcSIMatchCriteriaGroupRev1"), ("CISCO-EVC-MIB", "cevcSIForwardGroupRev1"), ("CISCO-EVC-MIB", "cevcMacSecurityViolationGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoEvcMIBComplianceRev2 = ciscoEvcMIBComplianceRev2.setStatus('current') if mibBuilder.loadTexts: ciscoEvcMIBComplianceRev2.setDescription('The compliance statement for entities which implement the CISCO-EVC-MIB. This compliance module deprecates ciscoEvcMIBComplianceRev1.') cevcSystemGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 1)).setObjects(("CISCO-EVC-MIB", "cevcMaxNumEvcs"), ("CISCO-EVC-MIB", "cevcNumCfgEvcs")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcSystemGroup = cevcSystemGroup.setStatus('current') if mibBuilder.loadTexts: cevcSystemGroup.setDescription('A collection of objects providing system configuration of EVCs.') cevcPortGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 2)).setObjects(("CISCO-EVC-MIB", "cevcPortMode"), ("CISCO-EVC-MIB", "cevcPortMaxNumEVCs"), ("CISCO-EVC-MIB", "cevcPortMaxNumServiceInstances"), ("CISCO-EVC-MIB", "cevcPortL2ControlProtocolAction"), ("CISCO-EVC-MIB", "cevcUniIdentifier"), ("CISCO-EVC-MIB", "cevcUniPortType"), ("CISCO-EVC-MIB", "cevcUniServiceAttributes"), ("CISCO-EVC-MIB", "cevcUniCEVlanEvcEndingVlan")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcPortGroup = cevcPortGroup.setStatus('current') if mibBuilder.loadTexts: cevcPortGroup.setDescription('A collection of objects providing configuration for ports in an EVC.') cevcEvcGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 3)).setObjects(("CISCO-EVC-MIB", "cevcEvcIdentifier"), ("CISCO-EVC-MIB", "cevcEvcType"), ("CISCO-EVC-MIB", "cevcEvcOperStatus"), ("CISCO-EVC-MIB", "cevcEvcCfgUnis"), ("CISCO-EVC-MIB", "cevcEvcActiveUnis"), ("CISCO-EVC-MIB", "cevcEvcStorageType"), ("CISCO-EVC-MIB", "cevcEvcRowStatus"), ("CISCO-EVC-MIB", "cevcEvcUniId"), ("CISCO-EVC-MIB", "cevcEvcUniOperStatus"), ("CISCO-EVC-MIB", "cevcEvcLocalUniIfIndex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcEvcGroup = cevcEvcGroup.setStatus('current') if mibBuilder.loadTexts: cevcEvcGroup.setDescription('A collection of objects providing configuration and status information for EVCs.') cevcSIGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 4)).setObjects(("CISCO-EVC-MIB", "cevcSIName"), ("CISCO-EVC-MIB", "cevcSITargetType"), ("CISCO-EVC-MIB", "cevcSITarget"), ("CISCO-EVC-MIB", "cevcSIEvcIndex"), ("CISCO-EVC-MIB", "cevcSIRowStatus"), ("CISCO-EVC-MIB", "cevcSIStorageType"), ("CISCO-EVC-MIB", "cevcSIAdminStatus"), ("CISCO-EVC-MIB", "cevcSIOperStatus"), ("CISCO-EVC-MIB", "cevcSIL2ControlProtocolAction"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteAction"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteEncapsulation"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteVlan1"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteVlan2"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteSymmetric"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteStorageType"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteRowStatus"), ("CISCO-EVC-MIB", "cevcSIForwardingType"), ("CISCO-EVC-MIB", "cevcSICEVlanRowStatus"), ("CISCO-EVC-MIB", "cevcSICEVlanStorageType"), ("CISCO-EVC-MIB", "cevcSICEVlanEndingVlan"), ("CISCO-EVC-MIB", "cevcSIMatchStorageType"), ("CISCO-EVC-MIB", "cevcSIMatchRowStatus"), ("CISCO-EVC-MIB", "cevcSIMatchCriteriaType"), ("CISCO-EVC-MIB", "cevcSIMatchEncapRowStatus"), ("CISCO-EVC-MIB", "cevcSIMatchEncapStorageType"), ("CISCO-EVC-MIB", "cevcSIMatchEncapValid"), ("CISCO-EVC-MIB", "cevcSIMatchEncapEncapsulation"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanRowStatus"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanStorageType"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanEndingVlan")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcSIGroup = cevcSIGroup.setStatus('deprecated') if mibBuilder.loadTexts: cevcSIGroup.setDescription('A collection of objects providing configuration and match criteria for service instances. cevcSIGroup object is superseded by cevcSIGroupRev1.') cevcSIVlanRewriteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 5)).setObjects(("CISCO-EVC-MIB", "cevcSIVlanRewriteAction"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteEncapsulation"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteVlan1"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteVlan2"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteSymmetric"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteStorageType"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcSIVlanRewriteGroup = cevcSIVlanRewriteGroup.setStatus('current') if mibBuilder.loadTexts: cevcSIVlanRewriteGroup.setDescription('A collection of objects which provides VLAN rewrite information for a service instance.') cevcSICosMatchCriteriaGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 6)).setObjects(("CISCO-EVC-MIB", "cevcSIMatchEncapPrimaryCos"), ("CISCO-EVC-MIB", "cevcSIMatchEncapSecondaryCos")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcSICosMatchCriteriaGroup = cevcSICosMatchCriteriaGroup.setStatus('current') if mibBuilder.loadTexts: cevcSICosMatchCriteriaGroup.setDescription('A collection of objects which provides CoS match criteria for a service instance.') cevcSIMatchCriteriaGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 7)).setObjects(("CISCO-EVC-MIB", "cevcSIMatchRowStatus"), ("CISCO-EVC-MIB", "cevcSIMatchStorageType"), ("CISCO-EVC-MIB", "cevcSIMatchCriteriaType"), ("CISCO-EVC-MIB", "cevcSIMatchEncapRowStatus"), ("CISCO-EVC-MIB", "cevcSIMatchEncapStorageType"), ("CISCO-EVC-MIB", "cevcSIMatchEncapValid"), ("CISCO-EVC-MIB", "cevcSIMatchEncapEncapsulation"), ("CISCO-EVC-MIB", "cevcSIMatchEncapPrimaryCos"), ("CISCO-EVC-MIB", "cevcSIMatchEncapSecondaryCos"), ("CISCO-EVC-MIB", "cevcSIMatchEncapPayloadType"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanRowStatus"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanStorageType"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanEndingVlan"), ("CISCO-EVC-MIB", "cevcSISecondaryVlanRowStatus"), ("CISCO-EVC-MIB", "cevcSISecondaryVlanStorageType"), ("CISCO-EVC-MIB", "cevcSISecondaryVlanEndingVlan")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcSIMatchCriteriaGroup = cevcSIMatchCriteriaGroup.setStatus('deprecated') if mibBuilder.loadTexts: cevcSIMatchCriteriaGroup.setDescription('A collection of objects providing match criteria information for service instances. cevcSIMatchCriteriaGroup object is superseded by cevcSIMatchCriteriaGroupRev1.') cevcSIForwardGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 8)).setObjects(("CISCO-EVC-MIB", "cevcSIForwardingType"), ("CISCO-EVC-MIB", "cevcSIForwardBdRowStatus"), ("CISCO-EVC-MIB", "cevcSIForwardBdStorageType"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumber")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcSIForwardGroup = cevcSIForwardGroup.setStatus('deprecated') if mibBuilder.loadTexts: cevcSIForwardGroup.setDescription('A collection of objects providing service frame forwarding information for service instances. cevcSIForwardGroup object is superseded by cevcSIForwardGroupRev1.') cevcEvcNotificationConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 9)).setObjects(("CISCO-EVC-MIB", "cevcEvcNotifyEnabled")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcEvcNotificationConfigGroup = cevcEvcNotificationConfigGroup.setStatus('current') if mibBuilder.loadTexts: cevcEvcNotificationConfigGroup.setDescription('A collection of objects for configuring notification of this MIB.') cevcEvcNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 10)).setObjects(("CISCO-EVC-MIB", "cevcEvcStatusChangedNotification"), ("CISCO-EVC-MIB", "cevcEvcCreationNotification"), ("CISCO-EVC-MIB", "cevcEvcDeletionNotification")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcEvcNotificationGroup = cevcEvcNotificationGroup.setStatus('deprecated') if mibBuilder.loadTexts: cevcEvcNotificationGroup.setDescription('A collection of notifications that this MIB module is required to implement. cevcEvcNotificationGroup object is superseded by cevcEvcNotificationGroupRev1.') cevcSIMatchCriteriaGroupRev1 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 11)).setObjects(("CISCO-EVC-MIB", "cevcSIMatchRowStatus"), ("CISCO-EVC-MIB", "cevcSIMatchStorageType"), ("CISCO-EVC-MIB", "cevcSIMatchCriteriaType"), ("CISCO-EVC-MIB", "cevcSIMatchEncapRowStatus"), ("CISCO-EVC-MIB", "cevcSIMatchEncapStorageType"), ("CISCO-EVC-MIB", "cevcSIMatchEncapValid"), ("CISCO-EVC-MIB", "cevcSIMatchEncapEncapsulation"), ("CISCO-EVC-MIB", "cevcSIMatchEncapPrimaryCos"), ("CISCO-EVC-MIB", "cevcSIMatchEncapSecondaryCos"), ("CISCO-EVC-MIB", "cevcSIMatchEncapPayloadTypes"), ("CISCO-EVC-MIB", "cevcSIMatchEncapPriorityCos"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanRowStatus"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanStorageType"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanEndingVlan"), ("CISCO-EVC-MIB", "cevcSISecondaryVlanRowStatus"), ("CISCO-EVC-MIB", "cevcSISecondaryVlanStorageType"), ("CISCO-EVC-MIB", "cevcSISecondaryVlanEndingVlan")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcSIMatchCriteriaGroupRev1 = cevcSIMatchCriteriaGroupRev1.setStatus('current') if mibBuilder.loadTexts: cevcSIMatchCriteriaGroupRev1.setDescription('A collection of objects providing match criteria information for service instances. This group deprecates the old group cevcSIMatchCriteriaGroup.') cevcEvcNotificationGroupRev1 = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 12)).setObjects(("CISCO-EVC-MIB", "cevcEvcStatusChangedNotification"), ("CISCO-EVC-MIB", "cevcEvcCreationNotification"), ("CISCO-EVC-MIB", "cevcEvcDeletionNotification"), ("CISCO-EVC-MIB", "cevcMacSecurityViolationNotification")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcEvcNotificationGroupRev1 = cevcEvcNotificationGroupRev1.setStatus('current') if mibBuilder.loadTexts: cevcEvcNotificationGroupRev1.setDescription('A collection of notifications that this MIB module is required to implement. This module deprecates the cevcNotificationGroup') cevcSIGroupRev1 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 13)).setObjects(("CISCO-EVC-MIB", "cevcSIName"), ("CISCO-EVC-MIB", "cevcSITargetType"), ("CISCO-EVC-MIB", "cevcSITarget"), ("CISCO-EVC-MIB", "cevcSIEvcIndex"), ("CISCO-EVC-MIB", "cevcSIRowStatus"), ("CISCO-EVC-MIB", "cevcSIStorageType"), ("CISCO-EVC-MIB", "cevcSIAdminStatus"), ("CISCO-EVC-MIB", "cevcSIOperStatus"), ("CISCO-EVC-MIB", "cevcPortL2ControlProtocolAction"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteAction"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteEncapsulation"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteVlan1"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteVlan2"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteSymmetric"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteRowStatus"), ("CISCO-EVC-MIB", "cevcSIVlanRewriteStorageType"), ("CISCO-EVC-MIB", "cevcSIForwardingType"), ("CISCO-EVC-MIB", "cevcSICEVlanRowStatus"), ("CISCO-EVC-MIB", "cevcSICEVlanStorageType"), ("CISCO-EVC-MIB", "cevcSICEVlanEndingVlan"), ("CISCO-EVC-MIB", "cevcSIMatchStorageType"), ("CISCO-EVC-MIB", "cevcSIMatchCriteriaType"), ("CISCO-EVC-MIB", "cevcSIMatchEncapRowStatus"), ("CISCO-EVC-MIB", "cevcSIMatchEncapStorageType"), ("CISCO-EVC-MIB", "cevcSIMatchEncapValid"), ("CISCO-EVC-MIB", "cevcSIMatchEncapEncapsulation"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanRowStatus"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanStorageType"), ("CISCO-EVC-MIB", "cevcSIPrimaryVlanEndingVlan"), ("CISCO-EVC-MIB", "cevcSIMatchRowStatus"), ("CISCO-EVC-MIB", "cevcSICreationType"), ("CISCO-EVC-MIB", "cevcSIType")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcSIGroupRev1 = cevcSIGroupRev1.setStatus('current') if mibBuilder.loadTexts: cevcSIGroupRev1.setDescription('A collection of objects providing configuration and match criteria for service instances. This module deprecates the cevcSIGroup') cevcSIForwardGroupRev1 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 14)).setObjects(("CISCO-EVC-MIB", "cevcSIForwardingType"), ("CISCO-EVC-MIB", "cevcSIForwardBdRowStatus"), ("CISCO-EVC-MIB", "cevcSIForwardBdStorageType"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumberBase"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumber1kBitmap"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumber2kBitmap"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumber3kBitmap"), ("CISCO-EVC-MIB", "cevcSIForwardBdNumber4kBitmap")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcSIForwardGroupRev1 = cevcSIForwardGroupRev1.setStatus('current') if mibBuilder.loadTexts: cevcSIForwardGroupRev1.setDescription('A collection of objects providing service frame forwarding information for service instances. This module deprecates cevcSIForwardGroup') cevcMacSecurityViolationGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 613, 2, 2, 15)).setObjects(("CISCO-EVC-MIB", "cevcMacAddress"), ("CISCO-EVC-MIB", "cevcMaxMacConfigLimit"), ("CISCO-EVC-MIB", "cevcSIID"), ("CISCO-EVC-MIB", "cevcViolationCause")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cevcMacSecurityViolationGroup = cevcMacSecurityViolationGroup.setStatus('current') if mibBuilder.loadTexts: cevcMacSecurityViolationGroup.setDescription('A collection of objects providing the maximum configured MAC limit, the MAC address, service instance ID and Violation cause for Mac Security Violation Information.') mibBuilder.exportSymbols("CISCO-EVC-MIB", cevcEvcStorageType=cevcEvcStorageType, cevcSIType=cevcSIType, cevcEvc=cevcEvc, cevcEvcUniOperStatus=cevcEvcUniOperStatus, ciscoEvcMIBCompliance=ciscoEvcMIBCompliance, cevcEvcUniTable=cevcEvcUniTable, cevcSystemGroup=cevcSystemGroup, cevcNumCfgEvcs=cevcNumCfgEvcs, cevcSICEVlanRowStatus=cevcSICEVlanRowStatus, cevcSIName=cevcSIName, cevcSICreationType=cevcSICreationType, cevcSIForwardBdNumberBase=cevcSIForwardBdNumberBase, cevcSIMatchEncapPayloadTypes=cevcSIMatchEncapPayloadTypes, cevcPortTable=cevcPortTable, ServiceInstanceTarget=ServiceInstanceTarget, cevcSIMatchEncapEntry=cevcSIMatchEncapEntry, PYSNMP_MODULE_ID=ciscoEvcMIB, cevcEvcCfgUnis=cevcEvcCfgUnis, cevcSIForwardGroupRev1=cevcSIForwardGroupRev1, cevcSIForwardBdEntry=cevcSIForwardBdEntry, cevcSIEvcIndex=cevcSIEvcIndex, cevcSIForwardBdNumber3kBitmap=cevcSIForwardBdNumber3kBitmap, cevcSIMatchCriteriaIndex=cevcSIMatchCriteriaIndex, cevcSIGroup=cevcSIGroup, cevcSIForwardBdTable=cevcSIForwardBdTable, cevcEvcUniId=cevcEvcUniId, cevcEvcStatusChangedNotification=cevcEvcStatusChangedNotification, cevcViolationCause=cevcViolationCause, cevcSIPrimaryVlanEntry=cevcSIPrimaryVlanEntry, cevcEvcGroup=cevcEvcGroup, cevcSIIndex=cevcSIIndex, cevcSIVlanRewriteVlan1=cevcSIVlanRewriteVlan1, cevcSITable=cevcSITable, cevcSISecondaryVlanStorageType=cevcSISecondaryVlanStorageType, cevcUniPortType=cevcUniPortType, cevcEvcStateTable=cevcEvcStateTable, cevcSIVlanRewriteSymmetric=cevcSIVlanRewriteSymmetric, cevcSIMatchEncapRowStatus=cevcSIMatchEncapRowStatus, cevcMacSecurityViolationNotification=cevcMacSecurityViolationNotification, cevcEvcNotificationGroupRev1=cevcEvcNotificationGroupRev1, ciscoEvcMIB=ciscoEvcMIB, ciscoEvcMIBComplianceRev1=ciscoEvcMIBComplianceRev1, cevcUniTable=cevcUniTable, cevcUniCEVlanEvcTable=cevcUniCEVlanEvcTable, cevcEvcOperStatus=cevcEvcOperStatus, ciscoEvcMIBNotifications=ciscoEvcMIBNotifications, ciscoEvcMIBComplianceRev2=ciscoEvcMIBComplianceRev2, cevcSIVlanRewriteEntry=cevcSIVlanRewriteEntry, cevcUniCEVlanEvcBeginningVlan=cevcUniCEVlanEvcBeginningVlan, cevcSIPrimaryVlanEndingVlan=cevcSIPrimaryVlanEndingVlan, cevcSIMatchEncapPayloadType=cevcSIMatchEncapPayloadType, cevcSISecondaryVlanRowStatus=cevcSISecondaryVlanRowStatus, cevcEvcStateEntry=cevcEvcStateEntry, cevcPortGroup=cevcPortGroup, cevcSIPrimaryVlanStorageType=cevcSIPrimaryVlanStorageType, cevcSIMatchCriteriaType=cevcSIMatchCriteriaType, cevcSICEVlanTable=cevcSICEVlanTable, cevcSITarget=cevcSITarget, cevcSIAdminStatus=cevcSIAdminStatus, cevcSIL2ControlProtocolType=cevcSIL2ControlProtocolType, ciscoEvcNotificationPrefix=ciscoEvcNotificationPrefix, CiscoEvcIndexOrZero=CiscoEvcIndexOrZero, cevcEvcIdentifier=cevcEvcIdentifier, cevcSIStateEntry=cevcSIStateEntry, cevcSIVlanRewriteTable=cevcSIVlanRewriteTable, cevcSIMatchCriteriaEntry=cevcSIMatchCriteriaEntry, cevcEvcRowStatus=cevcEvcRowStatus, cevcEvcNotificationGroup=cevcEvcNotificationGroup, cevcSIForwardBdNumber2kBitmap=cevcSIForwardBdNumber2kBitmap, cevcMaxNumEvcs=cevcMaxNumEvcs, cevcSIL2ControlProtocolTable=cevcSIL2ControlProtocolTable, cevcEvcUniIndex=cevcEvcUniIndex, cevcEvcIndex=cevcEvcIndex, cevcServiceInstance=cevcServiceInstance, cevcUniCEVlanEvcEntry=cevcUniCEVlanEvcEntry, cevcSICEVlanEntry=cevcSICEVlanEntry, cevcSIVlanRewriteDirection=cevcSIVlanRewriteDirection, cevcSIID=cevcSIID, cevcSIMatchEncapEncapsulation=cevcSIMatchEncapEncapsulation, ciscoEvcMIBObjects=ciscoEvcMIBObjects, ServiceInstanceTargetType=ServiceInstanceTargetType, cevcPort=cevcPort, cevcSIVlanRewriteVlan2=cevcSIVlanRewriteVlan2, cevcSIForwardBdNumber1kBitmap=cevcSIForwardBdNumber1kBitmap, cevcMaxMacConfigLimit=cevcMaxMacConfigLimit, cevcSIMatchEncapSecondaryCos=cevcSIMatchEncapSecondaryCos, cevcPortMaxNumServiceInstances=cevcPortMaxNumServiceInstances, cevcEvcNotifyEnabled=cevcEvcNotifyEnabled, cevcEvcType=cevcEvcType, cevcMacSecurityViolation=cevcMacSecurityViolation, cevcEvcDeletionNotification=cevcEvcDeletionNotification, ciscoEvcMIBGroups=ciscoEvcMIBGroups, cevcSIL2ControlProtocolAction=cevcSIL2ControlProtocolAction, cevcSIVlanRewriteGroup=cevcSIVlanRewriteGroup, cevcUniServiceAttributes=cevcUniServiceAttributes, cevcSIMatchRowStatus=cevcSIMatchRowStatus, cevcSICEVlanStorageType=cevcSICEVlanStorageType, cevcSICEVlanBeginningVlan=cevcSICEVlanBeginningVlan, cevcSIMatchEncapStorageType=cevcSIMatchEncapStorageType, cevcSIL2ControlProtocolEntry=cevcSIL2ControlProtocolEntry, cevcSIMatchCriteriaTable=cevcSIMatchCriteriaTable, cevcEvcActiveUnis=cevcEvcActiveUnis, cevcSIVlanRewriteAction=cevcSIVlanRewriteAction, ciscoEvcMIBCompliances=ciscoEvcMIBCompliances, cevcSICEVlanEndingVlan=cevcSICEVlanEndingVlan, cevcSIPrimaryVlanTable=cevcSIPrimaryVlanTable, cevcSIVlanRewriteEncapsulation=cevcSIVlanRewriteEncapsulation, cevcSIForwardingType=cevcSIForwardingType, cevcSISecondaryVlanBeginningVlan=cevcSISecondaryVlanBeginningVlan, cevcSystem=cevcSystem, ciscoEvcMIBConformance=ciscoEvcMIBConformance, cevcMacSecurityViolationGroup=cevcMacSecurityViolationGroup, cevcSIMatchEncapPriorityCos=cevcSIMatchEncapPriorityCos, cevcSIOperStatus=cevcSIOperStatus, CiscoEvcIndex=CiscoEvcIndex, cevcSIMatchCriteriaGroup=cevcSIMatchCriteriaGroup, cevcSITargetType=cevcSITargetType, cevcPortL2ControlProtocolTable=cevcPortL2ControlProtocolTable, cevcUniIdentifier=cevcUniIdentifier, cevcSISecondaryVlanTable=cevcSISecondaryVlanTable, cevcSIStorageType=cevcSIStorageType, CevcL2ControlProtocolType=CevcL2ControlProtocolType, cevcSIMatchCriteriaGroupRev1=cevcSIMatchCriteriaGroupRev1, cevcSICosMatchCriteriaGroup=cevcSICosMatchCriteriaGroup, cevcSIForwardGroup=cevcSIForwardGroup, cevcEvcUniEntry=cevcEvcUniEntry, cevcEvcNotificationConfigGroup=cevcEvcNotificationConfigGroup, cevcPortL2ControlProtocolAction=cevcPortL2ControlProtocolAction, CevcMacSecurityViolationCauseType=CevcMacSecurityViolationCauseType, cevcSIRowStatus=cevcSIRowStatus, cevcEvcEntry=cevcEvcEntry, cevcEvcCreationNotification=cevcEvcCreationNotification, cevcEvcLocalUniIfIndex=cevcEvcLocalUniIfIndex, cevcUniEntry=cevcUniEntry, cevcSIVlanRewriteRowStatus=cevcSIVlanRewriteRowStatus, cevcPortMaxNumEVCs=cevcPortMaxNumEVCs, cevcPortL2ControlProtocolType=cevcPortL2ControlProtocolType, cevcSISecondaryVlanEntry=cevcSISecondaryVlanEntry, cevcUniCEVlanEvcEndingVlan=cevcUniCEVlanEvcEndingVlan, cevcSIForwardBdRowStatus=cevcSIForwardBdRowStatus, cevcPortMode=cevcPortMode, cevcMacAddress=cevcMacAddress, cevcSIMatchEncapValid=cevcSIMatchEncapValid, cevcUniEvcIndex=cevcUniEvcIndex, cevcPortL2ControlProtocolEntry=cevcPortL2ControlProtocolEntry, cevcSIVlanRewriteStorageType=cevcSIVlanRewriteStorageType, cevcSIStateTable=cevcSIStateTable, cevcSIPrimaryVlanRowStatus=cevcSIPrimaryVlanRowStatus, cevcSIMatchEncapTable=cevcSIMatchEncapTable, cevcSISecondaryVlanEndingVlan=cevcSISecondaryVlanEndingVlan, cevcSIForwardBdNumber4kBitmap=cevcSIForwardBdNumber4kBitmap, cevcPortEntry=cevcPortEntry, cevcSIPrimaryVlanBeginningVlan=cevcSIPrimaryVlanBeginningVlan, ServiceInstanceInterface=ServiceInstanceInterface, cevcSIForwardBdNumber=cevcSIForwardBdNumber, cevcSIMatchEncapPrimaryCos=cevcSIMatchEncapPrimaryCos, cevcEvcTable=cevcEvcTable, cevcSIForwardBdStorageType=cevcSIForwardBdStorageType, cevcSIGroupRev1=cevcSIGroupRev1, cevcEvcNotificationConfig=cevcEvcNotificationConfig, cevcSIEntry=cevcSIEntry, cevcSIMatchStorageType=cevcSIMatchStorageType)
""" A module to show off dictionary comprehension. Dictionary comprehension is similar to list comprehension except that you put the generator expression inside of {} instead of []. Author: Walker M. White (wmw2) Date: October 28, 2020 """ GRADES = {'jrs1':80,'jrs2':92,'wmw2':50,'abc1':95} def histogram(s): """ Returns a histogram (dictionary) of the # of letters in string s. The letters in s are keys, and the count of each letter is the value. If the letter is not in s, then there is NO KEY for it in the histogram. Example: histogram('') returns {}, histogram('all') returns {'a':1,'l':2} histogram('abracadabra') returns {'a':5,'b':2,'c':1,'d':1,'r':2} Parameter s: The string to analyze Precondition: s is a string (possibly empty). """ # DICTIONARY COMPREHENSION #return { x:s.count(x) for x in s } # ACCUMULATOR PATTERN result = {} for x in s: result[x] = s.count(x) return result def halve_grades(grades): """ Returns a copy of grades, cutting all of the exam grades in half. Parameter grades: The dictionary of student grades Precondition: grades has netids as keys, ints as values. """ # DICTIONARY COMPREHENSION #return { k:grades[k]//2 for k in grades } # ACCUMULATOR PATTERN result = {} for k in grades: result[k] = grades[k]//2 return result def extra_credit(grades,students,bonus): """ Returns a copy of grades with extra credit assigned The dictionary returned adds a bonus to the grade of every student whose netid is in the list students. Parameter grades: The dictionary of student grades Precondition: grades has netids as keys, ints as values. Parameter netids: The list of students to give extra credit Precondition: netids is a list of valid (string) netids Parameter bonus: The extra credit bonus to award Precondition: bonus is an int """ # DICTIONARY COMPREHENSION #return { k:(grades[k]+bonus if k in students else grades[k]) for k in grades } # ACCUMULATOR PATTERN result = {} for k in grades: if k in students: result[k] = grades[k]+bonus else: result[k] = grades[k] return result
""" Model a record """ class Record(object): def __init__(self, gps_lat=None, gps_long=None, company_name=None, search_url=None, xpath_pattern=None, company_email=None): self.gps_lat = gps_lat self.gps_long = gps_long self.company_name = company_name self.search_url = search_url self.xpath_pattern = xpath_pattern self.company_email = company_email self.validate() def validate(self): # basic check if not self.gps_lat.isdecimal(): self.gps_lat = 0.0 else: self.gps_lat = float(self.gps_lat) if not self.gps_long.isdecimal(): self.gps_long = 0.0 else: self.gps_long = float(self.gps_long) # append /text() to xpath so we get text values if not self.xpath_pattern.endswith("text()"): self.xpath_pattern += "/text()"
# # PySNMP MIB module ALPHA-RECTIFIER-SYS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALPHA-RECTIFIER-SYS-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:20:50 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) # simple, ScaledNumber = mibBuilder.importSymbols("ALPHA-RESOURCE-MIB", "simple", "ScaledNumber") ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") TimeTicks, MibIdentifier, Unsigned32, IpAddress, ObjectIdentity, Gauge32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Counter32, Counter64, NotificationType, Integer32, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "MibIdentifier", "Unsigned32", "IpAddress", "ObjectIdentity", "Gauge32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Counter32", "Counter64", "NotificationType", "Integer32", "ModuleIdentity") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") rectifierSystem = ModuleIdentity((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1)) rectifierSystem.setRevisions(('2015-07-28 00:00', '2015-07-23 00:00', '2015-06-23 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: rectifierSystem.setRevisionsDescriptions((' Updated to follow MIB structure conformance rules. Tested with SimpleWeb: http://www.simpleweb.org Passed highest level of compliance. (level 6) ', 'Fixed MIB syntax warnings.', 'General revision.',)) if mibBuilder.loadTexts: rectifierSystem.setLastUpdated('201507280000Z') if mibBuilder.loadTexts: rectifierSystem.setOrganization('Alpha Technologies Ltd.') if mibBuilder.loadTexts: rectifierSystem.setContactInfo('Alpha Technologies Ltd. 7700 Riverfront Gate Burnaby, BC V5J 5M4 Canada Tel: 1-604-436-5900 Fax: 1-604-436-1233') if mibBuilder.loadTexts: rectifierSystem.setDescription('This MIB defines the notification block(s) available in system controllers.') rectSysTotalOutputCurrent = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 1), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysTotalOutputCurrent.setStatus('current') if mibBuilder.loadTexts: rectSysTotalOutputCurrent.setDescription(' Total accumulated output current of all the rectifiers associated with the current system. ') rectSysTotalOutputPower = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 2), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysTotalOutputPower.setStatus('current') if mibBuilder.loadTexts: rectSysTotalOutputPower.setDescription('Total output current of all system rectifiers.') rectSysTotalCapacityInstalledAmps = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 3), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysTotalCapacityInstalledAmps.setStatus('current') if mibBuilder.loadTexts: rectSysTotalCapacityInstalledAmps.setDescription('A rectifier output current multiplied by the number of rectifiers installed.') rectSysTotalCapacityInstalledPower = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 4), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysTotalCapacityInstalledPower.setStatus('current') if mibBuilder.loadTexts: rectSysTotalCapacityInstalledPower.setDescription('A rectifier output power multiplied by the number of rectifiers installed.') rectSysAverageRectifierOutputVoltage = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 5), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysAverageRectifierOutputVoltage.setStatus('current') if mibBuilder.loadTexts: rectSysAverageRectifierOutputVoltage.setDescription('Average rectifier output voltage.') rectSysAverageRectifierACInputVoltage = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 6), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysAverageRectifierACInputVoltage.setStatus('current') if mibBuilder.loadTexts: rectSysAverageRectifierACInputVoltage.setDescription('Average rectifier input voltage.') rectSysAveragePhase1Voltage = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 7), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysAveragePhase1Voltage.setStatus('current') if mibBuilder.loadTexts: rectSysAveragePhase1Voltage.setDescription('Average output voltage of rectifiers in Phase 1.') rectSysAveragePhase2Voltage = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 8), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysAveragePhase2Voltage.setStatus('current') if mibBuilder.loadTexts: rectSysAveragePhase2Voltage.setDescription('Average output voltage of rectifiers in Phase 2.') rectSysAveragePhase3Voltage = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 9), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysAveragePhase3Voltage.setStatus('current') if mibBuilder.loadTexts: rectSysAveragePhase3Voltage.setDescription('Average output voltage of rectifiers in Phase 3.') rectSysSystemVoltage = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 10), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysSystemVoltage.setStatus('current') if mibBuilder.loadTexts: rectSysSystemVoltage.setDescription('System voltage.') rectSysTotalLoadCurrent = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 11), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysTotalLoadCurrent.setStatus('current') if mibBuilder.loadTexts: rectSysTotalLoadCurrent.setDescription('Total load current.') rectSysBatteryVoltage = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 12), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysBatteryVoltage.setStatus('current') if mibBuilder.loadTexts: rectSysBatteryVoltage.setDescription('Battery voltage.') rectSysBatteryCurrent = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 13), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysBatteryCurrent.setStatus('current') if mibBuilder.loadTexts: rectSysBatteryCurrent.setDescription('Battery current.') rectSysBatteryTemperature = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 14), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysBatteryTemperature.setStatus('current') if mibBuilder.loadTexts: rectSysBatteryTemperature.setDescription('Battery temperature.') rectSysSystemNumber = MibScalar((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 15), ScaledNumber()).setMaxAccess("readonly") if mibBuilder.loadTexts: rectSysSystemNumber.setStatus('current') if mibBuilder.loadTexts: rectSysSystemNumber.setDescription('Snmp ID# assigned to the system.') conformance = MibIdentifier((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 100)) compliances = MibIdentifier((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 100, 1)) compliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 100, 1, 1)).setObjects(("ALPHA-RECTIFIER-SYS-MIB", "rectifierGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): compliance = compliance.setStatus('current') if mibBuilder.loadTexts: compliance.setDescription('The compliance statement for systems supporting the alpha MIB.') rectifierGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 100, 2)) rectifierGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 7309, 5, 3, 1, 100, 2, 1)).setObjects(("ALPHA-RECTIFIER-SYS-MIB", "rectSysTotalOutputCurrent"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysTotalOutputPower"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysTotalCapacityInstalledAmps"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysTotalCapacityInstalledPower"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysAverageRectifierOutputVoltage"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysAverageRectifierACInputVoltage"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysAveragePhase1Voltage"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysAveragePhase2Voltage"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysAveragePhase3Voltage"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysSystemVoltage"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysTotalLoadCurrent"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysBatteryVoltage"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysBatteryCurrent"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysBatteryTemperature"), ("ALPHA-RECTIFIER-SYS-MIB", "rectSysSystemNumber")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): rectifierGroup = rectifierGroup.setStatus('current') if mibBuilder.loadTexts: rectifierGroup.setDescription('Alpha Rectifier System data list group.') mibBuilder.exportSymbols("ALPHA-RECTIFIER-SYS-MIB", rectSysTotalCapacityInstalledPower=rectSysTotalCapacityInstalledPower, rectifierGroups=rectifierGroups, rectifierSystem=rectifierSystem, rectSysTotalCapacityInstalledAmps=rectSysTotalCapacityInstalledAmps, rectSysTotalOutputCurrent=rectSysTotalOutputCurrent, rectSysAveragePhase2Voltage=rectSysAveragePhase2Voltage, rectSysTotalLoadCurrent=rectSysTotalLoadCurrent, rectSysTotalOutputPower=rectSysTotalOutputPower, rectSysSystemVoltage=rectSysSystemVoltage, compliance=compliance, rectSysAveragePhase3Voltage=rectSysAveragePhase3Voltage, conformance=conformance, compliances=compliances, rectSysBatteryCurrent=rectSysBatteryCurrent, rectSysAverageRectifierOutputVoltage=rectSysAverageRectifierOutputVoltage, rectSysSystemNumber=rectSysSystemNumber, PYSNMP_MODULE_ID=rectifierSystem, rectSysAverageRectifierACInputVoltage=rectSysAverageRectifierACInputVoltage, rectSysBatteryTemperature=rectSysBatteryTemperature, rectSysAveragePhase1Voltage=rectSysAveragePhase1Voltage, rectSysBatteryVoltage=rectSysBatteryVoltage, rectifierGroup=rectifierGroup)
# O(n) time | O(1) space def twoNumberSum(array, targetSum): # Write your code here. result = [] for num in array: offset = targetSum - num if offset in array: result = [offset, num] return result # def twoNumberSum(array, targetSum): # for i in range(len(array)-1): # for k in range(i+1, len(array)): # if array[i] + array[k] == targetSum: # return [array[i], array[k]] # else: # return []
class MockMail: def __init__(self): self.inbox = [] def send_mail(self, recipient_list, **kwargs): for recipient in recipient_list: self.inbox.append({ 'recipient': recipient, 'subject': kwargs['subject'], 'message': kwargs['message'] }) def clear(self): self.inbox[:] = []
string = input() string_length = len(string) print(string_length) string = input() if len(string) < 5: print("Ошибка! Введите больше пяти символов!") string = input() if not string: print("Ошибка! Введите хоть что-нибудь!") string = input() if len(string) == 0: print("Ошибка! Введите хоть что-нибудь!")
class Text: """ The Plot Text Text Template """ def __init__(self, text=""): """ Initializes the plot text Text :param text: plot text text :type text: str """ self.text = text self.template = '\ttext = "{text}";\n' def to_str(self): """ Converts the plot text text instance to a z-tree text property declaration. :return: plot text text property declaration :rtype: str """ return self.template.format(text=self.text)
for x in range(0, 11): for c in range(0, 11): print(x, 'x', c, '= {}'.format(x * c)) print('\t')
def escreverPratos(): for i in range(0, t): op = int(input("\nEscolha o prato de sua preferência: ")) if op == 1: vet.append("Bobó de Camarão") vetPrecoPrato.append(25.90) if op == 2: vet.append("Moqueca de Camarão") vetPrecoPrato.append(29.90) if op == 3: vet.append("Moqueca de Peixe") vetPrecoPrato.append(29.90) if op == 4: vet.append("Moqueca Mista") vetPrecoPrato.append(35.90) if op == 5: vet.append("Filet de Salmão") vetPrecoPrato.append(49.90) if op == 6: vet.append("Filet à Parmegiana") vetPrecoPrato.append(19.90) if op == 7: vet.append("Picanha Tropeiro") vetPrecoPrato.append(45.90) if op == 8: vet.append("Filet Mignon Recheado") vetPrecoPrato.append(39.90) def escreverBebidas(): for i in range(0, n): op2 = int(input("\nEscolha a bebida de sua preferência: ")) if op2 == 1: vet.append("Suco de Laranja") vetPrecoBebida.append(4) if op2 == 2: vet.append("Suco de Maracujá") vetPrecoBebida.append(4) if op2 == 3: vet.append("Suco de Manga") vetPrecoBebida.append(4) if op2 == 4: vet.append("Refrigerante Coca-cola") vetPrecoBebida.append(3) if op2 == 5: vet.append("Refrigerante Guaraná") vetPrecoBebida.append(3) if op2 == 6: vet.append("Refrigerante Sprite") vetPrecoBebida.append(3) if op2 == 7: vet.append("Cerveja longneck") vetPrecoBebida.append(7) def escreverSobremesas(): for i in range (0, n): op3= int(input("\nEscolha a sobremesa de sua preferência: ")) if op3 == 1: vet.append("Pudim de Chocolate") vetPrecoSobremesa.append(8) if op3 == 2: vet.append("Açai 500ml") vetPrecoSobremesa.append(15) if op3 == 3: vet.append("Bolo de Banana") vetPrecoSobremesa.append(12) if op3 == 4: vet.append("Milkshake Ovomaltine") vetPrecoSobremesa.append(9) if op3 == 5: vet.append("Petit Gateau") vetPrecoSobremesa.append(18) def cardapioPratos(): print("\n|1 – Bobó de Camarão - R$ 25,90|\nCamarão, creme de mandioca e arroz\n") print("|2 – Moqueca de Camarão - R$ 29,90|\nCamarão, pirão, arroz e farofa\n") print("|3 – Moqueca de Peixe - R$ 29,90|\nCação, arroz, pirão e farofa\n") print("|4 – Moqueca Mista - R$ 35,90|\nCamarão, caçã, pirão, arroz e farofa\n") print("|5 – Filet de Salmão - R$ 49,90|\nSalmão grelhado, arroz e fritas\n") print("|6 – Filet à Parmegiana - R$ 19,90|\nArroz branco, fritas e bife bovino empanado\n") print("|7 – Picanha Tropeiro - R$ 45,90|\nPicanha, arroz, farofa e feijão de corda\n") print("|8 – Filet Mignon Recheado - R$ 39,90|\nFilet milanesa, 3 queijos, presunto, arroz à grega e fritas\n\n") def cardapioBebidas(): print("\n\nSuco: |1 - Laranja|, |2 - Maracujá|, |3 - Manga| - |400ml| - |R$ 4,00|\n") print("Refrigerante lata: |4 - Coca-cola|, |5 - Guaraná|, |6 - Sprite| - |R$ 3,00|\n") print("|7 - Cerveja longneck| - |R$ 7,00|\n") def cardapioSobremesas(): print("\n|1 - Pudim de Chocolate - R$ 8,00|") print("\n|2 - Açai 500ml - R$ 15,00|") print("\n|3 - Bolo de Banana - R$ 12,00|") print("\n|4 - Milkshake Ovomaltine - R$ 9,00|") print("\n|5 - Petit Gateau - R$ 18,00|") t = int(input("Digite quantos pratos você irá querer: ")) vet = [] vetPrecoPrato = [] vetPrecoBebida = [] vetPrecoSobremesa = [] somap=0 somapb=0 somapbs=0 for i in range(0, t): cardapioPratos() escreverPratos() break for i in range(0, t): somap=somap+vetPrecoPrato[i] opb = (input("\n\nGostaria de bebidas para acompanhar[s/n]? ")) if opb == 'sim' or opb == 's': n = int(input("\n\n\nDigite quantas bebidas você irá querer: ")) for i in range(0, n): cardapioBebidas() escreverBebidas() break for i in range(0, n): somapb=somapb+vetPrecoBebida[i] ops = (input("\n\nGostaria de sobremesa após a refeição[s/n]? ")) if ops == 'sim' or ops == 's': n= int(input("\n\n\nDigite quantas sobremesas você irá querer: ")) for i in range (0, n): cardapioSobremesas() escreverSobremesas() break for i in range (0, n): somapbs=somapbs+vetPrecoSobremesa[i] somaTotal=somap+somapb+somapbs print("\n\nSeu pedido: %s" %vet) print("\nPreço total do seu pedido: R$ %.2f" %somaTotal) else: somaTotal=somap+somapb print("\n\nSeu pedido: %s" %vet) print("\nPreço total do seu pedido: R$ %.2f" %somaTotal) else: ops = (input("\n\nGostaria de sobremesa após a refeição[s/n]? ")) if ops == 'sim' or ops == 's': n= int(input("\n\n\nDigite quantas sobremesas você irá querer: ")) for i in range (0, n): cardapioSobremesas() escreverSobremesas() break for i in range (0, n): somapbs=somapbs+vetPrecoSobremesa[i] somaTotal=somap+somapbs print("\n\nSeu pedido: %s" %vet) print("\nPreço total do seu pedido: R$ %.2f" %somaTotal) else: somaTotal=somap print("\n\nSeu pedido: %s" %vet) print("\nPreço total do seu pedido: R$ %.2f" %somaTotal)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Aug 19 17:53:46 2017 @author: benjaminsmith """ #do the regression in the #we need a design matrix #with linear, square, cubic time point regressors #plus intercept #plus whatever Design_Matrix files we want to put in. onsets_convolved.head() onsets_convolved['linearterm']=range(1,361) onsets_convolved['quadraticterm']=[pow(x,2) for x in onsets_convolved['linearterm']] onsets_convolved['cubicterm']=[pow(x,3) for x in onsets_convolved['linearterm']] onsets_convolved['ones']=[1]*360 c.head() onsets_convolved.heatmap() onsets_convolved #add in the Design Matrix msmrl1.X=onsets_convolved#=pd.DataFrame([msmrl1.X,onsets_convolved]) #msmrl1.X=pd.DataFrame(msmrl1.X) #msmrl1.X regression=msmrl1.regress() msm_predicted_pain=regression['t'].similarity(stats['weight_map'],'correlation') for brainimg in regression['t']: plotBrain(brainimg) regression['t'].shape() plotBrain(regression['t'][1,]) onsets_convolved.head() plotBrain(regression['t'][1,]) plotBrain(regression['t'][9,]) plotBrain(regression['t'][13,]) #regress out the linear trends #then dot product with the pain map # msm_predicted_pain=regression['beta'].similarity(stats['weight_map'],'dot_product') plt(msm_predicted_pain) np.shape(msm_predicted_pain) #raw data. msm_predicted_pain=msmrl1.similarity(stats['weight_map'],'dot_product') onsets_convolved.columns.tolist() ggplot( pd.DataFrame(data={ 'PainByBeta':msm_predicted_pain[0:9], 'RegressionBetaNum':range(0,9) }), aes('RegressionBetaNum','PainByBeta')) +\ geom_line() +\ stat_smooth(colour='blue', span=0.2)+ \ scale_x_continuous(breaks=[1,2,3], \ labels=["horrible", "ok", "awesome"])
# Main network and testnet3 definitions params = { 'argentum_main': { 'pubkey_address': 23, 'script_address': 5, 'genesis_hash': '88c667bc63167685e4e4da058fffdfe8e007e5abffd6855de52ad59df7bb0bb2' }, 'argentum_test': { 'pubkey_address': 111, 'script_address': 196, 'genesis_hash': 'f5ae71e26c74beacc88382716aced69cddf3dffff24f384e1808905e0188f68f' } }
""" Utilities for Cloud Backends """ def parse_remote_path(remote_path): """ Parses a remote pathname into its protocol, bucket, and key. These are fields required by the current cloud backends """ # Simple, but should work fields = remote_path.split("/") assert len(fields) > 3, "Improper remote path (needs more fields)" protocol = fields[0] assert fields[1] == "" bucket = fields[2] key = "/".join(fields[3:]) return protocol, bucket, key def check_slash(path): """ Make sure that a slash terminates the string """ if path[-1] == "/": return path else: return path + "/" def check_no_slash(path): """ Make sure that a slash doesn't terminate the string """ if path[-1] == "/": return path[:-1] else: return path
#52 Faça um programa que leia um número inteiro e diga se ele é ou não um número primo. contador = 0 numero = int(input('Digite um número: ')) x = numero for x in range(1,numero+1): if numero % x == 0: contador += 1 print(f'O número {numero} foi divisível {contador} vezes') if contador == 2: print(f'E por isso ele É PRIMO!') else: print(f'E por isso ele NÃO É PRIMO!')
# Crie um programa que tenha uma Tupla unica com nomes de produtos e seus respectivos preços na sequencia. # No final, mostre uma listagem de preços, organizando os dados em forma tabular. '''Dá para fazer em 2 linhas... for i in range(0, len(prod), 2): print(f'{prod[i]:.<30}R${prod[i + 1]:7.2f}')''' produtos = ('caneta', 2, 'Relogio', 23, 'remedio', 12, 'mouse', 10, 'pão', 2, "mascara", 3, "gabinete", 245, "alcool", 11) print(f'{"Listagem de preços":^30}') # Centralizando o topo for i in range(0, len(produtos), 2): # FAZENDO O PRINT DAS INFORMAÇÕES COM FOR PULANDO DE 2 EM 2 PRA PEGAR A ORDEM CORRETA print(f'{str(produtos[i]).upper():.<24}', end='') # TRANSFORMADO EM STR, CENTRALIZADO A DIREITA COM PONTO ENCHENDO O ESPAÇO print(f'R${produtos[i+1]:>6.2f} ') # ADICIONADO 1 NO INDICE PRA COMEÇAR DO SEGUINTE E MSOTRAR TODOS OS PREÇOS.
def add_time(start, duration, day=None): hour, minutes = start.split(':') minutes, am_pm = minutes.split() add_hour, add_min = duration.split(":") hour = int(hour) minutes = int(minutes) add_hour = int(add_hour) add_min = int(add_min) n = add_hour // 24 rem_hour = add_hour % 24 new_min = minutes + add_min extra_hour = new_min // 60 new_min = new_min % 60 new_min = str(new_min).rjust(2, '0') rem_hour = rem_hour + extra_hour extra_n = rem_hour // 24 rem_hour = rem_hour % 24 n = n + extra_n new_hour = hour + rem_hour changes = new_hour // 12 final_hour = new_hour % 12 if changes == 0: am_pm = am_pm elif changes == 1: if am_pm == 'AM': am_pm = 'PM' else: am_pm = 'AM' n = n + 1 elif changes == 2: am_pm = am_pm n = n + 1 if day is not None: day = day.lower() weekdays = {'monday': 0, 'tuesday': 1, "wednesday": 2, 'thursday': 3, 'friday': 4, 'saturday': 5, 'sunday': 6} day = weekdays[day] + n day = day % 7 day = list(weekdays.keys())[list(weekdays.values()).index(day)] day = day.capitalize() if final_hour == 0: final_hour = 12 if not n and day is None: return f"{final_hour}:{new_min} {am_pm}" if n and day is None: if n == 1: return f"{final_hour}:{new_min} {am_pm} (next day)" else: return f"{final_hour}:{new_min} {am_pm} ({n} days later)" if not n and day: return f"{final_hour}:{new_min} {am_pm}, {day}" if n and day: if n == 1: return f"{final_hour}:{new_min} {am_pm}, {day} (next day)" else: return f"{final_hour}:{new_min} {am_pm}, {day} ({n} days later)"
string = '<option value="1" >Malda</option><option value="2" >Hooghly</option><option value="3" >Calcutta</option><option value="4" >Jalpaiguri</option><option value="6" >Coochbehar</option><option value="7" >Paschim Medinpur</option><option value="8" >Birbhum</option><option value="9" >Purba Medinipur</option><option value="10" >Purulia</option><option value="11" >Howrah</option><option value="12" >Murshidabad</option><option value="13" >South Dinajpur</option><option value="14" >North Twenty Four Parganas</option><option value="17" >Darjeeling</option><option value="18" >Purba Bardhaman</option><option value="19" >Bankura</option><option value="20" >South Twenty Four Parganas</option><option value="21" >North Dinajpur</option><option value="22" >Nadia</option><option value="23" >kalimpong</option><option value="24" >Paschim Bardhaman</option><option value="25" >Jhargram</option> </select>' separated = string.split("</option>") codes = [each[15:].split('" >') for each in separated[:-1]] print(codes) #districts = [each[1] for each in codes] #codes = [each[0] for each in codes] codes = [",".join([each[1],each[0]]) for each in codes] print(len(codes)) print("\n".join(sorted(codes))) #print("\n".join(districts))
class Calls(object): def __init__(self): self.calls = [] def addCall(self, call): self.calls.append(call) def endCall(self, call): for c in self.calls: if call.ID == c.ID: self.calls.remove(call) def searchCall(self, call_id): for c in self.calls: if call_id == c.ID: return c return None def printaCalls(self): for i in self.calls: print(i.status)
# Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite # restaurants represented by strings. # You need to help them find out their common interest with the least list index sum. If there is a # choice tie between answers, output all of them with no order requirement. You could assume there always # exists an answer. # Example 1: # Input: # ["Shogun", "Tapioca Express", "Burger King", "KFC"] # ["KFC", "Shogun", "Burger King"] # Output: ["Shogun"] # Explanation: The restaurant they both like and have the least index sum is "Shogun" with index sum 1 (0+1). # Note: # The index is starting from 0 to the list length minus 1. # No duplicates in both lists. # Time complexity : O(l1 + l2) # Space complexity : O(l1 * x), hashmap size grows upto l1 * x where x refers to average string length. class Solution: def findRestaurant(self, list1: 'list[str]', list2: 'list[str]') -> 'list[str]': placesMap = {} minSum = float('inf') res = [] for i, cur in enumerate(list1): placesMap[cur] = i for i, cur in enumerate(list2): if cur in placesMap: if (placesMap[cur] + i) < minSum: res = [cur] minSum = placesMap[cur] + i elif (placesMap[cur] + i) == minSum: res.append(cur) return res
def gcd(a,b): if a < b: a, b = b, a if b == 0: return a return gcd(b, a %b) def gcdlist(l): if len(l) == 2: return gcd(l[0], l[1]) f = l.pop() s = l.pop() m = gcd(f, s) l.append(m) return gcdlist(l) def main(): n, x = map(int, input().split()) a = [int(v) for v in input().split(' ')] a.append(x) a.sort() dis = [x2 - x1 for x1, x2 in zip(a, a[1:])] max_ = 0 for i in range(n): if len(dis) == 1: max_ = dis[0] break try: max_ = gcdlist(dis) except: max_ = 1 print(max_) if __name__ == '__main__': main()
#! /bin/env python3 ''' Class that represents a bit mask. It has methods representing all the bitwise operations plus some additional features. The methods return a new BitMask object or a boolean result. See the bits module for more on the operations provided. ''' class BitMask(int): def AND(self,bm): return BitMask(self & bm) def OR(self,bm): return BitMask(self | bm) def XOR(self,bm): return BitMask(self ^ bm) def NOT(self): return BitMask(~self) def shiftleft(self, num): return BitMask(self << num) def shiftright(self, num): return BitMask(self >> num) def bit(self, num): mask = 1 << num return bool(self & mask) def setbit(self, num): mask = 1 << num return BitMask(self | mask) def zerobit(self, num): mask = ~(1 << num) return BitMask(self & mask) def listbits(self, start=0,end=None): if end: end = end if end < 0 else end+2 return [int(c) for c in bin(self)[start+2:end]]
n,reqsum=map(int,input().split()) a=list(map(int,input().split())) arr=[] for i in range(1,n+1): arr.append([i,a[i-1]]) arr=sorted(arr,key=lambda x:x[1]) #print(arr) i=0 j=n-1 while(i<=j and i!=j): #print("{}+{}={}".format(arr[i][1],arr[j][1],arr[i][1]+arr[j][1])) if(arr[i][1]+arr[j][1]==reqsum): print("{} {}".format(arr[i][0],arr[j][0])) break elif(arr[i][1]+arr[j][1]<reqsum): i+=1 elif(arr[i][1]+arr[j][1]>reqsum): j-=1 else: print("IMPOSSIBLE")
''' Leia 2 valores inteiros X e Y. A seguir, calcule e mostre a soma dos números impares entre eles. Entrada O arquivo de entrada contém dois valores inteiros. Saída O programa deve imprimir um valor inteiro. Este valor é a soma dos valores ímpares que estão entre os valores fornecidos na entrada que deverá caber em um inteiro. ''' a = int(input()) b = int(input()) X = min(a,b) Y = max(a,b) impares = [] for i in range(X+1, Y): if i % 2 != 0: impares.append(i) print(sum(impares))
# 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 class Solution: def flatten(self, root: TreeNode) -> None: preorderList = list() def preorderTraversal(root: TreeNode): if root: preorderList.append(root) preorderTraversal(root.left) preorderTraversal(root.right) preorderTraversal(root) size = len(preorderList) for i in range(1, size): prev, curr = preorderList[i - 1], preorderList[i] prev.left = None prev.right = curr
str = "Python Program" print(str[0]) print(str[1]) print(str[2]) print(str[3]) print(str[4]) print(str[5]) print(str[0:8]) print(str[::-1]) #to reverse the string
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. POLYAXON_DOCKER_TEMPLATE = """ FROM {{ image }} {% if lang_env -%} ENV LC_ALL {{ lang_env }} ENV LANG {{ lang_env }} ENV LANGUAGE {{ lang_env }} {% endif -%} {% if shell %} ENV SHELL {{ shell }} {% endif -%} {% if path -%} {% for path_step in path -%} ENV PATH="${PATH}:{{ path_step }}" {% endfor -%} {% endif -%} {% if env -%} {% for env_step in env -%} ENV {{ env_step[0] }} {{ env_step[1] }} {% endfor -%} {% endif -%} WORKDIR {{ workdir }} {% if copy -%} {% for copy_step in copy -%} COPY {{ copy_step[0] }} {{ copy_step[1] }} {% endfor -%} {% endif -%} {% if run -%} {% for step in run -%} RUN {{ step }} {% endfor -%} {% endif -%} {% if post_run_copy -%} {% for copy_step in post_run_copy -%} COPY {{ copy_step[0] }} {{ copy_step[1] }} {% endfor -%} {% endif -%} {% if uid and gid -%} # Drop root user and use Polyaxon user RUN groupadd -g {{ gid }} -r polyaxon && useradd -r -m -g polyaxon -u {{ uid }} {{ username }} {% endif -%} {% if workdir_path -%} COPY {{ workdir_path }} {{ workdir }} {% endif -%} """
"""Persian alphabet""" #Persian digits from 0 to 9 DIGITS = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'] #Diacritics SHORT_VOWELS = ['َ', 'ِ', 'ُ', 'ْ'] #The Persian Alphabet LONG_VOWELS = ['ا', 'و', 'ی'] CONSONANTS = ['ء', 'ب', 'پ', 'ت', 'ث', 'ج', 'چ', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'ژ', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ک', 'گ', 'ل', 'م', 'ن', 'ه'] #Special Characters SPECIAL = ['آ', 'ۀ'] #Tanvins TANVIN = [ 'ٌ' , 'ٍ' , 'ً'] #Tashdid TASHDID = 'ّ'
class BaseContext(object): """ Base class for contexts. Most views in this app will use a database connection. This class will add an instance attribute for the database session and the request. """ def __init__(self, request): self._request = request self._db = self._request.db
class Solution: def countOrders(self, n: int) -> int: """ n! * (1 * 2 * 3 * (2n - 1)) n == 3 ==> (1 * 2 * 3) * (1 * 3 * 5) ==> 1 * 1 * 2 * 3 * 3 * 5 result = 1 for i: 1 to n result *= i * (2*n - 1) """ result = 1 modulo = 10 ** 9 + 7 for index in range(1, n + 1): result *= index * (2 * index - 1) return result % modulo
""" Mycroft Holmes core """ VERSION = '0.3'
impar = 0 par = 0 for i in range(200): num = int(input()) if num % 2 == 0: par += 1 else: impar += 1 print(f'Você inseriu {impar} números ímpares e {par} números pares.')
celcius = float(input('Digite a temperatura em Celsius: ')) fahr = (celcius * 9 / 5) + 32 print(f'A temperatura {celcius}°C fica {fahr}°F')
vid_parttern = r'' class Video: def __init__(self): pass
expected_output = { 'Node number is ': '1', 'Node status is ': 'NODE_STATUS_UP', 'Tunnel status is ': 'NODE_TUNNEL_UP', 'Node Sudi is ': '11 FDO25390VQP', 'Node Name is ': '4 Node', 'Node type is ': 'CLUSTER_NODE_TYPE_MASTER', 'Node role is ': 'CLUSTER_NODE_ROLE_LEADER' }
# def get_sql(cte, params, company, conn, gl_code): # # sql = cte + (""" # SELECT # a.op_date AS "[DATE]", a.cl_date AS "[DATE]" # , SUM(COALESCE(b.tran_tot, 0)) AS "[REAL2]" # , SUM(COALESCE(c.tran_tot, 0) - COALESCE(b.tran_tot, 0)) AS "[REAL2]" # , SUM(COALESCE(c.tran_tot, 0)) AS "[REAL2]" # FROM # (SELECT dates.op_date, dates.cl_date, ( # SELECT c.row_id FROM {0}.gl_totals c # JOIN {0}.gl_codes f on f.row_id = c.gl_code_id # WHERE c.tran_date < dates.op_date # AND c.location_row_id = d.row_id # AND c.function_row_id = e.row_id # AND c.source_code_id = g.row_id # AND f.gl_code = {1} # AND c.deleted_id = 0 # ORDER BY c.tran_date DESC LIMIT 1 # ) AS op_row_id, ( # SELECT c.row_id FROM {0}.gl_totals c # JOIN {0}.gl_codes f on f.row_id = c.gl_code_id # WHERE c.tran_date <= dates.cl_date # AND c.location_row_id = d.row_id # AND c.function_row_id = e.row_id # AND c.source_code_id = g.row_id # AND f.gl_code = {1} # AND c.deleted_id = 0 # ORDER BY c.tran_date DESC LIMIT 1 # ) AS cl_row_id # FROM dates, {0}.adm_locations d, {0}.adm_functions e, {0}.gl_source_codes g # WHERE d.location_type = 'location' # AND e.function_type = 'function' # ) AS a # LEFT JOIN {0}.gl_totals b on b.row_id = a.op_row_id # LEFT JOIN {0}.gl_totals c on c.row_id = a.cl_row_id # GROUP BY a.op_date, a.cl_date # ORDER BY a.op_date # """.format(company, conn.constants.param_style) # ) # # params += (gl_code, gl_code) # # fmt = '{:%d-%m} - {:%d-%m} : {:>12}{:>12}{:>12}' # # return sql, params, fmt def get_sql(cte, params, company, conn, gl_code): sql = cte + (""" SELECT a.op_date AS "[DATE]", a.cl_date AS "[DATE]" , b.gl_code , SUM(COALESCE(a.op_tot, 0)) AS "[REAL2]" , SUM(COALESCE(a.cl_tot, 0) - COALESCE(a.op_tot, 0)) AS "[REAL2]" , SUM(COALESCE(a.cl_tot, 0)) AS "[REAL2]" FROM (SELECT dates.op_date, dates.cl_date, (SELECT SUM(c.tran_tot) FROM ( SELECT a.tran_tot, ROW_NUMBER() OVER (PARTITION BY a.gl_code_id, a.location_row_id, a.function_row_id, a.source_code_id ORDER BY a.tran_date DESC) row_num FROM {0}.gl_totals a JOIN {0}.gl_codes b on b.row_id = a.gl_code_id AND b.gl_code = {1} WHERE a.deleted_id = 0 AND a.tran_date < dates.op_date ) as c WHERE c.row_num = 1) as op_tot, (SELECT SUM(c.tran_tot) FROM ( SELECT a.tran_tot, ROW_NUMBER() OVER (PARTITION BY a.gl_code_id, a.location_row_id, a.function_row_id, a.source_code_id ORDER BY a.tran_date DESC) row_num FROM {0}.gl_totals a JOIN {0}.gl_codes b on b.row_id = a.gl_code_id AND b.gl_code = {1} WHERE a.deleted_id = 0 AND a.tran_date <= dates.cl_date ) as c WHERE c.row_num = 1) as cl_tot FROM dates ) AS a JOIN {0}.gl_codes b ON b.gl_code = {1} GROUP BY a.op_date, a.cl_date, b.gl_code ORDER BY a.op_date """.format(company, conn.constants.param_style) ) params += (gl_code, gl_code, gl_code) fmt = '{:%d-%m} - {:%d-%m} : {:<12}{:>12}{:>12}{:>12}' return sql, params, fmt
class Service: def __init__(self): self.base = 7 def set_val(self, val): self.func_val = val def get_val(self): return self.func_val class Service2(Service): def __init__(self): # pragma: no cover self.base = 8
__author__ = 'roeiherz' """ Write a method to return all subsets of a set """ def power_set(subset): n = len(subset) # Stop case if n != 0: print(subset) for i in range(n): new_lst = subset[:i] + subset[i + 1:] power_set(new_lst) def power_set_memo(subset, mem): n = len(subset) # Stop case if n != 0: if subset not in mem: mem.add(subset) print(subset) for i in range(n): new_lst = subset[:i] + subset[i + 1:] power_set_memo(new_lst, mem) if __name__ == '__main__': mem = set() # power_set((1, 2, 3, 4)) power_set_memo((1, 2, 3, 4), mem)