content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
class Solution:
def threeSumClosest(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
nums.sort()
rls = nums[0] + nums[1] + nums[2]
for i in range(len(nums)-2):
j, k = i+1, len(nums)-1
while j < k:
s = nums[i] + nums[j] + nums[k]
if s == target:
return s
rls = s if abs(s-target) < abs(rls-target) else rls
if s < target:
j += 1
else:
k -= 1
return rls
| class Solution:
def three_sum_closest(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
nums.sort()
rls = nums[0] + nums[1] + nums[2]
for i in range(len(nums) - 2):
(j, k) = (i + 1, len(nums) - 1)
while j < k:
s = nums[i] + nums[j] + nums[k]
if s == target:
return s
rls = s if abs(s - target) < abs(rls - target) else rls
if s < target:
j += 1
else:
k -= 1
return rls |
# A mapping between model field internal datatypes and sensible
# client-friendly datatypes. In virtually all cases, client programs
# only need to differentiate between high-level types like number, string,
# and boolean. More granular separation be may desired to alter the
# allowed operators or may infer a different client-side representation
SIMPLE_TYPES = {
'auto': 'key',
'foreignkey': 'key',
'biginteger': 'number',
'decimal': 'number',
'float': 'number',
'integer': 'number',
'positiveinteger': 'number',
'positivesmallinteger': 'number',
'smallinteger': 'number',
'nullboolean': 'boolean',
'char': 'string',
'email': 'string',
'file': 'string',
'filepath': 'string',
'image': 'string',
'ipaddress': 'string',
'slug': 'string',
'text': 'string',
'url': 'string',
}
# A mapping between the client-friendly datatypes and sensible operators
# that will be used to validate a query condition. In many cases, these types
# support more operators than what are defined, but are not include because
# they are not commonly used.
OPERATORS = {
'key': ('exact', '-exact', 'in', '-in'),
'boolean': ('exact', '-exact', 'in', '-in'),
'date': ('exact', '-exact', 'in', '-in', 'lt', 'lte', 'gt', 'gte',
'range', '-range'),
'number': ('exact', '-exact', 'in', '-in', 'lt', 'lte', 'gt', 'gte',
'range', '-range'),
'string': ('exact', '-exact', 'iexact', '-iexact', 'in', '-in',
'icontains', '-icontains', 'iregex', '-iregex'),
'datetime': ('exact', '-exact', 'in', '-in', 'lt', 'lte', 'gt', 'gte',
'range', '-range'),
'time': ('exact', '-exact', 'in', '-in', 'lt', 'lte', 'gt', 'gte',
'range', '-range'),
}
# A general mapping of formfield overrides for all subclasses. the mapping is
# similar to the SIMPLE_TYPE_MAP, but the values reference internal
# formfield classes, that is integer -> IntegerField. in many cases, the
# validation performed may need to be a bit less restrictive than what the
# is actually necessary
INTERNAL_DATATYPE_FORMFIELDS = {
'integer': 'FloatField',
'positiveinteger': 'FloatField',
'positivesmallinteger': 'FloatField',
'smallinteger': 'FloatField',
'biginteger': 'FloatField',
}
# The minimum number of distinct values required when determining to set the
# `searchable` flag on `DataField` instances during the `init` process. This
# will only be applied to fields with a Avocado datatype of 'string'
ENUMERABLE_MAXIMUM = 30
# Flag for enabling the history API
HISTORY_ENABLED = True
# The maximum size of a user's history. If the value is an integer, this
# is the maximum number of allowed items in the user's history. Set to
# `None` (or 0) to enable unlimited history. Note, in order to enforce this
# limit, the `avocado history --prune` command must be executed to remove
# the oldest history from each user based on this value.
HISTORY_MAX_SIZE = None
# App that the metadata migrations will be created for. This is typically the
# project itself.
METADATA_MIGRATION_APP = None
# Directory for the migration backup fixtures. If None, this will default to
# the fixtures dir in the app defined by `METADATA_MIGRATION_APP`
METADATA_FIXTURE_DIR = None
METADATA_FIXTURE_SUFFIX = 'avocado_metadata'
METADATA_MIGRATION_SUFFIX = 'avocado_metadata_migration'
# Query processors
QUERY_PROCESSORS = {
'default': 'avocado.query.pipeline.QueryProcessor',
}
# Custom validation error and warnings messages
VALIDATION_ERRORS = {}
VALIDATION_WARNINGS = {}
# Toggle whether DataField instances should cache the underlying data
# for their most common data access methods.
DATA_CACHE_ENABLED = True
# These settings affect how queries can be shared between users.
# A user is able to enter either a username or an email of another user
# they wish to share the query with. To limit to only one type of sharing
# set the appropriate setting to True and all others to false.
SHARE_BY_USERNAME = True
SHARE_BY_EMAIL = True
SHARE_BY_USERNAME_CASE_SENSITIVE = True
# Toggle whether the permissions system should be enabled.
# If django-guardian is installed and this value is None or True, permissions
# will be applied. If the value is True and django-guardian is not installed
# it is an error. If set to False the permissions will not be applied.
PERMISSIONS_ENABLED = None
# Caches are used to improve performance across various APIs. The two primary
# ones are data and query. Data cache is used for individual data field
# caching such as counts, values, and aggregations. Query cache is used for
# the ad-hoc queries built from a context and view.
DATA_CACHE = 'default'
QUERY_CACHE = 'default'
# Name of the queue to use for scheduling and working on async jobs.
ASYNC_QUEUE = 'avocado'
| simple_types = {'auto': 'key', 'foreignkey': 'key', 'biginteger': 'number', 'decimal': 'number', 'float': 'number', 'integer': 'number', 'positiveinteger': 'number', 'positivesmallinteger': 'number', 'smallinteger': 'number', 'nullboolean': 'boolean', 'char': 'string', 'email': 'string', 'file': 'string', 'filepath': 'string', 'image': 'string', 'ipaddress': 'string', 'slug': 'string', 'text': 'string', 'url': 'string'}
operators = {'key': ('exact', '-exact', 'in', '-in'), 'boolean': ('exact', '-exact', 'in', '-in'), 'date': ('exact', '-exact', 'in', '-in', 'lt', 'lte', 'gt', 'gte', 'range', '-range'), 'number': ('exact', '-exact', 'in', '-in', 'lt', 'lte', 'gt', 'gte', 'range', '-range'), 'string': ('exact', '-exact', 'iexact', '-iexact', 'in', '-in', 'icontains', '-icontains', 'iregex', '-iregex'), 'datetime': ('exact', '-exact', 'in', '-in', 'lt', 'lte', 'gt', 'gte', 'range', '-range'), 'time': ('exact', '-exact', 'in', '-in', 'lt', 'lte', 'gt', 'gte', 'range', '-range')}
internal_datatype_formfields = {'integer': 'FloatField', 'positiveinteger': 'FloatField', 'positivesmallinteger': 'FloatField', 'smallinteger': 'FloatField', 'biginteger': 'FloatField'}
enumerable_maximum = 30
history_enabled = True
history_max_size = None
metadata_migration_app = None
metadata_fixture_dir = None
metadata_fixture_suffix = 'avocado_metadata'
metadata_migration_suffix = 'avocado_metadata_migration'
query_processors = {'default': 'avocado.query.pipeline.QueryProcessor'}
validation_errors = {}
validation_warnings = {}
data_cache_enabled = True
share_by_username = True
share_by_email = True
share_by_username_case_sensitive = True
permissions_enabled = None
data_cache = 'default'
query_cache = 'default'
async_queue = 'avocado' |
constants = {
# --- ASSETS FILE NAMES AND DELAY BETWEEN FOOTAGE
"CALIBRATION_CAMERA_STATIC_PATH": "assets/cam1 - static/calibration.mov",
"CALIBRATION_CAMERA_MOVING_PATH": "assets/cam2 - moving light/calibration.mp4",
"COIN_1_VIDEO_CAMERA_STATIC_PATH": "assets/cam1 - static/coin1.mov",
"COIN_1_VIDEO_CAMERA_MOVING_PATH": "assets/cam2 - moving light/coin1.mp4",
"COIN_2_VIDEO_CAMERA_STATIC_PATH": "assets/cam1 - static/coin2.mov",
"COIN_2_VIDEO_CAMERA_MOVING_PATH": "assets/cam2 - moving light/coin2.mp4",
"COIN_3_VIDEO_CAMERA_STATIC_PATH": "assets/cam1 - static/coin3.mov",
"COIN_3_VIDEO_CAMERA_MOVING_PATH": "assets/cam2 - moving light/coin3.mp4",
"COIN_4_VIDEO_CAMERA_STATIC_PATH": "assets/cam1 - static/coin4.mov",
"COIN_4_VIDEO_CAMERA_MOVING_PATH": "assets/cam2 - moving light/coin4.mp4",
"FILE_1_MOVING_CAMERA_DELAY": 2.724, # [seconds] (static) 3.609 - 0.885 (moving)
"FILE_2_MOVING_CAMERA_DELAY": 2.024, # [seconds] (static) 2.995 - 0.971 (moving)
"FILE_3_MOVING_CAMERA_DELAY": 2.275, # [seconds] (static) 3.355 - 1.08 (moving)
"FILE_4_MOVING_CAMERA_DELAY": 2.015, # [seconds] (static) 2.960 - 0.945 (moving)
# --- CAMERA CALIBRATION CONSTANTS
"CHESSBOARD_SIZE": (6, 9),
"CALIBRATION_FRAME_SKIP_INTERVAL": 40, # We just need some, not all
# --- ANALYSIS CONSTANTS
"SQAURE_GRID_DIMENSION": 200, # It will be a 400x400 square grid inside the marker
"ALIGNED_VIDEO_FPS": 30,
"ANALYSIS_FRAME_SKIP": 5, # It will skip this frames each iteration during analysis
# --- DEBUG CONSTANTS
"STATIC_CAMERA_FEED_WINDOW_TITLE": "Static camera feed",
"MOVING_CAMERA_FEED_WINDOW_TITLE": "Moving camera feed",
"WARPED_FRAME_WINDOW_TITLE": "Warped moving frame",
"LIGHT_DIRECTION_WINDOW_TITLE": "Light direction",
"LIGHT_DIRECTION_WINDOW_SIZE": 200,
# --- INTERACTIVE RELIGHTING CONSTANTS
"INTERPOLATED_WINDOW_TITLE": "Interpolated Data",
"INPUT_LIGHT_DIRECTION_WINDOW_TITLE": "Light direction input",
# --- DATA FILE NAMES CONSTANTS
"CALIBRATION_INTRINSICS_CAMERA_STATIC_PATH": "data/static_intrinsics.xml",
"CALIBRATION_INTRINSICS_CAMERA_MOVING_PATH": "data/moving_intrinsics.xml",
"COIN_1_ALIGNED_VIDEO_STATIC_PATH": "data/1_static_aligned_video.mov",
"COIN_1_ALIGNED_VIDEO_MOVING_PATH": "data/1_moving_aligned_video.mp4",
"COIN_2_ALIGNED_VIDEO_STATIC_PATH": "data/2_static_aligned_video.mov",
"COIN_2_ALIGNED_VIDEO_MOVING_PATH": "data/2_moving_aligned_video.mp4",
"COIN_3_ALIGNED_VIDEO_STATIC_PATH": "data/3_static_aligned_video.mov",
"COIN_3_ALIGNED_VIDEO_MOVING_PATH": "data/3_moving_aligned_video.mp4",
"COIN_4_ALIGNED_VIDEO_STATIC_PATH": "data/4_static_aligned_video.mov",
"COIN_4_ALIGNED_VIDEO_MOVING_PATH": "data/4_moving_aligned_video.mp4",
"COIN_1_EXTRACTED_DATA_FILE_PATH": "data/1_extracted_data.npz",
"COIN_2_EXTRACTED_DATA_FILE_PATH": "data/2_extracted_data.npz",
"COIN_3_EXTRACTED_DATA_FILE_PATH": "data/3_extracted_data.npz",
"COIN_4_EXTRACTED_DATA_FILE_PATH": "data/4_extracted_data.npz",
"COIN_1_INTERPOLATED_DATA_RBF_FILE_PATH": "data/1_rbf_interpolated_data.npz",
"COIN_2_INTERPOLATED_DATA_RBF_FILE_PATH": "data/2_rbf_interpolated_data.npz",
"COIN_3_INTERPOLATED_DATA_RBF_FILE_PATH": "data/3_rbf_interpolated_data.npz",
"COIN_4_INTERPOLATED_DATA_RBF_FILE_PATH": "data/4_rbf_interpolated_data.npz",
"COIN_1_INTERPOLATED_DATA_PTM_FILE_PATH": "data/1_ptm_interpolated_data.npz",
"COIN_2_INTERPOLATED_DATA_PTM_FILE_PATH": "data/2_ptm_interpolated_data.npz",
"COIN_3_INTERPOLATED_DATA_PTM_FILE_PATH": "data/3_ptm_interpolated_data.npz",
"COIN_4_INTERPOLATED_DATA_PTM_FILE_PATH": "data/4_ptm_interpolated_data.npz",
}
| constants = {'CALIBRATION_CAMERA_STATIC_PATH': 'assets/cam1 - static/calibration.mov', 'CALIBRATION_CAMERA_MOVING_PATH': 'assets/cam2 - moving light/calibration.mp4', 'COIN_1_VIDEO_CAMERA_STATIC_PATH': 'assets/cam1 - static/coin1.mov', 'COIN_1_VIDEO_CAMERA_MOVING_PATH': 'assets/cam2 - moving light/coin1.mp4', 'COIN_2_VIDEO_CAMERA_STATIC_PATH': 'assets/cam1 - static/coin2.mov', 'COIN_2_VIDEO_CAMERA_MOVING_PATH': 'assets/cam2 - moving light/coin2.mp4', 'COIN_3_VIDEO_CAMERA_STATIC_PATH': 'assets/cam1 - static/coin3.mov', 'COIN_3_VIDEO_CAMERA_MOVING_PATH': 'assets/cam2 - moving light/coin3.mp4', 'COIN_4_VIDEO_CAMERA_STATIC_PATH': 'assets/cam1 - static/coin4.mov', 'COIN_4_VIDEO_CAMERA_MOVING_PATH': 'assets/cam2 - moving light/coin4.mp4', 'FILE_1_MOVING_CAMERA_DELAY': 2.724, 'FILE_2_MOVING_CAMERA_DELAY': 2.024, 'FILE_3_MOVING_CAMERA_DELAY': 2.275, 'FILE_4_MOVING_CAMERA_DELAY': 2.015, 'CHESSBOARD_SIZE': (6, 9), 'CALIBRATION_FRAME_SKIP_INTERVAL': 40, 'SQAURE_GRID_DIMENSION': 200, 'ALIGNED_VIDEO_FPS': 30, 'ANALYSIS_FRAME_SKIP': 5, 'STATIC_CAMERA_FEED_WINDOW_TITLE': 'Static camera feed', 'MOVING_CAMERA_FEED_WINDOW_TITLE': 'Moving camera feed', 'WARPED_FRAME_WINDOW_TITLE': 'Warped moving frame', 'LIGHT_DIRECTION_WINDOW_TITLE': 'Light direction', 'LIGHT_DIRECTION_WINDOW_SIZE': 200, 'INTERPOLATED_WINDOW_TITLE': 'Interpolated Data', 'INPUT_LIGHT_DIRECTION_WINDOW_TITLE': 'Light direction input', 'CALIBRATION_INTRINSICS_CAMERA_STATIC_PATH': 'data/static_intrinsics.xml', 'CALIBRATION_INTRINSICS_CAMERA_MOVING_PATH': 'data/moving_intrinsics.xml', 'COIN_1_ALIGNED_VIDEO_STATIC_PATH': 'data/1_static_aligned_video.mov', 'COIN_1_ALIGNED_VIDEO_MOVING_PATH': 'data/1_moving_aligned_video.mp4', 'COIN_2_ALIGNED_VIDEO_STATIC_PATH': 'data/2_static_aligned_video.mov', 'COIN_2_ALIGNED_VIDEO_MOVING_PATH': 'data/2_moving_aligned_video.mp4', 'COIN_3_ALIGNED_VIDEO_STATIC_PATH': 'data/3_static_aligned_video.mov', 'COIN_3_ALIGNED_VIDEO_MOVING_PATH': 'data/3_moving_aligned_video.mp4', 'COIN_4_ALIGNED_VIDEO_STATIC_PATH': 'data/4_static_aligned_video.mov', 'COIN_4_ALIGNED_VIDEO_MOVING_PATH': 'data/4_moving_aligned_video.mp4', 'COIN_1_EXTRACTED_DATA_FILE_PATH': 'data/1_extracted_data.npz', 'COIN_2_EXTRACTED_DATA_FILE_PATH': 'data/2_extracted_data.npz', 'COIN_3_EXTRACTED_DATA_FILE_PATH': 'data/3_extracted_data.npz', 'COIN_4_EXTRACTED_DATA_FILE_PATH': 'data/4_extracted_data.npz', 'COIN_1_INTERPOLATED_DATA_RBF_FILE_PATH': 'data/1_rbf_interpolated_data.npz', 'COIN_2_INTERPOLATED_DATA_RBF_FILE_PATH': 'data/2_rbf_interpolated_data.npz', 'COIN_3_INTERPOLATED_DATA_RBF_FILE_PATH': 'data/3_rbf_interpolated_data.npz', 'COIN_4_INTERPOLATED_DATA_RBF_FILE_PATH': 'data/4_rbf_interpolated_data.npz', 'COIN_1_INTERPOLATED_DATA_PTM_FILE_PATH': 'data/1_ptm_interpolated_data.npz', 'COIN_2_INTERPOLATED_DATA_PTM_FILE_PATH': 'data/2_ptm_interpolated_data.npz', 'COIN_3_INTERPOLATED_DATA_PTM_FILE_PATH': 'data/3_ptm_interpolated_data.npz', 'COIN_4_INTERPOLATED_DATA_PTM_FILE_PATH': 'data/4_ptm_interpolated_data.npz'} |
def timeConversion(s):
if "P" in s:
s = s.split(":")
if s[0] == '12':
s = s.split(":")
s[2] = s[2][:2]
print(":".join(s))
else:
s[0] = str(int(s[0])+12)
s[2] = s[2][:2]
print(":".join(s))
else:
s = s.split(":")
if s[0] == "12":
s[0] == "00"
print(s)
s[2] = s[2][:2]
print(":".join(s),'AM')
else:
s[2] = s[2][:2]
print(":".join(s))
s = input()
timeConversion(s)
| def time_conversion(s):
if 'P' in s:
s = s.split(':')
if s[0] == '12':
s = s.split(':')
s[2] = s[2][:2]
print(':'.join(s))
else:
s[0] = str(int(s[0]) + 12)
s[2] = s[2][:2]
print(':'.join(s))
else:
s = s.split(':')
if s[0] == '12':
s[0] == '00'
print(s)
s[2] = s[2][:2]
print(':'.join(s), 'AM')
else:
s[2] = s[2][:2]
print(':'.join(s))
s = input()
time_conversion(s) |
def for_loop4(str, x):
result = 0
for i in str:
if i == x:
result += 1
return result
def main():
print(for_loop4('athenian', 'e'))
print(for_loop4('apples', 'a'))
print(for_loop4('hello', 'a'))
print(for_loop4('alphabet', 'h'))
print(for_loop4('aaaaa', 'b'))
if __name__ == '__main__':
main()
| def for_loop4(str, x):
result = 0
for i in str:
if i == x:
result += 1
return result
def main():
print(for_loop4('athenian', 'e'))
print(for_loop4('apples', 'a'))
print(for_loop4('hello', 'a'))
print(for_loop4('alphabet', 'h'))
print(for_loop4('aaaaa', 'b'))
if __name__ == '__main__':
main() |
"""
Tuples
- iterable
- immutable
- strings are also immutable
"""
car = ('honda', 'city', 'white', 'DL09671', '78878GFG', 2016)
print(car)
print(type(car))
print(len(car))
for item in car:
print(item)
print(car[0])
| """
Tuples
- iterable
- immutable
- strings are also immutable
"""
car = ('honda', 'city', 'white', 'DL09671', '78878GFG', 2016)
print(car)
print(type(car))
print(len(car))
for item in car:
print(item)
print(car[0]) |
# Author : Nekyz
# Date : 30/06/2015
# Project Euler Challenge 3
# Largest palindrome of 2 three digit number
def is_palindrome (n):
# Reversing n to see if it's the same ! Extended slice are fun
if str(n) == (str(n))[::-1]:
return True
return False
max = 0
for i in range(999,100,-1):
for j in range (999,100,-1):
product = i * j
if is_palindrome(product):
if (product > max):
max = product
print(i," * ",j," = ", product)
print("Max palindrome is : ", max)
| def is_palindrome(n):
if str(n) == str(n)[::-1]:
return True
return False
max = 0
for i in range(999, 100, -1):
for j in range(999, 100, -1):
product = i * j
if is_palindrome(product):
if product > max:
max = product
print(i, ' * ', j, ' = ', product)
print('Max palindrome is : ', max) |
# -*- coding: utf-8 -*-
def remove_duplicate_elements(check_list):
func = lambda x,y:x if y in x else x + [y]
return reduce(func, [[], ] + check_list)
| def remove_duplicate_elements(check_list):
func = lambda x, y: x if y in x else x + [y]
return reduce(func, [[]] + check_list) |
class LightingSource(Enum, IComparable, IFormattable, IConvertible):
"""
Indicates the lighting scheme type in rendering settings.
enum LightingSource,values: ExteriorArtificial (23),ExteriorSun (21),ExteriorSunAndArtificial (22),InteriorArtificial (26),InteriorSun (24),InteriorSunAndArtificial (25)
"""
def __eq__(self, *args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self, *args):
""" __format__(formattable: IFormattable,format: str) -> str """
pass
def __ge__(self, *args):
pass
def __gt__(self, *args):
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self, *args):
pass
def __lt__(self, *args):
pass
def __ne__(self, *args):
pass
def __reduce_ex__(self, *args):
pass
def __str__(self, *args):
pass
ExteriorArtificial = None
ExteriorSun = None
ExteriorSunAndArtificial = None
InteriorArtificial = None
InteriorSun = None
InteriorSunAndArtificial = None
value__ = None
| class Lightingsource(Enum, IComparable, IFormattable, IConvertible):
"""
Indicates the lighting scheme type in rendering settings.
enum LightingSource,values: ExteriorArtificial (23),ExteriorSun (21),ExteriorSunAndArtificial (22),InteriorArtificial (26),InteriorSun (24),InteriorSunAndArtificial (25)
"""
def __eq__(self, *args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self, *args):
""" __format__(formattable: IFormattable,format: str) -> str """
pass
def __ge__(self, *args):
pass
def __gt__(self, *args):
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self, *args):
pass
def __lt__(self, *args):
pass
def __ne__(self, *args):
pass
def __reduce_ex__(self, *args):
pass
def __str__(self, *args):
pass
exterior_artificial = None
exterior_sun = None
exterior_sun_and_artificial = None
interior_artificial = None
interior_sun = None
interior_sun_and_artificial = None
value__ = None |
# coding: utf-8
mail_conf = {
"host": "",
"sender": "boom_run raise error",
"username": "",
"passwd": "",
"mail_postfix": "",
"recipients": [
"",
]
}
redis_conf = {
"host": "127.0.0.1",
"port": 6379,
}
| mail_conf = {'host': '', 'sender': 'boom_run raise error', 'username': '', 'passwd': '', 'mail_postfix': '', 'recipients': ['']}
redis_conf = {'host': '127.0.0.1', 'port': 6379} |
#
# PySNMP MIB module BEGEMOT-PF-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BEGEMOT-PF-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:37:07 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")
ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection")
begemot, = mibBuilder.importSymbols("BEGEMOT-MIB", "begemot")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Gauge32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, Bits, ObjectIdentity, Integer32, TimeTicks, Unsigned32, NotificationType, IpAddress, MibIdentifier, Counter32, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "Bits", "ObjectIdentity", "Integer32", "TimeTicks", "Unsigned32", "NotificationType", "IpAddress", "MibIdentifier", "Counter32", "Counter64")
TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue")
begemotPf = ModuleIdentity((1, 3, 6, 1, 4, 1, 12325, 1, 200))
if mibBuilder.loadTexts: begemotPf.setLastUpdated('200501240000Z')
if mibBuilder.loadTexts: begemotPf.setOrganization('NixSys BVBA')
if mibBuilder.loadTexts: begemotPf.setContactInfo(' Philip Paeps Postal: NixSys BVBA Louizastraat 14 BE-2800 Mechelen Belgium E-Mail: philip@FreeBSD.org')
if mibBuilder.loadTexts: begemotPf.setDescription('The Begemot MIB for the pf packet filter.')
begemotPfObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1))
pfStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1))
pfCounter = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2))
pfStateTable = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3))
pfSrcNodes = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4))
pfLimits = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5))
pfTimeouts = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6))
pfLogInterface = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7))
pfInterfaces = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8))
pfTables = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9))
pfAltq = MibIdentifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10))
pfStatusRunning = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfStatusRunning.setStatus('current')
if mibBuilder.loadTexts: pfStatusRunning.setDescription('True if pf is currently enabled.')
pfStatusRuntime = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 2), TimeTicks()).setUnits('1/100th of a Second').setMaxAccess("readonly")
if mibBuilder.loadTexts: pfStatusRuntime.setStatus('current')
if mibBuilder.loadTexts: pfStatusRuntime.setDescription('Indicates how long pf has been enabled. If pf is not currently enabled, indicates how long it has been disabled. If pf has not been enabled or disabled since the system was started, the value will be 0.')
pfStatusDebug = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("urgent", 1), ("misc", 2), ("loud", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfStatusDebug.setStatus('current')
if mibBuilder.loadTexts: pfStatusDebug.setDescription('Indicates the debug level at which pf is running.')
pfStatusHostId = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 4), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfStatusHostId.setStatus('current')
if mibBuilder.loadTexts: pfStatusHostId.setDescription('The (unique) host identifier of the machine running pf.')
pfCounterMatch = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfCounterMatch.setStatus('current')
if mibBuilder.loadTexts: pfCounterMatch.setDescription('Number of packets that matched a filter rule.')
pfCounterBadOffset = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfCounterBadOffset.setStatus('current')
if mibBuilder.loadTexts: pfCounterBadOffset.setDescription('Number of packets with bad offset.')
pfCounterFragment = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfCounterFragment.setStatus('current')
if mibBuilder.loadTexts: pfCounterFragment.setDescription('Number of fragmented packets.')
pfCounterShort = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfCounterShort.setStatus('current')
if mibBuilder.loadTexts: pfCounterShort.setDescription('Number of short packets.')
pfCounterNormalize = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfCounterNormalize.setStatus('current')
if mibBuilder.loadTexts: pfCounterNormalize.setDescription('Number of normalized packets.')
pfCounterMemDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfCounterMemDrop.setStatus('current')
if mibBuilder.loadTexts: pfCounterMemDrop.setDescription('Number of packets dropped due to memory limitations.')
pfStateTableCount = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfStateTableCount.setStatus('current')
if mibBuilder.loadTexts: pfStateTableCount.setDescription('Number of entries in the state table.')
pfStateTableSearches = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfStateTableSearches.setStatus('current')
if mibBuilder.loadTexts: pfStateTableSearches.setDescription('Number of searches against the state table.')
pfStateTableInserts = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfStateTableInserts.setStatus('current')
if mibBuilder.loadTexts: pfStateTableInserts.setDescription('Number of entries inserted into the state table.')
pfStateTableRemovals = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfStateTableRemovals.setStatus('current')
if mibBuilder.loadTexts: pfStateTableRemovals.setDescription('Number of entries removed from the state table.')
pfSrcNodesCount = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfSrcNodesCount.setStatus('current')
if mibBuilder.loadTexts: pfSrcNodesCount.setDescription('Number of entries in the source tracking table.')
pfSrcNodesSearches = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfSrcNodesSearches.setStatus('current')
if mibBuilder.loadTexts: pfSrcNodesSearches.setDescription('Number of searches against the source tracking table.')
pfSrcNodesInserts = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfSrcNodesInserts.setStatus('current')
if mibBuilder.loadTexts: pfSrcNodesInserts.setDescription('Number of entries inserted into the source tracking table.')
pfSrcNodesRemovals = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfSrcNodesRemovals.setStatus('current')
if mibBuilder.loadTexts: pfSrcNodesRemovals.setDescription('Number of entries removed from the source tracking table.')
pfLimitsStates = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLimitsStates.setStatus('current')
if mibBuilder.loadTexts: pfLimitsStates.setDescription("Maximum number of 'keep state' rules in the ruleset.")
pfLimitsSrcNodes = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLimitsSrcNodes.setStatus('current')
if mibBuilder.loadTexts: pfLimitsSrcNodes.setDescription("Maximum number of 'sticky-address' or 'source-track' rules in the ruleset.")
pfLimitsFrags = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLimitsFrags.setStatus('current')
if mibBuilder.loadTexts: pfLimitsFrags.setDescription("Maximum number of 'scrub' rules in the ruleset.")
pfTimeoutsTcpFirst = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsTcpFirst.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsTcpFirst.setDescription('State after the first packet in a connection.')
pfTimeoutsTcpOpening = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsTcpOpening.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsTcpOpening.setDescription('State before the destination host ever sends a packet.')
pfTimeoutsTcpEstablished = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsTcpEstablished.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsTcpEstablished.setDescription('The fully established state.')
pfTimeoutsTcpClosing = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 4), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsTcpClosing.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsTcpClosing.setDescription('State after the first FIN has been sent.')
pfTimeoutsTcpFinWait = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsTcpFinWait.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsTcpFinWait.setDescription('State after both FINs have been exchanged and the connection is closed.')
pfTimeoutsTcpClosed = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsTcpClosed.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsTcpClosed.setDescription('State after one endpoint sends an RST.')
pfTimeoutsUdpFirst = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsUdpFirst.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsUdpFirst.setDescription('State after the first packet.')
pfTimeoutsUdpSingle = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsUdpSingle.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsUdpSingle.setDescription('State if the source host sends more than one packet but the destination host has never sent one back.')
pfTimeoutsUdpMultiple = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 9), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsUdpMultiple.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsUdpMultiple.setDescription('State if both hosts have sent packets.')
pfTimeoutsIcmpFirst = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsIcmpFirst.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsIcmpFirst.setDescription('State after the first packet.')
pfTimeoutsIcmpError = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsIcmpError.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsIcmpError.setDescription('State after an ICMP error came back in response to an ICMP packet.')
pfTimeoutsOtherFirst = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 12), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsOtherFirst.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsOtherFirst.setDescription('State after the first packet.')
pfTimeoutsOtherSingle = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 13), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsOtherSingle.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsOtherSingle.setDescription('State if the source host sends more than one packet but the destination host has never sent one back.')
pfTimeoutsOtherMultiple = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 14), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsOtherMultiple.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsOtherMultiple.setDescription('State if both hosts have sent packets.')
pfTimeoutsFragment = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 15), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsFragment.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsFragment.setDescription('Seconds before an unassembled fragment is expired.')
pfTimeoutsInterval = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 16), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsInterval.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsInterval.setDescription('Interval between purging expired states and fragments.')
pfTimeoutsAdaptiveStart = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 17), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsAdaptiveStart.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsAdaptiveStart.setDescription('When the number of state entries exceeds this value, adaptive scaling begins.')
pfTimeoutsAdaptiveEnd = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 18), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsAdaptiveEnd.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsAdaptiveEnd.setDescription('When reaching this number of state entries, all timeout values become zero, effectively purging all state entries immediately.')
pfTimeoutsSrcNode = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 19), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTimeoutsSrcNode.setStatus('current')
if mibBuilder.loadTexts: pfTimeoutsSrcNode.setDescription('Length of time to retain a source tracking entry after the last state expires.')
pfLogInterfaceName = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 1), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceName.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceName.setDescription("The name of the interface configured with 'set loginterface'. If no interface has been configured, the object will be empty.")
pfLogInterfaceIp4BytesIn = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp4BytesIn.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp4BytesIn.setDescription('Number of IPv4 bytes passed in on the loginterface.')
pfLogInterfaceIp4BytesOut = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp4BytesOut.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp4BytesOut.setDescription('Number of IPv4 bytes passed out on the loginterface.')
pfLogInterfaceIp4PktsInPass = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp4PktsInPass.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp4PktsInPass.setDescription('Number of IPv4 packets passed in on the loginterface.')
pfLogInterfaceIp4PktsInDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp4PktsInDrop.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp4PktsInDrop.setDescription('Number of IPv4 packets dropped coming in on the loginterface.')
pfLogInterfaceIp4PktsOutPass = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp4PktsOutPass.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp4PktsOutPass.setDescription('Number of IPv4 packets passed out on the loginterface.')
pfLogInterfaceIp4PktsOutDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp4PktsOutDrop.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp4PktsOutDrop.setDescription('Number of IPv4 packets dropped going out on the loginterface.')
pfLogInterfaceIp6BytesIn = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp6BytesIn.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp6BytesIn.setDescription('Number of IPv6 bytes passed in on the loginterface.')
pfLogInterfaceIp6BytesOut = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp6BytesOut.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp6BytesOut.setDescription('Number of IPv6 bytes passed out on the loginterface.')
pfLogInterfaceIp6PktsInPass = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp6PktsInPass.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp6PktsInPass.setDescription('Number of IPv6 packets passed in on the loginterface.')
pfLogInterfaceIp6PktsInDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp6PktsInDrop.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp6PktsInDrop.setDescription('Number of IPv6 packets dropped coming in on the loginterface.')
pfLogInterfaceIp6PktsOutPass = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp6PktsOutPass.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp6PktsOutPass.setDescription('Number of IPv6 packets passed out on the loginterface.')
pfLogInterfaceIp6PktsOutDrop = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfLogInterfaceIp6PktsOutDrop.setStatus('current')
if mibBuilder.loadTexts: pfLogInterfaceIp6PktsOutDrop.setDescription('Number of IPv6 packets dropped going out on the loginterface.')
pfInterfacesIfNumber = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIfNumber.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIfNumber.setDescription('The number of network interfaces on this system.')
pfInterfacesIfTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2), )
if mibBuilder.loadTexts: pfInterfacesIfTable.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIfTable.setDescription('Table of network interfaces, indexed on pfInterfacesIfNumber.')
pfInterfacesIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1), ).setIndexNames((0, "BEGEMOT-PF-MIB", "pfInterfacesIfIndex"))
if mibBuilder.loadTexts: pfInterfacesIfEntry.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIfEntry.setDescription('An entry in the pfInterfacesIfTable containing information about a particular network interface in the machine.')
pfInterfacesIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: pfInterfacesIfIndex.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIfIndex.setDescription('A unique value, greater than zero, for each interface.')
pfInterfacesIfDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIfDescr.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIfDescr.setDescription('The name of the interface.')
pfInterfacesIfType = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("group", 0), ("instance", 1), ("detached", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIfType.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIfType.setDescription('Indicates whether the interface is a group inteface, an interface instance, or whether it has been removed or destroyed.')
pfInterfacesIfTZero = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 4), TimeTicks()).setUnits('1/100th of a Second').setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIfTZero.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIfTZero.setDescription('Time since statistics were last reset or since the interface was loaded.')
pfInterfacesIfRefsState = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIfRefsState.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIfRefsState.setDescription('The number of state and/or source track entries referencing this interface.')
pfInterfacesIfRefsRule = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIfRefsRule.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIfRefsRule.setDescription('The number of rules referencing this interface.')
pfInterfacesIf4BytesInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf4BytesInPass.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf4BytesInPass.setDescription('The number of IPv4 bytes passed coming in on this interface.')
pfInterfacesIf4BytesInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf4BytesInBlock.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf4BytesInBlock.setDescription('The number of IPv4 bytes blocked coming in on this interface.')
pfInterfacesIf4BytesOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf4BytesOutPass.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf4BytesOutPass.setDescription('The number of IPv4 bytes passed going out on this interface.')
pfInterfacesIf4BytesOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf4BytesOutBlock.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf4BytesOutBlock.setDescription('The number of IPv4 bytes blocked going out on this interface.')
pfInterfacesIf4PktsInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf4PktsInPass.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf4PktsInPass.setDescription('The number of IPv4 packets passed coming in on this interface.')
pfInterfacesIf4PktsInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf4PktsInBlock.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf4PktsInBlock.setDescription('The number of IPv4 packets blocked coming in on this interface.')
pfInterfacesIf4PktsOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf4PktsOutPass.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf4PktsOutPass.setDescription('The number of IPv4 packets passed going out on this interface.')
pfInterfacesIf4PktsOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf4PktsOutBlock.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf4PktsOutBlock.setDescription('The number of IPv4 packets blocked going out on this interface.')
pfInterfacesIf6BytesInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf6BytesInPass.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf6BytesInPass.setDescription('The number of IPv6 bytes passed coming in on this interface.')
pfInterfacesIf6BytesInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf6BytesInBlock.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf6BytesInBlock.setDescription('The number of IPv6 bytes blocked coming in on this interface.')
pfInterfacesIf6BytesOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf6BytesOutPass.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf6BytesOutPass.setDescription('The number of IPv6 bytes passed going out on this interface.')
pfInterfacesIf6BytesOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf6BytesOutBlock.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf6BytesOutBlock.setDescription('The number of IPv6 bytes blocked going out on this interface.')
pfInterfacesIf6PktsInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf6PktsInPass.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf6PktsInPass.setDescription('The number of IPv6 packets passed coming in on this interface.')
pfInterfacesIf6PktsInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf6PktsInBlock.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf6PktsInBlock.setDescription('The number of IPv6 packets blocked coming in on this interface.')
pfInterfacesIf6PktsOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 21), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf6PktsOutPass.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf6PktsOutPass.setDescription('The number of IPv6 packets passed going out on this interface.')
pfInterfacesIf6PktsOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 22), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfInterfacesIf6PktsOutBlock.setStatus('current')
if mibBuilder.loadTexts: pfInterfacesIf6PktsOutBlock.setDescription('The number of IPv6 packets blocked going out on this interface.')
pfTablesTblNumber = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblNumber.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblNumber.setDescription('The number of tables on this system.')
pfTablesTblTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2), )
if mibBuilder.loadTexts: pfTablesTblTable.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblTable.setDescription('Table of tables, index on pfTablesTblIndex.')
pfTablesTblEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1), ).setIndexNames((0, "BEGEMOT-PF-MIB", "pfTablesTblIndex"))
if mibBuilder.loadTexts: pfTablesTblEntry.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblEntry.setDescription('Any entry in the pfTablesTblTable containing information about a particular table on the system.')
pfTablesTblIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: pfTablesTblIndex.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblIndex.setDescription('A unique value, greater than zero, for each table.')
pfTablesTblDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblDescr.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblDescr.setDescription('The name of the table.')
pfTablesTblCount = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblCount.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblCount.setDescription('The number of addresses in the table.')
pfTablesTblTZero = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 4), TimeTicks()).setUnits('1/100th of a Second').setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblTZero.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblTZero.setDescription('The time passed since the statistics of this table were last cleared or the time since this table was loaded, whichever is sooner.')
pfTablesTblRefsAnchor = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblRefsAnchor.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblRefsAnchor.setDescription('The number of anchors referencing this table.')
pfTablesTblRefsRule = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblRefsRule.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblRefsRule.setDescription('The number of rules referencing this table.')
pfTablesTblEvalMatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblEvalMatch.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblEvalMatch.setDescription('The number of evaluations returning a match.')
pfTablesTblEvalNoMatch = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblEvalNoMatch.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblEvalNoMatch.setDescription('The number of evaluations not returning a match.')
pfTablesTblBytesInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblBytesInPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblBytesInPass.setDescription('The number of bytes passed in matching the table.')
pfTablesTblBytesInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblBytesInBlock.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblBytesInBlock.setDescription('The number of bytes blocked coming in matching the table.')
pfTablesTblBytesInXPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblBytesInXPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblBytesInXPass.setDescription('The number of bytes statefully passed in where the state entry refers to the table, but the table no longer contains the address in question.')
pfTablesTblBytesOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblBytesOutPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblBytesOutPass.setDescription('The number of bytes passed out matching the table.')
pfTablesTblBytesOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblBytesOutBlock.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblBytesOutBlock.setDescription('The number of bytes blocked going out matching the table.')
pfTablesTblBytesOutXPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblBytesOutXPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblBytesOutXPass.setDescription('The number of bytes statefully passed out where the state entry refers to the table, but the table no longer contains the address in question.')
pfTablesTblPktsInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblPktsInPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblPktsInPass.setDescription('The number of packets passed in matching the table.')
pfTablesTblPktsInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblPktsInBlock.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblPktsInBlock.setDescription('The number of packets blocked coming in matching the table.')
pfTablesTblPktsInXPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 17), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblPktsInXPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblPktsInXPass.setDescription('The number of packets statefully passed in where the state entry refers to the table, but the table no longer contains the address in question.')
pfTablesTblPktsOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 18), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblPktsOutPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblPktsOutPass.setDescription('The number of packets passed out matching the table.')
pfTablesTblPktsOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 19), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblPktsOutBlock.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblPktsOutBlock.setDescription('The number of packets blocked going out matching the table.')
pfTablesTblPktsOutXPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 20), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesTblPktsOutXPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesTblPktsOutXPass.setDescription('The number of packets statefully passed out where the state entry refers to the table, but the table no longer contains the address in question.')
pfTablesAddrTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3), )
if mibBuilder.loadTexts: pfTablesAddrTable.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrTable.setDescription('Table of addresses from every table on the system.')
pfTablesAddrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1), ).setIndexNames((0, "BEGEMOT-PF-MIB", "pfTablesAddrIndex"))
if mibBuilder.loadTexts: pfTablesAddrEntry.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrEntry.setDescription('An entry in the pfTablesAddrTable containing information about a particular entry in a table.')
pfTablesAddrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: pfTablesAddrIndex.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrIndex.setDescription('A unique value, greater than zero, for each address.')
pfTablesAddrNet = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 2), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrNet.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrNet.setDescription('The IP address of this particular table entry.')
pfTablesAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrMask.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrMask.setDescription('The CIDR netmask of this particular table entry.')
pfTablesAddrTZero = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 4), TimeTicks()).setUnits('1/100th of a Second').setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrTZero.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrTZero.setDescription("The time passed since this entry's statistics were last cleared, or the time passed since this entry was loaded into the table, whichever is sooner.")
pfTablesAddrBytesInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrBytesInPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrBytesInPass.setDescription('The number of inbound bytes passed as a result of this entry.')
pfTablesAddrBytesInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrBytesInBlock.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrBytesInBlock.setDescription('The number of inbound bytes blocked as a result of this entry.')
pfTablesAddrBytesOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrBytesOutPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrBytesOutPass.setDescription('The number of outbound bytes passed as a result of this entry.')
pfTablesAddrBytesOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrBytesOutBlock.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrBytesOutBlock.setDescription('The number of outbound bytes blocked as a result of this entry.')
pfTablesAddrPktsInPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrPktsInPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrPktsInPass.setDescription('The number of inbound packets passed as a result of this entry.')
pfTablesAddrPktsInBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrPktsInBlock.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrPktsInBlock.setDescription('The number of inbound packets blocked as a result of this entry.')
pfTablesAddrPktsOutPass = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrPktsOutPass.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrPktsOutPass.setDescription('The number of outbound packets passed as a result of this entry.')
pfTablesAddrPktsOutBlock = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfTablesAddrPktsOutBlock.setStatus('current')
if mibBuilder.loadTexts: pfTablesAddrPktsOutBlock.setDescription('The number of outbound packets blocked as a result of this entry.')
pfAltqQueueNumber = MibScalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 1), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfAltqQueueNumber.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueueNumber.setDescription('The number of queues in the active set.')
pfAltqQueueTable = MibTable((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2), )
if mibBuilder.loadTexts: pfAltqQueueTable.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueueTable.setDescription('Table containing the rules that are active on this system.')
pfAltqQueueEntry = MibTableRow((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1), ).setIndexNames((0, "BEGEMOT-PF-MIB", "pfAltqQueueIndex"))
if mibBuilder.loadTexts: pfAltqQueueEntry.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueueEntry.setDescription('An entry in the pfAltqQueueTable table.')
pfAltqQueueIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: pfAltqQueueIndex.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueueIndex.setDescription('A unique value, greater than zero, for each queue.')
pfAltqQueueDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfAltqQueueDescr.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueueDescr.setDescription('The name of the queue.')
pfAltqQueueParent = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 3), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfAltqQueueParent.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueueParent.setDescription("Name of the queue's parent if it has one.")
pfAltqQueueScheduler = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 8, 11))).clone(namedValues=NamedValues(("cbq", 1), ("hfsc", 8), ("priq", 11)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfAltqQueueScheduler.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueueScheduler.setDescription('Scheduler algorithm implemented by this queue.')
pfAltqQueueBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfAltqQueueBandwidth.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueueBandwidth.setDescription('Bandwitch assigned to this queue.')
pfAltqQueuePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfAltqQueuePriority.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueuePriority.setDescription('Priority level of the queue.')
pfAltqQueueLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: pfAltqQueueLimit.setStatus('current')
if mibBuilder.loadTexts: pfAltqQueueLimit.setDescription('Maximum number of packets in the queue.')
mibBuilder.exportSymbols("BEGEMOT-PF-MIB", pfTablesTblIndex=pfTablesTblIndex, pfLogInterfaceIp4PktsOutPass=pfLogInterfaceIp4PktsOutPass, pfTimeoutsTcpOpening=pfTimeoutsTcpOpening, pfStatusRunning=pfStatusRunning, pfStateTableCount=pfStateTableCount, pfSrcNodesSearches=pfSrcNodesSearches, pfCounterBadOffset=pfCounterBadOffset, pfStateTableSearches=pfStateTableSearches, pfTablesTblTable=pfTablesTblTable, pfInterfacesIf6PktsInPass=pfInterfacesIf6PktsInPass, pfInterfacesIf6BytesOutBlock=pfInterfacesIf6BytesOutBlock, pfTablesTblPktsOutPass=pfTablesTblPktsOutPass, pfLogInterfaceIp6BytesOut=pfLogInterfaceIp6BytesOut, pfStatusRuntime=pfStatusRuntime, pfLogInterfaceIp4PktsInDrop=pfLogInterfaceIp4PktsInDrop, pfInterfacesIf4PktsInBlock=pfInterfacesIf4PktsInBlock, pfAltqQueueParent=pfAltqQueueParent, pfInterfacesIfEntry=pfInterfacesIfEntry, pfTablesTblEvalNoMatch=pfTablesTblEvalNoMatch, pfTablesTblBytesOutPass=pfTablesTblBytesOutPass, PYSNMP_MODULE_ID=begemotPf, pfStatusHostId=pfStatusHostId, pfLogInterfaceIp4BytesOut=pfLogInterfaceIp4BytesOut, pfTablesAddrEntry=pfTablesAddrEntry, pfTablesTblPktsInXPass=pfTablesTblPktsInXPass, pfTimeoutsTcpClosing=pfTimeoutsTcpClosing, pfLogInterfaceIp6PktsOutDrop=pfLogInterfaceIp6PktsOutDrop, pfTablesTblBytesInPass=pfTablesTblBytesInPass, pfAltqQueueDescr=pfAltqQueueDescr, pfTimeoutsOtherFirst=pfTimeoutsOtherFirst, pfTablesTblBytesOutBlock=pfTablesTblBytesOutBlock, pfAltqQueueLimit=pfAltqQueueLimit, pfTablesTblPktsInBlock=pfTablesTblPktsInBlock, pfAltqQueueBandwidth=pfAltqQueueBandwidth, pfCounterMemDrop=pfCounterMemDrop, pfInterfacesIf6BytesInBlock=pfInterfacesIf6BytesInBlock, pfInterfaces=pfInterfaces, pfTimeoutsUdpFirst=pfTimeoutsUdpFirst, pfStateTable=pfStateTable, pfInterfacesIf4PktsOutBlock=pfInterfacesIf4PktsOutBlock, pfTimeoutsAdaptiveEnd=pfTimeoutsAdaptiveEnd, pfTablesTblEvalMatch=pfTablesTblEvalMatch, pfInterfacesIfNumber=pfInterfacesIfNumber, pfTablesTblRefsRule=pfTablesTblRefsRule, pfTimeoutsOtherMultiple=pfTimeoutsOtherMultiple, pfTimeoutsTcpFinWait=pfTimeoutsTcpFinWait, pfLogInterfaceIp6BytesIn=pfLogInterfaceIp6BytesIn, pfTablesTblPktsOutXPass=pfTablesTblPktsOutXPass, pfLimits=pfLimits, pfLogInterface=pfLogInterface, pfTimeoutsTcpEstablished=pfTimeoutsTcpEstablished, pfLogInterfaceIp6PktsInPass=pfLogInterfaceIp6PktsInPass, pfAltq=pfAltq, pfTablesTblBytesInXPass=pfTablesTblBytesInXPass, pfTablesTblTZero=pfTablesTblTZero, pfTablesTblRefsAnchor=pfTablesTblRefsAnchor, pfTablesAddrBytesInBlock=pfTablesAddrBytesInBlock, pfInterfacesIf4PktsOutPass=pfInterfacesIf4PktsOutPass, pfTimeoutsTcpClosed=pfTimeoutsTcpClosed, pfInterfacesIf6PktsOutPass=pfInterfacesIf6PktsOutPass, pfTablesAddrPktsInBlock=pfTablesAddrPktsInBlock, begemotPfObjects=begemotPfObjects, pfStateTableRemovals=pfStateTableRemovals, pfTablesAddrBytesInPass=pfTablesAddrBytesInPass, pfTablesTblPktsOutBlock=pfTablesTblPktsOutBlock, pfCounterFragment=pfCounterFragment, pfTimeoutsIcmpFirst=pfTimeoutsIcmpFirst, pfInterfacesIf4BytesOutPass=pfInterfacesIf4BytesOutPass, pfTablesAddrTable=pfTablesAddrTable, pfInterfacesIf4PktsInPass=pfInterfacesIf4PktsInPass, pfLogInterfaceIp6PktsInDrop=pfLogInterfaceIp6PktsInDrop, pfStatusDebug=pfStatusDebug, pfTimeouts=pfTimeouts, pfInterfacesIf4BytesOutBlock=pfInterfacesIf4BytesOutBlock, pfTablesAddrMask=pfTablesAddrMask, pfLogInterfaceIp4BytesIn=pfLogInterfaceIp4BytesIn, pfInterfacesIfTZero=pfInterfacesIfTZero, pfInterfacesIf6PktsOutBlock=pfInterfacesIf6PktsOutBlock, pfCounter=pfCounter, pfTablesAddrBytesOutPass=pfTablesAddrBytesOutPass, pfInterfacesIf6BytesInPass=pfInterfacesIf6BytesInPass, pfTimeoutsUdpSingle=pfTimeoutsUdpSingle, pfInterfacesIfRefsState=pfInterfacesIfRefsState, pfTables=pfTables, pfSrcNodesCount=pfSrcNodesCount, pfTimeoutsFragment=pfTimeoutsFragment, pfInterfacesIfDescr=pfInterfacesIfDescr, pfInterfacesIf6PktsInBlock=pfInterfacesIf6PktsInBlock, pfLogInterfaceIp4PktsOutDrop=pfLogInterfaceIp4PktsOutDrop, pfTablesTblEntry=pfTablesTblEntry, pfInterfacesIf4BytesInBlock=pfInterfacesIf4BytesInBlock, pfTablesAddrTZero=pfTablesAddrTZero, pfTimeoutsOtherSingle=pfTimeoutsOtherSingle, pfLogInterfaceIp4PktsInPass=pfLogInterfaceIp4PktsInPass, pfAltqQueuePriority=pfAltqQueuePriority, pfLogInterfaceIp6PktsOutPass=pfLogInterfaceIp6PktsOutPass, pfTimeoutsAdaptiveStart=pfTimeoutsAdaptiveStart, pfTimeoutsIcmpError=pfTimeoutsIcmpError, begemotPf=begemotPf, pfInterfacesIfIndex=pfInterfacesIfIndex, pfLimitsSrcNodes=pfLimitsSrcNodes, pfCounterMatch=pfCounterMatch, pfInterfacesIfType=pfInterfacesIfType, pfLimitsFrags=pfLimitsFrags, pfCounterNormalize=pfCounterNormalize, pfStateTableInserts=pfStateTableInserts, pfTimeoutsSrcNode=pfTimeoutsSrcNode, pfSrcNodes=pfSrcNodes, pfTimeoutsUdpMultiple=pfTimeoutsUdpMultiple, pfAltqQueueTable=pfAltqQueueTable, pfTablesTblPktsInPass=pfTablesTblPktsInPass, pfAltqQueueNumber=pfAltqQueueNumber, pfStatus=pfStatus, pfTablesTblNumber=pfTablesTblNumber, pfTablesAddrBytesOutBlock=pfTablesAddrBytesOutBlock, pfTablesAddrPktsOutBlock=pfTablesAddrPktsOutBlock, pfAltqQueueIndex=pfAltqQueueIndex, pfSrcNodesInserts=pfSrcNodesInserts, pfInterfacesIf4BytesInPass=pfInterfacesIf4BytesInPass, pfTablesTblDescr=pfTablesTblDescr, pfSrcNodesRemovals=pfSrcNodesRemovals, pfTablesTblCount=pfTablesTblCount, pfTablesAddrPktsInPass=pfTablesAddrPktsInPass, pfInterfacesIf6BytesOutPass=pfInterfacesIf6BytesOutPass, pfTablesTblBytesInBlock=pfTablesTblBytesInBlock, pfLimitsStates=pfLimitsStates, pfTablesAddrIndex=pfTablesAddrIndex, pfTimeoutsTcpFirst=pfTimeoutsTcpFirst, pfAltqQueueEntry=pfAltqQueueEntry, pfTablesAddrNet=pfTablesAddrNet, pfCounterShort=pfCounterShort, pfTimeoutsInterval=pfTimeoutsInterval, pfAltqQueueScheduler=pfAltqQueueScheduler, pfTablesTblBytesOutXPass=pfTablesTblBytesOutXPass, pfTablesAddrPktsOutPass=pfTablesAddrPktsOutPass, pfInterfacesIfTable=pfInterfacesIfTable, pfLogInterfaceName=pfLogInterfaceName, pfInterfacesIfRefsRule=pfInterfacesIfRefsRule)
| (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, single_value_constraint, value_range_constraint, constraints_union, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection')
(begemot,) = mibBuilder.importSymbols('BEGEMOT-MIB', 'begemot')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(gauge32, iso, mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, bits, object_identity, integer32, time_ticks, unsigned32, notification_type, ip_address, mib_identifier, counter32, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'Gauge32', 'iso', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'Bits', 'ObjectIdentity', 'Integer32', 'TimeTicks', 'Unsigned32', 'NotificationType', 'IpAddress', 'MibIdentifier', 'Counter32', 'Counter64')
(textual_convention, display_string, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'TruthValue')
begemot_pf = module_identity((1, 3, 6, 1, 4, 1, 12325, 1, 200))
if mibBuilder.loadTexts:
begemotPf.setLastUpdated('200501240000Z')
if mibBuilder.loadTexts:
begemotPf.setOrganization('NixSys BVBA')
if mibBuilder.loadTexts:
begemotPf.setContactInfo(' Philip Paeps Postal: NixSys BVBA Louizastraat 14 BE-2800 Mechelen Belgium E-Mail: philip@FreeBSD.org')
if mibBuilder.loadTexts:
begemotPf.setDescription('The Begemot MIB for the pf packet filter.')
begemot_pf_objects = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1))
pf_status = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1))
pf_counter = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2))
pf_state_table = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3))
pf_src_nodes = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4))
pf_limits = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5))
pf_timeouts = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6))
pf_log_interface = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7))
pf_interfaces = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8))
pf_tables = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9))
pf_altq = mib_identifier((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10))
pf_status_running = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 1), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfStatusRunning.setStatus('current')
if mibBuilder.loadTexts:
pfStatusRunning.setDescription('True if pf is currently enabled.')
pf_status_runtime = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 2), time_ticks()).setUnits('1/100th of a Second').setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfStatusRuntime.setStatus('current')
if mibBuilder.loadTexts:
pfStatusRuntime.setDescription('Indicates how long pf has been enabled. If pf is not currently enabled, indicates how long it has been disabled. If pf has not been enabled or disabled since the system was started, the value will be 0.')
pf_status_debug = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2, 3))).clone(namedValues=named_values(('none', 0), ('urgent', 1), ('misc', 2), ('loud', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfStatusDebug.setStatus('current')
if mibBuilder.loadTexts:
pfStatusDebug.setDescription('Indicates the debug level at which pf is running.')
pf_status_host_id = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 1, 4), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfStatusHostId.setStatus('current')
if mibBuilder.loadTexts:
pfStatusHostId.setDescription('The (unique) host identifier of the machine running pf.')
pf_counter_match = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 1), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfCounterMatch.setStatus('current')
if mibBuilder.loadTexts:
pfCounterMatch.setDescription('Number of packets that matched a filter rule.')
pf_counter_bad_offset = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfCounterBadOffset.setStatus('current')
if mibBuilder.loadTexts:
pfCounterBadOffset.setDescription('Number of packets with bad offset.')
pf_counter_fragment = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfCounterFragment.setStatus('current')
if mibBuilder.loadTexts:
pfCounterFragment.setDescription('Number of fragmented packets.')
pf_counter_short = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfCounterShort.setStatus('current')
if mibBuilder.loadTexts:
pfCounterShort.setDescription('Number of short packets.')
pf_counter_normalize = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfCounterNormalize.setStatus('current')
if mibBuilder.loadTexts:
pfCounterNormalize.setDescription('Number of normalized packets.')
pf_counter_mem_drop = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 2, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfCounterMemDrop.setStatus('current')
if mibBuilder.loadTexts:
pfCounterMemDrop.setDescription('Number of packets dropped due to memory limitations.')
pf_state_table_count = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 1), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfStateTableCount.setStatus('current')
if mibBuilder.loadTexts:
pfStateTableCount.setDescription('Number of entries in the state table.')
pf_state_table_searches = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfStateTableSearches.setStatus('current')
if mibBuilder.loadTexts:
pfStateTableSearches.setDescription('Number of searches against the state table.')
pf_state_table_inserts = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfStateTableInserts.setStatus('current')
if mibBuilder.loadTexts:
pfStateTableInserts.setDescription('Number of entries inserted into the state table.')
pf_state_table_removals = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 3, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfStateTableRemovals.setStatus('current')
if mibBuilder.loadTexts:
pfStateTableRemovals.setDescription('Number of entries removed from the state table.')
pf_src_nodes_count = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 1), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfSrcNodesCount.setStatus('current')
if mibBuilder.loadTexts:
pfSrcNodesCount.setDescription('Number of entries in the source tracking table.')
pf_src_nodes_searches = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfSrcNodesSearches.setStatus('current')
if mibBuilder.loadTexts:
pfSrcNodesSearches.setDescription('Number of searches against the source tracking table.')
pf_src_nodes_inserts = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfSrcNodesInserts.setStatus('current')
if mibBuilder.loadTexts:
pfSrcNodesInserts.setDescription('Number of entries inserted into the source tracking table.')
pf_src_nodes_removals = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 4, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfSrcNodesRemovals.setStatus('current')
if mibBuilder.loadTexts:
pfSrcNodesRemovals.setDescription('Number of entries removed from the source tracking table.')
pf_limits_states = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5, 1), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLimitsStates.setStatus('current')
if mibBuilder.loadTexts:
pfLimitsStates.setDescription("Maximum number of 'keep state' rules in the ruleset.")
pf_limits_src_nodes = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5, 2), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLimitsSrcNodes.setStatus('current')
if mibBuilder.loadTexts:
pfLimitsSrcNodes.setDescription("Maximum number of 'sticky-address' or 'source-track' rules in the ruleset.")
pf_limits_frags = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 5, 3), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLimitsFrags.setStatus('current')
if mibBuilder.loadTexts:
pfLimitsFrags.setDescription("Maximum number of 'scrub' rules in the ruleset.")
pf_timeouts_tcp_first = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsTcpFirst.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsTcpFirst.setDescription('State after the first packet in a connection.')
pf_timeouts_tcp_opening = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsTcpOpening.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsTcpOpening.setDescription('State before the destination host ever sends a packet.')
pf_timeouts_tcp_established = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsTcpEstablished.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsTcpEstablished.setDescription('The fully established state.')
pf_timeouts_tcp_closing = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 4), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsTcpClosing.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsTcpClosing.setDescription('State after the first FIN has been sent.')
pf_timeouts_tcp_fin_wait = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsTcpFinWait.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsTcpFinWait.setDescription('State after both FINs have been exchanged and the connection is closed.')
pf_timeouts_tcp_closed = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsTcpClosed.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsTcpClosed.setDescription('State after one endpoint sends an RST.')
pf_timeouts_udp_first = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsUdpFirst.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsUdpFirst.setDescription('State after the first packet.')
pf_timeouts_udp_single = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 8), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsUdpSingle.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsUdpSingle.setDescription('State if the source host sends more than one packet but the destination host has never sent one back.')
pf_timeouts_udp_multiple = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 9), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsUdpMultiple.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsUdpMultiple.setDescription('State if both hosts have sent packets.')
pf_timeouts_icmp_first = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 10), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsIcmpFirst.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsIcmpFirst.setDescription('State after the first packet.')
pf_timeouts_icmp_error = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 11), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsIcmpError.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsIcmpError.setDescription('State after an ICMP error came back in response to an ICMP packet.')
pf_timeouts_other_first = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 12), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsOtherFirst.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsOtherFirst.setDescription('State after the first packet.')
pf_timeouts_other_single = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 13), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsOtherSingle.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsOtherSingle.setDescription('State if the source host sends more than one packet but the destination host has never sent one back.')
pf_timeouts_other_multiple = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 14), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsOtherMultiple.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsOtherMultiple.setDescription('State if both hosts have sent packets.')
pf_timeouts_fragment = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 15), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsFragment.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsFragment.setDescription('Seconds before an unassembled fragment is expired.')
pf_timeouts_interval = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 16), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsInterval.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsInterval.setDescription('Interval between purging expired states and fragments.')
pf_timeouts_adaptive_start = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 17), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsAdaptiveStart.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsAdaptiveStart.setDescription('When the number of state entries exceeds this value, adaptive scaling begins.')
pf_timeouts_adaptive_end = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 18), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsAdaptiveEnd.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsAdaptiveEnd.setDescription('When reaching this number of state entries, all timeout values become zero, effectively purging all state entries immediately.')
pf_timeouts_src_node = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 6, 19), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTimeoutsSrcNode.setStatus('current')
if mibBuilder.loadTexts:
pfTimeoutsSrcNode.setDescription('Length of time to retain a source tracking entry after the last state expires.')
pf_log_interface_name = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 1), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceName.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceName.setDescription("The name of the interface configured with 'set loginterface'. If no interface has been configured, the object will be empty.")
pf_log_interface_ip4_bytes_in = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp4BytesIn.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp4BytesIn.setDescription('Number of IPv4 bytes passed in on the loginterface.')
pf_log_interface_ip4_bytes_out = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp4BytesOut.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp4BytesOut.setDescription('Number of IPv4 bytes passed out on the loginterface.')
pf_log_interface_ip4_pkts_in_pass = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp4PktsInPass.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp4PktsInPass.setDescription('Number of IPv4 packets passed in on the loginterface.')
pf_log_interface_ip4_pkts_in_drop = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp4PktsInDrop.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp4PktsInDrop.setDescription('Number of IPv4 packets dropped coming in on the loginterface.')
pf_log_interface_ip4_pkts_out_pass = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp4PktsOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp4PktsOutPass.setDescription('Number of IPv4 packets passed out on the loginterface.')
pf_log_interface_ip4_pkts_out_drop = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp4PktsOutDrop.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp4PktsOutDrop.setDescription('Number of IPv4 packets dropped going out on the loginterface.')
pf_log_interface_ip6_bytes_in = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 8), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp6BytesIn.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp6BytesIn.setDescription('Number of IPv6 bytes passed in on the loginterface.')
pf_log_interface_ip6_bytes_out = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 9), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp6BytesOut.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp6BytesOut.setDescription('Number of IPv6 bytes passed out on the loginterface.')
pf_log_interface_ip6_pkts_in_pass = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 10), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp6PktsInPass.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp6PktsInPass.setDescription('Number of IPv6 packets passed in on the loginterface.')
pf_log_interface_ip6_pkts_in_drop = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 11), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp6PktsInDrop.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp6PktsInDrop.setDescription('Number of IPv6 packets dropped coming in on the loginterface.')
pf_log_interface_ip6_pkts_out_pass = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 12), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp6PktsOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp6PktsOutPass.setDescription('Number of IPv6 packets passed out on the loginterface.')
pf_log_interface_ip6_pkts_out_drop = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 7, 13), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfLogInterfaceIp6PktsOutDrop.setStatus('current')
if mibBuilder.loadTexts:
pfLogInterfaceIp6PktsOutDrop.setDescription('Number of IPv6 packets dropped going out on the loginterface.')
pf_interfaces_if_number = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIfNumber.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIfNumber.setDescription('The number of network interfaces on this system.')
pf_interfaces_if_table = mib_table((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2))
if mibBuilder.loadTexts:
pfInterfacesIfTable.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIfTable.setDescription('Table of network interfaces, indexed on pfInterfacesIfNumber.')
pf_interfaces_if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1)).setIndexNames((0, 'BEGEMOT-PF-MIB', 'pfInterfacesIfIndex'))
if mibBuilder.loadTexts:
pfInterfacesIfEntry.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIfEntry.setDescription('An entry in the pfInterfacesIfTable containing information about a particular network interface in the machine.')
pf_interfaces_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647)))
if mibBuilder.loadTexts:
pfInterfacesIfIndex.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIfIndex.setDescription('A unique value, greater than zero, for each interface.')
pf_interfaces_if_descr = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 2), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIfDescr.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIfDescr.setDescription('The name of the interface.')
pf_interfaces_if_type = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(0, 1, 2))).clone(namedValues=named_values(('group', 0), ('instance', 1), ('detached', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIfType.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIfType.setDescription('Indicates whether the interface is a group inteface, an interface instance, or whether it has been removed or destroyed.')
pf_interfaces_if_t_zero = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 4), time_ticks()).setUnits('1/100th of a Second').setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIfTZero.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIfTZero.setDescription('Time since statistics were last reset or since the interface was loaded.')
pf_interfaces_if_refs_state = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 5), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIfRefsState.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIfRefsState.setDescription('The number of state and/or source track entries referencing this interface.')
pf_interfaces_if_refs_rule = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 6), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIfRefsRule.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIfRefsRule.setDescription('The number of rules referencing this interface.')
pf_interfaces_if4_bytes_in_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf4BytesInPass.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf4BytesInPass.setDescription('The number of IPv4 bytes passed coming in on this interface.')
pf_interfaces_if4_bytes_in_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 8), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf4BytesInBlock.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf4BytesInBlock.setDescription('The number of IPv4 bytes blocked coming in on this interface.')
pf_interfaces_if4_bytes_out_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 9), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf4BytesOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf4BytesOutPass.setDescription('The number of IPv4 bytes passed going out on this interface.')
pf_interfaces_if4_bytes_out_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 10), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf4BytesOutBlock.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf4BytesOutBlock.setDescription('The number of IPv4 bytes blocked going out on this interface.')
pf_interfaces_if4_pkts_in_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 11), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf4PktsInPass.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf4PktsInPass.setDescription('The number of IPv4 packets passed coming in on this interface.')
pf_interfaces_if4_pkts_in_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 12), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf4PktsInBlock.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf4PktsInBlock.setDescription('The number of IPv4 packets blocked coming in on this interface.')
pf_interfaces_if4_pkts_out_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 13), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf4PktsOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf4PktsOutPass.setDescription('The number of IPv4 packets passed going out on this interface.')
pf_interfaces_if4_pkts_out_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 14), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf4PktsOutBlock.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf4PktsOutBlock.setDescription('The number of IPv4 packets blocked going out on this interface.')
pf_interfaces_if6_bytes_in_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 15), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf6BytesInPass.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf6BytesInPass.setDescription('The number of IPv6 bytes passed coming in on this interface.')
pf_interfaces_if6_bytes_in_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 16), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf6BytesInBlock.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf6BytesInBlock.setDescription('The number of IPv6 bytes blocked coming in on this interface.')
pf_interfaces_if6_bytes_out_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 17), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf6BytesOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf6BytesOutPass.setDescription('The number of IPv6 bytes passed going out on this interface.')
pf_interfaces_if6_bytes_out_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 18), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf6BytesOutBlock.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf6BytesOutBlock.setDescription('The number of IPv6 bytes blocked going out on this interface.')
pf_interfaces_if6_pkts_in_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 19), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf6PktsInPass.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf6PktsInPass.setDescription('The number of IPv6 packets passed coming in on this interface.')
pf_interfaces_if6_pkts_in_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 20), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf6PktsInBlock.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf6PktsInBlock.setDescription('The number of IPv6 packets blocked coming in on this interface.')
pf_interfaces_if6_pkts_out_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 21), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf6PktsOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf6PktsOutPass.setDescription('The number of IPv6 packets passed going out on this interface.')
pf_interfaces_if6_pkts_out_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 8, 2, 1, 22), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfInterfacesIf6PktsOutBlock.setStatus('current')
if mibBuilder.loadTexts:
pfInterfacesIf6PktsOutBlock.setDescription('The number of IPv6 packets blocked going out on this interface.')
pf_tables_tbl_number = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblNumber.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblNumber.setDescription('The number of tables on this system.')
pf_tables_tbl_table = mib_table((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2))
if mibBuilder.loadTexts:
pfTablesTblTable.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblTable.setDescription('Table of tables, index on pfTablesTblIndex.')
pf_tables_tbl_entry = mib_table_row((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1)).setIndexNames((0, 'BEGEMOT-PF-MIB', 'pfTablesTblIndex'))
if mibBuilder.loadTexts:
pfTablesTblEntry.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblEntry.setDescription('Any entry in the pfTablesTblTable containing information about a particular table on the system.')
pf_tables_tbl_index = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647)))
if mibBuilder.loadTexts:
pfTablesTblIndex.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblIndex.setDescription('A unique value, greater than zero, for each table.')
pf_tables_tbl_descr = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 2), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblDescr.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblDescr.setDescription('The name of the table.')
pf_tables_tbl_count = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 3), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblCount.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblCount.setDescription('The number of addresses in the table.')
pf_tables_tbl_t_zero = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 4), time_ticks()).setUnits('1/100th of a Second').setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblTZero.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblTZero.setDescription('The time passed since the statistics of this table were last cleared or the time since this table was loaded, whichever is sooner.')
pf_tables_tbl_refs_anchor = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 5), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblRefsAnchor.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblRefsAnchor.setDescription('The number of anchors referencing this table.')
pf_tables_tbl_refs_rule = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblRefsRule.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblRefsRule.setDescription('The number of rules referencing this table.')
pf_tables_tbl_eval_match = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblEvalMatch.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblEvalMatch.setDescription('The number of evaluations returning a match.')
pf_tables_tbl_eval_no_match = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 8), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblEvalNoMatch.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblEvalNoMatch.setDescription('The number of evaluations not returning a match.')
pf_tables_tbl_bytes_in_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 9), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblBytesInPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblBytesInPass.setDescription('The number of bytes passed in matching the table.')
pf_tables_tbl_bytes_in_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 10), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblBytesInBlock.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblBytesInBlock.setDescription('The number of bytes blocked coming in matching the table.')
pf_tables_tbl_bytes_in_x_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 11), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblBytesInXPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblBytesInXPass.setDescription('The number of bytes statefully passed in where the state entry refers to the table, but the table no longer contains the address in question.')
pf_tables_tbl_bytes_out_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 12), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblBytesOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblBytesOutPass.setDescription('The number of bytes passed out matching the table.')
pf_tables_tbl_bytes_out_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 13), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblBytesOutBlock.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblBytesOutBlock.setDescription('The number of bytes blocked going out matching the table.')
pf_tables_tbl_bytes_out_x_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 14), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblBytesOutXPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblBytesOutXPass.setDescription('The number of bytes statefully passed out where the state entry refers to the table, but the table no longer contains the address in question.')
pf_tables_tbl_pkts_in_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 15), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblPktsInPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblPktsInPass.setDescription('The number of packets passed in matching the table.')
pf_tables_tbl_pkts_in_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 16), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblPktsInBlock.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblPktsInBlock.setDescription('The number of packets blocked coming in matching the table.')
pf_tables_tbl_pkts_in_x_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 17), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblPktsInXPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblPktsInXPass.setDescription('The number of packets statefully passed in where the state entry refers to the table, but the table no longer contains the address in question.')
pf_tables_tbl_pkts_out_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 18), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblPktsOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblPktsOutPass.setDescription('The number of packets passed out matching the table.')
pf_tables_tbl_pkts_out_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 19), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblPktsOutBlock.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblPktsOutBlock.setDescription('The number of packets blocked going out matching the table.')
pf_tables_tbl_pkts_out_x_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 2, 1, 20), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesTblPktsOutXPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesTblPktsOutXPass.setDescription('The number of packets statefully passed out where the state entry refers to the table, but the table no longer contains the address in question.')
pf_tables_addr_table = mib_table((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3))
if mibBuilder.loadTexts:
pfTablesAddrTable.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrTable.setDescription('Table of addresses from every table on the system.')
pf_tables_addr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1)).setIndexNames((0, 'BEGEMOT-PF-MIB', 'pfTablesAddrIndex'))
if mibBuilder.loadTexts:
pfTablesAddrEntry.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrEntry.setDescription('An entry in the pfTablesAddrTable containing information about a particular entry in a table.')
pf_tables_addr_index = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647)))
if mibBuilder.loadTexts:
pfTablesAddrIndex.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrIndex.setDescription('A unique value, greater than zero, for each address.')
pf_tables_addr_net = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 2), ip_address()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrNet.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrNet.setDescription('The IP address of this particular table entry.')
pf_tables_addr_mask = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 32))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrMask.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrMask.setDescription('The CIDR netmask of this particular table entry.')
pf_tables_addr_t_zero = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 4), time_ticks()).setUnits('1/100th of a Second').setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrTZero.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrTZero.setDescription("The time passed since this entry's statistics were last cleared, or the time passed since this entry was loaded into the table, whichever is sooner.")
pf_tables_addr_bytes_in_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrBytesInPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrBytesInPass.setDescription('The number of inbound bytes passed as a result of this entry.')
pf_tables_addr_bytes_in_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrBytesInBlock.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrBytesInBlock.setDescription('The number of inbound bytes blocked as a result of this entry.')
pf_tables_addr_bytes_out_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrBytesOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrBytesOutPass.setDescription('The number of outbound bytes passed as a result of this entry.')
pf_tables_addr_bytes_out_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 8), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrBytesOutBlock.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrBytesOutBlock.setDescription('The number of outbound bytes blocked as a result of this entry.')
pf_tables_addr_pkts_in_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 9), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrPktsInPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrPktsInPass.setDescription('The number of inbound packets passed as a result of this entry.')
pf_tables_addr_pkts_in_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 10), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrPktsInBlock.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrPktsInBlock.setDescription('The number of inbound packets blocked as a result of this entry.')
pf_tables_addr_pkts_out_pass = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 11), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrPktsOutPass.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrPktsOutPass.setDescription('The number of outbound packets passed as a result of this entry.')
pf_tables_addr_pkts_out_block = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 9, 3, 1, 12), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfTablesAddrPktsOutBlock.setStatus('current')
if mibBuilder.loadTexts:
pfTablesAddrPktsOutBlock.setDescription('The number of outbound packets blocked as a result of this entry.')
pf_altq_queue_number = mib_scalar((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 1), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfAltqQueueNumber.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueueNumber.setDescription('The number of queues in the active set.')
pf_altq_queue_table = mib_table((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2))
if mibBuilder.loadTexts:
pfAltqQueueTable.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueueTable.setDescription('Table containing the rules that are active on this system.')
pf_altq_queue_entry = mib_table_row((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1)).setIndexNames((0, 'BEGEMOT-PF-MIB', 'pfAltqQueueIndex'))
if mibBuilder.loadTexts:
pfAltqQueueEntry.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueueEntry.setDescription('An entry in the pfAltqQueueTable table.')
pf_altq_queue_index = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647)))
if mibBuilder.loadTexts:
pfAltqQueueIndex.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueueIndex.setDescription('A unique value, greater than zero, for each queue.')
pf_altq_queue_descr = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 2), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfAltqQueueDescr.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueueDescr.setDescription('The name of the queue.')
pf_altq_queue_parent = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 3), octet_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfAltqQueueParent.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueueParent.setDescription("Name of the queue's parent if it has one.")
pf_altq_queue_scheduler = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 8, 11))).clone(namedValues=named_values(('cbq', 1), ('hfsc', 8), ('priq', 11)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfAltqQueueScheduler.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueueScheduler.setDescription('Scheduler algorithm implemented by this queue.')
pf_altq_queue_bandwidth = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 5), unsigned32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfAltqQueueBandwidth.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueueBandwidth.setDescription('Bandwitch assigned to this queue.')
pf_altq_queue_priority = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 6), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfAltqQueuePriority.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueuePriority.setDescription('Priority level of the queue.')
pf_altq_queue_limit = mib_table_column((1, 3, 6, 1, 4, 1, 12325, 1, 200, 1, 10, 2, 1, 7), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
pfAltqQueueLimit.setStatus('current')
if mibBuilder.loadTexts:
pfAltqQueueLimit.setDescription('Maximum number of packets in the queue.')
mibBuilder.exportSymbols('BEGEMOT-PF-MIB', pfTablesTblIndex=pfTablesTblIndex, pfLogInterfaceIp4PktsOutPass=pfLogInterfaceIp4PktsOutPass, pfTimeoutsTcpOpening=pfTimeoutsTcpOpening, pfStatusRunning=pfStatusRunning, pfStateTableCount=pfStateTableCount, pfSrcNodesSearches=pfSrcNodesSearches, pfCounterBadOffset=pfCounterBadOffset, pfStateTableSearches=pfStateTableSearches, pfTablesTblTable=pfTablesTblTable, pfInterfacesIf6PktsInPass=pfInterfacesIf6PktsInPass, pfInterfacesIf6BytesOutBlock=pfInterfacesIf6BytesOutBlock, pfTablesTblPktsOutPass=pfTablesTblPktsOutPass, pfLogInterfaceIp6BytesOut=pfLogInterfaceIp6BytesOut, pfStatusRuntime=pfStatusRuntime, pfLogInterfaceIp4PktsInDrop=pfLogInterfaceIp4PktsInDrop, pfInterfacesIf4PktsInBlock=pfInterfacesIf4PktsInBlock, pfAltqQueueParent=pfAltqQueueParent, pfInterfacesIfEntry=pfInterfacesIfEntry, pfTablesTblEvalNoMatch=pfTablesTblEvalNoMatch, pfTablesTblBytesOutPass=pfTablesTblBytesOutPass, PYSNMP_MODULE_ID=begemotPf, pfStatusHostId=pfStatusHostId, pfLogInterfaceIp4BytesOut=pfLogInterfaceIp4BytesOut, pfTablesAddrEntry=pfTablesAddrEntry, pfTablesTblPktsInXPass=pfTablesTblPktsInXPass, pfTimeoutsTcpClosing=pfTimeoutsTcpClosing, pfLogInterfaceIp6PktsOutDrop=pfLogInterfaceIp6PktsOutDrop, pfTablesTblBytesInPass=pfTablesTblBytesInPass, pfAltqQueueDescr=pfAltqQueueDescr, pfTimeoutsOtherFirst=pfTimeoutsOtherFirst, pfTablesTblBytesOutBlock=pfTablesTblBytesOutBlock, pfAltqQueueLimit=pfAltqQueueLimit, pfTablesTblPktsInBlock=pfTablesTblPktsInBlock, pfAltqQueueBandwidth=pfAltqQueueBandwidth, pfCounterMemDrop=pfCounterMemDrop, pfInterfacesIf6BytesInBlock=pfInterfacesIf6BytesInBlock, pfInterfaces=pfInterfaces, pfTimeoutsUdpFirst=pfTimeoutsUdpFirst, pfStateTable=pfStateTable, pfInterfacesIf4PktsOutBlock=pfInterfacesIf4PktsOutBlock, pfTimeoutsAdaptiveEnd=pfTimeoutsAdaptiveEnd, pfTablesTblEvalMatch=pfTablesTblEvalMatch, pfInterfacesIfNumber=pfInterfacesIfNumber, pfTablesTblRefsRule=pfTablesTblRefsRule, pfTimeoutsOtherMultiple=pfTimeoutsOtherMultiple, pfTimeoutsTcpFinWait=pfTimeoutsTcpFinWait, pfLogInterfaceIp6BytesIn=pfLogInterfaceIp6BytesIn, pfTablesTblPktsOutXPass=pfTablesTblPktsOutXPass, pfLimits=pfLimits, pfLogInterface=pfLogInterface, pfTimeoutsTcpEstablished=pfTimeoutsTcpEstablished, pfLogInterfaceIp6PktsInPass=pfLogInterfaceIp6PktsInPass, pfAltq=pfAltq, pfTablesTblBytesInXPass=pfTablesTblBytesInXPass, pfTablesTblTZero=pfTablesTblTZero, pfTablesTblRefsAnchor=pfTablesTblRefsAnchor, pfTablesAddrBytesInBlock=pfTablesAddrBytesInBlock, pfInterfacesIf4PktsOutPass=pfInterfacesIf4PktsOutPass, pfTimeoutsTcpClosed=pfTimeoutsTcpClosed, pfInterfacesIf6PktsOutPass=pfInterfacesIf6PktsOutPass, pfTablesAddrPktsInBlock=pfTablesAddrPktsInBlock, begemotPfObjects=begemotPfObjects, pfStateTableRemovals=pfStateTableRemovals, pfTablesAddrBytesInPass=pfTablesAddrBytesInPass, pfTablesTblPktsOutBlock=pfTablesTblPktsOutBlock, pfCounterFragment=pfCounterFragment, pfTimeoutsIcmpFirst=pfTimeoutsIcmpFirst, pfInterfacesIf4BytesOutPass=pfInterfacesIf4BytesOutPass, pfTablesAddrTable=pfTablesAddrTable, pfInterfacesIf4PktsInPass=pfInterfacesIf4PktsInPass, pfLogInterfaceIp6PktsInDrop=pfLogInterfaceIp6PktsInDrop, pfStatusDebug=pfStatusDebug, pfTimeouts=pfTimeouts, pfInterfacesIf4BytesOutBlock=pfInterfacesIf4BytesOutBlock, pfTablesAddrMask=pfTablesAddrMask, pfLogInterfaceIp4BytesIn=pfLogInterfaceIp4BytesIn, pfInterfacesIfTZero=pfInterfacesIfTZero, pfInterfacesIf6PktsOutBlock=pfInterfacesIf6PktsOutBlock, pfCounter=pfCounter, pfTablesAddrBytesOutPass=pfTablesAddrBytesOutPass, pfInterfacesIf6BytesInPass=pfInterfacesIf6BytesInPass, pfTimeoutsUdpSingle=pfTimeoutsUdpSingle, pfInterfacesIfRefsState=pfInterfacesIfRefsState, pfTables=pfTables, pfSrcNodesCount=pfSrcNodesCount, pfTimeoutsFragment=pfTimeoutsFragment, pfInterfacesIfDescr=pfInterfacesIfDescr, pfInterfacesIf6PktsInBlock=pfInterfacesIf6PktsInBlock, pfLogInterfaceIp4PktsOutDrop=pfLogInterfaceIp4PktsOutDrop, pfTablesTblEntry=pfTablesTblEntry, pfInterfacesIf4BytesInBlock=pfInterfacesIf4BytesInBlock, pfTablesAddrTZero=pfTablesAddrTZero, pfTimeoutsOtherSingle=pfTimeoutsOtherSingle, pfLogInterfaceIp4PktsInPass=pfLogInterfaceIp4PktsInPass, pfAltqQueuePriority=pfAltqQueuePriority, pfLogInterfaceIp6PktsOutPass=pfLogInterfaceIp6PktsOutPass, pfTimeoutsAdaptiveStart=pfTimeoutsAdaptiveStart, pfTimeoutsIcmpError=pfTimeoutsIcmpError, begemotPf=begemotPf, pfInterfacesIfIndex=pfInterfacesIfIndex, pfLimitsSrcNodes=pfLimitsSrcNodes, pfCounterMatch=pfCounterMatch, pfInterfacesIfType=pfInterfacesIfType, pfLimitsFrags=pfLimitsFrags, pfCounterNormalize=pfCounterNormalize, pfStateTableInserts=pfStateTableInserts, pfTimeoutsSrcNode=pfTimeoutsSrcNode, pfSrcNodes=pfSrcNodes, pfTimeoutsUdpMultiple=pfTimeoutsUdpMultiple, pfAltqQueueTable=pfAltqQueueTable, pfTablesTblPktsInPass=pfTablesTblPktsInPass, pfAltqQueueNumber=pfAltqQueueNumber, pfStatus=pfStatus, pfTablesTblNumber=pfTablesTblNumber, pfTablesAddrBytesOutBlock=pfTablesAddrBytesOutBlock, pfTablesAddrPktsOutBlock=pfTablesAddrPktsOutBlock, pfAltqQueueIndex=pfAltqQueueIndex, pfSrcNodesInserts=pfSrcNodesInserts, pfInterfacesIf4BytesInPass=pfInterfacesIf4BytesInPass, pfTablesTblDescr=pfTablesTblDescr, pfSrcNodesRemovals=pfSrcNodesRemovals, pfTablesTblCount=pfTablesTblCount, pfTablesAddrPktsInPass=pfTablesAddrPktsInPass, pfInterfacesIf6BytesOutPass=pfInterfacesIf6BytesOutPass, pfTablesTblBytesInBlock=pfTablesTblBytesInBlock, pfLimitsStates=pfLimitsStates, pfTablesAddrIndex=pfTablesAddrIndex, pfTimeoutsTcpFirst=pfTimeoutsTcpFirst, pfAltqQueueEntry=pfAltqQueueEntry, pfTablesAddrNet=pfTablesAddrNet, pfCounterShort=pfCounterShort, pfTimeoutsInterval=pfTimeoutsInterval, pfAltqQueueScheduler=pfAltqQueueScheduler, pfTablesTblBytesOutXPass=pfTablesTblBytesOutXPass, pfTablesAddrPktsOutPass=pfTablesAddrPktsOutPass, pfInterfacesIfTable=pfInterfacesIfTable, pfLogInterfaceName=pfLogInterfaceName, pfInterfacesIfRefsRule=pfInterfacesIfRefsRule) |
# -*- coding:utf-8 -*-
p = raw_input("Escribe una frase: ")
for letras in p:
print(p.upper()) | p = raw_input('Escribe una frase: ')
for letras in p:
print(p.upper()) |
def find_words_in_phone_number():
phone_number = "3662277"
words = ["foo", "bar", "baz", "foobar", "emo", "cap", "car", "cat"]
lst = []
cmap = dict(a=2, b=2, c=2, d=3, e=3, f=3, g=4, h=4, i=4, j=5, k=5, l=5,
m=6, n=6, o=6, p=7, q=7, r=7, s=7, t=8, u=8, v=8, w=9, x=9, y=9, z=9)
for word in words:
num = "".join(str(cmap.get(x.lower(), "0")) for x in word)
found = num in phone_number
print(found, word, num, phone_number)
found and lst.append(word)
print(lst)
def countdown(count: int):
for num in range(count, 0, -1):
print(num)
if __name__ == '__main__':
find_words_in_phone_number()
| def find_words_in_phone_number():
phone_number = '3662277'
words = ['foo', 'bar', 'baz', 'foobar', 'emo', 'cap', 'car', 'cat']
lst = []
cmap = dict(a=2, b=2, c=2, d=3, e=3, f=3, g=4, h=4, i=4, j=5, k=5, l=5, m=6, n=6, o=6, p=7, q=7, r=7, s=7, t=8, u=8, v=8, w=9, x=9, y=9, z=9)
for word in words:
num = ''.join((str(cmap.get(x.lower(), '0')) for x in word))
found = num in phone_number
print(found, word, num, phone_number)
found and lst.append(word)
print(lst)
def countdown(count: int):
for num in range(count, 0, -1):
print(num)
if __name__ == '__main__':
find_words_in_phone_number() |
CMarketRspInfoField = {
"ErrorID": "int",
"ErrorMsg": "string",
}
CMarketReqUserLoginField = {
"UserId": "string",
"UserPwd": "string",
"UserType": "string",
"MacAddress": "string",
"ComputerName": "string",
"SoftwareName": "string",
"SoftwareVersion": "string",
"AuthorCode": "string",
"ErrorDescription": "string",
}
CMarketRspUserLoginField = {
"UserName": "string",
"UserPwd": "string",
"UserType": "string",
}
CMarketReqUserLogoutField = {
"BrokerID": "string",
"UserId": "string",
"ErrorDescription": "string",
}
CMarketReqMarketDataField = {
"MarketType": "char",
"SubscMode": "char",
"MarketCount": "int",
"MarketTrcode[MAX_SUB_COUNT]": "string",
"ErrorDescription": "string",
}
CMarketRspMarketDataField = {
"ExchangeCode": "string",
"TreatyCode": "string",
"BuyPrice": "string",
"BuyNumber": "string",
"SalePrice": "string",
"SaleNumber": "string",
"CurrPrice": "string",
"CurrNumber": "string",
"High": "string",
"Low": "string",
"Open": "string",
"IntradaySettlePrice": "string",
"Close": "string",
"Time": "string",
"FilledNum": "string",
"HoldNum": "string",
"BuyPrice2": "string",
"BuyPrice3": "string",
"BuyPrice4": "string",
"BuyPrice5": "string",
"BuyNumber2": "string",
"BuyNumber3": "string",
"BuyNumber4": "string",
"BuyNumber5": "string",
"SalePrice2": "string",
"SalePrice3": "string",
"SalePrice4": "string",
"SalePrice5": "string",
"SaleNumber2": "string",
"SaleNumber3": "string",
"SaleNumber4": "string",
"SaleNumber5": "string",
"HideBuyPrice": "string",
"HideBuyNumber": "string",
"HideSalePrice": "string",
"HideSaleNumber": "string",
"LimitDownPrice": "string",
"LimitUpPrice": "string",
"TradeDay": "string",
"BuyPrice6": "string",
"BuyPrice7": "string",
"BuyPrice8": "string",
"BuyPrice9": "string",
"BuyPrice10": "string",
"BuyNumber6": "string",
"BuyNumber7": "string",
"BuyNumber8": "string",
"BuyNumber9": "string",
"BuyNumber10": "string",
"SalePrice6": "string",
"SalePrice7": "string",
"SalePrice8": "string",
"SalePrice9": "string",
"SalePrice10": "string",
"SaleNumber6": "string",
"SaleNumber7": "string",
"SaleNumber8": "string",
"SaleNumber9": "string",
"SaleNumber10": "string",
"TradeFlag": "string",
"DataTimestamp": "string",
"DataSourceId": "string",
"CanSellVol": "string",
"QuoteType": "string",
"AggressorSide": "string",
"PreSettlementPrice": "string",
}
CMarketReqBrokerDataField = {
"ContCode": "string",
"ErrorDescription": "string",
}
CMarketRspBrokerDataField = {
"BrokerData": "string",
}
CMarketRspTradeDateField = {
"TradeDate": "string",
"TradeProduct": "string",
}
| c_market_rsp_info_field = {'ErrorID': 'int', 'ErrorMsg': 'string'}
c_market_req_user_login_field = {'UserId': 'string', 'UserPwd': 'string', 'UserType': 'string', 'MacAddress': 'string', 'ComputerName': 'string', 'SoftwareName': 'string', 'SoftwareVersion': 'string', 'AuthorCode': 'string', 'ErrorDescription': 'string'}
c_market_rsp_user_login_field = {'UserName': 'string', 'UserPwd': 'string', 'UserType': 'string'}
c_market_req_user_logout_field = {'BrokerID': 'string', 'UserId': 'string', 'ErrorDescription': 'string'}
c_market_req_market_data_field = {'MarketType': 'char', 'SubscMode': 'char', 'MarketCount': 'int', 'MarketTrcode[MAX_SUB_COUNT]': 'string', 'ErrorDescription': 'string'}
c_market_rsp_market_data_field = {'ExchangeCode': 'string', 'TreatyCode': 'string', 'BuyPrice': 'string', 'BuyNumber': 'string', 'SalePrice': 'string', 'SaleNumber': 'string', 'CurrPrice': 'string', 'CurrNumber': 'string', 'High': 'string', 'Low': 'string', 'Open': 'string', 'IntradaySettlePrice': 'string', 'Close': 'string', 'Time': 'string', 'FilledNum': 'string', 'HoldNum': 'string', 'BuyPrice2': 'string', 'BuyPrice3': 'string', 'BuyPrice4': 'string', 'BuyPrice5': 'string', 'BuyNumber2': 'string', 'BuyNumber3': 'string', 'BuyNumber4': 'string', 'BuyNumber5': 'string', 'SalePrice2': 'string', 'SalePrice3': 'string', 'SalePrice4': 'string', 'SalePrice5': 'string', 'SaleNumber2': 'string', 'SaleNumber3': 'string', 'SaleNumber4': 'string', 'SaleNumber5': 'string', 'HideBuyPrice': 'string', 'HideBuyNumber': 'string', 'HideSalePrice': 'string', 'HideSaleNumber': 'string', 'LimitDownPrice': 'string', 'LimitUpPrice': 'string', 'TradeDay': 'string', 'BuyPrice6': 'string', 'BuyPrice7': 'string', 'BuyPrice8': 'string', 'BuyPrice9': 'string', 'BuyPrice10': 'string', 'BuyNumber6': 'string', 'BuyNumber7': 'string', 'BuyNumber8': 'string', 'BuyNumber9': 'string', 'BuyNumber10': 'string', 'SalePrice6': 'string', 'SalePrice7': 'string', 'SalePrice8': 'string', 'SalePrice9': 'string', 'SalePrice10': 'string', 'SaleNumber6': 'string', 'SaleNumber7': 'string', 'SaleNumber8': 'string', 'SaleNumber9': 'string', 'SaleNumber10': 'string', 'TradeFlag': 'string', 'DataTimestamp': 'string', 'DataSourceId': 'string', 'CanSellVol': 'string', 'QuoteType': 'string', 'AggressorSide': 'string', 'PreSettlementPrice': 'string'}
c_market_req_broker_data_field = {'ContCode': 'string', 'ErrorDescription': 'string'}
c_market_rsp_broker_data_field = {'BrokerData': 'string'}
c_market_rsp_trade_date_field = {'TradeDate': 'string', 'TradeProduct': 'string'} |
# cook your dish here
print("137=2(2(2)+2+2(0))+2(2+2(0))+2(0)")
print("1315=2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2(0))+2+2(0)")
print("73=2(2(2)+2)+2(2+2(0))+2(0)")
print("136=2(2(2)+2+2(0))+2(2+2(0))")
print("255=2(2(2)+2+2(0))+2(2(2)+2)+2(2(2)+2(0))+2(2(2))+2(2+2(0))+2(2)+2+2(0)")
print("1384=2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2)+2(2(2)+2(0))+2(2+2(0))")
print("16385=2(2(2+2(0))+2(2)+2)+2(0)")
| print('137=2(2(2)+2+2(0))+2(2+2(0))+2(0)')
print('1315=2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2(0))+2+2(0)')
print('73=2(2(2)+2)+2(2+2(0))+2(0)')
print('136=2(2(2)+2+2(0))+2(2+2(0))')
print('255=2(2(2)+2+2(0))+2(2(2)+2)+2(2(2)+2(0))+2(2(2))+2(2+2(0))+2(2)+2+2(0)')
print('1384=2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2)+2(2(2)+2(0))+2(2+2(0))')
print('16385=2(2(2+2(0))+2(2)+2)+2(0)') |
#!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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.
"""
class UserInfo:
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
self.swaggerTypes = {
'nickname': 'str',
'firstname': 'str',
'lastname': 'str',
'pkey': 'str',
'pswd_salt': 'str',
'claimed_id': 'str',
'token': 'str',
'storage': 'int',
'photo': 'list[int]',
'active': 'bool',
'trial': 'bool',
'news_eanbled': 'bool',
'alerts_eanbled': 'bool',
'support_eanbled': 'bool',
'support_email': 'str',
'annotation_branded': 'bool',
'viewer_branded': 'bool',
'is_real_time_broadcast_enabled': 'bool',
'is_scroll_broadcast_enabled': 'bool',
'is_zoom_broadcast_enabled': 'bool',
'annotation_logo': 'list[int]',
'pointer_tool_cursor': 'list[int]',
'annotation_header_options': 'int',
'is_annotation_navigation_widget_enabled': 'bool',
'is_annotation_zoom_widget_enabled': 'bool',
'is_annotation_download_widget_enabled': 'bool',
'is_annotation_print_widget_enabled': 'bool',
'is_annotation_help_widget_enabled': 'bool',
'is_right_panel_enabled': 'bool',
'is_thumbnails_panel_enabled': 'bool',
'is_standard_header_always_shown': 'bool',
'is_toolbar_enabled': 'bool',
'is_text_annotation_button_enabled': 'bool',
'is_rectangle_annotation_button_enabled': 'bool',
'is_point_annotation_button_enabled': 'bool',
'is_strikeout_annotation_button_enabled': 'bool',
'is_polyline_annotation_button_enabled': 'bool',
'is_typewriter_annotation_button_enabled': 'bool',
'is_watermark_annotation_button_enabled': 'bool',
'is_annotation_document_name_shown': 'bool',
'annotation_navigation_icons': 'list[int]',
'annotation_tool_icons': 'list[int]',
'annotation_background_color': 'int',
'viewer_logo': 'list[int]',
'viewer_options': 'int',
'is_viewer_navigation_widget_enabled': 'bool',
'is_viewer_zoom_widget_enabled': 'bool',
'is_viewer_download_widget_enabled': 'bool',
'is_viewer_print_widget_enabled': 'bool',
'is_viewer_help_widget_enabled': 'bool',
'is_viewer_document_name_shown': 'bool',
'isviewer_right_mouse_button_menu_enabled': 'bool',
'signedupOn': 'long',
'signedinOn': 'long',
'signin_count': 'int',
'roles': 'list[RoleInfo]',
'signature_watermark_enabled': 'bool',
'signature_desktop_notifications': 'bool',
'webhook_notification_retries': 'int',
'webhook_notification_failed_recipients': 'str',
'signature_color': 'str',
'id': 'float',
'guid': 'str',
'primary_email': 'str'
}
self.nickname = None # str
self.firstname = None # str
self.lastname = None # str
self.pkey = None # str
self.pswd_salt = None # str
self.claimed_id = None # str
self.token = None # str
self.storage = None # int
self.photo = None # list[int]
self.active = None # bool
self.trial = None # bool
self.news_eanbled = None # bool
self.alerts_eanbled = None # bool
self.support_eanbled = None # bool
self.support_email = None # str
self.annotation_branded = None # bool
self.viewer_branded = None # bool
self.is_real_time_broadcast_enabled = None # bool
self.is_scroll_broadcast_enabled = None # bool
self.is_zoom_broadcast_enabled = None # bool
self.annotation_logo = None # list[int]
self.pointer_tool_cursor = None # list[int]
self.annotation_header_options = None # int
self.is_annotation_navigation_widget_enabled = None # bool
self.is_annotation_zoom_widget_enabled = None # bool
self.is_annotation_download_widget_enabled = None # bool
self.is_annotation_print_widget_enabled = None # bool
self.is_annotation_help_widget_enabled = None # bool
self.is_right_panel_enabled = None # bool
self.is_thumbnails_panel_enabled = None # bool
self.is_standard_header_always_shown = None # bool
self.is_toolbar_enabled = None # bool
self.is_text_annotation_button_enabled = None # bool
self.is_rectangle_annotation_button_enabled = None # bool
self.is_point_annotation_button_enabled = None # bool
self.is_strikeout_annotation_button_enabled = None # bool
self.is_polyline_annotation_button_enabled = None # bool
self.is_typewriter_annotation_button_enabled = None # bool
self.is_watermark_annotation_button_enabled = None # bool
self.is_annotation_document_name_shown = None # bool
self.annotation_navigation_icons = None # list[int]
self.annotation_tool_icons = None # list[int]
self.annotation_background_color = None # int
self.viewer_logo = None # list[int]
self.viewer_options = None # int
self.is_viewer_navigation_widget_enabled = None # bool
self.is_viewer_zoom_widget_enabled = None # bool
self.is_viewer_download_widget_enabled = None # bool
self.is_viewer_print_widget_enabled = None # bool
self.is_viewer_help_widget_enabled = None # bool
self.is_viewer_document_name_shown = None # bool
self.isviewer_right_mouse_button_menu_enabled = None # bool
self.signedupOn = None # long
self.signedinOn = None # long
self.signin_count = None # int
self.roles = None # list[RoleInfo]
self.signature_watermark_enabled = None # bool
self.signature_desktop_notifications = None # bool
self.webhook_notification_retries = None # int
self.webhook_notification_failed_recipients = None # str
self.signature_color = None # str
self.id = None # float
self.guid = None # str
self.primary_email = None # str
| """
Copyright 2012 GroupDocs.
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.
"""
class Userinfo:
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
self.swaggerTypes = {'nickname': 'str', 'firstname': 'str', 'lastname': 'str', 'pkey': 'str', 'pswd_salt': 'str', 'claimed_id': 'str', 'token': 'str', 'storage': 'int', 'photo': 'list[int]', 'active': 'bool', 'trial': 'bool', 'news_eanbled': 'bool', 'alerts_eanbled': 'bool', 'support_eanbled': 'bool', 'support_email': 'str', 'annotation_branded': 'bool', 'viewer_branded': 'bool', 'is_real_time_broadcast_enabled': 'bool', 'is_scroll_broadcast_enabled': 'bool', 'is_zoom_broadcast_enabled': 'bool', 'annotation_logo': 'list[int]', 'pointer_tool_cursor': 'list[int]', 'annotation_header_options': 'int', 'is_annotation_navigation_widget_enabled': 'bool', 'is_annotation_zoom_widget_enabled': 'bool', 'is_annotation_download_widget_enabled': 'bool', 'is_annotation_print_widget_enabled': 'bool', 'is_annotation_help_widget_enabled': 'bool', 'is_right_panel_enabled': 'bool', 'is_thumbnails_panel_enabled': 'bool', 'is_standard_header_always_shown': 'bool', 'is_toolbar_enabled': 'bool', 'is_text_annotation_button_enabled': 'bool', 'is_rectangle_annotation_button_enabled': 'bool', 'is_point_annotation_button_enabled': 'bool', 'is_strikeout_annotation_button_enabled': 'bool', 'is_polyline_annotation_button_enabled': 'bool', 'is_typewriter_annotation_button_enabled': 'bool', 'is_watermark_annotation_button_enabled': 'bool', 'is_annotation_document_name_shown': 'bool', 'annotation_navigation_icons': 'list[int]', 'annotation_tool_icons': 'list[int]', 'annotation_background_color': 'int', 'viewer_logo': 'list[int]', 'viewer_options': 'int', 'is_viewer_navigation_widget_enabled': 'bool', 'is_viewer_zoom_widget_enabled': 'bool', 'is_viewer_download_widget_enabled': 'bool', 'is_viewer_print_widget_enabled': 'bool', 'is_viewer_help_widget_enabled': 'bool', 'is_viewer_document_name_shown': 'bool', 'isviewer_right_mouse_button_menu_enabled': 'bool', 'signedupOn': 'long', 'signedinOn': 'long', 'signin_count': 'int', 'roles': 'list[RoleInfo]', 'signature_watermark_enabled': 'bool', 'signature_desktop_notifications': 'bool', 'webhook_notification_retries': 'int', 'webhook_notification_failed_recipients': 'str', 'signature_color': 'str', 'id': 'float', 'guid': 'str', 'primary_email': 'str'}
self.nickname = None
self.firstname = None
self.lastname = None
self.pkey = None
self.pswd_salt = None
self.claimed_id = None
self.token = None
self.storage = None
self.photo = None
self.active = None
self.trial = None
self.news_eanbled = None
self.alerts_eanbled = None
self.support_eanbled = None
self.support_email = None
self.annotation_branded = None
self.viewer_branded = None
self.is_real_time_broadcast_enabled = None
self.is_scroll_broadcast_enabled = None
self.is_zoom_broadcast_enabled = None
self.annotation_logo = None
self.pointer_tool_cursor = None
self.annotation_header_options = None
self.is_annotation_navigation_widget_enabled = None
self.is_annotation_zoom_widget_enabled = None
self.is_annotation_download_widget_enabled = None
self.is_annotation_print_widget_enabled = None
self.is_annotation_help_widget_enabled = None
self.is_right_panel_enabled = None
self.is_thumbnails_panel_enabled = None
self.is_standard_header_always_shown = None
self.is_toolbar_enabled = None
self.is_text_annotation_button_enabled = None
self.is_rectangle_annotation_button_enabled = None
self.is_point_annotation_button_enabled = None
self.is_strikeout_annotation_button_enabled = None
self.is_polyline_annotation_button_enabled = None
self.is_typewriter_annotation_button_enabled = None
self.is_watermark_annotation_button_enabled = None
self.is_annotation_document_name_shown = None
self.annotation_navigation_icons = None
self.annotation_tool_icons = None
self.annotation_background_color = None
self.viewer_logo = None
self.viewer_options = None
self.is_viewer_navigation_widget_enabled = None
self.is_viewer_zoom_widget_enabled = None
self.is_viewer_download_widget_enabled = None
self.is_viewer_print_widget_enabled = None
self.is_viewer_help_widget_enabled = None
self.is_viewer_document_name_shown = None
self.isviewer_right_mouse_button_menu_enabled = None
self.signedupOn = None
self.signedinOn = None
self.signin_count = None
self.roles = None
self.signature_watermark_enabled = None
self.signature_desktop_notifications = None
self.webhook_notification_retries = None
self.webhook_notification_failed_recipients = None
self.signature_color = None
self.id = None
self.guid = None
self.primary_email = None |
def get_current_players(current_room):
host_user = current_room['host_user']
users = current_room['game']['users']
players = [player for player in users]
players.append(host_user)
return players
| def get_current_players(current_room):
host_user = current_room['host_user']
users = current_room['game']['users']
players = [player for player in users]
players.append(host_user)
return players |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Helpdesk',
'category': 'Customer Relationship Management',
'version': '1.0',
'description': """
Helpdesk Management.
====================
Like records and processing of claims, Helpdesk and Support are good tools
to trace your interventions. This menu is more adapted to oral communication,
which is not necessarily related to a claim. Select a customer, add notes
and categorize your interventions with a channel and a priority level.
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['crm'],
'data': [
'crm_helpdesk_view.xml',
'crm_helpdesk_menu.xml',
'security/ir.model.access.csv',
'report/crm_helpdesk_report_view.xml',
'crm_helpdesk_data.xml',
],
'demo': ['crm_helpdesk_demo.xml'],
'test': ['test/process/help-desk.yml'],
'installable': True,
'auto_install': False,
'images': ['images/helpdesk_analysis.jpeg','images/helpdesk_categories.jpeg','images/helpdesk_requests.jpeg'],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
| {'name': 'Helpdesk', 'category': 'Customer Relationship Management', 'version': '1.0', 'description': '\nHelpdesk Management.\n====================\n\nLike records and processing of claims, Helpdesk and Support are good tools\nto trace your interventions. This menu is more adapted to oral communication,\nwhich is not necessarily related to a claim. Select a customer, add notes\nand categorize your interventions with a channel and a priority level.\n ', 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', 'depends': ['crm'], 'data': ['crm_helpdesk_view.xml', 'crm_helpdesk_menu.xml', 'security/ir.model.access.csv', 'report/crm_helpdesk_report_view.xml', 'crm_helpdesk_data.xml'], 'demo': ['crm_helpdesk_demo.xml'], 'test': ['test/process/help-desk.yml'], 'installable': True, 'auto_install': False, 'images': ['images/helpdesk_analysis.jpeg', 'images/helpdesk_categories.jpeg', 'images/helpdesk_requests.jpeg']} |
class DuckyScriptParser:
'''
This class is a parser for the DuckyScript language.
It allows to generate a sequence of frame to inject keystrokes according to the provided script.
'''
def __init__(self,content="",filename=""):
if content != "":
self.content = content
else:
self.content = open(filename,"r").read()
self.specialKeys ={
"ENTER":["ENTER"],
"super":["GUI","WINDOWS"],
"ctrl":["CTRL","CONTROL"],
"alt":["ALT"],
"shift":["SHIFT"],
"DOWNARROW":["DOWNARROW","DOWN"],
"UPARROW":["UPARROW","UP"],
"LEFTARROW":["LEFTARROW","LEFT"],
"RIGHTARROW":["RIGHTARROW","RIGHT"],
"F1":["F1"],
"F2":["F2"],
"F3":["F3"],
"F4":["F4"],
"F5":["F5"],
"F6":["F6"],
"F7":["F7"],
"F8":["F8"],
"F9":["F9"],
"F10":["F10"],
"F11":["F11"],
"F12":["F12"],
"ESC":["ESC","ESCAPE"],
"PAUSE":["PAUSE"],
"SPACE":["SPACE"],
"TAB":["TAB"],
"END":["END"],
"DELETE":["DELETE"],
"PAUSE":["BREAK","PAUSE"],
"PRINTSCREEN":["PRINTSCREEN"],
"CAPSLOCK":["CAPSLOCK"],
"SCROLLLOCK":["SCROLLLOCK"],
"INSERT":["INSERT"],
"HOME":["HOME"],
"PAGEUP":["PAGEUP"],
"PAGEDOWN":["PAGEDOWN"]
}
def _isSpecialKey(self,string):
for k,v in self.specialKeys.items():
if string in v:
return True
return False
def _getSpecialKey(self,string):
for k,v in self.specialKeys.items():
if string in v:
return k
return string
def _parseInstruction(self,instruction=[]):
first = instruction[0]
if first == "REM":
return None
elif first == "STRING":
return {"type":"text", "param":" ".join(instruction[1:])}
elif first == "DELAY":
return {"type":"sleep", "param":int(instruction[1])}
elif first == "REPEAT":
return {"type":"repeat", "param":int(instruction[1])}
elif first == "DEFAULTDELAY" or first == "DEFAULT_DELAY":
return {"type":"defaultdelay", "param":int(instruction[1])}
elif first == "APP" or first == "MENU":
return {"type":"keys","param":["shift","F10"]}
elif self._isSpecialKey(first):
keys = []
for k in instruction:
keys.append(self._getSpecialKey(k))
if len(keys)==1:
if keys[0] in ("ctrl","alt","shift"):
key = key.upper()
elif keys[0] == "super":
key = "GUI"
else:
key = keys[0]
return {"type":"key", "param":key}
else:
return {"type":"keys", "param":keys}
def _parse(self):
self.instructions = []
instructions = self.content.split("\n")
for instruction in instructions:
tokens = instruction.split(" ")
generated = self._parseInstruction(tokens)
if generated is not None:
self.instructions.append(generated)
def _generatePacketsFromInstruction(self,
currentDelay=0,
previousInstruction={},
currentInstruction={},
textFunction=None,
keyFunction=None,
sleepFunction=None
):
defaultDelay,packets = currentDelay, []
if currentInstruction["type"] == "defaultdelay":
defaultDelay = currentInstruction["param"]
elif currentInstruction["type"] == "sleep":
packets += sleepFunction(duration=currentInstruction["param"])
elif currentInstruction["type"] == "repeat" and previousInstruction != {}:
for _ in range(currentInstruction["param"]):
defaultDelay,nextPackets = self._generatePacketsFromInstruction(
currentDelay=currentDelay,
previousInstruction={},
currentInstruction=previousInstruction,
textFunction=textFunction,
keyFunction=keyFunction,
sleepFunction=sleepFunction
)
packets += nextPackets
elif currentInstruction["type"] == "text":
packets += textFunction(string=currentInstruction["param"])
elif currentInstruction["type"] == "key":
packets += keyFunction(key=currentInstruction["param"])
elif currentInstruction["type"] == "keys":
ctrl = "ctrl" in currentInstruction["param"]
alt = "alt" in currentInstruction["param"]
gui = "super" in currentInstruction["param"]
shift = "shift" in currentInstruction["param"]
key = ""
for i in currentInstruction["param"]:
if i not in ("ctrl","alt","super","shift"):
key = i
packets += keyFunction(key=key,shift=shift,gui=gui,ctrl=ctrl,alt=alt)
return defaultDelay,packets
def generatePackets(self,textFunction=None, keyFunction=None, sleepFunction=None, initFunction=None):
'''
This function allows to generate the sequence of packets corresponding to the provided script.
You have to provide different functions that returns the sequence of packets for a given action.
:param textFunction: function corresponding to a text injection
:type textFunction: func
:param keyFunction: function corresponding to a single keystroke injection
:type keyFunction: func
:param sleepFunction: function corresponding to a sleep interval
:type sleepFunction: func
:param initFunction: function corresponding to the initialization of the process
:type initFunction: func
:return: sequence of packets
:rtype: list of ``mirage.libs.wireless_utils.packets.Packet``
'''
self._parse()
defaultDelay = 0
previousInstruction = {}
currentInstruction = {}
packets = initFunction()
for currentInstruction in self.instructions:
newDelay,nextPackets = self._generatePacketsFromInstruction(
currentDelay=defaultDelay,
previousInstruction=previousInstruction,
currentInstruction=currentInstruction,
textFunction=textFunction,
keyFunction=keyFunction,
sleepFunction=sleepFunction
)
packets += nextPackets
defaultDelay = newDelay
if defaultDelay > 0:
packets += sleepFunction(duration=defaultDelay)
previousInstruction = currentInstruction
return packets
| class Duckyscriptparser:
"""
This class is a parser for the DuckyScript language.
It allows to generate a sequence of frame to inject keystrokes according to the provided script.
"""
def __init__(self, content='', filename=''):
if content != '':
self.content = content
else:
self.content = open(filename, 'r').read()
self.specialKeys = {'ENTER': ['ENTER'], 'super': ['GUI', 'WINDOWS'], 'ctrl': ['CTRL', 'CONTROL'], 'alt': ['ALT'], 'shift': ['SHIFT'], 'DOWNARROW': ['DOWNARROW', 'DOWN'], 'UPARROW': ['UPARROW', 'UP'], 'LEFTARROW': ['LEFTARROW', 'LEFT'], 'RIGHTARROW': ['RIGHTARROW', 'RIGHT'], 'F1': ['F1'], 'F2': ['F2'], 'F3': ['F3'], 'F4': ['F4'], 'F5': ['F5'], 'F6': ['F6'], 'F7': ['F7'], 'F8': ['F8'], 'F9': ['F9'], 'F10': ['F10'], 'F11': ['F11'], 'F12': ['F12'], 'ESC': ['ESC', 'ESCAPE'], 'PAUSE': ['PAUSE'], 'SPACE': ['SPACE'], 'TAB': ['TAB'], 'END': ['END'], 'DELETE': ['DELETE'], 'PAUSE': ['BREAK', 'PAUSE'], 'PRINTSCREEN': ['PRINTSCREEN'], 'CAPSLOCK': ['CAPSLOCK'], 'SCROLLLOCK': ['SCROLLLOCK'], 'INSERT': ['INSERT'], 'HOME': ['HOME'], 'PAGEUP': ['PAGEUP'], 'PAGEDOWN': ['PAGEDOWN']}
def _is_special_key(self, string):
for (k, v) in self.specialKeys.items():
if string in v:
return True
return False
def _get_special_key(self, string):
for (k, v) in self.specialKeys.items():
if string in v:
return k
return string
def _parse_instruction(self, instruction=[]):
first = instruction[0]
if first == 'REM':
return None
elif first == 'STRING':
return {'type': 'text', 'param': ' '.join(instruction[1:])}
elif first == 'DELAY':
return {'type': 'sleep', 'param': int(instruction[1])}
elif first == 'REPEAT':
return {'type': 'repeat', 'param': int(instruction[1])}
elif first == 'DEFAULTDELAY' or first == 'DEFAULT_DELAY':
return {'type': 'defaultdelay', 'param': int(instruction[1])}
elif first == 'APP' or first == 'MENU':
return {'type': 'keys', 'param': ['shift', 'F10']}
elif self._isSpecialKey(first):
keys = []
for k in instruction:
keys.append(self._getSpecialKey(k))
if len(keys) == 1:
if keys[0] in ('ctrl', 'alt', 'shift'):
key = key.upper()
elif keys[0] == 'super':
key = 'GUI'
else:
key = keys[0]
return {'type': 'key', 'param': key}
else:
return {'type': 'keys', 'param': keys}
def _parse(self):
self.instructions = []
instructions = self.content.split('\n')
for instruction in instructions:
tokens = instruction.split(' ')
generated = self._parseInstruction(tokens)
if generated is not None:
self.instructions.append(generated)
def _generate_packets_from_instruction(self, currentDelay=0, previousInstruction={}, currentInstruction={}, textFunction=None, keyFunction=None, sleepFunction=None):
(default_delay, packets) = (currentDelay, [])
if currentInstruction['type'] == 'defaultdelay':
default_delay = currentInstruction['param']
elif currentInstruction['type'] == 'sleep':
packets += sleep_function(duration=currentInstruction['param'])
elif currentInstruction['type'] == 'repeat' and previousInstruction != {}:
for _ in range(currentInstruction['param']):
(default_delay, next_packets) = self._generatePacketsFromInstruction(currentDelay=currentDelay, previousInstruction={}, currentInstruction=previousInstruction, textFunction=textFunction, keyFunction=keyFunction, sleepFunction=sleepFunction)
packets += nextPackets
elif currentInstruction['type'] == 'text':
packets += text_function(string=currentInstruction['param'])
elif currentInstruction['type'] == 'key':
packets += key_function(key=currentInstruction['param'])
elif currentInstruction['type'] == 'keys':
ctrl = 'ctrl' in currentInstruction['param']
alt = 'alt' in currentInstruction['param']
gui = 'super' in currentInstruction['param']
shift = 'shift' in currentInstruction['param']
key = ''
for i in currentInstruction['param']:
if i not in ('ctrl', 'alt', 'super', 'shift'):
key = i
packets += key_function(key=key, shift=shift, gui=gui, ctrl=ctrl, alt=alt)
return (defaultDelay, packets)
def generate_packets(self, textFunction=None, keyFunction=None, sleepFunction=None, initFunction=None):
"""
This function allows to generate the sequence of packets corresponding to the provided script.
You have to provide different functions that returns the sequence of packets for a given action.
:param textFunction: function corresponding to a text injection
:type textFunction: func
:param keyFunction: function corresponding to a single keystroke injection
:type keyFunction: func
:param sleepFunction: function corresponding to a sleep interval
:type sleepFunction: func
:param initFunction: function corresponding to the initialization of the process
:type initFunction: func
:return: sequence of packets
:rtype: list of ``mirage.libs.wireless_utils.packets.Packet``
"""
self._parse()
default_delay = 0
previous_instruction = {}
current_instruction = {}
packets = init_function()
for current_instruction in self.instructions:
(new_delay, next_packets) = self._generatePacketsFromInstruction(currentDelay=defaultDelay, previousInstruction=previousInstruction, currentInstruction=currentInstruction, textFunction=textFunction, keyFunction=keyFunction, sleepFunction=sleepFunction)
packets += nextPackets
default_delay = newDelay
if defaultDelay > 0:
packets += sleep_function(duration=defaultDelay)
previous_instruction = currentInstruction
return packets |
def Awana_Academy(name, age): ## say to python that all the code that come after that line is going to be in d function
print("Hello " + name + "you are " + age + "years old ")
Awana_Academy("Alex " , "45")
Awana_Academy("Donald ", "12")
| def awana__academy(name, age):
print('Hello ' + name + 'you are ' + age + 'years old ')
awana__academy('Alex ', '45')
awana__academy('Donald ', '12') |
# https://www.codewars.com/kata/55d2aee99f30dbbf8b000001/
'''
Details :
A new school year is approaching, which also means students will be taking tests.
The tests in this kata are to be graded in different ways. A certain number of points will be given for each correct answer and a certain number of points will be deducted for each incorrect answer. For ommitted answers, points will either be awarded, deducted, or no points will be given at all.
Return the number of points someone has scored on varying tests of different lengths.
The given parameters will be:
An array containing a series of 0s, 1s, and 2s, where 0 is a correct answer, 1 is an omitted answer, and 2 is an incorrect answer.
The points awarded for correct answers
The points awarded for omitted answers (note that this may be negative)
The points deducted for incorrect answers (hint: this value has to be subtracted)
Note: The input will always be valid (an array and three numbers)
Examples
#1:
[0, 0, 0, 0, 2, 1, 0], 2, 0, 1 --> 9
because:
5 correct answers: 5*2 = 10
1 omitted answer: 1*0 = 0
1 wrong answer: 1*1 = 1
which is: 10 + 0 - 1 = 9
#2:
[0, 1, 0, 0, 2, 1, 0, 2, 2, 1], 3, -1, 2) --> 3
because: 4*3 + 3*-1 - 3*2 = 3
'''
def score_test(tests, right, omit, wrong):
return tests.count(0) * right + tests.count(1) * omit - tests.count(2) * wrong
| """
Details :
A new school year is approaching, which also means students will be taking tests.
The tests in this kata are to be graded in different ways. A certain number of points will be given for each correct answer and a certain number of points will be deducted for each incorrect answer. For ommitted answers, points will either be awarded, deducted, or no points will be given at all.
Return the number of points someone has scored on varying tests of different lengths.
The given parameters will be:
An array containing a series of 0s, 1s, and 2s, where 0 is a correct answer, 1 is an omitted answer, and 2 is an incorrect answer.
The points awarded for correct answers
The points awarded for omitted answers (note that this may be negative)
The points deducted for incorrect answers (hint: this value has to be subtracted)
Note: The input will always be valid (an array and three numbers)
Examples
#1:
[0, 0, 0, 0, 2, 1, 0], 2, 0, 1 --> 9
because:
5 correct answers: 5*2 = 10
1 omitted answer: 1*0 = 0
1 wrong answer: 1*1 = 1
which is: 10 + 0 - 1 = 9
#2:
[0, 1, 0, 0, 2, 1, 0, 2, 2, 1], 3, -1, 2) --> 3
because: 4*3 + 3*-1 - 3*2 = 3
"""
def score_test(tests, right, omit, wrong):
return tests.count(0) * right + tests.count(1) * omit - tests.count(2) * wrong |
# https://open.kattis.com/problems/babybites
n = int(input())
inp = input().split()
for i in range(0, n):
if inp[i].isdigit():
if int(inp[i]) != i + 1:
print('something is fishy')
break
else:
print('makes sense')
| n = int(input())
inp = input().split()
for i in range(0, n):
if inp[i].isdigit():
if int(inp[i]) != i + 1:
print('something is fishy')
break
else:
print('makes sense') |
#Let's use tuples to store information about a file: its name,
#its type and its size in bytes.
#Fill in the gaps in this code to return the size in kilobytes (a kilobyte is 1024 bytes) up to 2 decimal places.
#Code:
def file_size(file_info):
name, type, size= file_info
return("{:.2f}".format(size / 1024))
print(file_size(('Class Assignment', 'docx', 17875))) # Should print 17.46
print(file_size(('Notes', 'txt', 496))) # Should print 0.48
print(file_size(('Program', 'py', 1239))) # Should print 1.21
| def file_size(file_info):
(name, type, size) = file_info
return '{:.2f}'.format(size / 1024)
print(file_size(('Class Assignment', 'docx', 17875)))
print(file_size(('Notes', 'txt', 496)))
print(file_size(('Program', 'py', 1239))) |
class DictToObj(object):
"""
transform a dict to a object
"""
def __init__(self, d):
for a, b in d.items():
if type(a) is bytes:
attr = a.decode()
else:
attr = a
if isinstance(b, (list, tuple)):
setattr(self, attr, [DictToObj(x) if isinstance(x, dict) else x for x in b])
else:
setattr(self, attr, DictToObj(b) if isinstance(b, dict) else b)
class DictToObjJson(object):
"""
transform a dict to a object
"""
def __init__(self, d):
for a, b in d.items():
if type(a) is bytes:
attr = a.decode()
else:
attr = a
if type(b) is bytes:
b = b.decode()
if isinstance(b, (list, tuple)):
setattr(self, attr, [DictToObj(x) if isinstance(x, dict) else x for x in b])
else:
setattr(self, attr, DictToObj(b) if isinstance(b, dict) else b) | class Dicttoobj(object):
"""
transform a dict to a object
"""
def __init__(self, d):
for (a, b) in d.items():
if type(a) is bytes:
attr = a.decode()
else:
attr = a
if isinstance(b, (list, tuple)):
setattr(self, attr, [dict_to_obj(x) if isinstance(x, dict) else x for x in b])
else:
setattr(self, attr, dict_to_obj(b) if isinstance(b, dict) else b)
class Dicttoobjjson(object):
"""
transform a dict to a object
"""
def __init__(self, d):
for (a, b) in d.items():
if type(a) is bytes:
attr = a.decode()
else:
attr = a
if type(b) is bytes:
b = b.decode()
if isinstance(b, (list, tuple)):
setattr(self, attr, [dict_to_obj(x) if isinstance(x, dict) else x for x in b])
else:
setattr(self, attr, dict_to_obj(b) if isinstance(b, dict) else b) |
"""
Given an array nums of 0s and 1s and an integer k, return True if all 1's are at least k places away from each other, otherwise return False.
Input: nums = [1,0,0,0,1,0,0,1], k = 2
Output: true
Explanation: Each of the 1s are at least 2 places away from each other.
Input: nums = [1,1,1,1,1], k = 0
Output: true
"""
class Solution:
def kLengthApart(self, nums: List[int], k: int) -> bool:
count_zero = 0
for i, n in enumerate(nums):
if n == 1:
if i != 0 and count_zero < k:
return False
count_zero = 0
elif n == 0:
count_zero += 1
if i == len(nums) - 1:
return True | """
Given an array nums of 0s and 1s and an integer k, return True if all 1's are at least k places away from each other, otherwise return False.
Input: nums = [1,0,0,0,1,0,0,1], k = 2
Output: true
Explanation: Each of the 1s are at least 2 places away from each other.
Input: nums = [1,1,1,1,1], k = 0
Output: true
"""
class Solution:
def k_length_apart(self, nums: List[int], k: int) -> bool:
count_zero = 0
for (i, n) in enumerate(nums):
if n == 1:
if i != 0 and count_zero < k:
return False
count_zero = 0
elif n == 0:
count_zero += 1
if i == len(nums) - 1:
return True |
"""Clean Code in Python - Chapter 7: Using Generators
> The Interface for Iteration
* Distinguish between iterable objects and iterators
* Create iterators
"""
class SequenceIterator:
"""
>>> si = SequenceIterator(1, 2)
>>> next(si)
1
>>> next(si)
3
>>> next(si)
5
"""
def __init__(self, start=0, step=1):
self.current = start
self.step = step
def __next__(self):
value = self.current
self.current += self.step
return value
| """Clean Code in Python - Chapter 7: Using Generators
> The Interface for Iteration
* Distinguish between iterable objects and iterators
* Create iterators
"""
class Sequenceiterator:
"""
>>> si = SequenceIterator(1, 2)
>>> next(si)
1
>>> next(si)
3
>>> next(si)
5
"""
def __init__(self, start=0, step=1):
self.current = start
self.step = step
def __next__(self):
value = self.current
self.current += self.step
return value |
def safe_repr(obj):
"""Returns a repr of an object and falls back to a minimal representation of type and ID if the call to repr raised
an error.
:param obj: object to safe repr
:returns: repr string or '(type<id> repr error)' string
:rtype: str
"""
try:
obj_repr = repr(obj)
except:
obj_repr = "({0}<{1}> repr error)".format(type(obj), id(obj))
return obj_repr
| def safe_repr(obj):
"""Returns a repr of an object and falls back to a minimal representation of type and ID if the call to repr raised
an error.
:param obj: object to safe repr
:returns: repr string or '(type<id> repr error)' string
:rtype: str
"""
try:
obj_repr = repr(obj)
except:
obj_repr = '({0}<{1}> repr error)'.format(type(obj), id(obj))
return obj_repr |
"""These SESSION commands are used to enter and exit the various
processors in the program.
"""
class ProcessorEntry:
def aux2(self, **kwargs):
"""Enters the binary file dumping processor.
APDL Command: /AUX2
Notes
-----
Enters the binary file dumping processor (ANSYS auxiliary processor
AUX2). This processor is used to dump the contents of certain ANSYS
binary files for visual examination.
This command is valid only at the Begin Level.
"""
command = "/AUX2,"
return self.run(command, **kwargs)
def aux3(self, **kwargs):
"""Enters the results file editing processor.
APDL Command: /AUX3
Notes
-----
Enters the results file editing processor (ANSYS auxiliary processor
AUX3). This processor is used to edit ANSYS results files.
This command is valid only at the Begin Level.
"""
command = "/AUX3,"
return self.run(command, **kwargs)
def aux12(self, **kwargs):
"""Enters the radiation processor.
APDL Command: /AUX12
Notes
-----
Enters the radiation processor (ANSYS auxiliary processor AUX12). This
processor supports the Radiation Matrix and the Radiosity Solver
methods.
This command is valid only at the Begin Level.
"""
command = "/AUX12,"
return self.run(command, **kwargs)
def aux15(self, **kwargs):
"""Enters the IGES file transfer processor.
APDL Command: /AUX15
Notes
-----
Enters the IGES file transfer processor (ANSYS auxiliary processor
AUX15), used to read an IGES data file into the ANSYS program.
This command is valid only at the Begin Level.
"""
command = "/AUX15,"
return self.run(command, **kwargs)
def finish(self, **kwargs):
"""Exits normally from a processor.
APDL Command: FINISH
Notes
-----
Exits any of the ANSYS processors or the DISPLAY program. For the
ANSYS processors, data will remain intact in the database but the
database is not automatically written to a file (use the SAVE command
to write the database to a file). See also the /QUIT command for an
alternate processor exit command. If exiting POST1, POST26, or OPT,
see additional notes below.
POST1: Data in the database will remain intact, including the POST1
element table data, the path table data, the fatigue table data, and
the load case pointers.
POST26: Data in the database will remain intact, except that POST26
variables are erased and specification commands (such as FILE, PRTIME,
NPRINT, etc.) are reset. Use the /QUIT command to exit the processor
and bypass these exceptions.
This command is valid in any processor. This command is not valid at
the Begin level.
"""
command = "FINISH,"
return self.run(command, **kwargs)
def map(self, kdim="", kout="", limit="", **kwargs):
"""Maps pressures from source points to target surface elements.
APDL Command: MAP
Parameters
----------
kdim
Interpolation key:
0 or 2 - Interpolation is done on a surface (default).
3 - Interpolation is done within a volume. This option is
useful if the supplied source data is volumetric field
data rather than surface data.
kout
Key to control how pressure is applied when a target node is
outside of the source region:
0 - Use the pressure(s) of the nearest source point for
target nodes outside of the region (default).
1 - Set pressures outside of the region to zero.
limit
Number of nearby points considered for interpolation. The
minimum is 5; the default is 20. Lower values reduce
processing time. However, some distorted or irregular
meshes will require a higher LIMIT value to find the
points encompassing the target node in order to define the
region for interpolation.
Notes
-----
Maps pressures from source points to target surface elements.
"""
return self.run(f"MAP,,{kdim},,{kout},{limit}", **kwargs)
def post1(self, **kwargs):
"""Enters the database results postprocessor.
APDL Command: /POST1
Notes
-----
Enters the general database results postprocessor (POST1). All load
symbols (/PBC, /PSF, or /PBF) are automatically turned off with this
command.
This command is valid only at the Begin Level.
"""
command = "/POST1,"
return self.run(command, **kwargs)
def post26(self, **kwargs):
"""Enters the time-history results postprocessor.
APDL Command: /POST26
Notes
-----
Enters the time-history results postprocessor (POST26).
This command is valid only at the Begin Level.
"""
command = "/POST26,"
return self.run(command, **kwargs)
def prep7(self, **kwargs):
"""Enters the model creation preprocessor.
APDL Command: /PREP7
Notes
-----
Enters the general input data preprocessor (PREP7).
This command is valid only at the Begin Level.
"""
command = "/PREP7,"
return self.run(command, **kwargs)
def quit(self, **kwargs):
"""Exits a processor.
APDL Command: /QUIT
Notes
-----
This is an alternative to the FINISH command. If any cleanup or file
writing is normally done by the FINISH command, it is bypassed if the
/QUIT command is used instead. A new processor may be entered after
this command. See the /EXIT command to terminate the run.
This command is valid in any processor. This command is not valid at
the Begin level.
"""
command = "/QUIT,"
return self.run(command, **kwargs)
def slashsolu(self, **kwargs):
"""Enters the solution processor.
APDL Command: /SOLU
Notes
-----
This command is valid only at the Begin Level.
"""
command = "/SOLU,"
return self.run(command, **kwargs)
| """These SESSION commands are used to enter and exit the various
processors in the program.
"""
class Processorentry:
def aux2(self, **kwargs):
"""Enters the binary file dumping processor.
APDL Command: /AUX2
Notes
-----
Enters the binary file dumping processor (ANSYS auxiliary processor
AUX2). This processor is used to dump the contents of certain ANSYS
binary files for visual examination.
This command is valid only at the Begin Level.
"""
command = '/AUX2,'
return self.run(command, **kwargs)
def aux3(self, **kwargs):
"""Enters the results file editing processor.
APDL Command: /AUX3
Notes
-----
Enters the results file editing processor (ANSYS auxiliary processor
AUX3). This processor is used to edit ANSYS results files.
This command is valid only at the Begin Level.
"""
command = '/AUX3,'
return self.run(command, **kwargs)
def aux12(self, **kwargs):
"""Enters the radiation processor.
APDL Command: /AUX12
Notes
-----
Enters the radiation processor (ANSYS auxiliary processor AUX12). This
processor supports the Radiation Matrix and the Radiosity Solver
methods.
This command is valid only at the Begin Level.
"""
command = '/AUX12,'
return self.run(command, **kwargs)
def aux15(self, **kwargs):
"""Enters the IGES file transfer processor.
APDL Command: /AUX15
Notes
-----
Enters the IGES file transfer processor (ANSYS auxiliary processor
AUX15), used to read an IGES data file into the ANSYS program.
This command is valid only at the Begin Level.
"""
command = '/AUX15,'
return self.run(command, **kwargs)
def finish(self, **kwargs):
"""Exits normally from a processor.
APDL Command: FINISH
Notes
-----
Exits any of the ANSYS processors or the DISPLAY program. For the
ANSYS processors, data will remain intact in the database but the
database is not automatically written to a file (use the SAVE command
to write the database to a file). See also the /QUIT command for an
alternate processor exit command. If exiting POST1, POST26, or OPT,
see additional notes below.
POST1: Data in the database will remain intact, including the POST1
element table data, the path table data, the fatigue table data, and
the load case pointers.
POST26: Data in the database will remain intact, except that POST26
variables are erased and specification commands (such as FILE, PRTIME,
NPRINT, etc.) are reset. Use the /QUIT command to exit the processor
and bypass these exceptions.
This command is valid in any processor. This command is not valid at
the Begin level.
"""
command = 'FINISH,'
return self.run(command, **kwargs)
def map(self, kdim='', kout='', limit='', **kwargs):
"""Maps pressures from source points to target surface elements.
APDL Command: MAP
Parameters
----------
kdim
Interpolation key:
0 or 2 - Interpolation is done on a surface (default).
3 - Interpolation is done within a volume. This option is
useful if the supplied source data is volumetric field
data rather than surface data.
kout
Key to control how pressure is applied when a target node is
outside of the source region:
0 - Use the pressure(s) of the nearest source point for
target nodes outside of the region (default).
1 - Set pressures outside of the region to zero.
limit
Number of nearby points considered for interpolation. The
minimum is 5; the default is 20. Lower values reduce
processing time. However, some distorted or irregular
meshes will require a higher LIMIT value to find the
points encompassing the target node in order to define the
region for interpolation.
Notes
-----
Maps pressures from source points to target surface elements.
"""
return self.run(f'MAP,,{kdim},,{kout},{limit}', **kwargs)
def post1(self, **kwargs):
"""Enters the database results postprocessor.
APDL Command: /POST1
Notes
-----
Enters the general database results postprocessor (POST1). All load
symbols (/PBC, /PSF, or /PBF) are automatically turned off with this
command.
This command is valid only at the Begin Level.
"""
command = '/POST1,'
return self.run(command, **kwargs)
def post26(self, **kwargs):
"""Enters the time-history results postprocessor.
APDL Command: /POST26
Notes
-----
Enters the time-history results postprocessor (POST26).
This command is valid only at the Begin Level.
"""
command = '/POST26,'
return self.run(command, **kwargs)
def prep7(self, **kwargs):
"""Enters the model creation preprocessor.
APDL Command: /PREP7
Notes
-----
Enters the general input data preprocessor (PREP7).
This command is valid only at the Begin Level.
"""
command = '/PREP7,'
return self.run(command, **kwargs)
def quit(self, **kwargs):
"""Exits a processor.
APDL Command: /QUIT
Notes
-----
This is an alternative to the FINISH command. If any cleanup or file
writing is normally done by the FINISH command, it is bypassed if the
/QUIT command is used instead. A new processor may be entered after
this command. See the /EXIT command to terminate the run.
This command is valid in any processor. This command is not valid at
the Begin level.
"""
command = '/QUIT,'
return self.run(command, **kwargs)
def slashsolu(self, **kwargs):
"""Enters the solution processor.
APDL Command: /SOLU
Notes
-----
This command is valid only at the Begin Level.
"""
command = '/SOLU,'
return self.run(command, **kwargs) |
"""
.. module:: data_series
:synopsis: Defines the DataSeries class.
.. moduleauthor:: Scott W. Fleming <fleming@stsci.edu>
"""
#--------------------
class DataSeries(object):
"""
Defines a Data Series object, which contains the data (plot series) and
plot labels for those series.
"""
def __init__(self, mission, obsid, plot_series, plot_labels,
xunits, yunits, errcode, is_ancillary=None):
"""
Create a DataSeries object.
:param mission: The mission this DataSeries comes from.
:type mission: str
:param obsid: The observation ID this DataSeries comes from.
:type obsid: str
:param plot_series: A 1-D list containing one or more 1-D lists that
contain the (x,y) pairs for the given series of data.
:type plot_series: list
:param plot_labels: A 1-D list containing the strings to use as plot
labels for each of the series of data.
:type plot_series: list
:param xunits: A 1-D list containing the strings to use as x-axis unit
labels for each of the series of data.
:type xunits: list
:param yunits: A 1-D list containing the strings to use as y-axis unit
labels for each of the series of data.
:type yunits: list
:param errcode: An integer used to signal if there was a problem reading
in the data.
:type errcode: int
:param is_ancillary: A 1-D list of ints that, if set, indicates the
returned data should NOT be plotted by default. If set to 0, then DO
plot by default.
:type is_ancillary: list
"""
self.mission = mission
self.obsid = obsid
self.plot_series = plot_series
self.plot_labels = plot_labels
self.xunits = xunits
self.yunits = yunits
self.errcode = errcode
if is_ancillary is not None:
self.is_ancillary = is_ancillary
#--------------------
| """
.. module:: data_series
:synopsis: Defines the DataSeries class.
.. moduleauthor:: Scott W. Fleming <fleming@stsci.edu>
"""
class Dataseries(object):
"""
Defines a Data Series object, which contains the data (plot series) and
plot labels for those series.
"""
def __init__(self, mission, obsid, plot_series, plot_labels, xunits, yunits, errcode, is_ancillary=None):
"""
Create a DataSeries object.
:param mission: The mission this DataSeries comes from.
:type mission: str
:param obsid: The observation ID this DataSeries comes from.
:type obsid: str
:param plot_series: A 1-D list containing one or more 1-D lists that
contain the (x,y) pairs for the given series of data.
:type plot_series: list
:param plot_labels: A 1-D list containing the strings to use as plot
labels for each of the series of data.
:type plot_series: list
:param xunits: A 1-D list containing the strings to use as x-axis unit
labels for each of the series of data.
:type xunits: list
:param yunits: A 1-D list containing the strings to use as y-axis unit
labels for each of the series of data.
:type yunits: list
:param errcode: An integer used to signal if there was a problem reading
in the data.
:type errcode: int
:param is_ancillary: A 1-D list of ints that, if set, indicates the
returned data should NOT be plotted by default. If set to 0, then DO
plot by default.
:type is_ancillary: list
"""
self.mission = mission
self.obsid = obsid
self.plot_series = plot_series
self.plot_labels = plot_labels
self.xunits = xunits
self.yunits = yunits
self.errcode = errcode
if is_ancillary is not None:
self.is_ancillary = is_ancillary |
class AdaptiveComponentInstanceUtils(object):
""" An interface for Adaptive Component Instances. """
@staticmethod
def CreateAdaptiveComponentInstance(doc, famSymb):
"""
CreateAdaptiveComponentInstance(doc: Document,famSymb: FamilySymbol) -> FamilyInstance
Creates a FamilyInstance of Adaptive Component Family.
doc: The Document
famSymb: The FamilySymbol
Returns: The Family Instance
"""
pass
@staticmethod
def GetInstancePlacementPointElementRefIds(famInst):
"""
GetInstancePlacementPointElementRefIds(famInst: FamilyInstance) -> IList[ElementId]
Gets Placement Adaptive Point Element Ref ids to which the instance geometry
adapts.
famInst: The FamilyInstance.
Returns: The Placement Adaptive Point Element Ref ids to which the instance geometry
adapts.
"""
pass
@staticmethod
def GetInstancePointElementRefIds(famInst):
"""
GetInstancePointElementRefIds(famInst: FamilyInstance) -> IList[ElementId]
Gets Adaptive Point Element Ref ids to which the instance geometry adapts.
famInst: The FamilyInstance.
Returns: The Adaptive Point Element Ref ids to which the instance geometry adapts.
"""
pass
@staticmethod
def GetInstanceShapeHandlePointElementRefIds(famInst):
"""
GetInstanceShapeHandlePointElementRefIds(famInst: FamilyInstance) -> IList[ElementId]
Gets Shape Handle Adaptive Point Element Ref ids to which the instance geometry
adapts.
famInst: The FamilyInstance
Returns: The Shape Handle Adaptive Point Element Ref ids to which the instance geometry
adapts.
"""
pass
@staticmethod
def HasAdaptiveFamilySymbol(famInst):
"""
HasAdaptiveFamilySymbol(famInst: FamilyInstance) -> bool
Verifies if a FamilyInstance has an Adaptive Family Symbol.
famInst: The FamilyInstance
Returns: True if the FamilyInstance has an Adaptive Family Symbol.
"""
pass
@staticmethod
def IsAdaptiveComponentInstance(famInst):
"""
IsAdaptiveComponentInstance(famInst: FamilyInstance) -> bool
Verifies if a FamilyInstance is an Adaptive Component Instance.
famInst: The FamilyInstance
Returns: True if the FamilyInstance has an Adaptive Component Instances.
"""
pass
@staticmethod
def IsAdaptiveFamilySymbol(famSymb):
"""
IsAdaptiveFamilySymbol(famSymb: FamilySymbol) -> bool
Verifies if a FamilySymbol is a valid Adaptive Family Symbol.
famSymb: The FamilySymbol
Returns: True if the FamilySymbol is a valid Adaptive Family Symbol.
"""
pass
@staticmethod
def IsInstanceFlipped(famInst):
"""
IsInstanceFlipped(famInst: FamilyInstance) -> bool
Gets the value of the flip parameter on the adaptive instance.
famInst: The FamilyInstance
Returns: True if the instance is flipped.
"""
pass
@staticmethod
def MoveAdaptiveComponentInstance(famInst, trf, unHost):
"""
MoveAdaptiveComponentInstance(famInst: FamilyInstance,trf: Transform,unHost: bool)
Moves Adaptive Component Instance by the specified transformation.
famInst: The FamilyInstance
trf: The Transformation
unHost: True if the move should disassociate the Point Element Refs from their hosts.
False if the Point Element Refs remain hosted.
"""
pass
@staticmethod
def SetInstanceFlipped(famInst, flip):
"""
SetInstanceFlipped(famInst: FamilyInstance,flip: bool)
Sets the value of the flip parameter on the adaptive instance.
famInst: The FamilyInstance
flip: The flip flag
"""
pass
__all__ = [
"CreateAdaptiveComponentInstance",
"GetInstancePlacementPointElementRefIds",
"GetInstancePointElementRefIds",
"GetInstanceShapeHandlePointElementRefIds",
"HasAdaptiveFamilySymbol",
"IsAdaptiveComponentInstance",
"IsAdaptiveFamilySymbol",
"IsInstanceFlipped",
"MoveAdaptiveComponentInstance",
"SetInstanceFlipped",
]
| class Adaptivecomponentinstanceutils(object):
""" An interface for Adaptive Component Instances. """
@staticmethod
def create_adaptive_component_instance(doc, famSymb):
"""
CreateAdaptiveComponentInstance(doc: Document,famSymb: FamilySymbol) -> FamilyInstance
Creates a FamilyInstance of Adaptive Component Family.
doc: The Document
famSymb: The FamilySymbol
Returns: The Family Instance
"""
pass
@staticmethod
def get_instance_placement_point_element_ref_ids(famInst):
"""
GetInstancePlacementPointElementRefIds(famInst: FamilyInstance) -> IList[ElementId]
Gets Placement Adaptive Point Element Ref ids to which the instance geometry
adapts.
famInst: The FamilyInstance.
Returns: The Placement Adaptive Point Element Ref ids to which the instance geometry
adapts.
"""
pass
@staticmethod
def get_instance_point_element_ref_ids(famInst):
"""
GetInstancePointElementRefIds(famInst: FamilyInstance) -> IList[ElementId]
Gets Adaptive Point Element Ref ids to which the instance geometry adapts.
famInst: The FamilyInstance.
Returns: The Adaptive Point Element Ref ids to which the instance geometry adapts.
"""
pass
@staticmethod
def get_instance_shape_handle_point_element_ref_ids(famInst):
"""
GetInstanceShapeHandlePointElementRefIds(famInst: FamilyInstance) -> IList[ElementId]
Gets Shape Handle Adaptive Point Element Ref ids to which the instance geometry
adapts.
famInst: The FamilyInstance
Returns: The Shape Handle Adaptive Point Element Ref ids to which the instance geometry
adapts.
"""
pass
@staticmethod
def has_adaptive_family_symbol(famInst):
"""
HasAdaptiveFamilySymbol(famInst: FamilyInstance) -> bool
Verifies if a FamilyInstance has an Adaptive Family Symbol.
famInst: The FamilyInstance
Returns: True if the FamilyInstance has an Adaptive Family Symbol.
"""
pass
@staticmethod
def is_adaptive_component_instance(famInst):
"""
IsAdaptiveComponentInstance(famInst: FamilyInstance) -> bool
Verifies if a FamilyInstance is an Adaptive Component Instance.
famInst: The FamilyInstance
Returns: True if the FamilyInstance has an Adaptive Component Instances.
"""
pass
@staticmethod
def is_adaptive_family_symbol(famSymb):
"""
IsAdaptiveFamilySymbol(famSymb: FamilySymbol) -> bool
Verifies if a FamilySymbol is a valid Adaptive Family Symbol.
famSymb: The FamilySymbol
Returns: True if the FamilySymbol is a valid Adaptive Family Symbol.
"""
pass
@staticmethod
def is_instance_flipped(famInst):
"""
IsInstanceFlipped(famInst: FamilyInstance) -> bool
Gets the value of the flip parameter on the adaptive instance.
famInst: The FamilyInstance
Returns: True if the instance is flipped.
"""
pass
@staticmethod
def move_adaptive_component_instance(famInst, trf, unHost):
"""
MoveAdaptiveComponentInstance(famInst: FamilyInstance,trf: Transform,unHost: bool)
Moves Adaptive Component Instance by the specified transformation.
famInst: The FamilyInstance
trf: The Transformation
unHost: True if the move should disassociate the Point Element Refs from their hosts.
False if the Point Element Refs remain hosted.
"""
pass
@staticmethod
def set_instance_flipped(famInst, flip):
"""
SetInstanceFlipped(famInst: FamilyInstance,flip: bool)
Sets the value of the flip parameter on the adaptive instance.
famInst: The FamilyInstance
flip: The flip flag
"""
pass
__all__ = ['CreateAdaptiveComponentInstance', 'GetInstancePlacementPointElementRefIds', 'GetInstancePointElementRefIds', 'GetInstanceShapeHandlePointElementRefIds', 'HasAdaptiveFamilySymbol', 'IsAdaptiveComponentInstance', 'IsAdaptiveFamilySymbol', 'IsInstanceFlipped', 'MoveAdaptiveComponentInstance', 'SetInstanceFlipped'] |
def gmaps_url_to_coords(url):
gmaps_coords = url.split('=')
coords = (0.0, 0.0) # defaults to 0,0
if len(gmaps_coords) == 2:
gmaps_coords = gmaps_coords[1]
coords = tuple(map(lambda c: float(c), gmaps_coords.split(',')))
return coords
| def gmaps_url_to_coords(url):
gmaps_coords = url.split('=')
coords = (0.0, 0.0)
if len(gmaps_coords) == 2:
gmaps_coords = gmaps_coords[1]
coords = tuple(map(lambda c: float(c), gmaps_coords.split(',')))
return coords |
# Copyright 2014 Google Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE filters or at
# https://developers.google.com/open-source/licenses/bsd
{
'includes': [
'../../common.gypi',
],
'targets': [
{
'target_name': 'filters',
'type': '<(component)',
'sources': [
'avc_decoder_configuration.cc',
'avc_decoder_configuration.h',
'decoder_configuration.cc',
'decoder_configuration.h',
'ec3_audio_util.cc',
'ec3_audio_util.h',
'h264_byte_to_unit_stream_converter.cc',
'h264_byte_to_unit_stream_converter.h',
'h264_parser.cc',
'h264_parser.h',
'h265_byte_to_unit_stream_converter.cc',
'h265_byte_to_unit_stream_converter.h',
'h265_parser.cc',
'h265_parser.h',
'h26x_bit_reader.cc',
'h26x_bit_reader.h',
'h26x_byte_to_unit_stream_converter.cc',
'h26x_byte_to_unit_stream_converter.h',
'hevc_decoder_configuration.cc',
'hevc_decoder_configuration.h',
'nal_unit_to_byte_stream_converter.cc',
'nal_unit_to_byte_stream_converter.h',
'nalu_reader.cc',
'nalu_reader.h',
'vp_codec_configuration.cc',
'vp_codec_configuration.h',
'vp8_parser.cc',
'vp8_parser.h',
'vp9_parser.cc',
'vp9_parser.h',
'vpx_parser.h',
],
'dependencies': [
'../../base/base.gyp:base',
],
},
{
'target_name': 'filters_unittest',
'type': '<(gtest_target_type)',
'sources': [
'avc_decoder_configuration_unittest.cc',
'ec3_audio_util_unittest.cc',
'h264_byte_to_unit_stream_converter_unittest.cc',
'h264_parser_unittest.cc',
'h265_byte_to_unit_stream_converter_unittest.cc',
'h265_parser_unittest.cc',
'h26x_bit_reader_unittest.cc',
'hevc_decoder_configuration_unittest.cc',
'nal_unit_to_byte_stream_converter_unittest.cc',
'nalu_reader_unittest.cc',
'vp_codec_configuration_unittest.cc',
'vp8_parser_unittest.cc',
'vp9_parser_unittest.cc',
],
'dependencies': [
'../../media/base/media_base.gyp:media_base',
'../../testing/gmock.gyp:gmock',
'../../testing/gtest.gyp:gtest',
'../test/media_test.gyp:media_test_support',
'filters',
],
},
],
}
| {'includes': ['../../common.gypi'], 'targets': [{'target_name': 'filters', 'type': '<(component)', 'sources': ['avc_decoder_configuration.cc', 'avc_decoder_configuration.h', 'decoder_configuration.cc', 'decoder_configuration.h', 'ec3_audio_util.cc', 'ec3_audio_util.h', 'h264_byte_to_unit_stream_converter.cc', 'h264_byte_to_unit_stream_converter.h', 'h264_parser.cc', 'h264_parser.h', 'h265_byte_to_unit_stream_converter.cc', 'h265_byte_to_unit_stream_converter.h', 'h265_parser.cc', 'h265_parser.h', 'h26x_bit_reader.cc', 'h26x_bit_reader.h', 'h26x_byte_to_unit_stream_converter.cc', 'h26x_byte_to_unit_stream_converter.h', 'hevc_decoder_configuration.cc', 'hevc_decoder_configuration.h', 'nal_unit_to_byte_stream_converter.cc', 'nal_unit_to_byte_stream_converter.h', 'nalu_reader.cc', 'nalu_reader.h', 'vp_codec_configuration.cc', 'vp_codec_configuration.h', 'vp8_parser.cc', 'vp8_parser.h', 'vp9_parser.cc', 'vp9_parser.h', 'vpx_parser.h'], 'dependencies': ['../../base/base.gyp:base']}, {'target_name': 'filters_unittest', 'type': '<(gtest_target_type)', 'sources': ['avc_decoder_configuration_unittest.cc', 'ec3_audio_util_unittest.cc', 'h264_byte_to_unit_stream_converter_unittest.cc', 'h264_parser_unittest.cc', 'h265_byte_to_unit_stream_converter_unittest.cc', 'h265_parser_unittest.cc', 'h26x_bit_reader_unittest.cc', 'hevc_decoder_configuration_unittest.cc', 'nal_unit_to_byte_stream_converter_unittest.cc', 'nalu_reader_unittest.cc', 'vp_codec_configuration_unittest.cc', 'vp8_parser_unittest.cc', 'vp9_parser_unittest.cc'], 'dependencies': ['../../media/base/media_base.gyp:media_base', '../../testing/gmock.gyp:gmock', '../../testing/gtest.gyp:gtest', '../test/media_test.gyp:media_test_support', 'filters']}]} |
def no_teen_sum(a, b, c):
retSum = 0
for i in [a, b, c]:
if i <= 19 and i >= 13 and i != 15 and i != 16:
continue
retSum += i
return retSum
| def no_teen_sum(a, b, c):
ret_sum = 0
for i in [a, b, c]:
if i <= 19 and i >= 13 and (i != 15) and (i != 16):
continue
ret_sum += i
return retSum |
"""Python implementation for doubly-linked list data structure."""
class DoublyLinkedList(object):
"""Sets properties and methods of a doubly-linked list."""
def __init__(self):
"""Create new instance of DoublyLinkedList."""
self.tail = None
self.head = None
self._length = 0
def push(self, val=None):
"""Instantiate and push new node."""
if val is None:
raise ValueError('You must give a value.')
new_node = Node(val, self.head)
if self.head is None:
self.head = new_node
self.tail = new_node
new_node.next_node = None
self._length += 1
return
self.head.prev_node = new_node
self.head = new_node
self._length += 1
def append(self, val=None):
"""Instantiate and append new node."""
if val is None:
raise ValueError('You must give a value.')
new_node = Node(val, None, self.tail)
if self.head is None:
self.head = new_node
self.tail = new_node
new_node.prev_node = None
self._length += 1
return
self.tail.next_node = new_node
self.tail = new_node
self._length += 1
def pop(self):
"""Remove and return node from head of doubly linked list."""
current_node = self.head
if current_node is None:
raise IndexError('The doubly linked list is empty.')
if current_node.next_node is not None:
self.head = current_node.next_node
self.head.prev_node = None
else:
self.head = None
self.tail = None
self._length -= 1
return current_node.val
def shift(self):
"""Remove and return node from tail of doubly linked list."""
current_node = self.tail
if current_node is None:
raise IndexError('The doubly linked list is empty.')
if current_node.prev_node is not None:
self.tail = current_node.prev_node
self.tail.next_node = None
else:
self.head = None
self.tail = None
self._length -= 1
return current_node.val
def remove(self, val):
"""Find and remove the first Node with a given value."""
current_item = self.head
if current_item is None:
raise ValueError('Node not in doubly linked list, it is empty.')
while current_item.val != val:
current_item = current_item.next_node
if current_item is None:
raise ValueError('Node not in doubly linked list.')
if self.head == self.tail:
self.head = None
self.tail = None
elif current_item.prev_node is None:
self.head = current_item.next_node
self.head.prev_node = None
elif current_item.next_node is None:
self.tail = current_item.prev_node
self.tail.next_node = None
else:
current_item.prev_node.next_node = current_item.next_node
current_item.next_node.prev_node = current_item.prev_node
self._length -= 1
def __len__(self):
"""Return the size of a doubly linked list, overwriting len method."""
return self._length
class Node(object):
"""Set properties and methods of Node class."""
def __init__(self, val, next_node=None, prev_node=None):
"""Create new Node."""
self.val = val
self.next_node = next_node
self.prev_node = prev_node
| """Python implementation for doubly-linked list data structure."""
class Doublylinkedlist(object):
"""Sets properties and methods of a doubly-linked list."""
def __init__(self):
"""Create new instance of DoublyLinkedList."""
self.tail = None
self.head = None
self._length = 0
def push(self, val=None):
"""Instantiate and push new node."""
if val is None:
raise value_error('You must give a value.')
new_node = node(val, self.head)
if self.head is None:
self.head = new_node
self.tail = new_node
new_node.next_node = None
self._length += 1
return
self.head.prev_node = new_node
self.head = new_node
self._length += 1
def append(self, val=None):
"""Instantiate and append new node."""
if val is None:
raise value_error('You must give a value.')
new_node = node(val, None, self.tail)
if self.head is None:
self.head = new_node
self.tail = new_node
new_node.prev_node = None
self._length += 1
return
self.tail.next_node = new_node
self.tail = new_node
self._length += 1
def pop(self):
"""Remove and return node from head of doubly linked list."""
current_node = self.head
if current_node is None:
raise index_error('The doubly linked list is empty.')
if current_node.next_node is not None:
self.head = current_node.next_node
self.head.prev_node = None
else:
self.head = None
self.tail = None
self._length -= 1
return current_node.val
def shift(self):
"""Remove and return node from tail of doubly linked list."""
current_node = self.tail
if current_node is None:
raise index_error('The doubly linked list is empty.')
if current_node.prev_node is not None:
self.tail = current_node.prev_node
self.tail.next_node = None
else:
self.head = None
self.tail = None
self._length -= 1
return current_node.val
def remove(self, val):
"""Find and remove the first Node with a given value."""
current_item = self.head
if current_item is None:
raise value_error('Node not in doubly linked list, it is empty.')
while current_item.val != val:
current_item = current_item.next_node
if current_item is None:
raise value_error('Node not in doubly linked list.')
if self.head == self.tail:
self.head = None
self.tail = None
elif current_item.prev_node is None:
self.head = current_item.next_node
self.head.prev_node = None
elif current_item.next_node is None:
self.tail = current_item.prev_node
self.tail.next_node = None
else:
current_item.prev_node.next_node = current_item.next_node
current_item.next_node.prev_node = current_item.prev_node
self._length -= 1
def __len__(self):
"""Return the size of a doubly linked list, overwriting len method."""
return self._length
class Node(object):
"""Set properties and methods of Node class."""
def __init__(self, val, next_node=None, prev_node=None):
"""Create new Node."""
self.val = val
self.next_node = next_node
self.prev_node = prev_node |
def read_input(filename):
with open(filename, 'r') as file:
N, k = file.readline().strip().split()
N, k = int(N), int(k)
X = []
clusters = []
for _ in range(N):
buffers = file.readline().strip().split()
X.append([float(v) for v in buffers])
for _ in range(k):
buffers = file.readline().strip().split()
clusters.append([float(v) for v in buffers])
return X, clusters
def add_2d_matrix(A, B):
a1, b1, c1, d1 = A[0][0], A[0][1], A[1][0], A[1][1]
a2, b2, c2, d2 = B[0][0], B[0][1], B[1][0], B[1][1]
return [[a1+a2, b1+b2], [c1+c2, d1+d2]]
def det_2d_matrix(A):
"""Determinant of a 2d matrix
A = [[a, b], [c, d]]
det(A) = ad - bc
"""
a, b, c, d = A[0][0], A[0][1], A[1][0], A[1][1]
return a * d - b * c
def invert_2d_matrix(A):
"""Inverse of a 2d matrix
A = [[a, b], [c, d]]
invert(A) = 1 / det(A) * [[d, -b], [-c, a]]
"""
a, b, c, d = A[0][0], A[0][1], A[1][0], A[1][1]
scalar = 1 / det_2d_matrix(A)
return [[scalar*d, scalar*-b], [scalar*-c, scalar*a]]
def mul_vector_2d_matrix(vector, A):
a, b, c, d = A[0][0], A[0][1], A[1][0], A[1][1]
return [vector[0]*a + vector[1]*c, vector[0]*b + vector[1]*d]
def mul_scalar_2d_matrix(scalar, A):
a, b, c, d = A[0][0], A[0][1], A[1][0], A[1][1]
return [[scalar*a, scalar*b], [scalar*c, scalar*d]]
def div_scalar_2d_matrix(scalar, A):
a, b, c, d = A[0][0], A[0][1], A[1][0], A[1][1]
return [[a/scalar, b/scalar], [c/scalar, d/scalar]]
def add_vector(vector1, vector2):
return [v1 + v2 for v1, v2 in zip(vector1, vector2)]
def sub_vector(vector1, vector2):
return [v1 - v2 for v1, v2 in zip(vector1, vector2)]
def dot_vector(vector1, vector2):
return sum([v1 * v2 for v1, v2 in zip(vector1, vector2)])
def mul_vector(vector1, vector2):
mul = [[0. for j in range(len(vector1))] for i in range(len(vector1))]
for i in range(len(vector1)):
for j in range(len(vector2)):
mul[i][j] = vector1[i] * vector2[j]
return mul
| def read_input(filename):
with open(filename, 'r') as file:
(n, k) = file.readline().strip().split()
(n, k) = (int(N), int(k))
x = []
clusters = []
for _ in range(N):
buffers = file.readline().strip().split()
X.append([float(v) for v in buffers])
for _ in range(k):
buffers = file.readline().strip().split()
clusters.append([float(v) for v in buffers])
return (X, clusters)
def add_2d_matrix(A, B):
(a1, b1, c1, d1) = (A[0][0], A[0][1], A[1][0], A[1][1])
(a2, b2, c2, d2) = (B[0][0], B[0][1], B[1][0], B[1][1])
return [[a1 + a2, b1 + b2], [c1 + c2, d1 + d2]]
def det_2d_matrix(A):
"""Determinant of a 2d matrix
A = [[a, b], [c, d]]
det(A) = ad - bc
"""
(a, b, c, d) = (A[0][0], A[0][1], A[1][0], A[1][1])
return a * d - b * c
def invert_2d_matrix(A):
"""Inverse of a 2d matrix
A = [[a, b], [c, d]]
invert(A) = 1 / det(A) * [[d, -b], [-c, a]]
"""
(a, b, c, d) = (A[0][0], A[0][1], A[1][0], A[1][1])
scalar = 1 / det_2d_matrix(A)
return [[scalar * d, scalar * -b], [scalar * -c, scalar * a]]
def mul_vector_2d_matrix(vector, A):
(a, b, c, d) = (A[0][0], A[0][1], A[1][0], A[1][1])
return [vector[0] * a + vector[1] * c, vector[0] * b + vector[1] * d]
def mul_scalar_2d_matrix(scalar, A):
(a, b, c, d) = (A[0][0], A[0][1], A[1][0], A[1][1])
return [[scalar * a, scalar * b], [scalar * c, scalar * d]]
def div_scalar_2d_matrix(scalar, A):
(a, b, c, d) = (A[0][0], A[0][1], A[1][0], A[1][1])
return [[a / scalar, b / scalar], [c / scalar, d / scalar]]
def add_vector(vector1, vector2):
return [v1 + v2 for (v1, v2) in zip(vector1, vector2)]
def sub_vector(vector1, vector2):
return [v1 - v2 for (v1, v2) in zip(vector1, vector2)]
def dot_vector(vector1, vector2):
return sum([v1 * v2 for (v1, v2) in zip(vector1, vector2)])
def mul_vector(vector1, vector2):
mul = [[0.0 for j in range(len(vector1))] for i in range(len(vector1))]
for i in range(len(vector1)):
for j in range(len(vector2)):
mul[i][j] = vector1[i] * vector2[j]
return mul |
def func():
yield 1
yield 2
yield 3
def main():
for item in func():
print(item)
# print(func()) #<generator object func at 0x7f227f3ae3b8>
obj1 = (1,2,3,)
obj = (i for i in range(10))
print (obj)
# print(obj[1]) # 'generator' object is not subscriptable
obj2 = [i for i in range(10)]
print(obj2)
print(obj2[1]) # Works absolutely fine
mygenerator = (x*x for x in range(3))
print(mygenerator)
print('-------')
print('Iterate A Generator')
print('-------')
for item in obj:
print(item)
print('-------')
print('Again!!!')
print('-------')
for item in obj:
print(item) # Prints nothing
if __name__ == '__main__':
main()
| def func():
yield 1
yield 2
yield 3
def main():
for item in func():
print(item)
obj1 = (1, 2, 3)
obj = (i for i in range(10))
print(obj)
obj2 = [i for i in range(10)]
print(obj2)
print(obj2[1])
mygenerator = (x * x for x in range(3))
print(mygenerator)
print('-------')
print('Iterate A Generator')
print('-------')
for item in obj:
print(item)
print('-------')
print('Again!!!')
print('-------')
for item in obj:
print(item)
if __name__ == '__main__':
main() |
def is_palindrome(str, length):
is_pali = True
length -= 1
for i in range (0, length//2):
if (str[i] != str[length - i]):
is_pali = False
break
return is_pali
str = input('please enter a string\n')
message = "Palindrome!" if is_palindrome(str, len(str)) else "not pali"
print (message) | def is_palindrome(str, length):
is_pali = True
length -= 1
for i in range(0, length // 2):
if str[i] != str[length - i]:
is_pali = False
break
return is_pali
str = input('please enter a string\n')
message = 'Palindrome!' if is_palindrome(str, len(str)) else 'not pali'
print(message) |
# TODO -- co.api.InvalidResponse is used in (client) public code. This should
# move to private.
class ClientError(Exception):
def __init__(self, status_code, message):
Exception.__init__(self)
self.status_code = status_code
self.message = message
def to_dict(self):
return {"message": self.message}
| class Clienterror(Exception):
def __init__(self, status_code, message):
Exception.__init__(self)
self.status_code = status_code
self.message = message
def to_dict(self):
return {'message': self.message} |
groups_dict = {
-1001384861110: "expresses"
}
log_file = "logs.log"
database_file = "Couples.sqlite"
couples_delta = 60 * 60 * 4
| groups_dict = {-1001384861110: 'expresses'}
log_file = 'logs.log'
database_file = 'Couples.sqlite'
couples_delta = 60 * 60 * 4 |
def sample_service(name=None):
"""
This is a sample service. Give it your name
and prepare to be greeted!
:param name: Your name
:type name: basestring
:return: A greeting or an error
"""
if name:
return { 'hello': name}
else:
return {"error": "what's your name?"} | def sample_service(name=None):
"""
This is a sample service. Give it your name
and prepare to be greeted!
:param name: Your name
:type name: basestring
:return: A greeting or an error
"""
if name:
return {'hello': name}
else:
return {'error': "what's your name?"} |
class Solution:
def reverseStr(self, s: str, k: int) -> str:
if not s or not k or k < 0:
return ""
s = list(s)
for i in range(0, len(s), 2 * k):
s[i: i+k] = reversed(s[i:i+k])
return ''.join(s)
| class Solution:
def reverse_str(self, s: str, k: int) -> str:
if not s or not k or k < 0:
return ''
s = list(s)
for i in range(0, len(s), 2 * k):
s[i:i + k] = reversed(s[i:i + k])
return ''.join(s) |
d1, d2 = map(int, input().split())
s = d1 + d2
dic = {}
for i in range(2, s + 1):
dic[i] = 0
for i in range(1, d1 + 1):
for j in range(1, d2 + 1):
dic[i + j] += 1
top = 0
out = []
for key in dic:
if dic[key] == top:
out.append(key)
elif dic[key] > top:
top = dic[key]
out = []
out.append(key)
else: continue
for i in out:
print(i) | (d1, d2) = map(int, input().split())
s = d1 + d2
dic = {}
for i in range(2, s + 1):
dic[i] = 0
for i in range(1, d1 + 1):
for j in range(1, d2 + 1):
dic[i + j] += 1
top = 0
out = []
for key in dic:
if dic[key] == top:
out.append(key)
elif dic[key] > top:
top = dic[key]
out = []
out.append(key)
else:
continue
for i in out:
print(i) |
'''
PARTIAL DEARRANGEMENTS
A partial dearrangement is a dearrangement where some points are
fixed. That is, given a number n and a number k, we need to find
count of all such dearrangements of n numbers, where k numbers are
fixed in their position.
'''
mod = 1000000007
def nCr(n, r, mod):
if n < r:
return -1
# We create a pascal triangle.
Pascal = []
Pascal.append(1)
for i in range(0, r):
Pascal.append(0)
# We use the known formula nCr = (n-1)C(r) + (n-1)C(r-1)
# for computing the values.
for i in range(0, n + 1):
k = ((i) if (i < r) else (r))
# We know, nCr = nC(n-r). Thus, at any point we only need min
# of the two, so as to improve our computation time.
for j in range(k, 0, -1):
Pascal[j] = (Pascal[j] + Pascal[j - 1]) % mod
return Pascal[r]
def count(n, k):
if k == 0:
if n == 0:
return 1
if n == 1:
return 0
return (n - 1) * (count(n - 1, 0) + count(n - 2, 0))
return nCr(n, k, mod) * count(n - k, 0)
number = int(input())
k = int(input())
dearrangements = count(number, k)
print("The number of partial dearrangements is", dearrangements)
'''
INPUT : n = 6
k = 3
OUTPUT: The number of partial dearrangements is 40
'''
| """
PARTIAL DEARRANGEMENTS
A partial dearrangement is a dearrangement where some points are
fixed. That is, given a number n and a number k, we need to find
count of all such dearrangements of n numbers, where k numbers are
fixed in their position.
"""
mod = 1000000007
def n_cr(n, r, mod):
if n < r:
return -1
pascal = []
Pascal.append(1)
for i in range(0, r):
Pascal.append(0)
for i in range(0, n + 1):
k = i if i < r else r
for j in range(k, 0, -1):
Pascal[j] = (Pascal[j] + Pascal[j - 1]) % mod
return Pascal[r]
def count(n, k):
if k == 0:
if n == 0:
return 1
if n == 1:
return 0
return (n - 1) * (count(n - 1, 0) + count(n - 2, 0))
return n_cr(n, k, mod) * count(n - k, 0)
number = int(input())
k = int(input())
dearrangements = count(number, k)
print('The number of partial dearrangements is', dearrangements)
'\nINPUT : n = 6\n k = 3\nOUTPUT: The number of partial dearrangements is 40\n' |
#!/usr/bin/env python3
class Color():
black = "\u001b[30m"
red = "\u001b[31m"
green = "\u001b[32m"
yellow = "\u001b[33m"
blue = "\u001b[34m"
magenta = "\u001b[35m"
cyan = "\u001b[36m"
white = "\u001b[37m"
reset = "\u001b[0m"
| class Color:
black = '\x1b[30m'
red = '\x1b[31m'
green = '\x1b[32m'
yellow = '\x1b[33m'
blue = '\x1b[34m'
magenta = '\x1b[35m'
cyan = '\x1b[36m'
white = '\x1b[37m'
reset = '\x1b[0m' |
# Classic crab rave text filter
def apply_filter(input_stream, overlay_text, font_file, font_color, font_size):
text_lines = overlay_text.split("\n")
text_shadow = int(font_size / 16)
# ffmpeg does not support multiline text with vertical align
if len(text_lines) >= 2:
video_stream = input_stream.video.drawtext(
x="(w-text_w)/2",
y="(h-text_h)/2-text_h",
text=text_lines[0],
fontfile=font_file,
fontcolor=font_color,
fontsize=font_size,
shadowcolor="black@0.6",
shadowx=str(text_shadow),
shadowy=str(text_shadow)
).drawtext(
x="(w-text_w)/2",
y="(h-text_h)/2+text_h",
text=text_lines[1],
fontfile=font_file,
fontcolor=font_color,
fontsize=font_size,
shadowcolor="black@0.6",
shadowx=str(text_shadow),
shadowy=str(text_shadow)
)
else:
video_stream = input_stream.video.drawtext(
x="(w-text_w)/2",
y="(h-text_h)/2",
text=overlay_text,
fontfile=font_file,
fontcolor=font_color,
fontsize=font_size,
shadowcolor="black@0.6",
shadowx=str(text_shadow),
shadowy=str(text_shadow)
)
return video_stream
| def apply_filter(input_stream, overlay_text, font_file, font_color, font_size):
text_lines = overlay_text.split('\n')
text_shadow = int(font_size / 16)
if len(text_lines) >= 2:
video_stream = input_stream.video.drawtext(x='(w-text_w)/2', y='(h-text_h)/2-text_h', text=text_lines[0], fontfile=font_file, fontcolor=font_color, fontsize=font_size, shadowcolor='black@0.6', shadowx=str(text_shadow), shadowy=str(text_shadow)).drawtext(x='(w-text_w)/2', y='(h-text_h)/2+text_h', text=text_lines[1], fontfile=font_file, fontcolor=font_color, fontsize=font_size, shadowcolor='black@0.6', shadowx=str(text_shadow), shadowy=str(text_shadow))
else:
video_stream = input_stream.video.drawtext(x='(w-text_w)/2', y='(h-text_h)/2', text=overlay_text, fontfile=font_file, fontcolor=font_color, fontsize=font_size, shadowcolor='black@0.6', shadowx=str(text_shadow), shadowy=str(text_shadow))
return video_stream |
class ElementableError(Exception):
pass
class InvalidElementError(KeyError, ElementableError):
def __init__(self, msg):
msg = f"Element {msg} is not supported"
super().__init__(msg)
| class Elementableerror(Exception):
pass
class Invalidelementerror(KeyError, ElementableError):
def __init__(self, msg):
msg = f'Element {msg} is not supported'
super().__init__(msg) |
NTIPAliasFlag = {}
NTIPAliasFlag["identified"]="0x10"
NTIPAliasFlag["eth"]="0x400000"
NTIPAliasFlag["ethereal"]="0x400000"
NTIPAliasFlag["runeword"]="0x4000000"
| ntip_alias_flag = {}
NTIPAliasFlag['identified'] = '0x10'
NTIPAliasFlag['eth'] = '0x400000'
NTIPAliasFlag['ethereal'] = '0x400000'
NTIPAliasFlag['runeword'] = '0x4000000' |
for _ in range(int(input())):
word = input()
if len(word) > 10:
print(word[0]+str(len(word)-2)+word[-1])
else:
print(word) | for _ in range(int(input())):
word = input()
if len(word) > 10:
print(word[0] + str(len(word) - 2) + word[-1])
else:
print(word) |
xmin, ymin, xmax, ymax = 100, 100, 1000, 800
# Bit code (0001, 0010, 0100, 1000 and 0000)
LEFT, RIGHT, BOT, TOP = 1, 2, 4, 8
INSIDE = 0
print(f"Xmin: {xmin}\nYmin: {ymin}\nXmax: {xmax}\nYmax: {ymax}")
x1 = float(input("Enter x: "))
y1 = float(input("Enter y: "))
x2 = float(input("Enter x2: "))
y2 = float(input("Enter y2: "))
# Compute code, doing OR operation according
# the position of x,y
def computeCode(x, y):
code = INSIDE
if x < xmin:
code |= LEFT
elif x > xmax:
code |= RIGHT
if y < ymin:
code |= BOT
elif y > ymax:
code |= TOP
return code
# Clipping line process
def cohenSuthClip(x1, y1, x2, y2):
# Compute region code
code1 = computeCode(x1, y1)
code2 = computeCode(x2, y2)
accept = False
while True:
# If both endpoints lie within clip bounds
if code1 == 0 and code2 == 0:
accept = True
break
# If both endpoints are outside clip bounds
elif (code1 & code2) != 0:
break
# Some inside and some outside
else:
# Clip process needed
# At least one point is outside clip
x = 1.
y = 1.
code_out = code1 if code1 != 0 else code2
# Find intersection point
# F(y) => y = y1 + slope * (x - x1),
# F(x) => x = x1 + (1 / slope) * (y - y1)
if code_out & TOP:
# point is above xmax
x = x1 + (x2 - x1) * (ymax - y1) / (y2 - y1)
y = ymax
elif code_out & BOT:
# point is below clip
x = x1 + (x2 - x1) * (ymin - y1) / (x2 - x1)
y = ymin
elif code_out & LEFT:
# point is to the left of the clip
y = y1 + (y2 - y1) * (xmin - x1) / (x2 - x1)
x = xmin
elif code_out & RIGHT:
# point is to the right of the clip
y = y1 + (y2 - y1) * (xmax - x1) / (x2 - x1)
x = xmax
# intersection point x,y is set now
# replace point outside clipping bounds
# by recently found intersection point
if code_out == code1:
x1 = x
y1 = y
code1 = computeCode(x1, y1)
else:
x2 = x
y2 = y
code2 = computeCode(x2, y2)
if accept:
print(f"Line accepted from {x1}, {y1}, {x2}, {y2}")
else:
print("Line rejected")
cohenSuthClip(x1, y1, x2, y2)
| (xmin, ymin, xmax, ymax) = (100, 100, 1000, 800)
(left, right, bot, top) = (1, 2, 4, 8)
inside = 0
print(f'Xmin: {xmin}\nYmin: {ymin}\nXmax: {xmax}\nYmax: {ymax}')
x1 = float(input('Enter x: '))
y1 = float(input('Enter y: '))
x2 = float(input('Enter x2: '))
y2 = float(input('Enter y2: '))
def compute_code(x, y):
code = INSIDE
if x < xmin:
code |= LEFT
elif x > xmax:
code |= RIGHT
if y < ymin:
code |= BOT
elif y > ymax:
code |= TOP
return code
def cohen_suth_clip(x1, y1, x2, y2):
code1 = compute_code(x1, y1)
code2 = compute_code(x2, y2)
accept = False
while True:
if code1 == 0 and code2 == 0:
accept = True
break
elif code1 & code2 != 0:
break
else:
x = 1.0
y = 1.0
code_out = code1 if code1 != 0 else code2
if code_out & TOP:
x = x1 + (x2 - x1) * (ymax - y1) / (y2 - y1)
y = ymax
elif code_out & BOT:
x = x1 + (x2 - x1) * (ymin - y1) / (x2 - x1)
y = ymin
elif code_out & LEFT:
y = y1 + (y2 - y1) * (xmin - x1) / (x2 - x1)
x = xmin
elif code_out & RIGHT:
y = y1 + (y2 - y1) * (xmax - x1) / (x2 - x1)
x = xmax
if code_out == code1:
x1 = x
y1 = y
code1 = compute_code(x1, y1)
else:
x2 = x
y2 = y
code2 = compute_code(x2, y2)
if accept:
print(f'Line accepted from {x1}, {y1}, {x2}, {y2}')
else:
print('Line rejected')
cohen_suth_clip(x1, y1, x2, y2) |
class Solution(object):
def firstMissingPositive(self, nums):
size = len(nums)
for i in range(size):
v = nums[i]
if v<1 or v > size:
nums[i]=size+10
for i in range(size):
v = abs(nums[i])
if v >0 and v<=size and nums[v-1]>0:
nums[v-1] = -nums[v-1]
for i in range(size):
if nums[i] >=0:
return i+1
return size + 1
def test():
s = Solution()
a=[1,2,7,8,3,9,11,12]
a=[1,2,3]
a=[1,2,3,0]
a=[1,1]
a=[1,2,0]
a=[0,1,2]
a=[1]
print(a)
r = s.firstMissingPositive(a)
print(a)
print(r)
test()
| class Solution(object):
def first_missing_positive(self, nums):
size = len(nums)
for i in range(size):
v = nums[i]
if v < 1 or v > size:
nums[i] = size + 10
for i in range(size):
v = abs(nums[i])
if v > 0 and v <= size and (nums[v - 1] > 0):
nums[v - 1] = -nums[v - 1]
for i in range(size):
if nums[i] >= 0:
return i + 1
return size + 1
def test():
s = solution()
a = [1, 2, 7, 8, 3, 9, 11, 12]
a = [1, 2, 3]
a = [1, 2, 3, 0]
a = [1, 1]
a = [1, 2, 0]
a = [0, 1, 2]
a = [1]
print(a)
r = s.firstMissingPositive(a)
print(a)
print(r)
test() |
# -*- coding: utf-8 -*-
class DbRouter(object):
external_db_models = ['cdr', 'numbers']
def db_for_read(self, model, **hints):
"""
Use original asterisk Db tables for read
"""
if model._meta.model_name.lower() in self.external_db_models:
return 'asterisk'
return None
def db_for_write(self, model, **hints):
if model._meta.model_name.lower() in self.external_db_models:
return 'asterisk'
return None
def allow_relation(self, obj1, obj2, **hints):
return True
def allow_migrate(self, db, app_label, model=None, **hints):
if app_label == 'asterisk':
return db == 'asterisk'
return True
| class Dbrouter(object):
external_db_models = ['cdr', 'numbers']
def db_for_read(self, model, **hints):
"""
Use original asterisk Db tables for read
"""
if model._meta.model_name.lower() in self.external_db_models:
return 'asterisk'
return None
def db_for_write(self, model, **hints):
if model._meta.model_name.lower() in self.external_db_models:
return 'asterisk'
return None
def allow_relation(self, obj1, obj2, **hints):
return True
def allow_migrate(self, db, app_label, model=None, **hints):
if app_label == 'asterisk':
return db == 'asterisk'
return True |
{
"targets": [
{
"target_name": "index"
}
]
} | {'targets': [{'target_name': 'index'}]} |
def countingSort(array):
size = len(array)
output = [0] * size
count = [0] * 10
for i in range(0, size):
count[array[i]] += 1
for j in range(1,10):
count[j] += count[j-1]
a = size-1
while a >= 0:
output[count[array[a]]-1] = array[a]
count[array[a]] -= 1
a -= 1
return output
unsorted_array = [4,2,2,2,8,8,3,3,1,7]
sorted_array=countingSort(unsorted_array)
print('Sorted Array:',sorted_array)
## OUTPUT:
'''
Sorted Array: [1, 2, 2, 2, 3, 3, 4, 7, 8, 8]
''' | def counting_sort(array):
size = len(array)
output = [0] * size
count = [0] * 10
for i in range(0, size):
count[array[i]] += 1
for j in range(1, 10):
count[j] += count[j - 1]
a = size - 1
while a >= 0:
output[count[array[a]] - 1] = array[a]
count[array[a]] -= 1
a -= 1
return output
unsorted_array = [4, 2, 2, 2, 8, 8, 3, 3, 1, 7]
sorted_array = counting_sort(unsorted_array)
print('Sorted Array:', sorted_array)
'\nSorted Array: [1, 2, 2, 2, 3, 3, 4, 7, 8, 8]\n\n' |
# Uses python3
def calc_fib(n):
fib_nums = []
fib_nums.append(0)
fib_nums.append(1)
for i in range(2, n + 1):
fib_nums.append(fib_nums[i - 1] + fib_nums[i - 2])
return fib_nums[n]
n = int(input())
print(calc_fib(n))
| def calc_fib(n):
fib_nums = []
fib_nums.append(0)
fib_nums.append(1)
for i in range(2, n + 1):
fib_nums.append(fib_nums[i - 1] + fib_nums[i - 2])
return fib_nums[n]
n = int(input())
print(calc_fib(n)) |
# -*- coding: utf-8 -*-
"""
State engine for django models.
Define a state graph for a model and remember the state of each object.
State transitions can be logged for objects.
"""
#: The version list
VERSION = (2, 0, 1)
#: The actual version number, used by python (and shown in sentry)
__version__ = '.'.join(map(str, VERSION))
__all__ = [
'__version__',
]
| """
State engine for django models.
Define a state graph for a model and remember the state of each object.
State transitions can be logged for objects.
"""
version = (2, 0, 1)
__version__ = '.'.join(map(str, VERSION))
__all__ = ['__version__'] |
#Narcissistic Number: (find all this kinds of number fromm 100~999)
#example: 153 = 1**3 + 5**3 + 3**3
#................method 1............................
# for x in range(100, 1000):
# digit_3 = x//100
# digit_2 = x%100//10
# digit_1 = x%10
# if x == digit_3**3 + digit_2**3 + digit_1**3:
# print (x)
#................method 2............................
# for x in range(100,1000):
# s=str(x)
# digit_3 = int(s[0])
# digit_2 = int(s[1])
# digit_1 = int(s[2])
# if x == digit_3**3 + digit_2**3 + digit_1**3:
# print (x)
#................method 3............................
for digit_3 in range(1, 10):
for digit_2 in range(10):
for digit_1 in range (10):
x = 100*digit_3 + 10*digit_2 + digit_1
if x == digit_3**3 + digit_2**3 + digit_1**3:
print (x) | for digit_3 in range(1, 10):
for digit_2 in range(10):
for digit_1 in range(10):
x = 100 * digit_3 + 10 * digit_2 + digit_1
if x == digit_3 ** 3 + digit_2 ** 3 + digit_1 ** 3:
print(x) |
"""
Copyright 2021 - Giovanni (iGio90) Rocca
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
BIG_ENDIAN = 'big endian'
LITTLE_ENDIAN = 'little endian'
DATA_TYPES = [
('byte', 1),
('short', 2),
('int', 4),
('long', 8),
('varInt', 0),
('string', 0),
('array', 0)
]
class DataType:
def __init__(self, data_type, endianness, length_type=None):
self.data_type = data_type
self.endianness = endianness
self.length_type: DataType = length_type
def get_length(self):
return DATA_TYPES[self.data_type][1]
def get_endianness_value(self):
return 'big' if self.endianness == 0 else 'little'
def serialize(self):
obj = {
'data_type': self.data_type,
'endianness': self.endianness,
'length': None
}
if self.length_type is not None:
obj['length'] = self.length_type.serialize()
return obj
| """
Copyright 2021 - Giovanni (iGio90) Rocca
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
big_endian = 'big endian'
little_endian = 'little endian'
data_types = [('byte', 1), ('short', 2), ('int', 4), ('long', 8), ('varInt', 0), ('string', 0), ('array', 0)]
class Datatype:
def __init__(self, data_type, endianness, length_type=None):
self.data_type = data_type
self.endianness = endianness
self.length_type: DataType = length_type
def get_length(self):
return DATA_TYPES[self.data_type][1]
def get_endianness_value(self):
return 'big' if self.endianness == 0 else 'little'
def serialize(self):
obj = {'data_type': self.data_type, 'endianness': self.endianness, 'length': None}
if self.length_type is not None:
obj['length'] = self.length_type.serialize()
return obj |
status = True
print(status)
print(type(status))
status = False
print(status)
print(type(status))
soda = 'coke'
print(soda == 'coke')
print(soda == 'pepsi')
print(soda == 'Coke')
print(soda != 'root beer')
names = ['mike', 'john', 'mary']
mike_status = 'mike' in names
bill_status = 'bill' in names
print(mike_status)
print(bill_status)
not_bill_status = 'bill' not in names
print(not_bill_status) | status = True
print(status)
print(type(status))
status = False
print(status)
print(type(status))
soda = 'coke'
print(soda == 'coke')
print(soda == 'pepsi')
print(soda == 'Coke')
print(soda != 'root beer')
names = ['mike', 'john', 'mary']
mike_status = 'mike' in names
bill_status = 'bill' in names
print(mike_status)
print(bill_status)
not_bill_status = 'bill' not in names
print(not_bill_status) |
def pytest_assertrepr_compare(op, left, right):
# add one more line for "assert ..."
return (
['']
+ ['---']
+ ['> ' + _.text for _ in left]
+ ['---']
+ ['> ' + _.text for _ in right]
)
def pytest_addoption(parser):
parser.addoption('--int', type='int')
def pytest_generate_tests(metafunc):
if 'int_test' in metafunc.fixturenames:
tests = []
count = metafunc.config.getoption('int')
if count:
tests = metafunc.module.int_tests(count)
metafunc.parametrize('int_test', tests)
| def pytest_assertrepr_compare(op, left, right):
return [''] + ['---'] + ['> ' + _.text for _ in left] + ['---'] + ['> ' + _.text for _ in right]
def pytest_addoption(parser):
parser.addoption('--int', type='int')
def pytest_generate_tests(metafunc):
if 'int_test' in metafunc.fixturenames:
tests = []
count = metafunc.config.getoption('int')
if count:
tests = metafunc.module.int_tests(count)
metafunc.parametrize('int_test', tests) |
def solution(s):
answer = []
str_idx = 0
for cont in s:
if cont.isalpha() == True:
if str_idx % 2 == 0:
answer.append(cont.upper())
else:
answer.append(cont.lower())
str_idx = str_idx + 1
else:
if cont == ' ':
str_idx = 0
answer.append(cont)
return ''.join(answer) | def solution(s):
answer = []
str_idx = 0
for cont in s:
if cont.isalpha() == True:
if str_idx % 2 == 0:
answer.append(cont.upper())
else:
answer.append(cont.lower())
str_idx = str_idx + 1
else:
if cont == ' ':
str_idx = 0
answer.append(cont)
return ''.join(answer) |
MAX_ROWS_DISPLAYABLE = 60
MAX_COLS_DISPLAYABLE = 80
cmap_freq = 'viridis'
cmap_grouping = 'copper' # 'Greys'
grouping_text_color = 'white'
grouping_text_color_background = 'grey'
grouping_fontweight = 'bold'
| max_rows_displayable = 60
max_cols_displayable = 80
cmap_freq = 'viridis'
cmap_grouping = 'copper'
grouping_text_color = 'white'
grouping_text_color_background = 'grey'
grouping_fontweight = 'bold' |
"""
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
"""
for s in [*open(0)][1:]:
n,m=map(int,s.split())
print(0-(-n*m)//2) | """
*
* Author: Juarez Paulino(coderemite)
* Email: juarez.paulino@gmail.com
*
"""
for s in [*open(0)][1:]:
(n, m) = map(int, s.split())
print(0 - -n * m // 2) |
class AccelerationException(Exception):
def __init__(self, message='This is neither acceleration nor deceleration... Go away and program Java, BooN'):
self.message = message
super().__init__(self.message)
class NoMemberException(Exception):
def __init__(self, message='This truck is not a convoy member'):
self.message = message
super().__init__(self.message)
class TruckBrokenException(Exception):
def __init__(self, message='A broken truck can\'t do this'):
self.message = message
super().__init__(self.message)
| class Accelerationexception(Exception):
def __init__(self, message='This is neither acceleration nor deceleration... Go away and program Java, BooN'):
self.message = message
super().__init__(self.message)
class Nomemberexception(Exception):
def __init__(self, message='This truck is not a convoy member'):
self.message = message
super().__init__(self.message)
class Truckbrokenexception(Exception):
def __init__(self, message="A broken truck can't do this"):
self.message = message
super().__init__(self.message) |
class InvalidValueError(Exception):
pass
class NotFoundError(Exception):
pass
| class Invalidvalueerror(Exception):
pass
class Notfounderror(Exception):
pass |
c = get_config()
c.ContentsManager.root_dir = "/root/"
c.NotebookApp.allow_root = True
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Comment out this line or first hash your own password
#c.NotebookApp.password = u'sha1:1234567abcdefghi'
c.ContentsManager.allow_hidden = True
| c = get_config()
c.ContentsManager.root_dir = '/root/'
c.NotebookApp.allow_root = True
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.ContentsManager.allow_hidden = True |
r,c=map(int,input('enter number of rows and columns of matrix: ').split())
m1=[]
m2=[]
a=[]
print('<<<<< enter element of matrix1 >>>>>')
for i in range(r):
l=[]
for j in range(c):
l.append(int(input(f"enter in m1[{i}][{j}]: ")))
m1.append(l)
print('<<<<< enter element of matrix2 >>>>>')
for i in range(r):
l=[]
for j in range(c):
l.append(int(input(f"enter in m2[{i}][{j}]: ")))
m2.append(l)
#addition of two matrix
print('<<<<< addition of two matrix >>>>>')
for i in range(r):
l=[]
for j in range(c):
l.append(int(m1[i][j])+int(m2[i][j]))
a.append(l)
print(a)
'''
output:
enter number of rows and columns of matrix: 2 2
<<<<< enter element of matrix1 >>>>>
enter in m1[0][0]: 21
enter in m1[0][1]: 22
enter in m1[1][0]: 23
enter in m1[1][1]: 24
<<<<< enter element of matrix2 >>>>>
enter in m2[0][0]: 1
enter in m2[0][1]: 2
enter in m2[1][0]: 3
enter in m2[1][1]: 4
<<<<< addition of two matrix >>>>>
[[22, 24], [26, 28]]
'''
| (r, c) = map(int, input('enter number of rows and columns of matrix: ').split())
m1 = []
m2 = []
a = []
print('<<<<< enter element of matrix1 >>>>>')
for i in range(r):
l = []
for j in range(c):
l.append(int(input(f'enter in m1[{i}][{j}]: ')))
m1.append(l)
print('<<<<< enter element of matrix2 >>>>>')
for i in range(r):
l = []
for j in range(c):
l.append(int(input(f'enter in m2[{i}][{j}]: ')))
m2.append(l)
print('<<<<< addition of two matrix >>>>>')
for i in range(r):
l = []
for j in range(c):
l.append(int(m1[i][j]) + int(m2[i][j]))
a.append(l)
print(a)
'\noutput:\nenter number of rows and columns of matrix: 2 2\n<<<<< enter element of matrix1 >>>>>\nenter in m1[0][0]: 21\nenter in m1[0][1]: 22\nenter in m1[1][0]: 23\nenter in m1[1][1]: 24\n<<<<< enter element of matrix2 >>>>>\nenter in m2[0][0]: 1\nenter in m2[0][1]: 2\nenter in m2[1][0]: 3\nenter in m2[1][1]: 4\n<<<<< addition of two matrix >>>>>\n[[22, 24], [26, 28]]\n' |
## Find peak element in an array
class Solution:
def findPeakElement(self, nums: List[int]) -> int:
## Iterative Binary Search
l, r = 0, len(nums)-1
while l<r:
mid = (l+r)//2
if nums[mid] > nums[mid+1]:
r = mid
else:
l = mid+1
return l
| class Solution:
def find_peak_element(self, nums: List[int]) -> int:
(l, r) = (0, len(nums) - 1)
while l < r:
mid = (l + r) // 2
if nums[mid] > nums[mid + 1]:
r = mid
else:
l = mid + 1
return l |
class Solution:
def numberOfWeeks(self, milestones: List[int]) -> int:
k = sorted(milestones,reverse = True)
t = sum(k) - k[0]
if k[0] <= t+1:
return sum(k)
else:
return 2*t+ 1 | class Solution:
def number_of_weeks(self, milestones: List[int]) -> int:
k = sorted(milestones, reverse=True)
t = sum(k) - k[0]
if k[0] <= t + 1:
return sum(k)
else:
return 2 * t + 1 |
# from geometry_msgs.msg import PoseStamped
# from geometry_msgs.msg import TwistStamped
# from autoware_msgs.msg import DetectedObjectArray
# from derived_object_msgs.msg import ObjectArray
# from carla_msgs.msg import CarlaEgoVehicleStatus
# from grid_map_msgs.msg import GridMap
PERCISION = 4
"""
Ego:
pos: (x, y),
heading: (x, y ,z, w),
velocity: (x, y),
accel: (x, y)
GroundTruth:
tag: string,
pos: (x, y),
heading: (x, y, x, w),
velocity: (x, y),
size: (x, y ,z)
Perception:
pos: (x, y),
heading: (x, y, x, w),
velocity: (x, y),
size: (x, y ,z)
"""
class Ego:
def __init__(self, pose_msg, velocity_msg, accel_msg):
self.pos = (pose_msg.pose.position.x, pose_msg.pose.position.y)
self.heading = (pose_msg.pose.orientation.x, pose_msg.pose.orientation.y, pose_msg.pose.orientation.z, pose_msg.pose.orientation.w)
self.velocity=(velocity_msg.twist.linear.x, velocity_msg.twist.linear.y)
self.accel=(accel_msg.acceleration.linear.x, accel_msg.acceleration.linear.y)
def data(self):
return (self.pos, self.heading, self.velocity, self.accel)
class GroundTruth:
# pose_msg indicates position of the ego vehicle
def __init__(self, pose_msg, obj_msg):
obj_msg.pose.position.x -= pose_msg.pose.position.x
obj_msg.pose.position.y -= pose_msg.pose.position.y
self.tag = ""
if(obj_msg.classification == 4):
self.tag = "pedestrian_"
elif(obj_msg.classification >= 5 and obj_msg.classification <= 9):
self.tag = "npc_"
self.tag += str(obj_msg.id)
self.pos = (obj_msg.pose.position.x, obj_msg.pose.position.y)
self.heading=(obj_msg.pose.orientation.x, obj_msg.pose.orientation.y, obj_msg.pose.orientation.z, obj_msg.pose.orientation.w)
self.velocity=(obj_msg.twist.linear.x, obj_msg.twist.linear.y)
self.size = (obj_msg.shape.dimensions[0], obj_msg.shape.dimensions[1], obj_msg.shape.dimensions[2])
def data(self):
return (self.pos, self.heading, self.velocity, self.size)
class Perception:
def __init__(self, obj_msg):
self.tag = str(obj_msg.id)
self.pos = (obj_msg.pose.position.x, obj_msg.pose.position.y)
self.heading=(obj_msg.pose.orientation.x, obj_msg.pose.orientation.y, obj_msg.pose.orientation.z, obj_msg.pose.orientation.w)
self.velocity=(obj_msg.velocity.linear.x, obj_msg.velocity.linear.y)
self.size = (obj_msg.dimensions.x, obj_msg.dimensions.y, obj_msg.dimensions.z)
def data(self):
return (self.pos, self.heading, self.velocity, self.size)
| percision = 4
'\nEgo:\n\tpos: \t\t(x, y),\n\theading: \t(x, y ,z, w),\n\tvelocity:\t(x, y),\n\taccel:\t\t(x, y)\n\n\nGroundTruth:\n\ttag:\t\tstring,\n\tpos:\t\t(x, y),\n\theading:\t(x, y, x, w),\n\tvelocity:\t(x, y),\n\tsize:\t\t(x, y ,z)\n\n\nPerception:\n\tpos:\t\t(x, y),\n\theading:\t(x, y, x, w),\n\tvelocity:\t(x, y),\n\tsize:\t\t(x, y ,z)\n'
class Ego:
def __init__(self, pose_msg, velocity_msg, accel_msg):
self.pos = (pose_msg.pose.position.x, pose_msg.pose.position.y)
self.heading = (pose_msg.pose.orientation.x, pose_msg.pose.orientation.y, pose_msg.pose.orientation.z, pose_msg.pose.orientation.w)
self.velocity = (velocity_msg.twist.linear.x, velocity_msg.twist.linear.y)
self.accel = (accel_msg.acceleration.linear.x, accel_msg.acceleration.linear.y)
def data(self):
return (self.pos, self.heading, self.velocity, self.accel)
class Groundtruth:
def __init__(self, pose_msg, obj_msg):
obj_msg.pose.position.x -= pose_msg.pose.position.x
obj_msg.pose.position.y -= pose_msg.pose.position.y
self.tag = ''
if obj_msg.classification == 4:
self.tag = 'pedestrian_'
elif obj_msg.classification >= 5 and obj_msg.classification <= 9:
self.tag = 'npc_'
self.tag += str(obj_msg.id)
self.pos = (obj_msg.pose.position.x, obj_msg.pose.position.y)
self.heading = (obj_msg.pose.orientation.x, obj_msg.pose.orientation.y, obj_msg.pose.orientation.z, obj_msg.pose.orientation.w)
self.velocity = (obj_msg.twist.linear.x, obj_msg.twist.linear.y)
self.size = (obj_msg.shape.dimensions[0], obj_msg.shape.dimensions[1], obj_msg.shape.dimensions[2])
def data(self):
return (self.pos, self.heading, self.velocity, self.size)
class Perception:
def __init__(self, obj_msg):
self.tag = str(obj_msg.id)
self.pos = (obj_msg.pose.position.x, obj_msg.pose.position.y)
self.heading = (obj_msg.pose.orientation.x, obj_msg.pose.orientation.y, obj_msg.pose.orientation.z, obj_msg.pose.orientation.w)
self.velocity = (obj_msg.velocity.linear.x, obj_msg.velocity.linear.y)
self.size = (obj_msg.dimensions.x, obj_msg.dimensions.y, obj_msg.dimensions.z)
def data(self):
return (self.pos, self.heading, self.velocity, self.size) |
class FilterModule(object):
''' Ansible core jinja2 filters '''
def filters(self):
return {
'infer_address' : self.infer_address
}
def infer_address(self, hostname, hostvars):
for t in ('ansible_ssh_host', 'ansible_host', 'inventory_hostname'):
if t in hostvars[hostname]:
return hostvars[hostname][t]
return None
| class Filtermodule(object):
""" Ansible core jinja2 filters """
def filters(self):
return {'infer_address': self.infer_address}
def infer_address(self, hostname, hostvars):
for t in ('ansible_ssh_host', 'ansible_host', 'inventory_hostname'):
if t in hostvars[hostname]:
return hostvars[hostname][t]
return None |
def check_log(recognition_log):
pair = recognition_log.split(",")
filename_tested = pair[0].split("/")[-1]
filename_result = pair[1].split("/")[-1]
no_extension_tested = filename_tested.split(".")[0]
no_extension_result = filename_result.split(".")[0]
check = no_extension_tested == no_extension_result
return check
def is_header(recognition_log):
pair = recognition_log.split(",")
is_header = pair[0] == "tolerance"
return is_header
false_pos = -1
true_pos = -1
tolerance = ""
first_time = True
filepath = './result.txt'
with open(filepath) as fp:
for cnt, line in enumerate(fp):
if(is_header(line)):
if first_time:
first_time = False
else:
with open('tolerance_exp.csv', 'a') as the_file:
the_file.write("%s,%i,%i\n" % (tolerance,true_pos,false_pos))
false_pos = 0
true_pos = 0
tolerance = (line.split(",")[1][:-1])
else:
if check_log(line):
true_pos += 1
else:
false_pos += 1
with open('tolerance_exp.csv', 'a') as the_file:
the_file.write("%s,%i,%i\n" % (tolerance,true_pos,false_pos))
| def check_log(recognition_log):
pair = recognition_log.split(',')
filename_tested = pair[0].split('/')[-1]
filename_result = pair[1].split('/')[-1]
no_extension_tested = filename_tested.split('.')[0]
no_extension_result = filename_result.split('.')[0]
check = no_extension_tested == no_extension_result
return check
def is_header(recognition_log):
pair = recognition_log.split(',')
is_header = pair[0] == 'tolerance'
return is_header
false_pos = -1
true_pos = -1
tolerance = ''
first_time = True
filepath = './result.txt'
with open(filepath) as fp:
for (cnt, line) in enumerate(fp):
if is_header(line):
if first_time:
first_time = False
else:
with open('tolerance_exp.csv', 'a') as the_file:
the_file.write('%s,%i,%i\n' % (tolerance, true_pos, false_pos))
false_pos = 0
true_pos = 0
tolerance = line.split(',')[1][:-1]
elif check_log(line):
true_pos += 1
else:
false_pos += 1
with open('tolerance_exp.csv', 'a') as the_file:
the_file.write('%s,%i,%i\n' % (tolerance, true_pos, false_pos)) |
class ResponseError(Exception):
"""Raised when the bittrex API returns an
error in the message response"""
class RequestError(Exception):
"""Raised when the request towards the bittrex
API is incorrect or fails"""
| class Responseerror(Exception):
"""Raised when the bittrex API returns an
error in the message response"""
class Requesterror(Exception):
"""Raised when the request towards the bittrex
API is incorrect or fails""" |
def cw_distance(az1: float, az2: float) -> float:
"""
Calculates the 'clockwise' distance between two azimuths, where 0 = North
and the direction of increasing angle is clockwise.
:param az1: Azimuth 1.
:type az1: float
:param az2: Azimuth 2.
:type az2: float
:returns: The angular distance between the azimuths, positive, going
clockwise.
:rtype: float
"""
diff = (az2 - az1) % 360
return diff
| def cw_distance(az1: float, az2: float) -> float:
"""
Calculates the 'clockwise' distance between two azimuths, where 0 = North
and the direction of increasing angle is clockwise.
:param az1: Azimuth 1.
:type az1: float
:param az2: Azimuth 2.
:type az2: float
:returns: The angular distance between the azimuths, positive, going
clockwise.
:rtype: float
"""
diff = (az2 - az1) % 360
return diff |
#!/usr/bin/env python3
def mod_sum(n):
return sum([x for x in range(n) if (x % 3 == 0) or (x % 5 == 0)])
| def mod_sum(n):
return sum([x for x in range(n) if x % 3 == 0 or x % 5 == 0]) |
class Detector(object):
"""detection algorithm to be implemented by sub class
input parameters: self and frame to be worked with
Must return frame after being processed and radius"""
def __init__(self):
"""init function"""
pass
def detection_algo(self, frame):
"""To be implemented by subclass"""
pass
| class Detector(object):
"""detection algorithm to be implemented by sub class
input parameters: self and frame to be worked with
Must return frame after being processed and radius"""
def __init__(self):
"""init function"""
pass
def detection_algo(self, frame):
"""To be implemented by subclass"""
pass |
def display(summary, *args):
args = list(args)
usage = ""
example = ""
details = ""
delimiter = "="
try:
usage = args.pop(0)
example = args.pop(0)
details = args.pop(0)
except IndexError:
# End of arg list
pass
for x in range(1, len(summary)):
delimiter = delimiter + "="
print("")
print(summary)
print(delimiter)
if usage:
print("Usage: " + usage)
if example:
print("Example: " + example)
if details:
print("")
print(details)
print("")
| def display(summary, *args):
args = list(args)
usage = ''
example = ''
details = ''
delimiter = '='
try:
usage = args.pop(0)
example = args.pop(0)
details = args.pop(0)
except IndexError:
pass
for x in range(1, len(summary)):
delimiter = delimiter + '='
print('')
print(summary)
print(delimiter)
if usage:
print('Usage: ' + usage)
if example:
print('Example: ' + example)
if details:
print('')
print(details)
print('') |
# -*- coding: utf-8 -*-
'''
Created on Mar 12, 2012
@author: hathcox
Copyright 2012 Root the Box
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.
'''
class Form(object):
''' Held by FormHandler's to deal with easy validation '''
def __init__(self, *args, **kwargs):
self.form_pieces = []
# Iterate over the dictionary
for name, msg in kwargs.iteritems():
# if we got supplied with a valid pair
if isinstance(name, basestring) and isinstance(msg, basestring):
piece = FormPiece(name, msg)
self.form_pieces.append(piece)
def __get_piece_names__(self):
''' returns peices that are marked with required true '''
required_pieces = []
for piece in self.form_pieces:
required_pieces.append(piece.name)
return required_pieces
def __contains_list__(self, small, big):
'''
Checks to make sure that all of the smaller list in inside of
the bigger list
'''
all_exist = True
for item in small:
if item not in big:
all_exist = False
return all_exist
def __get_piece_by_name__(self, name):
''' returns a FormPiece based on name '''
for piece in self.form_pieces:
if piece.name == name:
return piece
return None
def set_validation(self, argument_name, error_message):
'''
Use this to set the argument's error message and type after
creating a form
'''
piece = self.__get_piece_by_name__(argument_name)
# If we have a piece by that name
if piece is not None:
piece.error_message = error_message
def __get_error_messages__(self, arguments, required_pieces):
''' Returns a list of all applicable error messages '''
self.errors = []
for piece in required_pieces:
# If the peice isn't in our argument list
if piece.name not in arguments:
self.errors.append(piece.error_message)
def validate(self, arguments=None):
'''
This method is used to validate that a form's arguments
are actually existant
'''
if arguments is not None:
self.__get_error_messages__(arguments, self.form_pieces)
return 0 == len(self.errors)
return False
class FormPiece():
''' This is essentialy a wrapper for a given Input html tag '''
def __init__(self, name, error_message="Please Fill Out All Forms"):
'''
name is the argument name, and required is wether
or not we care if we got some entry
'''
self.name = name
self.error_message = error_message
| """
Created on Mar 12, 2012
@author: hathcox
Copyright 2012 Root the Box
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.
"""
class Form(object):
""" Held by FormHandler's to deal with easy validation """
def __init__(self, *args, **kwargs):
self.form_pieces = []
for (name, msg) in kwargs.iteritems():
if isinstance(name, basestring) and isinstance(msg, basestring):
piece = form_piece(name, msg)
self.form_pieces.append(piece)
def __get_piece_names__(self):
""" returns peices that are marked with required true """
required_pieces = []
for piece in self.form_pieces:
required_pieces.append(piece.name)
return required_pieces
def __contains_list__(self, small, big):
"""
Checks to make sure that all of the smaller list in inside of
the bigger list
"""
all_exist = True
for item in small:
if item not in big:
all_exist = False
return all_exist
def __get_piece_by_name__(self, name):
""" returns a FormPiece based on name """
for piece in self.form_pieces:
if piece.name == name:
return piece
return None
def set_validation(self, argument_name, error_message):
"""
Use this to set the argument's error message and type after
creating a form
"""
piece = self.__get_piece_by_name__(argument_name)
if piece is not None:
piece.error_message = error_message
def __get_error_messages__(self, arguments, required_pieces):
""" Returns a list of all applicable error messages """
self.errors = []
for piece in required_pieces:
if piece.name not in arguments:
self.errors.append(piece.error_message)
def validate(self, arguments=None):
"""
This method is used to validate that a form's arguments
are actually existant
"""
if arguments is not None:
self.__get_error_messages__(arguments, self.form_pieces)
return 0 == len(self.errors)
return False
class Formpiece:
""" This is essentialy a wrapper for a given Input html tag """
def __init__(self, name, error_message='Please Fill Out All Forms'):
"""
name is the argument name, and required is wether
or not we care if we got some entry
"""
self.name = name
self.error_message = error_message |
print(" _________ _____ ______ _________ ____ ______ ___________ ________ _________ ")
print(" | | | | / \ | | | | | ")
print(" | | | | /______\ | | | | |--------- ")
print(" | __|__ |______ | / \ |______ | |________| |_________ ")
print("\n\n")
print("This is a simple project [tic tac toe game] developed by Mr Ayush ")
lis=[]
for i in range(1,4):
lis.append(['*','*','*'])
def print_pattern(lis):
print(" [1] [2] [3]")
print("[1] %c |%c |%c"%(lis[0][0],lis[0][1],lis[0][2]))
print(" __|__|__")
print("[2] %c |%c |%c"%(lis[1][0],lis[1][1],lis[1][2]))
print(" __|__|__")
print("[3] %c |%c |%c"%(lis[2][0],lis[2][1],lis[2][2]))
print_pattern(lis)
print("\n\nTIC TAC TOE BOARD")
print("\nHERE * REPRESNT THE POSITION WHERE CHARACTER WILL BE PLOTTED\n\n")
name_first,name_second=input("Enter the name of FIRST PLAYER (-_-):="),input("Enter the name of SECOND PLAYER (-_-):=")
ch1,ch2=input("Enter the first character (^_^):= "),input("Enter the second chararcter (^_^):= ")
entry=int(input("Enter 1 if the FIRST turn is given to FIRST PLAYER ELSE the turn will be given to SECOND PLAYER:="))
print("\n\n\n")
print("Let's play!!!!!!!!!!")
def check_the_game_status(lis,x,y):
if lis[x][0]==lis[x][1]==lis[x][2]: #for checking horizontal line
return True
elif lis[0][y]==lis[1][y]==lis[2][y]: #for checking vertical line
return True
elif x==y: # for checking diagonal line
m=x
n=y
x=0
y=0
if lis[x][y]==lis[x+1][y+1]==lis[x+2][y+2]:
return True
elif m==1 and n==1:
x=0
y=2
if lis[x][y]==lis[x+1][y-1]==lis[x+2][y-2]:
return True
else:
return False
else:
return False
elif (x==0 and y==2) or (x==2 and y==0):
x=0
y=2
if lis[x][y]==lis[x+1][y-1]==lis[x+2][y-2]:
return True
else:
return False
lis=[]
for x in range(3):
lis.append([' ',' ',' '])
DATABASE=[] # to store the moves value(x,y) ,,, if someone enter the value which is already filled then it can be checked from here
print("PLEASE INPUT WHEN VALUE OF ROW AND COLUMN NUMBER WHEN ASKED AND INPUT IT WITH SEPARATED BY SINGLE SPACE (*_*)")
print("\n\n")
for m in range(9):
print("Enter the value of ROW and COLUMN number:=",end="")
x,y=list(map(eval,input().split(" ")))
while x>3 or y>3:
print("YOU HAVE ENTERED INVALID ROW-COLUMN VALUE,,PLEASE ENTER AGAIN:=")
x,y=list(map(eval,input().split(" ")))
x-=1
y-=1
while [x,y] in DATABASE:
print("!!!YOU HAVE ENTERED A VALUE ON BOARD WHICH IS ALREADY FILLED")
print("!!!AGAIN ENTER VALUES OF ROW AND COLUMN NUMBER:=")
x,y=list(map(eval,input().split(" ")))
DATABASE.append([x,y])
print("")
if entry==1:
lis[x][y]=ch1
current=name_first
entry=0
else:
lis[x][y]=ch2
current=name_second
entry=1
print_pattern(lis)
if check_the_game_status(lis,x,y):
print(current,"player WINS!!! (0_0) (0_0) (0_0),HOPE YOU ENJOYED(^_^)")
break
else:
print("Game TIED (0_0)!!!!!!!!!!")
| print(' _________ _____ ______ _________ ____ ______ ___________ ________ _________ ')
print(' | | | | / \\ | | | | | ')
print(' | | | | /______\\ | | | | |--------- ')
print(' | __|__ |______ | / \\ |______ | |________| |_________ ')
print('\n\n')
print('This is a simple project [tic tac toe game] developed by Mr Ayush ')
lis = []
for i in range(1, 4):
lis.append(['*', '*', '*'])
def print_pattern(lis):
print(' [1] [2] [3]')
print('[1] %c |%c |%c' % (lis[0][0], lis[0][1], lis[0][2]))
print(' __|__|__')
print('[2] %c |%c |%c' % (lis[1][0], lis[1][1], lis[1][2]))
print(' __|__|__')
print('[3] %c |%c |%c' % (lis[2][0], lis[2][1], lis[2][2]))
print_pattern(lis)
print('\n\nTIC TAC TOE BOARD')
print('\nHERE * REPRESNT THE POSITION WHERE CHARACTER WILL BE PLOTTED\n\n')
(name_first, name_second) = (input('Enter the name of FIRST PLAYER (-_-):='), input('Enter the name of SECOND PLAYER (-_-):='))
(ch1, ch2) = (input('Enter the first character (^_^):= '), input('Enter the second chararcter (^_^):= '))
entry = int(input('Enter 1 if the FIRST turn is given to FIRST PLAYER ELSE the turn will be given to SECOND PLAYER:='))
print('\n\n\n')
print("Let's play!!!!!!!!!!")
def check_the_game_status(lis, x, y):
if lis[x][0] == lis[x][1] == lis[x][2]:
return True
elif lis[0][y] == lis[1][y] == lis[2][y]:
return True
elif x == y:
m = x
n = y
x = 0
y = 0
if lis[x][y] == lis[x + 1][y + 1] == lis[x + 2][y + 2]:
return True
elif m == 1 and n == 1:
x = 0
y = 2
if lis[x][y] == lis[x + 1][y - 1] == lis[x + 2][y - 2]:
return True
else:
return False
else:
return False
elif x == 0 and y == 2 or (x == 2 and y == 0):
x = 0
y = 2
if lis[x][y] == lis[x + 1][y - 1] == lis[x + 2][y - 2]:
return True
else:
return False
lis = []
for x in range(3):
lis.append([' ', ' ', ' '])
database = []
print('PLEASE INPUT WHEN VALUE OF ROW AND COLUMN NUMBER WHEN ASKED AND INPUT IT WITH SEPARATED BY SINGLE SPACE (*_*)')
print('\n\n')
for m in range(9):
print('Enter the value of ROW and COLUMN number:=', end='')
(x, y) = list(map(eval, input().split(' ')))
while x > 3 or y > 3:
print('YOU HAVE ENTERED INVALID ROW-COLUMN VALUE,,PLEASE ENTER AGAIN:=')
(x, y) = list(map(eval, input().split(' ')))
x -= 1
y -= 1
while [x, y] in DATABASE:
print('!!!YOU HAVE ENTERED A VALUE ON BOARD WHICH IS ALREADY FILLED')
print('!!!AGAIN ENTER VALUES OF ROW AND COLUMN NUMBER:=')
(x, y) = list(map(eval, input().split(' ')))
DATABASE.append([x, y])
print('')
if entry == 1:
lis[x][y] = ch1
current = name_first
entry = 0
else:
lis[x][y] = ch2
current = name_second
entry = 1
print_pattern(lis)
if check_the_game_status(lis, x, y):
print(current, 'player WINS!!! (0_0) (0_0) (0_0),HOPE YOU ENJOYED(^_^)')
break
else:
print('Game TIED (0_0)!!!!!!!!!!') |
def Cron_Practice_help():
helpHand = """Hey There
Some useful commands -
fab - To Favorite Questios for Today
tasks - To see the questions that are scheduled for today
compile - To compile the tasks into a CSV File"""
print(helpHand)
def Cron_Practice_invalid():
print("Sorry Invalid Command !")
Cron_Practice_help() | def cron__practice_help():
help_hand = 'Hey There\n\n\tSome useful commands - \n\tfab - To Favorite Questios for Today\n\ttasks - To see the questions that are scheduled for today\n\tcompile - To compile the tasks into a CSV File'
print(helpHand)
def cron__practice_invalid():
print('Sorry Invalid Command !')
cron__practice_help() |
# Write your code here
n,k = [int(x) for x in input().split()]
l = []
while n > 0 :
a = int(input())
l.append(a)
n -= 1
while(l[0] <= k) :
l.pop(0)
l = l[::-1]
while (l[0] <= k) :
l.pop(0)
#print(l)
print(len(l))
| (n, k) = [int(x) for x in input().split()]
l = []
while n > 0:
a = int(input())
l.append(a)
n -= 1
while l[0] <= k:
l.pop(0)
l = l[::-1]
while l[0] <= k:
l.pop(0)
print(len(l)) |
def find_2020th_number_spoken(starting_numbers):
num_list = []
starting_numbers = [ int(num) for num in starting_numbers.split(',') ]
for i in range(0, 2020):
#print(f'i:{i}, num_list: {num_list}')
if i < len(starting_numbers):
#print(f'Still in starting numbers')
num_list.append(starting_numbers[i])
else:
last_num = num_list[i-1]
found_num = False
for j, num in enumerate(reversed(num_list[0:-1])):
if num == last_num:
#print(f'Found {last_num} at {j+1} numbers back')
num_list.append(j+1)
found_num = True
break
if found_num == False:
#print(f'Didn\'t find {last_num}, add 0 to list')
num_list.append(0)
return num_list[-1]
def find_nth_number_spoken(n, starting_numbers):
num_list = []
starting_numbers = [ int(num) for num in starting_numbers.split(',') ]
for i in range(0, n):
#if i % 10000 == 0:
#print(f'i:{i}, num_list: {num_list}')
if i < len(starting_numbers):
#print(f'Still in starting numbers')
num_list.append(starting_numbers[i])
else:
last_num = num_list[i-1]
found_num = False
for j, num in enumerate(reversed(num_list[0:-1])):
if num == last_num:
#print(f'Found {last_num} at {j+1} numbers back')
num_list.append(j+1)
found_num = True
break
if found_num == False:
#print(f'Didn\'t find {last_num}, add 0 to list')
num_list.append(0)
return num_list[-1]
def find_nth_number_spoken_dict(n, starting_numbers):
num_list = []
num_dict = {}
old_dict = {}
starting_numbers = [ int(num) for num in starting_numbers.split(',') ]
for i in range(0, n):
#if i % 10000 == 0:
# print(f'i:{i}')
#print(f'i:{i}, num_list: {num_list}, num_dict: {num_dict}, old_dict: {old_dict}')
if i < len(starting_numbers):
#print(f'Still in starting numbers')
num = starting_numbers[i]
num_list.append(num)
if num in num_dict:
old_dict[num] = num_dict[num]
num_dict[num] = i
else:
last_num = num_list[i-1]
if last_num in old_dict:
new_num = i - 1 - old_dict[last_num]
#print(f'Found last_num: {last_num} at index: {old_dict[last_num]}. new_num: {new_num}')
num_list.append(new_num)
old_dict[last_num] = num_dict[last_num]
if new_num in num_dict:
old_dict[new_num] = num_dict[new_num]
num_dict[new_num] = i
else:
#print(f'Did not find last_num: {last_num} in old_dict')
if last_num in num_dict:
#print(f'Found last_num: {last_num} in new_dict with value: {num_dict[last_num]}')
if num_dict[last_num] == i - 1:
pass
#print(f'Found it at previous index. Ignore')
else:
#print(f'Found it at other index. Add old_dict entry')
old_dict[num] = num_dict[num]
num_list.append(0)
if 0 in num_dict:
old_dict[0] = num_dict[0]
num_dict[0] = i
else:
print(f'How did this happen?')
return num_list[-1]
if __name__ == '__main__':
filenames = ['input-sample.txt', 'input.txt']
for filename in filenames:
with open(filename, 'r') as f:
starting_numbers_list = f.read().splitlines()
for starting_numbers in starting_numbers_list:
#num = find_2020th_number_spoken(starting_numbers)
#print(f'2020th number: {num}')
num = find_nth_number_spoken(2020, starting_numbers)
print(f'2020th number: {num}')
num = find_nth_number_spoken_dict(2020, starting_numbers)
print(f'2020th number: {num}')
for starting_numbers in starting_numbers_list:
num = find_nth_number_spoken_dict(30000000, starting_numbers)
print(f'30000000th number: {num}')
| def find_2020th_number_spoken(starting_numbers):
num_list = []
starting_numbers = [int(num) for num in starting_numbers.split(',')]
for i in range(0, 2020):
if i < len(starting_numbers):
num_list.append(starting_numbers[i])
else:
last_num = num_list[i - 1]
found_num = False
for (j, num) in enumerate(reversed(num_list[0:-1])):
if num == last_num:
num_list.append(j + 1)
found_num = True
break
if found_num == False:
num_list.append(0)
return num_list[-1]
def find_nth_number_spoken(n, starting_numbers):
num_list = []
starting_numbers = [int(num) for num in starting_numbers.split(',')]
for i in range(0, n):
if i < len(starting_numbers):
num_list.append(starting_numbers[i])
else:
last_num = num_list[i - 1]
found_num = False
for (j, num) in enumerate(reversed(num_list[0:-1])):
if num == last_num:
num_list.append(j + 1)
found_num = True
break
if found_num == False:
num_list.append(0)
return num_list[-1]
def find_nth_number_spoken_dict(n, starting_numbers):
num_list = []
num_dict = {}
old_dict = {}
starting_numbers = [int(num) for num in starting_numbers.split(',')]
for i in range(0, n):
if i < len(starting_numbers):
num = starting_numbers[i]
num_list.append(num)
if num in num_dict:
old_dict[num] = num_dict[num]
num_dict[num] = i
else:
last_num = num_list[i - 1]
if last_num in old_dict:
new_num = i - 1 - old_dict[last_num]
num_list.append(new_num)
old_dict[last_num] = num_dict[last_num]
if new_num in num_dict:
old_dict[new_num] = num_dict[new_num]
num_dict[new_num] = i
elif last_num in num_dict:
if num_dict[last_num] == i - 1:
pass
else:
old_dict[num] = num_dict[num]
num_list.append(0)
if 0 in num_dict:
old_dict[0] = num_dict[0]
num_dict[0] = i
else:
print(f'How did this happen?')
return num_list[-1]
if __name__ == '__main__':
filenames = ['input-sample.txt', 'input.txt']
for filename in filenames:
with open(filename, 'r') as f:
starting_numbers_list = f.read().splitlines()
for starting_numbers in starting_numbers_list:
num = find_nth_number_spoken(2020, starting_numbers)
print(f'2020th number: {num}')
num = find_nth_number_spoken_dict(2020, starting_numbers)
print(f'2020th number: {num}')
for starting_numbers in starting_numbers_list:
num = find_nth_number_spoken_dict(30000000, starting_numbers)
print(f'30000000th number: {num}') |
# used for template multi_assignment_list_modal
class MultiVideoAssignmentData:
def __init__(self, name, count, video_id, set_id):
self.name = name
self.count = count
self.video_id = video_id
self.set_id = set_id
| class Multivideoassignmentdata:
def __init__(self, name, count, video_id, set_id):
self.name = name
self.count = count
self.video_id = video_id
self.set_id = set_id |
first_number= 1
sec_number= 2
sum= 0
while (first_number < 4000000):
new= first_number + sec_number
first_number= sec_number
sec_number= new
if(first_number % 2== 0):
sum= sum+first_number
print(sum)
| first_number = 1
sec_number = 2
sum = 0
while first_number < 4000000:
new = first_number + sec_number
first_number = sec_number
sec_number = new
if first_number % 2 == 0:
sum = sum + first_number
print(sum) |
start_position = {
(1, 2): "y", (1, 3): "", (1, 5): "y'", (1, 6): "y2",
(2, 1): "z' y'", (2, 3): "z'", (2, 4): "z' y", (2, 6): "z' y2",
(3, 1): "x y2", (3, 2): "x y", (3, 4): "x", (3, 5): "x y'",
(4, 2): "z2 y'", (4, 3): "z2", (4, 5): "z2 y", (4, 6): "x2",
(5, 1): "z y", (5, 3): "z", (5, 4): "z y'", (5, 6): "z y2",
(6, 1): "x'", (6, 2): "x' y", (6, 4): "x' y2", (6, 5): "x' y'"
}
sorted_sides = [3, 5, 6, 2, 1, 4]
scramble_board_position = {
5: (1, 0),
4: (2, 1),
1: (1, 1),
6: (1, 2),
2: (0, 1),
3: (3, 1)
} | start_position = {(1, 2): 'y', (1, 3): '', (1, 5): "y'", (1, 6): 'y2', (2, 1): "z' y'", (2, 3): "z'", (2, 4): "z' y", (2, 6): "z' y2", (3, 1): 'x y2', (3, 2): 'x y', (3, 4): 'x', (3, 5): "x y'", (4, 2): "z2 y'", (4, 3): 'z2', (4, 5): 'z2 y', (4, 6): 'x2', (5, 1): 'z y', (5, 3): 'z', (5, 4): "z y'", (5, 6): 'z y2', (6, 1): "x'", (6, 2): "x' y", (6, 4): "x' y2", (6, 5): "x' y'"}
sorted_sides = [3, 5, 6, 2, 1, 4]
scramble_board_position = {5: (1, 0), 4: (2, 1), 1: (1, 1), 6: (1, 2), 2: (0, 1), 3: (3, 1)} |
sink_db = 'gedcom'
sink_tbl = {
"person": "person",
"family": "family"
}
| sink_db = 'gedcom'
sink_tbl = {'person': 'person', 'family': 'family'} |
#
# Copyright (c) 2017-2018 Joy Diamond. All rights reserved.
#
@gem('Sapphire.Combine')
def gem():
require_gem('Sapphire.Parse')
require_gem('Sapphire.SymbolTable')
variables = [
0, # 0 = copyright
]
query = variables.__getitem__
write = variables.__setitem__
qc = Method(query, 0)
wc = Method(write, 0)
wc0 = Method(wc, 0)
#
# Tokens
#
empty_indentation__function = conjure_indented_token(empty_indentation, FUNCTION__W)
#def gem():
gem__function_header = conjure_function_header(
empty_indentation__function,
conjure_name('gem'),
conjure_parameters_0(LP, RP),
COLON__LINE_MARKER,
)
class Copyright(Object):
__slots__ = ((
'year', # String+
'author', # String+
))
def __init__(t, year, author):
t.year = year
t.author = author
def write(t, f):
copyright = qc()
if t is not copyright:
if copyright is not 0:
close_copyright(f)
wc(t)
f.blank2()
f.line('#<Copyright (c) %s %s. All rights reserved.>', t.year, t.author)
f.blank_suppress()
Copyright.k1 = Copyright.year
Copyright.k2 = Copyright.author
copyright_cache = {}
conjure_copyright__X__dual = produce_conjure_dual('copyright', Copyright, copyright_cache)
def conjure_copyright(year, author):
return conjure_copyright__X__dual(intern_string(year), intern_string(author))
def close_copyright(f):
if qc() is not 0:
wc0()
f.blank_suppress()
f.line('#</Copyright>')
f.blank2()
class TwigCode(Object):
__slots__ = ((
'path', # String+
'part', # String
'copyright', # Copyright
'twig', # Any
'symbol_table', # GlobalSymbolTable
'transformed_twig', # Any
))
def __init__(t, path, part, copyright, twig, symbol_table, transformed_twig):
t.path = path
t.part = part
t.copyright = copyright
t.twig = twig
t.symbol_table = symbol_table
t.transformed_twig = transformed_twig
def write(t, f, tree = false):
t.copyright.write(f)
f.blank2()
f.line(arrange("#<source %r %s>", t.path, t.part))
if tree:
f2 = create_TokenOutput(f)
with f2.change_prefix('#', '# '):
f2.line()
r = t.twig.dump_token(f2)
f2.line()
assert not r
t.symbol_table.dump_global_symbol_table(f2)
f2.flush()
t.transformed_twig.write(f.write)
f.line('#</source>')
f.blank2()
def create_twig_code(path, part, copyright, twig, vary):
[art, transformed_twig] = build_global_symbol_table(twig, vary)
return TwigCode(path, part, copyright, twig, art, transformed_twig)
class RequireMany(Object):
__slots__ = ((
'vary', # SapphireTransform
'latest_many', # List of String
'_append_latest', # Method
'twig_many', # List of Twig
'_append_twig', # Method
'processed_set', # LiquidSet of String
'_add_processed', # Method
'_contains_processed', # Method
))
def __init__(t, vary):
t.vary = vary
t.latest_many = many = []
t._append_latest = many.append
t.twig_many = many = []
t._append_twig = many.append
t.processed_set = processed = LiquidSet()
t._add_processed = processed.add
t._contains_processed = processed.__contains__
#
# Ignore these file, pretend we already saw them
#
t._add_processed('Gem.Path2')
t._add_processed('Sapphire.Boot')
t._add_processed('Sapphire.Parse2')
def add_require_gem(t, module_name):
assert module_name.is_single_quote
s = module_name.s[1:-1]
if t._contains_processed(s):
return
t._append_latest(s)
def loop(t):
contains_processed = t._contains_processed
latest_many = t.latest_many
process_module = t.process_module
append_latest = t._append_latest
extend_latest = latest_many.extend
length_latest = latest_many.__len__
index_latest = latest_many.__getitem__
delete_latest = latest_many.__delitem__
index_latest_0 = Method(index_latest, 0)
index_latest_1 = Method(index_latest, 1)
delete_latest_0 = Method(delete_latest, 0)
zap_latest = Method(delete_latest, slice_all)
while 7 is 7:
total = length_latest()
if total is 0:
break
first = index_latest_0()
if contains_processed(first):
##line('Already processed %s', first)
delete_latest_0()
continue
line('Total %d - Process %s', total, first)
if total is 1:
zap_latest()
process_module(first)
continue
if total is 2:
other = index_latest_1()
zap_latest()
process_module(first)
append_latest(other)
continue
other = t.latest_many[1:]
zap_latest()
process_module(first)
extend_latest(other)
def process_module(t, module):
t._add_processed(module)
if module.startswith('Gem.'):
parent = '../Gem'
elif module.startswith('Pearl.'):
parent = '../Parser'
elif module.startswith('Sapphire.'):
parent = '../Parser'
elif module.startswith('Tremolite.'):
parent = '../Tremolite'
else:
line('module: %s', module)
path = path_join(parent, arrange('%s.py', module.replace('.', '/')))
gem = extract_gem(module, path, t.vary)
t._append_twig(gem)
gem.twig.find_require_gem(t)
def conjure_gem_decorator_header(module):
#@gem('Gem.Something')
return conjure_decorator_header(
empty_indentation__at_sign,
conjure_call_expression(
conjure_name('gem'),
conjure_arguments_1(LP, conjure_single_quote(portray(module)), RP),
),
LINE_MARKER,
)
def extract_boot(path, tree, index, copyright, vary):
boot_code = tree[index]
#@boot('Boot')
boot_code__decorator_header = conjure_decorator_header(
empty_indentation__at_sign,
conjure_call_expression(
conjure_name('boot'),
conjure_arguments_1(LP, conjure_single_quote("'Boot'"), RP),
),
LINE_MARKER,
)
assert boot_code.is_decorated_definition
assert boot_code.a is boot_code__decorator_header
return create_twig_code(
path,
arrange('[%d]', index),
extract_copyright(tree),
boot_code,
vary,
)
def extract_boot_decorator(function_name, path, tree, copyright, vary = 0):
boot_decorator = tree[0]
#def boot(module_name):
boot_decorator__function_header = conjure_function_header(
empty_indentation__function,
conjure_name(function_name),
conjure_parameters_1(LP, conjure_name('module_name'), RP),
COLON__LINE_MARKER,
)
assert boot_decorator.is_function_definition
assert boot_decorator.a is boot_decorator__function_header
assert boot_decorator.b.is_statement_suite
return create_twig_code(path, '[0]', copyright, boot_decorator, vary)
def extract_copyright(tree):
copyright = tree[0].prefix
if not copyright.is_comment_suite:
dump_token('copyright', copyright)
assert copyright.is_comment_suite
assert length(copyright) is 3
assert copyright[0] == empty_comment_line
assert copyright[1].is_comment_line
assert copyright[2] == empty_comment_line
m = copyright_match(copyright[1])
if m is none:
raise_runtime_error('failed to extract copyright from: %r', copyright[1])
return conjure_copyright(m.group('year'), m.group('author'))
def extract_gem(module, path, vary):
tree = parse_python(path)
assert length(tree) is 1
copyright = extract_copyright(tree)
gem = tree[0]
if gem.a is not conjure_gem_decorator_header(module):
dump_token('gem.a', gem.a)
dump_token('other', conjure_gem_decorator_header(module))
assert gem.is_decorated_definition
assert gem.a is conjure_gem_decorator_header(module)
assert gem.b.is_function_definition
assert gem.b.a is gem__function_header
return create_twig_code(path, '[0]', copyright, gem, vary)
def extract_sardnoyx_boot(vary):
path = path_join(source_path, 'Parser/Sardonyx/Boot.py')
tree = parse_python(path)
assert length(tree) is 1
return extract_boot(path, tree, 0, extract_copyright(tree), vary)
def extract_gem_boot(vary):
module_name = 'Gem.Boot'
path = path_join(source_path, 'Gem/Gem/Boot.py')
#path = 'b2.py'
tree = parse_python(path)
assert length(tree) is 3
copyright = extract_copyright(tree)
#
# [0]
# def boot(module_name):
# ...
#
boot_decorator = extract_boot_decorator('gem', path, tree, copyright)
del boot_decorator # We don't really want this, but just extracted it for testing purposes
#
# [1]: empty lines
#
assert tree[1].is_empty_line_suite
#
# [2]:
# @gem('Gem.Boot')
# def gem():
# ...
#
gem = tree[2]
assert gem.is_decorated_definition
assert gem.a is conjure_gem_decorator_header(module_name)
assert gem.b.is_function_definition
assert gem.b.a is gem__function_header
assert gem.b.b.is_statement_suite
return create_twig_code(path, '[2]', copyright, gem, vary)
def extract_sapphire_main(vary):
module_name = 'Sapphire.Main'
path = path_join(source_path, 'Parser/Sapphire/Main.py')
tree = parse_python(path)
assert length(tree) is 5
copyright = extract_copyright(tree)
#
# [0]:
# def boot(module_name):
# ...
#
boot_decorator = extract_boot_decorator('boot', path, tree, copyright, vary)
#
# [1]: empty lines
#
assert tree[1].is_empty_line_suite
#
# [2]:
# @boot('Boot')
# def boot():
# ...
#
boot = extract_boot(path, tree, 2, copyright, vary)
del boot # We don't really want this, but just extracted it for testing purposes
#
# [3]
#
assert tree[3].is_empty_line_suite
#
# [4]:
# @gem('Sapphire.Main')
# def gem():
# ...
#
main = tree[4]
assert main.is_decorated_definition
assert main.a is conjure_gem_decorator_header(module_name)
assert main.b.is_function_definition
assert main.b.a is gem__function_header
assert main.b.b.is_statement_suite
#
# Result
#
return ((
boot_decorator,
create_twig_code(path, '[4]', copyright, main, vary),
))
@share
def command_combine__X(module_name, vary, tree = true):
[boot_decorator, main_code] = extract_sapphire_main(vary)
sardnoyx_boot_code = extract_sardnoyx_boot(vary)
gem_boot_code = extract_gem_boot(vary)
require_many = RequireMany(vary)
require_many.process_module('Gem.Core')
main_code.twig.find_require_gem(require_many)
require_many.loop()
output_path = path_join(binary_path, arrange('.pyxie/%s.py', module_name))
with create_DelayedFileOutput(output_path) as f:
boot_decorator .write(f, tree)
sardnoyx_boot_code.write(f, tree)
for v in require_many.twig_many:
v.write(f, tree)
gem_boot_code.write(f, tree)
main_code .write(f, tree)
close_copyright(f)
#partial(read_text_from_path(output_path))
#for name in ['cell-function-parameter']:
# print_cache(name)
#print_cache()
| @gem('Sapphire.Combine')
def gem():
require_gem('Sapphire.Parse')
require_gem('Sapphire.SymbolTable')
variables = [0]
query = variables.__getitem__
write = variables.__setitem__
qc = method(query, 0)
wc = method(write, 0)
wc0 = method(wc, 0)
empty_indentation__function = conjure_indented_token(empty_indentation, FUNCTION__W)
gem__function_header = conjure_function_header(empty_indentation__function, conjure_name('gem'), conjure_parameters_0(LP, RP), COLON__LINE_MARKER)
class Copyright(Object):
__slots__ = ('year', 'author')
def __init__(t, year, author):
t.year = year
t.author = author
def write(t, f):
copyright = qc()
if t is not copyright:
if copyright is not 0:
close_copyright(f)
wc(t)
f.blank2()
f.line('#<Copyright (c) %s %s. All rights reserved.>', t.year, t.author)
f.blank_suppress()
Copyright.k1 = Copyright.year
Copyright.k2 = Copyright.author
copyright_cache = {}
conjure_copyright__x__dual = produce_conjure_dual('copyright', Copyright, copyright_cache)
def conjure_copyright(year, author):
return conjure_copyright__x__dual(intern_string(year), intern_string(author))
def close_copyright(f):
if qc() is not 0:
wc0()
f.blank_suppress()
f.line('#</Copyright>')
f.blank2()
class Twigcode(Object):
__slots__ = ('path', 'part', 'copyright', 'twig', 'symbol_table', 'transformed_twig')
def __init__(t, path, part, copyright, twig, symbol_table, transformed_twig):
t.path = path
t.part = part
t.copyright = copyright
t.twig = twig
t.symbol_table = symbol_table
t.transformed_twig = transformed_twig
def write(t, f, tree=false):
t.copyright.write(f)
f.blank2()
f.line(arrange('#<source %r %s>', t.path, t.part))
if tree:
f2 = create__token_output(f)
with f2.change_prefix('#', '# '):
f2.line()
r = t.twig.dump_token(f2)
f2.line()
assert not r
t.symbol_table.dump_global_symbol_table(f2)
f2.flush()
t.transformed_twig.write(f.write)
f.line('#</source>')
f.blank2()
def create_twig_code(path, part, copyright, twig, vary):
[art, transformed_twig] = build_global_symbol_table(twig, vary)
return twig_code(path, part, copyright, twig, art, transformed_twig)
class Requiremany(Object):
__slots__ = ('vary', 'latest_many', '_append_latest', 'twig_many', '_append_twig', 'processed_set', '_add_processed', '_contains_processed')
def __init__(t, vary):
t.vary = vary
t.latest_many = many = []
t._append_latest = many.append
t.twig_many = many = []
t._append_twig = many.append
t.processed_set = processed = liquid_set()
t._add_processed = processed.add
t._contains_processed = processed.__contains__
t._add_processed('Gem.Path2')
t._add_processed('Sapphire.Boot')
t._add_processed('Sapphire.Parse2')
def add_require_gem(t, module_name):
assert module_name.is_single_quote
s = module_name.s[1:-1]
if t._contains_processed(s):
return
t._append_latest(s)
def loop(t):
contains_processed = t._contains_processed
latest_many = t.latest_many
process_module = t.process_module
append_latest = t._append_latest
extend_latest = latest_many.extend
length_latest = latest_many.__len__
index_latest = latest_many.__getitem__
delete_latest = latest_many.__delitem__
index_latest_0 = method(index_latest, 0)
index_latest_1 = method(index_latest, 1)
delete_latest_0 = method(delete_latest, 0)
zap_latest = method(delete_latest, slice_all)
while 7 is 7:
total = length_latest()
if total is 0:
break
first = index_latest_0()
if contains_processed(first):
delete_latest_0()
continue
line('Total %d - Process %s', total, first)
if total is 1:
zap_latest()
process_module(first)
continue
if total is 2:
other = index_latest_1()
zap_latest()
process_module(first)
append_latest(other)
continue
other = t.latest_many[1:]
zap_latest()
process_module(first)
extend_latest(other)
def process_module(t, module):
t._add_processed(module)
if module.startswith('Gem.'):
parent = '../Gem'
elif module.startswith('Pearl.'):
parent = '../Parser'
elif module.startswith('Sapphire.'):
parent = '../Parser'
elif module.startswith('Tremolite.'):
parent = '../Tremolite'
else:
line('module: %s', module)
path = path_join(parent, arrange('%s.py', module.replace('.', '/')))
gem = extract_gem(module, path, t.vary)
t._append_twig(gem)
gem.twig.find_require_gem(t)
def conjure_gem_decorator_header(module):
return conjure_decorator_header(empty_indentation__at_sign, conjure_call_expression(conjure_name('gem'), conjure_arguments_1(LP, conjure_single_quote(portray(module)), RP)), LINE_MARKER)
def extract_boot(path, tree, index, copyright, vary):
boot_code = tree[index]
boot_code__decorator_header = conjure_decorator_header(empty_indentation__at_sign, conjure_call_expression(conjure_name('boot'), conjure_arguments_1(LP, conjure_single_quote("'Boot'"), RP)), LINE_MARKER)
assert boot_code.is_decorated_definition
assert boot_code.a is boot_code__decorator_header
return create_twig_code(path, arrange('[%d]', index), extract_copyright(tree), boot_code, vary)
def extract_boot_decorator(function_name, path, tree, copyright, vary=0):
boot_decorator = tree[0]
boot_decorator__function_header = conjure_function_header(empty_indentation__function, conjure_name(function_name), conjure_parameters_1(LP, conjure_name('module_name'), RP), COLON__LINE_MARKER)
assert boot_decorator.is_function_definition
assert boot_decorator.a is boot_decorator__function_header
assert boot_decorator.b.is_statement_suite
return create_twig_code(path, '[0]', copyright, boot_decorator, vary)
def extract_copyright(tree):
copyright = tree[0].prefix
if not copyright.is_comment_suite:
dump_token('copyright', copyright)
assert copyright.is_comment_suite
assert length(copyright) is 3
assert copyright[0] == empty_comment_line
assert copyright[1].is_comment_line
assert copyright[2] == empty_comment_line
m = copyright_match(copyright[1])
if m is none:
raise_runtime_error('failed to extract copyright from: %r', copyright[1])
return conjure_copyright(m.group('year'), m.group('author'))
def extract_gem(module, path, vary):
tree = parse_python(path)
assert length(tree) is 1
copyright = extract_copyright(tree)
gem = tree[0]
if gem.a is not conjure_gem_decorator_header(module):
dump_token('gem.a', gem.a)
dump_token('other', conjure_gem_decorator_header(module))
assert gem.is_decorated_definition
assert gem.a is conjure_gem_decorator_header(module)
assert gem.b.is_function_definition
assert gem.b.a is gem__function_header
return create_twig_code(path, '[0]', copyright, gem, vary)
def extract_sardnoyx_boot(vary):
path = path_join(source_path, 'Parser/Sardonyx/Boot.py')
tree = parse_python(path)
assert length(tree) is 1
return extract_boot(path, tree, 0, extract_copyright(tree), vary)
def extract_gem_boot(vary):
module_name = 'Gem.Boot'
path = path_join(source_path, 'Gem/Gem/Boot.py')
tree = parse_python(path)
assert length(tree) is 3
copyright = extract_copyright(tree)
boot_decorator = extract_boot_decorator('gem', path, tree, copyright)
del boot_decorator
assert tree[1].is_empty_line_suite
gem = tree[2]
assert gem.is_decorated_definition
assert gem.a is conjure_gem_decorator_header(module_name)
assert gem.b.is_function_definition
assert gem.b.a is gem__function_header
assert gem.b.b.is_statement_suite
return create_twig_code(path, '[2]', copyright, gem, vary)
def extract_sapphire_main(vary):
module_name = 'Sapphire.Main'
path = path_join(source_path, 'Parser/Sapphire/Main.py')
tree = parse_python(path)
assert length(tree) is 5
copyright = extract_copyright(tree)
boot_decorator = extract_boot_decorator('boot', path, tree, copyright, vary)
assert tree[1].is_empty_line_suite
boot = extract_boot(path, tree, 2, copyright, vary)
del boot
assert tree[3].is_empty_line_suite
main = tree[4]
assert main.is_decorated_definition
assert main.a is conjure_gem_decorator_header(module_name)
assert main.b.is_function_definition
assert main.b.a is gem__function_header
assert main.b.b.is_statement_suite
return (boot_decorator, create_twig_code(path, '[4]', copyright, main, vary))
@share
def command_combine__x(module_name, vary, tree=true):
[boot_decorator, main_code] = extract_sapphire_main(vary)
sardnoyx_boot_code = extract_sardnoyx_boot(vary)
gem_boot_code = extract_gem_boot(vary)
require_many = require_many(vary)
require_many.process_module('Gem.Core')
main_code.twig.find_require_gem(require_many)
require_many.loop()
output_path = path_join(binary_path, arrange('.pyxie/%s.py', module_name))
with create__delayed_file_output(output_path) as f:
boot_decorator.write(f, tree)
sardnoyx_boot_code.write(f, tree)
for v in require_many.twig_many:
v.write(f, tree)
gem_boot_code.write(f, tree)
main_code.write(f, tree)
close_copyright(f) |
class Solution(object):
def checkPossibility(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
is_modified = False
for i in xrange(len(nums) - 1):
if nums[i] > nums[i + 1]:
if is_modified:
return False
else:
if i == 0 or nums[i - 1] <= nums[i + 1]:
nums[i] = nums[i + 1]
else:
nums[i + 1] = nums[i]
is_modified = True
return True
| class Solution(object):
def check_possibility(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
is_modified = False
for i in xrange(len(nums) - 1):
if nums[i] > nums[i + 1]:
if is_modified:
return False
else:
if i == 0 or nums[i - 1] <= nums[i + 1]:
nums[i] = nums[i + 1]
else:
nums[i + 1] = nums[i]
is_modified = True
return True |
def diag(kp):
nk = []
for x in xrange(len(kp)):
l = []
for y in xrange(len(kp)):
l.append(kp[y][x])
nk.append("".join(l))
return tuple(nk)
def parse_line(line):
left, right = line.strip().split(" => ")
a = tuple(left.split("/"))
b = right.split("/")
return a, b
def parse_input(puzzle_input):
rules = {}
for line in puzzle_input:
k, v = parse_line(line)
rules[k] = v
rules[diag(k)] = v
k2 = tuple([s[::-1] for s in k])
rules[k2] = v
rules[diag(k2)] = v
k3 = tuple(s for s in k[::-1])
rules[k3] = v
rules[diag(k3)] = v
k4 = tuple([s[::-1] for s in k3])
rules[k4] = v
rules[diag(k4)] = v
return rules
def num_on(g):
return sum([sum([c == "#" for c in l]) for l in g])
def run(puzzle_input):
rules = parse_input(puzzle_input)
grid = [
".#.",
"..#",
"###",
]
for it in xrange(18):
length = len(grid)
new_grid = []
if length % 2 == 0:
for y in xrange(0, length, 2):
new_lines = [[],[],[]]
for x in xrange(0, length, 2):
k = tuple([grid[y][x:x+2], grid[y+1][x:x+2]])
v = rules[k]
for i, l in enumerate(v):
new_lines[i].extend(list(l))
new_grid.extend(["".join(l) for l in new_lines])
elif length % 3 == 0:
for y in xrange(0, length, 3):
new_lines = [[],[],[],[]]
for x in xrange(0, length, 3):
k = tuple([grid[y][x:x+3], grid[y+1][x:x+3], grid[y+2][x:x+3]])
v = rules[k]
for i, l in enumerate(v):
new_lines[i].extend(list(l))
new_grid.extend(["".join(l) for l in new_lines])
else:
raise "bad dimension"
grid = new_grid
if it == 4:
print(num_on(grid))
print(num_on(grid))
if __name__ == "__main__":
example_input = (
"../.# => ##./#../...",
".#./..#/### => #..#/..../..../#..#",
)
# run(example_input)
# 12
#
run(file("input21.txt"))
# 147
# 1936582
| def diag(kp):
nk = []
for x in xrange(len(kp)):
l = []
for y in xrange(len(kp)):
l.append(kp[y][x])
nk.append(''.join(l))
return tuple(nk)
def parse_line(line):
(left, right) = line.strip().split(' => ')
a = tuple(left.split('/'))
b = right.split('/')
return (a, b)
def parse_input(puzzle_input):
rules = {}
for line in puzzle_input:
(k, v) = parse_line(line)
rules[k] = v
rules[diag(k)] = v
k2 = tuple([s[::-1] for s in k])
rules[k2] = v
rules[diag(k2)] = v
k3 = tuple((s for s in k[::-1]))
rules[k3] = v
rules[diag(k3)] = v
k4 = tuple([s[::-1] for s in k3])
rules[k4] = v
rules[diag(k4)] = v
return rules
def num_on(g):
return sum([sum([c == '#' for c in l]) for l in g])
def run(puzzle_input):
rules = parse_input(puzzle_input)
grid = ['.#.', '..#', '###']
for it in xrange(18):
length = len(grid)
new_grid = []
if length % 2 == 0:
for y in xrange(0, length, 2):
new_lines = [[], [], []]
for x in xrange(0, length, 2):
k = tuple([grid[y][x:x + 2], grid[y + 1][x:x + 2]])
v = rules[k]
for (i, l) in enumerate(v):
new_lines[i].extend(list(l))
new_grid.extend([''.join(l) for l in new_lines])
elif length % 3 == 0:
for y in xrange(0, length, 3):
new_lines = [[], [], [], []]
for x in xrange(0, length, 3):
k = tuple([grid[y][x:x + 3], grid[y + 1][x:x + 3], grid[y + 2][x:x + 3]])
v = rules[k]
for (i, l) in enumerate(v):
new_lines[i].extend(list(l))
new_grid.extend([''.join(l) for l in new_lines])
else:
raise 'bad dimension'
grid = new_grid
if it == 4:
print(num_on(grid))
print(num_on(grid))
if __name__ == '__main__':
example_input = ('../.# => ##./#../...', '.#./..#/### => #..#/..../..../#..#')
run(file('input21.txt')) |
EXPECTED_RESPONSE_OF_JWKS_ENDPOINT = {
'keys': [
{
'kty': 'RSA',
'n': 'tSKfSeI0fukRIX38AHlKB1YPpX8PUYN2JdvfM-XjNmLfU1M74N0V'
'mdzIX95sneQGO9kC2xMIE-AIlt52Yf_KgBZggAlS9Y0Vx8DsSL2H'
'vOjguAdXir3vYLvAyyHin_mUisJOqccFKChHKjnk0uXy_38-1r17'
'_cYTp76brKpU1I4kM20M__dbvLBWjfzyw9ehufr74aVwr-0xJfsB'
'Vr2oaQFww_XHGz69Q7yHK6DbxYO4w4q2sIfcC4pT8XTPHo4JZ2M7'
'33Ea8a7HxtZS563_mhhRZLU5aynQpwaVv2U--CL6EvGt8TlNZOke'
'Rv8wz-Rt8B70jzoRpVK36rR-pHKlXhMGT619v82LneTdsqA25Wi2'
'Ld_c0niuul24A6-aaj2u9SWbxA9LmVtFntvNbRaHXE1SLpLPoIp8'
'uppGF02Nz2v3ld8gCnTTWfq_BQ80Qy8e0coRRABECZrjIMzHEg6M'
'loRDy4na0pRQv61VogqRKDU2r3_VezFPQDb3ciYsZjWBr3HpNOkU'
'jTrvLmFyOE9Q5R_qQGmc6BYtfk5rn7iIfXlkJAZHXhBy-ElBuiBM'
'-YSkFM7dH92sSIoZ05V4MP09Xcppx7kdwsJy72Sust9Hnd9B7V35'
'YnVF6W791lVHnenhCJOziRmkH4xLLbPkaST2Ks3IHH7tVltM6NsR'
'k3jNdVM',
'e': 'AQAB',
'alg': 'RS256',
'kid': '02B1174234C29F8EFB69911438F597FF3FFEE6B7',
'use': 'sig'
}
]
}
RESPONSE_OF_JWKS_ENDPOINT_WITH_WRONG_KEY = {
'keys': [
{
'kty': 'RSA',
'n': 'pSKfSeI0fukRIX38AHlKB1YPpX8PUYN2JdvfM-XjNmLfU1M74N0V'
'mdzIX95sneQGO9kC2xMIE-AIlt52Yf_KgBZggAlS9Y0Vx8DsSL2H'
'vOjguAdXir3vYLvAyyHin_mUisJOqccFKChHKjnk0uXy_38-1r17'
'_cYTp76brKpU1I4kM20M__dbvLBWjfzyw9ehufr74aVwr-0xJfsB'
'Vr2oaQFww_XHGz69Q7yHK6DbxYO4w4q2sIfcC4pT8XTPHo4JZ2M7'
'33Ea8a7HxtZS563_mhhRZLU5aynQpwaVv2U--CL6EvGt8TlNZOke'
'Rv8wz-Rt8B70jzoRpVK36rR-pHKlXhMGT619v82LneTdsqA25Wi2'
'Ld_c0niuul24A6-aaj2u9SWbxA9LmVtFntvNbRaHXE1SLpLPoIp8'
'uppGF02Nz2v3ld8gCnTTWfq_BQ80Qy8e0coRRABECZrjIMzHEg6M'
'loRDy4na0pRQv61VogqRKDU2r3_VezFPQDb3ciYsZjWBr3HpNOkU'
'jTrvLmFyOE9Q5R_qQGmc6BYtfk5rn7iIfXlkJAZHXhBy-ElBuiBM'
'-YSkFM7dH92sSIoZ05V4MP09Xcppx7kdwsJy72Sust9Hnd9B7V35'
'YnVF6W791lVHnenhCJOziRmkH4xLLbPkaST2Ks3IHH7tVltM6NsR'
'k3jNdVM',
'e': 'AQAB',
'alg': 'RS256',
'kid': '02B1174234C29F8EFB69911438F597FF3FFEE6B7',
'use': 'sig'
}
]
}
PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY-----
MIIJKwIBAAKCAgEAtSKfSeI0fukRIX38AHlKB1YPpX8PUYN2JdvfM+XjNmLfU1M7
4N0VmdzIX95sneQGO9kC2xMIE+AIlt52Yf/KgBZggAlS9Y0Vx8DsSL2HvOjguAdX
ir3vYLvAyyHin/mUisJOqccFKChHKjnk0uXy/38+1r17/cYTp76brKpU1I4kM20M
//dbvLBWjfzyw9ehufr74aVwr+0xJfsBVr2oaQFww/XHGz69Q7yHK6DbxYO4w4q2
sIfcC4pT8XTPHo4JZ2M733Ea8a7HxtZS563/mhhRZLU5aynQpwaVv2U++CL6EvGt
8TlNZOkeRv8wz+Rt8B70jzoRpVK36rR+pHKlXhMGT619v82LneTdsqA25Wi2Ld/c
0niuul24A6+aaj2u9SWbxA9LmVtFntvNbRaHXE1SLpLPoIp8uppGF02Nz2v3ld8g
CnTTWfq/BQ80Qy8e0coRRABECZrjIMzHEg6MloRDy4na0pRQv61VogqRKDU2r3/V
ezFPQDb3ciYsZjWBr3HpNOkUjTrvLmFyOE9Q5R/qQGmc6BYtfk5rn7iIfXlkJAZH
XhBy+ElBuiBM+YSkFM7dH92sSIoZ05V4MP09Xcppx7kdwsJy72Sust9Hnd9B7V35
YnVF6W791lVHnenhCJOziRmkH4xLLbPkaST2Ks3IHH7tVltM6NsRk3jNdVMCAwEA
AQKCAgEArx+0JXigDHtFZr4pYEPjwMgCBJ2dr8+L8PptB/4g+LoK9MKqR7M4aTO+
PoILPXPyWvZq/meeDakyZLrcdc8ad1ArKF7baDBpeGEbkRA9JfV5HjNq/ea4gyvD
MCGou8ZPSQCnkRmr8LFQbJDgnM5Za5AYrwEv2aEh67IrTHq53W83rMioIumCNiG+
7TQ7egEGiYsQ745GLrECLZhKKRTgt/T+k1cSk1LLJawme5XgJUw+3D9GddJEepvY
oL+wZ/gnO2ADyPnPdQ7oc2NPcFMXpmIQf29+/g7FflatfQhkIv+eC6bB51DhdMi1
zyp2hOhzKg6jn74ixVX+Hts2/cMiAPu0NaWmU9n8g7HmXWc4+uSO/fssGjI3DLYK
d5xnhrq4a3ZO5oJLeMO9U71+Ykctg23PTHwNAGrsPYdjGcBnJEdtbXa31agI5PAG
6rgGUY3iSoWqHLgBTxrX04TWVvLQi8wbxh7BEF0yasOeZKxdE2IWYg75zGsjluyH
lOnpRa5lSf6KZ6thh9eczFHYtS4DvYBcZ9hZW/g87ie28SkBFxxl0brYt9uKNYJv
uajVG8kT80AC7Wzg2q7Wmnoww3JNJUbNths5dqKyUSlMFMIB/vOePFHLrA6qDfAn
sQHgUb9WHhUrYsH20XKpqR2OjmWU05bV4pSMW/JwG37o+px1yKECggEBANnwx0d7
ksEMvJjeN5plDy3eMLifBI+6SL/o5TXDoFM6rJxF+0UP70uouYJq2dI+DCSA6c/E
sn7WAOirY177adKcBV8biwAtmKHnFnCs/kwAZq8lMvQPtNPJ/vq2n40kO48h8fxb
eGcmyAqFPZ4YKSxrPA4cdbHIuFSt9WyaUcVFmzdTFHVlRP70EXdmXHt84byWNB4C
Heq8zmrNxPNAi65nEkUks7iBQMtuvyV2+aXjDOTBMCd66IhIh2iZq1O7kXUwgh1O
H9hCa7oriHyAdgkKdKCWocmbPPENOETgjraA9wRIXwOYTDb1X5hMvi1mCHo8xjMj
u4szD03xJVi7WrsCggEBANTEblCkxEyhJqaMZF3U3df2Yr/ZtHqsrTr4lwB/MOKk
zmuSrROxheEkKIsxbiV+AxTvtPR1FQrlqbhTJRwy+pw4KPJ7P4fq2R/YBqvXSNBC
amTt6l2XdXqnAk3A++cOEZ2lU9ubfgdeN2Ih8rgdn1LWeOSjCWfExmkoU61/Xe6x
AMeXKQSlHKSnX9voxuE2xINHeU6ZAKy1kGmrJtEiWnI8b8C4s8fTyDtXJ1Lasys0
iHO2Tz2jUhf4IJwb87Lk7Ize2MrI+oPzVDXlmkbjkB4tYyoiRTj8rk8pwBW/HVv0
02pjOLTa4kz1kQ3lsZ/3As4zfNi7mWEhadmEsAIfYkkCggEBANO39r/Yqj5kUyrm
ZXnVxyM2AHq58EJ4I4hbhZ/vRWbVTy4ZRfpXeo4zgNPTXXvCzyT/HyS53vUcjJF7
PfPdpXX2H7m/Fg+8O9S8m64mQHwwv5BSQOecAnzkdJG2q9T/Z+Sqg1w2uAbtQ9QE
kFFvA0ClhBfpSeTGK1wICq3QVLOh5SGf0fYhxR8wl284v4svTFRaTpMAV3Pcq2JS
N4xgHdH1S2hkOTt6RSnbklGg/PFMWxA3JMKVwiPy4aiZ8DhNtQb1ctFpPcJm9CRN
ejAI06IAyD/hVZZ2+oLp5snypHFjY5SDgdoKL7AMOyvHEdEkmAO32ot/oQefOLTt
GOzURVUCggEBALSx5iYi6HtT2SlUzeBKaeWBYDgiwf31LGGKwWMwoem5oX0GYmr5
NwQP20brQeohbKiZMwrxbF+G0G60Xi3mtaN6pnvYZAogTymWI4RJH5OO9CCnVYUK
nkD+GRzDqqt97UP/Joq5MX08bLiwsBvhPG/zqVQzikdQfFjOYNJV+wY92LWpELLb
Lso/Q0/WDyExjA8Z4lH36vTCddTn/91Y2Ytu/FGmCzjICaMrzz+0cLlesgvjZsSo
MY4dskQiEQN7G9I/Z8pAiVEKlBf52N4fYUPfs/oShMty/O5KPNG7L0nrUKlnfr9J
rStC2l/9FK8P7pgEbiD6obY11FlhMMF8udECggEBAIKhvOFtipD1jqDOpjOoR9sK
/lRR5bVVWQfamMDN1AwmjJbVHS8hhtYUM/4sh2p12P6RgoO8fODf1vEcWFh3xxNZ
E1pPCPaICD9i5U+NRvPz2vC900HcraLRrUFaRzwhqOOknYJSBrGzW+Cx3YSeaOCg
nKyI8B5gw4C0G0iL1dSsz2bR1O4GNOVfT3R6joZEXATFo/Kc2L0YAvApBNUYvY0k
bjJ/JfTO5060SsWftf4iw3jrhSn9RwTTYdq/kErGFWvDGJn2MiuhMe2onNfVzIGR
mdUxHwi1ulkspAn/fmY7f0hZpskDwcHyZmbKZuk+NU/FJ8IAcmvk9y7m25nSSc8=
-----END RSA PRIVATE KEY-----"""
EXPECTED_RESPONSE_FROM_GRAYLOG = {
"execution": {
"done": True,
"cancelled": False,
"completed_exceptionally": False
},
"results": {
"60f9b4c461bf9b2a8a999b85": {
"query": {
"id": "query_id",
"timerange": {
"type": "relative",
"range": 12592000
},
"filter": {
"type": "or",
"filters": [
{
"type": "stream",
"filters": None,
"id": "000000000000000000000001",
"title": None
},
{
"type": "stream",
"filters": None,
"id": "60bf6fd4024ad37a05cbb006",
"title": None
}
]
},
"query": {
"type": "elasticsearch",
"query_string": "\"24.141.154.216\""
},
"search_types": [
{
"timerange": None,
"query": None,
"streams": [],
"id": "search_type_id",
"name": None,
"limit": 101,
"offset": 0,
"sort": [
{
"field": "timestamp",
"order": "DESC"
}
],
"decorators": [],
"type": "messages",
"filter": None
}
]
},
"execution_stats": {
"duration": 33,
"timestamp": "2021-07-20T12:37:42.058Z",
"effective_timerange": {
"type": "absolute",
"from": "2021-02-24T18:51:02.091Z",
"to": "2021-07-20T12:37:42.091Z"
}
},
"search_types": {
"60f9b550a09a4d867ecd0169": {
"id": "search_type_id",
"messages": [
{
"highlight_ranges": {},
"message": {
"gl2_accounted_message_size": 221,
"level": 3,
"gl2_remote_ip": "::1",
"gl2_remote_port": 43339,
"streams": [
"000000000000000000000001"
],
"gl2_message_id": "01F7NTA7TRK9Q36QN6Q03PKSJE",
"source": "%ASA-3-710003:",
"message": "%ASA-3-710003: TCP access denied by ACL from 49.143.32.6/4222 to outside:24.141.154.216/23",
"gl2_source_input": "60bf6485024ad37a05cba39c",
"facility_num": 20,
"gl2_source_node": "80fe6cad-d153-489f-91a8-beee65b2e27c",
"_id": "f5999d80-c856-11eb-a871-000c293368b3",
"facility": "local4",
"timestamp": "2021-06-08T12:42:17.816Z"
},
"index": "graylog_0",
"decoration_stats": None
},
{
"highlight_ranges": {},
"message": {
"gl2_accounted_message_size": 222,
"level": 3,
"gl2_remote_ip": "::1",
"gl2_remote_port": 49754,
"streams": [
"000000000000000000000001"
],
"gl2_message_id": "01F7NT94374GXQMJRV7GAH5AKM",
"source": "%ASA-3-710003:",
"message": "%ASA-3-710003: TCP access denied by ACL from 5.34.129.87/62507 to outside:24.141.154.216/23",
"gl2_source_input": "60bf6485024ad37a05cba39c",
"facility_num": 20,
"gl2_source_node": "80fe6cad-d153-489f-91a8-beee65b2e27c",
"_id": "dfc9f770-c856-11eb-a871-000c293368b3",
"facility": "local4",
"timestamp": "2021-06-08T12:41:41.223Z"
},
"index": "graylog_0",
"decoration_stats": None
},
{
"highlight_ranges": {},
"message": {
"gl2_accounted_message_size": 225,
"level": 3,
"gl2_remote_ip": "::1",
"gl2_remote_port": 48544,
"streams": [
"000000000000000000000001"
],
"gl2_message_id": "01F7NT7J8GGPSBNB6RFHH3P31A",
"source": "%ASA-3-710003:",
"message": "%ASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80",
"gl2_source_input": "60bf6485024ad37a05cba39c",
"facility_num": 20,
"gl2_source_node": "80fe6cad-d153-489f-91a8-beee65b2e27c",
"_id": "c15f4100-c856-11eb-a871-000c293368b3",
"facility": "local4",
"timestamp": "2021-06-08T12:40:50.192Z"
},
"index": "graylog_0",
"decoration_stats": None
},
{
"highlight_ranges": {},
"message": {
"gl2_accounted_message_size": 223,
"level": 3,
"gl2_remote_ip": "::1",
"gl2_remote_port": 47419,
"streams": [
"000000000000000000000001"
],
"gl2_message_id": "01F7NT4RFEHY8F2Y4VP1RT5T5F",
"source": "ASA-3-710003:",
"message": "ASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80",
"gl2_source_input": "60bf6485024ad37a05cba39c",
"facility_num": 20,
"gl2_source_node": "80fe6cad-d153-489f-91a8-beee65b2e27c",
"_id": "8a8cfb90-c856-11eb-a871-000c293368b3",
"facility": "local4",
"timestamp": "2021-06-08T12:39:18.216Z"
},
"index": "graylog_0",
"decoration_stats": None
}
],
"effective_timerange": {
"type": "absolute",
"from": "2021-02-24T18:51:02.091Z",
"to": "2021-07-20T12:37:42.091Z"
},
"total_results": 4,
"type": "messages"
}
},
"errors": [],
"state": "COMPLETED"
}
},
"id": "60f6c39681e5cd7cd5e9ad9a",
"owner": "admin",
"search_id": None
}
EXPECTED_RESPONSE_FROM_RELAY = {
"data": {
"sightings": {
"count": 4,
"docs": [
{
"confidence": "High",
"count": 1,
"data": {
"columns": [
{
"name": "level",
"type": "string"
},
{
"name": "source",
"type": "string"
},
{
"name": "facility_num",
"type": "string"
},
{
"name": "facility",
"type": "string"
}
],
"rows": [
[
"3",
"%ASA-3-710003:",
"20",
"local4"
]
]
},
"description": "```\n%ASA-3-710003: TCP access denied by ACL from 49.143.32.6/4222 to outside:24.141.154.216/23 \n```",
"external_ids": [
"01F7NTA7TRK9Q36QN6Q03PKSJE",
"f5999d80-c856-11eb-a871-000c293368b3"
],
"id": "01F7NTA7TRK9Q36QN6Q03PKSJE",
"internal": True,
"observables": [{
"type": "ip",
"value": "24.141.154.216"
}],
"observed_time": {
"start_time": "2021-06-08T12:42:17.816Z"
},
"schema_version": "1.1.6",
"short_description": "Node 80fe6cad received a log from ::1 containing the observable",
"source": "Graylog",
"source_uri": "https://host/messages/graylog_0/f5999d80-c856-11eb-a871-000c293368b3",
"title": "Log message received by Graylog in last 30 days contains observable",
"type": "sighting"
},
{
"confidence": "High",
"count": 1,
"data": {
"columns": [
{
"name": "level",
"type": "string"
},
{
"name": "source",
"type": "string"
},
{
"name": "facility_num",
"type": "string"
},
{
"name": "facility",
"type": "string"
}
],
"rows": [
[
"3",
"%ASA-3-710003:",
"20",
"local4"
]
]
},
"description": "```\n%ASA-3-710003: TCP access denied by ACL from 5.34.129.87/62507 to outside:24.141.154.216/23 \n```",
"external_ids": [
"01F7NT94374GXQMJRV7GAH5AKM",
"dfc9f770-c856-11eb-a871-000c293368b3"
],
"id": "01F7NT94374GXQMJRV7GAH5AKM",
"internal": True,
"observables": [{
"type": "ip",
"value": "24.141.154.216"
}],
"observed_time": {
"start_time": "2021-06-08T12:41:41.223Z"
},
"schema_version": "1.1.6",
"short_description": "Node 80fe6cad received a log from ::1 containing the observable",
"source": "Graylog",
"source_uri": "https://host/messages/graylog_0/dfc9f770-c856-11eb-a871-000c293368b3",
"title": "Log message received by Graylog in last 30 days contains observable",
"type": "sighting"
},
{
"confidence": "High",
"count": 1,
"data": {
"columns": [
{
"name": "level",
"type": "string"
},
{
"name": "source",
"type": "string"
},
{
"name": "facility_num",
"type": "string"
},
{
"name": "facility",
"type": "string"
}
],
"rows": [
[
"3",
"%ASA-3-710003:",
"20",
"local4"
]
]
},
"description": "```\n%ASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80 \n```",
"external_ids": [
"01F7NT7J8GGPSBNB6RFHH3P31A",
"c15f4100-c856-11eb-a871-000c293368b3"
],
"id": "01F7NT7J8GGPSBNB6RFHH3P31A",
"internal": True,
"observables": [{
"type": "ip",
"value": "24.141.154.216"
}],
"observed_time": {
"start_time": "2021-06-08T12:40:50.192Z"
},
"schema_version": "1.1.6",
"short_description": "Node 80fe6cad received a log from ::1 containing the observable",
"source": "Graylog",
"source_uri": "https://host/messages/graylog_0/c15f4100-c856-11eb-a871-000c293368b3",
"title": "Log message received by Graylog in last 30 days contains observable",
"type": "sighting"
},
{
"confidence": "High",
"count": 1,
"data": {
"columns": [
{
"name": "level",
"type": "string"
},
{
"name": "source",
"type": "string"
},
{
"name": "facility_num",
"type": "string"
},
{
"name": "facility",
"type": "string"
}
],
"rows": [
[
"3",
"ASA-3-710003:",
"20",
"local4"
]
]
},
"description": "```\nASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80 \n```",
"external_ids": [
"01F7NT4RFEHY8F2Y4VP1RT5T5F",
"8a8cfb90-c856-11eb-a871-000c293368b3"
],
"id": "01F7NT4RFEHY8F2Y4VP1RT5T5F",
"internal": True,
"observables": [{
"type": "ip",
"value": "24.141.154.216"
}],
"observed_time": {
"start_time": "2021-06-08T12:39:18.216Z"
},
"schema_version": "1.1.6",
"short_description": "Node 80fe6cad received a log from ::1 containing the observable",
"source": "Graylog",
"source_uri": "https://host/messages/graylog_0/8a8cfb90-c856-11eb-a871-000c293368b3",
"title": "Log message received by Graylog in last 30 days contains observable",
"type": "sighting"
}
]
}
}
}
EXPECTED_RESPONSE_FROM_RELAY_MORE_MESSAGES_AVAILABLE = {
'data': {
'sightings': {
'count': 4,
'docs': [{
'confidence': 'High',
'count': 1,
'data': {
'columns': [{'name': 'level',
'type': 'string'},
{'name': 'source',
'type': 'string'},
{
'name': 'facility_num',
'type': 'string'},
{
'name': 'facility',
'type': 'string'}],
'rows': [
['3', '%ASA-3-710003:',
'20', 'local4']]},
'description': '```\n%ASA-3-710003: TCP access denied by ACL from 49.143.32.6/4222 to outside:24.141.154.216/23 \n```',
'external_ids': [
'01F7NTA7TRK9Q36QN6Q03PKSJE',
'f5999d80-c856-11eb-a871-000c293368b3'],
'id': '01F7NTA7TRK9Q36QN6Q03PKSJE',
'internal': True,
'observables': [{'type': 'ip',
'value': '24.141.154.216'}],
'observed_time': {
'start_time': '2021-06-08T12:42:17.816Z'},
'schema_version': '1.1.6',
'short_description': 'Node 80fe6cad received a log from ::1 containing the observable',
'source': 'Graylog',
'source_uri': 'https://host/messages/graylog_0/f5999d80-c856-11eb-a871-000c293368b3',
'title': 'Log message received by Graylog in last 30 days contains observable',
'type': 'sighting'},
{'confidence': 'High', 'count': 1,
'data': {'columns': [{'name': 'level',
'type': 'string'},
{'name': 'source',
'type': 'string'},
{
'name': 'facility_num',
'type': 'string'},
{
'name': 'facility',
'type': 'string'}],
'rows': [
['3', '%ASA-3-710003:',
'20', 'local4']]},
'description': '```\n%ASA-3-710003: TCP access denied by ACL from 5.34.129.87/62507 to outside:24.141.154.216/23 \n```',
'external_ids': [
'01F7NT94374GXQMJRV7GAH5AKM',
'dfc9f770-c856-11eb-a871-000c293368b3'],
'id': '01F7NT94374GXQMJRV7GAH5AKM',
'internal': True,
'observables': [{'type': 'ip',
'value': '24.141.154.216'}],
'observed_time': {
'start_time': '2021-06-08T12:41:41.223Z'},
'schema_version': '1.1.6',
'short_description': 'Node 80fe6cad received a log from ::1 containing the observable',
'source': 'Graylog',
'source_uri': 'https://host/messages/graylog_0/dfc9f770-c856-11eb-a871-000c293368b3',
'title': 'Log message received by Graylog in last 30 days contains observable',
'type': 'sighting'},
{'confidence': 'High', 'count': 1,
'data': {'columns': [{'name': 'level',
'type': 'string'},
{'name': 'source',
'type': 'string'},
{
'name': 'facility_num',
'type': 'string'},
{
'name': 'facility',
'type': 'string'}],
'rows': [
['3', '%ASA-3-710003:',
'20', 'local4']]},
'description': '```\n%ASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80 \n```',
'external_ids': [
'01F7NT7J8GGPSBNB6RFHH3P31A',
'c15f4100-c856-11eb-a871-000c293368b3'],
'id': '01F7NT7J8GGPSBNB6RFHH3P31A',
'internal': True,
'observables': [{'type': 'ip',
'value': '24.141.154.216'}],
'observed_time': {
'start_time': '2021-06-08T12:40:50.192Z'},
'schema_version': '1.1.6',
'short_description': 'Node 80fe6cad received a log from ::1 containing the observable',
'source': 'Graylog',
'source_uri': 'https://host/messages/graylog_0/c15f4100-c856-11eb-a871-000c293368b3',
'title': 'Log message received by Graylog in last 30 days contains observable',
'type': 'sighting'},
{'confidence': 'High', 'count': 1,
'data': {'columns': [{'name': 'level',
'type': 'string'},
{'name': 'source',
'type': 'string'},
{
'name': 'facility_num',
'type': 'string'},
{
'name': 'facility',
'type': 'string'}],
'rows': [
['3', 'ASA-3-710003:',
'20', 'local4']]},
'description': '```\nASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80 \n```',
'external_ids': [
'01F7NT4RFEHY8F2Y4VP1RT5T5F',
'8a8cfb90-c856-11eb-a871-000c293368b3'],
'id': '01F7NT4RFEHY8F2Y4VP1RT5T5F',
'internal': True,
'observables': [{'type': 'ip',
'value': '24.141.154.216'}],
'observed_time': {
'start_time': '2021-06-08T12:39:18.216Z'},
'schema_version': '1.1.6',
'short_description': 'Node 80fe6cad received a log from ::1 containing the observable',
'source': 'Graylog',
'source_uri': 'https://host/messages/graylog_0/8a8cfb90-c856-11eb-a871-000c293368b3',
'title': 'Log message received by Graylog in last 30 days contains observable',
'type': 'sighting'}]}}, 'errors': [
{'code': 'too-many-messages-warning',
'message': 'More messages found in Graylog for 24.141.154.216 than can be rendered. Log in to the Graylog console to see all messages',
'type': 'warning'}]}
EXPECTED_RESPONSE_FROM_REFER_ENDPOINT = {
'data': [
{
'categories': [
'Graylog',
'Search'
],
'description': 'Search for this IP in the Graylog console',
'id': 'ref-graylog-search-ip-24.141.154.216',
'title': 'Search for this IP',
'url': 'https://host/search?rangetype=relative&relative=2592000&q=24.141.154.216'
}
]
}
EXPECTED_RESPONSE_FROM_GRAYLOG_WITH_RELATIONS = {
"execution": {
"done": True,
"cancelled": False,
"completed_exceptionally": False
},
"results": {
"60f9b4c461bf9b2a8a999b85": {
"query": {
"id": "60f9b550a09a4d867ecd0161",
"timerange": {
"type": "relative",
"range": 2592000
},
"filter": {
"type": "or",
"filters": [
{
"type": "stream",
"id": "61034e51d9dadc489abe0055"
},
{
"type": "stream",
"id": "000000000000000000000001"
},
{
"type": "stream",
"id": "61034e51d9dadc489abe00e8"
},
{
"type": "stream",
"id": "6100139fd9dadc489abaa65d"
}
]
},
"query": {
"type": "elasticsearch",
"query_string": "\"188.125.72.73\""
},
"search_types": [
{
"timerange": None,
"query": None,
"streams": [],
"id": "search_type_id",
"name": None,
"limit": 101,
"offset": 0,
"sort": [
{
"field": "timestamp",
"order": "DESC"
}
],
"decorators": [],
"type": "messages",
"filter": None
}
]
},
"execution_stats": {
"duration": 17,
"timestamp": "2021-07-30T08:10:41.731Z",
"effective_timerange": {
"type": "absolute",
"from": "2021-06-30T08:10:41.748Z",
"to": "2021-07-30T08:10:41.748Z"
}
},
"search_types": {
"60f9b550a09a4d867ecd0169": {
"id": "60f9b550a09a4d867ecd0162",
"messages": [
{
"highlight_ranges": {},
"message": {
"destination_port": "51083",
"gl2_remote_ip": "198.18.133.195",
"event_severity_level": "6",
"gl2_remote_port": 57724,
"source": "vFTD",
"gl2_source_input": "60f72a14d9dadc489ab16198",
"network_transport": "tcp",
"vendor_event_action": "blocked",
"source_ip": "188.125.72.73",
"destination_ip": "198.18.133.198",
"event_code": "106015",
"source_port": "25",
"event_outcome": "denied",
"gl2_source_node": "863495ef-c881-4024-ba49-e776020c676c",
"timestamp": "2021-07-30T08:01:14.000Z",
"event_source_product": "CISCO-ASA",
"gl2_accounted_message_size": 561,
"level": 6,
"streams": [
"61034e51d9dadc489abe00e8"
],
"gl2_message_id": "01FBV6X06DZP5N7YKS58DEJHNM",
"message": "vFTD : %FTD-6-106015: Deny TCP (no connection) from 188.125.72.73/25 to 198.18.133.198/51083 flags FIN PSH ACK on interface Outside",
"vendor_event_outcome_reason": "%FTD-6-106015: Deny TCP (no connection)",
"network_interface_in": "Outside",
"facility_num": 20,
"_id": "500812ac-f10c-11eb-9baa-1212395d7875",
"facility": "local4"
},
"index": "graylog_0",
"decoration_stats": None
},
{
"highlight_ranges": {},
"message": {
"destination_port": "51083",
"gl2_remote_ip": "198.18.133.195",
"event_severity_level": "6",
"gl2_remote_port": 40083,
"source": "vFTD",
"gl2_source_input": "60f72a14d9dadc489ab16198",
"network_transport": "tcp",
"vendor_event_action": "blocked",
"source_ip": "188.125.72.73",
"destination_ip": "198.18.133.198",
"event_code": "106015",
"source_port": "25",
"event_outcome": "denied",
"gl2_source_node": "863495ef-c881-4024-ba49-e776020c676c",
"timestamp": "2021-07-30T08:01:14.000Z",
"event_source_product": "CISCO-ASA",
"gl2_accounted_message_size": 561,
"level": 6,
"streams": [
"61034e51d9dadc489abe00e8"
],
"gl2_message_id": "01FBV6X06DPB5KM95W6CPJJ6Y7",
"message": "vFTD : %FTD-6-106015: Deny TCP (no connection) from 188.125.72.73/25 to 198.18.133.198/51083 flags FIN PSH ACK on interface Outside",
"vendor_event_outcome_reason": "%FTD-6-106015: Deny TCP (no connection)",
"network_interface_in": "Outside",
"facility_num": 20,
"_id": "500812af-f10c-11eb-9baa-1212395d7875",
"facility": "local4"
},
"index": "graylog_0",
"decoration_stats": None
}
],
"effective_timerange": {
"type": "absolute",
"from": "2021-06-30T08:10:41.748Z",
"to": "2021-07-30T08:10:41.748Z"
},
"total_results": 2,
"type": "messages"
}
},
"errors": [],
"state": "COMPLETED"
}
},
"id": "6103b401d9dadc489abe6b6a",
"owner": "mstorozh@cisco.com",
"search_id": None
}
EXPECTED_RESPONSE_FROM_RELAY_WITH_RELATIONS = {
'data': {
'sightings': {
'count': 2,
'docs': [
{
'confidence': 'High',
'count': 1,
'data': {
'columns': [
{'name': 'destination_port', 'type': 'string'},
{'name': 'event_severity_level', 'type': 'string'},
{'name': 'source', 'type': 'string'},
{'name': 'network_transport', 'type': 'string'},
{'name': 'vendor_event_action', 'type': 'string'},
{'name': 'source_ip', 'type': 'string'},
{'name': 'destination_ip', 'type': 'string'},
{'name': 'event_code', 'type': 'string'},
{'name': 'source_port', 'type': 'string'},
{'name': 'event_outcome', 'type': 'string'},
{'name': 'event_source_product', 'type': 'string'},
{'name': 'level', 'type': 'string'},
{'name': 'vendor_event_outcome_reason',
'type': 'string'},
{'name': 'network_interface_in', 'type': 'string'},
{'name': 'facility_num', 'type': 'string'},
{'name': 'facility', 'type': 'string'}
],
'rows': [
['51083', '6', 'vFTD', 'tcp',
'blocked', '188.125.72.73',
'198.18.133.198', '106015', '25',
'denied', 'CISCO-ASA', '6',
'%FTD-6-106015: Deny TCP (no connection)',
'Outside', '20', 'local4']]
},
'description': '```\nvFTD : %FTD-6-106015: Deny TCP (no connection) from 188.125.72.73/25 to 198.18.133.198/51083 flags FIN PSH ACK on interface Outside \n```',
'external_ids': [
'01FBV6X06DZP5N7YKS58DEJHNM',
'500812ac-f10c-11eb-9baa-1212395d7875'],
'id': '01FBV6X06DZP5N7YKS58DEJHNM',
'internal': True,
'observables': [
{'type': 'ip', 'value': '188.125.72.73'}],
'observed_time': {
'start_time': '2021-07-30T08:01:14.000Z'},
'relations': [
{'origin': 'vFTD',
'related': {'type': 'ip', 'value': '198.18.133.198'},
'relation': 'Connected_To',
'source': {'type': 'ip', 'value': '188.125.72.73'}}],
'schema_version': '1.1.6',
'short_description': 'Node 863495ef received a log from 198.18.133.195 containing the observable',
'source': 'Graylog',
'source_uri': 'https://host/messages/graylog_0/500812ac-f10c-11eb-9baa-1212395d7875',
'title': 'Log message received by Graylog in last 30 days contains observable',
'type': 'sighting'},
{'confidence': 'High', 'count': 1,
'data': {'columns': [
{'name': 'destination_port',
'type': 'string'},
{'name': 'event_severity_level',
'type': 'string'},
{'name': 'source',
'type': 'string'},
{'name': 'network_transport',
'type': 'string'},
{'name': 'vendor_event_action',
'type': 'string'},
{'name': 'source_ip',
'type': 'string'},
{'name': 'destination_ip',
'type': 'string'},
{'name': 'event_code',
'type': 'string'},
{'name': 'source_port',
'type': 'string'},
{'name': 'event_outcome',
'type': 'string'},
{'name': 'event_source_product',
'type': 'string'},
{'name': 'level',
'type': 'string'}, {
'name': 'vendor_event_outcome_reason',
'type': 'string'},
{'name': 'network_interface_in',
'type': 'string'},
{'name': 'facility_num',
'type': 'string'},
{'name': 'facility',
'type': 'string'}], 'rows': [
['51083', '6', 'vFTD', 'tcp',
'blocked', '188.125.72.73',
'198.18.133.198', '106015', '25',
'denied', 'CISCO-ASA', '6',
'%FTD-6-106015: Deny TCP (no connection)',
'Outside', '20', 'local4']]},
'description': '```\nvFTD : %FTD-6-106015: Deny TCP (no connection) from 188.125.72.73/25 to 198.18.133.198/51083 flags FIN PSH ACK on interface Outside \n```',
'external_ids': [
'01FBV6X06DPB5KM95W6CPJJ6Y7',
'500812af-f10c-11eb-9baa-1212395d7875'],
'id': '01FBV6X06DPB5KM95W6CPJJ6Y7',
'internal': True, 'observables': [
{'type': 'ip',
'value': '188.125.72.73'}],
'observed_time': {
'start_time': '2021-07-30T08:01:14.000Z'},
'relations': [{'origin': 'vFTD',
'related': {
'type': 'ip',
'value': '198.18.133.198'},
'relation': 'Connected_To',
'source': {'type': 'ip',
'value': '188.125.72.73'}}],
'schema_version': '1.1.6',
'short_description': 'Node 863495ef received a log from 198.18.133.195 containing the observable',
'source': 'Graylog',
'source_uri': 'https://host/messages/graylog_0/500812af-f10c-11eb-9baa-1212395d7875',
'title': 'Log message received by Graylog in last 30 days contains observable',
'type': 'sighting'}
]
}
}
}
| expected_response_of_jwks_endpoint = {'keys': [{'kty': 'RSA', 'n': 'tSKfSeI0fukRIX38AHlKB1YPpX8PUYN2JdvfM-XjNmLfU1M74N0VmdzIX95sneQGO9kC2xMIE-AIlt52Yf_KgBZggAlS9Y0Vx8DsSL2HvOjguAdXir3vYLvAyyHin_mUisJOqccFKChHKjnk0uXy_38-1r17_cYTp76brKpU1I4kM20M__dbvLBWjfzyw9ehufr74aVwr-0xJfsBVr2oaQFww_XHGz69Q7yHK6DbxYO4w4q2sIfcC4pT8XTPHo4JZ2M733Ea8a7HxtZS563_mhhRZLU5aynQpwaVv2U--CL6EvGt8TlNZOkeRv8wz-Rt8B70jzoRpVK36rR-pHKlXhMGT619v82LneTdsqA25Wi2Ld_c0niuul24A6-aaj2u9SWbxA9LmVtFntvNbRaHXE1SLpLPoIp8uppGF02Nz2v3ld8gCnTTWfq_BQ80Qy8e0coRRABECZrjIMzHEg6MloRDy4na0pRQv61VogqRKDU2r3_VezFPQDb3ciYsZjWBr3HpNOkUjTrvLmFyOE9Q5R_qQGmc6BYtfk5rn7iIfXlkJAZHXhBy-ElBuiBM-YSkFM7dH92sSIoZ05V4MP09Xcppx7kdwsJy72Sust9Hnd9B7V35YnVF6W791lVHnenhCJOziRmkH4xLLbPkaST2Ks3IHH7tVltM6NsRk3jNdVM', 'e': 'AQAB', 'alg': 'RS256', 'kid': '02B1174234C29F8EFB69911438F597FF3FFEE6B7', 'use': 'sig'}]}
response_of_jwks_endpoint_with_wrong_key = {'keys': [{'kty': 'RSA', 'n': 'pSKfSeI0fukRIX38AHlKB1YPpX8PUYN2JdvfM-XjNmLfU1M74N0VmdzIX95sneQGO9kC2xMIE-AIlt52Yf_KgBZggAlS9Y0Vx8DsSL2HvOjguAdXir3vYLvAyyHin_mUisJOqccFKChHKjnk0uXy_38-1r17_cYTp76brKpU1I4kM20M__dbvLBWjfzyw9ehufr74aVwr-0xJfsBVr2oaQFww_XHGz69Q7yHK6DbxYO4w4q2sIfcC4pT8XTPHo4JZ2M733Ea8a7HxtZS563_mhhRZLU5aynQpwaVv2U--CL6EvGt8TlNZOkeRv8wz-Rt8B70jzoRpVK36rR-pHKlXhMGT619v82LneTdsqA25Wi2Ld_c0niuul24A6-aaj2u9SWbxA9LmVtFntvNbRaHXE1SLpLPoIp8uppGF02Nz2v3ld8gCnTTWfq_BQ80Qy8e0coRRABECZrjIMzHEg6MloRDy4na0pRQv61VogqRKDU2r3_VezFPQDb3ciYsZjWBr3HpNOkUjTrvLmFyOE9Q5R_qQGmc6BYtfk5rn7iIfXlkJAZHXhBy-ElBuiBM-YSkFM7dH92sSIoZ05V4MP09Xcppx7kdwsJy72Sust9Hnd9B7V35YnVF6W791lVHnenhCJOziRmkH4xLLbPkaST2Ks3IHH7tVltM6NsRk3jNdVM', 'e': 'AQAB', 'alg': 'RS256', 'kid': '02B1174234C29F8EFB69911438F597FF3FFEE6B7', 'use': 'sig'}]}
private_key = '-----BEGIN RSA PRIVATE KEY-----\nMIIJKwIBAAKCAgEAtSKfSeI0fukRIX38AHlKB1YPpX8PUYN2JdvfM+XjNmLfU1M7\n4N0VmdzIX95sneQGO9kC2xMIE+AIlt52Yf/KgBZggAlS9Y0Vx8DsSL2HvOjguAdX\nir3vYLvAyyHin/mUisJOqccFKChHKjnk0uXy/38+1r17/cYTp76brKpU1I4kM20M\n//dbvLBWjfzyw9ehufr74aVwr+0xJfsBVr2oaQFww/XHGz69Q7yHK6DbxYO4w4q2\nsIfcC4pT8XTPHo4JZ2M733Ea8a7HxtZS563/mhhRZLU5aynQpwaVv2U++CL6EvGt\n8TlNZOkeRv8wz+Rt8B70jzoRpVK36rR+pHKlXhMGT619v82LneTdsqA25Wi2Ld/c\n0niuul24A6+aaj2u9SWbxA9LmVtFntvNbRaHXE1SLpLPoIp8uppGF02Nz2v3ld8g\nCnTTWfq/BQ80Qy8e0coRRABECZrjIMzHEg6MloRDy4na0pRQv61VogqRKDU2r3/V\nezFPQDb3ciYsZjWBr3HpNOkUjTrvLmFyOE9Q5R/qQGmc6BYtfk5rn7iIfXlkJAZH\nXhBy+ElBuiBM+YSkFM7dH92sSIoZ05V4MP09Xcppx7kdwsJy72Sust9Hnd9B7V35\nYnVF6W791lVHnenhCJOziRmkH4xLLbPkaST2Ks3IHH7tVltM6NsRk3jNdVMCAwEA\nAQKCAgEArx+0JXigDHtFZr4pYEPjwMgCBJ2dr8+L8PptB/4g+LoK9MKqR7M4aTO+\nPoILPXPyWvZq/meeDakyZLrcdc8ad1ArKF7baDBpeGEbkRA9JfV5HjNq/ea4gyvD\nMCGou8ZPSQCnkRmr8LFQbJDgnM5Za5AYrwEv2aEh67IrTHq53W83rMioIumCNiG+\n7TQ7egEGiYsQ745GLrECLZhKKRTgt/T+k1cSk1LLJawme5XgJUw+3D9GddJEepvY\noL+wZ/gnO2ADyPnPdQ7oc2NPcFMXpmIQf29+/g7FflatfQhkIv+eC6bB51DhdMi1\nzyp2hOhzKg6jn74ixVX+Hts2/cMiAPu0NaWmU9n8g7HmXWc4+uSO/fssGjI3DLYK\nd5xnhrq4a3ZO5oJLeMO9U71+Ykctg23PTHwNAGrsPYdjGcBnJEdtbXa31agI5PAG\n6rgGUY3iSoWqHLgBTxrX04TWVvLQi8wbxh7BEF0yasOeZKxdE2IWYg75zGsjluyH\nlOnpRa5lSf6KZ6thh9eczFHYtS4DvYBcZ9hZW/g87ie28SkBFxxl0brYt9uKNYJv\nuajVG8kT80AC7Wzg2q7Wmnoww3JNJUbNths5dqKyUSlMFMIB/vOePFHLrA6qDfAn\nsQHgUb9WHhUrYsH20XKpqR2OjmWU05bV4pSMW/JwG37o+px1yKECggEBANnwx0d7\nksEMvJjeN5plDy3eMLifBI+6SL/o5TXDoFM6rJxF+0UP70uouYJq2dI+DCSA6c/E\nsn7WAOirY177adKcBV8biwAtmKHnFnCs/kwAZq8lMvQPtNPJ/vq2n40kO48h8fxb\neGcmyAqFPZ4YKSxrPA4cdbHIuFSt9WyaUcVFmzdTFHVlRP70EXdmXHt84byWNB4C\nHeq8zmrNxPNAi65nEkUks7iBQMtuvyV2+aXjDOTBMCd66IhIh2iZq1O7kXUwgh1O\nH9hCa7oriHyAdgkKdKCWocmbPPENOETgjraA9wRIXwOYTDb1X5hMvi1mCHo8xjMj\nu4szD03xJVi7WrsCggEBANTEblCkxEyhJqaMZF3U3df2Yr/ZtHqsrTr4lwB/MOKk\nzmuSrROxheEkKIsxbiV+AxTvtPR1FQrlqbhTJRwy+pw4KPJ7P4fq2R/YBqvXSNBC\namTt6l2XdXqnAk3A++cOEZ2lU9ubfgdeN2Ih8rgdn1LWeOSjCWfExmkoU61/Xe6x\nAMeXKQSlHKSnX9voxuE2xINHeU6ZAKy1kGmrJtEiWnI8b8C4s8fTyDtXJ1Lasys0\niHO2Tz2jUhf4IJwb87Lk7Ize2MrI+oPzVDXlmkbjkB4tYyoiRTj8rk8pwBW/HVv0\n02pjOLTa4kz1kQ3lsZ/3As4zfNi7mWEhadmEsAIfYkkCggEBANO39r/Yqj5kUyrm\nZXnVxyM2AHq58EJ4I4hbhZ/vRWbVTy4ZRfpXeo4zgNPTXXvCzyT/HyS53vUcjJF7\nPfPdpXX2H7m/Fg+8O9S8m64mQHwwv5BSQOecAnzkdJG2q9T/Z+Sqg1w2uAbtQ9QE\nkFFvA0ClhBfpSeTGK1wICq3QVLOh5SGf0fYhxR8wl284v4svTFRaTpMAV3Pcq2JS\nN4xgHdH1S2hkOTt6RSnbklGg/PFMWxA3JMKVwiPy4aiZ8DhNtQb1ctFpPcJm9CRN\nejAI06IAyD/hVZZ2+oLp5snypHFjY5SDgdoKL7AMOyvHEdEkmAO32ot/oQefOLTt\nGOzURVUCggEBALSx5iYi6HtT2SlUzeBKaeWBYDgiwf31LGGKwWMwoem5oX0GYmr5\nNwQP20brQeohbKiZMwrxbF+G0G60Xi3mtaN6pnvYZAogTymWI4RJH5OO9CCnVYUK\nnkD+GRzDqqt97UP/Joq5MX08bLiwsBvhPG/zqVQzikdQfFjOYNJV+wY92LWpELLb\nLso/Q0/WDyExjA8Z4lH36vTCddTn/91Y2Ytu/FGmCzjICaMrzz+0cLlesgvjZsSo\nMY4dskQiEQN7G9I/Z8pAiVEKlBf52N4fYUPfs/oShMty/O5KPNG7L0nrUKlnfr9J\nrStC2l/9FK8P7pgEbiD6obY11FlhMMF8udECggEBAIKhvOFtipD1jqDOpjOoR9sK\n/lRR5bVVWQfamMDN1AwmjJbVHS8hhtYUM/4sh2p12P6RgoO8fODf1vEcWFh3xxNZ\nE1pPCPaICD9i5U+NRvPz2vC900HcraLRrUFaRzwhqOOknYJSBrGzW+Cx3YSeaOCg\nnKyI8B5gw4C0G0iL1dSsz2bR1O4GNOVfT3R6joZEXATFo/Kc2L0YAvApBNUYvY0k\nbjJ/JfTO5060SsWftf4iw3jrhSn9RwTTYdq/kErGFWvDGJn2MiuhMe2onNfVzIGR\nmdUxHwi1ulkspAn/fmY7f0hZpskDwcHyZmbKZuk+NU/FJ8IAcmvk9y7m25nSSc8=\n-----END RSA PRIVATE KEY-----'
expected_response_from_graylog = {'execution': {'done': True, 'cancelled': False, 'completed_exceptionally': False}, 'results': {'60f9b4c461bf9b2a8a999b85': {'query': {'id': 'query_id', 'timerange': {'type': 'relative', 'range': 12592000}, 'filter': {'type': 'or', 'filters': [{'type': 'stream', 'filters': None, 'id': '000000000000000000000001', 'title': None}, {'type': 'stream', 'filters': None, 'id': '60bf6fd4024ad37a05cbb006', 'title': None}]}, 'query': {'type': 'elasticsearch', 'query_string': '"24.141.154.216"'}, 'search_types': [{'timerange': None, 'query': None, 'streams': [], 'id': 'search_type_id', 'name': None, 'limit': 101, 'offset': 0, 'sort': [{'field': 'timestamp', 'order': 'DESC'}], 'decorators': [], 'type': 'messages', 'filter': None}]}, 'execution_stats': {'duration': 33, 'timestamp': '2021-07-20T12:37:42.058Z', 'effective_timerange': {'type': 'absolute', 'from': '2021-02-24T18:51:02.091Z', 'to': '2021-07-20T12:37:42.091Z'}}, 'search_types': {'60f9b550a09a4d867ecd0169': {'id': 'search_type_id', 'messages': [{'highlight_ranges': {}, 'message': {'gl2_accounted_message_size': 221, 'level': 3, 'gl2_remote_ip': '::1', 'gl2_remote_port': 43339, 'streams': ['000000000000000000000001'], 'gl2_message_id': '01F7NTA7TRK9Q36QN6Q03PKSJE', 'source': '%ASA-3-710003:', 'message': '%ASA-3-710003: TCP access denied by ACL from 49.143.32.6/4222 to outside:24.141.154.216/23', 'gl2_source_input': '60bf6485024ad37a05cba39c', 'facility_num': 20, 'gl2_source_node': '80fe6cad-d153-489f-91a8-beee65b2e27c', '_id': 'f5999d80-c856-11eb-a871-000c293368b3', 'facility': 'local4', 'timestamp': '2021-06-08T12:42:17.816Z'}, 'index': 'graylog_0', 'decoration_stats': None}, {'highlight_ranges': {}, 'message': {'gl2_accounted_message_size': 222, 'level': 3, 'gl2_remote_ip': '::1', 'gl2_remote_port': 49754, 'streams': ['000000000000000000000001'], 'gl2_message_id': '01F7NT94374GXQMJRV7GAH5AKM', 'source': '%ASA-3-710003:', 'message': '%ASA-3-710003: TCP access denied by ACL from 5.34.129.87/62507 to outside:24.141.154.216/23', 'gl2_source_input': '60bf6485024ad37a05cba39c', 'facility_num': 20, 'gl2_source_node': '80fe6cad-d153-489f-91a8-beee65b2e27c', '_id': 'dfc9f770-c856-11eb-a871-000c293368b3', 'facility': 'local4', 'timestamp': '2021-06-08T12:41:41.223Z'}, 'index': 'graylog_0', 'decoration_stats': None}, {'highlight_ranges': {}, 'message': {'gl2_accounted_message_size': 225, 'level': 3, 'gl2_remote_ip': '::1', 'gl2_remote_port': 48544, 'streams': ['000000000000000000000001'], 'gl2_message_id': '01F7NT7J8GGPSBNB6RFHH3P31A', 'source': '%ASA-3-710003:', 'message': '%ASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80', 'gl2_source_input': '60bf6485024ad37a05cba39c', 'facility_num': 20, 'gl2_source_node': '80fe6cad-d153-489f-91a8-beee65b2e27c', '_id': 'c15f4100-c856-11eb-a871-000c293368b3', 'facility': 'local4', 'timestamp': '2021-06-08T12:40:50.192Z'}, 'index': 'graylog_0', 'decoration_stats': None}, {'highlight_ranges': {}, 'message': {'gl2_accounted_message_size': 223, 'level': 3, 'gl2_remote_ip': '::1', 'gl2_remote_port': 47419, 'streams': ['000000000000000000000001'], 'gl2_message_id': '01F7NT4RFEHY8F2Y4VP1RT5T5F', 'source': 'ASA-3-710003:', 'message': 'ASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80', 'gl2_source_input': '60bf6485024ad37a05cba39c', 'facility_num': 20, 'gl2_source_node': '80fe6cad-d153-489f-91a8-beee65b2e27c', '_id': '8a8cfb90-c856-11eb-a871-000c293368b3', 'facility': 'local4', 'timestamp': '2021-06-08T12:39:18.216Z'}, 'index': 'graylog_0', 'decoration_stats': None}], 'effective_timerange': {'type': 'absolute', 'from': '2021-02-24T18:51:02.091Z', 'to': '2021-07-20T12:37:42.091Z'}, 'total_results': 4, 'type': 'messages'}}, 'errors': [], 'state': 'COMPLETED'}}, 'id': '60f6c39681e5cd7cd5e9ad9a', 'owner': 'admin', 'search_id': None}
expected_response_from_relay = {'data': {'sightings': {'count': 4, 'docs': [{'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['3', '%ASA-3-710003:', '20', 'local4']]}, 'description': '```\n%ASA-3-710003: TCP access denied by ACL from 49.143.32.6/4222 to outside:24.141.154.216/23 \n```', 'external_ids': ['01F7NTA7TRK9Q36QN6Q03PKSJE', 'f5999d80-c856-11eb-a871-000c293368b3'], 'id': '01F7NTA7TRK9Q36QN6Q03PKSJE', 'internal': True, 'observables': [{'type': 'ip', 'value': '24.141.154.216'}], 'observed_time': {'start_time': '2021-06-08T12:42:17.816Z'}, 'schema_version': '1.1.6', 'short_description': 'Node 80fe6cad received a log from ::1 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/f5999d80-c856-11eb-a871-000c293368b3', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}, {'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['3', '%ASA-3-710003:', '20', 'local4']]}, 'description': '```\n%ASA-3-710003: TCP access denied by ACL from 5.34.129.87/62507 to outside:24.141.154.216/23 \n```', 'external_ids': ['01F7NT94374GXQMJRV7GAH5AKM', 'dfc9f770-c856-11eb-a871-000c293368b3'], 'id': '01F7NT94374GXQMJRV7GAH5AKM', 'internal': True, 'observables': [{'type': 'ip', 'value': '24.141.154.216'}], 'observed_time': {'start_time': '2021-06-08T12:41:41.223Z'}, 'schema_version': '1.1.6', 'short_description': 'Node 80fe6cad received a log from ::1 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/dfc9f770-c856-11eb-a871-000c293368b3', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}, {'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['3', '%ASA-3-710003:', '20', 'local4']]}, 'description': '```\n%ASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80 \n```', 'external_ids': ['01F7NT7J8GGPSBNB6RFHH3P31A', 'c15f4100-c856-11eb-a871-000c293368b3'], 'id': '01F7NT7J8GGPSBNB6RFHH3P31A', 'internal': True, 'observables': [{'type': 'ip', 'value': '24.141.154.216'}], 'observed_time': {'start_time': '2021-06-08T12:40:50.192Z'}, 'schema_version': '1.1.6', 'short_description': 'Node 80fe6cad received a log from ::1 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/c15f4100-c856-11eb-a871-000c293368b3', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}, {'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['3', 'ASA-3-710003:', '20', 'local4']]}, 'description': '```\nASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80 \n```', 'external_ids': ['01F7NT4RFEHY8F2Y4VP1RT5T5F', '8a8cfb90-c856-11eb-a871-000c293368b3'], 'id': '01F7NT4RFEHY8F2Y4VP1RT5T5F', 'internal': True, 'observables': [{'type': 'ip', 'value': '24.141.154.216'}], 'observed_time': {'start_time': '2021-06-08T12:39:18.216Z'}, 'schema_version': '1.1.6', 'short_description': 'Node 80fe6cad received a log from ::1 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/8a8cfb90-c856-11eb-a871-000c293368b3', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}]}}}
expected_response_from_relay_more_messages_available = {'data': {'sightings': {'count': 4, 'docs': [{'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['3', '%ASA-3-710003:', '20', 'local4']]}, 'description': '```\n%ASA-3-710003: TCP access denied by ACL from 49.143.32.6/4222 to outside:24.141.154.216/23 \n```', 'external_ids': ['01F7NTA7TRK9Q36QN6Q03PKSJE', 'f5999d80-c856-11eb-a871-000c293368b3'], 'id': '01F7NTA7TRK9Q36QN6Q03PKSJE', 'internal': True, 'observables': [{'type': 'ip', 'value': '24.141.154.216'}], 'observed_time': {'start_time': '2021-06-08T12:42:17.816Z'}, 'schema_version': '1.1.6', 'short_description': 'Node 80fe6cad received a log from ::1 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/f5999d80-c856-11eb-a871-000c293368b3', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}, {'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['3', '%ASA-3-710003:', '20', 'local4']]}, 'description': '```\n%ASA-3-710003: TCP access denied by ACL from 5.34.129.87/62507 to outside:24.141.154.216/23 \n```', 'external_ids': ['01F7NT94374GXQMJRV7GAH5AKM', 'dfc9f770-c856-11eb-a871-000c293368b3'], 'id': '01F7NT94374GXQMJRV7GAH5AKM', 'internal': True, 'observables': [{'type': 'ip', 'value': '24.141.154.216'}], 'observed_time': {'start_time': '2021-06-08T12:41:41.223Z'}, 'schema_version': '1.1.6', 'short_description': 'Node 80fe6cad received a log from ::1 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/dfc9f770-c856-11eb-a871-000c293368b3', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}, {'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['3', '%ASA-3-710003:', '20', 'local4']]}, 'description': '```\n%ASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80 \n```', 'external_ids': ['01F7NT7J8GGPSBNB6RFHH3P31A', 'c15f4100-c856-11eb-a871-000c293368b3'], 'id': '01F7NT7J8GGPSBNB6RFHH3P31A', 'internal': True, 'observables': [{'type': 'ip', 'value': '24.141.154.216'}], 'observed_time': {'start_time': '2021-06-08T12:40:50.192Z'}, 'schema_version': '1.1.6', 'short_description': 'Node 80fe6cad received a log from ::1 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/c15f4100-c856-11eb-a871-000c293368b3', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}, {'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['3', 'ASA-3-710003:', '20', 'local4']]}, 'description': '```\nASA-3-710003: TCP access denied by ACL from 156.96.156.172/50168 to outside:24.141.154.216/80 \n```', 'external_ids': ['01F7NT4RFEHY8F2Y4VP1RT5T5F', '8a8cfb90-c856-11eb-a871-000c293368b3'], 'id': '01F7NT4RFEHY8F2Y4VP1RT5T5F', 'internal': True, 'observables': [{'type': 'ip', 'value': '24.141.154.216'}], 'observed_time': {'start_time': '2021-06-08T12:39:18.216Z'}, 'schema_version': '1.1.6', 'short_description': 'Node 80fe6cad received a log from ::1 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/8a8cfb90-c856-11eb-a871-000c293368b3', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}]}}, 'errors': [{'code': 'too-many-messages-warning', 'message': 'More messages found in Graylog for 24.141.154.216 than can be rendered. Log in to the Graylog console to see all messages', 'type': 'warning'}]}
expected_response_from_refer_endpoint = {'data': [{'categories': ['Graylog', 'Search'], 'description': 'Search for this IP in the Graylog console', 'id': 'ref-graylog-search-ip-24.141.154.216', 'title': 'Search for this IP', 'url': 'https://host/search?rangetype=relative&relative=2592000&q=24.141.154.216'}]}
expected_response_from_graylog_with_relations = {'execution': {'done': True, 'cancelled': False, 'completed_exceptionally': False}, 'results': {'60f9b4c461bf9b2a8a999b85': {'query': {'id': '60f9b550a09a4d867ecd0161', 'timerange': {'type': 'relative', 'range': 2592000}, 'filter': {'type': 'or', 'filters': [{'type': 'stream', 'id': '61034e51d9dadc489abe0055'}, {'type': 'stream', 'id': '000000000000000000000001'}, {'type': 'stream', 'id': '61034e51d9dadc489abe00e8'}, {'type': 'stream', 'id': '6100139fd9dadc489abaa65d'}]}, 'query': {'type': 'elasticsearch', 'query_string': '"188.125.72.73"'}, 'search_types': [{'timerange': None, 'query': None, 'streams': [], 'id': 'search_type_id', 'name': None, 'limit': 101, 'offset': 0, 'sort': [{'field': 'timestamp', 'order': 'DESC'}], 'decorators': [], 'type': 'messages', 'filter': None}]}, 'execution_stats': {'duration': 17, 'timestamp': '2021-07-30T08:10:41.731Z', 'effective_timerange': {'type': 'absolute', 'from': '2021-06-30T08:10:41.748Z', 'to': '2021-07-30T08:10:41.748Z'}}, 'search_types': {'60f9b550a09a4d867ecd0169': {'id': '60f9b550a09a4d867ecd0162', 'messages': [{'highlight_ranges': {}, 'message': {'destination_port': '51083', 'gl2_remote_ip': '198.18.133.195', 'event_severity_level': '6', 'gl2_remote_port': 57724, 'source': 'vFTD', 'gl2_source_input': '60f72a14d9dadc489ab16198', 'network_transport': 'tcp', 'vendor_event_action': 'blocked', 'source_ip': '188.125.72.73', 'destination_ip': '198.18.133.198', 'event_code': '106015', 'source_port': '25', 'event_outcome': 'denied', 'gl2_source_node': '863495ef-c881-4024-ba49-e776020c676c', 'timestamp': '2021-07-30T08:01:14.000Z', 'event_source_product': 'CISCO-ASA', 'gl2_accounted_message_size': 561, 'level': 6, 'streams': ['61034e51d9dadc489abe00e8'], 'gl2_message_id': '01FBV6X06DZP5N7YKS58DEJHNM', 'message': 'vFTD : %FTD-6-106015: Deny TCP (no connection) from 188.125.72.73/25 to 198.18.133.198/51083 flags FIN PSH ACK on interface Outside', 'vendor_event_outcome_reason': '%FTD-6-106015: Deny TCP (no connection)', 'network_interface_in': 'Outside', 'facility_num': 20, '_id': '500812ac-f10c-11eb-9baa-1212395d7875', 'facility': 'local4'}, 'index': 'graylog_0', 'decoration_stats': None}, {'highlight_ranges': {}, 'message': {'destination_port': '51083', 'gl2_remote_ip': '198.18.133.195', 'event_severity_level': '6', 'gl2_remote_port': 40083, 'source': 'vFTD', 'gl2_source_input': '60f72a14d9dadc489ab16198', 'network_transport': 'tcp', 'vendor_event_action': 'blocked', 'source_ip': '188.125.72.73', 'destination_ip': '198.18.133.198', 'event_code': '106015', 'source_port': '25', 'event_outcome': 'denied', 'gl2_source_node': '863495ef-c881-4024-ba49-e776020c676c', 'timestamp': '2021-07-30T08:01:14.000Z', 'event_source_product': 'CISCO-ASA', 'gl2_accounted_message_size': 561, 'level': 6, 'streams': ['61034e51d9dadc489abe00e8'], 'gl2_message_id': '01FBV6X06DPB5KM95W6CPJJ6Y7', 'message': 'vFTD : %FTD-6-106015: Deny TCP (no connection) from 188.125.72.73/25 to 198.18.133.198/51083 flags FIN PSH ACK on interface Outside', 'vendor_event_outcome_reason': '%FTD-6-106015: Deny TCP (no connection)', 'network_interface_in': 'Outside', 'facility_num': 20, '_id': '500812af-f10c-11eb-9baa-1212395d7875', 'facility': 'local4'}, 'index': 'graylog_0', 'decoration_stats': None}], 'effective_timerange': {'type': 'absolute', 'from': '2021-06-30T08:10:41.748Z', 'to': '2021-07-30T08:10:41.748Z'}, 'total_results': 2, 'type': 'messages'}}, 'errors': [], 'state': 'COMPLETED'}}, 'id': '6103b401d9dadc489abe6b6a', 'owner': 'mstorozh@cisco.com', 'search_id': None}
expected_response_from_relay_with_relations = {'data': {'sightings': {'count': 2, 'docs': [{'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'destination_port', 'type': 'string'}, {'name': 'event_severity_level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'network_transport', 'type': 'string'}, {'name': 'vendor_event_action', 'type': 'string'}, {'name': 'source_ip', 'type': 'string'}, {'name': 'destination_ip', 'type': 'string'}, {'name': 'event_code', 'type': 'string'}, {'name': 'source_port', 'type': 'string'}, {'name': 'event_outcome', 'type': 'string'}, {'name': 'event_source_product', 'type': 'string'}, {'name': 'level', 'type': 'string'}, {'name': 'vendor_event_outcome_reason', 'type': 'string'}, {'name': 'network_interface_in', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['51083', '6', 'vFTD', 'tcp', 'blocked', '188.125.72.73', '198.18.133.198', '106015', '25', 'denied', 'CISCO-ASA', '6', '%FTD-6-106015: Deny TCP (no connection)', 'Outside', '20', 'local4']]}, 'description': '```\nvFTD : %FTD-6-106015: Deny TCP (no connection) from 188.125.72.73/25 to 198.18.133.198/51083 flags FIN PSH ACK on interface Outside \n```', 'external_ids': ['01FBV6X06DZP5N7YKS58DEJHNM', '500812ac-f10c-11eb-9baa-1212395d7875'], 'id': '01FBV6X06DZP5N7YKS58DEJHNM', 'internal': True, 'observables': [{'type': 'ip', 'value': '188.125.72.73'}], 'observed_time': {'start_time': '2021-07-30T08:01:14.000Z'}, 'relations': [{'origin': 'vFTD', 'related': {'type': 'ip', 'value': '198.18.133.198'}, 'relation': 'Connected_To', 'source': {'type': 'ip', 'value': '188.125.72.73'}}], 'schema_version': '1.1.6', 'short_description': 'Node 863495ef received a log from 198.18.133.195 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/500812ac-f10c-11eb-9baa-1212395d7875', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}, {'confidence': 'High', 'count': 1, 'data': {'columns': [{'name': 'destination_port', 'type': 'string'}, {'name': 'event_severity_level', 'type': 'string'}, {'name': 'source', 'type': 'string'}, {'name': 'network_transport', 'type': 'string'}, {'name': 'vendor_event_action', 'type': 'string'}, {'name': 'source_ip', 'type': 'string'}, {'name': 'destination_ip', 'type': 'string'}, {'name': 'event_code', 'type': 'string'}, {'name': 'source_port', 'type': 'string'}, {'name': 'event_outcome', 'type': 'string'}, {'name': 'event_source_product', 'type': 'string'}, {'name': 'level', 'type': 'string'}, {'name': 'vendor_event_outcome_reason', 'type': 'string'}, {'name': 'network_interface_in', 'type': 'string'}, {'name': 'facility_num', 'type': 'string'}, {'name': 'facility', 'type': 'string'}], 'rows': [['51083', '6', 'vFTD', 'tcp', 'blocked', '188.125.72.73', '198.18.133.198', '106015', '25', 'denied', 'CISCO-ASA', '6', '%FTD-6-106015: Deny TCP (no connection)', 'Outside', '20', 'local4']]}, 'description': '```\nvFTD : %FTD-6-106015: Deny TCP (no connection) from 188.125.72.73/25 to 198.18.133.198/51083 flags FIN PSH ACK on interface Outside \n```', 'external_ids': ['01FBV6X06DPB5KM95W6CPJJ6Y7', '500812af-f10c-11eb-9baa-1212395d7875'], 'id': '01FBV6X06DPB5KM95W6CPJJ6Y7', 'internal': True, 'observables': [{'type': 'ip', 'value': '188.125.72.73'}], 'observed_time': {'start_time': '2021-07-30T08:01:14.000Z'}, 'relations': [{'origin': 'vFTD', 'related': {'type': 'ip', 'value': '198.18.133.198'}, 'relation': 'Connected_To', 'source': {'type': 'ip', 'value': '188.125.72.73'}}], 'schema_version': '1.1.6', 'short_description': 'Node 863495ef received a log from 198.18.133.195 containing the observable', 'source': 'Graylog', 'source_uri': 'https://host/messages/graylog_0/500812af-f10c-11eb-9baa-1212395d7875', 'title': 'Log message received by Graylog in last 30 days contains observable', 'type': 'sighting'}]}}} |
#
# Modify `remove_html_markup` so that it actually works!
#
def remove_html_markup(s):
tag = False
quote = False
quoteSign = '"'
out = ""
for c in s:
# print c, tag, quote
if c == '<' and not quote:
tag = True
elif c == '>' and not quote:
tag = False
elif (c == '"' or c == "'") and tag:
if quote == False or (quoteSign == c):
quote = not quote
quoteSign = c
elif not tag:
out = out + c
return out
def test():
assert remove_html_markup('<a href="don' + "'" + 't!">Link</a>') == "Link"
test()
| def remove_html_markup(s):
tag = False
quote = False
quote_sign = '"'
out = ''
for c in s:
if c == '<' and (not quote):
tag = True
elif c == '>' and (not quote):
tag = False
elif (c == '"' or c == "'") and tag:
if quote == False or quoteSign == c:
quote = not quote
quote_sign = c
elif not tag:
out = out + c
return out
def test():
assert remove_html_markup('<a href="don' + "'" + 't!">Link</a>') == 'Link'
test() |
features_dict = {
"Name":{
"Description":"String",
"Pre_Action":'''
''',
"Post_Action":'''
''',
"Equip":'''
''',
"Unequip":'''
'''
},
"Dual Wielding":{
"Description":"You can use this weapon in your Off Hand (if available) and attack for -1 AP but with no Techinques. ",
"Pre_Action":'''
weapon = input("Do you want to use your\n" + source.Equipment["Main Hand"] + "\n or your\n" + source.Equipment["Off Hand"])
''',
"Equip":'''
if slot == "Off Hand":
source.Equipment[slot][item]["AP"] -= 1
source.Equipment[slot][item]["Techniques] = {}
source.Pre_Action.update("Dual Wielding" = features_dict["Dual Wielding"]["Pre_Action"])
''',
"Unequip":'''
source.Pre_Action.pop("Dual Wielding")
'''
},
"Dueling":{
"Description":"You can perform Feint, Parry, Riposte, and Disarm for -1 AP/RP respectively. ",
"Pre_Action":'''
if action == "Feint" or "Disarm":
source.AP += 1
''',
"Pre_Reaction":'''
if reaction == "Parry" or "Riposte":
source.RP += 1
''',
"Equip":'''
source.Pre_Action.update(Dueling = features_dict["Dueling"]["Pre_Action"])
source.Pre_Reaction.update(Dueling = features_dict["Dueling"]["Pre_Reaction"])
''',
"Unequip":'''
source.Pre_Action.pop("Dueling")
source.Pre_Reaction.pop("Dueling")
'''
},
"Finesse":{
"Description":"You can Replace your Muscle skill with your Finesse Skill",
"Pre_Action":'''
if action == "Weapon Attack":
source.misc_bonus -= mods(source.Attributes["STR"])
source.misc_bonus -= source.Skills["Muscle"]
source.misc_bonus += mods(source.Attributes["DEX"])
source.misc_bonus += source.Skills["Finesse"]
''',
"Post_Action":'''
if action == "Weapon Attack":
source.misc_bonus -= mods(source.Attributes["DEX"])
source.misc_bonus -= source.Skills["Finesse"]
source.misc_bonus += mods(source.Attributes["STR"])
source.misc_bonus += source.Skills["Muscle"]
''',
"Equip":'''
source.Pre_Action.update(Finesse = features_dict["Finesse"]["Pre_Action"])
source.Post_Action.update(Finesse = features_dict["Finesse"]["Post_Action"])
''',
"Unequip":'''
source.Pre_Action.pop("Finesse")
souce.Post_Action.pop("Finesse")
'''
},
"Grappling":{
"Description":"You can perform Wrestle checks with this weapon against a target",
"Pre_Action":'''
''',
"Post_Action":'''
''',
"Equip":'''
''',
"Unequip":'''
'''
},
"Heavy":{
"Description":"You can use 2 techniques per attack",
"Pre_Action":'''
''',
"Post_Action":'''
''',
"Equip":'''
''',
"Unequip":'''
'''
},
"Light":{
"Description":"Doesn't damage Heavy armors Durability",
"Post_Roll":'''
if action == "Weapon Attack":
target_armor = target.Equipment["Armor"]
if target_armor["Type"] == "Heavy":
target.Equipment["Armor"][target_armor]["Durability"] += 1
''',
"Equip":'''
source.Post_Roll.update(Light = features_dict["Light"][Post_Roll])
''',
"Unequip":'''
source.Post_Roll.pop("Light")
'''
},
"Thrown":{
"Description":"You can add 1 stage of momentum to your impact equation when you attack with this weapon at range.",
"Pre_Action":'''
range = distance(source,target)
if action == "Weapon Attack" and range > 1:
status(source,momentum,1)
''',
"Post_Action":'''
if action == "Weapon Attack" and range > 1:
status(source,momentum,-1)
''',
"Equip":'''
source.Pre_Action.update(Thrown = features_dict["Thrown"]["Pre_Action"])
source.Post_Action.update(Thrown = features_dict["Thrown"]["Post_Action"])
''',
"Unequip":'''
source.Pre_Action.pop("Thrown")
source.Post_Action.pop("Thrown")
'''
},
"Versatile":{
"Description":"You can use the weapon as a Piercing or Slashing weapon.",
"Pre_Action":'''
if action == "Weapon Attack":
choice = input("Do you want to use slashing or piercing?")
if choice == "slashing":
source.Equipment[weapon]["Type"] = "Slashing"
else:
source.Equipment[weapon]["Type"] = "Piercing"
''',
"Equip":'''
source.Pre_Action.update(Versatile = features_dict["Thrown"]["Pre_Action"])
''',
"Unequip":'''
source.Pre_Action.pop("Versatile)
'''
},
}
| features_dict = {'Name': {'Description': 'String', 'Pre_Action': '\n\n ', 'Post_Action': '\n\n ', 'Equip': '\n\n ', 'Unequip': '\n\n '}, 'Dual Wielding': {'Description': 'You can use this weapon in your Off Hand (if available) and attack for -1 AP but with no Techinques. ', 'Pre_Action': '\nweapon = input("Do you want to use your\n" + source.Equipment["Main Hand"] + "\n or your\n" + source.Equipment["Off Hand"])\n ', 'Equip': '\nif slot == "Off Hand":\n source.Equipment[slot][item]["AP"] -= 1\n source.Equipment[slot][item]["Techniques] = {}\n\n source.Pre_Action.update("Dual Wielding" = features_dict["Dual Wielding"]["Pre_Action"])\n ', 'Unequip': '\nsource.Pre_Action.pop("Dual Wielding")\n '}, 'Dueling': {'Description': 'You can perform Feint, Parry, Riposte, and Disarm for -1 AP/RP respectively. ', 'Pre_Action': '\nif action == "Feint" or "Disarm":\n source.AP += 1\n ', 'Pre_Reaction': '\nif reaction == "Parry" or "Riposte":\n source.RP += 1\n ', 'Equip': '\nsource.Pre_Action.update(Dueling = features_dict["Dueling"]["Pre_Action"])\nsource.Pre_Reaction.update(Dueling = features_dict["Dueling"]["Pre_Reaction"])\n ', 'Unequip': '\nsource.Pre_Action.pop("Dueling")\nsource.Pre_Reaction.pop("Dueling")\n '}, 'Finesse': {'Description': 'You can Replace your Muscle skill with your Finesse Skill', 'Pre_Action': '\nif action == "Weapon Attack":\n source.misc_bonus -= mods(source.Attributes["STR"])\n source.misc_bonus -= source.Skills["Muscle"]\n\n source.misc_bonus += mods(source.Attributes["DEX"])\n source.misc_bonus += source.Skills["Finesse"]\n ', 'Post_Action': '\nif action == "Weapon Attack":\n source.misc_bonus -= mods(source.Attributes["DEX"])\n source.misc_bonus -= source.Skills["Finesse"]\n\n source.misc_bonus += mods(source.Attributes["STR"])\n source.misc_bonus += source.Skills["Muscle"]\n ', 'Equip': '\nsource.Pre_Action.update(Finesse = features_dict["Finesse"]["Pre_Action"])\nsource.Post_Action.update(Finesse = features_dict["Finesse"]["Post_Action"])\n ', 'Unequip': '\nsource.Pre_Action.pop("Finesse")\nsouce.Post_Action.pop("Finesse")\n '}, 'Grappling': {'Description': 'You can perform Wrestle checks with this weapon against a target', 'Pre_Action': '\n\n ', 'Post_Action': '\n\n ', 'Equip': '\n\n ', 'Unequip': '\n\n '}, 'Heavy': {'Description': 'You can use 2 techniques per attack', 'Pre_Action': '\n\n ', 'Post_Action': '\n\n ', 'Equip': '\n\n ', 'Unequip': '\n\n '}, 'Light': {'Description': "Doesn't damage Heavy armors Durability", 'Post_Roll': '\nif action == "Weapon Attack":\n target_armor = target.Equipment["Armor"]\n if target_armor["Type"] == "Heavy":\n target.Equipment["Armor"][target_armor]["Durability"] += 1\n ', 'Equip': '\nsource.Post_Roll.update(Light = features_dict["Light"][Post_Roll])\n ', 'Unequip': '\nsource.Post_Roll.pop("Light")\n '}, 'Thrown': {'Description': 'You can add 1 stage of momentum to your impact equation when you attack with this weapon at range.', 'Pre_Action': '\nrange = distance(source,target)\nif action == "Weapon Attack" and range > 1:\n status(source,momentum,1)\n ', 'Post_Action': '\nif action == "Weapon Attack" and range > 1:\n status(source,momentum,-1)\n ', 'Equip': '\nsource.Pre_Action.update(Thrown = features_dict["Thrown"]["Pre_Action"])\nsource.Post_Action.update(Thrown = features_dict["Thrown"]["Post_Action"])\n ', 'Unequip': '\nsource.Pre_Action.pop("Thrown")\nsource.Post_Action.pop("Thrown")\n '}, 'Versatile': {'Description': 'You can use the weapon as a Piercing or Slashing weapon.', 'Pre_Action': '\n\nif action == "Weapon Attack":\n choice = input("Do you want to use slashing or piercing?")\n\n if choice == "slashing":\n source.Equipment[weapon]["Type"] = "Slashing"\n else:\n source.Equipment[weapon]["Type"] = "Piercing"\n ', 'Equip': '\nsource.Pre_Action.update(Versatile = features_dict["Thrown"]["Pre_Action"])\n\n ', 'Unequip': '\nsource.Pre_Action.pop("Versatile)\n '}} |
tiles = [
# track example in Marin Headlands, a member of Bay Area Ridge Trail, a regional network
# https://www.openstreetmap.org/way/12188550
# https://www.openstreetmap.org/relation/2684235
[12, 654, 1582]
]
for z, x, y in tiles:
assert_has_feature(
z, x, y, 'roads',
{'highway': 'track'})
| tiles = [[12, 654, 1582]]
for (z, x, y) in tiles:
assert_has_feature(z, x, y, 'roads', {'highway': 'track'}) |
class Readfile():
def process(self, utils, logger):
filenames = utils.check_input()
words = []
for filename in filenames:
with open(utils.indir + filename, 'r') as f:
for line in f:
words.append(line.strip())
return words
| class Readfile:
def process(self, utils, logger):
filenames = utils.check_input()
words = []
for filename in filenames:
with open(utils.indir + filename, 'r') as f:
for line in f:
words.append(line.strip())
return words |
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2010, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
# Software Distributed under the MIT License
'''
Value types: An hierarchy of value types.
Hierarchy:
vtype
|- numeric
| |-ordinal
| | |- ordinalrange
| | - boolean
| | - integer
| -continuous
- categorical
- boolean
'''
class vtype(object):
def __init__(self,name):
self.name = name
class numeric(vtype):
def __init__(self,name):
vtype.__init__(self,name)
class continuous(numeric):
def __init__(self,name):
vtype.__init__(self,name)
class ordinal(numeric):
def __init__(self,name):
vtype.__init__(self,name)
class ordinalrange(ordinal):
def __init__(self,name,max,min):
ordinal.__init__(self,name)
self.max = max
self.min = min
class integer(ordinal):
pass
class categorical(vtype):
def __init__(self,name, categories):
vtype.__init__(self,name)
self.categories = categories
class boolean(categorical, ordinal):
def __init__(self,name):
vtype.__init__(self,name)
| """
Value types: An hierarchy of value types.
Hierarchy:
vtype
|- numeric
| |-ordinal
| | |- ordinalrange
| | - boolean
| | - integer
| -continuous
- categorical
- boolean
"""
class Vtype(object):
def __init__(self, name):
self.name = name
class Numeric(vtype):
def __init__(self, name):
vtype.__init__(self, name)
class Continuous(numeric):
def __init__(self, name):
vtype.__init__(self, name)
class Ordinal(numeric):
def __init__(self, name):
vtype.__init__(self, name)
class Ordinalrange(ordinal):
def __init__(self, name, max, min):
ordinal.__init__(self, name)
self.max = max
self.min = min
class Integer(ordinal):
pass
class Categorical(vtype):
def __init__(self, name, categories):
vtype.__init__(self, name)
self.categories = categories
class Boolean(categorical, ordinal):
def __init__(self, name):
vtype.__init__(self, name) |
"""Module entrypoint."""
def main() -> None:
"""Execute package entrypoint."""
print("Test")
if __name__ == "__main__":
main()
| """Module entrypoint."""
def main() -> None:
"""Execute package entrypoint."""
print('Test')
if __name__ == '__main__':
main() |
def letter_to_number(letter):
if letter == 'A':
return 10
if letter == 'B':
return 11
if letter == 'C':
return 12
if letter == 'D':
return 13
if letter == 'E':
return 14
if letter == 'F':
return 15
else:
return int(letter)
def int_to_char(integer):
if integer == 15:
return 'F'
if integer == 14:
return 'E'
if integer == 13:
return 'D'
if integer == 12:
return 'C'
if integer == 11:
return 'B'
if integer == 10:
return 'A'
else:
return str(integer)
def base_to_decimal(number, base):
first_index = 1 if number[0] == '-' else 0
power = len(number) - 1 if first_index == 0 else len(number) - 2
decimal = 0
for char in number[first_index:]:
decimal += letter_to_number(char) * pow(base, power)
power -= 1
return decimal
def solution(number, from_base, to_base):
is_negative = number[0] == '-'
decimal = base_to_decimal(number, from_base)
digits = []
while decimal > 0:
current_digit = decimal % to_base
decimal //= to_base
digits.append(int_to_char(current_digit))
return '-' + ''.join(reversed(digits)) if is_negative else ''.join(reversed(digits))
| def letter_to_number(letter):
if letter == 'A':
return 10
if letter == 'B':
return 11
if letter == 'C':
return 12
if letter == 'D':
return 13
if letter == 'E':
return 14
if letter == 'F':
return 15
else:
return int(letter)
def int_to_char(integer):
if integer == 15:
return 'F'
if integer == 14:
return 'E'
if integer == 13:
return 'D'
if integer == 12:
return 'C'
if integer == 11:
return 'B'
if integer == 10:
return 'A'
else:
return str(integer)
def base_to_decimal(number, base):
first_index = 1 if number[0] == '-' else 0
power = len(number) - 1 if first_index == 0 else len(number) - 2
decimal = 0
for char in number[first_index:]:
decimal += letter_to_number(char) * pow(base, power)
power -= 1
return decimal
def solution(number, from_base, to_base):
is_negative = number[0] == '-'
decimal = base_to_decimal(number, from_base)
digits = []
while decimal > 0:
current_digit = decimal % to_base
decimal //= to_base
digits.append(int_to_char(current_digit))
return '-' + ''.join(reversed(digits)) if is_negative else ''.join(reversed(digits)) |
def returned(reduction):
if reduction is not None:
return r"""
Returns
-------
torch.Tensor
If `reduction` is left as default {} is taken and single value returned.
Otherwise whatever `reduction` returns.
""".format(
reduction
)
return r"""
Returns
-------
torch.Tensor
Scalar `tensor`
"""
def reduction_parameter(reduction):
if reduction == "mean":
return r"""
reduction: Callable(torch.Tensor) -> Any, optional
One argument callable getting `torch.Tensor` and returning argument
after specified reduction.
Default: `torch.mean` (mean across batch, user can use `torchtraining.savers.Mean`
to get mean across iterations/epochs).
"""
if reduction == "sum":
return r"""
reduction: Callable, optional
One argument callable getting `torch.Tensor` and returning `torch.Tensor`.
Default: `torch.sum` (sum of all elements, user can use `torchtraining.savers.Sum`
to get sum across iterations/epochs).
"""
raise ValueError(
"""reduction argument can be one of ["sum", "mean"], got {}""".format(reduction)
)
| def returned(reduction):
if reduction is not None:
return '\nReturns\n-------\ntorch.Tensor\n If `reduction` is left as default {} is taken and single value returned.\n Otherwise whatever `reduction` returns.\n\n '.format(reduction)
return '\nReturns\n-------\ntorch.Tensor\n Scalar `tensor`\n\n '
def reduction_parameter(reduction):
if reduction == 'mean':
return '\nreduction: Callable(torch.Tensor) -> Any, optional\n One argument callable getting `torch.Tensor` and returning argument\n after specified reduction.\n Default: `torch.mean` (mean across batch, user can use `torchtraining.savers.Mean`\n to get mean across iterations/epochs).\n'
if reduction == 'sum':
return '\nreduction: Callable, optional\n One argument callable getting `torch.Tensor` and returning `torch.Tensor`.\n Default: `torch.sum` (sum of all elements, user can use `torchtraining.savers.Sum`\n to get sum across iterations/epochs).\n'
raise value_error('reduction argument can be one of ["sum", "mean"], got {}'.format(reduction)) |
p = int(input())
total = 0
numbers = []
for i in range(p):
cod, quant = input().split(' ')
cod = int(cod)
quant = int(quant)
if(cod == 1001):
total = quant*1.50
elif(cod==1002):
total = quant*2.50
elif(cod==1003):
total = quant*3.50
elif(cod==1004):
total = quant*4.50
elif(cod==1005):
total = quant*5.50
numbers.append(total)
for i in range(len(numbers)):
numbers[i] = float(numbers[i])
print('{:.2f}'.format(sum(numbers))) | p = int(input())
total = 0
numbers = []
for i in range(p):
(cod, quant) = input().split(' ')
cod = int(cod)
quant = int(quant)
if cod == 1001:
total = quant * 1.5
elif cod == 1002:
total = quant * 2.5
elif cod == 1003:
total = quant * 3.5
elif cod == 1004:
total = quant * 4.5
elif cod == 1005:
total = quant * 5.5
numbers.append(total)
for i in range(len(numbers)):
numbers[i] = float(numbers[i])
print('{:.2f}'.format(sum(numbers))) |
"""
Code examples for common DevOps tasks
cmd.py : Running comand line utils from python script
archive.py : tar/zip archives management
"""
__author__ = "Oleg Merzlyakov"
__license__ = "MIT"
__email__ = "contact@merzlyakov.me"
| """
Code examples for common DevOps tasks
cmd.py : Running comand line utils from python script
archive.py : tar/zip archives management
"""
__author__ = 'Oleg Merzlyakov'
__license__ = 'MIT'
__email__ = 'contact@merzlyakov.me' |
ENV_NAMES = [
"coinrun",
"starpilot",
"caveflyer",
"dodgeball",
"fruitbot",
"chaser",
"miner",
"jumper",
"leaper",
"maze",
"bigfish",
"heist",
"climber",
"plunder",
"ninja",
"bossfight",
]
HARD_GAME_RANGES = {
'coinrun': [5, 10],
'starpilot': [1.5, 35],
'caveflyer': [2, 13.4],
'dodgeball': [1.5, 19],
'fruitbot': [-.5, 27.2],
'chaser': [.5, 14.2],
'miner': [1.5, 20],
'jumper': [1, 10],
'leaper': [1.5, 10],
'maze': [4, 10],
'bigfish': [0, 40],
'heist': [2, 10],
'climber': [1, 12.6],
'plunder': [3, 30],
'ninja': [2, 10],
'bossfight': [.5, 13],
}
NAME_TO_CASE = {
'coinrun': 'CoinRun',
'starpilot': 'StarPilot',
'caveflyer': 'CaveFlyer',
'dodgeball': 'Dodgeball',
'fruitbot': 'FruitBot',
'chaser': 'Chaser',
'miner': 'Miner',
'jumper': 'Jumper',
'leaper': 'Leaper',
'maze': 'Maze',
'bigfish': 'BigFish',
'heist': 'Heist',
'climber': 'Climber',
'plunder': 'Plunder',
'ninja': 'Ninja',
'bossfight': 'BossFight',
} | env_names = ['coinrun', 'starpilot', 'caveflyer', 'dodgeball', 'fruitbot', 'chaser', 'miner', 'jumper', 'leaper', 'maze', 'bigfish', 'heist', 'climber', 'plunder', 'ninja', 'bossfight']
hard_game_ranges = {'coinrun': [5, 10], 'starpilot': [1.5, 35], 'caveflyer': [2, 13.4], 'dodgeball': [1.5, 19], 'fruitbot': [-0.5, 27.2], 'chaser': [0.5, 14.2], 'miner': [1.5, 20], 'jumper': [1, 10], 'leaper': [1.5, 10], 'maze': [4, 10], 'bigfish': [0, 40], 'heist': [2, 10], 'climber': [1, 12.6], 'plunder': [3, 30], 'ninja': [2, 10], 'bossfight': [0.5, 13]}
name_to_case = {'coinrun': 'CoinRun', 'starpilot': 'StarPilot', 'caveflyer': 'CaveFlyer', 'dodgeball': 'Dodgeball', 'fruitbot': 'FruitBot', 'chaser': 'Chaser', 'miner': 'Miner', 'jumper': 'Jumper', 'leaper': 'Leaper', 'maze': 'Maze', 'bigfish': 'BigFish', 'heist': 'Heist', 'climber': 'Climber', 'plunder': 'Plunder', 'ninja': 'Ninja', 'bossfight': 'BossFight'} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.