content
stringlengths
1
1.05M
input_ids
listlengths
1
883k
ratio_char_token
float64
1
22.9
token_count
int64
1
883k
#!/usr/bin/python3.4 # -*-coding:utf-8 -* """ https://openclassrooms.com/courses/apprenez-a-programmer-en-python/le-reseau LA FIN LE TERMINAL QUITTE PYTHON : DONC CE PROGRAMME NE MARCHE PAS !! """ # Les deux lignes prcdentes serviraient si je rendais ce fichier # directement excutable import socket # Construire notre socket : LE SERVEUR # socket.AF_INET : la famille d'adresses, ici ce sont des adresses Internet ; # # socket.SOCK_STREAM : le type du socket, SOCK_STREAM pour le protocole TCP. connexion_principale = socket.socket(socket.AF_INET,socket.SOCK_STREAM) print("connexion_principale :\n",connexion_principale) # Connecter le socket # le nom de l'hte sera vide et le port sera celui que vous voulez, entre 1024 et 65535. connexion_principale.bind(("",12800)) # l'argument unique de bind est un tuple !! print("bind :\n",connexion_principale.bind) # Faire couter notre socket connexion_principale.listen(5) print("listen :\n",connexion_principale.listen) print("salute") # +++ Il y a donc deux ports dans notre histoire +++ # # mais celui qu'utilise le client # pour ouvrir sa connexion ne va pas nous intresser. connexion_avec_client,infos_connexion = connexion_principale.accept()
[ 2, 48443, 14629, 14, 8800, 14, 29412, 18, 13, 19, 198, 2, 532, 9, 12, 66, 7656, 25, 40477, 12, 23, 532, 9, 198, 37811, 198, 198, 5450, 1378, 9654, 4871, 9649, 13, 785, 14, 66, 39975, 14, 1324, 25924, 89, 12, 64, 12, 23065, 647...
2.477137
503
import os import sys import time from tqdm import tqdm as print_progress import csv import json import logging import numpy as np import pandas as pd import random import cv2 from PIL import Image from matplotlib import pyplot as plt import re import requests from io import BytesIO from bs4 import BeautifulSoup as BS from urllib import request, response from selenium import webdriver from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.common.proxy import * from selenium.common.exceptions import * import sqlite3 as sqllib from sql_commands import * from driver_utils import * from utils import * working_dir = os.path.dirname(__file__) # Define global variables page_url = 'https://www.shopee.vn' data_source = 'shopee' if __name__ == "__main__": initialize_db() first_time = True while True: # Step 0: Initialize browser = random.choice(['chrome', 'firefox', 'edge']) driver = initialize_driver(browser) try: main(driver, first_time) except Exception as e: print("\n\n\nCrash ... Please wait a few seconds!!!") for t in print_progress(range(69)): time.sleep(1) first_time = False driver.quit() db_connector.close()
[ 11748, 28686, 201, 198, 11748, 25064, 201, 198, 11748, 640, 201, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 355, 3601, 62, 33723, 201, 198, 201, 198, 11748, 269, 21370, 201, 198, 11748, 33918, 201, 198, 11748, 18931, 201, 198, 2...
2.468013
594
# -*- coding: utf-8 -*- import numpy as np import tensorflow as tf from inferbeddings.regularizers import TransEEquivalentPredicateRegularizer from inferbeddings.regularizers import DistMultEquivalentPredicateRegularizer from inferbeddings.regularizers import ComplExEquivalentPredicateRegularizer from inferbeddings.regularizers import BilinearEquivalentPredicateRegularizer import pytest if __name__ == '__main__': pytest.main([__file__])
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 198, 6738, 13249, 3077, 67, 654, 13, 16338, 11341, 1330, 3602, 6500, 421, 29540, 39156,...
3.377778
135
""" Code illustration: 8.11 Chaos Game Tkinter GUI Application Development Blueprints """ import random from tkinter import Tk, Canvas import math WIDTH = 800 HEIGHT = 500 v1 = (float(WIDTH/2), 0.0) v2 = (0.00, float(HEIGHT)) v3 = (float(WIDTH), float(HEIGHT)) last_point = None root = Tk() canvas = Canvas(root, background="#660099", width = WIDTH, height = HEIGHT) canvas.pack() last_point = random_point_inside_triangle(v1, v2, v3) update() root.mainloop()
[ 37811, 198, 10669, 20936, 25, 807, 13, 1157, 198, 220, 220, 220, 13903, 3776, 198, 51, 74, 3849, 25757, 15678, 7712, 4518, 17190, 198, 37811, 198, 11748, 4738, 198, 6738, 256, 74, 3849, 1330, 309, 74, 11, 1680, 11017, 198, 11748, 1068...
2.584699
183
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import wagtail.wagtailcore.fields import wagtail.wagtailcore.blocks import datetime import wagtail.wagtailimages.blocks
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 4981, 11, 15720, 602, 198, 11748, 266, 363, 13199, 13, 86, 363,...
2.948052
77
""" 17.17 Multi Search: Given a string b and an array of smaller strings T, design a method to search b for each small string in T. In - text: str, words: List[str] Out - List[str] lgget`s go to the party tonight? ['go', 'test', 'jump'] return ['go'] O(k^2 + n*t) time complexity, where k is the size of text, n is the size of words, and t is the size of the biggest word O(k^2) space complexity """ from typing import Dict, Any, List TrieNode = Dict[str, Any] def build_trie(text: str) -> Trie: """ Inserts all possible substrings on the trie """ trie: Trie = Trie() for i in range(len(text)): trie.insert(text[i:]) return trie print(multi_search('lgget`s go to the party tonight?', ['go', 'test', 'jump']))
[ 37811, 198, 1558, 13, 1558, 15237, 11140, 25, 11259, 257, 4731, 275, 290, 281, 7177, 286, 4833, 13042, 309, 11, 1486, 257, 2446, 284, 2989, 275, 329, 198, 27379, 1402, 4731, 287, 309, 13, 198, 198, 818, 532, 2420, 25, 965, 11, 2456,...
2.648084
287
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="replacefs", version="1.2.0", python_requires='>=3', author="yoarch", author_email="yo.managements@gmail.com", description="Search and replace CLI tool for strings on the all system", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/yoarch/replace", packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], entry_points={ "console_scripts": [ "replacefs = replacefs.__main__:main", "rp = replacefs.__main__:main" ] })
[ 11748, 900, 37623, 10141, 198, 198, 4480, 1280, 7203, 15675, 11682, 13, 9132, 1600, 366, 81, 4943, 355, 277, 71, 25, 198, 220, 220, 220, 890, 62, 11213, 796, 277, 71, 13, 961, 3419, 198, 198, 2617, 37623, 10141, 13, 40406, 7, 198, ...
2.608553
304
""" modulegraph tests """
[ 37811, 953, 84, 16606, 5254, 37227, 198 ]
3.714286
7
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys if __name__ == '__main__': A = list(map(int, input().split())) if len(A) != 10: print(" ", file=sys.stderr) exit(1) s = 0 for item in A: if not ((item % 2) == 0): s += item x0 = 0 # x1 = 0 # for i, a in enumerate(A): if a < 0: x0 = i break for i, a in enumerate(A[::-1]): if a < 0: x1 = len(A) - 1 - i break print(s) print(sum(A[x0 + 1:x1])) snew=list(filter(lambda x: abs(x)>1, A)) for _ in range(len(A)-len(snew)): snew.append(0) print(snew)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 201, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 201, 198, 11748, 25064, 201, 198, 201, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 2...
1.689055
402
import requests import re import sys xml = re.compile(r'<.+>|\n') # queries using closed intervals [x,y], 1-based # queries using half-open intervals [x,y), 0-based
[ 11748, 7007, 198, 11748, 302, 198, 11748, 25064, 198, 198, 19875, 796, 302, 13, 5589, 576, 7, 81, 6, 27, 13, 10, 29, 91, 59, 77, 11537, 198, 198, 2, 20743, 1262, 4838, 20016, 685, 87, 11, 88, 4357, 352, 12, 3106, 628, 198, 2, ...
2.816667
60
import cmath import math import logging import random import plotly import pandas
[ 11748, 269, 11018, 198, 11748, 10688, 198, 11748, 18931, 198, 11748, 4738, 198, 11748, 7110, 306, 198, 11748, 19798, 292, 198 ]
3.904762
21
# coding=utf-8 # Copyright 2018 The TF-Agents Authors. # # 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. """Simple Categorical Q-Policy for Q-Learning with Categorical DQN.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import gin import tensorflow as tf import tensorflow_probability as tfp from tf_agents.policies import tf_policy from tf_agents.specs import tensor_spec from tf_agents.trajectories import policy_step from tf_agents.trajectories import time_step as ts from tf_agents.utils import common from tf_agents.utils import nest_utils
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 15069, 2864, 383, 24958, 12, 10262, 658, 46665, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, ...
3.618893
307
from invenio_oarepo_oai_pmh_harvester.register import Decorators from invenio_oarepo_oai_pmh_harvester.rules.utils import iter_array from invenio_oarepo_oai_pmh_harvester.transformer import OAITransformer
[ 6738, 287, 574, 952, 62, 78, 533, 7501, 62, 78, 1872, 62, 4426, 71, 62, 9869, 1158, 353, 13, 30238, 1330, 4280, 273, 2024, 198, 6738, 287, 574, 952, 62, 78, 533, 7501, 62, 78, 1872, 62, 4426, 71, 62, 9869, 1158, 353, 13, 38785, ...
2.575
80
import unittest import queries
[ 11748, 555, 715, 395, 198, 198, 11748, 20743, 628 ]
3.666667
9
from MedipReport import ProjectTracker from CGATReport.Tracker import SingleTableTrackerRows, \ SingleTableTrackerEdgeList _gat_analysis = {"Results": GatResults, "SignificantResults": GatSignificantResults, "Fold": GatLogFold, "LogFold": GatLogFold} _gat_sets = {"Context": GatTableContext} for a, aa in list(_gat_analysis.items()): for b, bb in list(_gat_sets.items()): n = "Gat%s%s" % (a, b) globals()[n] = type(n, (bb, aa), {})
[ 6738, 2019, 541, 19100, 1330, 4935, 35694, 198, 6738, 29925, 1404, 19100, 13, 35694, 1330, 14206, 10962, 35694, 49, 1666, 11, 3467, 198, 220, 220, 220, 14206, 10962, 35694, 37021, 8053, 628, 628, 628, 628, 198, 62, 41268, 62, 20930, 796...
2.262009
229
from tkinter import * from interfaces.functions import centralize from tkinter import messagebox from interfaces.functions import update_session_data_csv, update_clients_csv, get_current_balance
[ 6738, 256, 74, 3849, 1330, 1635, 198, 6738, 20314, 13, 12543, 2733, 1330, 4318, 1096, 198, 6738, 256, 74, 3849, 1330, 3275, 3524, 198, 6738, 20314, 13, 12543, 2733, 1330, 4296, 62, 29891, 62, 7890, 62, 40664, 11, 4296, 62, 565, 2334, ...
3.843137
51
''' cardcollectordb URL Configuration ''' from django.contrib import admin from django.urls import include, path from account.views import SignUp urlpatterns = [ path('admin/', admin.site.urls), path('account/', include('account.urls'), name='account'), path('signup/', SignUp.as_view(), name='signup'), ]
[ 7061, 6, 198, 9517, 33327, 585, 65, 10289, 28373, 198, 7061, 6, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 2291, 11, 3108, 198, 198, 6738, 1848, 13, 33571, 1330, 5865, 4933, 628, ...
2.944954
109
# Copyright 2021 The Kubeflow Authors # # 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. """Definitions of utils methods.""" import importlib import os import re import sys import types def load_module(module_name: str, module_directory: str) -> types.ModuleType: """Dynamically imports the Python module with the given name and package path. E.g., Assuming there is a file called `my_module.py` under `/some/directory/my_module`, we can use:: load_module('my_module', '/some/directory') to effectively `import mymodule`. Args: module_name: The name of the module. package_path: The package under which the specified module resides. """ module_spec = importlib.util.spec_from_file_location( name=module_name, location=os.path.join(module_directory, f'{module_name}.py')) module = importlib.util.module_from_spec(module_spec) sys.modules[module_spec.name] = module module_spec.loader.exec_module(module) return module def maybe_rename_for_k8s(name: str) -> str: """Cleans and converts a name to be k8s compatible. Args: name: The original name. Returns: A sanitized name. """ return re.sub('-+', '-', re.sub('[^-0-9a-z]+', '-', name.lower())).lstrip('-').rstrip('-')
[ 2, 15069, 33448, 383, 24921, 891, 9319, 46665, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, ...
2.866771
638
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from datetime import datetime, date from decimal import Decimal from base import GAETestCase from notification_app.notification_model import Notification from routes.notifications import rest from gaegraph.model import Node from mock import Mock from mommygae import mommy
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 11, 28000, 1098, 62, 17201, 874, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 3128, 198, 6738, 32465, 1330, 4280, 4402, 1...
3.739583
96
#!/usr/bin/env python ''' yamlcfg Bring in Configs into namespace ''' from yamlcfg.conf import Config as BaseConfig from yamlcfg.yml import YAMLConfig YMLConfig = YAMLConfig YamlConfig = YAMLConfig from yamlcfg.util import normalize, validate_ext from yamlcfg.env import check_env
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 7061, 6, 331, 43695, 37581, 198, 198, 31416, 287, 17056, 82, 656, 25745, 198, 7061, 6, 198, 198, 6738, 331, 43695, 37581, 13, 10414, 1330, 17056, 355, 7308, 16934, 198, 6738, 331, 4369...
2.938144
97
# -*- coding: utf-8 -*- from scrapy.item import Item, Field
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 15881, 88, 13, 9186, 1330, 9097, 11, 7663 ]
2.565217
23
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from ..modeldb import Lineage_pb2 as modeldb_dot_Lineage__pb2 def add_LineageServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'addLineage': grpc.unary_unary_rpc_method_handler( servicer.addLineage, request_deserializer=modeldb_dot_Lineage__pb2.AddLineage.FromString, response_serializer=modeldb_dot_Lineage__pb2.AddLineage.Response.SerializeToString, ), 'deleteLineage': grpc.unary_unary_rpc_method_handler( servicer.deleteLineage, request_deserializer=modeldb_dot_Lineage__pb2.DeleteLineage.FromString, response_serializer=modeldb_dot_Lineage__pb2.DeleteLineage.Response.SerializeToString, ), 'findAllInputs': grpc.unary_unary_rpc_method_handler( servicer.findAllInputs, request_deserializer=modeldb_dot_Lineage__pb2.FindAllInputs.FromString, response_serializer=modeldb_dot_Lineage__pb2.FindAllInputs.Response.SerializeToString, ), 'findAllOutputs': grpc.unary_unary_rpc_method_handler( servicer.findAllOutputs, request_deserializer=modeldb_dot_Lineage__pb2.FindAllOutputs.FromString, response_serializer=modeldb_dot_Lineage__pb2.FindAllOutputs.Response.SerializeToString, ), 'findAllInputsOutputs': grpc.unary_unary_rpc_method_handler( servicer.findAllInputsOutputs, request_deserializer=modeldb_dot_Lineage__pb2.FindAllInputsOutputs.FromString, response_serializer=modeldb_dot_Lineage__pb2.FindAllInputsOutputs.Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'ai.verta.modeldb.LineageService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,))
[ 2, 2980, 515, 416, 262, 308, 49, 5662, 11361, 8435, 17050, 13877, 13, 8410, 5626, 48483, 0, 198, 11748, 1036, 14751, 198, 198, 6738, 11485, 14171, 335, 65, 1330, 6910, 496, 62, 40842, 17, 355, 4235, 335, 65, 62, 26518, 62, 13949, 49...
2.341804
787
import numpy import logging import theano import theano.tensor as TT from theano.gradient import grad_clip from sparnn.utils import * from sparnn.layers import Layer logger = logging.getLogger(__name__)
[ 198, 11748, 299, 32152, 198, 11748, 18931, 198, 11748, 262, 5733, 198, 11748, 262, 5733, 13, 83, 22854, 355, 26653, 198, 6738, 262, 5733, 13, 49607, 1330, 3915, 62, 15036, 198, 198, 6738, 599, 1501, 77, 13, 26791, 1330, 1635, 198, 673...
3.136364
66
import base64 import glob import gzip if __name__ == '__main__': for submission_name in ['tf', 'mx']: build_script(submission_name)
[ 11748, 2779, 2414, 198, 11748, 15095, 198, 11748, 308, 13344, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 329, 14498, 62, 3672, 287, 37250, 27110, 3256, 705, 36802, 6, 5974, 198, 220, 2...
2.578947
57
""" DOCSTRING """ import dash import dash.dependencies as dependencies import dash_core_components.Graph as Graph import dash_core_components.Input as Input import dash_html_components.Div as Div import dash_html_components.H1 as H1 app = dash.Dash() app.layout = Div(children=[Input(id='input', value='blank', type='text'), Div(id='output')]) app.run_server(debug=True)
[ 37811, 198, 38715, 18601, 2751, 198, 37811, 198, 11748, 14470, 198, 11748, 14470, 13, 45841, 3976, 355, 20086, 198, 11748, 14470, 62, 7295, 62, 5589, 3906, 13, 37065, 355, 29681, 198, 11748, 14470, 62, 7295, 62, 5589, 3906, 13, 20560, 3...
3.17094
117
# My script to process the generated data # The temperature we want to aim for aimTemperature = float(30 + 273) # To halt the script import sys # Numpy matrices import numpy as np #Used to get the epoch time to calculate the time difference dt import datetime import time #Regular expressions import re # Generate random numbers for the epsilon greedy import random # Math functions import math # Allows deep copies to be made import copy ### variables # Q = mcDeltaT for li-ion batteries specHeatCap = 795.0 # Specific heat capacity (in seconds) Tamb = float(25 + 273) # Ambient (initial) temperature (kelin) battMass = 80.0 # Mass of the battery in kg # Conversion factors mphTomps = 0.44704 # Fan infomation maxFanDraw = 36.0 # 36W, based on 2.8W power consumption and 12 fans on the TBRe car fanVoltage = 12.0 # 12V DC # Fan current is the power divided by the voltage fanCurrent = maxFanDraw / fanVoltage coolingFloor = 285 # Min temperature the fans can physically get the batteries, 12oC # Battery infomation currDraw = 240.0 # 240A, continous current draw of 30A with 8 cells in parallel battCapacity = 18.7 # 180Ah total capcity of the battery, note unit of hours! battVoltageNom = 388.0 # 388V nominal voltage battResistance = 0.2304 # 0.2304ohm, 108 in series, 6 in parallel, 12.8E-3 per cell regenEfficiency = 0.55 # 55% Efficiecny of the velocity converted to regen power, and this power used for recharging maxAllowTemp = 307 # Kelvin, 35oC minAllowTemp = 288 # Kevlin, 15oC # GA variables generationCount = 5 populationCount = 50 mutationRate = 0.01 # Some variables to do with the traniing of the controller reqSigFig = 4 # Number of signiicant figures we need to variables to maxkp = 2.0 maxki = 2.0 maxkd = 2.0 # Chromosomes length chromKPlen = math.ceil(math.log(((maxkp - 0) * 10 ** reqSigFig), 2)) chromKIlen = math.ceil(math.log(((maxki - 0) * 10 ** reqSigFig), 2)) chromKDlen = math.ceil(math.log(((maxkd - 0) * 10 ** reqSigFig), 2)) # Generate a random binary string of input length # Decode chromosome # Decodes the chromoesome string to the float digit #Calculated the time difference in milliseconds #Regex on each filepath to get the time variables #Create an object to get the epoch time #Differene in epoch time is the dt (in seconds) # Take an action to change the fan speed # Fan speed can only be changed up to 20% per dt, as per the main script #Calculate the cooling which occurs, depending on the vehicle speed #In m/s, and the accumulator #Uses fluid dynamics of dry air, with flow across a tube bank # Calcualte the drain on the batteriries # Drain from running the fan # Drain is very large approximation with a linear drain on the batteries!! #Process the input file to work out the power at each point #Print it to a file def processFile(filePath): #open this new file and get all the lines with open(filePath) as f: processLine = f.readlines() # you may also want to remove whitespace characters like `\n` at the end of each line processLine = [x.strip() for x in processLine] # Bin off the first line as it just contains all the titles processLine.pop(0) # Set up learning variables epochs = generationCount # Run the learn 1000 times per simulation print(datetime.datetime.now().strftime("%a, %d %B %Y %I:%M:%S")) # Initialise the generation generationGroup = [] for count in range(populationCount): chromKP = generateBinaryString(chromKPlen) chromKI = generateBinaryString(chromKPlen) chromKD = generateBinaryString(chromKPlen) cont = geneticLearner(chromKP, chromKI, chromKD, Tamb) generationGroup.append(cont) for i in range(epochs): # Set up the training run readLines = copy.deepcopy(processLine) # First thing to do is initialise the state # Keep the state as dynamic arrays so can be popped and appended # Trim the lines that were sent to the state creation battTemp = copy.deepcopy(Tamb) battCharge = 100.0 fanSpeed = 0.0 isRunning = True thisBattCapacity = copy.deepcopy(battCapacity) lineCounter = 0 prevLine = readLines.pop(0).split(',') while isRunning: # Run the simulation currLine = readLines.pop(0).split(',') # Work out the dt dt = calculateDt(prevLine[0], currLine[0]) if len(readLines) > 1: prevLine = currLine else: isRunning = False # Every 10 % of the way print the current time, and the percentage if ((i + 1) % (epochs / 10.0)) == 0: print("---------------------------------------------") print(str(((i + 1) / epochs) * 100) + "% completed...") print(datetime.datetime.now().strftime("%a, %d %B %Y %I:%M:%S")) # Print some things at the end of each game to see how close we are to targets :) print("---------------------------------------------") print("Completed game " + str(i + 1) + "/" + str(epochs)) #print("End temperature : " + str(battTemp)) #batteryPercentage = (thisBattCapacity / battCapacity) * 100.0 ##Get this as a string with two decimal places (cut, not rounded) #wholePercentage = str(batteryPercentage).split('.')[0] #decimPercentage = str(batteryPercentage).split('.')[1] #batteryRemaining = str(wholePercentage + "." + decimPercentage[0:2]) #print("End capacity : " + str(batteryRemaining)) # Simulation finished, print model to JSON file print("---------------------------------------------") print("Model saved to disk...") # File with the list of files to process masterFile = "/Users/Matt/google_drive/documents/uni/year_3/EE30147_40148_GDBP_MEng/individual/scripts/traindatatoprocess" #Open the list of files to go through, try: with open(masterFile) as f: processFilePaths = f.readlines() # you may also want to remove whitespace characters like `\n` at the end of each line processFilePaths = [x.strip() for x in processFilePaths] except IOError: print("Error, unable to find list file : " + filePath) #Remove first item from processFilePaths as this is just the file header processFilePaths.pop(0) #For every required file for row in processFilePaths: #Try to process this file try: print("Processing file : " + row) processFile(row) except IOError: print("Error, unable to find list file : " + row)
[ 2, 2011, 4226, 284, 1429, 262, 7560, 1366, 198, 2, 383, 5951, 356, 765, 284, 4031, 329, 198, 1385, 42492, 796, 12178, 7, 1270, 1343, 38549, 8, 198, 198, 2, 1675, 17369, 262, 4226, 198, 11748, 25064, 198, 2, 399, 32152, 2603, 45977, ...
2.734886
2,448
""" graphjson module pull an event from neo4j and creates graphjson formated file to be used with AlchemyJS Written by Ray Bernard ray@suprfanz.com """ import json from neo4j.v1 import GraphDatabase, basic_auth from config import neo4j_dbip, neo4j_admin, neo4j_password session = GraphDatabase.driver("bolt://{}:7687".format(neo4j_dbip), auth=basic_auth("{}".format(neo4j_admin), "{}".format(neo4j_password))).session() if __name__ == '__main__': main()
[ 37811, 198, 34960, 17752, 8265, 2834, 281, 1785, 422, 19102, 19, 73, 290, 8075, 198, 34960, 17752, 1296, 515, 2393, 284, 307, 973, 351, 43987, 20120, 198, 25354, 416, 7760, 16197, 26842, 31, 37330, 81, 24408, 89, 13, 785, 198, 198, 37...
2.56701
194
""" dataset.py defines a container for a training dataset. """ import os import torch from torchvision import datasets, transforms
[ 37811, 198, 19608, 292, 316, 13, 9078, 15738, 257, 9290, 329, 257, 3047, 27039, 13, 198, 37811, 198, 11748, 28686, 198, 11748, 28034, 198, 6738, 28034, 10178, 1330, 40522, 11, 31408, 628 ]
4.125
32
# Copyright (C) 2012 - 2014 EMC Corporation. # # All Rights Reserved. # # 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. from cinderclient.tests.unit import utils from cinderclient.tests.unit.v2 import fakes cs = fakes.FakeClient()
[ 2, 15069, 357, 34, 8, 2321, 532, 1946, 412, 9655, 10501, 13, 198, 2, 198, 2, 1439, 6923, 33876, 13, 198, 2, 198, 2, 220, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 19...
3.31441
229
# -*- coding: utf-8 -*- # Author : Manki Baek # e-mail : bmg8551@seculayer.co.kr # Powered by Seculayer 2021 Service Model Team from mlps.core.data.cnvrtr.ConvertAbstract import ConvertAbstract if __name__ == "__main__": payload = "192.168.1.110" tokenizer = IPTransferDivide(stat_dict=None, arg_list=None) print(tokenizer.apply(payload))
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 6434, 1058, 337, 962, 72, 8999, 988, 198, 2, 304, 12, 4529, 1058, 275, 11296, 23, 43697, 31, 2363, 377, 2794, 13, 1073, 13, 38584, 198, 2, 45090, 416, 1882, 377, ...
2.561151
139
import DBScrape import calendar import datetime import time import csv import sys import os days = 30 R = roomAnalytics() R.roomData() R.saveData()
[ 11748, 20137, 3351, 13484, 198, 11748, 11845, 198, 11748, 4818, 8079, 198, 11748, 640, 198, 11748, 269, 21370, 198, 11748, 25064, 198, 11748, 28686, 198, 198, 12545, 796, 1542, 628, 628, 628, 628, 198, 198, 49, 796, 2119, 37702, 14094, ...
2.962264
53
import pytest from unittest import mock from reactive import kubernetes_master from charms.reactive import endpoint_from_flag, remove_state from charmhelpers.core import hookenv
[ 11748, 12972, 9288, 198, 6738, 555, 715, 395, 1330, 15290, 198, 6738, 32242, 1330, 479, 18478, 3262, 274, 62, 9866, 198, 6738, 41700, 13, 260, 5275, 1330, 36123, 62, 6738, 62, 32109, 11, 4781, 62, 5219, 198, 6738, 20024, 16794, 364, 1...
3.770833
48
# # PySNMP MIB module HH3C-DOT3-EFM-EPON-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-DOT3-EFM-EPON-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:26:25 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, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint") hh3cEpon, = mibBuilder.importSymbols("HH3C-OID-MIB", "hh3cEpon") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") Unsigned32, ObjectIdentity, IpAddress, TimeTicks, Integer32, mib_2, Gauge32, iso, Counter64, Counter32, ModuleIdentity, NotificationType, MibIdentifier, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "ObjectIdentity", "IpAddress", "TimeTicks", "Integer32", "mib-2", "Gauge32", "iso", "Counter64", "Counter32", "ModuleIdentity", "NotificationType", "MibIdentifier", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TextualConvention, MacAddress, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "MacAddress", "DisplayString", "TruthValue") hh3cDot3EfmeponMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2)) hh3cDot3EfmeponMIB.setRevisions(('2004-09-21 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hh3cDot3EfmeponMIB.setRevisionsDescriptions(('Initial version, published as RFC XXXX.',)) if mibBuilder.loadTexts: hh3cDot3EfmeponMIB.setLastUpdated('200409210000Z') if mibBuilder.loadTexts: hh3cDot3EfmeponMIB.setOrganization('Hangzhou H3C Tech. Co., Ltd.') if mibBuilder.loadTexts: hh3cDot3EfmeponMIB.setContactInfo('Platform Team Hangzhou H3C Tech. Co., Ltd. Hai-Dian District Beijing P.R. China http://www.h3c.com Zip:100085 ') if mibBuilder.loadTexts: hh3cDot3EfmeponMIB.setDescription("The objects in this MIB module are used to manage the Ethernet in the First Mile (EFM) Multi Point Control Protocol (MPCP) Interfaces as defined in IEEE Draft P802.3ah/D3.0 clause 64,65. The following reference is used throughout this MIB module: [802.3ah] refers to: IEEE Draft P802.3ah/D3.3: 'Draft amendment to - Information technology - Telecommunications and information exchange between systems - Local and metropolitan area networks - Specific requirements - Part 3: Carrier sense multiple access with collision detection (CSMA/CD) access method and physical layer specifications - Media Access Control Parameters, Physical Layers and Management Parameters for subscriber access networks', 22 April 2004. Of particular interest are Clause 64(MPCP) 65(P2MP RS) and 60 (PON PMDs). Clause 30, 'Management', and Clause 45, 'Management Data Input/Output (MDIO) Interface'. Copyright (C) The Internet Society (2004). This version of this MIB module is part of XXXX see the RFC itself for full legal notices.") hh3cDot3MpcpMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1)) hh3cDot3MpcpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1)) hh3cDot3MpcpConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 2)) hh3cDot3MpcpTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1), ) if mibBuilder.loadTexts: hh3cDot3MpcpTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpTable.setDescription('Table for dot3 Multi-Point Control Protocol (MPCP) MIB modules.') hh3cDot3MpcpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hh3cDot3MpcpEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpEntry.setDescription('An entry in the dot3 MPCP MIB modules table.') hh3cDot3MpcpID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpID.setReference('[802.3ah], 30.3.5.1.1.') if mibBuilder.loadTexts: hh3cDot3MpcpID.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpID.setDescription('This variable is assigned so as to uniquely identify the Multi-Point MAC Control (MPCP) entity, as defined in [802.3ah] clause 64, among the subordinate managed objects of the containing object. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpOperStatus.setReference('[802.3ah], 30.3.5.1.2.') if mibBuilder.loadTexts: hh3cDot3MpcpOperStatus.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpOperStatus.setDescription('This variable can be used to define the operational state of the Multi-Point MAC Control sublayer as defined in [802.3ah] clause 64. Selecting admin for an interface with Multi-Point MAC Control sublayer. When the attribute is True the the interface will act as if Multi-point control protocol is enabled. When the attribute is False the interface will act as if it does not have the Multi-point control protocol. The operational state can be changed using the hh3cDot3MpcpAdminState attribute. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("olt", 1), ("onu", 2))).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot3MpcpMode.setReference('[802.3ah], 30.3.5.1.3.') if mibBuilder.loadTexts: hh3cDot3MpcpMode.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpMode.setDescription('This variable can be used to identify the operational state of the Multi-Point MAC Control sublayer as defined in [802.3ah] clause 64. Selecting olt(1) for an OLT (server) mode and onu(2) for an ONU (client) mode. Writing can be done during only during initialization, when hh3cDot3MpcpOperStatus indicates Flase. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpLinkID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpLinkID.setReference('[802.3ah], 30.3.5.1.4.') if mibBuilder.loadTexts: hh3cDot3MpcpLinkID.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpLinkID.setDescription('A read-only value that identifies the Logical Link identity (LLID) associated with the MAC port as specified in [802.3ah] clause 65.1.3.2.2. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpRemoteMACAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 5), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpRemoteMACAddress.setReference('[802.3ah], 30.3.5.1.5.') if mibBuilder.loadTexts: hh3cDot3MpcpRemoteMACAddress.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpRemoteMACAddress.setDescription('A read-only value that identifies the source_address parameter of the last MPCPDUs passed to the MAC Control. This value is updated on reception of a valid frame with (1) a destination Field equal to the reserved multicast address for MAC Control specified in [802.3ah] Annex 31A, (2) lengthOrType field value equal to the reserved Type for MAC Control as specified in [802.3ah] Annex 31A. (3) an MPCP subtype value equal to the subtype reserved for MPCP as specified in [802.3ah] Annex 31A. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpRegistrationState = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unregistered", 1), ("registering", 2), ("registered", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpRegistrationState.setReference('[802.3ah], 30.3.5.1.6.') if mibBuilder.loadTexts: hh3cDot3MpcpRegistrationState.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpRegistrationState.setDescription('A read-only value that identifies the operational state of the Multi-Point MAC Control sublayer as defined in [802.3ah] clause 64. When this attribute has the enumeration unregistered(1) the interface may be used for registering a link partner. When this attribute has the enumeration registering(2) the interface is in the process of registering a link-partner. When this attribute has the enumeration registered(3) the interface has an established link-partner. This attribute is relevant for an OLT and an ONU. For the OLT it provides an indication per LLID.') hh3cDot3MpcpTransmitElapsed = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 7), Integer32()).setUnits('TQ (16nsec)').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpTransmitElapsed.setReference('[802.3ah], 30.3.5.1.19.') if mibBuilder.loadTexts: hh3cDot3MpcpTransmitElapsed.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpTransmitElapsed.setDescription('A read-only value that reports the interval from last MPCP frame transmission in increments of Time Quanta (TQ) 16ns. The value returned shall be (interval from last MPCP frame transmission in ns)/16. If this value exceeds (2^32-1) the value (2^32-1) shall be returned. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpReceiveElapsed = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 8), Integer32()).setUnits('TQ (16nsec)').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpReceiveElapsed.setReference('[802.3ah], 30.3.5.1.20.') if mibBuilder.loadTexts: hh3cDot3MpcpReceiveElapsed.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpReceiveElapsed.setDescription('A read-only value that reports the interval from last MPCP frame reception in increments of Time Quanta (TQ) 16ns. The value returned shall be (interval from last MPCP last MPCP frame reception in ns)/16. If this value exceeds (2^32-1) the value (2^32-1) shall be returned. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpRoundTripTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 9), Integer32()).setUnits('TQ (16nsec)').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpRoundTripTime.setReference('[802.3ah], 30.3.5.1.21.') if mibBuilder.loadTexts: hh3cDot3MpcpRoundTripTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpRoundTripTime.setDescription('A read-only value that reports the MPCP round trip time in increments of Time Quanta (TQ) 16ns. The value returned shall be (round trip time in ns)/16. If this value exceeds (2^16-1) the value (2^16-1) shall be returned. This attribute is relevant for an OLT and an ONU. For the OLT there is a value per LLID') hh3cDot3MpcpMaximumPendingGrants = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpMaximumPendingGrants.setReference('[802.3ah], 30.3.5.1.24.') if mibBuilder.loadTexts: hh3cDot3MpcpMaximumPendingGrants.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpMaximumPendingGrants.setDescription('A read-only value that indicates the maximum number of grants an ONU can store. The maximum number of grants an ONU can store has a range of 0 to 255. This attribute is relevant for an OLT and an ONU. For the OLT there is a value per LLID') hh3cDot3MpcpAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 11), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot3MpcpAdminState.setReference('[802.3ah], 30.3.5.2.1.') if mibBuilder.loadTexts: hh3cDot3MpcpAdminState.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpAdminState.setDescription('This variable can be used to define the operational state of the Multi-Point MAC Control sublayer as defined in [802.3ah] clause 64. Selecting admin for an interface with Multi-Point MAC Control sublayer. When selecting the value as True the interface Multi-Point control protocol is enabled. When selecting the value as False the interface acts as if the Multi-point Control protocol does not exist. Reading reflects the state of the attribute and the operation of the Multi-point control protocol mode of the interface. Writing can be done all the time. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpOnTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 12), Integer32()).setUnits('TQ (16nsec)').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpOnTime.setReference('[802.3ah], 64.3.5.1.') if mibBuilder.loadTexts: hh3cDot3MpcpOnTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpOnTime.setDescription('A read-only value that reports the -on time- for a grant burst in increments of Time Quanta (TQ) 16ns as defined in [802.3ah] 60,64. The value returned shall be (on time ns)/16. If this value exceeds (2^32-1) the value (2^32-1) shall be returned. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpOffTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 13), Integer32()).setUnits('TQ (16nsec)').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpOffTime.setReference('[802.3ah], 64.3.5.1.') if mibBuilder.loadTexts: hh3cDot3MpcpOffTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpOffTime.setDescription('A read-only value that reports the -off time- for a grant burst in increments of Time Quanta (TQ) 16ns as defined in [802.3ah] 60,64. The value returned shall be (off time ns)/16. If this value exceeds (2^32-1) the value (2^32-1) shall be returned. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpSyncTime = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 1, 1, 14), Integer32()).setUnits('TQ (16nsec)').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpSyncTime.setReference('[802.3ah], 64.3.3.2.') if mibBuilder.loadTexts: hh3cDot3MpcpSyncTime.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpSyncTime.setDescription('A read-only value that reports the -sync lock time- for an OLT receiver in increments of Time Quanta (TQ) 16ns as defined in [802.3ah] 60,64,65. The value returned shall be (sync lock time ns)/16. If this value exceeds (2^32-1) the value (2^32-1) shall be returned. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpStatTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2), ) if mibBuilder.loadTexts: hh3cDot3MpcpStatTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpStatTable.setDescription('This table defines the list of statistics counters of [802.3ah] clause 64 MPCP interface.') hh3cDot3MpcpStatEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hh3cDot3MpcpStatEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpStatEntry.setDescription('Table entries for table of statistics counters of [802.3ah] clause 64 MPCP interface.') hh3cDot3MpcpMACCtrlFramesTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 1), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpMACCtrlFramesTransmitted.setReference('[802.3ah], 30.3.5.1.7.') if mibBuilder.loadTexts: hh3cDot3MpcpMACCtrlFramesTransmitted.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpMACCtrlFramesTransmitted.setDescription('A count of MPCP frames passed to the MAC sublayer for transmission. This counter is incremented when a MA_CONTROL.request service primitive is generated within the MAC control sublayer with an opcode indicating a MPCP frame. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpMACCtrlFramesReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 2), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpMACCtrlFramesReceived.setReference('[802.3ah], 30.3.5.1.8.') if mibBuilder.loadTexts: hh3cDot3MpcpMACCtrlFramesReceived.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpMACCtrlFramesReceived.setDescription('A count of MPCP frames passed by the MAC sublayer to the MAC Control sublayer. This counter is incremented when a ReceiveFrame function call returns a valid frame with: (1) a lengthOrType field value equal to the reserved Type for 802.3_MAC_Control as specified in 31.4.1.3, and (2) an opcode indicating a MPCP frame. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpDiscoveryWindowsSent = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpDiscoveryWindowsSent.setReference('[802.3ah], 30.3.5.1.22.') if mibBuilder.loadTexts: hh3cDot3MpcpDiscoveryWindowsSent.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpDiscoveryWindowsSent.setDescription('A count of discovery windows generated. The counter is incremented by one for each generated discovery window. This attribute is relevant for an OLT and an ONU. At the ONU value should be zero.') hh3cDot3MpcpDiscoveryTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpDiscoveryTimeout.setReference('[802.3ah], 30.3.5.1.23.') if mibBuilder.loadTexts: hh3cDot3MpcpDiscoveryTimeout.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpDiscoveryTimeout.setDescription('A count of the number of times a discovery timeout occurs. Increment the counter by one for each discovery processing state-machine reset resulting from timeout waiting for message arrival. This attribute is relevant for an OLT and an ONU.') hh3cDot3MpcpTxRegRequest = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 5), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpTxRegRequest.setReference('[802.3ah], 30.3.5.1.12.') if mibBuilder.loadTexts: hh3cDot3MpcpTxRegRequest.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpTxRegRequest.setDescription('A count of the number of times a REGISTER_REQ MPCP frames transmission occurs. Increment the counter by one for each REGISTER_REQ MPCP frame transmitted as defined in [802.3ah] clause 64. This counter is mandatory for an ONU. This attribute is relevant for an OLT and an ONU. At the OLT value should be zero.') hh3cDot3MpcpRxRegRequest = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 6), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpRxRegRequest.setReference('[802.3ah], 30.3.5.1.17.') if mibBuilder.loadTexts: hh3cDot3MpcpRxRegRequest.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpRxRegRequest.setDescription('A count of the number of times a REGISTER_REQ MPCP frames reception occurs. A single counter at the ONU and a set of counters, one for each LLID, at the OLT. Increment the counter by one for each REGISTER_REQ MPCP frame received for each LLID as defined in [802.3ah] clause 64. This counter is mandatory for an ONU and for an OLT. At the ONU value should be zero.') hh3cDot3MpcpTxRegAck = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 7), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpTxRegAck.setReference('[802.3ah], 30.3.5.1.10.') if mibBuilder.loadTexts: hh3cDot3MpcpTxRegAck.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpTxRegAck.setDescription('A count of the number of times a REGISTER_ACK MPCP frames transmission occurs. Increment the counter by one for each REGISTER_ACK MPCP frame transmitted as defined in [802.3ah] clause 64. This counter is mandatory for an ONU. This attribute is relevant for an OLT and an ONU. At the OLT the value should be zero.') hh3cDot3MpcpRxRegAck = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 8), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpRxRegAck.setReference('[802.3ah], 30.3.5.1.15.') if mibBuilder.loadTexts: hh3cDot3MpcpRxRegAck.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpRxRegAck.setDescription('A count of the number of times a REGISTER_ACK MPCP frames reception occurs. A single counter at the ONU and a set of counters, one for each LLID, at the OLT. Increment the counter by one for each REGISTER_ACK MPCP frame received for each LLID, as defined in [802.3ah] clause 64. This counter is mandatory for an ONU and for an OLT. At the ONU the value should be zero.') hh3cDot3MpcpTxReport = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 9), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpTxReport.setReference('[802.3ah], 30.3.5.1.13.') if mibBuilder.loadTexts: hh3cDot3MpcpTxReport.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpTxReport.setDescription('A count of the number of times a REPORT MPCP frames transmission occurs. Increment the counter by one for each REPORT MPCP frame transmitted as defined in [802.3ah] clause 64. This counter is mandatory for an ONU. This attribute is relevant for an OLT and an ONU. At the OLT value should be zero.') hh3cDot3MpcpRxReport = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 10), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpRxReport.setReference('[802.3ah], 30.3.5.1.18.') if mibBuilder.loadTexts: hh3cDot3MpcpRxReport.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpRxReport.setDescription('A count of the number of times a REPORT MPCP frames reception occurs. A single counter at the ONU and a set of counters, one for each LLID, at the OLT. Increment the counter by one for each REPORT MPCP frame received for each LLID, as defined in [802.3ah] clause 64. This counter is mandatory for an ONU and for an OLT. At the ONU value should be zero.') hh3cDot3MpcpTxGate = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 11), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpTxGate.setReference('[802.3ah], 30.3.5.1.9.') if mibBuilder.loadTexts: hh3cDot3MpcpTxGate.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpTxGate.setDescription('A count of the number of times a GATE MPCP frames transmission occurs. A set of counters, one for each LLID, at the OLT. Increment the counter by one for each GATE MPCP frame transmitted, for each LLID, as defined in [802.3ah] clause 64. This counter is mandatory for an OLT. This attribute is relevant for an OLT and an ONU. At the ONU the value should be zero.') hh3cDot3MpcpRxGate = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 12), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpRxGate.setReference('[802.3ah], 30.3.5.1.14.') if mibBuilder.loadTexts: hh3cDot3MpcpRxGate.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpRxGate.setDescription('A count of the number of times a GATE MPCP frames reception occurs. A single counter at the ONU and a set of counters, one for each LLID ,at the OLT. Increment the counter by one for each GATE MPCP frame received, for each LLID, as defined in [802.3ah] clause 64. This counter is mandatory for an ONU and for an OLT. At the OLT the value should be zero.') hh3cDot3MpcpTxRegister = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 13), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpTxRegister.setReference('[802.3ah], 30.3.5.1.11.') if mibBuilder.loadTexts: hh3cDot3MpcpTxRegister.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpTxRegister.setDescription('A count of the number of times a REGISTER MPCP frames transmission occurs. A set of counters, one for each LLID, at the OLT. Increment the counter by one for each REGISTER MPCP frame transmitted, for each LLID, as defined in [802.3ah] clause 64. This counter is mandatory for an OLT. This attribute is relevant for an OLT and an ONU. At the ONU the value should be zero.') hh3cDot3MpcpRxRegister = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 14), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpRxRegister.setReference('[802.3ah], 30.3.5.1.16.') if mibBuilder.loadTexts: hh3cDot3MpcpRxRegister.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpRxRegister.setDescription('A count of the number of times a REGISTER MPCP frames reception occurs. A single counter at the ONU and a set of counters, one for each LLID, at the OLT. Increment the counter by one for each REGISTER MPCP frame received, for each LLID, as defined in [802.3ah] clause 64. This counter is mandatory for an ONU and for an OLT. at the OLT the value should be zero.') hh3cDot3MpcpRxNotSupportedMPCP = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 1, 2, 1, 15), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3MpcpRxNotSupportedMPCP.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpRxNotSupportedMPCP.setDescription('A count of the number of times a non-supported MPCP frames reception occurs. A single counter at the ONU and a set of counters, one for each LLID, at the OLT. Increment the counter by one for each non-supported MPCP frame received, for each LLID, as defined in [802.3ah] clause 64. This counter is mandatory for an ONU and for an OLT.') hh3cDot3MpcpGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 2, 1)) hh3cDot3MpcpGroupBase = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 2, 1, 1)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpID"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpOperStatus"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpMode"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpLinkID"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpRemoteMACAddress"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpRegistrationState"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpMaximumPendingGrants"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpAdminState")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3MpcpGroupBase = hh3cDot3MpcpGroupBase.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpGroupBase.setDescription('A collection of objects of dot3 Mpcp Basic entity state definition.') hh3cDot3MpcpGroupParam = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 2, 1, 2)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpTransmitElapsed"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpReceiveElapsed"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpRoundTripTime"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpOnTime"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpOffTime"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpSyncTime")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3MpcpGroupParam = hh3cDot3MpcpGroupParam.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpGroupParam.setDescription('A collection of objects of dot3 Mpcp for P2MP parameters.') hh3cDot3MpcpGroupStat = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 2, 1, 3)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpMACCtrlFramesTransmitted"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpMACCtrlFramesReceived"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpDiscoveryWindowsSent"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpDiscoveryTimeout"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpTxRegRequest"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpRxRegRequest"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpTxRegAck"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpRxRegAck"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpTxReport"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpRxReport"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpTxGate"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpRxGate"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpTxRegister"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpRxRegister"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpRxNotSupportedMPCP")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3MpcpGroupStat = hh3cDot3MpcpGroupStat.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpGroupStat.setDescription('A collection of objects of dot3 Mpcp Statistics') hh3cDot3MpcpCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 2, 2)) hh3cDot3MpcpCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 1, 2, 2, 1)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpGroupBase"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpGroupParam"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3MpcpGroupStat")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3MpcpCompliance = hh3cDot3MpcpCompliance.setStatus('current') if mibBuilder.loadTexts: hh3cDot3MpcpCompliance.setDescription('The compliance statement for Multi-point control protocol interfaces.') hh3cDot3OmpEmulationMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2)) hh3cDot3OmpEmulationObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1)) hh3cDot3OmpeConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 2)) hh3cDot3OmpEmulationTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 1), ) if mibBuilder.loadTexts: hh3cDot3OmpEmulationTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationTable.setDescription('Table for dot3 OmpEmulation MIB modules.') hh3cDot3OmpEmulationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hh3cDot3OmpEmulationEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationEntry.setDescription('An entry in the dot3 OmpEmulation MIB modules table.') hh3cDot3OmpEmulationID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationID.setReference('[802.3ah], 30.3.7.1.1.') if mibBuilder.loadTexts: hh3cDot3OmpEmulationID.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationID.setDescription('The value of hh3cDot3OmpEmulationID is assigned so as to uniquely identify a OMPEmulation entity among the subordinate managed objects of the containing object. The value is mandated for an ONU.') hh3cDot3OmpEmulationType = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("olt", 2), ("onu", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationType.setReference('[802.3ah], 30.3.7.1.2.') if mibBuilder.loadTexts: hh3cDot3OmpEmulationType.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationType.setDescription('A read-only value that indicates that mode of operation of the Reconciliation Sublayer for Point to Point Emulation (see [802.3ah] clause 65.1). unknown(1) value is assigned in initializing, true state or type not yet known. olt(2) value is assigned when Sublayer operating in OLT mode. onu(3) value is assigned when Sublayer operating in ONU mode.') hh3cDot3OmpEmulationStatTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2), ) if mibBuilder.loadTexts: hh3cDot3OmpEmulationStatTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationStatTable.setDescription('This table defines the list of statistics counters of [802.3ah] clause 65 OMP interface.') hh3cDot3OmpEmulationStatEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hh3cDot3OmpEmulationStatEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationStatEntry.setDescription('Table entries for Table of statistics counters of [802.3ah] clause 65 OMP interface.') hh3cDot3OmpEmulationSLDErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 1), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationSLDErrors.setReference('[802.3ah], 30.3.7.1.3.') if mibBuilder.loadTexts: hh3cDot3OmpEmulationSLDErrors.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationSLDErrors.setDescription('A count of frames received that do not contain a valid SLD field as defined in [802.3ah] clause 65.1.3.3.1. This attribute is mandatory for an OLT and optional for an ONU.') hh3cDot3OmpEmulationCRC8Errors = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 2), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationCRC8Errors.setReference('[802.3ah], 30.3.7.1.4.') if mibBuilder.loadTexts: hh3cDot3OmpEmulationCRC8Errors.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationCRC8Errors.setDescription('A count of frames received that contain a valid SLD field, as defined in [802.3ah] clause 65.1.3.3.1, but do not pass the CRC-8 check as defined in [802.3ah] clause 65.1.3.3.3. This attribute is mandatory for an OLT and for an ONU.') hh3cDot3OmpEmulationBadLLID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 3), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationBadLLID.setReference('[802.3ah], 30.3.7.1.8.') if mibBuilder.loadTexts: hh3cDot3OmpEmulationBadLLID.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationBadLLID.setDescription('A count of frames received that contain a valid SLD field, as defined in [802.3ah] clause 65.1.3.3.1, and pass the CRC-8 check, as defined in [802.3ah] clause 65.1.3.3.3, but are discarded due to the LLID check as defined in [802.3ah] clause 65.1.3.3.2. This attribute is relevant for an OLT and an ONU.') hh3cDot3OmpEmulationGoodLLID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 4), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationGoodLLID.setReference('[802.3ah], 30.3.7.1.5.') if mibBuilder.loadTexts: hh3cDot3OmpEmulationGoodLLID.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationGoodLLID.setDescription('A count of frames received that contain a valid SLD field, as defined in [802.3ah] clause 65.1.3.3.1, and pass the CRC-8 check, as defined in [802.3ah] clause 65.1.3.3.3. This attribute is relevant for an OLT and an ONU.') hh3cDot3OmpEmulationOnuPonCastLLID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 5), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationOnuPonCastLLID.setReference('[802.3ah], 30.3.7.1.6.') if mibBuilder.loadTexts: hh3cDot3OmpEmulationOnuPonCastLLID.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationOnuPonCastLLID.setDescription('A count of frames received that contain a valid SLD field in an ONU, as defined in [802.3ah] 65.1.3.3.1, passes the CRC-8 check, as defined in [802.3ah] 65.1.3.3.3, and the frame meets the rule for acceptance defined in [802.3ah] 65.1.3.3.2.') hh3cDot3OmpEmulationOltPonCastLLID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 6), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationOltPonCastLLID.setReference('[802.3ah], 30.3.7.1.7.') if mibBuilder.loadTexts: hh3cDot3OmpEmulationOltPonCastLLID.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationOltPonCastLLID.setDescription('A count of frames received that contain a valid SLD field in an OLT, as defined in [802.3ah] 65.1.3.3.1, passes the CRC-8 check, as defined in [802.3ah] 65.1.3.3.3, and the frame meets the rule for acceptance defined in [802.3ah] 65.1.3.3.2.') hh3cDot3OmpEmulationBroadcastLLIDNotOnuID = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 7), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationBroadcastLLIDNotOnuID.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationBroadcastLLIDNotOnuID.setDescription('A count of frames received that contain a valid SLD field in a OLT, as defined in [802.3ah] clause 65.1.3.3.1, and pass the CRC-8 check, as defined in [802.3ah] clause 65.1.3.3.3, and contain broadcast LLID as defined in [802.3ah] clause 65. This attribute is mandatory for an OLT and for an ONU.') hh3cDot3OmpEmulationOnuLLIDNotBroadcast = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 8), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationOnuLLIDNotBroadcast.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationOnuLLIDNotBroadcast.setDescription("A count of frames received that contain a valid SLD field in a OLT, as defined in [802.3ah] clause 65.1.3.3.1, and pass the CRC-8 check, as defined in [802.3ah] clause 65.1.3.3.3, and contain the ONU's LLID as defined in [802.3ah] clause 65. This attribute is mandatory for an ONU and mandatory for an OLT (a counter per LLID).") hh3cDot3OmpEmulationBroadcastLLIDPlusOnuId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 9), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationBroadcastLLIDPlusOnuId.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationBroadcastLLIDPlusOnuId.setDescription("A count of frames received that contain a valid SLD field in a OLT, as defined in [802.3ah] clause 65.1.3.3.1, and pass the CRC-8 check, as defined in [802.3ah] clause 65.1.3.3.3, and contain the broadcast LLID plus ONU's LLID (frame reflected) as defined in [802.3ah] clause 65. This attribute is mandatory for an ONU and mandatory for an OLT (a counter per LLID).") hh3cDot3OmpEmulationNotBroadcastLLIDNotOnuId = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 1, 2, 1, 10), Counter32()).setUnits('frames').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3OmpEmulationNotBroadcastLLIDNotOnuId.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpEmulationNotBroadcastLLIDNotOnuId.setDescription("A count of frames received that contain a valid SLD field in a OLT, as defined in [802.3ah] clause 65.1.3.3.1, and pass the CRC-8 check, as defined in [802.3ah] clause 65.1.3.3.3, and does not contain the ONU's LLID as defined in [802.3ah] clause 65. This attribute is mandatory for an ONU") hh3cDot3OmpeGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 2, 1)) hh3cDot3OmpeGroupID = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 2, 1, 1)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationID"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationType")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3OmpeGroupID = hh3cDot3OmpeGroupID.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpeGroupID.setDescription('A collection of objects of dot3 OMP emulation ID entity state definition.') hh3cDot3OmpeGroupStat = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 2, 1, 2)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationSLDErrors"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationCRC8Errors"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationBadLLID"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationGoodLLID"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationOnuPonCastLLID"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationOltPonCastLLID"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationBroadcastLLIDNotOnuID"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationOnuLLIDNotBroadcast"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationBroadcastLLIDPlusOnuId"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpEmulationNotBroadcastLLIDNotOnuId")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3OmpeGroupStat = hh3cDot3OmpeGroupStat.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpeGroupStat.setDescription('A collection of objects of dot3 OMP emulation Statistics') hh3cDot3OmpeCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 2, 2)) hh3cDot3OmpeCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 2, 2, 2, 1)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpeGroupID"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3OmpeGroupStat")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3OmpeCompliance = hh3cDot3OmpeCompliance.setStatus('current') if mibBuilder.loadTexts: hh3cDot3OmpeCompliance.setDescription('The compliance statement for OMPEmulation interfaces.') hh3cDot3EponMauMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3)) hh3cDot3EponMauObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 1)) hh3cDot3EponMauConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 2)) hh3cDot3EponMauTable = MibTable((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 1, 1), ) if mibBuilder.loadTexts: hh3cDot3EponMauTable.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauTable.setDescription('Table for dot3 MAU EPON MIB modules.') hh3cDot3EponMauEntry = MibTableRow((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hh3cDot3EponMauEntry.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauEntry.setDescription('An entry in the dot3 MAU EPON MIB modules table.') hh3cDot3EponMauPCSCodingViolation = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 1, 1, 1, 1), Counter32()).setUnits('octets').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3EponMauPCSCodingViolation.setReference('[802.3ah], 30.5.1.1.12.') if mibBuilder.loadTexts: hh3cDot3EponMauPCSCodingViolation.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauPCSCodingViolation.setDescription('For 100 Mb/ s operation it is a count of the number of times an invalid code-group is received, other than the /H/ code-group. For 1000 Mb/ s operation it is a count of the number of times an invalid codegroup is received, other than the /V/ code-group.') hh3cDot3EponMauFecAbility = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("nonsupported", 2), ("supported", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3EponMauFecAbility.setReference('[802.3ah], 30.5.1.1.13.') if mibBuilder.loadTexts: hh3cDot3EponMauFecAbility.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauFecAbility.setDescription('A read-only value that indicates the support of operation of the 1000BASE-PX PHY optional FEC Sublayer for Forward error correction see [802.3ah] clause 65.2). unknown(1) value is assigned in initializing, for non FEC support state or type not yet known. nonsupported(2) value is assigned when Sublayer is not support. supported(3) value is assigned when Sublayer is supported.') hh3cDot3EponMauFecMode = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("disabled", 2), ("enabled", 3))).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: hh3cDot3EponMauFecMode.setReference('[802.3ah], 30.5.1.1.14.') if mibBuilder.loadTexts: hh3cDot3EponMauFecMode.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauFecMode.setDescription('A read-write value that indicates the mode of operation of the 1000BASE-PX PHY optional FEC Sublayer for Forward error correction see [802.3ah] clause 65.2). A GET operation returns the current mode of operation the PHY. A SET operation changes the mode of operation of the PHY to the indicated value. unknown(1) value is assigned in initializing, for non FEC support state or type not yet known. disabled(2) value is assigned when Sublayer operating in disabled mode. enabled(3) value is assigned when Sublayer operating in FEC mode. writing can be done all the time.') hh3cDot3EponMauFECCorrectedBlocks = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 1, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3EponMauFECCorrectedBlocks.setReference('[802.3ah], 30.5.1.1.15.') if mibBuilder.loadTexts: hh3cDot3EponMauFECCorrectedBlocks.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauFECCorrectedBlocks.setDescription('For 10PASS-TS, 2BASE-TL and 1000BASE-PX PHYs, a count of corrected FEC blocks. This counter will not increment for other PHY Types. Increment the counter by one for each received block that is corrected by the FEC function in the PHY.') hh3cDot3EponMauFECUncorrectableBlocks = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 1, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3EponMauFECUncorrectableBlocks.setReference('[802.3ah], 30.5.1.1.16.') if mibBuilder.loadTexts: hh3cDot3EponMauFECUncorrectableBlocks.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauFECUncorrectableBlocks.setDescription('For 10PASS-TS, 2BASE-TL and 1000BASE-PX PHYs, a count of uncorrectable FEC blocks. This counter will not increment for other PHY Types. Increment the counter by one for each FEC block that is determined to be uncorrectable by the FEC function in the PHY.') hh3cDot3EponMauBufferHeadCodingViolation = MibTableColumn((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 1, 1, 1, 6), Counter32()).setUnits('octets').setMaxAccess("readonly") if mibBuilder.loadTexts: hh3cDot3EponMauBufferHeadCodingViolation.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauBufferHeadCodingViolation.setDescription('For 1000 Mbps operation it is a counts of the number of invalid code-group received directly from the link.') hh3cDot3EponMauType = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3)) hh3cEponMauType1000BasePXOLT = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 1)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePXOLT.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePXOLT.setDescription('Multipoint MAC Control (per 802.3 section 64,65) OLT (master), unknown PMD') if mibBuilder.loadTexts: hh3cEponMauType1000BasePXOLT.setReference('[802.3ah], 30.5.1.1.2.') hh3cEponMauType1000BasePXONU = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 2)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePXONU.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePXONU.setDescription('Multipoint MAC Control (per 802.3 section 64,65),ONU (slave), unknown PMD') if mibBuilder.loadTexts: hh3cEponMauType1000BasePXONU.setReference('[802.3ah], 30.5.1.1.2.') hh3cEponMauType1000BasePX10DOLT = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 3)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10DOLT.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10DOLT.setDescription('EPON over 10K link, downlink (per 802.3 section 60), OLT side') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10DOLT.setReference('[802.3ah], 30.5.1.1.2.') hh3cEponMauType1000BasePX10DONU = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 4)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10DONU.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10DONU.setDescription('EPON over 10K link, downlink (per 802.3 section 60), ONU side') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10DONU.setReference('[802.3ah], 30.5.1.1.2.') hh3cEponMauType1000BasePX10UOLT = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 5)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10UOLT.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10UOLT.setDescription('EPON over 10K link, uplink (per 802.3 section 60), OLT side') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10UOLT.setReference('[802.3ah], 30.5.1.1.2.') hh3cEponMauType1000BasePX10UONU = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 6)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10UONU.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10UONU.setDescription('EPON over 10K link, uplink (per 802.3 section 60), ONU side') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX10UONU.setReference('[802.3ah], 30.5.1.1.2.') hh3cEponMauType1000BasePX20DOLT = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 7)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20DOLT.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20DOLT.setDescription('EPON over 20K link, downlink (per 802.3 section 60), OLT side') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20DOLT.setReference('[802.3ah], 30.5.1.1.2.') hh3cEponMauType1000BasePX20DONU = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 8)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20DONU.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20DONU.setDescription('EPON over 20K link, downlink (per 802.3 section 60), ONU side') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20DONU.setReference('[802.3ah], 30.5.1.1.2.') hh3cEponMauType1000BasePX20UOLT = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 9)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20UOLT.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20UOLT.setDescription('EPON over 20K link, uplink (per 802.3 section 60), OLT side') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20UOLT.setReference('[802.3ah], 30.5.1.1.2.') hh3cEponMauType1000BasePX20UONU = ObjectIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 3, 10)) if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20UONU.setStatus('current') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20UONU.setDescription('EPON over 20K link, uplink (per 802.3 section 60), ONU side') if mibBuilder.loadTexts: hh3cEponMauType1000BasePX20UONU.setReference('[802.3ah], 30.5.1.1.2.') hh3cDot3EponMauGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 2, 1)) hh3cDot3EponMauGroupAll = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 2, 1, 1)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3EponMauPCSCodingViolation")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3EponMauGroupAll = hh3cDot3EponMauGroupAll.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauGroupAll.setDescription('A collection of objects of dot3 MAU definition.') hh3cDot3EponMauGroupFEC = ObjectGroup((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 2, 1, 2)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3EponMauFecAbility"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3EponMauFecMode"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3EponMauFECCorrectedBlocks"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3EponMauFECUncorrectableBlocks"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3EponMauBufferHeadCodingViolation")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3EponMauGroupFEC = hh3cDot3EponMauGroupFEC.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauGroupFEC.setDescription('A collection of objects of FEC group definition.') hh3cDot3EponMauCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 2, 2)) hh3cDot3EponMauCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 25506, 2, 42, 2, 3, 2, 2, 1)).setObjects(("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3EponMauGroupAll"), ("HH3C-DOT3-EFM-EPON-MIB", "hh3cDot3EponMauGroupFEC")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hh3cDot3EponMauCompliance = hh3cDot3EponMauCompliance.setStatus('current') if mibBuilder.loadTexts: hh3cDot3EponMauCompliance.setDescription('The compliance statement for MAU EPON interfaces.') mibBuilder.exportSymbols("HH3C-DOT3-EFM-EPON-MIB", hh3cDot3MpcpRxNotSupportedMPCP=hh3cDot3MpcpRxNotSupportedMPCP, hh3cEponMauType1000BasePXONU=hh3cEponMauType1000BasePXONU, hh3cDot3OmpEmulationGoodLLID=hh3cDot3OmpEmulationGoodLLID, hh3cDot3MpcpCompliances=hh3cDot3MpcpCompliances, hh3cEponMauType1000BasePX10UOLT=hh3cEponMauType1000BasePX10UOLT, hh3cDot3OmpeGroupStat=hh3cDot3OmpeGroupStat, hh3cDot3OmpeConformance=hh3cDot3OmpeConformance, hh3cEponMauType1000BasePX10UONU=hh3cEponMauType1000BasePX10UONU, hh3cEponMauType1000BasePX20DONU=hh3cEponMauType1000BasePX20DONU, hh3cDot3OmpEmulationStatEntry=hh3cDot3OmpEmulationStatEntry, hh3cDot3OmpEmulationType=hh3cDot3OmpEmulationType, hh3cDot3MpcpRxGate=hh3cDot3MpcpRxGate, hh3cEponMauType1000BasePX10DONU=hh3cEponMauType1000BasePX10DONU, hh3cDot3EponMauPCSCodingViolation=hh3cDot3EponMauPCSCodingViolation, hh3cEponMauType1000BasePX20UONU=hh3cEponMauType1000BasePX20UONU, hh3cDot3MpcpTxRegister=hh3cDot3MpcpTxRegister, hh3cDot3MpcpDiscoveryWindowsSent=hh3cDot3MpcpDiscoveryWindowsSent, hh3cDot3OmpEmulationMIB=hh3cDot3OmpEmulationMIB, hh3cDot3MpcpMACCtrlFramesReceived=hh3cDot3MpcpMACCtrlFramesReceived, hh3cDot3MpcpConformance=hh3cDot3MpcpConformance, hh3cDot3MpcpMACCtrlFramesTransmitted=hh3cDot3MpcpMACCtrlFramesTransmitted, hh3cDot3OmpEmulationCRC8Errors=hh3cDot3OmpEmulationCRC8Errors, PYSNMP_MODULE_ID=hh3cDot3EfmeponMIB, hh3cDot3OmpEmulationBadLLID=hh3cDot3OmpEmulationBadLLID, hh3cDot3MpcpObjects=hh3cDot3MpcpObjects, hh3cDot3EponMauGroupFEC=hh3cDot3EponMauGroupFEC, hh3cDot3MpcpAdminState=hh3cDot3MpcpAdminState, hh3cDot3EponMauGroups=hh3cDot3EponMauGroups, hh3cDot3MpcpGroups=hh3cDot3MpcpGroups, hh3cDot3EponMauType=hh3cDot3EponMauType, hh3cDot3MpcpStatTable=hh3cDot3MpcpStatTable, hh3cDot3MpcpOnTime=hh3cDot3MpcpOnTime, hh3cDot3OmpEmulationStatTable=hh3cDot3OmpEmulationStatTable, hh3cDot3EponMauBufferHeadCodingViolation=hh3cDot3EponMauBufferHeadCodingViolation, hh3cDot3MpcpGroupParam=hh3cDot3MpcpGroupParam, hh3cDot3OmpEmulationBroadcastLLIDNotOnuID=hh3cDot3OmpEmulationBroadcastLLIDNotOnuID, hh3cDot3MpcpCompliance=hh3cDot3MpcpCompliance, hh3cDot3EponMauFECUncorrectableBlocks=hh3cDot3EponMauFECUncorrectableBlocks, hh3cDot3MpcpRxReport=hh3cDot3MpcpRxReport, hh3cEponMauType1000BasePX10DOLT=hh3cEponMauType1000BasePX10DOLT, hh3cDot3OmpEmulationSLDErrors=hh3cDot3OmpEmulationSLDErrors, hh3cDot3EponMauCompliances=hh3cDot3EponMauCompliances, hh3cDot3MpcpRemoteMACAddress=hh3cDot3MpcpRemoteMACAddress, hh3cDot3MpcpMaximumPendingGrants=hh3cDot3MpcpMaximumPendingGrants, hh3cDot3MpcpTable=hh3cDot3MpcpTable, hh3cDot3EponMauEntry=hh3cDot3EponMauEntry, hh3cDot3OmpEmulationOnuPonCastLLID=hh3cDot3OmpEmulationOnuPonCastLLID, hh3cDot3EponMauTable=hh3cDot3EponMauTable, hh3cDot3OmpEmulationEntry=hh3cDot3OmpEmulationEntry, hh3cDot3MpcpRxRegRequest=hh3cDot3MpcpRxRegRequest, hh3cDot3EponMauFecAbility=hh3cDot3EponMauFecAbility, hh3cDot3EponMauMIB=hh3cDot3EponMauMIB, hh3cDot3MpcpTxRegRequest=hh3cDot3MpcpTxRegRequest, hh3cDot3MpcpEntry=hh3cDot3MpcpEntry, hh3cDot3MpcpStatEntry=hh3cDot3MpcpStatEntry, hh3cDot3OmpEmulationObjects=hh3cDot3OmpEmulationObjects, hh3cDot3MpcpMode=hh3cDot3MpcpMode, hh3cDot3OmpEmulationNotBroadcastLLIDNotOnuId=hh3cDot3OmpEmulationNotBroadcastLLIDNotOnuId, hh3cDot3EponMauCompliance=hh3cDot3EponMauCompliance, hh3cDot3MpcpReceiveElapsed=hh3cDot3MpcpReceiveElapsed, hh3cDot3MpcpOperStatus=hh3cDot3MpcpOperStatus, hh3cDot3MpcpOffTime=hh3cDot3MpcpOffTime, hh3cDot3OmpEmulationBroadcastLLIDPlusOnuId=hh3cDot3OmpEmulationBroadcastLLIDPlusOnuId, hh3cDot3MpcpMIB=hh3cDot3MpcpMIB, hh3cDot3MpcpGroupBase=hh3cDot3MpcpGroupBase, hh3cDot3MpcpGroupStat=hh3cDot3MpcpGroupStat, hh3cDot3OmpeGroups=hh3cDot3OmpeGroups, hh3cDot3OmpEmulationTable=hh3cDot3OmpEmulationTable, hh3cDot3OmpEmulationID=hh3cDot3OmpEmulationID, hh3cDot3MpcpTransmitElapsed=hh3cDot3MpcpTransmitElapsed, hh3cDot3EponMauObjects=hh3cDot3EponMauObjects, hh3cDot3EponMauFecMode=hh3cDot3EponMauFecMode, hh3cDot3MpcpTxReport=hh3cDot3MpcpTxReport, hh3cDot3EponMauFECCorrectedBlocks=hh3cDot3EponMauFECCorrectedBlocks, hh3cDot3OmpeCompliance=hh3cDot3OmpeCompliance, hh3cDot3EponMauGroupAll=hh3cDot3EponMauGroupAll, hh3cEponMauType1000BasePX20UOLT=hh3cEponMauType1000BasePX20UOLT, hh3cDot3OmpEmulationOnuLLIDNotBroadcast=hh3cDot3OmpEmulationOnuLLIDNotBroadcast, hh3cDot3MpcpTxRegAck=hh3cDot3MpcpTxRegAck, hh3cDot3MpcpRegistrationState=hh3cDot3MpcpRegistrationState, hh3cDot3MpcpRoundTripTime=hh3cDot3MpcpRoundTripTime, hh3cDot3EfmeponMIB=hh3cDot3EfmeponMIB, hh3cDot3MpcpRxRegAck=hh3cDot3MpcpRxRegAck, hh3cDot3MpcpDiscoveryTimeout=hh3cDot3MpcpDiscoveryTimeout, hh3cEponMauType1000BasePX20DOLT=hh3cEponMauType1000BasePX20DOLT, hh3cDot3MpcpLinkID=hh3cDot3MpcpLinkID, hh3cDot3MpcpRxRegister=hh3cDot3MpcpRxRegister, hh3cDot3MpcpID=hh3cDot3MpcpID, hh3cEponMauType1000BasePXOLT=hh3cEponMauType1000BasePXOLT, hh3cDot3EponMauConformance=hh3cDot3EponMauConformance, hh3cDot3OmpeCompliances=hh3cDot3OmpeCompliances, hh3cDot3OmpEmulationOltPonCastLLID=hh3cDot3OmpEmulationOltPonCastLLID, hh3cDot3OmpeGroupID=hh3cDot3OmpeGroupID, hh3cDot3MpcpTxGate=hh3cDot3MpcpTxGate, hh3cDot3MpcpSyncTime=hh3cDot3MpcpSyncTime)
[ 2, 198, 2, 9485, 15571, 7378, 337, 9865, 8265, 47138, 18, 34, 12, 35, 2394, 18, 12, 36, 23264, 12, 8905, 1340, 12, 8895, 33, 357, 4023, 1378, 16184, 76, 489, 8937, 13, 785, 14, 79, 893, 11632, 8, 198, 2, 7054, 45, 13, 16, 2723...
2.503312
22,793
import argparse from module_a.fun_1 import fun_1 from module_c.fun_4 import fun_4 from external_a.extra_fun import extra_fun if __name__ == "__main__": main()
[ 11748, 1822, 29572, 198, 198, 6738, 8265, 62, 64, 13, 12543, 62, 16, 1330, 1257, 62, 16, 198, 6738, 8265, 62, 66, 13, 12543, 62, 19, 1330, 1257, 62, 19, 198, 198, 6738, 7097, 62, 64, 13, 26086, 62, 12543, 1330, 3131, 62, 12543, ...
2.625
64
from .Proxy import Proxy from robot.libraries.BuiltIn import BuiltIn import sys from robot.libraries.Screenshot import Screenshot from robot.api import logger import I18nListener as i18n import ManyTranslations as ui from robot.utils import unic
[ 6738, 764, 44148, 1330, 38027, 198, 6738, 9379, 13, 75, 11127, 13, 39582, 818, 1330, 28477, 818, 198, 11748, 25064, 198, 6738, 9379, 13, 75, 11127, 13, 34204, 1330, 1446, 26892, 198, 6738, 9379, 13, 15042, 1330, 49706, 198, 11748, 314, ...
3.888889
63
# coding=utf-8 # Copyright 2018 Google LLC # # 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. """Implements experimental logic.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from copy import copy from dl_bounds.src.data import LocalDatasetProvider from dl_bounds.src.exp_helpers import aggregate_dicts from dl_bounds.src.experiments.exp_base import Experiment import numpy as np from scipy.stats import truncnorm import tensorflow as tf
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 15069, 2864, 3012, 11419, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262,...
3.666667
273
import json
[ 11748, 33918 ]
5.5
2
from time import sleep colors = {"clean": "\033[m", "red": "\033[31m", "green": "\033[32m", "yellow": "\033[33m", "blue": "\033[34m", "purple": "\033[35m", "cian": "\033[36m"} v = float(input("Enter the car speed was: ")) tic = (v - 80) * 7 print("{}Loading...{}".format(colors["green"], colors["clean"])) sleep(2) if v > 80: print("{}You were very fast, your speed was {} km{}".format(colors["red"], v, colors["clean"])) print("{}Now you need to pay {} $US because of that{}".format(colors["red"], tic, colors["clean"])) else: print("{}You were in the right speed, you can move on{}".format(colors["green"], colors["clean"]))
[ 6738, 640, 1330, 3993, 198, 4033, 669, 796, 19779, 27773, 1298, 37082, 44427, 58, 76, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 445, 1298, 37082, 44427, 58, 3132, 76, 1600, 198, 220, 220, 220, 220, 220, 220, 220, ...
2.33
300
# # @lc app=leetcode id=687 lang=python3 # # [687] Longest Univalue Path # # https://leetcode.com/problems/longest-univalue-path/description/ # # algorithms # Easy (34.69%) # Likes: 1312 # Dislikes: 351 # Total Accepted: 76.5K # Total Submissions: 218.3K # Testcase Example: '[5,4,5,1,1,5]' # # Given a binary tree, find the length of the longest path where each node in # the path has the same value. This path may or may not pass through the root. # # The length of path between two nodes is represented by the number of edges # between them. # # # # Example 1: # # Input: # # # 5 # / \ # 4 5 # / \ \ # 1 1 5 # # # Output:2 # # # # Example 2: # # Input: # # # 1 # / \ # 4 5 # / \ \ # 4 4 5 # # # Output:2 # # # # Note: The given binary tree has not more than 10000 nodes. The height of the # tree is not more than 1000. # # # @lc code=start # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # @lc code=end
[ 2, 198, 2, 2488, 44601, 598, 28, 293, 316, 8189, 4686, 28, 39925, 42392, 28, 29412, 18, 198, 2, 198, 2, 685, 39925, 60, 5882, 395, 791, 2473, 518, 10644, 198, 2, 198, 2, 3740, 1378, 293, 316, 8189, 13, 785, 14, 1676, 22143, 14, ...
2.066784
569
#!/usr/bin/env python2.7 # -*- coding: utf-8; mode: python; -*- """ Module for reading and processing GemaNet files. Constants: POS - list of parts-of-speech present in GermaNet RELTYPES - types of GermaNet relations Classes: Germanet - main class for processing GermaNet files """ ################################################################## # Imports from __future__ import unicode_literals, print_function from itertools import chain from collections import defaultdict import argparse import codecs import glob import os import re import sys import xml.etree.ElementTree as ET ################################################################## # Variables and Constants SKIP_RE = re.compile(r"\s+[1-9]") ENCODING = "utf-8" POS = [".adj", ".adv", ".noun", ".verb"] RELSYM2NAME = { "~": "Hyponym", "~i": "Instance Hyponym", "!": "Antonym", "#m": "Member holonym", "#p": "Part holonym", "#s": "Substance holonym", "$": "Verb Group", "%m": "Member meronym", "%p": "Part meronym", "%s": "Substance meronym", "&": "Similar to", "*": "Entailment", "+": "Derivationally related form", "-c": "Member of this domain - TOPIC", "-r": "Member of this domain - REGION", "-u": "Member of this domain - USAGE", ";c": "Domain of synset - TOPIC", ";r": "Domain of synset - REGION", ";u": "Domain of synset - USAGE", "<": "Participle of verb", "=": "Attribute", ">": "Cause", "@": "Hypernym", "@i": "Instance Hypernym", "\\": "Derived from adjective", "^": "Also see" } ################################################################## # Class
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 17, 13, 22, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 26, 4235, 25, 21015, 26, 532, 9, 12, 198, 198, 37811, 198, 26796, 329, 3555, 290, 7587, 15669, 64, 7934, 3696, 13, 198, ...
2.820513
585
import sys sys.path.append('./python') import skyhook.common as lib import io import json import math import numpy import os import os.path import skimage.io import struct user_func = None # user_func will be defined by the exec call in meta_func lib.run(callback, meta_func)
[ 11748, 25064, 198, 17597, 13, 6978, 13, 33295, 7, 4458, 14, 29412, 11537, 198, 11748, 6766, 25480, 13, 11321, 355, 9195, 198, 198, 11748, 33245, 198, 11748, 33918, 198, 11748, 10688, 198, 11748, 299, 32152, 198, 11748, 28686, 198, 11748, ...
3.146067
89
# model eval
[ 2, 2746, 5418 ]
4
3
import ply.lex # # Lexer setup # instructions = ( 'NOP', 'INT', 'IPI', 'RETINT', 'CALL', 'RET', 'CLI', 'STI', 'HLT', 'RST', 'IDLE', 'PUSH', 'POP', 'INC', 'DEC', 'ADD', 'SUB', 'CMP', 'J', 'AND', 'OR', 'XOR', 'NOT', 'SHL', 'SHR', 'SHRS', 'LW', 'LS', 'LB', 'LI', 'LIU', 'LA', 'STW', 'STS', 'STB', 'MOV', 'SWP', 'MUL', 'UDIV', 'MOD', 'CMPU', 'CAS', 'SIS', 'DIV', 'BE', 'BNE', 'BS', 'BNS', 'BZ', 'BNZ', 'BO', 'BNO', "BL", "BLE", "BGE", "BG", 'SETE', 'SETNE', 'SETZ', 'SETNZ', 'SETO', 'SETNO', 'SETS', 'SETNS', "SETL", "SETLE", "SETGE", "SETG", 'SELE', 'SELNE', 'SELZ', 'SELNZ', 'SELS', 'SELNS', 'SELO', 'SELNO', "SELL", "SELLE", "SELGE", "SELG", 'LPM', 'CTR', 'CTW', 'FPTC' ) math_instructions = ( 'PUSHW', 'SAVEW', 'POPW', 'LOADW', 'POPUW', 'LOADUW', 'SAVE', 'LOAD', 'INCL', 'DECL', 'ADDL', 'MULL', 'DIVL', 'MODL', 'UDIVL', 'UMODL', 'DUP', 'DUP2', 'SWPL', 'DROP', 'SYMDIVL', 'SYMMODL', 'PUSHL', 'POPL' ) directives = ( 'data', 'text', 'type', 'global', 'ascii', 'byte', 'short', 'space', 'string', 'word', 'section', 'align', 'file', 'set' ) # Construct list of tokens, and map of reserved words tokens = instructions + math_instructions + ( 'COMMA', 'COLON', 'HASH', 'LBRAC', 'RBRAC', 'DOT', 'PLUS', 'SCONST', 'ICONST', 'ID', 'REGISTER' ) reserved_map = { # Special registers 'sp': 'REGISTER', 'fp': 'REGISTER', # Special instructions 'shiftl': 'SHL', 'shiftr': 'SHR', 'shiftrs': 'SHRS' } reserved_map.update({i.lower(): i for i in instructions}) reserved_map.update({i.lower(): i for i in math_instructions}) tokens = tokens + tuple([i.upper() for i in directives]) reserved_map.update({'.' + i: i.upper() for i in directives}) reserved_map.update({i: i.upper() for i in directives}) reserved_map.update({'r%d' % i: 'REGISTER' for i in range(0, 32)}) # Newlines def t_NEWLINE(t): r'\n+' t.lexer.lineno += t.value.count('\n') # Tokens t_COMMA = r',' t_COLON = r':' t_HASH = r'\#' t_LBRAC = r'\[' t_RBRAC = r'\]' t_DOT = r'\.' t_PLUS = r'\+' t_SCONST = r'\"([^\\\n]|(\\.))*?\"' t_ICONST = r'-?(?:(?:0x[0-9a-fA-F][0-9a-fA-F]*)|(?:[0-9][0-9]*))' def t_ID(t): r'[a-zA-Z_\.][a-zA-Z0-9_\.]*' t.type = reserved_map.get(t.value, 'ID') return t t_ignore = " \t"
[ 11748, 35960, 13, 2588, 198, 198, 2, 198, 2, 17210, 263, 9058, 198, 2, 198, 259, 7249, 507, 796, 357, 198, 220, 705, 45, 3185, 3256, 705, 12394, 3256, 705, 4061, 40, 3256, 705, 26087, 12394, 3256, 705, 34, 7036, 3256, 705, 26087, ...
1.982609
1,150
from django.test import TestCase, override_settings from django.urls import reverse from rest_framework.test import APIClient from MyUser.models import User
[ 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 11, 20957, 62, 33692, 198, 6738, 42625, 14208, 13, 6371, 82, 1330, 9575, 198, 6738, 1334, 62, 30604, 13, 9288, 1330, 3486, 2149, 75, 1153, 198, 198, 6738, 2011, 12982, 13, 27530, 1330, ...
3.697674
43
""" flashcards.commands.sets ~~~~~~~~~~~~~~~~~~~ Contains the commands and subcommands related to the sets resource. """ import os import click from flashcards import sets from flashcards import storage sets_group.add_command(new) sets_group.add_command(select)
[ 37811, 198, 34167, 27761, 13, 9503, 1746, 13, 28709, 198, 27156, 4907, 93, 198, 198, 4264, 1299, 262, 9729, 290, 850, 9503, 1746, 3519, 284, 262, 5621, 8271, 13, 198, 37811, 198, 11748, 28686, 198, 198, 11748, 3904, 198, 198, 6738, 76...
3.506494
77
"""Module containing imports for user entity feature set pipelines.""" from legiti_challenge.feature_store_pipelines.user.user_chargebacks import ( UserChargebacksPipeline, ) from legiti_challenge.feature_store_pipelines.user.user_orders import UserOrdersPipeline __all__ = ["UserChargebacksPipeline", "UserOrdersPipeline"]
[ 37811, 26796, 7268, 17944, 329, 2836, 9312, 3895, 900, 31108, 526, 15931, 198, 6738, 6984, 72, 62, 36747, 3540, 13, 30053, 62, 8095, 62, 79, 541, 20655, 13, 7220, 13, 7220, 62, 10136, 10146, 1330, 357, 198, 220, 220, 220, 11787, 50044...
3.29
100
import numpy as np import struct import getpass import struct from datetime import datetime edge_curve = {}
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2878, 198, 11748, 651, 6603, 198, 11748, 2878, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 14907, 62, 22019, 303, 796, 23884, 628 ]
3.548387
31
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.888889
9
from marshmallow import Schema, fields, validate
[ 6738, 22397, 42725, 1330, 10011, 2611, 11, 7032, 11, 26571, 628 ]
4.545455
11
from styx_msgs.msg import TrafficLight import tensorflow as tf import numpy as np import rospy import cv2 import os MAX_IMAGE_WIDTH = 300 MAX_IMAGE_HEIGHT = 300
[ 6738, 8944, 87, 62, 907, 14542, 13, 19662, 1330, 23624, 15047, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 686, 2777, 88, 198, 11748, 269, 85, 17, 198, 11748, 28686, 628, 198, 22921, 62, ...
2.733333
60
import os import serial import time import binascii import textwrap import re from wifi import WIFI_SSID, WIFI_PASS if __name__ == '__main__': main()
[ 11748, 28686, 198, 11748, 11389, 198, 11748, 640, 198, 11748, 9874, 292, 979, 72, 198, 11748, 2420, 37150, 198, 11748, 302, 198, 198, 6738, 43121, 1330, 370, 5064, 40, 62, 5432, 2389, 11, 370, 5064, 40, 62, 47924, 628, 628, 198, 361, ...
2.741379
58
from extension_native_helpers import * Dtool_PreloadDLL('libpandaode') from libpandaode import * from extension_native_helpers import * Dtool_PreloadDLL('libpanda') from libpanda import * Dtool_funcToMethod(convert, OdeGeom) del convert Dtool_funcToMethod(getConvertedSpace, OdeGeom) del getConvertedSpace Dtool_funcToMethod(getAABounds, OdeGeom) del getAABounds from extension_native_helpers import * Dtool_PreloadDLL('libpanda') from libpanda import * Dtool_funcToMethod(convert, OdeSpace) del convert Dtool_funcToMethod(getConvertedGeom, OdeSpace) del getConvertedGeom Dtool_funcToMethod(getConvertedSpace, OdeSpace) del getConvertedSpace Dtool_funcToMethod(getAABounds, OdeSpace) del getAABounds from extension_native_helpers import * Dtool_PreloadDLL('libpanda') from libpanda import * Dtool_funcToMethod(attach, OdeJoint) del attach Dtool_funcToMethod(convert, OdeJoint) del convert from extension_native_helpers import * Dtool_PreloadDLL('libpanda') from libpanda import * Dtool_funcToMethod(getConvertedJoint, OdeBody) del getConvertedJoint
[ 6738, 7552, 62, 30191, 62, 16794, 364, 1330, 1635, 198, 35, 25981, 62, 6719, 2220, 35, 3069, 10786, 8019, 79, 5282, 1098, 11537, 198, 6738, 9195, 79, 5282, 1098, 1330, 1635, 198, 6738, 7552, 62, 30191, 62, 16794, 364, 1330, 1635, 198,...
2.813158
380
import gi import json gi.require_version('Gtk', '3.0') from gi.repository import Gtk
[ 11748, 308, 72, 198, 11748, 33918, 198, 198, 12397, 13, 46115, 62, 9641, 10786, 38, 30488, 3256, 705, 18, 13, 15, 11537, 198, 6738, 308, 72, 13, 260, 1930, 37765, 1330, 402, 30488, 628 ]
2.558824
34
from homeserver.voice_control.google_speech import GoogleVoiceRecognition from homeserver.voice_control.snowboy.snowboydecoder import HotwordDetector, play_audio_file #make the voicecontrol follow the device interface structure for control from homeserver.interface import DeviceInterface, DeviceTarget # import the DeviceCommand from homeserver.command_handler import DeviceCommand from homeserver import app, logger, device_handler import datetime import threading
[ 198, 198, 6738, 5682, 18497, 13, 38888, 62, 13716, 13, 13297, 62, 45862, 1330, 3012, 35708, 6690, 2360, 653, 198, 6738, 5682, 18497, 13, 38888, 62, 13716, 13, 82, 2197, 7081, 13, 82, 2197, 7081, 12501, 12342, 1330, 6964, 4775, 11242, ...
4.025
120
# Name: HELLO WORLD # Author: Fenteale # # Notes: # This is just a tiny program meant to showcase what # a repository will look like when downloaded through # github. print("Hello World!") print("This is just meant to be a tiny program to show off what a repo looks like.") inp = input("Type something here: ") print("You typed:", inp) print("Ok this is another test.") print("This is a change from the testing branch. Here is even more info.")
[ 2, 6530, 25, 47899, 46, 29564, 198, 2, 6434, 25, 376, 21872, 1000, 198, 2, 220, 198, 2, 11822, 25, 198, 2, 770, 318, 655, 257, 7009, 1430, 4001, 284, 21742, 644, 198, 2, 257, 16099, 481, 804, 588, 618, 15680, 832, 198, 2, 33084,...
3.496124
129
from pyfirmata import Arduino, util import time board = Arduino('/dev/ttyACM0') while 1: board.digital[13].write(0) time.sleep(1) board.digital[13].write(1) time.sleep(1)
[ 6738, 12972, 69, 2533, 1045, 1330, 27634, 11, 7736, 198, 11748, 640, 198, 3526, 796, 27634, 10786, 14, 7959, 14, 42852, 2246, 44, 15, 11537, 198, 198, 4514, 352, 25, 198, 220, 220, 220, 3096, 13, 34725, 58, 1485, 4083, 13564, 7, 15,...
2.379747
79
import pytest from Door import Door
[ 11748, 12972, 9288, 198, 6738, 19821, 1330, 19821 ]
4.375
8
import FWCore.ParameterSet.Config as cms process = cms.Process("SiPixelCPEGenericErrorParmReaderTest") process.load("CondCore.DBCommon.CondDBSetup_cfi") process.load("FWCore.MessageService.MessageLogger_cfi") process.source = cms.Source("EmptySource") process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) ) #Uncomment these two lines to get from the global tag #process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff') #process.GlobalTag.globaltag = 'IDEAL_30X::All' process.PoolDBESSource = cms.ESSource("PoolDBESSource", process.CondDBSetup, loadAll = cms.bool(True), toGet = cms.VPSet(cms.PSet( record = cms.string('SiPixelCPEGenericErrorParmRcd'), tag = cms.string('SiPixelCPEGenericErrorParm') )), DBParameters = cms.PSet( messageLevel = cms.untracked.int32(0), authenticationPath = cms.untracked.string('.') ), catalog = cms.untracked.string('file:PoolFileCatalog.xml'), timetype = cms.string('runnumber'), connect = cms.string('sqlite_file:siPixelCPEGenericErrorParm.db') ) process.reader = cms.EDAnalyzer("SiPixelCPEGenericErrorParmReader") process.myprint = cms.OutputModule("AsciiOutputModule") process.p = cms.Path(process.reader)
[ 11748, 48849, 14055, 13, 36301, 7248, 13, 16934, 355, 269, 907, 198, 198, 14681, 796, 269, 907, 13, 18709, 7203, 42801, 40809, 8697, 7156, 877, 291, 12331, 47, 1670, 33634, 14402, 4943, 198, 14681, 13, 2220, 7203, 25559, 14055, 13, 35, ...
2.018494
757
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry import test from benchmarks import silk_flags from measurements import smoothness import page_sets class SmoothnessMaps(test.Test): test = smoothness.Smoothness page_set = page_sets.MapsPageSet class SmoothnessKeyMobileSites(test.Test): """Measures rendering statistics while scrolling down the key mobile sites. http://www.chromium.org/developers/design-documents/rendering-benchmarks""" test = smoothness.Smoothness page_set = page_sets.KeyMobileSitesPageSet class SmoothnessGpuRasterizationKeySilkCases(test.Test): """Measures rendering statistics for the key silk cases with GPU rasterization """ tag = 'gpu_rasterization' test = smoothness.Smoothness page_set = page_sets.KeySilkCasesPageSet class SmoothnessFastPathGpuRasterizationKeySilkCases( SmoothnessGpuRasterizationKeySilkCases): """Measures rendering statistics for the key silk cases with GPU rasterization using bleeding edge rendering fast paths. """ tag = 'fast_path_gpu_rasterization' test = smoothness.Smoothness page_set = page_sets.KeySilkCasesPageSet
[ 2, 15069, 2211, 383, 18255, 1505, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 257, 347, 10305, 12, 7635, 5964, 326, 460, 307, 198, 2, 1043, 287, 262, 38559, 24290, 2393, 13, 198, 198, 6738,...
3.392473
372
from setuptools import setup, find_packages setup(name='robot', version='1.0', author='Igor Couto', author_email='igorcouto@gmail.com', description='A project to execute a robot that performs several actions on the browser.', packages=find_packages(), license='MIT' )
[ 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 201, 198, 201, 198, 40406, 7, 3672, 11639, 305, 13645, 3256, 201, 198, 220, 220, 220, 220, 220, 2196, 11639, 16, 13, 15, 3256, 201, 198, 220, 220, 220, 220, 220, 1772, 11639,...
2.603306
121
#!/usr/bin/env python import argparse import boundary import functools import graphics import itertools import json import operator import os.path import random import re import secrets import sys import traceback from boundary import Boundary from boundary import Domain from boundary import Orientation from boundary import Vect from collections import deque from enum import Enum, auto DEBUG_PRINTOUT = False DEFAULT_TILE_SIZE = 100 SCREENSHOT_PATH = './screenshot.jpg' DUMP_PATH = './dump.bmp' RIVER_PLACEMENT_DEFAULT_T_POLICY = RiverPlacement.USE_T RIVER_PLACEMENT_DEFAULT_LENGTH_POLICY = RiverPlacement.SHORT_RIVER def parse_tileset_description_file(json_file): fp = None cumul = 0 try: fp = open(json_file, 'r') tileset_json = json.load(fp) assert 'tiles' in tileset_json.keys() for tile_json in tileset_json['tiles']: tile = Tile.from_json_description(tile_json, os.path.dirname(json_file)) assert tile.max_nb >= 0 if tile.max_nb > 0: if 'start' in tile.tags: assert tile.max_nb == 1 cumul += tile.max_nb yield tile except FileNotFoundError: warn('Could not load file {}'.format(json_file)) except AssertionError: handle_assertion_error() except Exception: warn('Error parsing file {}'.format(json_file)) raise finally: if fp is not None: fp.close() if cumul > 0: print('Loaded {} tiles from file {}'.format(cumul, json_file)) def iterate_tile_predicates(tile_predicates, tileset_iter): remaining = tileset_iter for predicate in tile_predicates: tile_subset, remaining = predicate.partition_iter(remaining) yield tile_subset TileSubset.exclude_remaining().partition_iter(remaining) def iterate_tilesets(river_tileset, regular_tileset, river_tileset_period = 0, infinite = False): river_flag = len(river_tileset) > 0 first = True while True: if river_flag: if river_tileset_period == 0: # Single use of the river tileset if first: yield river_tileset else: # Reuse the river tileset periodically yield river_tileset for _ in range(max(1, river_tileset_period)): yield regular_tileset else: yield regular_tileset if not infinite: break first = False def update_border_and_candidate_tiles(placed_tile, border, candidate_tiles): """ This function updates the map boundary and the candidate tile placements Arguments: placed_tile The tile being added to the map boundary border The current map boundary candidate_tiles The list of candidate tiles along the map boundary Notes: A candidate tile placement is an unoccupied tile adjacent to the map boundary. In order to prioritize a tile placement among other candidates, the following parameters are used: - The length of the segment in contact with the map boundary - The L1 distance of the tile to the center of the map """ assert isinstance(placed_tile, PlacedTile) assert isinstance(border, Boundary) assert isinstance(candidate_tiles, CandidateTiles) # Merge the newly placed tile to the map boundary border.merge(placed_tile.get_boundary()) # Account for the change in the map boundary in candidate_tiles candidate_tiles.delete(placed_tile.pos) neighbor_edges = [(point, edge) for (point, edge, _) in placed_tile.iter_complement_segment()] neighbor_edges.extend([(point + edge, edge) for (point, edge) in neighbor_edges[:-1]]) tiles_to_update = [PositionedTile.from_boundary_edge(border, point, edge) for (point, edge) in neighbor_edges] for pos_tile in tiles_to_update: candidate_tiles.update(pos_tile) # Sort the updated list of candidates candidate_tiles.sort(key=PlacedTile.get_l1_distance) candidate_tiles.sort(key=PlacedTile.get_segment_length, reverse=True) if DEBUG_PRINTOUT: candidate_tiles.debug_printout() return placed_tile if __name__ == "__main__": main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 628, 198, 11748, 1822, 29572, 198, 11748, 18645, 198, 11748, 1257, 310, 10141, 198, 11748, 9382, 198, 11748, 340, 861, 10141, 198, 11748, 33918, 198, 11748, 10088, 198, 11748, 28686, 13, 6978, ...
2.514654
1,706
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainpage.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import *
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 2, 5178, 7822, 7560, 422, 3555, 334, 72, 2393, 705, 12417, 7700, 13, 9019, 6, 198, 2, 198, 2, 15622, 416, 25, 9485, 48, 83, 20, 12454, 2438, 17301, 642, 13, 2...
2.704082
98
""" @Author : liujianhan @Date : 2018/6/2 11:59 @Project : posture_classification @FileName : data_processor.py @Description : Placeholder """ import os from typing import Tuple import pandas as pd from keras.applications.resnet50 import preprocess_input from keras.preprocessing.image import ImageDataGenerator from sklearn.utils import shuffle import numpy as np def data_generator_flow(_train_dir: str, _valid_dir: str, _test_dir: str, batch_size: int = 32, target_size: Tuple = (256, 256), multi_output_mode: bool = False) -> Tuple: """ @param _train_dir: @param _valid_dir: @param _test_dir: @param batch_size: @param target_size: @param multi_output_mode: @return: """ train_df = pd.read_csv(os.path.join(_train_dir, 'train.csv')) valid_df = pd.read_csv(os.path.join(_valid_dir, 'valid.csv')) test_df = pd.read_csv(os.path.join(_test_dir, 'test.csv')) if not multi_output_mode: train_df.label = train_df.label.astype('str') valid_df.label = valid_df.label.astype('str') test_df.label = test_df.label.astype('str') train_data_gen = ImageDataGenerator( preprocessing_function=preprocess_input, width_shift_range=.2, height_shift_range=.2, shear_range=.2, zoom_range=.2, channel_shift_range=np.random.choice(100), horizontal_flip=True, ) train_data_flow = train_data_gen.flow_from_dataframe( dataframe=train_df, target_size=target_size, directory=_train_dir, batch_size=batch_size, class_mode='multi_output' if multi_output_mode else 'binary', x_col='filename', y_col=['label', 'score'] if multi_output_mode else 'label', ) # valid_data_gen = ImageDataGenerator(preprocessing_function=preprocess_input) valid_data_flow = valid_data_gen.flow_from_dataframe( dataframe=valid_df, target_size=target_size, directory=_valid_dir, batch_size=batch_size, class_mode='multi_output' if multi_output_mode else 'binary', x_col='filename', y_col=['label', 'score'] if multi_output_mode else 'label', ) test_data_gen = ImageDataGenerator(preprocessing_function=preprocess_input) test_data_flow = test_data_gen.flow_from_dataframe( dataframe=test_df, target_size=target_size, directory=_test_dir, batch_size=batch_size, class_mode='multi_output' if multi_output_mode else 'binary', x_col='filename', y_col=['label', 'score'] if multi_output_mode else 'label', ) return train_data_flow, valid_data_flow, test_data_flow
[ 37811, 198, 220, 2488, 13838, 220, 220, 220, 220, 220, 220, 1058, 7649, 23577, 666, 7637, 198, 220, 2488, 10430, 220, 220, 220, 220, 220, 220, 220, 220, 1058, 2864, 14, 21, 14, 17, 1367, 25, 3270, 198, 220, 2488, 16775, 220, 220, ...
2.193173
1,289
from math import sqrt x1,y1=map(float,input().split()) x2,y2=map(float,input().split()) p1=x2-x1 p2=y2-y1 res=sqrt((p1*p1)+(p2*p2)) print("%.4f"%res)
[ 6738, 10688, 1330, 19862, 17034, 198, 87, 16, 11, 88, 16, 28, 8899, 7, 22468, 11, 15414, 22446, 35312, 28955, 198, 87, 17, 11, 88, 17, 28, 8899, 7, 22468, 11, 15414, 22446, 35312, 28955, 198, 79, 16, 28, 87, 17, 12, 87, 16, 198,...
1.807229
83
from .pointer_network import PointerNetwork
[ 6738, 764, 29536, 62, 27349, 1330, 7695, 3849, 26245 ]
4.777778
9
from django.shortcuts import render, redirect from django.utils.datastructures import MultiValueDictKeyError
[ 6738, 42625, 14208, 13, 19509, 23779, 1330, 8543, 11, 18941, 198, 6738, 42625, 14208, 13, 26791, 13, 19608, 459, 1356, 942, 1330, 15237, 11395, 35, 713, 9218, 12331, 628 ]
3.793103
29
""" Test class attributes. """ import numba from numba import * from numba.testing.test_support import parametrize, main #------------------------------------------------------------------------ # Tests #------------------------------------------------------------------------ if __name__ == '__main__': # test_derivedclass_attrs(autojit) main()
[ 37811, 198, 14402, 1398, 12608, 13, 198, 37811, 198, 198, 11748, 997, 7012, 198, 6738, 997, 7012, 1330, 1635, 198, 6738, 997, 7012, 13, 33407, 13, 9288, 62, 11284, 1330, 5772, 316, 380, 2736, 11, 1388, 198, 198, 2, 10097, 982, 198, ...
4.261905
84
import time from datetime import datetime import pytest from pnp.plugins.pull import StopPollingError from pnp.plugins.pull.simple import CustomPolling from . import make_runner, start_runner def test_poll_with_cron_expression(): from cronex import CronExpression dut = CustomPolling(name='pytest', interval="*/1 * * * *", scheduled_callable=poll) assert dut.is_cron assert isinstance(dut._cron_interval, CronExpression) assert dut._cron_interval.string_tab == ['*/1', '*', '*', '*', '*']
[ 11748, 640, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 11748, 12972, 9288, 198, 198, 6738, 279, 37659, 13, 37390, 13, 31216, 1330, 13707, 39176, 278, 12331, 198, 6738, 279, 37659, 13, 37390, 13, 31216, 13, 36439, 1330, 8562, 391...
2.866667
180
from picamera import PiCamera from time import * from cv2 import * import numpy as np import os from PIL import Image from .errors import *
[ 6738, 8301, 18144, 1330, 13993, 35632, 198, 6738, 640, 1330, 1635, 198, 6738, 269, 85, 17, 1330, 1635, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 6738, 350, 4146, 1330, 7412, 198, 6738, 764, 48277, 1330, 1635, 198 ]
3.5
40
from setuptools import setup, find_packages """ Uma biblioteca para leitura de arquivos CNAB 240. """ setup( name='sbcnab240', version='0.1.0', url='https://github.com/Superbuy-Team/sbcnab240/', license='MIT', author='SuperBuy Team', author_email='ti@superbuy.com.br', description='Uma biblioteca para leitura de arquivos CNAB 240', long_description=__doc__, keywords='cnab cnab240 boleto', #packages=['sbcnab240'], packages=find_packages(exclude=['contrib', 'docs', 'tests*']), package_data={ 'bancos': ['sbcnab240/bancos/santander.json'], }, include_package_data=True, zip_safe=False, python_requires='~=2.6', platforms='any', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Natural Language :: Portuguese (Brazilian)', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules' ] )
[ 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 198, 37811, 198, 52, 2611, 275, 29142, 313, 31047, 31215, 443, 270, 5330, 390, 610, 421, 452, 418, 327, 4535, 33, 14956, 13, 198, 37811, 198, 198, 40406, 7, 198, 220, 22...
2.476768
495
from mlib.proj.struct import Project from mlib.web.html import HTMLPage, Hyperlink, HTMLImage SKIPPED_SOURCE = [ '@log_invokation', 'global DOC', '@staticmethod' ] FUN_LINKS = { 'bilinear': 'https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.bilinear.html' } FUN_LINKS.update( {fun.split('.')[-1]: scipy_doc_url(fun) for fun in [ 'scipy.signal.filtfilt', 'scipy.signal.lfilter', 'scipy.signal.butter' ]} )
[ 6738, 285, 8019, 13, 1676, 73, 13, 7249, 1330, 4935, 198, 6738, 285, 8019, 13, 12384, 13, 6494, 1330, 11532, 9876, 11, 15079, 8726, 11, 11532, 5159, 198, 18831, 31444, 1961, 62, 47690, 796, 685, 198, 220, 220, 220, 705, 31, 6404, 62...
2.079295
227
#!/usr/local/bin/python3 import sys import os import shutil import markdown def generate_markdown(source_file, dest_dir): '''generates a new html file in the dest directory, returns the name of the newly-created file''' md = "" with open(source_file, 'r') as opened_file: md = opened_file.read() html = content_to_html(md) new_name = os.path.split(source_file)[1].replace("md", "html") new_path = os.path.join(dest_dir, new_name) with open(new_path, "w+") as opened_file: opened_file.write(html) return new_name if __name__ == "__main__": main(sys.argv)
[ 2, 48443, 14629, 14, 12001, 14, 8800, 14, 29412, 18, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 4423, 346, 198, 11748, 1317, 2902, 628, 628, 198, 4299, 7716, 62, 4102, 2902, 7, 10459, 62, 7753, 11, 2244, 62, 15908, 2599, 198, ...
2.502024
247
#!/usr/bin/python from ansible.module_utils.basic import * if __name__ == '__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 198, 6738, 9093, 856, 13, 21412, 62, 26791, 13, 35487, 1330, 1635, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419, 198 ]
2.512195
41
"""Schemas Schemas Package more description """
[ 37811, 27054, 5356, 220, 198, 27054, 5356, 15717, 198, 220, 220, 220, 517, 6764, 198, 37811, 198 ]
3.117647
17
from itertools import chain, combinations from re import search from urllib.parse import urlparse from pymongo.errors import BulkWriteError from tweepy import OAuthHandler, API from yaml import load as yaml_load, BaseLoader from objects.article import Article from objects.hashtag import Hashtag from objects.tweet import Tweet from mongo.article_mongo import ArticleMongo from mongo.hashtag_mongo import HashtagMongo from mongo.theme_mongo import ThemeMongo from mongo.tweet_mongo import TweetMongo from utils.log_utils import dir_log from utils.url_utils import unshorten
[ 6738, 340, 861, 10141, 1330, 6333, 11, 17790, 198, 6738, 302, 1330, 2989, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 19016, 29572, 198, 198, 6738, 279, 4948, 25162, 13, 48277, 1330, 47900, 16594, 12331, 198, 6738, 4184, 538, 88, 1330, ...
3.490909
165
import psycopg2 import pandas as pd from ensemble_compilation.utils import gen_full_join_query, print_conditions
[ 11748, 17331, 22163, 70, 17, 201, 198, 11748, 19798, 292, 355, 279, 67, 201, 198, 201, 198, 6738, 34549, 62, 5589, 10520, 13, 26791, 1330, 2429, 62, 12853, 62, 22179, 62, 22766, 11, 3601, 62, 17561, 1756, 201, 198, 201, 198, 201, 19...
2.837209
43
# encoding: utf-8 # module Autodesk.AutoCAD.EditorInput calls itself EditorInput # from Acmgd, Version=24.0.0.0, Culture=neutral, PublicKeyToken=null, accoremgd, Version=24.0.0.0, Culture=neutral, PublicKeyToken=null # by generator 1.145 # no doc # no imports # no functions # classes def StartRecording(self): """ StartRecording(self: LivePreview) """ pass PreviewEnded = None Previewing = None PreviewStarted = None PreviewWillEnd = None PreviewWillStart = None RecordingEnded = None RecordingStarted = None RecordingWillEnd = None RecordingWillStart = None class LivePreviewActionBase(object): # no doc def Execute(self): """ Execute(self: LivePreviewActionBase) """ pass def OnAborted(self): """ OnAborted(self: LivePreviewActionBase) """ pass class LivePreviewAction(LivePreviewActionBase): """ LivePreviewAction(method: Delegate, *args: Array[object]) """ def Execute(self): """ Execute(self: LivePreviewAction) """ pass
[ 2, 21004, 25, 3384, 69, 12, 23, 201, 198, 2, 8265, 5231, 4147, 74, 13, 27722, 34, 2885, 13, 17171, 20560, 3848, 2346, 12058, 20560, 201, 198, 2, 422, 4013, 11296, 67, 11, 10628, 28, 1731, 13, 15, 13, 15, 13, 15, 11, 17346, 28, ...
1.764032
873
from all_models_for_mock.models.M0001_mock import * from all_models_for_mock.models.M0002_keywords import * from all_models_for_mock.models.M0003_statisic_task import *
[ 6738, 477, 62, 27530, 62, 1640, 62, 76, 735, 13, 27530, 13, 44, 18005, 62, 76, 735, 1330, 1635, 198, 6738, 477, 62, 27530, 62, 1640, 62, 76, 735, 13, 27530, 13, 44, 34215, 62, 2539, 10879, 1330, 1635, 198, 6738, 477, 62, 27530, ...
2.640625
64
# This program reverses a given string reverse()
[ 2, 770, 1430, 10372, 274, 257, 1813, 4731, 628, 198, 198, 50188, 3419, 198 ]
3.714286
14
import copy import cmath import numpy import scipy.linalg from pauxy.estimators.thermal import greens_function, one_rdm_from_G, particle_number from pauxy.estimators.mixed import local_energy from pauxy.walkers.stack import PropagatorStack from pauxy.walkers.walker import Walker from pauxy.utils.linalg import regularise_matrix_inverse from pauxy.utils.misc import update_stack, get_numeric_names if __name__=="__main__": unit_test()
[ 11748, 4866, 198, 11748, 269, 11018, 198, 11748, 299, 32152, 198, 11748, 629, 541, 88, 13, 75, 1292, 70, 198, 6738, 279, 559, 5431, 13, 395, 320, 2024, 13, 490, 7617, 1330, 30966, 62, 8818, 11, 530, 62, 4372, 76, 62, 6738, 62, 38,...
2.894737
152
from collections import OrderedDict import os import re from schedules_tools.schedule_handlers.smart_sheet import ScheduleHandler_smartsheet import yaml DEFAULT_TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'templates') DEPENDENCY_REGEX = re.compile(r'^{(?P<to>predecessor|\d+)}(?P<type>[F|S]+)?' r'( ?(?P<lag_sign>[+|-])?(?P<lag_amount>\d+)' r'(?P<lag_type>[d|w]))?$')
[ 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 11748, 28686, 198, 11748, 302, 198, 6738, 24025, 62, 31391, 13, 15952, 5950, 62, 4993, 8116, 13, 27004, 62, 21760, 1330, 19281, 25060, 62, 5796, 5889, 25473, 198, 11748, 331, 43695, 628, 198...
1.986547
223
"""Script to run camera calibration""" from camera import Camera camera = Camera(source_dir='/home/mce/Documents/bubble3D/calibration/Cam01', outfilename='Cam01', target_dir='results/camera', verbose=True) camera.calibrate() camera.compute_undistort()
[ 37811, 7391, 284, 1057, 4676, 36537, 37811, 198, 6738, 4676, 1330, 20432, 628, 198, 25695, 796, 20432, 7, 10459, 62, 15908, 11639, 14, 11195, 14, 76, 344, 14, 38354, 14, 46176, 903, 18, 35, 14, 9948, 571, 1358, 14, 21701, 486, 3256, ...
2.842105
95
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "MPZinke" ######################################################################################################################## # # # created by: MPZinke # # on 2021.09.14 # # # # DESCRIPTION: Created to sepparate the crazy logic between repeating and single occurance threads. The flow of this # # class is Sleep -> Action, where as the repeating class is (Action -> Sleep) <- REPEAT. # # BUGS: # # FUTURE: # # # ######################################################################################################################## from collections.abc import Callable; from Other.Class.ZThread import ZThread; from Other.Logger import log_error;
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 834, 9800, 834, 796, 366, 7378, 57, 259, 365, 1, 198, 198, 29113, 29113, 29113, 14468, 7804, 198, 2, 220, 220, ...
1.554648
979
from flask import Flask from werkzeug.routing import BaseConverter app = Flask(__name__) app.config['DEBUG'] = True app.url_map.converters['re'] = RegexConverter if __name__ == '__main__': app.run(host='0.0.0.0', port=8888)
[ 6738, 42903, 1330, 46947, 198, 6738, 266, 9587, 2736, 1018, 13, 81, 13660, 1330, 7308, 3103, 332, 353, 628, 198, 198, 1324, 796, 46947, 7, 834, 3672, 834, 8, 198, 1324, 13, 11250, 17816, 30531, 20520, 796, 6407, 198, 1324, 13, 6371, ...
2.489362
94
from pyfields import field from trend_analyze.src.validate import Validate from trend_analyze.config import *
[ 6738, 12972, 25747, 1330, 2214, 198, 198, 6738, 5182, 62, 38200, 2736, 13, 10677, 13, 12102, 378, 1330, 3254, 20540, 198, 6738, 5182, 62, 38200, 2736, 13, 11250, 1330, 1635, 628 ]
3.612903
31
# -*- coding: utf-8 -*- """ Inheritance Diagram ------------------- .. inheritance-diagram:: kotti.testing """ import os from os.path import join, dirname from unittest import TestCase from pytest import mark from pyramid import testing from pyramid.events import NewResponse from pyramid.security import ALL_PERMISSIONS from zope.deprecation.deprecation import deprecate import transaction # re-enable deprecation warnings during test runs # however, let the `ImportWarning` produced by Babel's # `localedata.py` vs `localedata/` show up once... from warnings import catch_warnings with catch_warnings(): from babel import localedata import compiler localedata, compiler # make pyflakes happy... :p # py.test markers (see http://pytest.org/latest/example/markers.html) user = mark.user BASE_URL = 'http://localhost:6543' def asset(name): import kotti return open(join(dirname(kotti.__file__), 'tests', name), 'rb') def includeme_login(config): config.add_view( login_view, name='login', renderer='kotti:templates/login.pt') def includeme_layout(config): # override edit master layout with view master layout config.override_asset( to_override='kotti:templates/edit/master.pt', override_with='kotti:templates/view/master.pt') def login_view(request): return {} def dummy_search(search_term, request): return u"Not found. Sorry!" def testing_db_url(): return os.environ.get('KOTTI_TEST_DB_STRING', 'sqlite://') def _initTestingDB(): from sqlalchemy import create_engine from kotti import get_settings from kotti.resources import initialize_sql database_url = testing_db_url() get_settings()['sqlalchemy.url'] = database_url session = initialize_sql(create_engine(database_url), drop_all=True) return session def _populator(): from kotti import DBSession from kotti.resources import Document from kotti.populate import populate populate() for doc in DBSession.query(Document)[1:]: DBSession.delete(doc) transaction.commit() def _turn_warnings_into_errors(): # pragma: no cover # turn all warnings into errors, but let the `ImportWarning` # produced by Babel's `localedata.py` vs `localedata/` show up once... from babel import localedata localedata # make pyflakes happy... :p from warnings import filterwarnings filterwarnings("error") def setUp(init_db=True, **kwargs): # _turn_warnings_into_errors() from kotti import _resolve_dotted from kotti import conf_defaults tearDown() settings = conf_defaults.copy() settings['kotti.secret'] = 'secret' settings['kotti.secret2'] = 'secret2' settings['kotti.populators'] = 'kotti.testing._populator' settings.update(kwargs.get('settings', {})) settings = _resolve_dotted(settings) kwargs['settings'] = settings config = testing.setUp(**kwargs) config.add_default_renderers() if init_db: _initTestingDB() transaction.begin() return config def tearDown(): from kotti import events from kotti import security from kotti.message import _inject_mailer # These should arguable use the configurator, so they don't need # to be torn down separately: events.clear() security.reset() _inject_mailer[:] = [] transaction.abort() testing.tearDown() # Functional ---- def _functional_includeme(config): from kotti import DBSession config.add_subscriber(expire, NewResponse) def _zope_testbrowser_pyquery(self): from pyquery import PyQuery return PyQuery( self.contents.replace('xmlns="http://www.w3.org/1999/xhtml', '')) def setUpFunctional(global_config=None, **settings): from kotti import main import wsgi_intercept.zope_testbrowser from webtest import TestApp tearDown() _settings = { 'sqlalchemy.url': testing_db_url(), 'kotti.secret': 'secret', 'kotti.site_title': 'Website des Kottbusser Tors', # for mailing 'kotti.populators': 'kotti.testing._populator', 'mail.default_sender': 'kotti@localhost', 'pyramid.includes': 'kotti.testing._functional_includeme', } _settings.update(settings) host, port = BASE_URL.split(':')[-2:] app = main({}, **_settings) wsgi_intercept.add_wsgi_intercept(host[2:], int(port), lambda: app) Browser = wsgi_intercept.zope_testbrowser.WSGI_Browser Browser.pyquery = property(_zope_testbrowser_pyquery) return dict( Browser=Browser, browser=Browser(), test_app=TestApp(app), ) def dummy_view(context, request): return {} def include_testing_view(config): config.add_view( dummy_view, context=TestingRootFactory, renderer='kotti:tests/testing_view.pt', ) config.add_view( dummy_view, name='secured', permission='view', context=TestingRootFactory, renderer='kotti:tests/testing_view.pt', ) def setUpFunctionalStrippedDownApp(global_config=None, **settings): # An app that doesn't use Nodes at all _settings = { 'kotti.base_includes': ( 'kotti kotti.views kotti.views.login kotti.views.users'), 'kotti.use_tables': 'principals', 'kotti.populators': 'kotti.populate.populate_users', 'pyramid.includes': 'kotti.testing.include_testing_view', 'kotti.root_factory': 'kotti.testing.TestingRootFactory', 'kotti.site_title': 'My Stripped Down Kotti', } _settings.update(settings) return setUpFunctional(global_config, **_settings) def registerDummyMailer(): from pyramid_mailer.mailer import DummyMailer from kotti.message import _inject_mailer mailer = DummyMailer() _inject_mailer.append(mailer) return mailer # set up deprecation warnings from zope.deprecation.deprecation import deprecated for item in UnitTestBase, EventTestBase, FunctionalTestBase, _initTestingDB: name = getattr(item, '__name__', item) deprecated(name, 'Unittest-style tests are deprecated as of Kotti 0.7. ' 'Please use pytest function arguments instead.')
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 198, 818, 372, 42942, 6031, 6713, 198, 1783, 6329, 198, 198, 492, 24155, 12, 10989, 6713, 3712, 479, 26380, 13, 33407, 198, 37811, 198, 198, 11748, 28686, 19...
2.656984
2,341
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None
[ 2, 30396, 329, 257, 13934, 5509, 10139, 13, 198, 2, 1398, 12200, 19667, 25, 198, 2, 220, 220, 220, 220, 825, 11593, 15003, 834, 7, 944, 11, 2124, 2599, 198, 2, 220, 220, 220, 220, 220, 220, 220, 220, 2116, 13, 2100, 796, 2124, 1...
2.173333
75
# simple recursions print("-"*5, "count down from 10") count_down(10) print() print("-"*5, "count down from 5") count_down(5) print()
[ 2, 2829, 664, 42394, 198, 198, 4798, 7203, 21215, 9, 20, 11, 366, 9127, 866, 422, 838, 4943, 198, 9127, 62, 2902, 7, 940, 8, 198, 4798, 3419, 198, 198, 4798, 7203, 21215, 9, 20, 11, 366, 9127, 866, 422, 642, 4943, 198, 9127, 62,...
2.566038
53
# Standard Python import copy # Thirdparty import numpy as np
[ 2, 8997, 11361, 198, 11748, 4866, 198, 198, 2, 10467, 10608, 198, 11748, 299, 32152, 355, 45941, 628, 628, 628, 628, 198 ]
3.227273
22
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2019-07-23 22:47 # @Author : Simon Meng # @Site : # @File : mkdir.py # @Software: PyCharm import os # Make a folder under the current path
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 220, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 220, 198, 2, 2488, 7575, 1058, 13130, 12, 2998, 12, 1954, 2534, 25, 2857, 220, 198, 2, 2488, 13838, 1058, 11288, ...
2.367816
87
import os import sys header_file_fmt = "{name}_ocl.hpp" header_string = ( "#ifndef {definition}_OCL_HPP\n" "#define {definition}_OCL_HPP\n" "#include <opencv2/core/ocl.hpp>\n" "const cv::ocl::ProgramSource& {module}_{name}_ocl() {{\n" "static cv::ocl::ProgramSource source(\"{module}\", \"{name}\", \"{kernel}\", \"\");\n" "return source;\n" "}}\n" "#endif\n" ) if __name__ == "__main__": if len(sys.argv) != 3: print("Usage: {} <kernel_dir> <header_dir>".format(sys.argv[0])) sys.exit(1) os.makedirs(sys.argv[2], exist_ok=True) create_headers(sys.argv[1], sys.argv[2])
[ 11748, 28686, 198, 11748, 25064, 198, 198, 25677, 62, 7753, 62, 69, 16762, 796, 45144, 3672, 92, 62, 38679, 13, 71, 381, 1, 198, 25677, 62, 8841, 796, 357, 198, 1, 2, 361, 358, 891, 1391, 46758, 92, 62, 4503, 43, 62, 39, 10246, ...
2.168539
267
from lotto_game.lotto_game import LottoGame if __name__ == "__main__": main()
[ 198, 6738, 300, 17631, 62, 6057, 13, 75, 17631, 62, 6057, 1330, 406, 17631, 8777, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3419, 198 ]
2.457143
35
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2142, 286, 10529, 2238, 13, 4091, 38559, 24290, 2393, 329, 1336, 6634, 290, 15665, 3307, 13, 198, 198, 6738, 16298, 2238, 1330, 40391, 11, 7032, 11, 4981, 628, 198 ]
3.159091
44
# ---------------------------------------------------------------------- # | # | BinaryStatementParserInfo.py # | # | David Brownell <db@DavidBrownell.com> # | 2021-10-12 13:55:27 # | # ---------------------------------------------------------------------- # | # | Copyright David Brownell 2021 # | Distributed under the Boost Software License, Version 1.0. See # | accompanying file LICENSE_1_0.txt or copy at # | http://www.boost.org/LICENSE_1_0.txt. # | # ---------------------------------------------------------------------- """Contains the BinaryStatementParserInfo""" import os from enum import auto, Enum from dataclasses import dataclass import CommonEnvironment from CommonEnvironmentEx.Package import InitRelativeImports # ---------------------------------------------------------------------- _script_fullpath = CommonEnvironment.ThisFullpath() _script_dir, _script_name = os.path.split(_script_fullpath) # ---------------------------------------------------------------------- with InitRelativeImports(): from .StatementParserInfo import StatementParserInfo from ..Expressions.ExpressionParserInfo import ExpressionParserInfo from ..Names.NameParserInfo import NameParserInfo # ---------------------------------------------------------------------- # ----------------------------------------------------------------------
[ 2, 16529, 23031, 201, 198, 2, 930, 201, 198, 2, 930, 220, 45755, 48682, 46677, 12360, 13, 9078, 201, 198, 2, 930, 201, 198, 2, 930, 220, 3271, 4373, 695, 1279, 9945, 31, 11006, 20644, 695, 13, 785, 29, 201, 198, 2, 930, 220, 220...
3.762274
387
__author__ = 'Daniel Kapellusch' import astropy.io.fits as fits import os import csv import json import sys import multiprocessing as mp #necessary imports. Note: this is written in python 2. from os import path import ConfigParser from os import system #necessary imports. Note: this is written in python 2. global path, max_processes,file_shifts,darkmaster,darksub,fitscent def writeListCfg(lst, cfgname): """ Write out a config file from a list. - Entries: 'listItem\n' :param lst: List to be written as a config file. :param cfgname: Filename or path/to/filename for config file. :return: Config filename or path/to/filename """ cfg_out = open(cfgname, 'w') for e in lst: cfg_out.write(str(e) + '\n') cfg_out.close() return cfgname def writeDictCfg(dct, cfgname): """ Write out a config file from a dictionary. - Entries: 'key=value\n' :param dct: Dictionary to be written as a config file. :param cfgname: Filename or path/to/filename for config file. :return: Config filename or path/to/filename """ cfg_out = open(cfgname, 'w') for k, v in dct.iteritems(): cfg_out.write('%s=%s\n' % (str(k), str(v))) cfg_out.close() return cfgname def prependToFilename(filename, prepending): """ Prepend Text to Filename. :param filename: Filename or path/to/filename to be modified. :param prepending: String to prepend to filename. :return: Modified filename or path/to/filename. """ b = os.path.basename(filename) n = prepending + b return filename.replace(b, n) def spawnDsubCmd(science_img, dark_img, norm_bot=None, norm_top=None): """ Spawn a darksub command. :param science_img: Science image filename or path/to/filename. :param dark_img: Master dark filename or path/to/filename. :param norm_bot: Multiplicative scaling to apply to the bottom amplifier (optional). :param norm_top: Multiplicative scaling to apply to the top amplifier (optional). :return: darksub_command, subtracted_fiilename """ dsub_out = prependToFilename(science_img, 'dsub_') dsub_opts = '--inputFile=%s --darkFile=%s --outputFile=%s' % (science_img, dark_img, dsub_out) if norm_bot: dsub_opts += ' --norm_bot=%s' % str(norm_bot) if norm_top: dsub_opts += ' --norm_top=%s' % str(norm_top) dsub_cmd = darksub + ' ' + dsub_opts return dsub_cmd, dsub_out def spawnCentCmd(subtracted_img, xshift, yshift): """ Spawn a fitscent command. :param subtracted_img: Dark subtracted science image. :param xshift: X shift to apply to image. :param yshift: Y shift to apply to image. :return: fitscent_command, centered_filename """ cent_out = prependToFilename(subtracted_img, 'cent_') cent_opts = '--input=%s --x=%s --y=%s --output=%s' % (subtracted_img, str(xshift), str(yshift), cent_out) cent_cmd = fitscent + ' ' + cent_opts return cent_cmd, cent_out def getNorms(img): # TODO """ :param img: Image to obtain normalization s for. :return: """ top = '' bot = '' return top, bot def getShifts(img, fileshifts): # TODOr """ :param img: image to get shift values :return: xshift, yshift """ try: xs = fileshifts[img]['x'] ys = fileshifts[img]['y'] return xs, ys except KeyError: print "Warning (getShifts): %s not found in fileshifts" % str(img) return 0, 0 if __name__ == "__main__": print(main(sys.argv[1:]))
[ 834, 9800, 834, 796, 705, 19962, 509, 1758, 297, 385, 354, 6, 198, 11748, 220, 6468, 28338, 13, 952, 13, 21013, 355, 11414, 198, 11748, 28686, 198, 11748, 269, 21370, 198, 11748, 33918, 198, 11748, 25064, 198, 11748, 18540, 305, 919, ...
2.520567
1,410
import datetime import random from django.test import TestCase from django.utils.dateparse import parse_datetime from .models import Article
[ 11748, 4818, 8079, 198, 11748, 4738, 198, 198, 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 198, 6738, 42625, 14208, 13, 26791, 13, 4475, 29572, 1330, 21136, 62, 19608, 8079, 198, 198, 6738, 764, 27530, 1330, 10172, 628 ]
3.789474
38
import nltk from nltk.tokenize import sent_tokenize from nltk.tokenize import word_tokenize from nltk.corpus import wordnet # TODO move cut words to config CUT_WORDS = ( "drop", "cut", "leave", "lose", "trim", "shed", "cast", "unload", "strike", "skip", "throw", "shake", "shave", "ditch", ) # phrases to include # shave some weight # phrases to ignore # leave no trace # A verb could be categorized to any of the following codes VERB_CODES = { "VB", # Verb, base form "VBD", # Verb, past tense "VBG", # Verb, gerund or present participle "VBN", # Verb, past participle "VBP", # Verb, non-3rd person singular present "VBZ", # Verb, 3rd person singular present }
[ 11748, 299, 2528, 74, 198, 6738, 299, 2528, 74, 13, 30001, 1096, 1330, 1908, 62, 30001, 1096, 198, 6738, 299, 2528, 74, 13, 30001, 1096, 1330, 1573, 62, 30001, 1096, 198, 6738, 299, 2528, 74, 13, 10215, 79, 385, 1330, 1573, 3262, 19...
2.441558
308
Python 3.9.2 (v3.9.2:1a79785e3e, Feb 19 2021, 09:06:10) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license()" for more information. >>>
[ 37906, 513, 13, 24, 13, 17, 357, 85, 18, 13, 24, 13, 17, 25, 16, 64, 3720, 41172, 68, 18, 68, 11, 3158, 678, 33448, 11, 7769, 25, 3312, 25, 940, 8, 220, 198, 58, 2601, 648, 718, 13, 15, 357, 565, 648, 12, 8054, 13, 15, 13,...
2.189873
79
from __future__ import unicode_literals import boto import sure # noqa from nose.tools import assert_raises from boto.exception import BotoServerError from moto import mock_iam
[ 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 11748, 275, 2069, 198, 11748, 1654, 220, 1303, 645, 20402, 198, 198, 6738, 9686, 13, 31391, 1330, 6818, 62, 430, 2696, 198, 6738, 275, 2069, 13, 1069, 4516, 1330, 347, 2...
3.303571
56
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: unversioned Generated by: https://github.com/swagger-api/swagger-codegen.git 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. """ from __future__ import absolute_import import os import sys import unittest import k8sclient from k8sclient.rest import ApiException from k8sclient.apis.storage_v1beta1_api import StorageV1beta1Api if __name__ == '__main__': unittest.main()
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 37811, 198, 220, 220, 220, 12554, 527, 3262, 274, 628, 220, 220, 220, 1400, 6764, 2810, 357, 27568, 416, 2451, 7928, 6127, 5235, 3740, 1378, 12567, 13, 785, 14, 2032, 7928, 12, 15042, 14, ...
3.162242
339