hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 11
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 251 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 251 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 251 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.05M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.04M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
098d7c6c55f7415535fddaa88a483e5bc3bc96a3 | 650 | py | Python | Python/[4 kyu] Sum of Intervals.py | KonstantinosAng/CodeWars | 9ec9da9ed95b47b9656a5ecf77f486230fd15e3a | [
"MIT"
] | null | null | null | Python/[4 kyu] Sum of Intervals.py | KonstantinosAng/CodeWars | 9ec9da9ed95b47b9656a5ecf77f486230fd15e3a | [
"MIT"
] | null | null | null | Python/[4 kyu] Sum of Intervals.py | KonstantinosAng/CodeWars | 9ec9da9ed95b47b9656a5ecf77f486230fd15e3a | [
"MIT"
] | null | null | null | # More details on this kata
# https://www.codewars.com/kata/52b7ed099cdc285c300001cd
| 32.5 | 56 | 0.432308 |
098ecd46fb3c22e9788a5fea3f7f90c4783dd2f7 | 59,170 | py | Python | tests/test_certdb.py | crocs-muni/cert-validataion-stats | bd61968c0487e634c160f6e25b7bb0eb1bab64fc | [
"MIT"
] | 3 | 2020-06-26T09:31:35.000Z | 2020-06-26T09:32:17.000Z | tests/test_certdb.py | crocs-muni/cert-validataion-stats | bd61968c0487e634c160f6e25b7bb0eb1bab64fc | [
"MIT"
] | null | null | null | tests/test_certdb.py | crocs-muni/cert-validataion-stats | bd61968c0487e634c160f6e25b7bb0eb1bab64fc | [
"MIT"
] | null | null | null | """
This module contains white-box unit tests of CertDB package
"""
# pylint: disable=W0212, C0103, C0302
import sys
import os
import subprocess
import time
import shutil
import string
import random
import unittest
import unittest.mock
from collections import OrderedDict
import toml
from cevast.utils import make_PEM_filename
from cevast.certdb import (
CertDB,
CertFileDB,
CertFileDBReadOnly,
CertNotAvailableError,
CertInvalidError,
CompositeCertDB,
CompositeCertDBReadOnly,
)
# Helper functions
TEST_DATA_PATH = 'tests/data/'
TEST_CERTS_1 = TEST_DATA_PATH + 'test_certs_1.csv'
TEST_CERTS_2 = TEST_DATA_PATH + 'test_certs_2.csv'
def insert_test_certs(database: CertDB, certs_file: str) -> list:
"""
Insert certificates from certs_file to database
Return list of inserted certificates.
"""
certs = []
with open(certs_file) as r_file:
for line in r_file:
els = [e.strip() for e in line.split(',')]
database.insert(els[0], els[1])
certs.append(els[0])
return certs
def insert_random_certs(database: CertDB, certs_cnt: int) -> list:
"""
Insert number(certs_cnt) randomly generated certificates to database
Return list of inserted certificates.
"""
certs = []
for _ in range(certs_cnt):
cert_id = random_string(16)
database.insert(cert_id, random_string(8))
certs.append(cert_id)
return certs
def delete_test_certs(database: CertDB, certs_file: str) -> list:
"""
Delete certificates from certs_file from database
Return list of deleted certificates.
"""
certs = []
with open(certs_file) as r_file:
for line in r_file:
els = [e.strip() for e in line.split(',')]
database.delete(els[0])
certs.append(els[0])
return certs
def commit_test_certs(database: CertDB, certs_file: str) -> list:
"""
Insert and commit certificates from certs_file to database
Return list of committed certificates.
"""
certs = insert_test_certs(database, certs_file)
database.commit()
return certs
if __name__ == '__main__':
unittest.main()
| 43.86212 | 112 | 0.65905 |
09902a24aa7794ecafdf93045b5137f40aa8d310 | 2,325 | py | Python | src/utils/utils.py | T1b4lt/gen-alg-examples | 7498c3b96fbc2b6c968cc98d0f1ef6551345a1f4 | [
"MIT"
] | null | null | null | src/utils/utils.py | T1b4lt/gen-alg-examples | 7498c3b96fbc2b6c968cc98d0f1ef6551345a1f4 | [
"MIT"
] | null | null | null | src/utils/utils.py | T1b4lt/gen-alg-examples | 7498c3b96fbc2b6c968cc98d0f1ef6551345a1f4 | [
"MIT"
] | null | null | null | import uuid
import numpy as np
def fitness_offsprings(mutated_offsprings, func_weights):
fitness_array = []
for indv in mutated_offsprings:
fitness_array.append(fitness_max_function(indv.weights, func_weights))
print("Actual offsprings fitness values:")
print(fitness_array)
return fitness_array
def fitness_population(population, func_weights):
fitness_array = []
for indv in population.population:
fitness_array.append(fitness_max_function(indv.weights,
func_weights)) # Calculate the fitness value for each indv of the population
print("Actual fitness values:")
print(fitness_array)
return fitness_array
def fitness_max_function(indv_weights, func_weights):
return np.dot(indv_weights, func_weights)
def select_parents(population, fitness_values):
num_parents = int(len(population) / 2) # We want the best 50% of the parents
parents = []
for parent_num in range(num_parents): # For each parent
max_fitness_idx = np.where(fitness_values == np.max(fitness_values)) # Get the index of the max fitness value
max_fitness_idx = max_fitness_idx[0][0]
parents.append(population.population[max_fitness_idx])
fitness_values[max_fitness_idx] = -99999999999 # Change his fitness to a minimum
print("Selected parents:")
print(parents)
return parents
| 27.034884 | 112 | 0.743656 |
0990ac9875cade50ef8fa38605b20f842216c59c | 516 | py | Python | main/migrations/0023_auto_20200114_2019.py | Ducolnd/SQ37 | 2323c3bd07124f082f1bb018c6ae5ee4cb7c94d1 | [
"Apache-2.0"
] | null | null | null | main/migrations/0023_auto_20200114_2019.py | Ducolnd/SQ37 | 2323c3bd07124f082f1bb018c6ae5ee4cb7c94d1 | [
"Apache-2.0"
] | null | null | null | main/migrations/0023_auto_20200114_2019.py | Ducolnd/SQ37 | 2323c3bd07124f082f1bb018c6ae5ee4cb7c94d1 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.1 on 2020-01-14 19:19
from django.db import migrations, models
| 22.434783 | 74 | 0.581395 |
0990bfe14e23c72b11bf2defe5e3302294dbdd91 | 11,197 | py | Python | unit_list.py | guliverza/AdditionalPylons | 37336dcd1678c6cdfa22d881c2178ba65cb1fd61 | [
"MIT"
] | null | null | null | unit_list.py | guliverza/AdditionalPylons | 37336dcd1678c6cdfa22d881c2178ba65cb1fd61 | [
"MIT"
] | null | null | null | unit_list.py | guliverza/AdditionalPylons | 37336dcd1678c6cdfa22d881c2178ba65cb1fd61 | [
"MIT"
] | null | null | null | import sc2
from sc2.constants import *
#our own classes
from unit_counters import UnitCounter
from warpprism import WarpPrism as wpControl
from immortal import Immortal as imControl
from stalker import Stalker as skControl
from zealot import Zealot as zlControl
from sentry import Sentry as snControl
from adept import Adept as adControl
from colossus import Colossus as coControl
from voidray import VoidRay as vrControl
from tempest import Tempest as tpControl
from phoenix import Phoenix as pxControl
from probe import Probe as pbControl
from shade import Shade as sdControl
from hightemplar import HighTemplar as htControl
from observer import Observer as obControl
from disruptor import Disruptor as dsControl
from disruptor_phased import DisruptorPhased as dpControl
from carrier import Carrier as crControl
from mothership import Mothership as msControl
from archon import Archon as arControl
from cannon import Cannon as cnControl
#properties.
| 34.24159 | 155 | 0.703224 |
09912f75595653975287507558557321b7720adb | 619 | py | Python | src/lib/bver/Versioned/Addon.py | backboneHQ/bver | c3c929442fadb28a3f39d0ddec19fb2dfc7a4732 | [
"MIT"
] | 1 | 2021-09-09T01:22:37.000Z | 2021-09-09T01:22:37.000Z | src/lib/bver/Versioned/Addon.py | backboneHQ/bver | c3c929442fadb28a3f39d0ddec19fb2dfc7a4732 | [
"MIT"
] | null | null | null | src/lib/bver/Versioned/Addon.py | backboneHQ/bver | c3c929442fadb28a3f39d0ddec19fb2dfc7a4732 | [
"MIT"
] | 1 | 2021-09-03T18:45:15.000Z | 2021-09-03T18:45:15.000Z | from .Versioned import Versioned
| 23.807692 | 77 | 0.568659 |
099172de3e642bdeca5a27c254f8bd00fc1bca12 | 393 | py | Python | agendamentos/migrations/0002_rename_ponto_agendamentos.py | afnmachado/univesp_pi_1 | e6f2b545faaf53d14d17f751d2fb32e6618885b7 | [
"MIT"
] | null | null | null | agendamentos/migrations/0002_rename_ponto_agendamentos.py | afnmachado/univesp_pi_1 | e6f2b545faaf53d14d17f751d2fb32e6618885b7 | [
"MIT"
] | null | null | null | agendamentos/migrations/0002_rename_ponto_agendamentos.py | afnmachado/univesp_pi_1 | e6f2b545faaf53d14d17f751d2fb32e6618885b7 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-11-15 20:32
from django.db import migrations
| 20.684211 | 63 | 0.613232 |
09928e74c332f7b48d51ab003cf566958a601031 | 5,988 | py | Python | backend/filing/admin.py | bhardwajRahul/sec-filings-app | 8cf7f5956717db8fee1f9a20445986ad9cb831ca | [
"MIT"
] | 36 | 2020-12-04T08:16:38.000Z | 2022-03-22T02:30:49.000Z | backend/filing/admin.py | bhardwajRahul/sec-filings-app | 8cf7f5956717db8fee1f9a20445986ad9cb831ca | [
"MIT"
] | 1 | 2021-10-14T22:20:40.000Z | 2021-10-17T17:29:50.000Z | backend/filing/admin.py | briancaffey/sec-filings-app | 8cf7f5956717db8fee1f9a20445986ad9cb831ca | [
"MIT"
] | 16 | 2020-11-30T18:46:51.000Z | 2022-01-20T23:01:58.000Z | from datetime import date
from django.contrib import admin, messages
from django.core.management import call_command
from django.utils.html import format_html
from django.http import HttpResponseRedirect
from django.urls import path
# Register your models here.
from .models import (
FilingList,
Filing,
Holding,
Cik,
Cusip,
CikObservation,
CusipObservation,
)
from .tasks import process_filing, process_filing_list
admin.site.register(Holding, HoldingAdmin)
admin.site.register(FilingList, FilingListAdmin)
admin.site.register(Filing, FilingAdmin)
admin.site.register(Cik, CikAdmin)
admin.site.register(CikObservation, CikObservationAdmin)
admin.site.register(Cusip, CusipAdmin)
admin.site.register(CusipObservation, CusipObservationAdmin)
| 27.981308 | 129 | 0.644122 |
0993f348c7032c4b29ebad6f8cebebce182f1117 | 1,039 | py | Python | 2019/day_06.py | nabiirah/advent-of-code | 9c7e7cae437c024aa05d9cb7f9211fd47f5226a2 | [
"MIT"
] | 24 | 2020-12-08T20:07:52.000Z | 2022-01-18T20:08:06.000Z | 2019/day_06.py | nestorhf/advent-of-code | 1bb827e9ea85e03e0720e339d10b3ed8c44d8f27 | [
"MIT"
] | null | null | null | 2019/day_06.py | nestorhf/advent-of-code | 1bb827e9ea85e03e0720e339d10b3ed8c44d8f27 | [
"MIT"
] | 10 | 2020-12-04T10:04:15.000Z | 2022-02-21T22:22:26.000Z | """Advent of Code 2019 Day 6 - Universal Orbit Map."""
with open('inputs/day_06.txt', 'r') as f:
orbits = f.read().split()
objects_dict = {}
for orbit in orbits:
orbited, orbiter = orbit.split(')')
objects_dict[orbiter] = orbited
num_orbits = 0
for orbiter in objects_dict:
next_orbit = objects_dict.get(orbiter, None)
while next_orbit:
next_orbit = objects_dict.get(next_orbit, None)
num_orbits += 1
# Answer One
print("Number of direct and indirect orbits:", num_orbits)
you_path = {}
on_you_path = set()
transfers = 0
next_orbit = objects_dict.get("YOU", None)
while next_orbit:
transfers += 1
you_path[next_orbit] = transfers
on_you_path.add(next_orbit)
next_orbit = objects_dict.get(next_orbit, None)
transfers = 0
next_orbit = objects_dict.get("SAN", None)
while next_orbit and next_orbit not in on_you_path:
transfers += 1
next_orbit = objects_dict.get(next_orbit, None)
# Answer Two
print("Transfers between you and Santa:", transfers + you_path[next_orbit] - 1)
| 25.975 | 79 | 0.704524 |
099616993ba496a5f298e789a5f964e19fc3db1f | 663 | py | Python | tests/test_handler.py | jbasko/hookery | 5638de2999ad533f83bc9a03110f85e5a0404257 | [
"MIT"
] | 3 | 2017-06-25T22:52:03.000Z | 2018-08-11T22:43:49.000Z | tests/test_handler.py | jbasko/hookery | 5638de2999ad533f83bc9a03110f85e5a0404257 | [
"MIT"
] | null | null | null | tests/test_handler.py | jbasko/hookery | 5638de2999ad533f83bc9a03110f85e5a0404257 | [
"MIT"
] | 1 | 2018-06-05T02:56:28.000Z | 2018-06-05T02:56:28.000Z | from hookery import Handler, Hook
| 22.1 | 66 | 0.641026 |
0996b5a05af034475da68915d54936a0fd18f441 | 1,057 | py | Python | apps/permcontrol/router.py | zshengsheng/Swallow | dd5098e241c5b4e50e53abbb105fd45323abf4d5 | [
"MIT"
] | 10 | 2018-03-18T14:22:31.000Z | 2019-03-18T03:13:40.000Z | apps/permcontrol/router.py | zshengsheng/Swallow | dd5098e241c5b4e50e53abbb105fd45323abf4d5 | [
"MIT"
] | null | null | null | apps/permcontrol/router.py | zshengsheng/Swallow | dd5098e241c5b4e50e53abbb105fd45323abf4d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/2/25 14:14
# @Author : ZJJ
# @Email : 597105373@qq.com
from .views import UserViewset, ChangeUserPasswdView, GroupsViewset, UserGroupViewset, GroupMemberViewset, \
PermissionViewset, GroupPermViewset, PersonalInfoViewset
from rest_framework.routers import DefaultRouter
permcontrol_router = DefaultRouter()
permcontrol_router.register("personinfo", PersonalInfoViewset, base_name="personinfo")
permcontrol_router.register("users", UserViewset, base_name="users")
permcontrol_router.register("chuserpasswd", ChangeUserPasswdView, base_name="chuserpasswd")
permcontrol_router.register("groups", GroupsViewset, base_name="groups")
permcontrol_router.register("usergroup", UserGroupViewset, base_name="usergroup")
permcontrol_router.register("groupmember", GroupMemberViewset, base_name="groupmember")
permcontrol_router.register("permission", PermissionViewset, base_name="permission")
permcontrol_router.register("groupperm", GroupPermViewset, base_name="groupperm")
| 52.85 | 109 | 0.796594 |
0996f3d1f1ac8a9ea6f99a214f2486805b79d23f | 3,742 | py | Python | __init__.py | FabienBasset/evolucare-skill | 4ecce1615cb11d72196ea745d2753fec19117b12 | [
"Apache-2.0"
] | null | null | null | __init__.py | FabienBasset/evolucare-skill | 4ecce1615cb11d72196ea745d2753fec19117b12 | [
"Apache-2.0"
] | null | null | null | __init__.py | FabienBasset/evolucare-skill | 4ecce1615cb11d72196ea745d2753fec19117b12 | [
"Apache-2.0"
] | null | null | null | # TODO: Add an appropriate license to your skill before publishing. See
# the LICENSE file for more information.
# Below is the list of outside modules you'll be using in your skill.
# They might be built-in to Python, from mycroft-core or from external
# libraries. If you use an external library, be sure to include it
# in the requirements.txt file so the library is installed properly
# when the skill gets installed later by a user.
from adapt.intent import IntentBuilder
from mycroft.skills.core import MycroftSkill, intent_handler
from mycroft.util.log import LOG
from mycroft.skills.context import adds_context, removes_context
| 33.711712 | 84 | 0.638696 |
0997546f6d77374f92afff882bacd381651ee0ae | 123 | py | Python | inconnu/traits/__init__.py | tiltowait/inconnu | 6cca5fed520899d159537701b695c94222d8dc45 | [
"MIT"
] | 4 | 2021-09-06T20:18:13.000Z | 2022-02-05T17:08:44.000Z | inconnu/traits/__init__.py | tiltowait/inconnu | 6cca5fed520899d159537701b695c94222d8dc45 | [
"MIT"
] | 7 | 2021-09-13T00:46:57.000Z | 2022-01-11T06:38:50.000Z | inconnu/traits/__init__.py | tiltowait/inconnu | 6cca5fed520899d159537701b695c94222d8dc45 | [
"MIT"
] | 2 | 2021-11-27T22:24:53.000Z | 2022-03-16T21:05:00.000Z | """Set up the package interface."""
from .add_update import add, update
from .show import show
from .delete import delete
| 20.5 | 35 | 0.756098 |
0997cd0a89022a9406ffd19fb23a90e8f3cec543 | 300 | py | Python | web/searching.py | Kabanosk/JAVRIS | f3fac115eb537e689c59bd093da34e7f0b34a035 | [
"MIT"
] | null | null | null | web/searching.py | Kabanosk/JAVRIS | f3fac115eb537e689c59bd093da34e7f0b34a035 | [
"MIT"
] | null | null | null | web/searching.py | Kabanosk/JAVRIS | f3fac115eb537e689c59bd093da34e7f0b34a035 | [
"MIT"
] | null | null | null | import webbrowser as web
from bs4 import BeautifulSoup
STARTING_URL = 'https://www.google.com/search?q='
| 25 | 50 | 0.716667 |
099a45ec8f275507986b6214bd241fe4b6c71ae3 | 54 | py | Python | tests/__init__.py | GDG-Ukraine/talks-feedback | 9016e2ecc35858d45f4979fab5a54ee953a75f04 | [
"MIT"
] | null | null | null | tests/__init__.py | GDG-Ukraine/talks-feedback | 9016e2ecc35858d45f4979fab5a54ee953a75f04 | [
"MIT"
] | null | null | null | tests/__init__.py | GDG-Ukraine/talks-feedback | 9016e2ecc35858d45f4979fab5a54ee953a75f04 | [
"MIT"
] | null | null | null | """Test suite for the Talks Feedback microservice."""
| 27 | 53 | 0.740741 |
099a7200287e3918106aa13022ec6083c9f7a764 | 867 | py | Python | app/models.py | KhaledHamoul/nbo_cs_dashboard | 0fc5a3479da4346d3b8f5cf44b19292ea2b99b10 | [
"MIT"
] | null | null | null | app/models.py | KhaledHamoul/nbo_cs_dashboard | 0fc5a3479da4346d3b8f5cf44b19292ea2b99b10 | [
"MIT"
] | null | null | null | app/models.py | KhaledHamoul/nbo_cs_dashboard | 0fc5a3479da4346d3b8f5cf44b19292ea2b99b10 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
import json
| 29.896552 | 81 | 0.730104 |
099bd56c8872287f3abf2cdee5e4888979d01b99 | 86 | py | Python | bigGay/__init__.py | MayaValentia/byleth-bot-dev | d22290156fdac597aca2dd6d83020dbb49ad8ff0 | [
"MIT"
] | 1 | 2020-08-12T18:46:49.000Z | 2020-08-12T18:46:49.000Z | bigGay/__init__.py | MayaValentia/byleth-bot-dev | d22290156fdac597aca2dd6d83020dbb49ad8ff0 | [
"MIT"
] | null | null | null | bigGay/__init__.py | MayaValentia/byleth-bot-dev | d22290156fdac597aca2dd6d83020dbb49ad8ff0 | [
"MIT"
] | 2 | 2020-09-13T02:55:48.000Z | 2021-02-11T09:34:07.000Z | from .bigGay import bigGay | 17.2 | 26 | 0.674419 |
099c6d4626feec61b7b00c6c857042abd77c6c2a | 2,039 | py | Python | ai_script_writer.py | FLWL/aoc-ai-parser | 2e08fc7b0909579aced5a84bda3645dbe8834d39 | [
"MIT"
] | 10 | 2019-03-17T00:48:35.000Z | 2022-02-06T18:15:48.000Z | ai_script_writer.py | FLWL/aoc-ai-parser | 2e08fc7b0909579aced5a84bda3645dbe8834d39 | [
"MIT"
] | null | null | null | ai_script_writer.py | FLWL/aoc-ai-parser | 2e08fc7b0909579aced5a84bda3645dbe8834d39 | [
"MIT"
] | 1 | 2022-01-16T12:38:52.000Z | 2022-01-16T12:38:52.000Z | from ai_constants import *
import ai_generator
if __name__ == '__main__':
# generate and express a rule
rule_tree = ai_generator.generate_rule()
rule_script = express_node(rule_tree)
print(rule_script)
# generate and write a script
script_tree = ai_generator.generate_script()
write_script(script_tree, "random_script.per")
| 30.432836 | 91 | 0.650809 |
099d1dd35cd095ae208ec87e7df60676dd935b0a | 1,316 | py | Python | euler-148.py | simonolander/euler | 4d7c4cd9333201cd0065419a511f111b6d75d90c | [
"MIT"
] | null | null | null | euler-148.py | simonolander/euler | 4d7c4cd9333201cd0065419a511f111b6d75d90c | [
"MIT"
] | null | null | null | euler-148.py | simonolander/euler | 4d7c4cd9333201cd0065419a511f111b6d75d90c | [
"MIT"
] | null | null | null | import numpy as np
from tabulate import tabulate
np.set_printoptions(linewidth=400, threshold=100000)
print(c(1000000000))
| 19.939394 | 70 | 0.506839 |
099d22378abb2c23fd159020197e09cb83d9cba8 | 440 | py | Python | geotrek/common/utils/translation.py | GeotrekCE/Geotrek | c1393925c1940ac795ab7fc04819cd8c78bc79fb | [
"BSD-2-Clause"
] | null | null | null | geotrek/common/utils/translation.py | GeotrekCE/Geotrek | c1393925c1940ac795ab7fc04819cd8c78bc79fb | [
"BSD-2-Clause"
] | null | null | null | geotrek/common/utils/translation.py | GeotrekCE/Geotrek | c1393925c1940ac795ab7fc04819cd8c78bc79fb | [
"BSD-2-Clause"
] | null | null | null | from django.conf import settings
if 'modeltranslation' in settings.INSTALLED_APPS:
from modeltranslation.translator import translator, NotRegistered
def get_translated_fields(model):
"""Get translated fields from a model"""
try:
mto = translator.get_options_for_model(model)
except NotRegistered:
translated_fields = []
else:
translated_fields = mto.fields.keys()
return translated_fields
| 27.5 | 69 | 0.731818 |
099dcffa5aed44bda69a923f230dbcd1cba3e9b5 | 141,668 | py | Python | pysnmp-with-texts/OSPF-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/OSPF-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/OSPF-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module OSPF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/OSPF-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:18:45 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint")
InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
IpAddress, TimeTicks, MibIdentifier, iso, ObjectIdentity, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, mib_2, Counter64, ModuleIdentity, Gauge32, Integer32, NotificationType, Unsigned32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "TimeTicks", "MibIdentifier", "iso", "ObjectIdentity", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "mib-2", "Counter64", "ModuleIdentity", "Gauge32", "Integer32", "NotificationType", "Unsigned32", "Bits")
TruthValue, RowStatus, TimeStamp, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "RowStatus", "TimeStamp", "TextualConvention", "DisplayString")
ospf = ModuleIdentity((1, 3, 6, 1, 2, 1, 14))
ospf.setRevisions(('2006-11-10 00:00', '1995-01-20 12:25',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ospf.setRevisionsDescriptions(('Updated for latest changes to OSPF Version 2: - updated the General Group with the new ospfRFC1583Compatibility, ospfReferenceBandwidth and ospfDiscontinuityTime objects - added graceful-restart-related objects - added stub-router-related objects - updated the Area Table with NSSA-related objects - added ospfAreaAggregateExtRouteTag object - added Opaque LSA-related objects - updates to the Compliances and Security sections - added area LSA counter table - added section describing translation of notification parameters between SNMP versions - added ospfComplianceObsolete to contain obsolete object groups - deprecated ospfExtLsdbTable See Appendix B of RFC 4750 for more details. This version published as part of RFC 4750', 'The initial SMIv2 revision of this MIB module, published in RFC 1850.',))
if mibBuilder.loadTexts: ospf.setLastUpdated('200611100000Z')
if mibBuilder.loadTexts: ospf.setOrganization('IETF OSPF Working Group')
if mibBuilder.loadTexts: ospf.setContactInfo('WG E-Mail: ospf@ietf.org WG Chairs: acee@cisco.com rohit@gmail.com Editors: Dan Joyal Nortel 600 Technology Park Drive Billerica, MA 01821 djoyal@nortel.com Piotr Galecki Airvana 19 Alpha Road Chelmsford, MA 01824 pgalecki@airvana.com Spencer Giacalone CSFB Eleven Madison Ave New York, NY 10010-3629 spencer.giacalone@gmail.com')
if mibBuilder.loadTexts: ospf.setDescription('The MIB module to describe the OSPF Version 2 Protocol. Note that some objects in this MIB module may pose a significant security risk. Refer to the Security Considerations section in RFC 4750 for more information. Copyright (C) The IETF Trust (2006). This version of this MIB module is part of RFC 4750; see the RFC itself for full legal notices.')
ospfGeneralGroup = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 1))
ospfRouterId = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 1), RouterID()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfRouterId.setReference('OSPF Version 2, C.1 Global parameters')
if mibBuilder.loadTexts: ospfRouterId.setStatus('current')
if mibBuilder.loadTexts: ospfRouterId.setDescription("A 32-bit integer uniquely identifying the router in the Autonomous System. By convention, to ensure uniqueness, this should default to the value of one of the router's IP interface addresses. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.")
ospfAdminStat = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 2), Status()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfAdminStat.setStatus('current')
if mibBuilder.loadTexts: ospfAdminStat.setDescription("The administrative status of OSPF in the router. The value 'enabled' denotes that the OSPF Process is active on at least one interface; 'disabled' disables it on all interfaces. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.")
ospfVersionNumber = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2))).clone(namedValues=NamedValues(("version2", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVersionNumber.setReference('OSPF Version 2, Title')
if mibBuilder.loadTexts: ospfVersionNumber.setStatus('current')
if mibBuilder.loadTexts: ospfVersionNumber.setDescription('The current version number of the OSPF protocol is 2.')
ospfAreaBdrRtrStatus = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 4), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaBdrRtrStatus.setReference('OSPF Version 2, Section 3 Splitting the AS into Areas')
if mibBuilder.loadTexts: ospfAreaBdrRtrStatus.setStatus('current')
if mibBuilder.loadTexts: ospfAreaBdrRtrStatus.setDescription('A flag to note whether this router is an Area Border Router.')
ospfASBdrRtrStatus = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 5), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfASBdrRtrStatus.setReference('OSPF Version 2, Section 3.3 Classification of routers')
if mibBuilder.loadTexts: ospfASBdrRtrStatus.setStatus('current')
if mibBuilder.loadTexts: ospfASBdrRtrStatus.setDescription('A flag to note whether this router is configured as an Autonomous System Border Router. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.')
ospfExternLsaCount = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExternLsaCount.setReference('OSPF Version 2, Appendix A.4.5 AS external link advertisements')
if mibBuilder.loadTexts: ospfExternLsaCount.setStatus('current')
if mibBuilder.loadTexts: ospfExternLsaCount.setDescription('The number of external (LS type-5) link state advertisements in the link state database.')
ospfExternLsaCksumSum = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExternLsaCksumSum.setStatus('current')
if mibBuilder.loadTexts: ospfExternLsaCksumSum.setDescription("The 32-bit sum of the LS checksums of the external link state advertisements contained in the link state database. This sum can be used to determine if there has been a change in a router's link state database and to compare the link state database of two routers. The value should be treated as unsigned when comparing two sums of checksums.")
ospfTOSSupport = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 8), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfTOSSupport.setReference('OSPF Version 2, Appendix F.1.2 Optional TOS support')
if mibBuilder.loadTexts: ospfTOSSupport.setStatus('current')
if mibBuilder.loadTexts: ospfTOSSupport.setDescription("The router's support for type-of-service routing. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.")
ospfOriginateNewLsas = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfOriginateNewLsas.setStatus('current')
if mibBuilder.loadTexts: ospfOriginateNewLsas.setDescription('The number of new link state advertisements that have been originated. This number is incremented each time the router originates a new LSA. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ospfDiscontinuityTime.')
ospfRxNewLsas = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfRxNewLsas.setStatus('current')
if mibBuilder.loadTexts: ospfRxNewLsas.setDescription('The number of link state advertisements received that are determined to be new instantiations. This number does not include newer instantiations of self-originated link state advertisements. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ospfDiscontinuityTime.')
ospfExtLsdbLimit = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 2147483647)).clone(-1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfExtLsdbLimit.setStatus('current')
if mibBuilder.loadTexts: ospfExtLsdbLimit.setDescription("The maximum number of non-default AS-external LSAs entries that can be stored in the link state database. If the value is -1, then there is no limit. When the number of non-default AS-external LSAs in a router's link state database reaches ospfExtLsdbLimit, the router enters overflow state. The router never holds more than ospfExtLsdbLimit non-default AS-external LSAs in its database. OspfExtLsdbLimit MUST be set identically in all routers attached to the OSPF backbone and/or any regular OSPF area (i.e., OSPF stub areas and NSSAs are excluded). This object is persistent and when written the entity SHOULD save the change to non-volatile storage.")
ospfMulticastExtensions = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 12), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfMulticastExtensions.setStatus('current')
if mibBuilder.loadTexts: ospfMulticastExtensions.setDescription("A bit mask indicating whether the router is forwarding IP multicast (Class D) datagrams based on the algorithms defined in the multicast extensions to OSPF. Bit 0, if set, indicates that the router can forward IP multicast datagrams in the router's directly attached areas (called intra-area multicast routing). Bit 1, if set, indicates that the router can forward IP multicast datagrams between OSPF areas (called inter-area multicast routing). Bit 2, if set, indicates that the router can forward IP multicast datagrams between Autonomous Systems (called inter-AS multicast routing). Only certain combinations of bit settings are allowed, namely: 0 (no multicast forwarding is enabled), 1 (intra-area multicasting only), 3 (intra-area and inter-area multicasting), 5 (intra-area and inter-AS multicasting), and 7 (multicasting everywhere). By default, no multicast forwarding is enabled. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.")
ospfExitOverflowInterval = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 13), PositiveInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfExitOverflowInterval.setStatus('current')
if mibBuilder.loadTexts: ospfExitOverflowInterval.setDescription('The number of seconds that, after entering OverflowState, a router will attempt to leave OverflowState. This allows the router to again originate non-default AS-external LSAs. When set to 0, the router will not leave overflow state until restarted. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.')
ospfDemandExtensions = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 14), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfDemandExtensions.setReference('Extending OSPF to Support Demand Circuits')
if mibBuilder.loadTexts: ospfDemandExtensions.setStatus('current')
if mibBuilder.loadTexts: ospfDemandExtensions.setDescription("The router's support for demand routing. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.")
ospfRFC1583Compatibility = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 15), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfRFC1583Compatibility.setReference('OSPF Version 2, Section 16.4.1 External path preferences')
if mibBuilder.loadTexts: ospfRFC1583Compatibility.setStatus('current')
if mibBuilder.loadTexts: ospfRFC1583Compatibility.setDescription('Indicates metrics used to choose among multiple AS-external LSAs. When RFC1583Compatibility is set to enabled, only cost will be used when choosing among multiple AS-external LSAs advertising the same destination. When RFC1583Compatibility is set to disabled, preference will be driven first by type of path using cost only to break ties. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.')
ospfOpaqueLsaSupport = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 16), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfOpaqueLsaSupport.setReference('The OSPF Opaque LSA Option')
if mibBuilder.loadTexts: ospfOpaqueLsaSupport.setStatus('current')
if mibBuilder.loadTexts: ospfOpaqueLsaSupport.setDescription("The router's support for Opaque LSA types.")
ospfReferenceBandwidth = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 17), Unsigned32()).setUnits('kilobits per second').setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfReferenceBandwidth.setStatus('current')
if mibBuilder.loadTexts: ospfReferenceBandwidth.setDescription('Reference bandwidth in kilobits/second for calculating default interface metrics. The default value is 100,000 KBPS (100 MBPS). This object is persistent and when written the entity SHOULD save the change to non-volatile storage.')
ospfRestartSupport = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("plannedOnly", 2), ("plannedAndUnplanned", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfRestartSupport.setStatus('current')
if mibBuilder.loadTexts: ospfRestartSupport.setDescription("The router's support for OSPF graceful restart. Options include: no restart support, only planned restarts, or both planned and unplanned restarts. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.")
ospfRestartInterval = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1800))).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfRestartInterval.setStatus('current')
if mibBuilder.loadTexts: ospfRestartInterval.setDescription('Configured OSPF graceful restart timeout interval. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.')
ospfRestartStrictLsaChecking = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 20), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfRestartStrictLsaChecking.setStatus('current')
if mibBuilder.loadTexts: ospfRestartStrictLsaChecking.setDescription('Indicates if strict LSA checking is enabled for graceful restart. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.')
ospfRestartStatus = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("notRestarting", 1), ("plannedRestart", 2), ("unplannedRestart", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfRestartStatus.setStatus('current')
if mibBuilder.loadTexts: ospfRestartStatus.setDescription('Current status of OSPF graceful restart.')
ospfRestartAge = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 22), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfRestartAge.setStatus('current')
if mibBuilder.loadTexts: ospfRestartAge.setDescription('Remaining time in current OSPF graceful restart interval.')
ospfRestartExitReason = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("inProgress", 2), ("completed", 3), ("timedOut", 4), ("topologyChanged", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfRestartExitReason.setStatus('current')
if mibBuilder.loadTexts: ospfRestartExitReason.setDescription("Describes the outcome of the last attempt at a graceful restart. If the value is 'none', no restart has yet been attempted. If the value is 'inProgress', a restart attempt is currently underway.")
ospfAsLsaCount = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 24), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAsLsaCount.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsaCount.setDescription('The number of AS-scope link state advertisements in the AS-scope link state database.')
ospfAsLsaCksumSum = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 25), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAsLsaCksumSum.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsaCksumSum.setDescription("The 32-bit unsigned sum of the LS checksums of the AS link state advertisements contained in the AS-scope link state database. This sum can be used to determine if there has been a change in a router's AS-scope link state database, and to compare the AS-scope link state database of two routers.")
ospfStubRouterSupport = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 26), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfStubRouterSupport.setReference('OSPF Stub Router Advertisement')
if mibBuilder.loadTexts: ospfStubRouterSupport.setStatus('current')
if mibBuilder.loadTexts: ospfStubRouterSupport.setDescription("The router's support for stub router functionality.")
ospfStubRouterAdvertisement = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("doNotAdvertise", 1), ("advertise", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ospfStubRouterAdvertisement.setStatus('current')
if mibBuilder.loadTexts: ospfStubRouterAdvertisement.setDescription('This object controls the advertisement of stub router LSAs by the router. The value doNotAdvertise will result in the advertisement of a standard router LSA and is the default value. This object is persistent and when written the entity SHOULD save the change to non-volatile storage.')
ospfDiscontinuityTime = MibScalar((1, 3, 6, 1, 2, 1, 14, 1, 28), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfDiscontinuityTime.setStatus('current')
if mibBuilder.loadTexts: ospfDiscontinuityTime.setDescription("The value of sysUpTime on the most recent occasion at which any one of this MIB's counters suffered a discontinuity. If no such discontinuities have occurred since the last re-initialization of the local management subsystem, then this object contains a zero value.")
ospfAreaTable = MibTable((1, 3, 6, 1, 2, 1, 14, 2), )
if mibBuilder.loadTexts: ospfAreaTable.setReference('OSPF Version 2, Section 6 The Area Data Structure')
if mibBuilder.loadTexts: ospfAreaTable.setStatus('current')
if mibBuilder.loadTexts: ospfAreaTable.setDescription("Information describing the configured parameters and cumulative statistics of the router's attached areas. The interfaces and virtual links are configured as part of these areas. Area 0.0.0.0, by definition, is the backbone area.")
ospfAreaEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 2, 1), ).setIndexNames((0, "OSPF-MIB", "ospfAreaId"))
if mibBuilder.loadTexts: ospfAreaEntry.setStatus('current')
if mibBuilder.loadTexts: ospfAreaEntry.setDescription("Information describing the configured parameters and cumulative statistics of one of the router's attached areas. The interfaces and virtual links are configured as part of these areas. Area 0.0.0.0, by definition, is the backbone area. Information in this table is persistent and when this object is written the entity SHOULD save the change to non-volatile storage.")
ospfAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 1), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaId.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaId.setStatus('current')
if mibBuilder.loadTexts: ospfAreaId.setDescription('A 32-bit integer uniquely identifying an area. Area ID 0.0.0.0 is used for the OSPF backbone.')
ospfAuthType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 2), OspfAuthenticationType().clone('none')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAuthType.setReference('OSPF Version 2, Appendix D Authentication')
if mibBuilder.loadTexts: ospfAuthType.setStatus('obsolete')
if mibBuilder.loadTexts: ospfAuthType.setDescription('The authentication type specified for an area.')
ospfImportAsExtern = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("importExternal", 1), ("importNoExternal", 2), ("importNssa", 3))).clone('importExternal')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfImportAsExtern.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfImportAsExtern.setStatus('current')
if mibBuilder.loadTexts: ospfImportAsExtern.setDescription('Indicates if an area is a stub area, NSSA, or standard area. Type-5 AS-external LSAs and type-11 Opaque LSAs are not imported into stub areas or NSSAs. NSSAs import AS-external data as type-7 LSAs')
ospfSpfRuns = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfSpfRuns.setStatus('current')
if mibBuilder.loadTexts: ospfSpfRuns.setDescription("The number of times that the intra-area route table has been calculated using this area's link state database. This is typically done using Dijkstra's algorithm. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ospfDiscontinuityTime.")
ospfAreaBdrRtrCount = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaBdrRtrCount.setStatus('current')
if mibBuilder.loadTexts: ospfAreaBdrRtrCount.setDescription('The total number of Area Border Routers reachable within this area. This is initially zero and is calculated in each Shortest Path First (SPF) pass.')
ospfAsBdrRtrCount = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAsBdrRtrCount.setStatus('current')
if mibBuilder.loadTexts: ospfAsBdrRtrCount.setDescription('The total number of Autonomous System Border Routers reachable within this area. This is initially zero and is calculated in each SPF pass.')
ospfAreaLsaCount = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 7), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaLsaCount.setStatus('current')
if mibBuilder.loadTexts: ospfAreaLsaCount.setDescription("The total number of link state advertisements in this area's link state database, excluding AS-external LSAs.")
ospfAreaLsaCksumSum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaLsaCksumSum.setStatus('current')
if mibBuilder.loadTexts: ospfAreaLsaCksumSum.setDescription("The 32-bit sum of the link state advertisements' LS checksums contained in this area's link state database. This sum excludes external (LS type-5) link state advertisements. The sum can be used to determine if there has been a change in a router's link state database, and to compare the link state database of two routers. The value should be treated as unsigned when comparing two sums of checksums.")
ospfAreaSummary = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("noAreaSummary", 1), ("sendAreaSummary", 2))).clone('noAreaSummary')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaSummary.setStatus('current')
if mibBuilder.loadTexts: ospfAreaSummary.setDescription('The variable ospfAreaSummary controls the import of summary LSAs into stub and NSSA areas. It has no effect on other areas. If it is noAreaSummary, the router will not originate summary LSAs into the stub or NSSA area. It will rely entirely on its default route. If it is sendAreaSummary, the router will both summarize and propagate summary LSAs.')
ospfAreaStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 10), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaStatus.setStatus('current')
if mibBuilder.loadTexts: ospfAreaStatus.setDescription('This object permits management of the table by facilitating actions such as row creation, construction, and destruction. The value of this object has no effect on whether other objects in this conceptual row can be modified.')
ospfAreaNssaTranslatorRole = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("always", 1), ("candidate", 2))).clone('candidate')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaNssaTranslatorRole.setStatus('current')
if mibBuilder.loadTexts: ospfAreaNssaTranslatorRole.setDescription("Indicates an NSSA border router's ability to perform NSSA translation of type-7 LSAs into type-5 LSAs.")
ospfAreaNssaTranslatorState = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enabled", 1), ("elected", 2), ("disabled", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaNssaTranslatorState.setStatus('current')
if mibBuilder.loadTexts: ospfAreaNssaTranslatorState.setDescription("Indicates if and how an NSSA border router is performing NSSA translation of type-7 LSAs into type-5 LSAs. When this object is set to enabled, the NSSA Border router's OspfAreaNssaExtTranslatorRole has been set to always. When this object is set to elected, a candidate NSSA Border router is Translating type-7 LSAs into type-5. When this object is set to disabled, a candidate NSSA border router is NOT translating type-7 LSAs into type-5.")
ospfAreaNssaTranslatorStabilityInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 13), PositiveInteger().clone(40)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaNssaTranslatorStabilityInterval.setStatus('current')
if mibBuilder.loadTexts: ospfAreaNssaTranslatorStabilityInterval.setDescription('The number of seconds after an elected translator determines its services are no longer required, that it should continue to perform its translation duties.')
ospfAreaNssaTranslatorEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 2, 1, 14), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaNssaTranslatorEvents.setStatus('current')
if mibBuilder.loadTexts: ospfAreaNssaTranslatorEvents.setDescription('Indicates the number of translator state changes that have occurred since the last boot-up. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ospfDiscontinuityTime.')
ospfStubAreaTable = MibTable((1, 3, 6, 1, 2, 1, 14, 3), )
if mibBuilder.loadTexts: ospfStubAreaTable.setReference('OSPF Version 2, Appendix C.2, Area Parameters')
if mibBuilder.loadTexts: ospfStubAreaTable.setStatus('current')
if mibBuilder.loadTexts: ospfStubAreaTable.setDescription('The set of metrics that will be advertised by a default Area Border Router into a stub area.')
ospfStubAreaEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 3, 1), ).setIndexNames((0, "OSPF-MIB", "ospfStubAreaId"), (0, "OSPF-MIB", "ospfStubTOS"))
if mibBuilder.loadTexts: ospfStubAreaEntry.setReference('OSPF Version 2, Appendix C.2, Area Parameters')
if mibBuilder.loadTexts: ospfStubAreaEntry.setStatus('current')
if mibBuilder.loadTexts: ospfStubAreaEntry.setDescription('The metric for a given Type of Service that will be advertised by a default Area Border Router into a stub area. Information in this table is persistent and when this object is written the entity SHOULD save the change to non-volatile storage.')
ospfStubAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 3, 1, 1), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfStubAreaId.setStatus('current')
if mibBuilder.loadTexts: ospfStubAreaId.setDescription('The 32-bit identifier for the stub area. On creation, this can be derived from the instance.')
ospfStubTOS = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 3, 1, 2), TOSType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfStubTOS.setStatus('current')
if mibBuilder.loadTexts: ospfStubTOS.setDescription('The Type of Service associated with the metric. On creation, this can be derived from the instance.')
ospfStubMetric = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 3, 1, 3), BigMetric()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfStubMetric.setStatus('current')
if mibBuilder.loadTexts: ospfStubMetric.setDescription('The metric value applied at the indicated Type of Service. By default, this equals the least metric at the Type of Service among the interfaces to other areas.')
ospfStubStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 3, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfStubStatus.setStatus('current')
if mibBuilder.loadTexts: ospfStubStatus.setDescription('This object permits management of the table by facilitating actions such as row creation, construction, and destruction. The value of this object has no effect on whether other objects in this conceptual row can be modified.')
ospfStubMetricType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ospfMetric", 1), ("comparableCost", 2), ("nonComparable", 3))).clone('ospfMetric')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfStubMetricType.setStatus('current')
if mibBuilder.loadTexts: ospfStubMetricType.setDescription('This variable displays the type of metric advertised as a default route.')
ospfLsdbTable = MibTable((1, 3, 6, 1, 2, 1, 14, 4), )
if mibBuilder.loadTexts: ospfLsdbTable.setReference('OSPF Version 2, Section 12 Link State Advertisements')
if mibBuilder.loadTexts: ospfLsdbTable.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbTable.setDescription("The OSPF Process's link state database (LSDB). The LSDB contains the link state advertisements from throughout the areas that the device is attached to.")
ospfLsdbEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 4, 1), ).setIndexNames((0, "OSPF-MIB", "ospfLsdbAreaId"), (0, "OSPF-MIB", "ospfLsdbType"), (0, "OSPF-MIB", "ospfLsdbLsid"), (0, "OSPF-MIB", "ospfLsdbRouterId"))
if mibBuilder.loadTexts: ospfLsdbEntry.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbEntry.setDescription('A single link state advertisement.')
ospfLsdbAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 1), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbAreaId.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfLsdbAreaId.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbAreaId.setDescription('The 32-bit identifier of the area from which the LSA was received.')
ospfLsdbType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 10))).clone(namedValues=NamedValues(("routerLink", 1), ("networkLink", 2), ("summaryLink", 3), ("asSummaryLink", 4), ("asExternalLink", 5), ("multicastLink", 6), ("nssaExternalLink", 7), ("areaOpaqueLink", 10)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbType.setReference('OSPF Version 2, Appendix A.4.1 The Link State Advertisement header')
if mibBuilder.loadTexts: ospfLsdbType.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbType.setDescription('The type of the link state advertisement. Each link state type has a separate advertisement format. Note: External link state advertisements are permitted for backward compatibility, but should be displayed in the ospfAsLsdbTable rather than here.')
ospfLsdbLsid = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbLsid.setReference('OSPF Version 2, Section 12.1.4 Link State ID')
if mibBuilder.loadTexts: ospfLsdbLsid.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbLsid.setDescription('The Link State ID is an LS Type Specific field containing either a Router ID or an IP address; it identifies the piece of the routing domain that is being described by the advertisement.')
ospfLsdbRouterId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 4), RouterID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbRouterId.setReference('OSPF Version 2, Appendix C.1 Global parameters')
if mibBuilder.loadTexts: ospfLsdbRouterId.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbRouterId.setDescription('The 32-bit number that uniquely identifies the originating router in the Autonomous System.')
ospfLsdbSequence = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbSequence.setReference('OSPF Version 2, Section 12.1.6 LS sequence number')
if mibBuilder.loadTexts: ospfLsdbSequence.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbSequence.setDescription("The sequence number field is a signed 32-bit integer. It starts with the value '80000001'h, or -'7FFFFFFF'h, and increments until '7FFFFFFF'h. Thus, a typical sequence number will be very negative. It is used to detect old and duplicate Link State Advertisements. The space of sequence numbers is linearly ordered. The larger the sequence number, the more recent the advertisement.")
ospfLsdbAge = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 6), Integer32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbAge.setReference('OSPF Version 2, Section 12.1.1 LS age')
if mibBuilder.loadTexts: ospfLsdbAge.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbAge.setDescription('This field is the age of the link state advertisement in seconds.')
ospfLsdbChecksum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbChecksum.setReference('OSPF Version 2, Section 12.1.7 LS checksum')
if mibBuilder.loadTexts: ospfLsdbChecksum.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbChecksum.setDescription("This field is the checksum of the complete contents of the advertisement, excepting the age field. The age field is excepted so that an advertisement's age can be incremented without updating the checksum. The checksum used is the same that is used for ISO connectionless datagrams; it is commonly referred to as the Fletcher checksum.")
ospfLsdbAdvertisement = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 4, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLsdbAdvertisement.setReference('OSPF Version 2, Section 12 Link State Advertisements')
if mibBuilder.loadTexts: ospfLsdbAdvertisement.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbAdvertisement.setDescription('The entire link state advertisement, including its header. Note that for variable length LSAs, SNMP agents may not be able to return the largest string size.')
ospfAreaRangeTable = MibTable((1, 3, 6, 1, 2, 1, 14, 5), )
if mibBuilder.loadTexts: ospfAreaRangeTable.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaRangeTable.setStatus('obsolete')
if mibBuilder.loadTexts: ospfAreaRangeTable.setDescription('The Address Range Table acts as an adjunct to the Area Table. It describes those Address Range Summaries that are configured to be propagated from an Area to reduce the amount of information about it that is known beyond its borders. It contains a set of IP address ranges specified by an IP address/IP network mask pair. For example, class B address range of X.X.X.X with a network mask of 255.255.0.0 includes all IP addresses from X.X.0.0 to X.X.255.255. Note that this table is obsoleted and is replaced by the Area Aggregate Table.')
ospfAreaRangeEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 5, 1), ).setIndexNames((0, "OSPF-MIB", "ospfAreaRangeAreaId"), (0, "OSPF-MIB", "ospfAreaRangeNet"))
if mibBuilder.loadTexts: ospfAreaRangeEntry.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaRangeEntry.setStatus('obsolete')
if mibBuilder.loadTexts: ospfAreaRangeEntry.setDescription('A single area address range. Information in this table is persistent and when this object is written the entity SHOULD save the change to non-volatile storage.')
ospfAreaRangeAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 5, 1, 1), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaRangeAreaId.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaRangeAreaId.setStatus('obsolete')
if mibBuilder.loadTexts: ospfAreaRangeAreaId.setDescription('The area that the address range is to be found within.')
ospfAreaRangeNet = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 5, 1, 2), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaRangeNet.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaRangeNet.setStatus('obsolete')
if mibBuilder.loadTexts: ospfAreaRangeNet.setDescription('The IP address of the net or subnet indicated by the range.')
ospfAreaRangeMask = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 5, 1, 3), IpAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaRangeMask.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaRangeMask.setStatus('obsolete')
if mibBuilder.loadTexts: ospfAreaRangeMask.setDescription('The subnet mask that pertains to the net or subnet.')
ospfAreaRangeStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 5, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaRangeStatus.setStatus('obsolete')
if mibBuilder.loadTexts: ospfAreaRangeStatus.setDescription('This object permits management of the table by facilitating actions such as row creation, construction, and destruction. The value of this object has no effect on whether other objects in this conceptual row can be modified.')
ospfAreaRangeEffect = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 5, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("advertiseMatching", 1), ("doNotAdvertiseMatching", 2))).clone('advertiseMatching')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaRangeEffect.setStatus('obsolete')
if mibBuilder.loadTexts: ospfAreaRangeEffect.setDescription("Subnets subsumed by ranges either trigger the advertisement of the indicated summary (advertiseMatching) or result in the subnet's not being advertised at all outside the area.")
ospfHostTable = MibTable((1, 3, 6, 1, 2, 1, 14, 6), )
if mibBuilder.loadTexts: ospfHostTable.setReference('OSPF Version 2, Appendix C.7 Host route parameters')
if mibBuilder.loadTexts: ospfHostTable.setStatus('current')
if mibBuilder.loadTexts: ospfHostTable.setDescription('The Host/Metric Table indicates what hosts are directly attached to the router, what metrics and types of service should be advertised for them, and what areas they are found within.')
ospfHostEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 6, 1), ).setIndexNames((0, "OSPF-MIB", "ospfHostIpAddress"), (0, "OSPF-MIB", "ospfHostTOS"))
if mibBuilder.loadTexts: ospfHostEntry.setStatus('current')
if mibBuilder.loadTexts: ospfHostEntry.setDescription('A metric to be advertised, for a given type of service, when a given host is reachable. Information in this table is persistent and when this object is written the entity SHOULD save the change to non-volatile storage.')
ospfHostIpAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 1), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfHostIpAddress.setReference('OSPF Version 2, Appendix C.7 Host route parameters')
if mibBuilder.loadTexts: ospfHostIpAddress.setStatus('current')
if mibBuilder.loadTexts: ospfHostIpAddress.setDescription('The IP address of the host.')
ospfHostTOS = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 2), TOSType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfHostTOS.setReference('OSPF Version 2, Appendix C.7 Host route parameters')
if mibBuilder.loadTexts: ospfHostTOS.setStatus('current')
if mibBuilder.loadTexts: ospfHostTOS.setDescription('The Type of Service of the route being configured.')
ospfHostMetric = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 3), Metric()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfHostMetric.setReference('OSPF Version 2, Appendix C.7 Host route parameters')
if mibBuilder.loadTexts: ospfHostMetric.setStatus('current')
if mibBuilder.loadTexts: ospfHostMetric.setDescription('The metric to be advertised.')
ospfHostStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfHostStatus.setStatus('current')
if mibBuilder.loadTexts: ospfHostStatus.setDescription('This object permits management of the table by facilitating actions such as row creation, construction, and destruction. The value of this object has no effect on whether other objects in this conceptual row can be modified.')
ospfHostAreaID = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 5), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfHostAreaID.setReference('OSPF Version 2, Appendix C.7 Host parameters')
if mibBuilder.loadTexts: ospfHostAreaID.setStatus('deprecated')
if mibBuilder.loadTexts: ospfHostAreaID.setDescription('The OSPF area to which the host belongs. Deprecated by ospfHostCfgAreaID.')
ospfHostCfgAreaID = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 6, 1, 6), AreaID()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfHostCfgAreaID.setReference('OSPF Version 2, Appendix C.7 Host parameters')
if mibBuilder.loadTexts: ospfHostCfgAreaID.setStatus('current')
if mibBuilder.loadTexts: ospfHostCfgAreaID.setDescription('To configure the OSPF area to which the host belongs.')
ospfIfTable = MibTable((1, 3, 6, 1, 2, 1, 14, 7), )
if mibBuilder.loadTexts: ospfIfTable.setReference('OSPF Version 2, Appendix C.3 Router interface parameters')
if mibBuilder.loadTexts: ospfIfTable.setStatus('current')
if mibBuilder.loadTexts: ospfIfTable.setDescription('The OSPF Interface Table describes the interfaces from the viewpoint of OSPF. It augments the ipAddrTable with OSPF specific information.')
ospfIfEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 7, 1), ).setIndexNames((0, "OSPF-MIB", "ospfIfIpAddress"), (0, "OSPF-MIB", "ospfAddressLessIf"))
if mibBuilder.loadTexts: ospfIfEntry.setStatus('current')
if mibBuilder.loadTexts: ospfIfEntry.setDescription('The OSPF interface entry describes one interface from the viewpoint of OSPF. Information in this table is persistent and when this object is written the entity SHOULD save the change to non-volatile storage.')
ospfIfIpAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 1), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfIpAddress.setStatus('current')
if mibBuilder.loadTexts: ospfIfIpAddress.setDescription('The IP address of this OSPF interface.')
ospfAddressLessIf = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 2), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAddressLessIf.setStatus('current')
if mibBuilder.loadTexts: ospfAddressLessIf.setDescription('For the purpose of easing the instancing of addressed and addressless interfaces; this variable takes the value 0 on interfaces with IP addresses and the corresponding value of ifIndex for interfaces having no IP address.')
ospfIfAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 3), AreaID().clone(hexValue="00000000")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfAreaId.setStatus('current')
if mibBuilder.loadTexts: ospfIfAreaId.setDescription('A 32-bit integer uniquely identifying the area to which the interface connects. Area ID 0.0.0.0 is used for the OSPF backbone.')
ospfIfType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5))).clone(namedValues=NamedValues(("broadcast", 1), ("nbma", 2), ("pointToPoint", 3), ("pointToMultipoint", 5)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfType.setStatus('current')
if mibBuilder.loadTexts: ospfIfType.setDescription("The OSPF interface type. By way of a default, this field may be intuited from the corresponding value of ifType. Broadcast LANs, such as Ethernet and IEEE 802.5, take the value 'broadcast', X.25 and similar technologies take the value 'nbma', and links that are definitively point to point take the value 'pointToPoint'.")
ospfIfAdminStat = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 5), Status().clone('enabled')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfAdminStat.setStatus('current')
if mibBuilder.loadTexts: ospfIfAdminStat.setDescription("The OSPF interface's administrative status. The value formed on the interface, and the interface will be advertised as an internal route to some area. The value 'disabled' denotes that the interface is external to OSPF.")
ospfIfRtrPriority = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 6), DesignatedRouterPriority().clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfRtrPriority.setStatus('current')
if mibBuilder.loadTexts: ospfIfRtrPriority.setDescription('The priority of this interface. Used in multi-access networks, this field is used in the designated router election algorithm. The value 0 signifies that the router is not eligible to become the designated router on this particular network. In the event of a tie in this value, routers will use their Router ID as a tie breaker.')
ospfIfTransitDelay = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 7), UpToMaxAge().clone(1)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfTransitDelay.setStatus('current')
if mibBuilder.loadTexts: ospfIfTransitDelay.setDescription('The estimated number of seconds it takes to transmit a link state update packet over this interface. Note that the minimal value SHOULD be 1 second.')
ospfIfRetransInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 8), UpToMaxAge().clone(5)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfRetransInterval.setStatus('current')
if mibBuilder.loadTexts: ospfIfRetransInterval.setDescription('The number of seconds between link state advertisement retransmissions, for adjacencies belonging to this interface. This value is also used when retransmitting database description and Link State request packets. Note that minimal value SHOULD be 1 second.')
ospfIfHelloInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 9), HelloRange().clone(10)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfHelloInterval.setStatus('current')
if mibBuilder.loadTexts: ospfIfHelloInterval.setDescription('The length of time, in seconds, between the Hello packets that the router sends on the interface. This value must be the same for all routers attached to a common network.')
ospfIfRtrDeadInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 10), PositiveInteger().clone(40)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfRtrDeadInterval.setStatus('current')
if mibBuilder.loadTexts: ospfIfRtrDeadInterval.setDescription("The number of seconds that a router's Hello packets have not been seen before its neighbors declare the router down. This should be some multiple of the Hello interval. This value must be the same for all routers attached to a common network.")
ospfIfPollInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 11), PositiveInteger().clone(120)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfPollInterval.setStatus('current')
if mibBuilder.loadTexts: ospfIfPollInterval.setDescription('The larger time interval, in seconds, between the Hello packets sent to an inactive non-broadcast multi-access neighbor.')
ospfIfState = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("down", 1), ("loopback", 2), ("waiting", 3), ("pointToPoint", 4), ("designatedRouter", 5), ("backupDesignatedRouter", 6), ("otherDesignatedRouter", 7))).clone('down')).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfState.setStatus('current')
if mibBuilder.loadTexts: ospfIfState.setDescription('The OSPF Interface State.')
ospfIfDesignatedRouter = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 13), IpAddress().clone(hexValue="00000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfDesignatedRouter.setStatus('current')
if mibBuilder.loadTexts: ospfIfDesignatedRouter.setDescription('The IP address of the designated router.')
ospfIfBackupDesignatedRouter = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 14), IpAddress().clone(hexValue="00000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfBackupDesignatedRouter.setStatus('current')
if mibBuilder.loadTexts: ospfIfBackupDesignatedRouter.setDescription('The IP address of the backup designated router.')
ospfIfEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 15), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfEvents.setStatus('current')
if mibBuilder.loadTexts: ospfIfEvents.setDescription('The number of times this OSPF interface has changed its state or an error has occurred. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ospfDiscontinuityTime.')
ospfIfAuthKey = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 256)).clone(hexValue="0000000000000000")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfAuthKey.setReference('OSPF Version 2, Section 9 The Interface Data Structure')
if mibBuilder.loadTexts: ospfIfAuthKey.setStatus('current')
if mibBuilder.loadTexts: ospfIfAuthKey.setDescription('The cleartext password used as an OSPF authentication key when simplePassword security is enabled. This object does not access any OSPF cryptogaphic (e.g., MD5) authentication key under any circumstance. If the key length is shorter than 8 octets, the agent will left adjust and zero fill to 8 octets. Unauthenticated interfaces need no authentication key, and simple password authentication cannot use a key of more than 8 octets. Note that the use of simplePassword authentication is NOT recommended when there is concern regarding attack upon the OSPF system. SimplePassword authentication is only sufficient to protect against accidental misconfigurations because it re-uses cleartext passwords [RFC1704]. When read, ospfIfAuthKey always returns an octet string of length zero.')
ospfIfStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 17), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfStatus.setStatus('current')
if mibBuilder.loadTexts: ospfIfStatus.setDescription('This object permits management of the table by facilitating actions such as row creation, construction, and destruction. The value of this object has no effect on whether other objects in this conceptual row can be modified.')
ospfIfMulticastForwarding = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("blocked", 1), ("multicast", 2), ("unicast", 3))).clone('blocked')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfMulticastForwarding.setStatus('current')
if mibBuilder.loadTexts: ospfIfMulticastForwarding.setDescription('The way multicasts should be forwarded on this interface: not forwarded, forwarded as data link multicasts, or forwarded as data link unicasts. Data link multicasting is not meaningful on point-to-point and NBMA interfaces, and setting ospfMulticastForwarding to 0 effectively disables all multicast forwarding.')
ospfIfDemand = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 19), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfDemand.setStatus('current')
if mibBuilder.loadTexts: ospfIfDemand.setDescription('Indicates whether Demand OSPF procedures (hello suppression to FULL neighbors and setting the DoNotAge flag on propagated LSAs) should be performed on this interface.')
ospfIfAuthType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 20), OspfAuthenticationType().clone('none')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfAuthType.setReference('OSPF Version 2, Appendix D Authentication')
if mibBuilder.loadTexts: ospfIfAuthType.setStatus('current')
if mibBuilder.loadTexts: ospfIfAuthType.setDescription('The authentication type specified for an interface. Note that this object can be used to engage in significant attacks against an OSPF router.')
ospfIfLsaCount = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 21), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfLsaCount.setStatus('current')
if mibBuilder.loadTexts: ospfIfLsaCount.setDescription("The total number of link-local link state advertisements in this interface's link-local link state database.")
ospfIfLsaCksumSum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 22), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfLsaCksumSum.setStatus('current')
if mibBuilder.loadTexts: ospfIfLsaCksumSum.setDescription("The 32-bit unsigned sum of the Link State Advertisements' LS checksums contained in this interface's link-local link state database. The sum can be used to determine if there has been a change in the interface's link state database and to compare the interface link state database of routers attached to the same subnet.")
ospfIfDesignatedRouterId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 23), RouterID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfDesignatedRouterId.setStatus('current')
if mibBuilder.loadTexts: ospfIfDesignatedRouterId.setDescription('The Router ID of the designated router.')
ospfIfBackupDesignatedRouterId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 7, 1, 24), RouterID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfBackupDesignatedRouterId.setStatus('current')
if mibBuilder.loadTexts: ospfIfBackupDesignatedRouterId.setDescription('The Router ID of the backup designated router.')
ospfIfMetricTable = MibTable((1, 3, 6, 1, 2, 1, 14, 8), )
if mibBuilder.loadTexts: ospfIfMetricTable.setReference('OSPF Version 2, Appendix C.3 Router interface parameters')
if mibBuilder.loadTexts: ospfIfMetricTable.setStatus('current')
if mibBuilder.loadTexts: ospfIfMetricTable.setDescription('The Metric Table describes the metrics to be advertised for a specified interface at the various types of service. As such, this table is an adjunct of the OSPF Interface Table. Types of service, as defined by RFC 791, have the ability to request low delay, high bandwidth, or reliable linkage. For the purposes of this specification, the measure of bandwidth: Metric = referenceBandwidth / ifSpeed is the default value. The default reference bandwidth is 10^8. For multiple link interfaces, note that ifSpeed is the sum of the individual link speeds. This yields a number having the following typical values: Network Type/bit rate Metric >= 100 MBPS 1 Ethernet/802.3 10 E1 48 T1 (ESF) 65 64 KBPS 1562 56 KBPS 1785 19.2 KBPS 5208 9.6 KBPS 10416 Routes that are not specified use the default (TOS 0) metric. Note that the default reference bandwidth can be configured using the general group object ospfReferenceBandwidth.')
ospfIfMetricEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 8, 1), ).setIndexNames((0, "OSPF-MIB", "ospfIfMetricIpAddress"), (0, "OSPF-MIB", "ospfIfMetricAddressLessIf"), (0, "OSPF-MIB", "ospfIfMetricTOS"))
if mibBuilder.loadTexts: ospfIfMetricEntry.setReference('OSPF Version 2, Appendix C.3 Router interface parameters')
if mibBuilder.loadTexts: ospfIfMetricEntry.setStatus('current')
if mibBuilder.loadTexts: ospfIfMetricEntry.setDescription('A particular TOS metric for a non-virtual interface identified by the interface index. Information in this table is persistent and when this object is written the entity SHOULD save the change to non-volatile storage.')
ospfIfMetricIpAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 1), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfMetricIpAddress.setStatus('current')
if mibBuilder.loadTexts: ospfIfMetricIpAddress.setDescription('The IP address of this OSPF interface. On row creation, this can be derived from the instance.')
ospfIfMetricAddressLessIf = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 2), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfMetricAddressLessIf.setStatus('current')
if mibBuilder.loadTexts: ospfIfMetricAddressLessIf.setDescription('For the purpose of easing the instancing of addressed and addressless interfaces; this variable takes the value 0 on interfaces with IP addresses and the value of ifIndex for interfaces having no IP address. On row creation, this can be derived from the instance.')
ospfIfMetricTOS = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 3), TOSType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfIfMetricTOS.setStatus('current')
if mibBuilder.loadTexts: ospfIfMetricTOS.setDescription('The Type of Service metric being referenced. On row creation, this can be derived from the instance.')
ospfIfMetricValue = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 4), Metric()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfMetricValue.setStatus('current')
if mibBuilder.loadTexts: ospfIfMetricValue.setDescription('The metric of using this Type of Service on this interface. The default value of the TOS 0 metric is 10^8 / ifSpeed.')
ospfIfMetricStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 8, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfIfMetricStatus.setStatus('current')
if mibBuilder.loadTexts: ospfIfMetricStatus.setDescription('This object permits management of the table by facilitating actions such as row creation, construction, and destruction. The value of this object has no effect on whether other objects in this conceptual row can be modified.')
ospfVirtIfTable = MibTable((1, 3, 6, 1, 2, 1, 14, 9), )
if mibBuilder.loadTexts: ospfVirtIfTable.setReference('OSPF Version 2, Appendix C.4 Virtual link parameters')
if mibBuilder.loadTexts: ospfVirtIfTable.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfTable.setDescription("Information about this router's virtual interfaces that the OSPF Process is configured to carry on.")
ospfVirtIfEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 9, 1), ).setIndexNames((0, "OSPF-MIB", "ospfVirtIfAreaId"), (0, "OSPF-MIB", "ospfVirtIfNeighbor"))
if mibBuilder.loadTexts: ospfVirtIfEntry.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfEntry.setDescription('Information about a single virtual interface. Information in this table is persistent and when this object is written the entity SHOULD save the change to non-volatile storage.')
ospfVirtIfAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 1), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtIfAreaId.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfAreaId.setDescription('The transit area that the virtual link traverses. By definition, this is not 0.0.0.0.')
ospfVirtIfNeighbor = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 2), RouterID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtIfNeighbor.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfNeighbor.setDescription('The Router ID of the virtual neighbor.')
ospfVirtIfTransitDelay = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 3), UpToMaxAge().clone(1)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfVirtIfTransitDelay.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfTransitDelay.setDescription('The estimated number of seconds it takes to transmit a Link State update packet over this interface. Note that the minimal value SHOULD be 1 second.')
ospfVirtIfRetransInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 4), UpToMaxAge().clone(5)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfVirtIfRetransInterval.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfRetransInterval.setDescription('The number of seconds between link state avertisement retransmissions, for adjacencies belonging to this interface. This value is also used when retransmitting database description and Link State request packets. This value should be well over the expected round-trip time. Note that the minimal value SHOULD be 1 second.')
ospfVirtIfHelloInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 5), HelloRange().clone(10)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfVirtIfHelloInterval.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfHelloInterval.setDescription('The length of time, in seconds, between the Hello packets that the router sends on the interface. This value must be the same for the virtual neighbor.')
ospfVirtIfRtrDeadInterval = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 6), PositiveInteger().clone(60)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfVirtIfRtrDeadInterval.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfRtrDeadInterval.setDescription("The number of seconds that a router's Hello packets have not been seen before its neighbors declare the router down. This should be some multiple of the Hello interval. This value must be the same for the virtual neighbor.")
ospfVirtIfState = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 4))).clone(namedValues=NamedValues(("down", 1), ("pointToPoint", 4))).clone('down')).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtIfState.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfState.setDescription('OSPF virtual interface states.')
ospfVirtIfEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtIfEvents.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfEvents.setDescription('The number of state changes or error events on this virtual link. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ospfDiscontinuityTime.')
ospfVirtIfAuthKey = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 256)).clone(hexValue="0000000000000000")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfVirtIfAuthKey.setReference('OSPF Version 2, Section 9 The Interface Data Structure')
if mibBuilder.loadTexts: ospfVirtIfAuthKey.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfAuthKey.setDescription('The cleartext password used as an OSPF authentication key when simplePassword security is enabled. This object does not access any OSPF cryptogaphic (e.g., MD5) authentication key under any circumstance. If the key length is shorter than 8 octets, the agent will left adjust and zero fill to 8 octets. Unauthenticated interfaces need no authentication key, and simple password authentication cannot use a key of more than 8 octets. Note that the use of simplePassword authentication is NOT recommended when there is concern regarding attack upon the OSPF system. SimplePassword authentication is only sufficient to protect against accidental misconfigurations because it re-uses cleartext passwords. [RFC1704] When read, ospfIfAuthKey always returns an octet string of length zero.')
ospfVirtIfStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 10), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfVirtIfStatus.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfStatus.setDescription('This object permits management of the table by facilitating actions such as row creation, construction, and destruction. The value of this object has no effect on whether other objects in this conceptual row can be modified.')
ospfVirtIfAuthType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 11), OspfAuthenticationType().clone('none')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfVirtIfAuthType.setReference('OSPF Version 2, Appendix E Authentication')
if mibBuilder.loadTexts: ospfVirtIfAuthType.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfAuthType.setDescription('The authentication type specified for a virtual interface. Note that this object can be used to engage in significant attacks against an OSPF router.')
ospfVirtIfLsaCount = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 12), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtIfLsaCount.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfLsaCount.setDescription("The total number of link-local link state advertisements in this virtual interface's link-local link state database.")
ospfVirtIfLsaCksumSum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 9, 1, 13), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtIfLsaCksumSum.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfLsaCksumSum.setDescription("The 32-bit unsigned sum of the link state advertisements' LS checksums contained in this virtual interface's link-local link state database. The sum can be used to determine if there has been a change in the virtual interface's link state database, and to compare the virtual interface link state database of the virtual neighbors.")
ospfNbrTable = MibTable((1, 3, 6, 1, 2, 1, 14, 10), )
if mibBuilder.loadTexts: ospfNbrTable.setReference('OSPF Version 2, Section 10 The Neighbor Data Structure')
if mibBuilder.loadTexts: ospfNbrTable.setStatus('current')
if mibBuilder.loadTexts: ospfNbrTable.setDescription('A table describing all non-virtual neighbors in the locality of the OSPF router.')
ospfNbrEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 10, 1), ).setIndexNames((0, "OSPF-MIB", "ospfNbrIpAddr"), (0, "OSPF-MIB", "ospfNbrAddressLessIndex"))
if mibBuilder.loadTexts: ospfNbrEntry.setReference('OSPF Version 2, Section 10 The Neighbor Data Structure')
if mibBuilder.loadTexts: ospfNbrEntry.setStatus('current')
if mibBuilder.loadTexts: ospfNbrEntry.setDescription('The information regarding a single neighbor. Information in this table is persistent and when this object is written the entity SHOULD save the change to non-volatile storage.')
ospfNbrIpAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 1), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrIpAddr.setStatus('current')
if mibBuilder.loadTexts: ospfNbrIpAddr.setDescription("The IP address this neighbor is using in its IP source address. Note that, on addressless links, this will not be 0.0.0.0 but the address of another of the neighbor's interfaces.")
ospfNbrAddressLessIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 2), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrAddressLessIndex.setStatus('current')
if mibBuilder.loadTexts: ospfNbrAddressLessIndex.setDescription('On an interface having an IP address, zero. On addressless interfaces, the corresponding value of ifIndex in the Internet Standard MIB. On row creation, this can be derived from the instance.')
ospfNbrRtrId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 3), RouterID().clone(hexValue="00000000")).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrRtrId.setStatus('current')
if mibBuilder.loadTexts: ospfNbrRtrId.setDescription('A 32-bit integer (represented as a type IpAddress) uniquely identifying the neighboring router in the Autonomous System.')
ospfNbrOptions = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrOptions.setReference('OSPF Version 2, Section 12.1.2 Options')
if mibBuilder.loadTexts: ospfNbrOptions.setStatus('current')
if mibBuilder.loadTexts: ospfNbrOptions.setDescription("A bit mask corresponding to the neighbor's options field. Bit 0, if set, indicates that the system will operate on Type of Service metrics other than TOS 0. If zero, the neighbor will ignore all metrics except the TOS 0 metric. Bit 1, if set, indicates that the associated area accepts and operates on external information; if zero, it is a stub area. Bit 2, if set, indicates that the system is capable of routing IP multicast datagrams, that is that it implements the multicast extensions to OSPF. Bit 3, if set, indicates that the associated area is an NSSA. These areas are capable of carrying type-7 external advertisements, which are translated into type-5 external advertisements at NSSA borders.")
ospfNbrPriority = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 5), DesignatedRouterPriority().clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfNbrPriority.setStatus('current')
if mibBuilder.loadTexts: ospfNbrPriority.setDescription('The priority of this neighbor in the designated router election algorithm. The value 0 signifies that the neighbor is not eligible to become the designated router on this particular network.')
ospfNbrState = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("down", 1), ("attempt", 2), ("init", 3), ("twoWay", 4), ("exchangeStart", 5), ("exchange", 6), ("loading", 7), ("full", 8))).clone('down')).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrState.setReference('OSPF Version 2, Section 10.1 Neighbor States')
if mibBuilder.loadTexts: ospfNbrState.setStatus('current')
if mibBuilder.loadTexts: ospfNbrState.setDescription('The state of the relationship with this neighbor.')
ospfNbrEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrEvents.setStatus('current')
if mibBuilder.loadTexts: ospfNbrEvents.setDescription('The number of times this neighbor relationship has changed state or an error has occurred. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ospfDiscontinuityTime.')
ospfNbrLsRetransQLen = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 8), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrLsRetransQLen.setStatus('current')
if mibBuilder.loadTexts: ospfNbrLsRetransQLen.setDescription('The current length of the retransmission queue.')
ospfNbmaNbrStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 9), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfNbmaNbrStatus.setStatus('current')
if mibBuilder.loadTexts: ospfNbmaNbrStatus.setDescription('This object permits management of the table by facilitating actions such as row creation, construction, and destruction. The value of this object has no effect on whether other objects in this conceptual row can be modified.')
ospfNbmaNbrPermanence = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("dynamic", 1), ("permanent", 2))).clone('permanent')).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbmaNbrPermanence.setStatus('current')
if mibBuilder.loadTexts: ospfNbmaNbrPermanence.setDescription("This variable displays the status of the entry; 'dynamic' and 'permanent' refer to how the neighbor became known.")
ospfNbrHelloSuppressed = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 11), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrHelloSuppressed.setStatus('current')
if mibBuilder.loadTexts: ospfNbrHelloSuppressed.setDescription('Indicates whether Hellos are being suppressed to the neighbor.')
ospfNbrRestartHelperStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notHelping", 1), ("helping", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrRestartHelperStatus.setStatus('current')
if mibBuilder.loadTexts: ospfNbrRestartHelperStatus.setDescription('Indicates whether the router is acting as a graceful restart helper for the neighbor.')
ospfNbrRestartHelperAge = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 13), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrRestartHelperAge.setStatus('current')
if mibBuilder.loadTexts: ospfNbrRestartHelperAge.setDescription('Remaining time in current OSPF graceful restart interval, if the router is acting as a restart helper for the neighbor.')
ospfNbrRestartHelperExitReason = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 10, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("inProgress", 2), ("completed", 3), ("timedOut", 4), ("topologyChanged", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfNbrRestartHelperExitReason.setStatus('current')
if mibBuilder.loadTexts: ospfNbrRestartHelperExitReason.setDescription('Describes the outcome of the last attempt at acting as a graceful restart helper for the neighbor.')
ospfVirtNbrTable = MibTable((1, 3, 6, 1, 2, 1, 14, 11), )
if mibBuilder.loadTexts: ospfVirtNbrTable.setReference('OSPF Version 2, Section 15 Virtual Links')
if mibBuilder.loadTexts: ospfVirtNbrTable.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrTable.setDescription('This table describes all virtual neighbors. Since virtual links are configured in the Virtual Interface Table, this table is read-only.')
ospfVirtNbrEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 11, 1), ).setIndexNames((0, "OSPF-MIB", "ospfVirtNbrArea"), (0, "OSPF-MIB", "ospfVirtNbrRtrId"))
if mibBuilder.loadTexts: ospfVirtNbrEntry.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrEntry.setDescription('Virtual neighbor information.')
ospfVirtNbrArea = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 1), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrArea.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrArea.setDescription('The Transit Area Identifier.')
ospfVirtNbrRtrId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 2), RouterID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrRtrId.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrRtrId.setDescription('A 32-bit integer uniquely identifying the neighboring router in the Autonomous System.')
ospfVirtNbrIpAddr = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrIpAddr.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrIpAddr.setDescription('The IP address this virtual neighbor is using.')
ospfVirtNbrOptions = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrOptions.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrOptions.setDescription("A bit mask corresponding to the neighbor's options field. Bit 1, if set, indicates that the system will operate on Type of Service metrics other than TOS 0. If zero, the neighbor will ignore all metrics except the TOS 0 metric. Bit 2, if set, indicates that the system is network multicast capable, i.e., that it implements OSPF multicast routing.")
ospfVirtNbrState = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("down", 1), ("attempt", 2), ("init", 3), ("twoWay", 4), ("exchangeStart", 5), ("exchange", 6), ("loading", 7), ("full", 8)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrState.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrState.setDescription('The state of the virtual neighbor relationship.')
ospfVirtNbrEvents = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrEvents.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrEvents.setDescription('The number of times this virtual link has changed its state or an error has occurred. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ospfDiscontinuityTime.')
ospfVirtNbrLsRetransQLen = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 7), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrLsRetransQLen.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrLsRetransQLen.setDescription('The current length of the retransmission queue.')
ospfVirtNbrHelloSuppressed = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 8), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrHelloSuppressed.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrHelloSuppressed.setDescription('Indicates whether Hellos are being suppressed to the neighbor.')
ospfVirtNbrRestartHelperStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notHelping", 1), ("helping", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrRestartHelperStatus.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrRestartHelperStatus.setDescription('Indicates whether the router is acting as a graceful restart helper for the neighbor.')
ospfVirtNbrRestartHelperAge = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 10), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrRestartHelperAge.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrRestartHelperAge.setDescription('Remaining time in current OSPF graceful restart interval, if the router is acting as a restart helper for the neighbor.')
ospfVirtNbrRestartHelperExitReason = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 11, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("none", 1), ("inProgress", 2), ("completed", 3), ("timedOut", 4), ("topologyChanged", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtNbrRestartHelperExitReason.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrRestartHelperExitReason.setDescription('Describes the outcome of the last attempt at acting as a graceful restart helper for the neighbor.')
ospfExtLsdbTable = MibTable((1, 3, 6, 1, 2, 1, 14, 12), )
if mibBuilder.loadTexts: ospfExtLsdbTable.setReference('OSPF Version 2, Section 12 Link State Advertisements')
if mibBuilder.loadTexts: ospfExtLsdbTable.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbTable.setDescription("The OSPF Process's external LSA link state database. This table is identical to the OSPF LSDB Table in format, but contains only external link state advertisements. The purpose is to allow external LSAs to be displayed once for the router rather than once in each non-stub area. Note that external LSAs are also in the AS-scope link state database.")
ospfExtLsdbEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 12, 1), ).setIndexNames((0, "OSPF-MIB", "ospfExtLsdbType"), (0, "OSPF-MIB", "ospfExtLsdbLsid"), (0, "OSPF-MIB", "ospfExtLsdbRouterId"))
if mibBuilder.loadTexts: ospfExtLsdbEntry.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbEntry.setDescription('A single link state advertisement.')
ospfExtLsdbType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 12, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(5))).clone(namedValues=NamedValues(("asExternalLink", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExtLsdbType.setReference('OSPF Version 2, Appendix A.4.1 The Link State Advertisement header')
if mibBuilder.loadTexts: ospfExtLsdbType.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbType.setDescription('The type of the link state advertisement. Each link state type has a separate advertisement format.')
ospfExtLsdbLsid = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 12, 1, 2), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExtLsdbLsid.setReference('OSPF Version 2, Section 12.1.4 Link State ID')
if mibBuilder.loadTexts: ospfExtLsdbLsid.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbLsid.setDescription('The Link State ID is an LS Type Specific field containing either a Router ID or an IP address; it identifies the piece of the routing domain that is being described by the advertisement.')
ospfExtLsdbRouterId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 12, 1, 3), RouterID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExtLsdbRouterId.setReference('OSPF Version 2, Appendix C.1 Global parameters')
if mibBuilder.loadTexts: ospfExtLsdbRouterId.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbRouterId.setDescription('The 32-bit number that uniquely identifies the originating router in the Autonomous System.')
ospfExtLsdbSequence = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 12, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExtLsdbSequence.setReference('OSPF Version 2, Section 12.1.6 LS sequence number')
if mibBuilder.loadTexts: ospfExtLsdbSequence.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbSequence.setDescription("The sequence number field is a signed 32-bit integer. It starts with the value '80000001'h, or -'7FFFFFFF'h, and increments until '7FFFFFFF'h. Thus, a typical sequence number will be very negative. It is used to detect old and duplicate link state advertisements. The space of sequence numbers is linearly ordered. The larger the sequence number, the more recent the advertisement.")
ospfExtLsdbAge = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 12, 1, 5), Integer32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExtLsdbAge.setReference('OSPF Version 2, Section 12.1.1 LS age')
if mibBuilder.loadTexts: ospfExtLsdbAge.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbAge.setDescription('This field is the age of the link state advertisement in seconds.')
ospfExtLsdbChecksum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 12, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExtLsdbChecksum.setReference('OSPF Version 2, Section 12.1.7 LS checksum')
if mibBuilder.loadTexts: ospfExtLsdbChecksum.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbChecksum.setDescription("This field is the checksum of the complete contents of the advertisement, excepting the age field. The age field is excepted so that an advertisement's age can be incremented without updating the checksum. The checksum used is the same that is used for ISO connectionless datagrams; it is commonly referred to as the Fletcher checksum.")
ospfExtLsdbAdvertisement = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 12, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(36, 36)).setFixedLength(36)).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfExtLsdbAdvertisement.setReference('OSPF Version 2, Section 12 Link State Advertisements')
if mibBuilder.loadTexts: ospfExtLsdbAdvertisement.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbAdvertisement.setDescription('The entire link state advertisement, including its header.')
ospfRouteGroup = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 13))
ospfIntraArea = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 13, 1))
ospfInterArea = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 13, 2))
ospfExternalType1 = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 13, 3))
ospfExternalType2 = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 13, 4))
ospfAreaAggregateTable = MibTable((1, 3, 6, 1, 2, 1, 14, 14), )
if mibBuilder.loadTexts: ospfAreaAggregateTable.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaAggregateTable.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateTable.setDescription("The Area Aggregate Table acts as an adjunct to the Area Table. It describes those address aggregates that are configured to be propagated from an area. Its purpose is to reduce the amount of information that is known beyond an Area's borders. It contains a set of IP address ranges specified by an IP address/IP network mask pair. For example, a class B address range of X.X.X.X with a network mask of 255.255.0.0 includes all IP addresses from X.X.0.0 to X.X.255.255. Note that if ranges are configured such that one range subsumes another range (e.g., 10.0.0.0 mask 255.0.0.0 and 10.1.0.0 mask 255.255.0.0), the most specific match is the preferred one.")
ospfAreaAggregateEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 14, 1), ).setIndexNames((0, "OSPF-MIB", "ospfAreaAggregateAreaID"), (0, "OSPF-MIB", "ospfAreaAggregateLsdbType"), (0, "OSPF-MIB", "ospfAreaAggregateNet"), (0, "OSPF-MIB", "ospfAreaAggregateMask"))
if mibBuilder.loadTexts: ospfAreaAggregateEntry.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaAggregateEntry.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateEntry.setDescription('A single area aggregate entry. Information in this table is persistent and when this object is written the entity SHOULD save the change to non-volatile storage.')
ospfAreaAggregateAreaID = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 14, 1, 1), AreaID()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaAggregateAreaID.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaAggregateAreaID.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateAreaID.setDescription('The area within which the address aggregate is to be found.')
ospfAreaAggregateLsdbType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 14, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 7))).clone(namedValues=NamedValues(("summaryLink", 3), ("nssaExternalLink", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaAggregateLsdbType.setReference('OSPF Version 2, Appendix A.4.1 The Link State Advertisement header')
if mibBuilder.loadTexts: ospfAreaAggregateLsdbType.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateLsdbType.setDescription('The type of the address aggregate. This field specifies the Lsdb type that this address aggregate applies to.')
ospfAreaAggregateNet = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 14, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaAggregateNet.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaAggregateNet.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateNet.setDescription('The IP address of the net or subnet indicated by the range.')
ospfAreaAggregateMask = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 14, 1, 4), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaAggregateMask.setReference('OSPF Version 2, Appendix C.2 Area parameters')
if mibBuilder.loadTexts: ospfAreaAggregateMask.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateMask.setDescription('The subnet mask that pertains to the net or subnet.')
ospfAreaAggregateStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 14, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaAggregateStatus.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateStatus.setDescription('This object permits management of the table by facilitating actions such as row creation, construction, and destruction. The value of this object has no effect on whether other objects in this conceptual row can be modified.')
ospfAreaAggregateEffect = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 14, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("advertiseMatching", 1), ("doNotAdvertiseMatching", 2))).clone('advertiseMatching')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaAggregateEffect.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateEffect.setDescription("Subnets subsumed by ranges either trigger the advertisement of the indicated aggregate (advertiseMatching) or result in the subnet's not being advertised at all outside the area.")
ospfAreaAggregateExtRouteTag = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 14, 1, 7), Unsigned32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ospfAreaAggregateExtRouteTag.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateExtRouteTag.setDescription('External route tag to be included in NSSA (type-7) LSAs.')
ospfLocalLsdbTable = MibTable((1, 3, 6, 1, 2, 1, 14, 17), )
if mibBuilder.loadTexts: ospfLocalLsdbTable.setReference('OSPF Version 2, Section 12 Link State Advertisements and The OSPF Opaque LSA Option')
if mibBuilder.loadTexts: ospfLocalLsdbTable.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbTable.setDescription("The OSPF Process's link-local link state database for non-virtual links. This table is identical to the OSPF LSDB Table in format, but contains only link-local Link State Advertisements for non-virtual links. The purpose is to allow link-local LSAs to be displayed for each non-virtual interface. This table is implemented to support type-9 LSAs that are defined in 'The OSPF Opaque LSA Option'.")
ospfLocalLsdbEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 17, 1), ).setIndexNames((0, "OSPF-MIB", "ospfLocalLsdbIpAddress"), (0, "OSPF-MIB", "ospfLocalLsdbAddressLessIf"), (0, "OSPF-MIB", "ospfLocalLsdbType"), (0, "OSPF-MIB", "ospfLocalLsdbLsid"), (0, "OSPF-MIB", "ospfLocalLsdbRouterId"))
if mibBuilder.loadTexts: ospfLocalLsdbEntry.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbEntry.setDescription('A single link state advertisement.')
ospfLocalLsdbIpAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 17, 1, 1), IpAddress())
if mibBuilder.loadTexts: ospfLocalLsdbIpAddress.setReference('OSPF Version 2, Appendix C.3 Interface parameters')
if mibBuilder.loadTexts: ospfLocalLsdbIpAddress.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbIpAddress.setDescription('The IP address of the interface from which the LSA was received if the interface is numbered.')
ospfLocalLsdbAddressLessIf = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 17, 1, 2), InterfaceIndexOrZero())
if mibBuilder.loadTexts: ospfLocalLsdbAddressLessIf.setReference('OSPF Version 2, Appendix C.3 Interface parameters')
if mibBuilder.loadTexts: ospfLocalLsdbAddressLessIf.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbAddressLessIf.setDescription('The interface index of the interface from which the LSA was received if the interface is unnumbered.')
ospfLocalLsdbType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 17, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(9))).clone(namedValues=NamedValues(("localOpaqueLink", 9))))
if mibBuilder.loadTexts: ospfLocalLsdbType.setReference('OSPF Version 2, Appendix A.4.1 The Link State Advertisement header')
if mibBuilder.loadTexts: ospfLocalLsdbType.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbType.setDescription('The type of the link state advertisement. Each link state type has a separate advertisement format.')
ospfLocalLsdbLsid = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 17, 1, 4), IpAddress())
if mibBuilder.loadTexts: ospfLocalLsdbLsid.setReference('OSPF Version 2, Section 12.1.4 Link State ID')
if mibBuilder.loadTexts: ospfLocalLsdbLsid.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbLsid.setDescription('The Link State ID is an LS Type Specific field containing a 32-bit identifier in IP address format; it identifies the piece of the routing domain that is being described by the advertisement.')
ospfLocalLsdbRouterId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 17, 1, 5), RouterID())
if mibBuilder.loadTexts: ospfLocalLsdbRouterId.setReference('OSPF Version 2, Appendix C.1 Global parameters')
if mibBuilder.loadTexts: ospfLocalLsdbRouterId.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbRouterId.setDescription('The 32-bit number that uniquely identifies the originating router in the Autonomous System.')
ospfLocalLsdbSequence = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 17, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLocalLsdbSequence.setReference('OSPF Version 2, Section 12.1.6 LS sequence number')
if mibBuilder.loadTexts: ospfLocalLsdbSequence.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbSequence.setDescription("The sequence number field is a signed 32-bit integer. It starts with the value '80000001'h, or -'7FFFFFFF'h, and increments until '7FFFFFFF'h. Thus, a typical sequence number will be very negative. It is used to detect old and duplicate link state advertisements. The space of sequence numbers is linearly ordered. The larger the sequence number, the more recent the advertisement.")
ospfLocalLsdbAge = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 17, 1, 7), Integer32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLocalLsdbAge.setReference('OSPF Version 2, Section 12.1.1 LS age')
if mibBuilder.loadTexts: ospfLocalLsdbAge.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbAge.setDescription('This field is the age of the link state advertisement in seconds.')
ospfLocalLsdbChecksum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 17, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLocalLsdbChecksum.setReference('OSPF Version 2, Section 12.1.7 LS checksum')
if mibBuilder.loadTexts: ospfLocalLsdbChecksum.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbChecksum.setDescription("This field is the checksum of the complete contents of the advertisement, excepting the age field. The age field is excepted so that an advertisement's age can be incremented without updating the checksum. The checksum used is the same that is used for ISO connectionless datagrams; it is commonly referred to as the Fletcher checksum.")
ospfLocalLsdbAdvertisement = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 17, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfLocalLsdbAdvertisement.setReference('OSPF Version 2, Section 12 Link State Advertisements')
if mibBuilder.loadTexts: ospfLocalLsdbAdvertisement.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbAdvertisement.setDescription('The entire link state advertisement, including its header. Note that for variable length LSAs, SNMP agents may not be able to return the largest string size.')
ospfVirtLocalLsdbTable = MibTable((1, 3, 6, 1, 2, 1, 14, 18), )
if mibBuilder.loadTexts: ospfVirtLocalLsdbTable.setReference('OSPF Version 2, Section 12 Link State Advertisements and The OSPF Opaque LSA Option')
if mibBuilder.loadTexts: ospfVirtLocalLsdbTable.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbTable.setDescription("The OSPF Process's link-local link state database for virtual links. This table is identical to the OSPF LSDB Table in format, but contains only link-local Link State Advertisements for virtual links. The purpose is to allow link-local LSAs to be displayed for each virtual interface. This table is implemented to support type-9 LSAs that are defined in 'The OSPF Opaque LSA Option'.")
ospfVirtLocalLsdbEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 18, 1), ).setIndexNames((0, "OSPF-MIB", "ospfVirtLocalLsdbTransitArea"), (0, "OSPF-MIB", "ospfVirtLocalLsdbNeighbor"), (0, "OSPF-MIB", "ospfVirtLocalLsdbType"), (0, "OSPF-MIB", "ospfVirtLocalLsdbLsid"), (0, "OSPF-MIB", "ospfVirtLocalLsdbRouterId"))
if mibBuilder.loadTexts: ospfVirtLocalLsdbEntry.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbEntry.setDescription('A single link state advertisement.')
ospfVirtLocalLsdbTransitArea = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 18, 1, 1), AreaID())
if mibBuilder.loadTexts: ospfVirtLocalLsdbTransitArea.setReference('OSPF Version 2, Appendix C.3 Interface parameters')
if mibBuilder.loadTexts: ospfVirtLocalLsdbTransitArea.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbTransitArea.setDescription('The transit area that the virtual link traverses. By definition, this is not 0.0.0.0.')
ospfVirtLocalLsdbNeighbor = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 18, 1, 2), RouterID())
if mibBuilder.loadTexts: ospfVirtLocalLsdbNeighbor.setReference('OSPF Version 2, Appendix C.3 Interface parameters')
if mibBuilder.loadTexts: ospfVirtLocalLsdbNeighbor.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbNeighbor.setDescription('The Router ID of the virtual neighbor.')
ospfVirtLocalLsdbType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 18, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(9))).clone(namedValues=NamedValues(("localOpaqueLink", 9))))
if mibBuilder.loadTexts: ospfVirtLocalLsdbType.setReference('OSPF Version 2, Appendix A.4.1 The Link State Advertisement header')
if mibBuilder.loadTexts: ospfVirtLocalLsdbType.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbType.setDescription('The type of the link state advertisement. Each link state type has a separate advertisement format.')
ospfVirtLocalLsdbLsid = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 18, 1, 4), IpAddress())
if mibBuilder.loadTexts: ospfVirtLocalLsdbLsid.setReference('OSPF Version 2, Section 12.1.4 Link State ID')
if mibBuilder.loadTexts: ospfVirtLocalLsdbLsid.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbLsid.setDescription('The Link State ID is an LS Type Specific field containing a 32-bit identifier in IP address format; it identifies the piece of the routing domain that is being described by the advertisement.')
ospfVirtLocalLsdbRouterId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 18, 1, 5), RouterID())
if mibBuilder.loadTexts: ospfVirtLocalLsdbRouterId.setReference('OSPF Version 2, Appendix C.1 Global parameters')
if mibBuilder.loadTexts: ospfVirtLocalLsdbRouterId.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbRouterId.setDescription('The 32-bit number that uniquely identifies the originating router in the Autonomous System.')
ospfVirtLocalLsdbSequence = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 18, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtLocalLsdbSequence.setReference('OSPF Version 2, Section 12.1.6 LS sequence number')
if mibBuilder.loadTexts: ospfVirtLocalLsdbSequence.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbSequence.setDescription("The sequence number field is a signed 32-bit integer. It starts with the value '80000001'h, or -'7FFFFFFF'h, and increments until '7FFFFFFF'h. Thus, a typical sequence number will be very negative. It is used to detect old and duplicate link state advertisements. The space of sequence numbers is linearly ordered. The larger the sequence number, the more recent the advertisement.")
ospfVirtLocalLsdbAge = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 18, 1, 7), Integer32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtLocalLsdbAge.setReference('OSPF Version 2, Section 12.1.1 LS age')
if mibBuilder.loadTexts: ospfVirtLocalLsdbAge.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbAge.setDescription('This field is the age of the link state advertisement in seconds.')
ospfVirtLocalLsdbChecksum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 18, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtLocalLsdbChecksum.setReference('OSPF Version 2, Section 12.1.7 LS checksum')
if mibBuilder.loadTexts: ospfVirtLocalLsdbChecksum.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbChecksum.setDescription("This field is the checksum of the complete contents of the advertisement, excepting the age field. The age field is excepted so that an advertisement's age can be incremented without updating the checksum. The checksum used is the same that is used for ISO connectionless datagrams; it is commonly referred to as the Fletcher checksum.")
ospfVirtLocalLsdbAdvertisement = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 18, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfVirtLocalLsdbAdvertisement.setReference('OSPF Version 2, Section 12 Link State Advertisements. Note that for variable length LSAs, SNMP agents may not be able to return the largest string size.')
if mibBuilder.loadTexts: ospfVirtLocalLsdbAdvertisement.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbAdvertisement.setDescription('The entire link state advertisement, including its header.')
ospfAsLsdbTable = MibTable((1, 3, 6, 1, 2, 1, 14, 19), )
if mibBuilder.loadTexts: ospfAsLsdbTable.setReference('OSPF Version 2, Section 12 Link State Advertisements')
if mibBuilder.loadTexts: ospfAsLsdbTable.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbTable.setDescription("The OSPF Process's AS-scope LSA link state database. The database contains the AS-scope Link State Advertisements from throughout the areas that the device is attached to. This table is identical to the OSPF LSDB Table in format, but contains only AS-scope Link State Advertisements. The purpose is to allow AS-scope LSAs to be displayed once for the router rather than once in each non-stub area.")
ospfAsLsdbEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 19, 1), ).setIndexNames((0, "OSPF-MIB", "ospfAsLsdbType"), (0, "OSPF-MIB", "ospfAsLsdbLsid"), (0, "OSPF-MIB", "ospfAsLsdbRouterId"))
if mibBuilder.loadTexts: ospfAsLsdbEntry.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbEntry.setDescription('A single link state advertisement.')
ospfAsLsdbType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 19, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(5, 11))).clone(namedValues=NamedValues(("asExternalLink", 5), ("asOpaqueLink", 11))))
if mibBuilder.loadTexts: ospfAsLsdbType.setReference('OSPF Version 2, Appendix A.4.1 The Link State Advertisement header')
if mibBuilder.loadTexts: ospfAsLsdbType.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbType.setDescription('The type of the link state advertisement. Each link state type has a separate advertisement format.')
ospfAsLsdbLsid = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 19, 1, 2), IpAddress())
if mibBuilder.loadTexts: ospfAsLsdbLsid.setReference('OSPF Version 2, Section 12.1.4 Link State ID')
if mibBuilder.loadTexts: ospfAsLsdbLsid.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbLsid.setDescription('The Link State ID is an LS Type Specific field containing either a Router ID or an IP address; it identifies the piece of the routing domain that is being described by the advertisement.')
ospfAsLsdbRouterId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 19, 1, 3), RouterID())
if mibBuilder.loadTexts: ospfAsLsdbRouterId.setReference('OSPF Version 2, Appendix C.1 Global parameters')
if mibBuilder.loadTexts: ospfAsLsdbRouterId.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbRouterId.setDescription('The 32-bit number that uniquely identifies the originating router in the Autonomous System.')
ospfAsLsdbSequence = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 19, 1, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAsLsdbSequence.setReference('OSPF Version 2, Section 12.1.6 LS sequence number')
if mibBuilder.loadTexts: ospfAsLsdbSequence.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbSequence.setDescription("The sequence number field is a signed 32-bit integer. It starts with the value '80000001'h, or -'7FFFFFFF'h, and increments until '7FFFFFFF'h. Thus, a typical sequence number will be very negative. It is used to detect old and duplicate link state advertisements. The space of sequence numbers is linearly ordered. The larger the sequence number, the more recent the advertisement.")
ospfAsLsdbAge = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 19, 1, 5), Integer32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAsLsdbAge.setReference('OSPF Version 2, Section 12.1.1 LS age')
if mibBuilder.loadTexts: ospfAsLsdbAge.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbAge.setDescription('This field is the age of the link state advertisement in seconds.')
ospfAsLsdbChecksum = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 19, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAsLsdbChecksum.setReference('OSPF Version 2, Section 12.1.7 LS checksum')
if mibBuilder.loadTexts: ospfAsLsdbChecksum.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbChecksum.setDescription("This field is the checksum of the complete contents of the advertisement, excepting the age field. The age field is excepted so that an advertisement's age can be incremented without updating the checksum. The checksum used is the same that is used for ISO connectionless datagrams; it is commonly referred to as the Fletcher checksum.")
ospfAsLsdbAdvertisement = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 19, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAsLsdbAdvertisement.setReference('OSPF Version 2, Section 12 Link State Advertisements. Note that for variable length LSAs, SNMP agents may not be able to return the largest string size.')
if mibBuilder.loadTexts: ospfAsLsdbAdvertisement.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbAdvertisement.setDescription('The entire link state advertisement, including its header.')
ospfAreaLsaCountTable = MibTable((1, 3, 6, 1, 2, 1, 14, 20), )
if mibBuilder.loadTexts: ospfAreaLsaCountTable.setStatus('current')
if mibBuilder.loadTexts: ospfAreaLsaCountTable.setDescription('This table maintains per-area, per-LSA-type counters')
ospfAreaLsaCountEntry = MibTableRow((1, 3, 6, 1, 2, 1, 14, 20, 1), ).setIndexNames((0, "OSPF-MIB", "ospfAreaLsaCountAreaId"), (0, "OSPF-MIB", "ospfAreaLsaCountLsaType"))
if mibBuilder.loadTexts: ospfAreaLsaCountEntry.setStatus('current')
if mibBuilder.loadTexts: ospfAreaLsaCountEntry.setDescription('An entry with a number of link advertisements of a given type for a given area.')
ospfAreaLsaCountAreaId = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 20, 1, 1), AreaID())
if mibBuilder.loadTexts: ospfAreaLsaCountAreaId.setStatus('current')
if mibBuilder.loadTexts: ospfAreaLsaCountAreaId.setDescription('This entry Area ID.')
ospfAreaLsaCountLsaType = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 20, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 6, 7, 10))).clone(namedValues=NamedValues(("routerLink", 1), ("networkLink", 2), ("summaryLink", 3), ("asSummaryLink", 4), ("multicastLink", 6), ("nssaExternalLink", 7), ("areaOpaqueLink", 10))))
if mibBuilder.loadTexts: ospfAreaLsaCountLsaType.setStatus('current')
if mibBuilder.loadTexts: ospfAreaLsaCountLsaType.setDescription('This entry LSA type.')
ospfAreaLsaCountNumber = MibTableColumn((1, 3, 6, 1, 2, 1, 14, 20, 1, 3), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ospfAreaLsaCountNumber.setStatus('current')
if mibBuilder.loadTexts: ospfAreaLsaCountNumber.setDescription('Number of LSAs of a given type for a given area.')
ospfConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 15))
ospfGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 15, 1))
ospfCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 14, 15, 2))
ospfCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 14, 15, 2, 1)).setObjects(("OSPF-MIB", "ospfBasicGroup"), ("OSPF-MIB", "ospfAreaGroup"), ("OSPF-MIB", "ospfStubAreaGroup"), ("OSPF-MIB", "ospfIfGroup"), ("OSPF-MIB", "ospfIfMetricGroup"), ("OSPF-MIB", "ospfVirtIfGroup"), ("OSPF-MIB", "ospfNbrGroup"), ("OSPF-MIB", "ospfVirtNbrGroup"), ("OSPF-MIB", "ospfAreaAggregateGroup"), ("OSPF-MIB", "ospfHostGroup"), ("OSPF-MIB", "ospfLsdbGroup"), ("OSPF-MIB", "ospfExtLsdbGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfCompliance = ospfCompliance.setStatus('deprecated')
if mibBuilder.loadTexts: ospfCompliance.setDescription('The compliance statement for OSPF systems conforming to RFC 1850.')
ospfCompliance2 = ModuleCompliance((1, 3, 6, 1, 2, 1, 14, 15, 2, 2)).setObjects(("OSPF-MIB", "ospfBasicGroup2"), ("OSPF-MIB", "ospfAreaGroup2"), ("OSPF-MIB", "ospfStubAreaGroup"), ("OSPF-MIB", "ospfIfGroup2"), ("OSPF-MIB", "ospfIfMetricGroup"), ("OSPF-MIB", "ospfVirtIfGroup2"), ("OSPF-MIB", "ospfNbrGroup2"), ("OSPF-MIB", "ospfVirtNbrGroup2"), ("OSPF-MIB", "ospfAreaAggregateGroup2"), ("OSPF-MIB", "ospfHostGroup2"), ("OSPF-MIB", "ospfLsdbGroup"), ("OSPF-MIB", "ospfAsLsdbGroup"), ("OSPF-MIB", "ospfLocalLsdbGroup"), ("OSPF-MIB", "ospfVirtLocalLsdbGroup"), ("OSPF-MIB", "ospfAreaLsaCountGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfCompliance2 = ospfCompliance2.setStatus('current')
if mibBuilder.loadTexts: ospfCompliance2.setDescription('The compliance statement.')
ospfComplianceObsolete = ModuleCompliance((1, 3, 6, 1, 2, 1, 14, 15, 2, 3)).setObjects(("OSPF-MIB", "ospfAreaRangeGroup"), ("OSPF-MIB", "ospfObsoleteGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfComplianceObsolete = ospfComplianceObsolete.setStatus('obsolete')
if mibBuilder.loadTexts: ospfComplianceObsolete.setDescription('Contains obsolete object groups.')
ospfBasicGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 1)).setObjects(("OSPF-MIB", "ospfRouterId"), ("OSPF-MIB", "ospfAdminStat"), ("OSPF-MIB", "ospfVersionNumber"), ("OSPF-MIB", "ospfAreaBdrRtrStatus"), ("OSPF-MIB", "ospfASBdrRtrStatus"), ("OSPF-MIB", "ospfExternLsaCount"), ("OSPF-MIB", "ospfExternLsaCksumSum"), ("OSPF-MIB", "ospfTOSSupport"), ("OSPF-MIB", "ospfOriginateNewLsas"), ("OSPF-MIB", "ospfRxNewLsas"), ("OSPF-MIB", "ospfExtLsdbLimit"), ("OSPF-MIB", "ospfMulticastExtensions"), ("OSPF-MIB", "ospfExitOverflowInterval"), ("OSPF-MIB", "ospfDemandExtensions"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfBasicGroup = ospfBasicGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ospfBasicGroup.setDescription('These objects are used to monitor/manage global OSPF parameters. This object group conforms to RFC 1850.')
ospfAreaGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 2)).setObjects(("OSPF-MIB", "ospfAreaId"), ("OSPF-MIB", "ospfImportAsExtern"), ("OSPF-MIB", "ospfSpfRuns"), ("OSPF-MIB", "ospfAreaBdrRtrCount"), ("OSPF-MIB", "ospfAsBdrRtrCount"), ("OSPF-MIB", "ospfAreaLsaCount"), ("OSPF-MIB", "ospfAreaLsaCksumSum"), ("OSPF-MIB", "ospfAreaSummary"), ("OSPF-MIB", "ospfAreaStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfAreaGroup = ospfAreaGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ospfAreaGroup.setDescription('These objects are used for OSPF systems supporting areas per RFC 1850.')
ospfStubAreaGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 3)).setObjects(("OSPF-MIB", "ospfStubAreaId"), ("OSPF-MIB", "ospfStubTOS"), ("OSPF-MIB", "ospfStubMetric"), ("OSPF-MIB", "ospfStubStatus"), ("OSPF-MIB", "ospfStubMetricType"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfStubAreaGroup = ospfStubAreaGroup.setStatus('current')
if mibBuilder.loadTexts: ospfStubAreaGroup.setDescription('These objects are used for OSPF systems supporting stub areas.')
ospfLsdbGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 4)).setObjects(("OSPF-MIB", "ospfLsdbAreaId"), ("OSPF-MIB", "ospfLsdbType"), ("OSPF-MIB", "ospfLsdbLsid"), ("OSPF-MIB", "ospfLsdbRouterId"), ("OSPF-MIB", "ospfLsdbSequence"), ("OSPF-MIB", "ospfLsdbAge"), ("OSPF-MIB", "ospfLsdbChecksum"), ("OSPF-MIB", "ospfLsdbAdvertisement"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfLsdbGroup = ospfLsdbGroup.setStatus('current')
if mibBuilder.loadTexts: ospfLsdbGroup.setDescription('These objects are used for OSPF systems that display their link state database.')
ospfAreaRangeGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 5)).setObjects(("OSPF-MIB", "ospfAreaRangeAreaId"), ("OSPF-MIB", "ospfAreaRangeNet"), ("OSPF-MIB", "ospfAreaRangeMask"), ("OSPF-MIB", "ospfAreaRangeStatus"), ("OSPF-MIB", "ospfAreaRangeEffect"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfAreaRangeGroup = ospfAreaRangeGroup.setStatus('obsolete')
if mibBuilder.loadTexts: ospfAreaRangeGroup.setDescription('These objects are used for non-CIDR OSPF systems that support multiple areas. This object group is obsolete.')
ospfHostGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 6)).setObjects(("OSPF-MIB", "ospfHostIpAddress"), ("OSPF-MIB", "ospfHostTOS"), ("OSPF-MIB", "ospfHostMetric"), ("OSPF-MIB", "ospfHostStatus"), ("OSPF-MIB", "ospfHostAreaID"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfHostGroup = ospfHostGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ospfHostGroup.setDescription('These objects are used for OSPF systems that support attached hosts.')
ospfIfGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 7)).setObjects(("OSPF-MIB", "ospfIfIpAddress"), ("OSPF-MIB", "ospfAddressLessIf"), ("OSPF-MIB", "ospfIfAreaId"), ("OSPF-MIB", "ospfIfType"), ("OSPF-MIB", "ospfIfAdminStat"), ("OSPF-MIB", "ospfIfRtrPriority"), ("OSPF-MIB", "ospfIfTransitDelay"), ("OSPF-MIB", "ospfIfRetransInterval"), ("OSPF-MIB", "ospfIfHelloInterval"), ("OSPF-MIB", "ospfIfRtrDeadInterval"), ("OSPF-MIB", "ospfIfPollInterval"), ("OSPF-MIB", "ospfIfState"), ("OSPF-MIB", "ospfIfDesignatedRouter"), ("OSPF-MIB", "ospfIfBackupDesignatedRouter"), ("OSPF-MIB", "ospfIfEvents"), ("OSPF-MIB", "ospfIfAuthType"), ("OSPF-MIB", "ospfIfAuthKey"), ("OSPF-MIB", "ospfIfStatus"), ("OSPF-MIB", "ospfIfMulticastForwarding"), ("OSPF-MIB", "ospfIfDemand"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfIfGroup = ospfIfGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ospfIfGroup.setDescription('These objects are used to monitor/manage OSPF interfaces. This object group conforms to RFC 1850.')
ospfIfMetricGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 8)).setObjects(("OSPF-MIB", "ospfIfMetricIpAddress"), ("OSPF-MIB", "ospfIfMetricAddressLessIf"), ("OSPF-MIB", "ospfIfMetricTOS"), ("OSPF-MIB", "ospfIfMetricValue"), ("OSPF-MIB", "ospfIfMetricStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfIfMetricGroup = ospfIfMetricGroup.setStatus('current')
if mibBuilder.loadTexts: ospfIfMetricGroup.setDescription('These objects are used for OSPF systems for supporting interface metrics.')
ospfVirtIfGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 9)).setObjects(("OSPF-MIB", "ospfVirtIfAreaId"), ("OSPF-MIB", "ospfVirtIfNeighbor"), ("OSPF-MIB", "ospfVirtIfTransitDelay"), ("OSPF-MIB", "ospfVirtIfRetransInterval"), ("OSPF-MIB", "ospfVirtIfHelloInterval"), ("OSPF-MIB", "ospfVirtIfRtrDeadInterval"), ("OSPF-MIB", "ospfVirtIfState"), ("OSPF-MIB", "ospfVirtIfEvents"), ("OSPF-MIB", "ospfVirtIfAuthType"), ("OSPF-MIB", "ospfVirtIfAuthKey"), ("OSPF-MIB", "ospfVirtIfStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfVirtIfGroup = ospfVirtIfGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ospfVirtIfGroup.setDescription('These objects are used for OSPF systems for supporting virtual interfaces. This object group conforms to RFC 1850.')
ospfNbrGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 10)).setObjects(("OSPF-MIB", "ospfNbrIpAddr"), ("OSPF-MIB", "ospfNbrAddressLessIndex"), ("OSPF-MIB", "ospfNbrRtrId"), ("OSPF-MIB", "ospfNbrOptions"), ("OSPF-MIB", "ospfNbrPriority"), ("OSPF-MIB", "ospfNbrState"), ("OSPF-MIB", "ospfNbrEvents"), ("OSPF-MIB", "ospfNbrLsRetransQLen"), ("OSPF-MIB", "ospfNbmaNbrStatus"), ("OSPF-MIB", "ospfNbmaNbrPermanence"), ("OSPF-MIB", "ospfNbrHelloSuppressed"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfNbrGroup = ospfNbrGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ospfNbrGroup.setDescription('These objects are used to monitor/manage OSPF neighbors. This object group conforms to RFC 1850.')
ospfVirtNbrGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 11)).setObjects(("OSPF-MIB", "ospfVirtNbrArea"), ("OSPF-MIB", "ospfVirtNbrRtrId"), ("OSPF-MIB", "ospfVirtNbrIpAddr"), ("OSPF-MIB", "ospfVirtNbrOptions"), ("OSPF-MIB", "ospfVirtNbrState"), ("OSPF-MIB", "ospfVirtNbrEvents"), ("OSPF-MIB", "ospfVirtNbrLsRetransQLen"), ("OSPF-MIB", "ospfVirtNbrHelloSuppressed"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfVirtNbrGroup = ospfVirtNbrGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ospfVirtNbrGroup.setDescription('These objects are used to monitor/manage OSPF virtual neighbors. This object group conforms to RFC 1850.')
ospfExtLsdbGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 12)).setObjects(("OSPF-MIB", "ospfExtLsdbType"), ("OSPF-MIB", "ospfExtLsdbLsid"), ("OSPF-MIB", "ospfExtLsdbRouterId"), ("OSPF-MIB", "ospfExtLsdbSequence"), ("OSPF-MIB", "ospfExtLsdbAge"), ("OSPF-MIB", "ospfExtLsdbChecksum"), ("OSPF-MIB", "ospfExtLsdbAdvertisement"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfExtLsdbGroup = ospfExtLsdbGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ospfExtLsdbGroup.setDescription('These objects are used for OSPF systems that display their link state database. This object group conforms to RFC 1850. This object group is replaced by the ospfAsLsdbGroup in order to support any AS-scope LSA type in a single table.')
ospfAreaAggregateGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 13)).setObjects(("OSPF-MIB", "ospfAreaAggregateAreaID"), ("OSPF-MIB", "ospfAreaAggregateLsdbType"), ("OSPF-MIB", "ospfAreaAggregateNet"), ("OSPF-MIB", "ospfAreaAggregateMask"), ("OSPF-MIB", "ospfAreaAggregateStatus"), ("OSPF-MIB", "ospfAreaAggregateEffect"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfAreaAggregateGroup = ospfAreaAggregateGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ospfAreaAggregateGroup.setDescription('These objects are used for OSPF systems to support network prefix aggregation across areas.')
ospfLocalLsdbGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 14)).setObjects(("OSPF-MIB", "ospfLocalLsdbSequence"), ("OSPF-MIB", "ospfLocalLsdbAge"), ("OSPF-MIB", "ospfLocalLsdbChecksum"), ("OSPF-MIB", "ospfLocalLsdbAdvertisement"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfLocalLsdbGroup = ospfLocalLsdbGroup.setStatus('current')
if mibBuilder.loadTexts: ospfLocalLsdbGroup.setDescription('These objects are used for OSPF systems that display their link-local link state databases for non-virtual links.')
ospfVirtLocalLsdbGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 15)).setObjects(("OSPF-MIB", "ospfVirtLocalLsdbSequence"), ("OSPF-MIB", "ospfVirtLocalLsdbAge"), ("OSPF-MIB", "ospfVirtLocalLsdbChecksum"), ("OSPF-MIB", "ospfVirtLocalLsdbAdvertisement"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfVirtLocalLsdbGroup = ospfVirtLocalLsdbGroup.setStatus('current')
if mibBuilder.loadTexts: ospfVirtLocalLsdbGroup.setDescription('These objects are used for OSPF systems that display their link-local link state databases for virtual links.')
ospfAsLsdbGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 16)).setObjects(("OSPF-MIB", "ospfAsLsdbSequence"), ("OSPF-MIB", "ospfAsLsdbAge"), ("OSPF-MIB", "ospfAsLsdbChecksum"), ("OSPF-MIB", "ospfAsLsdbAdvertisement"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfAsLsdbGroup = ospfAsLsdbGroup.setStatus('current')
if mibBuilder.loadTexts: ospfAsLsdbGroup.setDescription('These objects are used for OSPF systems that display their AS-scope link state database.')
ospfBasicGroup2 = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 17)).setObjects(("OSPF-MIB", "ospfRouterId"), ("OSPF-MIB", "ospfAdminStat"), ("OSPF-MIB", "ospfVersionNumber"), ("OSPF-MIB", "ospfAreaBdrRtrStatus"), ("OSPF-MIB", "ospfASBdrRtrStatus"), ("OSPF-MIB", "ospfExternLsaCount"), ("OSPF-MIB", "ospfExternLsaCksumSum"), ("OSPF-MIB", "ospfTOSSupport"), ("OSPF-MIB", "ospfOriginateNewLsas"), ("OSPF-MIB", "ospfRxNewLsas"), ("OSPF-MIB", "ospfExtLsdbLimit"), ("OSPF-MIB", "ospfMulticastExtensions"), ("OSPF-MIB", "ospfExitOverflowInterval"), ("OSPF-MIB", "ospfDemandExtensions"), ("OSPF-MIB", "ospfRFC1583Compatibility"), ("OSPF-MIB", "ospfOpaqueLsaSupport"), ("OSPF-MIB", "ospfReferenceBandwidth"), ("OSPF-MIB", "ospfRestartSupport"), ("OSPF-MIB", "ospfRestartInterval"), ("OSPF-MIB", "ospfRestartStrictLsaChecking"), ("OSPF-MIB", "ospfRestartStatus"), ("OSPF-MIB", "ospfRestartAge"), ("OSPF-MIB", "ospfRestartExitReason"), ("OSPF-MIB", "ospfAsLsaCount"), ("OSPF-MIB", "ospfAsLsaCksumSum"), ("OSPF-MIB", "ospfStubRouterSupport"), ("OSPF-MIB", "ospfStubRouterAdvertisement"), ("OSPF-MIB", "ospfDiscontinuityTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfBasicGroup2 = ospfBasicGroup2.setStatus('current')
if mibBuilder.loadTexts: ospfBasicGroup2.setDescription('These objects are used to monitor/manage OSPF global parameters.')
ospfAreaGroup2 = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 18)).setObjects(("OSPF-MIB", "ospfAreaId"), ("OSPF-MIB", "ospfImportAsExtern"), ("OSPF-MIB", "ospfSpfRuns"), ("OSPF-MIB", "ospfAreaBdrRtrCount"), ("OSPF-MIB", "ospfAsBdrRtrCount"), ("OSPF-MIB", "ospfAreaLsaCount"), ("OSPF-MIB", "ospfAreaLsaCksumSum"), ("OSPF-MIB", "ospfAreaSummary"), ("OSPF-MIB", "ospfAreaStatus"), ("OSPF-MIB", "ospfAreaNssaTranslatorRole"), ("OSPF-MIB", "ospfAreaNssaTranslatorState"), ("OSPF-MIB", "ospfAreaNssaTranslatorStabilityInterval"), ("OSPF-MIB", "ospfAreaNssaTranslatorEvents"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfAreaGroup2 = ospfAreaGroup2.setStatus('current')
if mibBuilder.loadTexts: ospfAreaGroup2.setDescription('These objects are used by OSPF systems to support areas.')
ospfIfGroup2 = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 19)).setObjects(("OSPF-MIB", "ospfIfIpAddress"), ("OSPF-MIB", "ospfAddressLessIf"), ("OSPF-MIB", "ospfIfAreaId"), ("OSPF-MIB", "ospfIfType"), ("OSPF-MIB", "ospfIfAdminStat"), ("OSPF-MIB", "ospfIfRtrPriority"), ("OSPF-MIB", "ospfIfTransitDelay"), ("OSPF-MIB", "ospfIfRetransInterval"), ("OSPF-MIB", "ospfIfHelloInterval"), ("OSPF-MIB", "ospfIfRtrDeadInterval"), ("OSPF-MIB", "ospfIfPollInterval"), ("OSPF-MIB", "ospfIfState"), ("OSPF-MIB", "ospfIfDesignatedRouter"), ("OSPF-MIB", "ospfIfBackupDesignatedRouter"), ("OSPF-MIB", "ospfIfEvents"), ("OSPF-MIB", "ospfIfAuthType"), ("OSPF-MIB", "ospfIfAuthKey"), ("OSPF-MIB", "ospfIfStatus"), ("OSPF-MIB", "ospfIfMulticastForwarding"), ("OSPF-MIB", "ospfIfDemand"), ("OSPF-MIB", "ospfIfLsaCount"), ("OSPF-MIB", "ospfIfLsaCksumSum"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfIfGroup2 = ospfIfGroup2.setStatus('current')
if mibBuilder.loadTexts: ospfIfGroup2.setDescription('These objects are used to monitor/manage OSPF interfaces.')
ospfVirtIfGroup2 = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 20)).setObjects(("OSPF-MIB", "ospfVirtIfAreaId"), ("OSPF-MIB", "ospfVirtIfNeighbor"), ("OSPF-MIB", "ospfVirtIfTransitDelay"), ("OSPF-MIB", "ospfVirtIfRetransInterval"), ("OSPF-MIB", "ospfVirtIfHelloInterval"), ("OSPF-MIB", "ospfVirtIfRtrDeadInterval"), ("OSPF-MIB", "ospfVirtIfState"), ("OSPF-MIB", "ospfVirtIfEvents"), ("OSPF-MIB", "ospfVirtIfAuthType"), ("OSPF-MIB", "ospfVirtIfAuthKey"), ("OSPF-MIB", "ospfVirtIfStatus"), ("OSPF-MIB", "ospfVirtIfLsaCount"), ("OSPF-MIB", "ospfVirtIfLsaCksumSum"), ("OSPF-MIB", "ospfIfDesignatedRouterId"), ("OSPF-MIB", "ospfIfBackupDesignatedRouterId"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfVirtIfGroup2 = ospfVirtIfGroup2.setStatus('current')
if mibBuilder.loadTexts: ospfVirtIfGroup2.setDescription('These objects are used to monitor/manage OSPF virtual interfaces.')
ospfNbrGroup2 = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 21)).setObjects(("OSPF-MIB", "ospfNbrIpAddr"), ("OSPF-MIB", "ospfNbrAddressLessIndex"), ("OSPF-MIB", "ospfNbrRtrId"), ("OSPF-MIB", "ospfNbrOptions"), ("OSPF-MIB", "ospfNbrPriority"), ("OSPF-MIB", "ospfNbrState"), ("OSPF-MIB", "ospfNbrEvents"), ("OSPF-MIB", "ospfNbrLsRetransQLen"), ("OSPF-MIB", "ospfNbmaNbrStatus"), ("OSPF-MIB", "ospfNbmaNbrPermanence"), ("OSPF-MIB", "ospfNbrHelloSuppressed"), ("OSPF-MIB", "ospfNbrRestartHelperStatus"), ("OSPF-MIB", "ospfNbrRestartHelperAge"), ("OSPF-MIB", "ospfNbrRestartHelperExitReason"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfNbrGroup2 = ospfNbrGroup2.setStatus('current')
if mibBuilder.loadTexts: ospfNbrGroup2.setDescription('These objects are used to monitor/manage OSPF neighbors.')
ospfVirtNbrGroup2 = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 22)).setObjects(("OSPF-MIB", "ospfVirtNbrArea"), ("OSPF-MIB", "ospfVirtNbrRtrId"), ("OSPF-MIB", "ospfVirtNbrIpAddr"), ("OSPF-MIB", "ospfVirtNbrOptions"), ("OSPF-MIB", "ospfVirtNbrState"), ("OSPF-MIB", "ospfVirtNbrEvents"), ("OSPF-MIB", "ospfVirtNbrLsRetransQLen"), ("OSPF-MIB", "ospfVirtNbrHelloSuppressed"), ("OSPF-MIB", "ospfVirtNbrRestartHelperStatus"), ("OSPF-MIB", "ospfVirtNbrRestartHelperAge"), ("OSPF-MIB", "ospfVirtNbrRestartHelperExitReason"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfVirtNbrGroup2 = ospfVirtNbrGroup2.setStatus('current')
if mibBuilder.loadTexts: ospfVirtNbrGroup2.setDescription('These objects are used to monitor/manage OSPF virtual neighbors.')
ospfAreaAggregateGroup2 = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 23)).setObjects(("OSPF-MIB", "ospfAreaAggregateAreaID"), ("OSPF-MIB", "ospfAreaAggregateLsdbType"), ("OSPF-MIB", "ospfAreaAggregateNet"), ("OSPF-MIB", "ospfAreaAggregateMask"), ("OSPF-MIB", "ospfAreaAggregateStatus"), ("OSPF-MIB", "ospfAreaAggregateEffect"), ("OSPF-MIB", "ospfAreaAggregateExtRouteTag"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfAreaAggregateGroup2 = ospfAreaAggregateGroup2.setStatus('current')
if mibBuilder.loadTexts: ospfAreaAggregateGroup2.setDescription('These objects are used for OSPF systems to support network prefix aggregation across areas.')
ospfAreaLsaCountGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 24)).setObjects(("OSPF-MIB", "ospfAreaLsaCountNumber"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfAreaLsaCountGroup = ospfAreaLsaCountGroup.setStatus('current')
if mibBuilder.loadTexts: ospfAreaLsaCountGroup.setDescription('These objects are used for OSPF systems that display per-area, per-LSA-type counters.')
ospfHostGroup2 = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 25)).setObjects(("OSPF-MIB", "ospfHostIpAddress"), ("OSPF-MIB", "ospfHostTOS"), ("OSPF-MIB", "ospfHostMetric"), ("OSPF-MIB", "ospfHostStatus"), ("OSPF-MIB", "ospfHostCfgAreaID"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfHostGroup2 = ospfHostGroup2.setStatus('current')
if mibBuilder.loadTexts: ospfHostGroup2.setDescription('These objects are used for OSPF systems that support attached hosts.')
ospfObsoleteGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 14, 15, 1, 26)).setObjects(("OSPF-MIB", "ospfAuthType"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ospfObsoleteGroup = ospfObsoleteGroup.setStatus('obsolete')
if mibBuilder.loadTexts: ospfObsoleteGroup.setDescription('These objects are obsolete and are no longer required for OSPF systems. They are placed into this group for SMI conformance.')
mibBuilder.exportSymbols("OSPF-MIB", ospfVirtLocalLsdbTable=ospfVirtLocalLsdbTable, ospfAsLsdbAdvertisement=ospfAsLsdbAdvertisement, ospfIfRtrPriority=ospfIfRtrPriority, ospfNbrPriority=ospfNbrPriority, ospfStubAreaEntry=ospfStubAreaEntry, ospfLsdbType=ospfLsdbType, ospfAreaSummary=ospfAreaSummary, ospfObsoleteGroup=ospfObsoleteGroup, ospfIfGroup=ospfIfGroup, ospfAreaBdrRtrStatus=ospfAreaBdrRtrStatus, ospfCompliances=ospfCompliances, ospfAsLsdbAge=ospfAsLsdbAge, ospfOriginateNewLsas=ospfOriginateNewLsas, ospfLsdbLsid=ospfLsdbLsid, ospfVirtLocalLsdbType=ospfVirtLocalLsdbType, ospfRxNewLsas=ospfRxNewLsas, ospfAreaRangeMask=ospfAreaRangeMask, ospfIfEvents=ospfIfEvents, ospfVirtIfTable=ospfVirtIfTable, ospfVirtLocalLsdbAge=ospfVirtLocalLsdbAge, ospfVirtLocalLsdbGroup=ospfVirtLocalLsdbGroup, ospfNbrGroup=ospfNbrGroup, ospfExtLsdbLsid=ospfExtLsdbLsid, ospfVirtIfAuthType=ospfVirtIfAuthType, ospfVirtLocalLsdbAdvertisement=ospfVirtLocalLsdbAdvertisement, ospfVirtNbrArea=ospfVirtNbrArea, ospfVirtIfGroup2=ospfVirtIfGroup2, ospfLocalLsdbAddressLessIf=ospfLocalLsdbAddressLessIf, ospfConformance=ospfConformance, ospfVirtNbrState=ospfVirtNbrState, ospfNbrOptions=ospfNbrOptions, ospfAreaNssaTranslatorRole=ospfAreaNssaTranslatorRole, ospfAreaNssaTranslatorState=ospfAreaNssaTranslatorState, ospfHostTable=ospfHostTable, ospfGeneralGroup=ospfGeneralGroup, ospfVirtNbrTable=ospfVirtNbrTable, UpToMaxAge=UpToMaxAge, ospfIfHelloInterval=ospfIfHelloInterval, ospfVirtIfLsaCount=ospfVirtIfLsaCount, ospfStubMetricType=ospfStubMetricType, ospfAreaLsaCount=ospfAreaLsaCount, ospfIntraArea=ospfIntraArea, ospfAreaAggregateEffect=ospfAreaAggregateEffect, ospfVirtLocalLsdbChecksum=ospfVirtLocalLsdbChecksum, ospfAsLsdbGroup=ospfAsLsdbGroup, ospfStubTOS=ospfStubTOS, ospfComplianceObsolete=ospfComplianceObsolete, ospfAreaRangeTable=ospfAreaRangeTable, ospfAreaAggregateGroup=ospfAreaAggregateGroup, ospfAreaNssaTranslatorStabilityInterval=ospfAreaNssaTranslatorStabilityInterval, ospfExtLsdbType=ospfExtLsdbType, ospfIfBackupDesignatedRouter=ospfIfBackupDesignatedRouter, ospfAreaStatus=ospfAreaStatus, ospfVirtLocalLsdbEntry=ospfVirtLocalLsdbEntry, ospfExtLsdbRouterId=ospfExtLsdbRouterId, ospfNbrRestartHelperAge=ospfNbrRestartHelperAge, ospfLocalLsdbEntry=ospfLocalLsdbEntry, ospfLocalLsdbSequence=ospfLocalLsdbSequence, ospfExternLsaCount=ospfExternLsaCount, ospfAsLsdbEntry=ospfAsLsdbEntry, ospfExternalType1=ospfExternalType1, ospfAreaAggregateAreaID=ospfAreaAggregateAreaID, ospfGroups=ospfGroups, ospfAreaAggregateMask=ospfAreaAggregateMask, ospfIfPollInterval=ospfIfPollInterval, ospfVirtIfAuthKey=ospfVirtIfAuthKey, ospfExtLsdbChecksum=ospfExtLsdbChecksum, ospfExtLsdbLimit=ospfExtLsdbLimit, ospfVirtIfState=ospfVirtIfState, ospfIfMetricGroup=ospfIfMetricGroup, ospfNbrTable=ospfNbrTable, ospfAreaRangeNet=ospfAreaRangeNet, ospfVirtNbrLsRetransQLen=ospfVirtNbrLsRetransQLen, ospfAreaAggregateEntry=ospfAreaAggregateEntry, ospfRestartStatus=ospfRestartStatus, ospfVirtNbrGroup2=ospfVirtNbrGroup2, ospfASBdrRtrStatus=ospfASBdrRtrStatus, ospfHostGroup=ospfHostGroup, ospfNbrIpAddr=ospfNbrIpAddr, ospfVirtNbrHelloSuppressed=ospfVirtNbrHelloSuppressed, Status=Status, ospfInterArea=ospfInterArea, ospfRFC1583Compatibility=ospfRFC1583Compatibility, ospfIfMetricValue=ospfIfMetricValue, ospfAsLsdbSequence=ospfAsLsdbSequence, ospfIfLsaCksumSum=ospfIfLsaCksumSum, BigMetric=BigMetric, ospfHostAreaID=ospfHostAreaID, ospfIfMulticastForwarding=ospfIfMulticastForwarding, ospfLsdbChecksum=ospfLsdbChecksum, ospfIfMetricIpAddress=ospfIfMetricIpAddress, ospfVirtIfEvents=ospfVirtIfEvents, ospfAreaAggregateGroup2=ospfAreaAggregateGroup2, ospfAreaId=ospfAreaId, ospfAsLsdbTable=ospfAsLsdbTable, ospfHostGroup2=ospfHostGroup2, ospfNbmaNbrStatus=ospfNbmaNbrStatus, ospfLsdbAdvertisement=ospfLsdbAdvertisement, ospfMulticastExtensions=ospfMulticastExtensions, ospfLocalLsdbAdvertisement=ospfLocalLsdbAdvertisement, ospfVirtNbrOptions=ospfVirtNbrOptions, ospfAreaRangeEffect=ospfAreaRangeEffect, ospfVirtIfEntry=ospfVirtIfEntry, ospfReferenceBandwidth=ospfReferenceBandwidth, ospfAreaGroup2=ospfAreaGroup2, ospfExternalType2=ospfExternalType2, ospfBasicGroup2=ospfBasicGroup2, Metric=Metric, ospfHostTOS=ospfHostTOS, ospfLocalLsdbLsid=ospfLocalLsdbLsid, ospfAsLsdbLsid=ospfAsLsdbLsid, ospfAreaRangeGroup=ospfAreaRangeGroup, ospfStubStatus=ospfStubStatus, ospfVirtLocalLsdbNeighbor=ospfVirtLocalLsdbNeighbor, ospfHostStatus=ospfHostStatus, ospfAreaAggregateStatus=ospfAreaAggregateStatus, ospfAsLsaCksumSum=ospfAsLsaCksumSum, ospfVirtIfRtrDeadInterval=ospfVirtIfRtrDeadInterval, ospfExtLsdbAge=ospfExtLsdbAge, ospfExtLsdbEntry=ospfExtLsdbEntry, ospfRestartInterval=ospfRestartInterval, ospfExtLsdbGroup=ospfExtLsdbGroup, ospfAreaRangeEntry=ospfAreaRangeEntry, ospfLsdbAge=ospfLsdbAge, TOSType=TOSType, ospfIfAdminStat=ospfIfAdminStat, ospfLsdbSequence=ospfLsdbSequence, ospfLocalLsdbTable=ospfLocalLsdbTable, ospfVirtNbrRestartHelperAge=ospfVirtNbrRestartHelperAge, ospfAreaGroup=ospfAreaGroup, ospfRouterId=ospfRouterId, OspfAuthenticationType=OspfAuthenticationType, ospfVirtIfStatus=ospfVirtIfStatus, ospfIfEntry=ospfIfEntry, HelloRange=HelloRange, ospfNbrState=ospfNbrState, ospfDemandExtensions=ospfDemandExtensions, ospfNbrAddressLessIndex=ospfNbrAddressLessIndex, ospfHostCfgAreaID=ospfHostCfgAreaID, ospfLsdbGroup=ospfLsdbGroup, ospfBasicGroup=ospfBasicGroup, ospfRouteGroup=ospfRouteGroup, ospfStubRouterSupport=ospfStubRouterSupport, ospfVirtIfLsaCksumSum=ospfVirtIfLsaCksumSum, ospfExternLsaCksumSum=ospfExternLsaCksumSum, ospfNbrRtrId=ospfNbrRtrId, ospfNbrRestartHelperExitReason=ospfNbrRestartHelperExitReason, ospfAreaLsaCountEntry=ospfAreaLsaCountEntry, ospfIfDesignatedRouterId=ospfIfDesignatedRouterId, ospfAreaLsaCountNumber=ospfAreaLsaCountNumber, ospfLocalLsdbAge=ospfLocalLsdbAge, ospfNbrRestartHelperStatus=ospfNbrRestartHelperStatus, ospfNbrHelloSuppressed=ospfNbrHelloSuppressed, ospfVirtIfRetransInterval=ospfVirtIfRetransInterval, ospfStubAreaTable=ospfStubAreaTable, ospfVirtIfHelloInterval=ospfVirtIfHelloInterval, ospfVirtNbrRestartHelperExitReason=ospfVirtNbrRestartHelperExitReason, RouterID=RouterID, ospfRestartExitReason=ospfRestartExitReason, ospfIfLsaCount=ospfIfLsaCount, ospfAreaAggregateTable=ospfAreaAggregateTable, ospfNbmaNbrPermanence=ospfNbmaNbrPermanence, ospfTOSSupport=ospfTOSSupport, ospfAreaLsaCountAreaId=ospfAreaLsaCountAreaId, ospfIfIpAddress=ospfIfIpAddress, ospfStubMetric=ospfStubMetric, ospfIfType=ospfIfType, ospfAdminStat=ospfAdminStat, ospfImportAsExtern=ospfImportAsExtern, ospfVirtIfAreaId=ospfVirtIfAreaId, ospfAreaLsaCksumSum=ospfAreaLsaCksumSum, ospfVirtIfNeighbor=ospfVirtIfNeighbor, ospfExtLsdbAdvertisement=ospfExtLsdbAdvertisement, ospfVersionNumber=ospfVersionNumber, ospfOpaqueLsaSupport=ospfOpaqueLsaSupport, PYSNMP_MODULE_ID=ospf, ospfLsdbTable=ospfLsdbTable, ospfAddressLessIf=ospfAddressLessIf, ospfExtLsdbTable=ospfExtLsdbTable, ospfIfAuthKey=ospfIfAuthKey, ospfLsdbRouterId=ospfLsdbRouterId, ospfLocalLsdbIpAddress=ospfLocalLsdbIpAddress, ospfIfAreaId=ospfIfAreaId, ospfAsLsdbChecksum=ospfAsLsdbChecksum, ospfHostMetric=ospfHostMetric, ospfAreaEntry=ospfAreaEntry, ospfIfMetricTOS=ospfIfMetricTOS, ospfNbrLsRetransQLen=ospfNbrLsRetransQLen, ospfVirtNbrRestartHelperStatus=ospfVirtNbrRestartHelperStatus, ospfLocalLsdbGroup=ospfLocalLsdbGroup, ospfVirtNbrEntry=ospfVirtNbrEntry, ospfExitOverflowInterval=ospfExitOverflowInterval, ospfStubRouterAdvertisement=ospfStubRouterAdvertisement, ospfLsdbEntry=ospfLsdbEntry, ospfIfMetricEntry=ospfIfMetricEntry, ospfVirtNbrIpAddr=ospfVirtNbrIpAddr, ospfVirtLocalLsdbRouterId=ospfVirtLocalLsdbRouterId, ospfSpfRuns=ospfSpfRuns, AreaID=AreaID, ospf=ospf, ospfVirtNbrGroup=ospfVirtNbrGroup, ospfVirtLocalLsdbSequence=ospfVirtLocalLsdbSequence, ospfIfRtrDeadInterval=ospfIfRtrDeadInterval, ospfAreaAggregateNet=ospfAreaAggregateNet, ospfLocalLsdbChecksum=ospfLocalLsdbChecksum, ospfIfTransitDelay=ospfIfTransitDelay, ospfIfTable=ospfIfTable, ospfIfRetransInterval=ospfIfRetransInterval, ospfIfAuthType=ospfIfAuthType, ospfLocalLsdbRouterId=ospfLocalLsdbRouterId, ospfAreaTable=ospfAreaTable, ospfAreaBdrRtrCount=ospfAreaBdrRtrCount, ospfIfDemand=ospfIfDemand, ospfAsLsaCount=ospfAsLsaCount, ospfDiscontinuityTime=ospfDiscontinuityTime, ospfAsBdrRtrCount=ospfAsBdrRtrCount, ospfLsdbAreaId=ospfLsdbAreaId, ospfAreaRangeAreaId=ospfAreaRangeAreaId, ospfAreaRangeStatus=ospfAreaRangeStatus, ospfLocalLsdbType=ospfLocalLsdbType, ospfAsLsdbRouterId=ospfAsLsdbRouterId, ospfCompliance2=ospfCompliance2, ospfIfDesignatedRouter=ospfIfDesignatedRouter, ospfRestartStrictLsaChecking=ospfRestartStrictLsaChecking, ospfVirtIfGroup=ospfVirtIfGroup, ospfIfGroup2=ospfIfGroup2, ospfAreaAggregateExtRouteTag=ospfAreaAggregateExtRouteTag, ospfVirtLocalLsdbTransitArea=ospfVirtLocalLsdbTransitArea, ospfAreaLsaCountTable=ospfAreaLsaCountTable, ospfHostIpAddress=ospfHostIpAddress, ospfStubAreaId=ospfStubAreaId, ospfVirtNbrRtrId=ospfVirtNbrRtrId, ospfIfBackupDesignatedRouterId=ospfIfBackupDesignatedRouterId, PositiveInteger=PositiveInteger, ospfAreaLsaCountLsaType=ospfAreaLsaCountLsaType, ospfAreaAggregateLsdbType=ospfAreaAggregateLsdbType, ospfAreaNssaTranslatorEvents=ospfAreaNssaTranslatorEvents, ospfAuthType=ospfAuthType, DesignatedRouterPriority=DesignatedRouterPriority, ospfStubAreaGroup=ospfStubAreaGroup, ospfCompliance=ospfCompliance, ospfVirtIfTransitDelay=ospfVirtIfTransitDelay, ospfHostEntry=ospfHostEntry, ospfNbrEvents=ospfNbrEvents, ospfAreaLsaCountGroup=ospfAreaLsaCountGroup, ospfNbrGroup2=ospfNbrGroup2, ospfIfState=ospfIfState, ospfVirtNbrEvents=ospfVirtNbrEvents, ospfNbrEntry=ospfNbrEntry, ospfAsLsdbType=ospfAsLsdbType, ospfIfMetricTable=ospfIfMetricTable, ospfIfStatus=ospfIfStatus, ospfIfMetricAddressLessIf=ospfIfMetricAddressLessIf, ospfVirtLocalLsdbLsid=ospfVirtLocalLsdbLsid)
mibBuilder.exportSymbols("OSPF-MIB", ospfIfMetricStatus=ospfIfMetricStatus, ospfExtLsdbSequence=ospfExtLsdbSequence, ospfRestartSupport=ospfRestartSupport, ospfRestartAge=ospfRestartAge)
| 152.659483 | 9,786 | 0.785753 |
099e3f2b24bd01bfd5b7e1350533a5d17bf7ffdd | 1,695 | py | Python | abandoned-ideas/yml-generator.py | HenryZheng1/sengrep-cli-py | 89d2ffad813706a534290f248220f0d32aeb4c3c | [
"Apache-2.0"
] | null | null | null | abandoned-ideas/yml-generator.py | HenryZheng1/sengrep-cli-py | 89d2ffad813706a534290f248220f0d32aeb4c3c | [
"Apache-2.0"
] | null | null | null | abandoned-ideas/yml-generator.py | HenryZheng1/sengrep-cli-py | 89d2ffad813706a534290f248220f0d32aeb4c3c | [
"Apache-2.0"
] | 2 | 2021-07-23T16:46:16.000Z | 2021-07-30T02:59:43.000Z | from csv import reader
import yaml
import json
go()
| 35.3125 | 150 | 0.60118 |
099e6785d5350ed75115c74f1a4e9bf333839d99 | 4,018 | py | Python | linearizer/utils.py | Max1993Liu/Linearizer | 739c47c0d98d262a0bc962a450729bcf83c61212 | [
"MIT"
] | null | null | null | linearizer/utils.py | Max1993Liu/Linearizer | 739c47c0d98d262a0bc962a450729bcf83c61212 | [
"MIT"
] | null | null | null | linearizer/utils.py | Max1993Liu/Linearizer | 739c47c0d98d262a0bc962a450729bcf83c61212 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from types import FunctionType
import warnings
from .transform import BaseTransformer
def drop_na(x, y, according='both'):
""" Drop the values in both x and y if the element in `according` is missing
ex. drop_na([1, 2, np.nan], [1, 2, 3], 'x') => [1, 2], [1, 2]
"""
if according == 'x':
valid_index = ~np.isnan(x)
elif according == 'y':
valid_index = ~np.isnan(y)
elif according == 'both':
valid_index = (~np.isnan(x)) & (~np.isnan(y))
else:
raise ValueError('According should be one of {}'.format(['x', 'y', 'both']))
return np.array(x)[valid_index], np.array(y)[valid_index]
def check_binary_label(y):
""" Make sure the label contains only 0 and 1 """
if set(y) != set([0, 1]):
raise ValueError('The label must be binary 0 or 1.')
def as_positive_rate(x, y, bins, interval_value='mean'):
""" Group numerical variable x into several bins
and calculate the positive rate within each bin
:param bins: Integer or a sequence of values as cutoff points
:param interval_value: One of ['left', 'right', 'mean'], how the interval is converted to a scalar
"""
if isinstance(x, list):
x = np.array(x)
check_numerical(x)
check_binary_label(y)
if len(set(x)) <= bins:
pos_pct = pd.Series(y).groupby(x).mean()
else:
intervals = pd.cut(x, bins)
if interval_value == 'left':
intervals = [i.left for i in intervals]
elif interval_value == 'right':
intervals = [i.right for i in intervals]
elif interval_value == 'mean':
intervals = [(i.left + i.right) / 2.0 for i in intervals]
else:
raise ValueError('Only {} is supported.'.format(['left', 'right', 'mean']))
pos_pct = pd.Series(y).groupby(intervals).mean()
return pos_pct.index.values, pos_pct.values
EPILSON = 1e-15
_TRANSFORMS = {
'odds': _odds,
'logodds': _logodds
}
def preprocess(x, y, binary_label=True, bins=50, transform_y=None, interval_value='mean', ignore_na=True):
""" Preprocess the input before finding the best transformations
:param binary_label: Whether the label is binary (0, 1), in other words. whether the problem
is classification or regression.
:param transform_y: Transformation applied to y, can either be a string within ['odds', 'logodds'],
or a function
:param bins: Integer or a sequence of values as cutoff points
:param interval_value: One of ['left', 'right', 'mean'], how the interval is converted to a scalar
:ignore_na: Whether to ignore NA
"""
if binary_label:
x, y = as_positive_rate(x, y, bins, interval_value)
if transform_y is not None:
# make sure y is an array
y = np.array(y)
if isinstance(transform_y, str):
if transform_y not in _TRANSFORMS:
raise ValueError('Only {} is supported.'.format(_TRANSFORMS.keys()))
y = _TRANSFORMS[transform_y](y)
elif isinstance(transform_y, FunctionType):
y = transform_y(y)
else:
raise ValueError('Only string and function is supported for `transform_y`.')
if ignore_na:
x, y = drop_na(x, y, according='both')
return x, y
| 31.637795 | 106 | 0.612245 |
099e97710e96accac9ae6950fc54a6209ae97168 | 821 | py | Python | lintcode/NineChapters/06/remove-duplicates-from-sorted-list-ii.py | shootsoft/practice | 49f28c2e0240de61d00e4e0291b3c5edd930e345 | [
"Apache-2.0"
] | null | null | null | lintcode/NineChapters/06/remove-duplicates-from-sorted-list-ii.py | shootsoft/practice | 49f28c2e0240de61d00e4e0291b3c5edd930e345 | [
"Apache-2.0"
] | null | null | null | lintcode/NineChapters/06/remove-duplicates-from-sorted-list-ii.py | shootsoft/practice | 49f28c2e0240de61d00e4e0291b3c5edd930e345 | [
"Apache-2.0"
] | null | null | null | __author__ = 'yinjun'
"""
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
| 22.805556 | 61 | 0.504263 |
09a082c5b766d52ac4bd284843a07b1bfbf38eba | 325 | py | Python | testings.py | GYosifov88/Python-Fundamentals | b46ba2822bd2dac6ff46830c6a520e559b448442 | [
"MIT"
] | null | null | null | testings.py | GYosifov88/Python-Fundamentals | b46ba2822bd2dac6ff46830c6a520e559b448442 | [
"MIT"
] | null | null | null | testings.py | GYosifov88/Python-Fundamentals | b46ba2822bd2dac6ff46830c6a520e559b448442 | [
"MIT"
] | null | null | null |
vid = input()
object = Object(vid)
a = int(input())
b = int(input())
print(f'{object.square(a,b)}')
| 18.055556 | 35 | 0.52 |
09a0e0698bb4f209bcf75379d2f58d655b33426a | 809 | py | Python | argdeco/__main__.py | klorenz/python-argdeco | eb614d63430c5da68a972bdc40f8a1541070089d | [
"MIT"
] | null | null | null | argdeco/__main__.py | klorenz/python-argdeco | eb614d63430c5da68a972bdc40f8a1541070089d | [
"MIT"
] | null | null | null | argdeco/__main__.py | klorenz/python-argdeco | eb614d63430c5da68a972bdc40f8a1541070089d | [
"MIT"
] | null | null | null | from .main import Main
from .arguments import arg
from textwrap import dedent
main = Main()
command = main.command
main()
| 28.892857 | 100 | 0.700865 |
09a18d4b2a0fa8ae47cff0df35320c0b38f5b9e2 | 1,500 | py | Python | Resources/Python Example Files/Prior_move_rel.py | stephf0716/MATLAB-scanning-stage | a4f5e96b86d1c95bf16ff7262959b7c0f8b8e51d | [
"MIT"
] | null | null | null | Resources/Python Example Files/Prior_move_rel.py | stephf0716/MATLAB-scanning-stage | a4f5e96b86d1c95bf16ff7262959b7c0f8b8e51d | [
"MIT"
] | null | null | null | Resources/Python Example Files/Prior_move_rel.py | stephf0716/MATLAB-scanning-stage | a4f5e96b86d1c95bf16ff7262959b7c0f8b8e51d | [
"MIT"
] | null | null | null | # *********************************************************
# Relative Stage Movement
#
# Stephanie Fung 2014
# *********************************************************
# Import modules.
# ---------------------------------------------------------
import visa
import string
import struct
import sys
import serial
# =========================================================
# Initialize Prior:
# =========================================================
# =========================================================
# Prior Move Relative function:
# =========================================================
# =========================================================
# Main program:
# =========================================================
## Prior Stage
Prior = serial.Serial()
Prior.port = "COM1"
Prior.timeout = 0.1
print Prior
Prior.open()
Prior.isOpen
PriorInit()
## Move position
moveRel('x',-1000)
moveRel('y',0)
# Close the serial connection to the Prior stage
Prior.close()
Prior.isOpen()
print "End of program."
| 25.862069 | 59 | 0.420667 |
09a1a281f097af89e78698b2962835021fca03c7 | 7,794 | py | Python | ratatosk/lib/tools/picard.py | SciLifeLab/ratatosk | 4e9c9d8dc868b19a7c70eb7b326422c87bc3d7c0 | [
"Apache-2.0"
] | null | null | null | ratatosk/lib/tools/picard.py | SciLifeLab/ratatosk | 4e9c9d8dc868b19a7c70eb7b326422c87bc3d7c0 | [
"Apache-2.0"
] | null | null | null | ratatosk/lib/tools/picard.py | SciLifeLab/ratatosk | 4e9c9d8dc868b19a7c70eb7b326422c87bc3d7c0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 Per Unneberg
#
# 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.
import os
import luigi
import logging
import time
import glob
import ratatosk.lib.files.external
from ratatosk.utils import rreplace
from ratatosk.job import InputJobTask, JobWrapperTask, JobTask, DefaultShellJobRunner
import ratatosk.shell as shell
# TODO: make these configurable
JAVA="java"
JAVA_OPTS="-Xmx2g"
PICARD_HOME=os.getenv("PICARD_HOME")
logger = logging.getLogger('luigi-interface')
| 41.903226 | 186 | 0.673723 |
09a25fafbbc8341875cf49512a6963ebb67af9a9 | 1,092 | py | Python | working-with-data/part1/reading-and-writing-text-files.py | LucasHelal/data-science | 9b243be1dea23a521e6ebb49dc358708a9b17dbd | [
"MIT"
] | null | null | null | working-with-data/part1/reading-and-writing-text-files.py | LucasHelal/data-science | 9b243be1dea23a521e6ebb49dc358708a9b17dbd | [
"MIT"
] | null | null | null | working-with-data/part1/reading-and-writing-text-files.py | LucasHelal/data-science | 9b243be1dea23a521e6ebb49dc358708a9b17dbd | [
"MIT"
] | null | null | null | import sys
import pandas as pd
# Can open csv files as a dataframe
dframe = pd.read_csv('lec25.csv')
# Can also use read_table with ',' as a delimiter
dframe = pd.read_table('lec25.csv', sep=',')
# If we dont want the header to be the first row
dframe = pd.read_csv('lec25.csv', header=None)
# We can also indicate a particular number of rows to be read
pd.read_csv('lec25.csv', header=None, nrows=2)
# Now let's see how we can write DataFrames out to text files
dframe.to_csv('mytextdata_out.csv')
# You'll see this file where you're ipython Notebooks are saved (Usually
# under my documents)
# We can also use other delimiters
# we'll import sys to see the output
# Use sys.stdout to see the output directly and not save it
dframe.to_csv(sys.stdout, sep='_')
# Just to make sure we understand the delimiter
dframe.to_csv(sys.stdout, sep='?')
# We can also choose to write only a specific subset of columns
dframe.to_csv(sys.stdout, columns=[0, 1, 2])
# You should also checkout pythons built-in csv reader and writer fot more info
# https://docs.python.org/2/library/csv.html
| 28.736842 | 79 | 0.739011 |
09a28df0637d0c34e269ec275da4a8046d1b7543 | 385 | py | Python | python-framework/libs/crypto.py | huangxingx/python-framework | a62618b0ee5ecff9de426327892cdd690d10510d | [
"MIT"
] | 7 | 2019-10-24T03:26:22.000Z | 2019-10-27T14:55:07.000Z | python-framework/libs/crypto.py | PJoemu/python-framework | a62618b0ee5ecff9de426327892cdd690d10510d | [
"MIT"
] | 3 | 2021-06-08T19:13:10.000Z | 2022-01-13T00:38:48.000Z | python-framework/libs/crypto.py | PJoemu/python-framework | a62618b0ee5ecff9de426327892cdd690d10510d | [
"MIT"
] | 2 | 2019-10-25T03:54:51.000Z | 2020-06-28T08:50:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @author: x.huang
# @date:17-8-17
from Crypto.Hash import MD5
if __name__ == '__main__':
print(encrypto('arhieason'))
| 15.4 | 51 | 0.623377 |
09a2b27d6e9143175c3eaab5d912857ca2f60085 | 1,428 | py | Python | comments/urls.py | ggetzie/greaterdebater | fb1739f3db42717f3d63fe6c9dbf0c2402fb1fd5 | [
"MIT"
] | null | null | null | comments/urls.py | ggetzie/greaterdebater | fb1739f3db42717f3d63fe6c9dbf0c2402fb1fd5 | [
"MIT"
] | 1 | 2020-05-02T02:03:08.000Z | 2020-05-02T02:03:08.000Z | comments/urls.py | ggetzie/greaterdebater | fb1739f3db42717f3d63fe6c9dbf0c2402fb1fd5 | [
"MIT"
] | null | null | null |
from django.conf.urls import patterns
from comments.views import CommentDebateList
# This url file is included from items.urls with the prefix /comments/
urlpatterns = patterns('',
# Add a comment to a topic
(r'^(?P<topic_id>\d+)/add/$', 'comments.views.add'),
# Edit a comment
(r'^(?P<topic_id>\d+)/edit/$', 'comments.views.edit'),
# View a single comment on a page by itself
(r'^(?P<comment_id>\d+)/?$', 'comments.views.comment_detail'),
# Delete a comment
(r'[delete|undelete]/$', 'comments.views.delete'),
# View all arguments associated with a comment
(r'^(?P<comment_id>\d+)/arguments/?(?P<page>\d+)?/?$',
CommentDebateList.as_view(paginate_by=10,
template_name='comments/comment_args.html',
context_object_name='args_list')),
# Flag a comment as spam
(r'^flag/$', 'comments.views.flag'),
# Follow or unfollow a topic or comment for
# updates when new replies are made
(r'^follow/$', 'comments.views.toggle_follow'),
)
| 42 | 93 | 0.464286 |
09a4876d8faaee60c05b563c48e7b9207133b300 | 2,022 | py | Python | src/engine/app.py | vxlk/stoinks | afea92824a21d203098dd41137957f2343ec363d | [
"MIT"
] | 1 | 2020-12-30T23:54:58.000Z | 2020-12-30T23:54:58.000Z | src/engine/app.py | vxlk/stoinks | afea92824a21d203098dd41137957f2343ec363d | [
"MIT"
] | null | null | null | src/engine/app.py | vxlk/stoinks | afea92824a21d203098dd41137957f2343ec363d | [
"MIT"
] | null | null | null | import sys
from threading import Thread
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from pyqtconsole.console import PythonConsole
from view.console import Console
from view.gui_dock import *
from util.logger import *
from model.engine import *
# clear logs
logger.ClearLogs()
# make Qapp
app = QApplication([])
app.setApplicationName("Stoinks Alpha")
window = QMainWindow()
console = PythonConsole()
logConsole = Console()
# stop debug console from resizing
logConsoleFrame = QScrollArea()
logConsoleFrame.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
logConsoleFrame.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
logConsoleFrame.setWidgetResizable(True)
logConsoleFrame.setWidget(logConsole)
#temp for now
gui = finance_tab_container()
consoleContainer = QDockWidget("Input")
consoleContainer.setAllowedAreas(Qt.LeftDockWidgetArea)
consoleContainer.setWidget(console)
logConsoleContainer = QDockWidget("Output")
logConsoleContainer.setAllowedAreas(Qt.RightDockWidgetArea)
logConsoleContainer.setWidget(logConsoleFrame)
guiContainer = QDockWidget("GUI View")
guiContainer.setAllowedAreas(Qt.TopDockWidgetArea)
guiContainer.setWidget(gui)
window.addDockWidget(Qt.LeftDockWidgetArea, consoleContainer)
window.addDockWidget(Qt.RightDockWidgetArea, logConsoleContainer)
window.addDockWidget(Qt.TopDockWidgetArea, guiContainer)
#console.show() add dock widget calls show on its widget i think
console.eval_in_thread() # let the input terminal go
# make an engine
engine.connectConsole(console)
engine.connectDebugConsole(logConsole)
# Force the style to be the same on all OSs:
app.setStyle("Fusion")
# Now use a palette to switch to dark colors:
palette = QPalette()
palette.setColor(QPalette.Window, QColor(53, 53, 53))
palette.setColor(QPalette.WindowText, Qt.white)
app.setPalette(palette)
window.setMinimumSize(820, 800)
window.show()
app.exec_()
# sys.exit(app.exec_())
engine.stop() | 27.69863 | 67 | 0.787834 |
09a62e7b8881c3b94a94393151fe47674d845dd0 | 845 | py | Python | Python/behavioral_patterns/command/history_command.py | ploukareas/Design-Patterns | 8effde38d73ae9058c3028c97ef395644a90d55b | [
"BSD-3-Clause",
"MIT"
] | 28 | 2018-09-28T07:45:35.000Z | 2022-02-12T12:25:05.000Z | Python/behavioral_patterns/command/history_command.py | ploukareas/Design-Patterns | 8effde38d73ae9058c3028c97ef395644a90d55b | [
"BSD-3-Clause",
"MIT"
] | null | null | null | Python/behavioral_patterns/command/history_command.py | ploukareas/Design-Patterns | 8effde38d73ae9058c3028c97ef395644a90d55b | [
"BSD-3-Clause",
"MIT"
] | 5 | 2021-05-10T23:19:55.000Z | 2022-03-04T20:26:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from behavioral_patterns.command.command import Command
#
# Holder of the past commands
#
#
| 15.089286 | 55 | 0.502959 |
09a65708ef251f13b9781f1e9b250a16f7eb5521 | 8,710 | py | Python | Agents/agent.py | TylerJamesMalloy/bullet3 | e357853815c1e0297683218273de79e586b574c8 | [
"Zlib"
] | null | null | null | Agents/agent.py | TylerJamesMalloy/bullet3 | e357853815c1e0297683218273de79e586b574c8 | [
"Zlib"
] | null | null | null | Agents/agent.py | TylerJamesMalloy/bullet3 | e357853815c1e0297683218273de79e586b574c8 | [
"Zlib"
] | null | null | null | import logging, os, time, multiprocessing, sys, signal
logging.disable(logging.WARNING)
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
import tensorflow as tf
import gym
import pybullet, pybullet_envs, pybullet_data
import numpy as np
import pandas as pd
from stable_baselines.sac.policies import MlpPolicy
from stable_baselines.clac.policies import MlpPolicy as CLAC_MlpPolicy
from stable_baselines.common.vec_env import DummyVecEnv
from stable_baselines import SAC, CLAC
#from tensorflow.python.client import device_lib
#print(device_lib.list_local_devices())
# ENVIRONMENT_NAMES Walker2DBulletEnv-v0, Robots/AntBulletEnv-v0 , HopperBulletEnv-v0 , HumanoidBulletEnv-v0, HalfCheetahBulletEnv-v0
FOLDER = "Results/InvertedDoublePendulumBulletEnv"
NUM_RESAMPLES = 50
NUM_TRAINING_STEPS = 100000
NUM_TESTING_STEPS = 50000
ENVIRONMENT_NAME = "InvertedDoublePendulumBulletEnv-v0"
if(not os.path.exists(FOLDER + '/Extreme/results')):
os.mkdir(FOLDER + '/Extreme/results')
if(not os.path.exists(FOLDER + '/Generalization/results')):
os.mkdir(FOLDER + '/Generalization/results')
if(not os.path.exists(FOLDER + '/Training/results')):
os.mkdir(FOLDER + '/Training/results')
if(not os.path.exists(FOLDER + '/Training/models')):
os.mkdir(FOLDER + '/Training/models')
CLAC_COEFS = [2.0]
SAC_COEFS = [2.0]
if __name__ == "__main__":
main()
| 46.57754 | 186 | 0.666475 |
09a9810fc20f0e86e48fafc4f5dbb9adb6c5702a | 1,274 | py | Python | ToDoApp/todo/urls.py | akmcinto/ToDoApp | 2176294c1cfc33a2e651f613f23922a2c8879a84 | [
"Apache-2.0"
] | null | null | null | ToDoApp/todo/urls.py | akmcinto/ToDoApp | 2176294c1cfc33a2e651f613f23922a2c8879a84 | [
"Apache-2.0"
] | null | null | null | ToDoApp/todo/urls.py | akmcinto/ToDoApp | 2176294c1cfc33a2e651f613f23922a2c8879a84 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2016 Andrea McIntosh
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 django.conf.urls import url, include
from . import views
app_name = 'todo'
urlpatterns = [
url(r'^$', views.index_view, name='index'),
url(r'^(?P<pk>[0-9]+)/$', views.list_details, name='detail'),
url(r'^(?P<pk>[0-9]+)/newitem/$', views.new_item, name='new_item'),
url(r'^newlist/$', views.new_list, name='new_list'),
url(r'^register/$', views.register, name='register'),
url(r'^accounts/login/$', 'django.contrib.auth.views.login', name='login'),
url(r'^accounts/logout/$', views.user_logout, name='logout'),
url(r'^accounts/viewlists/$', views.view_lists, name='viewlists'),
url(r'^accounts/', include('django.contrib.auth.urls')),
]
| 39.8125 | 79 | 0.689953 |
09a9fcdb559137e2907018a24bc26f28eb5ecd69 | 81,886 | py | Python | froi/main.py | sunshineDrizzle/FreeROI | e2bae1a19835667988e9dbe4a1a88e5b2778d819 | [
"BSD-3-Clause"
] | 13 | 2016-02-12T05:10:23.000Z | 2021-01-13T01:40:12.000Z | froi/main.py | sunshineDrizzle/FreeROI | e2bae1a19835667988e9dbe4a1a88e5b2778d819 | [
"BSD-3-Clause"
] | 14 | 2015-05-04T05:56:45.000Z | 2021-01-24T11:49:13.000Z | froi/main.py | sunshineDrizzle/FreeROI | e2bae1a19835667988e9dbe4a1a88e5b2778d819 | [
"BSD-3-Clause"
] | 8 | 2016-03-07T06:29:51.000Z | 2017-10-30T13:59:27.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Graphic User Interface."""
import sys
import os
import glob
import ConfigParser
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from version import __version__
from algorithm.imtool import label_edge_detection as vol_label_edge_detection
from algorithm.imtool import inverse_transformation
from algorithm.meshtool import label_edge_detection as surf_label_edge_detection
from core.labelconfig import LabelConfig
from utils import get_icon_dir
from widgets.listwidget import LayerView
from widgets.gridwidget import GridView
from widgets.orthwidget import OrthView
from widgets.datamodel import VolumeListModel
from widgets.drawsettings import PainterStatus, ViewSettings, MoveSettings
from widgets.binarizationdialog import VolBinarizationDialog, SurfBinarizationDialog
from widgets.intersectdialog import VolIntersectDialog, SurfIntersectDialog
from widgets.localmaxdialog import LocalMaxDialog
from widgets.no_gui_tools import gen_label_color
from widgets.smoothingdialog import SmoothingDialog
from widgets.growdialog import GrowDialog, VolumeRGDialog
from widgets.watersheddialog import WatershedDialog
from widgets.slicdialog import SLICDialog
from widgets.clusterdialog import SurfClusterDialog, VolClusterDialog
from widgets.regularroidialog import RegularROIDialog
from widgets.regularroifromcsvfiledialog import RegularROIFromCSVFileDialog
from widgets.roi2gwmidialog import Roi2gwmiDialog
from widgets.roimergedialog import ROIMergeDialog
from widgets.opendialog import OpenDialog
from widgets.labelmanagedialog import LabelManageDialog
from widgets.labelconfigcenter import LabelConfigCenter
from widgets.roidialog import VolROIDialog, SurfROIDialog
from widgets.atlasdialog import AtlasDialog
from widgets.binaryerosiondialog import VolBinErosionDialog, SurfBinErosionDialog
from widgets.binarydilationdialog import VolBinDilationDialog, SurfBinDilationDialog
from widgets.greydilationdialog import GreydilationDialog
from widgets.greyerosiondialog import GreyerosionDialog
from widgets.meants import MeanTSDialog
from widgets.voxelstatsdialog import VoxelStatsDialog
from widgets.registervolume import RegisterVolumeDialog
from widgets.treemodel import TreeModel
from widgets.surfacetreewidget import SurfaceTreeView
from widgets.surfaceview import SurfaceView
from widgets.scribingdialog import ScribingDialog
from widgets.surfaceRGdialog import SurfaceRGDialog
from widgets.prob_map_dialog import SurfProbMapDialog
from widgets.concatenate_dialog import SurfConcatenateDialog
| 46.97992 | 120 | 0.591078 |
09aba896248f30069fcb0a73d80efae7ce718e1a | 975 | py | Python | class1/exercise6&7.py | linkdebian/pynet_course | e0de498078ab914b3535fa2ea5c2e71d6e3799fb | [
"Apache-2.0"
] | null | null | null | class1/exercise6&7.py | linkdebian/pynet_course | e0de498078ab914b3535fa2ea5c2e71d6e3799fb | [
"Apache-2.0"
] | null | null | null | class1/exercise6&7.py | linkdebian/pynet_course | e0de498078ab914b3535fa2ea5c2e71d6e3799fb | [
"Apache-2.0"
] | null | null | null | import yaml
import json
from pprint import pprint as pp
my_list = []
while True:
x = raw_input("Enter num or text to add to list or press enter to finish: ")
if not x: break
my_list.append(x)
my_list.append({})
while True:
y = raw_input("Enter the name of the key in the list or press enter to finish: ")
z = raw_input("Enter the value of the key or press enter to finish: ")
if not y: break
if not z: break
my_list[-1][y] = z
print "----------------------------------"
print "Importing this list to YAML format"
print "----------------------------------"
with open ("computer_details.yml", "w") as f:
f.write(yaml.dump(my_list, default_flow_style=False))
print yaml.dump(my_list, default_flow_style=False)
print "----------------------------------"
print "Importing this list to JSON format"
print "----------------------------------"
with open("computer_details.json", "w") as f:
json.dump(my_list, f)
pp(my_list)
| 20.744681 | 85 | 0.58359 |
09abc457e5bd1caa1d8046d6ee92bbfdae5edefe | 1,475 | py | Python | backend/naki/naki/model/digital_item.py | iimcz/emod | 432094c020247597a94e95f76cc524c20b68b685 | [
"MIT"
] | null | null | null | backend/naki/naki/model/digital_item.py | iimcz/emod | 432094c020247597a94e95f76cc524c20b68b685 | [
"MIT"
] | 6 | 2021-03-08T23:32:15.000Z | 2022-02-26T08:11:38.000Z | backend/naki/naki/model/digital_item.py | iimcz/emod | 432094c020247597a94e95f76cc524c20b68b685 | [
"MIT"
] | null | null | null | import colander
from sqlalchemy import Column, ForeignKey
from sqlalchemy.types import DateTime, Integer, Unicode, UnicodeText
from naki.model.meta import Base
| 34.302326 | 110 | 0.602034 |
09ae724cdc803309af6a236723605a5ad5b9d098 | 4,389 | py | Python | z3/labeled_dice.py | Wikunia/hakank | 030bc928d2efe8dcbc5118bda3f8ae9575d0fd13 | [
"MIT"
] | 279 | 2015-01-10T09:55:35.000Z | 2022-03-28T02:34:03.000Z | z3/labeled_dice.py | Wikunia/hakank | 030bc928d2efe8dcbc5118bda3f8ae9575d0fd13 | [
"MIT"
] | 10 | 2017-10-05T15:48:50.000Z | 2021-09-20T12:06:52.000Z | z3/labeled_dice.py | Wikunia/hakank | 030bc928d2efe8dcbc5118bda3f8ae9575d0fd13 | [
"MIT"
] | 83 | 2015-01-20T03:44:00.000Z | 2022-03-13T23:53:06.000Z | #!/usr/bin/python -u
# -*- coding: latin-1 -*-
#
# Labeled dice and Building block problems in Z3
#
# * Labeled dice
#
# From Jim Orlin 'Colored letters, labeled dice: a logic puzzle'
# http://jimorlin.wordpress.com/2009/02/17/colored-letters-labeled-dice-a-logic-puzzle/
# '''
# My daughter Jenn bough a puzzle book, and showed me a cute puzzle. There
# are 13 words as follows: BUOY, CAVE, CELT, FLUB, FORK, HEMP, JUDY,
# JUNK, LIMN, QUIP, SWAG, VISA, WISH.
#
# There are 24 different letters that appear in the 13 words. The question
# is: can one assign the 24 letters to 4 different cubes so that the
# four letters of each word appears on different cubes. (There is one
# letter from each word on each cube.) It might be fun for you to try
# it. I'll give a small hint at the end of this post. The puzzle was
# created by Humphrey Dudley.
# '''
#
# Also, see Jim Orlin's followup 'Update on Logic Puzzle':
# http://jimorlin.wordpress.com/2009/02/21/update-on-logic-puzzle/
#
#
# * Building Blocks puzzle (Dell Logic Puzzles) in MiniZinc.
#
# From http://brownbuffalo.sourceforge.net/BuildingBlocksClues.html
# """
# Each of four alphabet blocks has a single letter of the alphabet on each
# of its six sides. In all, the four blocks contain every letter but
# Q and Z. By arranging the blocks in various ways, you can spell all of
# the words listed below. Can you figure out how the letters are arranged
# on the four blocks?
#
# BAKE ONYX ECHO OVAL
#
# GIRD SMUG JUMP TORN
#
# LUCK VINY LUSH WRAP
# """
#
# This Z3 model was written by Hakan Kjellerstrand (hakank@gmail.com)
# See also my Z3 page: http://hakank.org/z3/
#
#
from __future__ import print_function
from z3_utils_hakank import *
if __name__ == "__main__":
labeled_dice()
print("\n\n\n")
building_blocks()
| 26.281437 | 99 | 0.549784 |
09af767430017771c3139a9ce09339ca19b87b16 | 2,741 | py | Python | samples/flat_sample/test.py | benlindsay/job_tree | 0cdb293fd166d8d1cd50e54ab090264029adf978 | [
"MIT"
] | null | null | null | samples/flat_sample/test.py | benlindsay/job_tree | 0cdb293fd166d8d1cd50e54ab090264029adf978 | [
"MIT"
] | null | null | null | samples/flat_sample/test.py | benlindsay/job_tree | 0cdb293fd166d8d1cd50e54ab090264029adf978 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Ben Lindsay <benjlindsay@gmail.com>
from job_tree import job_tree
# Tier 1 is 3 values of VAR_1 (1, 2, and 3) found in 'tier_1.csv'
tier_1_csv_file = 'tier_1.csv'
# Tier 2 is 2 values of VAR_2 for each VAR_1, defined as a function of VAR_1
# Tier 3 is 2 values of VAR_3 (100 and 200) defined in a python dictionary
tier_3_dict = {'VAR_3': [100,200]}
tier_list = [ tier_1_csv_file, tier_2_func, tier_3_dict ]
job_file_list = ['params.input', 'sub.sh']
# Generate a flat job tree submit the jobs.
# Add 'submit = False' to prevent submission.
job_tree(job_file_list, tier_list)
# Running this script should generate a directory tree that looks like this:
# ~ $ tree
# .
# |-- 1-1-100
# | |-- 1-1-100.e3654633
# | |-- 1-1-100.o3654633
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 1-1-200
# | |-- 1-1-200.e3654634
# | |-- 1-1-200.o3654634
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 1-2-100
# | |-- 1-2-100.e3654635
# | |-- 1-2-100.o3654635
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 1-2-200
# | |-- 1-2-200.e3654636
# | |-- 1-2-200.o3654636
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 2-2-100
# | |-- 2-2-100.e3654637
# | |-- 2-2-100.o3654637
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 2-2-200
# | |-- 2-2-200.e3654638
# | |-- 2-2-200.o3654638
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 2-3-100
# | |-- 2-3-100.e3654639
# | |-- 2-3-100.o3654639
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 2-3-200
# | |-- 2-3-200.e3654640
# | |-- 2-3-200.o3654640
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 3-3-100
# | |-- 3-3-100.e3654641
# | |-- 3-3-100.o3654641
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 3-3-200
# | |-- 3-3-200.e3654642
# | |-- 3-3-200.o3654642
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 3-4-100
# | |-- 3-4-100.e3654643
# | |-- 3-4-100.o3654643
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- 3-4-200
# | |-- 3-4-200.e3654644
# | |-- 3-4-200.o3654644
# | |-- files.log
# | |-- params.input
# | `-- sub.sh
# |-- job_tree.py
# |-- job_tree.pyc
# |-- params.input
# |-- sub.sh
# |-- test.py
# `-- tier_1.csv
# Where the {VAR_1}, {VAR_2}, and {VAR_3} in each params.input file is replaced
# with the corresponding variables. {JOB_NAME} is replaced by
# hyphen-separated string representing the directory tree in which it resides
| 24.256637 | 79 | 0.549435 |
09b071406342703275a6a5f8df9c8ce73299146c | 1,602 | py | Python | scripts/ai/mle/test_ai.py | AlexGustafsson/word-frequencies | 21a73dc1e56770f5563f928b7e3943874c995bd9 | [
"Unlicense"
] | null | null | null | scripts/ai/mle/test_ai.py | AlexGustafsson/word-frequencies | 21a73dc1e56770f5563f928b7e3943874c995bd9 | [
"Unlicense"
] | null | null | null | scripts/ai/mle/test_ai.py | AlexGustafsson/word-frequencies | 21a73dc1e56770f5563f928b7e3943874c995bd9 | [
"Unlicense"
] | null | null | null | import pickle
import random
from argparse import ArgumentParser
# Requires NLTK to be installed:
# python3 -m pip install nltk
# python3 -c 'import nltk;nltk.download("punkt")'
# May be slow at first start due to NLTK preparing its dependencies
from nltk.tokenize.treebank import TreebankWordDetokenizer
from nltk.lm import MLE
detokenize = TreebankWordDetokenizer().detokenize
def main() -> None:
"""Main entrypoint."""
# Create an argument parser for parsing CLI arguments
parser = ArgumentParser(description="A tool to train an AI to predict the probability of a word in a sentence")
# Add parameters for the server connection
parser.add_argument("-i", "--input", required=True, type=str, help="The serialized model previously trained")
parser.add_argument("-w", "--word", required=True, type=str, help="The word to check the probability for")
parser.add_argument("-c", "--context", required=True, type=str, help="The context / sentence for the word")
# Parse the arguments
options = parser.parse_args()
model = None
with open(options.input, "rb") as file:
model = pickle.load(file)
print(model.logscore(options.word, options.context.split()))
print(generate_sentence(model, 10))
if __name__ == '__main__':
main()
| 32.693878 | 115 | 0.692884 |
09b38cadc8a5b66d765f9f62596709fa7325c773 | 7,529 | py | Python | lib/common/render_utils.py | YuliangXiu/ICON | ece5a09aa2d56aec28017430e65a0352622a0f30 | [
"Intel"
] | 486 | 2021-12-16T03:13:31.000Z | 2022-03-30T04:26:48.000Z | lib/common/render_utils.py | YuliangXiu/ICON | ece5a09aa2d56aec28017430e65a0352622a0f30 | [
"Intel"
] | 33 | 2021-12-30T07:28:10.000Z | 2022-03-30T08:04:06.000Z | lib/common/render_utils.py | YuliangXiu/ICON | ece5a09aa2d56aec28017430e65a0352622a0f30 | [
"Intel"
] | 38 | 2021-12-17T10:55:01.000Z | 2022-03-30T23:25:39.000Z |
# -*- coding: utf-8 -*-
# Max-Planck-Gesellschaft zur Frderung der Wissenschaften e.V. (MPG) is
# holder of all proprietary rights on this computer program.
# You can only use this computer program if you have closed
# a license agreement with MPG or you get the right to use the computer
# program from someone who is authorized to grant you that right.
# Any use of the computer program without a valid license is prohibited and
# liable to prosecution.
#
# Copyright2019 Max-Planck-Gesellschaft zur Frderung
# der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute
# for Intelligent Systems. All rights reserved.
#
# Contact: ps-license@tuebingen.mpg.de
import torch
from torch import nn
import trimesh
import math
from typing import NewType
from pytorch3d.structures import Meshes
from pytorch3d.renderer.mesh import rasterize_meshes
Tensor = NewType('Tensor', torch.Tensor)
def solid_angles(points: Tensor,
triangles: Tensor,
thresh: float = 1e-8) -> Tensor:
''' Compute solid angle between the input points and triangles
Follows the method described in:
The Solid Angle of a Plane Triangle
A. VAN OOSTEROM AND J. STRACKEE
IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING,
VOL. BME-30, NO. 2, FEBRUARY 1983
Parameters
-----------
points: BxQx3
Tensor of input query points
triangles: BxFx3x3
Target triangles
thresh: float
float threshold
Returns
-------
solid_angles: BxQxF
A tensor containing the solid angle between all query points
and input triangles
'''
# Center the triangles on the query points. Size should be BxQxFx3x3
centered_tris = triangles[:, None] - points[:, :, None, None]
# BxQxFx3
norms = torch.norm(centered_tris, dim=-1)
# Should be BxQxFx3
cross_prod = torch.cross(centered_tris[:, :, :, 1],
centered_tris[:, :, :, 2],
dim=-1)
# Should be BxQxF
numerator = (centered_tris[:, :, :, 0] * cross_prod).sum(dim=-1)
del cross_prod
dot01 = (centered_tris[:, :, :, 0] * centered_tris[:, :, :, 1]).sum(dim=-1)
dot12 = (centered_tris[:, :, :, 1] * centered_tris[:, :, :, 2]).sum(dim=-1)
dot02 = (centered_tris[:, :, :, 0] * centered_tris[:, :, :, 2]).sum(dim=-1)
del centered_tris
denominator = (norms.prod(dim=-1) + dot01 * norms[:, :, :, 2] +
dot02 * norms[:, :, :, 1] + dot12 * norms[:, :, :, 0])
del dot01, dot12, dot02, norms
# Should be BxQ
solid_angle = torch.atan2(numerator, denominator)
del numerator, denominator
torch.cuda.empty_cache()
return 2 * solid_angle
def winding_numbers(points: Tensor,
triangles: Tensor,
thresh: float = 1e-8) -> Tensor:
''' Uses winding_numbers to compute inside/outside
Robust inside-outside segmentation using generalized winding numbers
Alec Jacobson,
Ladislav Kavan,
Olga Sorkine-Hornung
Fast Winding Numbers for Soups and Clouds SIGGRAPH 2018
Gavin Barill
NEIL G. Dickson
Ryan Schmidt
David I.W. Levin
and Alec Jacobson
Parameters
-----------
points: BxQx3
Tensor of input query points
triangles: BxFx3x3
Target triangles
thresh: float
float threshold
Returns
-------
winding_numbers: BxQ
A tensor containing the Generalized winding numbers
'''
# The generalized winding number is the sum of solid angles of the point
# with respect to all triangles.
return 1 / (4 * math.pi) * solid_angles(points, triangles,
thresh=thresh).sum(dim=-1)
def face_vertices(vertices, faces):
"""
:param vertices: [batch size, number of vertices, 3]
:param faces: [batch size, number of faces, 3]
:return: [batch size, number of faces, 3, 3]
"""
bs, nv = vertices.shape[:2]
bs, nf = faces.shape[:2]
device = vertices.device
faces = faces + (torch.arange(bs, dtype=torch.int32).to(device) *
nv)[:, None, None]
vertices = vertices.reshape((bs * nv, vertices.shape[-1]))
return vertices[faces.long()]
| 33.914414 | 79 | 0.592376 |
09b41443c1ba334ee6ad9dc77418ea29db20354e | 456 | py | Python | merge_string.py | mrillusi0n/compete | ac798e2b1ff27abddd8bebf113d079228f038e56 | [
"MIT"
] | null | null | null | merge_string.py | mrillusi0n/compete | ac798e2b1ff27abddd8bebf113d079228f038e56 | [
"MIT"
] | null | null | null | merge_string.py | mrillusi0n/compete | ac798e2b1ff27abddd8bebf113d079228f038e56 | [
"MIT"
] | null | null | null | ######################### AABCAAADA
from collections import OrderedDict
def remove_duplicates(block):
"""
>>> remove_duplicates('AAB')
>>> 'AB'
"""
freq = OrderedDict()
for c in block:
freq[c] = freq.get(c, 0) + 1
return ''.join(freq.keys())
print(solve('AABCAAADA', 3))
| 18.24 | 65 | 0.58114 |
09b4cd6f2d42318aef248c6850aeea38ce8781bf | 335 | py | Python | src/art_of_geom/_util/_tmp.py | Mathverse/Art-of-Geometry | 8fd89fd3526f871815c38953580a48b017d39847 | [
"MIT"
] | 1 | 2021-12-25T01:16:10.000Z | 2021-12-25T01:16:10.000Z | src/art_of_geom/_util/_tmp.py | Mathverse/Art-of-Geometry | 8fd89fd3526f871815c38953580a48b017d39847 | [
"MIT"
] | null | null | null | src/art_of_geom/_util/_tmp.py | Mathverse/Art-of-Geometry | 8fd89fd3526f871815c38953580a48b017d39847 | [
"MIT"
] | null | null | null | __all__ = 'TMP_NAME_FACTORY', 'tmp_file_name', 'str_uuid'
import os
from tempfile import NamedTemporaryFile
from uuid import uuid4
TMP_NAME_FACTORY = tmp_file_name
| 17.631579 | 57 | 0.755224 |
09b5a2bb038f2cac57634bfef33f5cb085b77a89 | 48 | py | Python | tests/__init__.py | jebabi/controllerx | bc68cdd69e416880e6394b3ecf92522b3871e959 | [
"MIT"
] | 1 | 2020-02-28T17:26:36.000Z | 2020-02-28T17:26:36.000Z | tests/__init__.py | jebabi/controllerx | bc68cdd69e416880e6394b3ecf92522b3871e959 | [
"MIT"
] | null | null | null | tests/__init__.py | jebabi/controllerx | bc68cdd69e416880e6394b3ecf92522b3871e959 | [
"MIT"
] | null | null | null | import sys
sys.path.append("apps/controllerx")
| 12 | 35 | 0.770833 |
09b5d250f780316cd9c06c021e66be29bc76a8ed | 884 | py | Python | tests/views/test_is_component_field_model_or_unicorn_field.py | nerdoc/django-unicorn | e512b8f64f5c276a78127db9a05d9d5c042232d5 | [
"MIT"
] | 1 | 2021-12-21T16:20:49.000Z | 2021-12-21T16:20:49.000Z | tests/views/test_is_component_field_model_or_unicorn_field.py | teury/django-unicorn | 5e9142b8a7e13b862ece419d567e805cc783b517 | [
"MIT"
] | null | null | null | tests/views/test_is_component_field_model_or_unicorn_field.py | teury/django-unicorn | 5e9142b8a7e13b862ece419d567e805cc783b517 | [
"MIT"
] | 1 | 2022-02-10T07:47:01.000Z | 2022-02-10T07:47:01.000Z | from django_unicorn.components import UnicornView
from django_unicorn.views.utils import _is_component_field_model_or_unicorn_field
from example.coffee.models import Flavor
def test_type_hint():
component = TypeHintView(component_name="asdf", component_id="hjkl")
name = "model"
actual = _is_component_field_model_or_unicorn_field(component, name)
assert actual
assert component.model is not None
assert type(component.model) == Flavor
def test_model_instance():
component = ModelInstanceView(component_name="asdf", component_id="hjkl")
name = "model"
actual = _is_component_field_model_or_unicorn_field(component, name)
assert actual
assert component.model is not None
assert type(component.model) == Flavor
| 27.625 | 81 | 0.7681 |
09bb144937911126f0899a4f90a8ca7646246b73 | 431 | py | Python | data_wrangling/data_manipulation/check_if_even.py | dkedar7/Notes | 08a9e710a774fd46ec525e0041c1cbd67fbe6c20 | [
"MIT"
] | 3 | 2021-05-28T09:00:56.000Z | 2021-12-21T01:12:20.000Z | data_wrangling/data_manipulation/check_if_even.py | dkedar7/Notes | 08a9e710a774fd46ec525e0041c1cbd67fbe6c20 | [
"MIT"
] | null | null | null | data_wrangling/data_manipulation/check_if_even.py | dkedar7/Notes | 08a9e710a774fd46ec525e0041c1cbd67fbe6c20 | [
"MIT"
] | null | null | null |
import pytest
testdata = [
(2, True),
(3, False),
(4, True),
(5, True) # We expect this test to fail
]
def check_if_even(a):
"""
Returns True if 'a' is an even number
"""
return a % 2 == 0
| 17.958333 | 61 | 0.612529 |
09bf7c1ce0c20840d83284f246ccdbf099539181 | 4,970 | py | Python | intvalpy/linear/system_properties.py | SShary/intvalpy | 42f4c8f6b23e6481f4032b0a0f7cc0d798fda3be | [
"MIT"
] | null | null | null | intvalpy/linear/system_properties.py | SShary/intvalpy | 42f4c8f6b23e6481f4032b0a0f7cc0d798fda3be | [
"MIT"
] | null | null | null | intvalpy/linear/system_properties.py | SShary/intvalpy | 42f4c8f6b23e6481f4032b0a0f7cc0d798fda3be | [
"MIT"
] | null | null | null | import numpy as np
from scipy.optimize import minimize
from intvalpy.MyClass import Interval
from intvalpy.intoper import zeros
def Uni(A, b, x=None, maxQ=False, x0=None, tol=1e-12, maxiter=1e3):
"""
Uni.
, maxQ=True .
Parameters:
A: Interval
.
b: Interval
.
Optional Parameters:
x: float, array_like
.
x .
maxQ: bool
True,
.
x0: float, array_like
.
tol: float
.
maxiter: int
.
Returns:
out: float, tuple
x.
, maxQ=True, ,
-- ,
-- ,
-- .
"""
__uni = lambda x: min(b.rad - (b.mid - A @ x).mig)
__minus_uni = lambda x: -__uni(x)
if maxQ==False:
if x is None:
x = np.zeros(A.shape[1])
return __uni(x)
else:
from scipy.optimize import minimize
if x0 is None:
x0 = np.zeros(A.shape[1])+1
maximize = minimize(__minus_uni, x0, method='Nelder-Mead', tol=tol,
options={'maxiter': maxiter})
return maximize.success, maximize.x, -maximize.fun
def Tol(A, b, x=None, maxQ=False, x0=None, tol=1e-12, maxiter=1e3):
"""
Tol.
, maxQ=True .
Parameters:
A: Interval
.
b: Interval
.
Optional Parameters:
x: float, array_like
.
x .
maxQ: bool
True,
.
x0: float, array_like
.
tol: float
.
maxiter: int
.
Returns:
out: float, tuple
x.
, maxQ=True, ,
-- ,
-- ,
-- .
"""
__tol = lambda x: min(b.rad - abs(b.mid - A @ x))
__minus_tol = lambda x: -__tol(x)
if maxQ==False:
if x is None:
x = np.zeros(A.shape[1])
return __tol(x)
else:
from scipy.optimize import minimize
if x0 is None:
x0 = np.zeros(A.shape[1])+1
maximize = minimize(__minus_tol, x0, method='Nelder-Mead', tol=tol,
options={'maxiter': maxiter})
return maximize.success, maximize.x, -maximize.fun
def ive(A, b, N=40):
"""
.
Parameters:
A: Interval
.
b: Interval
.
Optional Parameters:
N: int
.
Returns:
out: float
IVE.
"""
success, _arg_max, _max = Tol(A, b, maxQ=True)
if not success:
print(' Tol !')
_inf = A.a
_sup = A.b
cond = float('inf')
angle_A = np.zeros(A.shape, dtype='float64')
for _ in range(N):
for k in range(A.shape[0]):
for l in range(A.shape[1]):
angle_A[k, l] = np.random.choice([_inf[k,l], _sup[k,l]])
tmp = np.linalg.cond(angle_A)
cond = tmp if tmp<cond else cond
return np.sqrt(A.shape[1]) * _max * cond * \
(np.linalg.norm(_arg_max, ord=2)/np.sqrt(sum(abs(b)**2)))
| 31.257862 | 86 | 0.547485 |
09bffb272321cfeba42574b90d3f77c2507d62be | 3,648 | py | Python | libcity/utils/GPS_utils.py | moghadas76/test_bigcity | 607b9602c5b1113b23e1830455e174b0901d7558 | [
"Apache-2.0"
] | 221 | 2021-09-06T03:33:31.000Z | 2022-03-28T05:36:49.000Z | libcity/utils/GPS_utils.py | moghadas76/test_bigcity | 607b9602c5b1113b23e1830455e174b0901d7558 | [
"Apache-2.0"
] | 43 | 2021-09-19T16:12:28.000Z | 2022-03-31T16:29:03.000Z | libcity/utils/GPS_utils.py | moghadas76/test_bigcity | 607b9602c5b1113b23e1830455e174b0901d7558 | [
"Apache-2.0"
] | 64 | 2021-09-06T07:56:10.000Z | 2022-03-25T08:48:35.000Z | import math
R_EARTH = 6371000 # meter
def angle2radian(angle):
"""
convert from an angle to a radian
:param angle: (float)
:return: radian (float)
"""
return math.radians(angle)
def spherical_law_of_cosines(phi1, lambda1, phi2, lambda2):
"""
calculate great circle distance with spherical law of cosines
phi/lambda for latitude/longitude in radians
:param phi1: point one's latitude in radians
:param lambda1: point one's longitude in radians
:param phi2: point two's latitude in radians
:param lambda2: point two's longitude in radians
:return:
"""
d_lambda = lambda2 - lambda1
return math.acos(math.sin(phi1) * math.sin(phi2) + math.cos(phi1) * math.cos(phi2) * math.cos(d_lambda))
def haversine(phi1, lambda1, phi2, lambda2):
"""
calculate angular great circle distance with haversine formula
see parameters in spherical_law_of_cosines
"""
d_phi = phi2 - phi1
d_lambda = lambda2 - lambda1
a = math.pow(math.sin(d_phi / 2), 2) + \
math.cos(phi1) * math.cos(phi2) * math.pow(math.sin(d_lambda / 2), 2)
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a))
return c
def equirectangular_approximation(phi1, lambda1, phi2, lambda2):
"""
calculate angular great circle distance with Pythagoras theorem performed on an equirectangular projection
see parameters in spherical_law_of_cosines
"""
x = (lambda2 - lambda1) * math.cos((phi1 + phi2) / 2)
y = phi2 - phi1
return math.sqrt(math.pow(x, 2) + math.pow(y, 2))
def dist(phi1, lambda1, phi2, lambda2, r=R_EARTH, method='hav'):
"""
calculate great circle distance with given latitude and longitude,
:param phi1: point one's latitude in angle
:param lambda1: point one's longitude in angle
:param phi2: point two's latitude in angle
:param lambda2: point two's longitude in angle
:param r: earth radius(m)
:param method: 'hav' means haversine,
'LoC' means Spherical Law of Cosines,
'approx' means Pythagoras theorem performed on an equirectangular projection
:return: distance (m)
"""
return angular_dist(phi1, lambda1, phi2, lambda2, method) * r
def angular_dist(phi1, lambda1, phi2, lambda2, method='hav'):
"""
calculate angular great circle distance with given latitude and longitude
:return: angle
"""
if method.lower() == 'hav':
return haversine(phi1, lambda1, phi2, lambda2)
elif method.lower() == 'loc':
return spherical_law_of_cosines(phi1, lambda1, phi2, lambda2)
elif method.lower() == 'approx':
return equirectangular_approximation(phi1, lambda1, phi2, lambda2)
else:
assert False
def destination(phi1, lambda1, brng, distance, r=R_EARTH):
"""
:param phi1:
:param lambda1:
:param brng:
:param distance:
:return:
"""
delta = distance / r
phi2 = math.asin(math.sin(phi1) * math.cos(delta) + math.cos(phi1) * math.sin(delta) * math.cos(brng))
lambda2 = lambda1 + math.atan2(
math.sin(brng) * math.sin(delta) * math.cos(phi1), math.cos(delta) - math.sin(phi1) * math.sin(phi2)
)
return phi2, lambda2
def init_bearing(phi1, lambda1, phi2, lambda2):
"""
initial bearing of a great circle route
:return: 0~360
"""
y = math.sin(lambda2 - lambda1) * math.cos(phi2)
x = math.cos(phi1) * math.sin(phi2) - math.sin(phi1) * math.cos(phi2) * math.cos(lambda2 - lambda1)
theta = math.atan2(y, x)
brng = (theta * 180 / math.pi + 360) % 360
return brng | 32.283186 | 111 | 0.654331 |
09c01d1c28ae990e8cd5cd83a9d33b741fa6c805 | 1,154 | py | Python | python/docstring/__init__.py | liguohao96/template | 31648c4334bdce50cadcfc707c5f64c483e1abce | [
"MIT"
] | null | null | null | python/docstring/__init__.py | liguohao96/template | 31648c4334bdce50cadcfc707c5f64c483e1abce | [
"MIT"
] | null | null | null | python/docstring/__init__.py | liguohao96/template | 31648c4334bdce50cadcfc707c5f64c483e1abce | [
"MIT"
] | null | null | null | """
Python Template for docstring
-----------------------------
python.docstring is a package cotaining TEMPLATE for docstring in python.
usage:
>>> from python import docstring
>>> help(docstring)
>>> print(docstring.module_.__doc__)
>>> print(docstring.class_.__doc__)
>>> print(docstring.method_.__doc__)
"""
import importlib
import os
spec = importlib.util.spec_from_file_location(
'.'.join([__name__, 'module']), os.path.join(os.path.dirname(__file__), 'module.py'))
module_ = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module_)
spec = importlib.util.spec_from_file_location(
'method', os.path.join(os.path.dirname(__file__), 'method.py'))
method_ = importlib.util.module_from_spec(spec)
spec.loader.exec_module(method_)
method_ = method_.template_method
method_.__module__ = __name__
spec = importlib.util.spec_from_file_location(
'class', os.path.join(os.path.dirname(__file__), 'class.py'))
class_ = importlib.util.module_from_spec(spec)
spec.loader.exec_module(class_)
class_ = class_.TemplateClass
class_.__module__ = __name__
del spec, os, importlib
| 31.189189 | 90 | 0.714905 |
09c0c79a0b5cfaa45266d9d9675a6a0f9435dae8 | 6,234 | py | Python | orwell/agent/main.py | dchilot/agent-server-game-python | ce8db9560047a06960343cc66a9eddb11e77f5a1 | [
"BSD-3-Clause"
] | null | null | null | orwell/agent/main.py | dchilot/agent-server-game-python | ce8db9560047a06960343cc66a9eddb11e77f5a1 | [
"BSD-3-Clause"
] | null | null | null | orwell/agent/main.py | dchilot/agent-server-game-python | ce8db9560047a06960343cc66a9eddb11e77f5a1 | [
"BSD-3-Clause"
] | null | null | null | import logging
import sys
import socket
from cliff.app import App
from cliff.command import Command
from cliff.commandmanager import CommandManager
def main(argv=sys.argv[1:]):
myapp = AgentApp()
return myapp.run(argv)
if ("__main__" == __name__):
sys.exit(main(sys.argv[1:])) # pragma: no coverage
| 26.193277 | 76 | 0.611806 |
09c1b09e1644ac2346f010a7494eb66da023d9f8 | 88 | py | Python | yad2/encoders/__init__.py | odcinek/yad2 | 5ecf5073a7eb9651944837e33c083c4a1e7945bc | [
"MIT"
] | null | null | null | yad2/encoders/__init__.py | odcinek/yad2 | 5ecf5073a7eb9651944837e33c083c4a1e7945bc | [
"MIT"
] | null | null | null | yad2/encoders/__init__.py | odcinek/yad2 | 5ecf5073a7eb9651944837e33c083c4a1e7945bc | [
"MIT"
] | 1 | 2021-10-17T15:46:50.000Z | 2021-10-17T15:46:50.000Z | from format2 import Format2
from format40 import Format40
from format80 import Format80
| 22 | 29 | 0.863636 |
09c1d29d541d96d593332dafbd24a6cf449f04ba | 20,705 | py | Python | bin/scripts/findsnps_refalt.py | smozaffari/ASE | ad0013daf8505227d1818ba8f9e4ea6cc1fd0f4b | [
"Apache-2.0"
] | null | null | null | bin/scripts/findsnps_refalt.py | smozaffari/ASE | ad0013daf8505227d1818ba8f9e4ea6cc1fd0f4b | [
"Apache-2.0"
] | null | null | null | bin/scripts/findsnps_refalt.py | smozaffari/ASE | ad0013daf8505227d1818ba8f9e4ea6cc1fd0f4b | [
"Apache-2.0"
] | 1 | 2016-01-26T07:15:50.000Z | 2016-01-26T07:15:50.000Z |
import sys
import os
import gzip
import argparse
import numpy as np
import pysam
import util
import snptable
import tables
MAX_SEQS_DEFAULT = 64
MAX_SNPS_DEFAULT = 6
def parse_options():
parser = argparse.ArgumentParser(description="Looks for SNPs and indels "
"overlapping reads. If a read overlaps "
"SNPs, alternative versions of the read "
"containing different alleles are created "
"and written to files for remapping. "
"Reads that do not overlap SNPs or indels "
"are written to a 'keep' BAM file."
"Reads that overlap indels are presently "
"discarded.")
parser.add_argument("--is_paired_end", "-p", action='store_true',
dest='is_paired_end',
default=False,
help=("Indicates that reads are paired-end "
"(default is single)."))
parser.add_argument("--is_sorted", "-s", action='store_true',
dest='is_sorted',
default=False,
help=('Indicates that the input BAM file'
' is coordinate-sorted (default '
'is False).'))
parser.add_argument("--max_seqs", type=int, default=MAX_SEQS_DEFAULT,
help="The maximum number of sequences with different "
"allelic combinations to consider remapping "
"(default=%d). Read pairs with more allelic "
"combinations than MAX_SEQs are discarded" %
MAX_SEQS_DEFAULT)
parser.add_argument("--max_snps", type=int, default=MAX_SNPS_DEFAULT,
help="The maximum number of SNPs allowed to overlap "
"a read before discarding the read. Allowing higher "
"numbers will decrease speed and increase memory "
"usage (default=%d)."
% MAX_SNPS_DEFAULT)
parser.add_argument("--output_dir", default=None,
help="Directory to write output files to. If not "
"specified, output files are written to the "
"same directory as the input BAM file.")
parser.add_argument("--snp_dir", action='store',
help="Directory containing SNP text files "
"This directory should contain one file per "
"chromosome named like chr<#>.snps.txt.gz. "
"Each file should contain 3 columns: position "
"RefAllele AltAllele. This option should "
"only be used if --snp_tab, --snp_index, "
"and --haplotype arguments are not used."
" If this argument is provided, all possible "
"allelic combinations are used (rather "
"than set of observed haplotypes).",
default=None)
parser.add_argument("--snp_tab",
help="Path to HDF5 file to read SNP information "
"from. Each row of SNP table contains SNP name "
"(rs_id), position, allele1, allele2.",
metavar="SNP_TABLE_H5_FILE",
default=None)
parser.add_argument("--snp_index",
help="Path to HDF5 file containing SNP index. The "
"SNP index is used to convert the genomic position "
"of a SNP to its corresponding row in the haplotype "
"and snp_tab HDF5 files.",
metavar="SNP_INDEX_H5_FILE",
default=None)
parser.add_argument("--haplotype",
help="Path to HDF5 file to read phased haplotypes "
"from. When generating alternative reads "
"use known haplotypes from this file rather "
"than all possible allelic combinations.",
metavar="HAPLOTYPE_H5_FILE",
default=None)
parser.add_argument("--samples",
help="Use only haplotypes and SNPs that are "
"polymorphic in these samples. "
"SAMPLES can either be a comma-delimited string "
"of sample names or a path to a file with one sample "
"name per line (file is assumed to be whitespace-"
"delimited and first column is assumed to be sample "
"name). Sample names should match those present in the "
"--haplotype file. Samples are ignored if no haplotype "
"file is provided.",
metavar="SAMPLES")
parser.add_argument("bam_filename", action='store',
help="Coordinate-sorted input BAM file "
"containing mapped reads.")
options = parser.parse_args()
if options.snp_dir:
if(options.snp_tab or options.snp_index or options.haplotype):
parser.error("expected --snp_dir OR (--snp_tab, --snp_index and "
"--haplotype) arguments but not both")
else:
if not (options.snp_tab and options.snp_index and options.haplotype):
parser.error("either --snp_dir OR (--snp_tab, "
"--snp_index AND --haplotype) arguments must be "
"provided")
if options.samples and not options.haplotype:
# warn because no way to use samples if haplotype file not specified
sys.stderr.write("WARNING: ignoring --samples argument "
"because --haplotype argument not provided")
return options
def count_ref_alt_matches(read, read_stats, snp_tab, snp_idx, read_pos, files, cur_chrom):
pat_alleles = snp_tab.snp_allele1[snp_idx]
mat_alleles = snp_tab.snp_allele2[snp_idx]
#if all SNPs in the read are equal th entire read will go to homozgyous count
if np.array_equal(mat_alleles, pat_alleles):
read_stats.hom_count +=1
files.hom_bam.write(read)
for i in range(len(snp_idx)):
print len(snp_idx), cur_chrom, snp_idx[i], snp_tab.snp_pos[snp_idx][i], mat_alleles[i], pat_alleles[i], i, "hom", read_pos[i], read.query_sequence
else:
# if they are not equal it means there is a read that could be used to "assign" the read.
# loop through the SNPs to see which one it is, and then assign it.
assign = 0
for i in range(len(snp_idx)):
if mat_alleles[i] != pat_alleles[i]:
if pat_alleles[i] == read.query_sequence[read_pos[i]-1]:
# read matches reference allele
if assign==0:
read_stats.pat_count += 1
assign +=1
#output to paternal.bam file.
files.paternal_bam.write(read)
print len(snp_idx), cur_chrom, snp_idx[i], snp_tab.snp_pos[snp_idx][i], mat_alleles[i], pat_alleles[i], i, "pat", read_pos[i], read.query_sequence
elif mat_alleles[i] == read.query_sequence[read_pos[i]-1]:
# read matches non-reference allele
if assign==0:
read_stats.mat_count += 1
assign+=1
#output to maternal.bam file.
files.maternal_bam.write(read)
print len(snp_idx), cur_chrom, snp_idx[i], snp_tab.snp_pos[snp_idx][i], mat_alleles[i], pat_alleles[i], i, "mat", read_pos[i], read.query_sequence
else:
# read matches neither ref nor other
if assign==0:
assign +=1
read_stats.other_count += 1
print len(snp_idx), cur_chrom, snp_idx[i], snp_tab.snp_pos[snp_idx][i], mat_alleles[i], pat_alleles[i], i, "other", read_pos[i], read.query_sequence, read.query_sequence[read_pos[i]-1]
def filter_reads(files, max_seqs=MAX_SEQS_DEFAULT, max_snps=MAX_SNPS_DEFAULT,
samples=None):
cur_chrom = None
cur_tid = None
seen_chrom = set([])
snp_tab = snptable.SNPTable()
read_stats = ReadStats()
read_pair_cache = {}
cache_size = 0
read_count = 0
for read in files.input_bam:
read_count += 1
# if (read_count % 100000) == 0:
# sys.stderr.write("\nread_count: %d\n" % read_count)
# sys.stderr.write("cache_size: %d\n" % cache_size)
# TODO: need to change this to use new pysam API calls
# but need to check pysam version for backward compatibility
if read.tid == -1:
# unmapped read
read_stats.discard_unmapped += 1
continue
if (cur_tid is None) or (read.tid != cur_tid):
# this is a new chromosome
cur_chrom = files.input_bam.getrname(read.tid)
if len(read_pair_cache) != 0:
sys.stderr.write("WARNING: failed to find pairs for %d "
"reads on this chromosome\n" %
len(read_pair_cache))
read_stats.discard_missing_pair += len(read_pair_cache)
read_pair_cache = {}
cache_size = 0
read_count = 0
if cur_chrom in seen_chrom:
# sanity check that input bam file is sorted
raise ValueError("expected input BAM file to be sorted "
"but chromosome %s is repeated\n" % cur_chrom)
seen_chrom.add(cur_chrom)
cur_tid = read.tid
sys.stderr.write("starting chromosome %s\n" % cur_chrom)
# use HDF5 files if they are provided, otherwise use text
# files from SNP dir
snp_filename = "%s/%s.snps.txt.gz" % (files.snp_dir, cur_chrom)
sys.stderr.write("reading SNPs from file '%s'\n" % snp_filename)
snp_tab.read_file(snp_filename)
sys.stderr.write("processing reads\n")
if read.is_secondary:
# this is a secondary alignment (i.e. read was aligned more than
# once and this has align score that <= best score)
read_stats.discard_secondary += 1
continue
process_single_read(read, read_stats, files, snp_tab,
max_seqs, max_snps, cur_chrom)
read_stats.write(sys.stderr)
def process_single_read(read, read_stats, files, snp_tab, max_seqs,
max_snps, cur_chrom):
"""Check if a single read overlaps SNPs or indels, and writes
this read (or generated read pairs) to appropriate output files"""
# check if read overlaps SNPs or indels
snp_idx, snp_read_pos, \
indel_idx, indel_read_pos = snp_tab.get_overlapping_snps(read)
if len(indel_idx) > 0:
# for now discard this read, we want to improve this to handle
# the indel reads appropriately
read_stats.discard_indel += 1
# TODO: add option to handle indels instead of throwing out reads
return
if len(snp_idx) > 0:
mat_alleles = snp_tab.snp_allele1[snp_idx]
pat_alleles = snp_tab.snp_allele2[snp_idx]
count_ref_alt_matches(read, read_stats, snp_tab, snp_idx,
snp_read_pos, files, cur_chrom)
# limit recursion here by discarding reads that
# overlap too many SNPs
if len(snp_read_pos) > max_snps:
read_stats.discard_excess_snps += 1
return
# mat_seqs, pat_seqs = generate_reads(read.query_sequence, 0)
# make set of unique reads, we don't want to remap
# duplicates, or the read that matches original
# unique_reads = set(read_seqs)
# if read.query_sequence in unique_reads:
# unique_reads.remove(read.query_sequence)
# if len(unique_reads) == 0:
# only read generated matches original read,
# so keep original
# files.maternal_bam.write(mat_seqs)
# read_stats.maternal_single += 1
# elif len(unique_reads) < max_seqs:
# # write read to fastq file for remapping
# write_fastq(files.fastq_single, read, unique_reads)
# write read to 'to remap' BAM
# this is probably not necessary with new implmentation
# but kept for consistency with previous version of script
# files.paternal_bam.write(pat_seqs)
# read_stats.paternal_single += 1
# else:
# discard read
# read_stats.discard_excess_reads += 1
# return
else:
# no SNPs overlap read, write to keep file
files.hom_bam.write(read)
read_stats.hom_single += 1
if __name__ == '__main__':
sys.stderr.write("command line: %s\n" % " ".join(sys.argv))
sys.stderr.write("python version: %s\n" % sys.version)
sys.stderr.write("pysam version: %s\n" % pysam.__version__)
util.check_pysam_version()
options = parse_options()
main(options.bam_filename,
is_sorted=options.is_sorted,
max_seqs=options.max_seqs, max_snps=options.max_snps,
output_dir=options.output_dir,
snp_dir=options.snp_dir)
| 40.203883 | 205 | 0.543009 |
09c1f3727d6933c8c847df8d0be18f6dbfa8e1a9 | 25,145 | py | Python | bungieapi/generated/clients/group_v2.py | itemmanager/bungieapi | 0c4326f88ea0f28a1dcab683dc08c8d21c940fc1 | [
"MIT"
] | 5 | 2022-01-06T21:05:53.000Z | 2022-02-12T19:58:11.000Z | bungieapi/generated/clients/group_v2.py | itemmanager/bungieapi | 0c4326f88ea0f28a1dcab683dc08c8d21c940fc1 | [
"MIT"
] | 8 | 2021-12-25T02:40:56.000Z | 2022-03-28T03:31:41.000Z | bungieapi/generated/clients/group_v2.py | itemmanager/bungieapi | 0c4326f88ea0f28a1dcab683dc08c8d21c940fc1 | [
"MIT"
] | 1 | 2022-01-30T23:53:25.000Z | 2022-01-30T23:53:25.000Z | # generated by update to not change manually
import typing as t
from bungieapi.base import BaseClient, clean_query_value
from bungieapi.forge import forge
from bungieapi.generated.components.responses import (
CEListOfGroupOptionalConversationClientResponse,
DictionaryOfint32AndstringClientResponse,
ListOfEntityActionResultClientResponse,
ListOfGroupThemeClientResponse,
ListOfGroupV2CardClientResponse,
SearchResultOfGroupBanClientResponse,
SearchResultOfGroupMemberApplicationClientResponse,
SearchResultOfGroupMemberClientResponse,
booleanClientResponse,
int32ClientResponse,
int64ClientResponse,
)
from bungieapi.generated.components.responses.groups_v2 import (
GetGroupsForMemberClientResponse,
GroupApplicationClientResponse,
GroupClientResponse,
GroupMemberLeaveResultClientResponse,
GroupMembershipSearchClientResponse,
GroupPotentialMembershipSearchClientResponse,
GroupSearchClientResponse,
)
from bungieapi.generated.components.schemas import BungieMembershipType
from bungieapi.generated.components.schemas.groups_v2 import (
ClanBanner,
GroupApplicationListRequest,
GroupApplicationRequest,
GroupBanRequest,
GroupDateRange,
GroupEditAction,
GroupNameSearchRequest,
GroupOptionalConversationAddRequest,
GroupOptionalConversationEditRequest,
GroupOptionsEditAction,
GroupPotentialMemberStatus,
GroupQuery,
GroupsForMemberFilter,
GroupType,
RuntimeGroupMemberType,
)
| 36.923642 | 197 | 0.643786 |
09c267a3cb1cc17f6f5bb5ef69492d09f87a64fa | 1,475 | py | Python | tests/test_models.py | jimimvp/CausalProb | 900527725ad43eac258df2b16ef93fd1643deb3a | [
"MIT"
] | 3 | 2021-11-04T16:37:45.000Z | 2022-03-08T10:24:19.000Z | tests/test_models.py | jimimvp/CausalProb | 900527725ad43eac258df2b16ef93fd1643deb3a | [
"MIT"
] | 13 | 2021-11-07T11:11:54.000Z | 2021-11-20T10:40:39.000Z | tests/test_models.py | jimimvp/CausalProb | 900527725ad43eac258df2b16ef93fd1643deb3a | [
"MIT"
] | 1 | 2021-11-17T21:40:49.000Z | 2021-11-17T21:40:49.000Z | from causalprob import CausalProb
import unittest
import jax.numpy as jnp
import numpy as np
| 39.864865 | 122 | 0.547119 |
09c2c4fe16627c25f8121510a450845e41ae70cc | 1,713 | py | Python | python/analysis/simulations/replot_as_bar.py | UKPLab/tacl2018-preference-convincing | 65eb1cd3bf76f8068889880e0f80178e790350ce | [
"Apache-2.0"
] | 13 | 2019-03-01T19:40:23.000Z | 2022-01-10T05:53:47.000Z | python/analysis/simulations/replot_as_bar.py | UKPLab/tacl2018-preference-convincing | 65eb1cd3bf76f8068889880e0f80178e790350ce | [
"Apache-2.0"
] | 12 | 2020-11-13T17:54:01.000Z | 2022-02-09T23:39:11.000Z | python/analysis/simulations/replot_as_bar.py | UKPLab/tacl2018-preference-convincing | 65eb1cd3bf76f8068889880e0f80178e790350ce | [
"Apache-2.0"
] | 5 | 2019-02-06T12:08:20.000Z | 2022-01-10T20:40:22.000Z | '''
Generate a bar chart with error bars -- might be easier to read than a line graph with error bars.
'''
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
if __name__ == '__main__':
figure_save_path = './results/synth2/'
filename = 'r_pairs_bar.pdf'
fig = None
cs = [1,3,10,20]
markers = ['o', 'x', '+', '>', '<', '*']
linestyles = [':', '-.', '--', '-']
for idx, c in enumerate(cs):
mean_results = np.genfromtxt('./results/synth_latent_mean_results_%i.csv' % c)
std_results = np.genfromtxt('./results/synth_latent_std_results_%i.csv' % c)
fig = plot_result(idx, filename, 'noise rate in pairwise training labels', '$\\tau$ (on test set)', 'C=%i' % c,
fig) | 32.320755 | 119 | 0.624051 |
09c49181d3fdabb104e8b2473f43e07ce944fcb6 | 74 | py | Python | shapes-trainer/training_shapes_module/__init__.py | dakotaJang/shapes | 19ba73ad2a9b50b57cafca53560678273aeb7776 | [
"MIT"
] | 1 | 2019-02-02T11:46:55.000Z | 2019-02-02T11:46:55.000Z | shapes-trainer/training_shapes_module/__init__.py | dakotaJang/shapes | 19ba73ad2a9b50b57cafca53560678273aeb7776 | [
"MIT"
] | null | null | null | shapes-trainer/training_shapes_module/__init__.py | dakotaJang/shapes | 19ba73ad2a9b50b57cafca53560678273aeb7776 | [
"MIT"
] | null | null | null | from .loader import *
from .model import *
from .train_and_test import * | 24.666667 | 29 | 0.743243 |
09c6c74d8c24c276c440f25295526d610514d57d | 468 | py | Python | python-lab-file/78_tkintermenu.py | zshashz/py1729 | 3281ae2a20c665ebcc0d53840cc95143cbe6861b | [
"MIT"
] | 1 | 2021-01-22T09:03:59.000Z | 2021-01-22T09:03:59.000Z | python-lab-file/78_tkintermenu.py | zshashz/py1729 | 3281ae2a20c665ebcc0d53840cc95143cbe6861b | [
"MIT"
] | null | null | null | python-lab-file/78_tkintermenu.py | zshashz/py1729 | 3281ae2a20c665ebcc0d53840cc95143cbe6861b | [
"MIT"
] | 2 | 2021-05-04T11:29:38.000Z | 2021-11-03T13:09:48.000Z | # Program 77 : make Tkinter menu
from tkinter import *
from tkinter import *
root = Tk()
menu = Menu(root)
root.config(menu=menu)
filemenu = Menu(menu)
menu.add_cascade(label='File', menu=filemenu)
filemenu.add_command(label='New')
filemenu.add_command(label='Open...')
filemenu.add_separator()
filemenu.add_command(label='Exit', command=root.quit)
helpmenu = Menu(menu)
menu.add_cascade(label='Help', menu=helpmenu)
helpmenu.add_command(label='About')
mainloop()
| 23.4 | 53 | 0.75641 |
09c972c8ee2252231ba255a8d7fd24be9200e9e4 | 445 | py | Python | chat/tests/factories.py | gurupratap-matharu/chatylon | d23ce4b9fa3954ad49fc18647ccf54cd0cc73cf8 | [
"MIT"
] | 4 | 2020-11-16T01:53:17.000Z | 2021-09-01T06:02:31.000Z | chat/tests/factories.py | gurupratap-matharu/chatylon | d23ce4b9fa3954ad49fc18647ccf54cd0cc73cf8 | [
"MIT"
] | null | null | null | chat/tests/factories.py | gurupratap-matharu/chatylon | d23ce4b9fa3954ad49fc18647ccf54cd0cc73cf8 | [
"MIT"
] | null | null | null | import factory
from chat.models import Chat, ChatRoom
from users.factories import UserFactory
| 22.25 | 57 | 0.730337 |
09c9a15d0f7a17f53680be679c2a6066d5b21c97 | 1,335 | py | Python | tools/prepare_data.py | xrick/CTC_DySpeechCommands | d92cb97f7344fb5acdb6aa3fc3dfb7c022fffc6e | [
"MIT"
] | 74 | 2018-05-05T18:43:28.000Z | 2022-03-21T13:00:14.000Z | tools/prepare_data.py | xrick/CTC_DySpeechCommands | d92cb97f7344fb5acdb6aa3fc3dfb7c022fffc6e | [
"MIT"
] | 5 | 2018-07-20T16:18:57.000Z | 2021-01-26T11:52:31.000Z | tools/prepare_data.py | xrick/CTC_DySpeechCommands | d92cb97f7344fb5acdb6aa3fc3dfb7c022fffc6e | [
"MIT"
] | 21 | 2018-06-18T07:21:19.000Z | 2021-04-11T06:49:03.000Z | """Downloads the training dataset and removes bad samples.
"""
import csv
import os
import urllib.request
import tarfile
import glob
DATA_URL = 'http://download.tensorflow.org/data/speech_commands_v0.01.tar.gz'
TRAIN_DIR = '../dataset/train/audio/'
FILE_BAD = 'bad_samples.txt'
def maybe_download(data_url, dest_directory):
"""Download and extract data set tar file.
"""
if not os.path.exists(dest_directory):
os.makedirs(dest_directory)
filename = data_url.split('/')[-1]
filepath = os.path.join(dest_directory, filename)
if not os.path.exists(filepath):
print('Downloading %s ...' % filename)
filepath, _ = urllib.request.urlretrieve(data_url, filepath)
tarfile.open(filepath, 'r:gz').extractall(dest_directory)
print('Successfully unzipped %s' % filename)
def remove_bad(f_bad, train_dir):
"""Deletes bad samples in the dataset.
"""
num_bad = 0
with open(f_bad, 'r') as fp:
for wav in csv.reader(fp, delimiter=','):
try:
os.remove(train_dir + wav[0])
num_bad += 1
except FileNotFoundError:
pass
print('bad_training_samples removed: %d' % num_bad)
wav_paths = glob.glob(os.path.join(train_dir, '*', '*nohash*.wav'))
print('num_training_samples = %d' % len(wav_paths))
maybe_download(DATA_URL, TRAIN_DIR)
remove_bad(FILE_BAD, TRAIN_DIR)
| 26.7 | 77 | 0.698876 |
09ca172ccac0fbc44db1af59fb9a28884f053bb0 | 162 | py | Python | remote_control/apps.py | adrienemery/auv-control-api | 44d04c070879be3a52633369886534657b2d67ca | [
"MIT"
] | null | null | null | remote_control/apps.py | adrienemery/auv-control-api | 44d04c070879be3a52633369886534657b2d67ca | [
"MIT"
] | 2 | 2016-08-03T00:37:37.000Z | 2016-08-03T00:46:12.000Z | remote_control/apps.py | adrienemery/auv-control | 44d04c070879be3a52633369886534657b2d67ca | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 18 | 37 | 0.734568 |
09caab87d8b63d185ae16695cb5079d8b60078ed | 4,232 | py | Python | Dashboard_Relay/tests/unit/api/test_authorization.py | weiwa6/SecValidation | e899b7aa3f46ded3b39aeb6a1eeab95cc8dc21b5 | [
"BSD-3-Clause"
] | null | null | null | Dashboard_Relay/tests/unit/api/test_authorization.py | weiwa6/SecValidation | e899b7aa3f46ded3b39aeb6a1eeab95cc8dc21b5 | [
"BSD-3-Clause"
] | null | null | null | Dashboard_Relay/tests/unit/api/test_authorization.py | weiwa6/SecValidation | e899b7aa3f46ded3b39aeb6a1eeab95cc8dc21b5 | [
"BSD-3-Clause"
] | null | null | null | from http import HTTPStatus
from authlib.jose import jwt
from pytest import fixture
from .utils import get_headers
from api.errors import AUTH_ERROR
def test_call_with_authorization_header_failure(
route, client,
authorization_errors_expected_payload
):
response = client.post(route)
assert response.status_code == HTTPStatus.OK
assert response.json == authorization_errors_expected_payload(
'Authorization header is missing'
)
def test_call_with_wrong_authorization_type(
route, client, valid_jwt,
authorization_errors_expected_payload
):
response = client.post(
route, headers=get_headers(valid_jwt, auth_type='wrong_type')
)
assert response.status_code == HTTPStatus.OK
assert response.json == authorization_errors_expected_payload(
'Wrong authorization type'
)
def test_call_with_wrong_jwt_structure(
route, client, wrong_jwt_structure,
authorization_errors_expected_payload
):
response = client.post(route, headers=get_headers(wrong_jwt_structure))
assert response.status_code == HTTPStatus.OK
assert response.json == authorization_errors_expected_payload(
'Wrong JWT structure'
)
def test_call_with_jwt_encoded_by_wrong_key(
route, client, invalid_jwt,
authorization_errors_expected_payload
):
response = client.post(route, headers=get_headers(invalid_jwt))
assert response.status_code == HTTPStatus.OK
assert response.json == authorization_errors_expected_payload(
'Failed to decode JWT with provided key'
)
def test_call_with_wrong_jwt_payload_structure(
route, client, wrong_payload_structure_jwt,
authorization_errors_expected_payload
):
response = client.post(route,
headers=get_headers(wrong_payload_structure_jwt))
assert response.status_code == HTTPStatus.OK
assert response.json == authorization_errors_expected_payload(
'Wrong JWT payload structure'
)
def test_call_with_missed_secret_key(
route, client, valid_jwt,
authorization_errors_expected_payload
):
right_secret_key = client.application.secret_key
client.application.secret_key = None
response = client.post(route, headers=get_headers(valid_jwt))
client.application.secret_key = right_secret_key
assert response.status_code == HTTPStatus.OK
assert response.json == authorization_errors_expected_payload(
'<SECRET_KEY> is missing'
)
| 27.660131 | 79 | 0.712193 |
09cbcab75f8e35ba54cb7a9b30b5581da605210d | 1,562 | py | Python | ops-implementations/ads-ml-service/app/gunicorn.init.py | IBM/open-prediction-service-hub | 8b7db98f46a81b731d0dddfde8e3fb6f91ebc71a | [
"Apache-2.0"
] | 1 | 2021-09-14T18:40:33.000Z | 2021-09-14T18:40:33.000Z | ops-implementations/ads-ml-service/app/gunicorn.init.py | IBM/open-prediction-service-hub | 8b7db98f46a81b731d0dddfde8e3fb6f91ebc71a | [
"Apache-2.0"
] | 7 | 2021-04-23T13:41:39.000Z | 2021-08-12T09:33:10.000Z | ops-implementations/ads-ml-service/app/gunicorn.init.py | IBM/open-prediction-service-hub | 8b7db98f46a81b731d0dddfde8e3fb6f91ebc71a | [
"Apache-2.0"
] | 5 | 2020-12-10T14:27:23.000Z | 2022-03-29T08:44:22.000Z | #!/usr/bin/env python3
#
# Copyright 2020 IBM
# 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.IBM Confidential
#
import os
from multiprocessing import cpu_count
TRUE = ('TRUE', 'True', 'true', '1')
use_ssl = True if os.getenv('ENABLE_SSL') in TRUE else False
settings = os.getenv('SETTINGS')
# Gunicorn config variables
workers = int(os.getenv('GUNICORN_WORKER_NUM')) \
if os.getenv('GUNICORN_WORKER_NUM') and int(os.getenv('GUNICORN_WORKER_NUM')) > 0 \
else cpu_count() * 2 + 1
# Gunicorn needs to store its temporary file in memory (e.g. /dev/shm)
worker_tmp_dir = '/dev/shm'
# Container schedulers typically expect logs to come out on stdout/stderr, thus gunicorn is configured to do so
log_file = '-'
ssl_version = 'TLSv1_2'
bind = ':8080'
ca_certs = f'{settings}/ca.crt' if use_ssl else None
certfile = f'{settings}/server.crt' if use_ssl else None
keyfile = f'{settings}/server.key' if use_ssl else None
timeout = int(os.getenv('GUNICORN_TIMEOUT')) \
if os.getenv('GUNICORN_TIMEOUT') and int(os.getenv('GUNICORN_TIMEOUT')) > 0 \
else 30
| 33.956522 | 111 | 0.734955 |
09cd5bd9b3afeaf12e00c4f547e27cdd27294e5a | 394 | py | Python | projecteuler/util/summation.py | Tenebrar/codebase | 59c9a35289fb29afedad0e3edd0519b67372ef9f | [
"Unlicense"
] | 1 | 2020-04-21T11:39:25.000Z | 2020-04-21T11:39:25.000Z | projecteuler/util/summation.py | Tenebrar/codebase | 59c9a35289fb29afedad0e3edd0519b67372ef9f | [
"Unlicense"
] | 7 | 2020-02-12T01:08:01.000Z | 2022-02-10T11:56:56.000Z | projecteuler/util/summation.py | Tenebrar/codebase | 59c9a35289fb29afedad0e3edd0519b67372ef9f | [
"Unlicense"
] | null | null | null | def sum_all_to(num: int) -> int:
""" Return the sum of all numbers up to and including the input number """
return num * (num + 1) // 2
def square_pyramidal_number(num: int) -> int:
""" Return the sum of the squares of all numbers up to and including the input number """
# https://en.wikipedia.org/wiki/Square_pyramidal_number
return num * (num + 1) * (2 * num + 1) // 6
| 39.4 | 93 | 0.649746 |
09ce6912201c289c5c7f36b054105384590d7dc8 | 2,143 | py | Python | graphics/place_camera.py | bdemin/M113_Visualization | bf863af9dfc2902ae9123afeae8d5bd413a4bedb | [
"MIT"
] | null | null | null | graphics/place_camera.py | bdemin/M113_Visualization | bf863af9dfc2902ae9123afeae8d5bd413a4bedb | [
"MIT"
] | null | null | null | graphics/place_camera.py | bdemin/M113_Visualization | bf863af9dfc2902ae9123afeae8d5bd413a4bedb | [
"MIT"
] | null | null | null | import numpy as np
| 31.985075 | 133 | 0.585161 |
09cf011d62fddefba9f4507356da24e66db71898 | 16,405 | py | Python | src/tools/api_compiler/compiler.py | facade-technologies-inc/facile | 4c9134dced71734641fed605e152880cd9ddefe3 | [
"MIT"
] | 2 | 2020-09-17T20:51:18.000Z | 2020-11-03T15:58:10.000Z | src/tools/api_compiler/compiler.py | facade-technologies-inc/facile | 4c9134dced71734641fed605e152880cd9ddefe3 | [
"MIT"
] | 97 | 2020-08-26T05:07:08.000Z | 2022-03-28T16:01:49.000Z | src/tools/api_compiler/compiler.py | facade-technologies-inc/facile | 4c9134dced71734641fed605e152880cd9ddefe3 | [
"MIT"
] | null | null | null | """
..
/------------------------------------------------------------------------------\
| -- FACADE TECHNOLOGIES INC. CONFIDENTIAL -- |
|------------------------------------------------------------------------------|
| |
| Copyright [2019] Facade Technologies Inc. |
| All Rights Reserved. |
| |
| NOTICE: All information contained herein is, and remains the property of |
| Facade Technologies Inc. and its suppliers if any. The intellectual and |
| and technical concepts contained herein are proprietary to Facade |
| Technologies Inc. and its suppliers and may be covered by U.S. and Foreign |
| Patents, patents in process, and are protected by trade secret or copyright |
| law. Dissemination of this information or reproduction of this material is |
| strictly forbidden unless prior written permission is obtained from Facade |
| Technologies Inc. |
| |
\------------------------------------------------------------------------------/
This file contains the Compiler class - the part of Facile that interprets a user's
work in the gui, and converts it into the desired API.
"""
import os
import sys
import json
from subprocess import check_call, DEVNULL, STDOUT, check_output
from shutil import copyfile, rmtree
from PySide2.QtCore import QObject, Signal
from PySide2.QtWidgets import QApplication
import data.statemachine as sm
from data.compilationprofile import CompilationProfile
from tools.api_compiler.copy_file_manifest import compilation_copy_files
from libs.logging import compiler_logger as logger
from libs.logging import log_exceptions
import libs.env as env
from multiprocessing.pool import ThreadPool
curPath = os.path.abspath(os.path.join(env.FACILE_DIR, "tools/api_compiler/compiler.py"))
dir, filename = os.path.split(curPath)
def nongui(fun):
"""Decorator running the function in non-gui thread while
processing the gui events."""
return wrap
| 40.208333 | 120 | 0.585431 |
09d449514e9039bc5c41cf98d5932b80f0321669 | 898 | py | Python | TestSourceCode_Store/PIM_example_resize.py | leejaymin/QDroid | 13ff9d26932378513a7c9f0038eb59b922ed06eb | [
"Apache-2.0"
] | null | null | null | TestSourceCode_Store/PIM_example_resize.py | leejaymin/QDroid | 13ff9d26932378513a7c9f0038eb59b922ed06eb | [
"Apache-2.0"
] | null | null | null | TestSourceCode_Store/PIM_example_resize.py | leejaymin/QDroid | 13ff9d26932378513a7c9f0038eb59b922ed06eb | [
"Apache-2.0"
] | null | null | null | import sys
from PIL import Image
#import ImageChops
#import numpy as np
#import ImageChops
if __name__ == '__main__':
srcList = []
targetList = []
colorRate = []
avgColorRate = 0.0
sumColorRate = 0
validCount = 0
# image_src = '/root/Android_Application_source/recomended/0.png'
first_image = "../ImageStore/GameActivityGalaxyNexus.png"
# image_src = '../TestingResult/HTCDesire/Air_Hockey_1_1_1/MultitouchTestActivity'
# first_image = "../TestingResult/GalaxyNexus/Digger/splash.png"
imSrc = Image.open(first_image)
a = imSrc.size
print a[0]
# grayImage = Image.open(image_src)
out = imSrc.resize((1280,720))
# diff_out = ImageChops.difference(imSrc, grayImage)
# diff_out.show()
# diff_out.getbox()
# print diff_out.histogram()
out.save('/root/Android_Application_source/recomended/0_r.png','PNG')
| 26.411765 | 85 | 0.680401 |
09d4d5139b90907a08147b1f476920cdd503f04c | 15,484 | py | Python | src/testing/functionaltests/webtest.py | pgecsenyi/piepy | 37bf6cb5bc8c4f9da3f695216beda7353d79fb29 | [
"MIT"
] | 1 | 2018-03-26T22:39:36.000Z | 2018-03-26T22:39:36.000Z | src/testing/functionaltests/webtest.py | pgecsenyi/piepy | 37bf6cb5bc8c4f9da3f695216beda7353d79fb29 | [
"MIT"
] | null | null | null | src/testing/functionaltests/webtest.py | pgecsenyi/piepy | 37bf6cb5bc8c4f9da3f695216beda7353d79fb29 | [
"MIT"
] | null | null | null | """
Web unit tests
"""
# pylint: disable=too-many-public-methods
import time
import unittest
import requests
from testing.communicationhelper import get_json, put_json
from testing.functions import are_expected_items_in_list, are_expected_kv_pairs_in_list, \
get_item_from_embedded_dictionary
from testing.servermanager import ServerManager
from testing.testhelper import TestHelper
from testing.videotestenvironment import VideoTestEnvironment
def test_5_02_video_titles_by_l(self):
"""
Query video titles by language.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?language={}'.format(WebTest._language_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Battle of Impact', 'Compressor Head (2014)']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_03_video_titles_by_p(self):
"""
Query video titles by parent.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?parent={}'.format(WebTest._parent_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = [
'Compressor Head [1x01] Variable Length Codes',
'Compressor Head [1x03] Markov Chain Compression',
'Compressor Head [1x01] Variable Length Codes']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_04_video_titles_by_q(self):
"""
Query video titles by quality.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?quality={}'.format(WebTest._quality_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Triple Payback', 'Compressor Head (2014)']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_05_video_titles_by_l_p(self):
"""
Query video titles by language and parent.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?language={}&parent={}'.format(
WebTest._language_id,
WebTest._parent_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head [1x01] Variable Length Codes']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_06_video_titles_by_l_q(self):
"""
Query video titles by language and quality.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?language={}&quality={}'.format(
WebTest._language_id,
WebTest._quality_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head (2014)']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_07_video_titles_by_p_q(self):
"""
Query video titles by parent and quality.
"""
# Arrange.
url = WebTest._helper.build_url(
'video/titles?parent={}&quality={}'.format(WebTest._parent_id, WebTest._quality_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head [1x01] Variable Length Codes']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
WebTest._episode_title_id = get_item_from_embedded_dictionary(
data['titles'],
'title',
'Compressor Head [1x01] Variable Length Codes',
'id')
def test_5_08_video_titles_by_sl(self):
"""
Query video titles by subtitle language.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?subtitle={}'.format(WebTest._language_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head (2014)']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_09_video_titles_by_l_sl(self):
"""
Query video titles by language and subtitle language.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?language={}&subtitle={}'.format(
WebTest._language_id,
WebTest._language_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head (2014)']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_10_video_titles_by_p_sl(self):
"""
Query video titles by parent and subtitle language.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?parent={}&subtitle={}'.format(
WebTest._parent_id,
WebTest._language_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head [1x01] Variable Length Codes']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_11_video_titles_by_q_sl(self):
"""
Query video titles by quality and subtitle language.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?quality={}&subtitle={}'.format(
WebTest._quality_id,
WebTest._language_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head (2014)']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_12_video_titles_by_l_p_sl(self):
"""
Query video titles by language, parent and subtitle language.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?language={}&parent={}&subtitle={}'.format(
WebTest._language_id,
WebTest._parent_id,
WebTest._language_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head [1x01] Variable Length Codes']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_13_video_titles_by_l_q_sl(self):
"""
Query video titles by language, quality and subtitle language.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?language={}&quality={}&subtitle={}'.format(
WebTest._language_id,
WebTest._quality_id,
WebTest._language_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head (2014)']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
def test_5_14_video_titles_by_l_p_q_sl(self):
"""
Query video titles by language, parent, quality and subtitle language.
"""
# Arrange.
url = WebTest._helper.build_url('video/titles?language={}&parent={}&quality={}&subtitle={}'.format(
WebTest._language_id,
WebTest._parent_id,
WebTest._quality_id,
WebTest._language_id))
# Act.
data = get_json(url)
# Assert.
expected_titles = ['Compressor Head [1x01] Variable Length Codes']
are_expected_items_in_list(self, data, 'titles')
are_expected_kv_pairs_in_list(self, data['titles'], 'title', expected_titles)
| 32.529412 | 120 | 0.58822 |
09d79f0d227847749db1ddb7eb6acbb60326e8b8 | 862 | py | Python | 10_Name_Card_Detection/pytorch-faster-rcnn/lib/datasets/factory.py | ZeroWeight/Pattern-Recognize | ce18ab7d218840978f546a94d02d4183c9dc1aac | [
"MIT"
] | 4 | 2018-07-30T01:46:22.000Z | 2019-04-09T12:23:52.000Z | 10_Name_Card_Detection/pytorch-faster-rcnn/lib/datasets/factory.py | ZeroWeight/Pattern-Recognize | ce18ab7d218840978f546a94d02d4183c9dc1aac | [
"MIT"
] | null | null | null | 10_Name_Card_Detection/pytorch-faster-rcnn/lib/datasets/factory.py | ZeroWeight/Pattern-Recognize | ce18ab7d218840978f546a94d02d4183c9dc1aac | [
"MIT"
] | 1 | 2020-02-25T05:09:06.000Z | 2020-02-25T05:09:06.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Factory method for easily getting imdbs by name."""
__sets = {}
from datasets.name_card import name_card
import numpy as np
for split in ['trainval', 'test']:
name = 'name_card_real_{}'.format(split)
__sets[name] = (lambda split=split: name_card(split,'NameCardReal'))
__sets['name_card_fake_train'] = (lambda: name_card('trainval','NameCardFake'))
def get_imdb(name):
"""Get an imdb (image database) by name."""
if name not in __sets:
raise KeyError('Unknown dataset: {}'.format(name))
return __sets[name]()
def list_imdbs():
"""List all registered imdbs."""
return list(__sets.keys())
| 29.724138 | 79 | 0.612529 |
09d9a6c70c2c9fb2475c65d8587c45d1e8aa1eb1 | 1,251 | py | Python | portafolio/core/views.py | breinerGiraldo/python | 89603d7ce0be8e2bb20817ee3c845fdb26a1b54a | [
"bzip2-1.0.6"
] | null | null | null | portafolio/core/views.py | breinerGiraldo/python | 89603d7ce0be8e2bb20817ee3c845fdb26a1b54a | [
"bzip2-1.0.6"
] | null | null | null | portafolio/core/views.py | breinerGiraldo/python | 89603d7ce0be8e2bb20817ee3c845fdb26a1b54a | [
"bzip2-1.0.6"
] | null | null | null | from django.shortcuts import render,HTTpResponse
# Create your views here.
| 39.09375 | 106 | 0.655476 |
09da5fe1886cdd50f1983ad7996a351fe7c5c4f5 | 257 | py | Python | setup.py | luphord/australian-housing-exercise | 441b8700cfe6d50742945b33d4f123dc6c497e5a | [
"MIT"
] | null | null | null | setup.py | luphord/australian-housing-exercise | 441b8700cfe6d50742945b33d4f123dc6c497e5a | [
"MIT"
] | null | null | null | setup.py | luphord/australian-housing-exercise | 441b8700cfe6d50742945b33d4f123dc6c497e5a | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='australian_housing',
packages=find_packages(),
version='0.2.1',
description='"A data science exercise on Australian house approvements"',
author='"luphord"',
license='MIT',
)
| 23.363636 | 77 | 0.696498 |
09dbc482da6f2620a0ec95d44dab6ffbe0c052f9 | 4,439 | py | Python | monopoly.py | michaelhutton/monopoly | d3adcf524dfb015dbdaaadf905ca8cc4396fde3e | [
"MIT"
] | null | null | null | monopoly.py | michaelhutton/monopoly | d3adcf524dfb015dbdaaadf905ca8cc4396fde3e | [
"MIT"
] | null | null | null | monopoly.py | michaelhutton/monopoly | d3adcf524dfb015dbdaaadf905ca8cc4396fde3e | [
"MIT"
] | null | null | null | import random
squares = [
"Go",
"Mediterranean Ave.",
"Community Chest",
"Baltic Ave.",
"Income Tax",
"Reading Railroad",
"Oriental Ave.",
"Chance",
"Vermont Ave.",
"Connecticut Ave.",
"Jail",
"St. Charles Place",
"Electric Company",
"States Ave.",
"Virginia Ave.",
"Pennsylvania Railroad",
"St. James Place",
"Community Chest",
"Tennessee Ave.",
"New York Ave.",
"Free Parking",
"Kentucky Ave.",
"Chance",
"Indiana Ave.",
"Illinois Ave.",
"B. & O. Railroad",
"Atlantic Ave.",
"Ventnor Ave.",
"Water Works",
"Marvin Gardens",
"Go To Jail",
"Pacific Ave.",
"North Carolina Ave.",
"Community Chest",
"Pennsylvania Ave.",
"Short Line Railroad",
"Chance",
"Park Place",
"Luxury Tax",
"Boardwalk"
]
SQUARES_LENGTH = len(squares)
chance_cards = [
"Advance to Go",
"Advance to Illinois Ave.",
"Advance to St. Charles Place",
"Advance token to nearest Utility",
"Advance token to the nearest Railroad",
"Bank pays you dividend of $50",
"Get out of Jail Free Card",
"Go Back 3 Spaces",
"Go to Jail",
"Make general repairs on all your property",
"Pay poor tax of $15",
"Take a trip to Reading Railroad",
"Take a walk on the Boardwalk",
"You have been elected Chairman of the Board",
"Your building loan matures - Collect $150"
]
community_chest_cards = [
"Advance to Go",
"Bank error in your favor - Collect $200",
"Doctor's fees - Pay $50",
"From sale of stock you get $50",
"Get Out of Jail Free Card",
"Go to Jail",
"Grand Opera Night - Collect $50 from every player for opening night seats",
"Holiday Fund matures - Receive $100",
"Income tax refund - Collect $20",
"Life insurance matures - Collect $100",
"Pay hospital fees of $100",
"Pay school fees of $150",
"Receive $25 consultancy fee",
"You are assessed for street repairs - $40 per house - $115 per hotel",
"You have won second prize in a beauty contest - Collect $10",
"You inherit $100"
]
player1 = {
"pos": 0,
"doubles_in_a_row": 0,
"in_jail": False
}
for turn in range(1,100):
dice = roll_dice()
print(dice)
if(dice[0] == dice[1]):
player1["doubles_in_a_row"] = player1["doubles_in_a_row"] + 1
else:
player1["doubles_in_a_row"] = 0
# TODO: if the player has rolled 3 doubles, go to jail!
player1["pos"] = (player1["pos"] + dice[0] + dice[1]) % SQUARES_LENGTH
# TODO: Check if its a go to jail space
if(squares[player1["pos"]] == "Chance"):
print("chance!")
print(player1)
pick_card(player1, chance_cards)
print(player1)
if(squares[player1["pos"]] == "Community Chest"):
print("CC!")
pick_card(player1, community_chest_cards)
print("Turn " + str(turn) + ": " + squares[player1["pos"]])
| 29.593333 | 80 | 0.581437 |
09ddae526c3cd9bcfe820b2b4ae3706b5e1e7c32 | 7,769 | py | Python | coinzdense/app.py | pibara/coinzdense-python | f051770b71fa0afe935eb0d2079dab21eea9432d | [
"BSD-3-Clause"
] | null | null | null | coinzdense/app.py | pibara/coinzdense-python | f051770b71fa0afe935eb0d2079dab21eea9432d | [
"BSD-3-Clause"
] | null | null | null | coinzdense/app.py | pibara/coinzdense-python | f051770b71fa0afe935eb0d2079dab21eea9432d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
from coinzdense.signing import SigningKey as _SigningKey
from coinzdense.validation import ValidationEnv as _ValidationEnv
from coinzdense.wallet import create_wallet as _create_wallet
from coinzdense.wallet import open_wallet as _open_wallet
| 50.122581 | 132 | 0.635603 |
09de00e54d3860203b7729e1854754335ac141d7 | 1,296 | py | Python | src/asyncdataflow/inspector.py | tomaszkingukrol/async-data-flow | 1572ef101cb0e6a0f27a77401538a4620ee9939f | [
"Apache-2.0"
] | null | null | null | src/asyncdataflow/inspector.py | tomaszkingukrol/async-data-flow | 1572ef101cb0e6a0f27a77401538a4620ee9939f | [
"Apache-2.0"
] | null | null | null | src/asyncdataflow/inspector.py | tomaszkingukrol/async-data-flow | 1572ef101cb0e6a0f27a77401538a4620ee9939f | [
"Apache-2.0"
] | null | null | null | from collections.abc import Iterable
from typing import Callable, Tuple
import inspect
from .definition import DataFlowInspector
from .exceptions import DataFlowFunctionArgsError, DataFlowNotCallableError, DataFlowEmptyError, DataFlowNotTupleError
def _check_positional_or_keyword_args(func: Callable) -> bool:
''' Check that function has only POSITIONAL_OR_KEYWORD arguments.
'''
inspect_args = inspect.signature(func).parameters.values()
for arg in inspect_args:
if str(arg.kind) != 'POSITIONAL_OR_KEYWORD':
raise DataFlowFunctionArgsError(func.__name__, arg)
| 35.027027 | 118 | 0.655864 |
09e5ab892fd8685aedec11f8378615ed2931fa1c | 891 | py | Python | processing_pipeline/extractionless_registration.py | SijRa/Brain-Image-Analysis-using-Deep-Learning | a35411bda6e39eff57f715a695b7fb6a30997706 | [
"MIT"
] | 2 | 2022-01-04T16:54:20.000Z | 2022-01-24T03:01:14.000Z | processing_pipeline/extractionless_registration.py | SijRa/Brain-Image-Analysis-using-Deep-Learning | a35411bda6e39eff57f715a695b7fb6a30997706 | [
"MIT"
] | null | null | null | processing_pipeline/extractionless_registration.py | SijRa/Brain-Image-Analysis-using-Deep-Learning | a35411bda6e39eff57f715a695b7fb6a30997706 | [
"MIT"
] | 1 | 2020-07-05T09:30:11.000Z | 2020-07-05T09:30:11.000Z | from ants import registration, image_read, image_write, resample_image, crop_image
from os import listdir
mri_directory = "ADNI_baseline_raw/"
template_loc = "MNI152_2009/mni_icbm152_t1_tal_nlin_sym_09a.nii"
template = image_read(template_loc)
template = resample_image(template, (192, 192, 160), True, 4)
#template = crop_image(template)
for scan in listdir(mri_directory):
id = scan.split('.')[0]
filename = "ADNI_original_registered/" + id + ".nii"
img_path = mri_directory + scan
image = image_read(img_path, reorient=True)
if image.shape[1] != 192:
print("- Resampling -")
image = resample_image(image, (192, 192, 160), True, 4)
registered_dict = registration(fixed=template, moving=image, type_of_transform="SyNRA")
#img = crop_image(registered_dict['warpedmovout'])
image_write(registered_dict['warpedmovout'], filename=filename)
print("Registered:",scan) | 40.5 | 89 | 0.751964 |
09e5f7e19923e048c28f58a87dbbfe0de36d4a04 | 362 | py | Python | 3rdparty/pytorch/torch/autograd/variable.py | WoodoLee/TorchCraft | 999f68aab9e7d50ed3ae138297226dc95fefc458 | [
"MIT"
] | 51 | 2020-01-26T23:32:57.000Z | 2022-03-20T14:49:57.000Z | 3rdparty/pytorch/torch/autograd/variable.py | WoodoLee/TorchCraft | 999f68aab9e7d50ed3ae138297226dc95fefc458 | [
"MIT"
] | 2 | 2020-12-19T20:00:28.000Z | 2021-03-03T20:22:45.000Z | 3rdparty/pytorch/torch/autograd/variable.py | WoodoLee/TorchCraft | 999f68aab9e7d50ed3ae138297226dc95fefc458 | [
"MIT"
] | 33 | 2020-02-18T16:15:48.000Z | 2022-03-24T15:12:05.000Z | import torch
from torch._six import with_metaclass
from torch._C import _ImperativeEngine as ImperativeEngine
Variable._execution_engine = ImperativeEngine()
| 22.625 | 75 | 0.79558 |
09e7e9329ecb594a1ce5f26cf6f1dcdac3d78aef | 15,237 | py | Python | sp_api/api/finances/models/shipment_item.py | lionsdigitalsolutions/python-amazon-sp-api | 7374523ebc65e2e01e37d03fc4009a44fabf2c3b | [
"MIT"
] | null | null | null | sp_api/api/finances/models/shipment_item.py | lionsdigitalsolutions/python-amazon-sp-api | 7374523ebc65e2e01e37d03fc4009a44fabf2c3b | [
"MIT"
] | null | null | null | sp_api/api/finances/models/shipment_item.py | lionsdigitalsolutions/python-amazon-sp-api | 7374523ebc65e2e01e37d03fc4009a44fabf2c3b | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Selling Partner API for Finances
The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order, financial event group, or date range without having to wait until a statement period closes. You can also obtain financial event groups for a given date range. # noqa: E501
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, ShipmentItem):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
| 35.270833 | 377 | 0.671458 |
09e83bd920be035d9c74e3803047761cd01ba2d9 | 583 | py | Python | glycan_profiling/database/prebuilt/__init__.py | mstim/glycresoft | 1d305c42c7e6cba60326d8246e4a485596a53513 | [
"Apache-2.0"
] | 4 | 2019-04-26T15:47:57.000Z | 2021-04-20T22:53:58.000Z | glycan_profiling/database/prebuilt/__init__.py | mstim/glycresoft | 1d305c42c7e6cba60326d8246e4a485596a53513 | [
"Apache-2.0"
] | 8 | 2017-11-22T19:20:20.000Z | 2022-02-14T01:49:58.000Z | glycan_profiling/database/prebuilt/__init__.py | mstim/glycresoft | 1d305c42c7e6cba60326d8246e4a485596a53513 | [
"Apache-2.0"
] | 3 | 2017-11-21T18:05:28.000Z | 2021-09-23T18:38:33.000Z | from .utils import hypothesis_register
from . import heparin
from . import combinatorial_mammalian_n_linked
from . import glycosaminoglycan_linkers
from . import combinatorial_human_n_linked
from . import biosynthesis_human_n_linked
from . import biosynthesis_mammalian_n_linked
from . import human_mucin_o_linked
__all__ = [
"hypothesis_register",
"heparin",
"combinatorial_mammalian_n_linked",
"combinatorial_human_n_linked",
"glycosaminoglycan_linkers",
"biosynthesis_human_n_linked",
"biosynthesis_mammalian_n_linked",
"human_mucin_o_linked",
]
| 27.761905 | 46 | 0.806175 |
09e84e1dd2d539b68ad7f9d464717d52336a5ae9 | 216 | py | Python | zhongyicheng/scripts/test.py | Chr0802/No-easy-summer1 | d8d88b8d025f039deca7c89518b63446e4f80567 | [
"MIT"
] | 2 | 2021-08-05T11:44:12.000Z | 2021-08-31T10:50:13.000Z | zhongyicheng/scripts/test.py | Chr0802/No-easy-summer1 | d8d88b8d025f039deca7c89518b63446e4f80567 | [
"MIT"
] | 1 | 2021-08-07T03:21:12.000Z | 2021-08-07T03:21:12.000Z | zhongyicheng/scripts/test.py | Chr0802/No-easy-summer1 | d8d88b8d025f039deca7c89518b63446e4f80567 | [
"MIT"
] | 8 | 2021-07-26T05:11:37.000Z | 2021-10-05T05:34:34.000Z | from elasticsearch import Elasticsearch
es = Elasticsearch([
{'host':'localhost','port':8200},
])
print(es.search(index='ename_test_multiprocess',body={"query":{"match":{"name":str(input())}}})['hits']['hits'])
| 30.857143 | 112 | 0.680556 |
09e89717699974cfa907e599273f2f898e6cc20f | 30 | py | Python | pastepdb/__init__.py | pooriaahmadi/pastepdb | 166b2e8614ee2ea6c8f2f804af23458defb4674a | [
"MIT"
] | 8 | 2021-03-17T10:48:49.000Z | 2021-04-06T08:16:04.000Z | pastepdb/__init__.py | pooriaahmadi/pastepdb | 166b2e8614ee2ea6c8f2f804af23458defb4674a | [
"MIT"
] | null | null | null | pastepdb/__init__.py | pooriaahmadi/pastepdb | 166b2e8614ee2ea6c8f2f804af23458defb4674a | [
"MIT"
] | null | null | null | from .pastepdb import pastepdb | 30 | 30 | 0.866667 |
09e89b2450d77d8cea8acdf70dfa8deb4095af90 | 3,370 | py | Python | my_plugins/youcompleteme/python/ycm/tests/diagnostic_interface_test.py | VirtualLG/vimrc | 33f961b0e465b852753479bc4aa0a32a6ff017cf | [
"MIT"
] | null | null | null | my_plugins/youcompleteme/python/ycm/tests/diagnostic_interface_test.py | VirtualLG/vimrc | 33f961b0e465b852753479bc4aa0a32a6ff017cf | [
"MIT"
] | null | null | null | my_plugins/youcompleteme/python/ycm/tests/diagnostic_interface_test.py | VirtualLG/vimrc | 33f961b0e465b852753479bc4aa0a32a6ff017cf | [
"MIT"
] | null | null | null | # Copyright (C) 2015-2018 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# YouCompleteMe is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with YouCompleteMe. If not, see <http://www.gnu.org/licenses/>.
from ycm import diagnostic_interface
from ycm.tests.test_utils import VimBuffer, MockVimModule, MockVimBuffers
from hamcrest import assert_that, contains_exactly, has_entries, has_item
from unittest import TestCase
MockVimModule()
| 32.403846 | 77 | 0.625223 |
09e91e344b133bb70e9396f03df09da25b24a2b5 | 1,372 | py | Python | oa_zalo/zalo_base/migrations/0004_auto_20210714_0949.py | quandxbp/vnpt-ccos | 23d2bc3d3db2e0bce479e0ccfa62e13451306635 | [
"bzip2-1.0.6"
] | null | null | null | oa_zalo/zalo_base/migrations/0004_auto_20210714_0949.py | quandxbp/vnpt-ccos | 23d2bc3d3db2e0bce479e0ccfa62e13451306635 | [
"bzip2-1.0.6"
] | null | null | null | oa_zalo/zalo_base/migrations/0004_auto_20210714_0949.py | quandxbp/vnpt-ccos | 23d2bc3d3db2e0bce479e0ccfa62e13451306635 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 3.2.4 on 2021-07-14 02:49
from django.db import migrations, models
| 29.191489 | 74 | 0.559038 |
09e9f3d9309a9df34ab48cce11c67316c012a978 | 272 | py | Python | project/web/utils/docx_files.py | sirodeneko/pyProject | 02cd67df26decf7b0ec20d86a2bbb5bce9f4e369 | [
"MIT"
] | null | null | null | project/web/utils/docx_files.py | sirodeneko/pyProject | 02cd67df26decf7b0ec20d86a2bbb5bce9f4e369 | [
"MIT"
] | 1 | 2020-11-30T09:35:15.000Z | 2020-11-30T09:35:15.000Z | project/web/utils/docx_files.py | sirodeneko/pyProject | 02cd67df26decf7b0ec20d86a2bbb5bce9f4e369 | [
"MIT"
] | 1 | 2020-11-30T09:33:24.000Z | 2020-11-30T09:33:24.000Z | import json
import os
import re
import urllib.request
| 17 | 35 | 0.632353 |
09eadaf88e96e921514284415b829745e173d0ca | 708 | py | Python | pkgs/javusdev/javusdev/settings.py | quapka/javus | 577e0c2dabfaea39d7ffacd42100d8a5f4cd738c | [
"MIT"
] | 1 | 2020-09-22T01:38:21.000Z | 2020-09-22T01:38:21.000Z | pkgs/javusdev/javusdev/settings.py | petrs/javus | 6927c824d5e6b574a6a323c87bd5aa117eca5b00 | [
"MIT"
] | null | null | null | pkgs/javusdev/javusdev/settings.py | petrs/javus | 6927c824d5e6b574a6a323c87bd5aa117eca5b00 | [
"MIT"
] | 1 | 2020-07-26T07:20:47.000Z | 2020-07-26T07:20:47.000Z | import os
from pathlib import Path
PROJECT_ROOT = get_project_root()
PROJECT_SRC = get_project_src()
DATA = get_project_data()
JAVUS_ATTACKS_DIR = get_javus_attacks_dir()
| 23.6 | 83 | 0.728814 |
09edfb321e8839956c0dd18d657713402150647f | 2,043 | py | Python | examples/design_studies/ihm_fingergait/check_progress.py | cbteeple/somo | 53a1a94f7d9d624bc4c43e582c80f24a0e98df24 | [
"MIT"
] | null | null | null | examples/design_studies/ihm_fingergait/check_progress.py | cbteeple/somo | 53a1a94f7d9d624bc4c43e582c80f24a0e98df24 | [
"MIT"
] | null | null | null | examples/design_studies/ihm_fingergait/check_progress.py | cbteeple/somo | 53a1a94f7d9d624bc4c43e582c80f24a0e98df24 | [
"MIT"
] | null | null | null | # Be sure to run this file from the "palm_sweeps" folder
# cd examples/palm_sweeps
import os
import sys
from datetime import datetime
path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
sys.path.insert(0, path)
from somo.sweep import iter_utils
config_file = "sweeps/grid_diam_height.yaml"
todo_file = "_runs_todo.yaml"
num_files_per_folder_end = 5
num_files_per_folder_start = 1
time_per_run = 25 # seconds
avg_size = 40 # MB
parallel_cores = 4
# Get data from config files
config = iter_utils.load_yaml(config_file)
todo = iter_utils.load_yaml(todo_file)
total_runs = len(todo)
# Calculate the time
total_time_min = (time_per_run / 60.0) * total_runs / parallel_cores
total_time_hr = total_time_min / 60.0
total_time_day = total_time_hr / 24.0
# Calculate total data size
total_size_GB = float(avg_size) * total_runs / 1000.0
# Calculate the percent complete
folder_to_count = iter_utils.get_group_folder(config)
cpt = sum([len(files) for r, d, files in os.walk(folder_to_count)])
total_files_expected_end = total_runs * num_files_per_folder_end
total_files_expected_start = total_runs * num_files_per_folder_start
progress = (cpt - total_files_expected_start) / (
total_files_expected_end - total_files_expected_start
)
eta_min = total_time_min * (1.0 - progress)
eta_hr = eta_min / 60.0
eta_day = eta_hr / 24.0
# Print info
print("")
print("Current time: " + datetime.now().strftime("%H:%M:%S"))
print("=================================")
print("Number of runs to complete: %d" % (total_runs))
print(
"Estimated total data saved @ %0.1f MB per run: %0.2f GB"
% (avg_size, total_size_GB)
)
print(
"Estimated total time @ %0.1f sec per run with %d cores: %0.1f min, %0.2f hrs, %0.3f days"
% (time_per_run, parallel_cores, total_time_min, total_time_hr, total_time_day)
)
print("---------------------------------")
print("Percent Complete: %0.3f %%" % (progress * 100))
print(
"Estimated time left: %0.1f min, %0.2f hrs, %0.3f days" % (eta_min, eta_hr, eta_day)
)
print("")
| 29.185714 | 94 | 0.708762 |
09f226a5810e82fde46ce6d76eb7db7321ca355b | 3,998 | py | Python | Projects/Project 1/Handin/program.py | ymirthor/T-215-STY1 | b888da1e88c5aa16eac03353f525e9e0b9d901df | [
"MIT"
] | null | null | null | Projects/Project 1/Handin/program.py | ymirthor/T-215-STY1 | b888da1e88c5aa16eac03353f525e9e0b9d901df | [
"MIT"
] | null | null | null | Projects/Project 1/Handin/program.py | ymirthor/T-215-STY1 | b888da1e88c5aa16eac03353f525e9e0b9d901df | [
"MIT"
] | null | null | null | from collections import deque as LL
| 35.070175 | 79 | 0.598049 |
09f23dc12e2bcbc1428ea1ce895f4e644cb3aca4 | 2,449 | py | Python | utils/ion.py | karlstratos/EntityQuestions | c4969aa6ca464773c2c35ab0569ba5924320d8d9 | [
"MIT"
] | 103 | 2021-09-16T18:19:49.000Z | 2022-03-29T03:18:50.000Z | utils/ion.py | karlstratos/EntityQuestions | c4969aa6ca464773c2c35ab0569ba5924320d8d9 | [
"MIT"
] | 8 | 2021-09-25T00:00:37.000Z | 2022-03-24T01:01:35.000Z | utils/ion.py | karlstratos/EntityQuestions | c4969aa6ca464773c2c35ab0569ba5924320d8d9 | [
"MIT"
] | 10 | 2021-09-19T08:12:53.000Z | 2022-03-23T09:09:23.000Z | """
General framework for reading/writing data from/to files on
the local system.
"""
import json
import random
from pathlib import Path
###############################################################################
# FILE READING #################################################
###############################################################################
###############################################################################
# FILE WRITING #################################################
###############################################################################
###############################################################################
# OTHER OUTPUT #################################################
###############################################################################
| 31 | 79 | 0.475704 |
09f240acbe9b8fa80d51945cdcc670845719d41c | 2,394 | py | Python | pg_methods/interfaces/state_processors.py | zafarali/policy-gradient-methods | f0d83a80ddc772dcad0c851aac9bfd41d436c274 | [
"MIT"
] | 28 | 2018-06-12T21:37:20.000Z | 2021-12-27T15:13:14.000Z | pg_methods/interfaces/state_processors.py | zafarali/policy-gradient-methods | f0d83a80ddc772dcad0c851aac9bfd41d436c274 | [
"MIT"
] | 3 | 2018-05-10T16:33:05.000Z | 2018-06-19T18:17:37.000Z | pg_methods/interfaces/state_processors.py | zafarali/policy-gradient-methods | f0d83a80ddc772dcad0c851aac9bfd41d436c274 | [
"MIT"
] | 7 | 2018-05-08T04:13:21.000Z | 2021-04-02T12:31:55.000Z | import gym
import torch
import numpy as np
from pg_methods.interfaces import common_interfaces as common
| 36.272727 | 102 | 0.575188 |
09f69dea9d9541fb1a471fe9f8d7ffca1d756933 | 3,935 | py | Python | tests/test_emlib.py | mjpekala/faster-membranes | f203fc8608603bc7b16a1abeac324d52e9dfe96a | [
"Apache-2.0"
] | null | null | null | tests/test_emlib.py | mjpekala/faster-membranes | f203fc8608603bc7b16a1abeac324d52e9dfe96a | [
"Apache-2.0"
] | null | null | null | tests/test_emlib.py | mjpekala/faster-membranes | f203fc8608603bc7b16a1abeac324d52e9dfe96a | [
"Apache-2.0"
] | null | null | null | """Unit test for emlib.py
To run:
PYTHONPATH=../src python test_emlib.py
"""
__author__ = "Mike Pekala"
__copyright__ = "Copyright 2015, JHU/APL"
__license__ = "Apache 2.0"
import unittest
import numpy as np
from sklearn.metrics import precision_recall_fscore_support as smetrics
import emlib
if __name__ == "__main__":
unittest.main()
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
| 33.067227 | 88 | 0.519695 |
09f80f8b20cbf9fab41433b7fb79cb311415a791 | 193 | py | Python | src/biopsykit/signals/imu/feature_extraction/__init__.py | Zwitscherle/BioPsyKit | 7200c5f1be75c20f53e1eb4c991aca1c89e3dd88 | [
"MIT"
] | 10 | 2020-11-05T13:34:55.000Z | 2022-03-11T16:20:10.000Z | src/biopsykit/signals/imu/feature_extraction/__init__.py | Zwitscherle/BioPsyKit | 7200c5f1be75c20f53e1eb4c991aca1c89e3dd88 | [
"MIT"
] | 14 | 2021-03-11T14:43:52.000Z | 2022-03-10T19:44:57.000Z | src/biopsykit/signals/imu/feature_extraction/__init__.py | Zwitscherle/BioPsyKit | 7200c5f1be75c20f53e1eb4c991aca1c89e3dd88 | [
"MIT"
] | 3 | 2021-09-13T13:14:38.000Z | 2022-02-19T09:13:25.000Z | """Module containing scripts for different feature extraction techniques from raw IMU data."""
from biopsykit.signals.imu.feature_extraction import static_moments
__all__ = ["static_moments"]
| 38.6 | 94 | 0.818653 |
09f91afeaca4a61947c025a6985fde971a2433a0 | 727 | py | Python | app/core/bluetooth/models.py | FHellmann/MLWTF | 582c3505d638907a848d5a6c739ee99981300f17 | [
"Apache-2.0"
] | null | null | null | app/core/bluetooth/models.py | FHellmann/MLWTF | 582c3505d638907a848d5a6c739ee99981300f17 | [
"Apache-2.0"
] | null | null | null | app/core/bluetooth/models.py | FHellmann/MLWTF | 582c3505d638907a848d5a6c739ee99981300f17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
Author: Fabio Hellmann <info@fabio-hellmann.de>
"""
from attr import s, ib
from attr.validators import instance_of
| 27.961538 | 114 | 0.68088 |
09f949d20672656308f4b25b2fb52c7d29555163 | 1,511 | py | Python | Algorithms_medium/1102. Path With Maximum Minimum Value.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | 4 | 2020-08-11T20:45:15.000Z | 2021-03-12T00:33:34.000Z | Algorithms_medium/1102. Path With Maximum Minimum Value.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | null | null | null | Algorithms_medium/1102. Path With Maximum Minimum Value.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | null | null | null | """
1102. Path With Maximum Minimum Value
Medium
Given a matrix of integers A with R rows and C columns, find the maximum score of a path starting at [0,0] and ending at [R-1,C-1].
The score of a path is the minimum value in that path. For example, the value of the path 8 4 5 9 is 4.
A path moves some number of times from one visited cell to any neighbouring unvisited cell in one of the 4 cardinal directions (north, east, west, south).
Example 1:
Input: [[5,4,5],[1,2,6],[7,4,6]]
Output: 4
Explanation:
The path with the maximum score is highlighted in yellow.
Example 2:
Input: [[2,2,1,2,2,2],[1,2,2,2,1,2]]
Output: 2
Example 3:
Input: [[3,4,6,3,4],[0,2,1,1,7],[8,8,3,2,7],[3,2,4,9,8],[4,1,2,0,0],[4,6,5,4,3]]
Output: 3
Note:
1 <= R, C <= 100
0 <= A[i][j] <= 10^9
""" | 26.982143 | 154 | 0.536069 |
09f9da8e8fb3a2cb6c40b0627a6fdbf5844460e0 | 1,436 | py | Python | tests/extractor/test_factory.py | albertteoh/data_pipeline | a99f1c7412375b3e9f4115108fcdde517b2e71a6 | [
"Apache-2.0"
] | null | null | null | tests/extractor/test_factory.py | albertteoh/data_pipeline | a99f1c7412375b3e9f4115108fcdde517b2e71a6 | [
"Apache-2.0"
] | null | null | null | tests/extractor/test_factory.py | albertteoh/data_pipeline | a99f1c7412375b3e9f4115108fcdde517b2e71a6 | [
"Apache-2.0"
] | null | null | null | import pytest
import data_pipeline.db.factory as db_factory
import data_pipeline.extractor.factory as extractor_factory
import tests.unittest_utils as utils
import data_pipeline.constants.const as const
from pytest_mock import mocker
from data_pipeline.db.exceptions import UnsupportedDbTypeError
def test_build_unsupported(setup):
(mockargv, mock_audit_factory) = setup
with pytest.raises(ImportError):
db = db_factory.build("AnUnsupportedDatabase")
extractor = extractor_factory.build(db, mockargv, mock_audit_factory)
| 34.190476 | 79 | 0.766017 |
09fa1379267ff36d7eaf0c8f04ba9a7c23bd124b | 3,424 | py | Python | suremco/tracker.py | modsim/SurEmCo | 71fc0cfc62f8733de93ee2736421574a154e3db3 | [
"BSD-2-Clause"
] | null | null | null | suremco/tracker.py | modsim/SurEmCo | 71fc0cfc62f8733de93ee2736421574a154e3db3 | [
"BSD-2-Clause"
] | null | null | null | suremco/tracker.py | modsim/SurEmCo | 71fc0cfc62f8733de93ee2736421574a154e3db3 | [
"BSD-2-Clause"
] | null | null | null | # SurEmCo - C++ tracker wrapper
import ctypes
from enum import IntEnum
import sys
import os
import numpy
import numpy.ctypeslib
| 29.517241 | 101 | 0.580023 |
09fa8917e01388a6694109a784fa133ce2d71a48 | 774 | py | Python | lianxi/abc.py | xuguoqiang1/qiang | a95f105897462a630d8312eabea6a0f905c3e3e1 | [
"MIT"
] | null | null | null | lianxi/abc.py | xuguoqiang1/qiang | a95f105897462a630d8312eabea6a0f905c3e3e1 | [
"MIT"
] | null | null | null | lianxi/abc.py | xuguoqiang1/qiang | a95f105897462a630d8312eabea6a0f905c3e3e1 | [
"MIT"
] | null | null | null | # coding=utf-8
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from config import Config
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
if __name__ == '__main__':
db.create_all()
app.run() | 24.967742 | 62 | 0.682171 |
09fb1d9a7c357f2bc49fb2f43274b073bfff333e | 4,026 | py | Python | foreign_languages/anderson.py | ds-modules/NESTUD-190A | 54ca1cd9a8f369f48946147f72377f874738f7d5 | [
"MIT"
] | 6 | 2017-11-06T03:18:12.000Z | 2019-10-02T19:41:06.000Z | foreign_languages/anderson.py | admndrsn/NESTUD-190A | 54ca1cd9a8f369f48946147f72377f874738f7d5 | [
"MIT"
] | null | null | null | foreign_languages/anderson.py | admndrsn/NESTUD-190A | 54ca1cd9a8f369f48946147f72377f874738f7d5 | [
"MIT"
] | 2 | 2018-02-09T01:04:58.000Z | 2019-06-19T17:45:34.000Z | from IPython.core.display import display, HTML
import translation
| 31.209302 | 132 | 0.721063 |
61cb92b7eff849f550f556cfcf71f302f039dac7 | 1,315 | py | Python | landdox/core.py | natefduncan/landdox | 58908554034577cc20c6f89ee6056da90cbfbd4e | [
"MIT"
] | 1 | 2019-12-13T16:19:56.000Z | 2019-12-13T16:19:56.000Z | landdox/core.py | natefduncan/landdox | 58908554034577cc20c6f89ee6056da90cbfbd4e | [
"MIT"
] | null | null | null | landdox/core.py | natefduncan/landdox | 58908554034577cc20c6f89ee6056da90cbfbd4e | [
"MIT"
] | null | null | null | import requests
import json
import pandas as pd
import os
from .endpoints import *
| 26.3 | 62 | 0.580989 |
61cd1b7623e09e8563a60f3d87a7caf270f2faa2 | 589 | py | Python | src/signalplotter/qt/makePyUI.py | jowanpittevils/Databasemanager_Signalplotter | 993152ad15793054df2acf386eb1c9a76610b789 | [
"BSD-3-Clause"
] | null | null | null | src/signalplotter/qt/makePyUI.py | jowanpittevils/Databasemanager_Signalplotter | 993152ad15793054df2acf386eb1c9a76610b789 | [
"BSD-3-Clause"
] | null | null | null | src/signalplotter/qt/makePyUI.py | jowanpittevils/Databasemanager_Signalplotter | 993152ad15793054df2acf386eb1c9a76610b789 | [
"BSD-3-Clause"
] | null | null | null | #%%
uiNames = ['plotter_uiDesign']
makeUI(uiNames)
# %%
| 21.035714 | 69 | 0.50764 |
61cd45cf1541403e9fd5c523d38b1e30cb5cbcc0 | 1,640 | py | Python | scraper.py | mikeku1116/python-accupass-scraper | ad3301fde373ce68e55459ba5af0273599d25e37 | [
"MIT"
] | null | null | null | scraper.py | mikeku1116/python-accupass-scraper | ad3301fde373ce68e55459ba5af0273599d25e37 | [
"MIT"
] | null | null | null | scraper.py | mikeku1116/python-accupass-scraper | ad3301fde373ce68e55459ba5af0273599d25e37 | [
"MIT"
] | null | null | null | from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from bs4 import BeautifulSoup
import pandas as pd
# ChromeChrome
browser = webdriver.Chrome(ChromeDriverManager().install())
browser.get(
"https://old.accupass.com/search/r/0/0/0/0/4/0/00010101/99991231?q=python")
soup = BeautifulSoup(browser.page_source, "lxml")
activities = soup.find_all(
"div", {"class": "apcss-activity-card ng-isolate-scope"})
result = []
for activity in activities:
#
title = activity.find(
"h3", {"class": "apcss-activity-card-title ng-binding"}).getText().strip()
#
view = activity.find(
"span", {"class": "apcss-activity-pageview ng-binding"}).getText().strip()
# ()
like = activity.find("span", {
"class": "apcss-activity-card-like ng-binding"}).getText().strip().replace(" ", "")
#
status = activity.find(
"a", {"class": "apcss-btn apcss-btn-block ng-binding activity-card-status-ready"})
# (class)
if status == None:
status = activity.find(
"a", {"class": "apcss-btn apcss-btn-block ng-binding activity-card-status-end"})
result.append((title, int(view), int(like), status.getText()))
df = pd.DataFrame(result, columns=["", "", "", ""])
new_df = df[df[""] == ""] #
sort_df = new_df.sort_values([""], ascending=False) #
sort_df.to_excel("accupass.xlsx",
sheet_name="activities",
index=False) # Excel()
browser.quit() # Chrome
| 30.943396 | 111 | 0.65 |
61cea84c27bf7df9b0289ed47ffee2781ddbdc17 | 3,148 | py | Python | mpcontribs-users/mpcontribs/users/swf/pre_submission.py | josuav1/MPContribs | 3cbf0e83ba6cd749dd4fc988c9f6ad076b05f935 | [
"MIT"
] | 1 | 2019-07-03T04:38:58.000Z | 2019-07-03T04:38:58.000Z | mpcontribs-users/mpcontribs/users/swf/pre_submission.py | josuav1/MPContribs | 3cbf0e83ba6cd749dd4fc988c9f6ad076b05f935 | [
"MIT"
] | null | null | null | mpcontribs-users/mpcontribs/users/swf/pre_submission.py | josuav1/MPContribs | 3cbf0e83ba6cd749dd4fc988c9f6ad076b05f935 | [
"MIT"
] | 1 | 2019-07-03T04:39:04.000Z | 2019-07-03T04:39:04.000Z | from mpcontribs.config import mp_level01_titles
from mpcontribs.io.core.recdict import RecursiveDict
from mpcontribs.io.core.utils import clean_value, get_composition_from_string
from mpcontribs.users.utils import duplicate_check
| 43.123288 | 91 | 0.656607 |