content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
# This file is part of the dune-gdt project:
# https://github.com/dune-community/dune-gdt
# Copyright 2010-2017 dune-gdt developers and contributors. All rights reserved.
# License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
# or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
# with "runtime exception" (http://www.dune-project.org/license.html)
# Authors:
# Felix Schindler (2017)
# Rene Milk (2017)
class Grids(object):
def __init__(self, cache):
try:
have_alugrid = cache['dune-alugrid']
except KeyError:
have_alugrid = False
self.all_parts_fmt = [self.alu_conf_part_fmt, self.alu_cube_part_fmt, self.yasp_part_fmt] if have_alugrid else [
self.yasp_part_fmt]
self.all_views_fmt = [self.alu_conf_view_fmt, self.alu_cube_view_fmt, self.yasp_view_fmt] if have_alugrid else [
self.yasp_view_fmt]
class LeafGrids(Grids):
world_dim = [2, 3]
alu_cube_part_fmt = 'AluCube{}dLeafGridPartType'
alu_conf_part_fmt = 'AluConform{}dLeafGridPartType'
yasp_part_fmt = 'Yasp{}dLeafGridPartType'
alu_cube_view_fmt = 'AluCube{}dLeafGridViewType'
alu_conf_view_fmt = 'AluConform{}dLeafGridViewType'
yasp_view_fmt = 'Yasp{}dLeafGridViewType'
def __init__(self, cache):
super(LeafGrids, self).__init__(cache)
class LevelGrids(Grids):
world_dim = [2, 3]
alu_cube_part_fmt = 'AluCube{}dLevelGridPartType'
alu_conf_part_fmt = 'AluConform{}dLevelGridPartType'
yasp_part_fmt = 'Yasp{}dLevelGridPartType'
alu_cube_view_fmt = 'AluCube{}dLevelGridViewType'
alu_conf_view_fmt = 'AluConform{}dLevelGridViewType'
yasp_view_fmt = 'Yasp{}dLevelGridViewType'
def __init__(self, cache):
super(LevelGrids, self).__init__(cache) | class Grids(object):
def __init__(self, cache):
try:
have_alugrid = cache['dune-alugrid']
except KeyError:
have_alugrid = False
self.all_parts_fmt = [self.alu_conf_part_fmt, self.alu_cube_part_fmt, self.yasp_part_fmt] if have_alugrid else [self.yasp_part_fmt]
self.all_views_fmt = [self.alu_conf_view_fmt, self.alu_cube_view_fmt, self.yasp_view_fmt] if have_alugrid else [self.yasp_view_fmt]
class Leafgrids(Grids):
world_dim = [2, 3]
alu_cube_part_fmt = 'AluCube{}dLeafGridPartType'
alu_conf_part_fmt = 'AluConform{}dLeafGridPartType'
yasp_part_fmt = 'Yasp{}dLeafGridPartType'
alu_cube_view_fmt = 'AluCube{}dLeafGridViewType'
alu_conf_view_fmt = 'AluConform{}dLeafGridViewType'
yasp_view_fmt = 'Yasp{}dLeafGridViewType'
def __init__(self, cache):
super(LeafGrids, self).__init__(cache)
class Levelgrids(Grids):
world_dim = [2, 3]
alu_cube_part_fmt = 'AluCube{}dLevelGridPartType'
alu_conf_part_fmt = 'AluConform{}dLevelGridPartType'
yasp_part_fmt = 'Yasp{}dLevelGridPartType'
alu_cube_view_fmt = 'AluCube{}dLevelGridViewType'
alu_conf_view_fmt = 'AluConform{}dLevelGridViewType'
yasp_view_fmt = 'Yasp{}dLevelGridViewType'
def __init__(self, cache):
super(LevelGrids, self).__init__(cache) |
# BASE
URL = "http://download.geofabrik.de/"
suffix = "-latest.osm.pbf"
africa_url = "africa/"
asia_url = "asia/"
australia_oceania_url = "australia-oceania/"
central_america_url = "central-america/"
europe_url = "europe/"
north_america_url = "north-america/"
south_america_url = "south-america/"
baden_wuerttemberg_url = "europe/germany/baden-wuerttemberg/"
bayern_url = "europe/germany/bayern/"
brazil_url = "south-america/brazil/"
canada_url = "north-america/canada/"
england_url = "europe/great-britain/england/"
france_url = "europe/france/"
gb_url = "europe/great-britain/"
germany_url = "europe/germany/"
italy_url = "europe/italy/"
japan_url = "asia/japan/"
netherlands_url = "europe/netherlands/"
nordrhein_wesfalen_url = "europe/germany/nordrhein-westfalen/"
poland_url = "europe/poland/"
russia_url = "russia/"
usa_url = "north-america/us/"
class USA:
# State level data sources
regions = [
"alabama",
"alaska",
"arizona",
"arkansas",
"colorado",
"connecticut",
"delaware",
"district_of_columbia",
"florida",
"georgia",
"hawaii",
"idaho",
"illinois",
"indiana",
"iowa",
"kansas",
"kentucky",
"louisiana",
"maine",
"maryland",
"massachusetts",
"michigan",
"minnesota",
"mississippi",
"missouri",
"montana",
"nebraska",
"nevada",
"new_hampshire",
"new_mexico",
"new_york",
"new_jersey",
"north_carolina",
"north_dakota",
"ohio",
"oklahoma",
"oregon",
"pennsylvania",
"puerto_rico",
"rhode_island",
"south_carolina",
"south_dakota",
"tennessee",
"texas",
"utah",
"vermont",
"virginia",
"washington",
"west_virginia",
"wisconsin",
"wyoming",
]
available = regions + ["southern_california", "northern_california"]
available.sort()
country = {"name": "us" + suffix, "url": URL + north_america_url + "us" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + usa_url + region.replace("_", "-") + suffix}
for region in regions
}
# Add California separately
_sources["southern_california"] = {
"name": "socal" + suffix,
"url": URL + "north-america/us/california/socal-latest.osm.pbf",
}
_sources["northern_california"] = {
"name": "norcal" + suffix,
"url": URL + "north-america/us/california/norcal-latest.osm.pbf",
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class France:
regions = [
"alsace",
"aquitaine",
"auvergne",
"basse_normandie",
"bourgogne",
"bretagne",
"centre",
"champagne_ardenne",
"corse",
"franche_comte",
"guadeloupe",
"guyane",
"haute_normandie",
"ile_de_france",
"languedoc_roussillon",
"limousin",
"lorraine",
"martinique",
"mayotte",
"midi_pyrenees",
"nord_pas_de_calais",
"pays_de_la_loire",
"picardie",
"poitou_charentes",
"provence_alpes_cote_d_azur",
"reunion",
"rhone_alpes",
]
available = regions
available.sort()
country = {"name": "france" + suffix, "url": URL + europe_url + "france" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + france_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class England:
regions = [
"bedfordshire",
"berkshire",
"bristol",
"buckinghamshire",
"cambridgeshire",
"cheshire",
"cornwall",
"cumbria",
"derbyshire",
"devon",
"dorset",
"durham",
"east_sussex",
"east_yorkshire_with_hull",
"essex",
"gloucestershire",
"greater_london",
"greater_manchester",
"hampshire",
"herefordshire",
"hertfordshire",
"isle_of_wight",
"kent",
"lancashire",
"leicestershire",
"lincolnshire",
"merseyside",
"norfolk",
"north_yorkshire",
"northamptonshire",
"northumberland",
"nottinghamshire",
"oxfordshire",
"rutland",
"shropshire",
"somerset",
"south_yorkshire",
"staffordshire",
"suffolk",
"surrey",
"tyne_and_wear",
"warwickshire",
"west_midlands",
"west_sussex",
"west_yorkshire",
"wiltshire",
"worcestershire",
]
available = regions
available.sort()
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix,
"url": URL + england_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class GreatBritain:
regions = ["england", "scotland", "wales"]
england = England()
available = regions + england.available
available.sort()
country = {"name": "great-britain" + suffix, "url": URL + europe_url + "great-britain" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + gb_url + region.replace("_", "-") + suffix}
for region in regions
}
for region in england.available:
_sources[region] = {"name": region.replace("_", "-") + suffix,
"url": URL + england_url + region.replace("_", "-") + suffix}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Italy:
regions = ["centro", "isole", "nord_est", "nord_ovest", "sud"]
available = regions
available.sort()
country = {"name": "italy" + suffix, "url": URL + europe_url + "italy" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + italy_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Russia:
regions = ["central_fed_district",
"crimean_fed_district",
"far_eastern_fed_district",
"kaliningrad",
"north_caucasus_fed_district",
"northwestern_fed_district",
"siberian_fed_district",
"south_fed_district",
"ural_fed_district",
"volga_fed_district"]
available = regions
available.sort()
country = {"name": "russia" + suffix, "url": URL + russia_url + "russia" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + russia_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Poland:
regions = ["dolnoslaskie",
"kujawsko_pomorskie",
"lodzkie",
"lubelskie",
"lubuskie",
"malopolskie",
"mazowieckie",
"opolskie",
"podkarpackie",
"podlaskie",
"pomorskie",
"slaskie",
"swietokrzyskie",
"warminsko_mazurskie",
"wielkopolskie",
"zachodniopomorskie"
]
available = regions
available.sort()
country = {"name": "poland" + suffix, "url": URL + europe_url + "poland" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + poland_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class BadenWuerttemberg:
regions = ["freiburg_regbez",
"karlsruhe_regbez",
"stuttgart_regbez",
"tuebingen_regbez"]
available = regions
available.sort()
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix,
"url": URL + baden_wuerttemberg_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class NordrheinWestfalen:
regions = ["arnsberg_regbez",
"detmold_regbez",
"duesseldorf_regbez",
"koeln_regbez",
"muenster_regbez"]
available = regions
available.sort()
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix,
"url": URL + nordrhein_wesfalen_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Bayern:
regions = ["mittelfranken",
"niederbayern",
"oberbayern",
"oberfranken",
"oberpfalz",
"schwaben",
"unterfranken"]
available = regions
available.sort()
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix,
"url": URL + bayern_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Germany:
regions = ["baden_wuerttemberg",
"bayern",
"berlin",
"brandenburg",
"bremen",
"hamburg",
"hessen",
"mecklenburg_vorpommern",
"niedersachsen",
"nordrhein_westfalen",
"rheinland_pfalz",
"saarland",
"sachsen_anhalt",
"sachsen",
"schleswig_holstein",
"thueringen"]
baden_wuerttemberg = BadenWuerttemberg()
bayern = Bayern()
nordrhein_westfalen = NordrheinWestfalen()
available = regions + bayern.available + baden_wuerttemberg.available \
+ nordrhein_westfalen.available
available.sort()
country = {"name": "germany" + suffix, "url": URL + europe_url + "germany" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix,
"url": URL + germany_url + region.replace("_", "-") + suffix}
for region in regions
}
for region in nordrhein_westfalen.available:
_sources[region] = {"name": region.replace("_", "-") + suffix,
"url": URL + nordrhein_wesfalen_url + region.replace("_", "-") + suffix}
for region in baden_wuerttemberg.available:
_sources[region] = {"name": region.replace("_", "-") + suffix,
"url": URL + baden_wuerttemberg_url + region.replace("_", "-") + suffix}
for region in bayern.available:
_sources[region] = {"name": region.replace("_", "-") + suffix,
"url": URL + bayern_url + region.replace("_", "-") + suffix}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Netherlands:
regions = ["drenthe",
"flevoland",
"friesland",
"gelderland",
"groningen",
"limburg",
"noord_brabant",
"noord_holland",
"overijssel",
"utrecht",
"zeeland",
"zuid_holland"]
available = regions
available.sort()
country = {"name": "netherlands" + suffix, "url": URL + europe_url + "netherlands" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix,
"url": URL + netherlands_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Canada:
regions = ["alberta",
"british_columbia",
"manitoba",
"new_brunswick",
"newfoundland_and_labrador",
"northwest_territories",
"nova_scotia",
"nunavut",
"ontario",
"prince_edward_island",
"quebec",
"saskatchewan",
"yukon"]
available = regions
available.sort()
country = {"name": "canada" + suffix, "url": URL + north_america_url + "canada" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + canada_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Brazil:
regions = ["centro_oeste", "nordeste", "norte", "sudeste", "sul"]
available = regions
available.sort()
country = {"name": "brazil" + suffix, "url": URL + south_america_url + "brazil" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + brazil_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Japan:
regions = ["chubu",
"chugoku",
"hokkaido",
"kansai",
"kanto",
"kyushu",
"shikoku",
"tohoku"]
available = regions
available.sort()
country = {"name": "japan" + suffix, "url": URL + asia_url + "japan" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + japan_url + region + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class AustraliaOceania:
regions = ["australia",
"cook_islands",
"fiji",
"kiribati",
"marshall_islands",
"micronesia",
"nauru",
"new_caledonia",
"new_zealand",
"niue",
"palau",
"papua_new_guinea",
"samoa",
"solomon_islands",
"tonga",
"tuvalu",
"vanuatu"]
available = regions
available.sort()
continent = {"name": "australia-oceania" + suffix, "url": URL + "australia-oceania" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix,
"url": URL + australia_oceania_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class NorthAmerica:
regions = ["canada",
"greenland",
"mexico",
"usa",
"us_midwest",
"us_northeast",
"us_pacific",
"us_south",
"us_west"]
usa = USA()
canada = Canada()
available = regions
available.sort()
continent = {"name": "north-america" + suffix, "url": URL + "north-america" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix,
"url": URL + north_america_url + region.replace("_", "-") + suffix}
for region in regions if region != "usa"
}
# USA is "us" in GeoFabrik
_sources["usa"] = {"name": "us" + suffix,
"url": URL + north_america_url + "us" + suffix}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class SouthAmerica:
regions = ["argentina",
"bolivia",
"brazil",
"chile",
"colombia",
"ecuador",
"paraguay",
"peru",
"suriname",
"uruguay",
"venezuela"]
brazil = Brazil()
available = regions
available.sort()
available.sort()
continent = {"name": "south-america" + suffix, "url": URL + "south-america" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + south_america_url + region + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class CentralAmerica:
regions = ["bahamas",
"belize",
"cuba",
"guatemala",
"haiti_and_domrep",
"jamaica",
"nicaragua"]
available = regions
available.sort()
continent = {"name": "central-america" + suffix, "url": URL + "central-america" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix,
"url": URL + central_america_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Europe:
# Country specific subregions
france = France()
great_britain = GreatBritain()
italy = Italy()
russia = Russia()
poland = Poland()
germany = Germany()
netherlands = Netherlands()
regions = [
"albania",
"andorra",
"austria",
"azores",
"belarus",
"belgium",
"bosnia_herzegovina",
"bulgaria",
"croatia",
"cyprus",
"czech_republic",
"denmark",
"estonia",
"faroe_islands",
"finland",
"france",
"georgia",
"germany",
"great_britain",
"greece",
"hungary",
"iceland",
"ireland_and_northern_ireland",
"isle_of_man",
"italy",
"kosovo",
"latvia",
"liechtenstein",
"lithuania",
"luxembourg",
"macedonia",
"malta",
"moldova",
"monaco",
"montenegro",
"netherlands",
"norway",
"poland",
"portugal",
"romania",
"russia",
"serbia",
"slovakia",
"slovenia",
"spain",
"sweden",
"switzerland",
"turkey",
"ukraine",
]
available = regions
available.sort()
continent = {"name": "europe" + suffix, "url": URL + "europe" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + europe_url + region.replace("_", "-") + suffix}
for region in regions if region != "russia"
}
# Russia is separately from Europe
_sources["russia"] = {"name": "russia" + suffix,
"url": URL + "russia" + suffix}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Africa:
regions = ["algeria",
"angola",
"benin",
"botswana",
"burkina_faso",
"burundi",
"cameroon",
"canary_islands",
"cape_verde",
"central_african_republic",
"chad",
"comores",
"congo_brazzaville",
"congo_democratic_republic",
"djibouti",
"egypt",
"equatorial_guinea",
"eritrea",
"ethiopia",
"gabon",
"ghana",
"guinea_bissau",
"guinea",
"ivory_coast",
"kenya",
"lesotho",
"liberia",
"libya",
"madagascar",
"malawi",
"mali",
"mauritania",
"mauritius",
"morocco",
"mozambique",
"namibia",
"niger",
"nigeria",
"rwanda",
"saint_helena_ascension_and_tristan_da_cunha",
"sao_tome_and_principe",
"senegal_and_gambia",
"seychelles",
"sierra_leone",
"somalia",
"south_africa_and_lesotho",
"south_africa",
"south_sudan",
"sudan",
"swaziland",
"tanzania",
"togo",
"tunisia",
"uganda",
"zambia",
"zimbabwe"]
available = regions
available.sort()
continent = {"name": "africa" + suffix, "url": URL + "africa" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + africa_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Asia:
regions = ["afghanistan",
"armenia",
"azerbaijan",
"bangladesh",
"bhutan",
"cambodia",
"china",
"gcc_states",
"india",
"indonesia",
"iran",
"iraq",
"israel_and_palestine",
"japan",
"jordan",
"kazakhstan",
"kyrgyzstan",
"laos",
"lebanon",
"malaysia_singapore_brunei",
"maldives",
"mongolia",
"myanmar",
"nepal",
"north_korea",
"pakistan",
"philippines",
"south_korea",
"sri_lanka",
"syria",
"taiwan",
"tajikistan",
"thailand",
"turkmenistan",
"uzbekistan",
"vietnam",
"yemen"]
japan = Japan()
available = regions
available.sort()
continent = {"name": "asia" + suffix, "url": URL + "asia" + suffix}
# Create data sources
_sources = {
region: {"name": region.replace("_", "-") + suffix, "url": URL + asia_url + region.replace("_", "-") + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Antarctica:
regions = ["antarctica"]
available = regions
available.sort()
continent = {"name": "antarctica" + suffix, "url": URL + "antarctica" + suffix}
# Create data sources
_sources = {
region: {"name": region + suffix, "url": URL + region + suffix}
for region in regions
}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class SubRegions:
def __init__(self):
self.regions = ["brazil", "canada", "france", "germany", "great_britain", "italy", "japan", "netherlands", "poland", "russia", "usa"]
available = self.regions
available.sort()
self.brazil = Brazil()
self.canada = Canada()
self.france = France()
self.germany = Germany()
self.great_britain = GreatBritain()
self.italy = Italy()
self.japan = Japan()
self.netherlands = Netherlands()
self.poland = Poland()
self.russia = Russia()
self.usa = USA()
self.available = {name: self.__dict__[name].available for name in self.regions}
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
| url = 'http://download.geofabrik.de/'
suffix = '-latest.osm.pbf'
africa_url = 'africa/'
asia_url = 'asia/'
australia_oceania_url = 'australia-oceania/'
central_america_url = 'central-america/'
europe_url = 'europe/'
north_america_url = 'north-america/'
south_america_url = 'south-america/'
baden_wuerttemberg_url = 'europe/germany/baden-wuerttemberg/'
bayern_url = 'europe/germany/bayern/'
brazil_url = 'south-america/brazil/'
canada_url = 'north-america/canada/'
england_url = 'europe/great-britain/england/'
france_url = 'europe/france/'
gb_url = 'europe/great-britain/'
germany_url = 'europe/germany/'
italy_url = 'europe/italy/'
japan_url = 'asia/japan/'
netherlands_url = 'europe/netherlands/'
nordrhein_wesfalen_url = 'europe/germany/nordrhein-westfalen/'
poland_url = 'europe/poland/'
russia_url = 'russia/'
usa_url = 'north-america/us/'
class Usa:
regions = ['alabama', 'alaska', 'arizona', 'arkansas', 'colorado', 'connecticut', 'delaware', 'district_of_columbia', 'florida', 'georgia', 'hawaii', 'idaho', 'illinois', 'indiana', 'iowa', 'kansas', 'kentucky', 'louisiana', 'maine', 'maryland', 'massachusetts', 'michigan', 'minnesota', 'mississippi', 'missouri', 'montana', 'nebraska', 'nevada', 'new_hampshire', 'new_mexico', 'new_york', 'new_jersey', 'north_carolina', 'north_dakota', 'ohio', 'oklahoma', 'oregon', 'pennsylvania', 'puerto_rico', 'rhode_island', 'south_carolina', 'south_dakota', 'tennessee', 'texas', 'utah', 'vermont', 'virginia', 'washington', 'west_virginia', 'wisconsin', 'wyoming']
available = regions + ['southern_california', 'northern_california']
available.sort()
country = {'name': 'us' + suffix, 'url': URL + north_america_url + 'us' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + usa_url + region.replace('_', '-') + suffix} for region in regions}
_sources['southern_california'] = {'name': 'socal' + suffix, 'url': URL + 'north-america/us/california/socal-latest.osm.pbf'}
_sources['northern_california'] = {'name': 'norcal' + suffix, 'url': URL + 'north-america/us/california/norcal-latest.osm.pbf'}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class France:
regions = ['alsace', 'aquitaine', 'auvergne', 'basse_normandie', 'bourgogne', 'bretagne', 'centre', 'champagne_ardenne', 'corse', 'franche_comte', 'guadeloupe', 'guyane', 'haute_normandie', 'ile_de_france', 'languedoc_roussillon', 'limousin', 'lorraine', 'martinique', 'mayotte', 'midi_pyrenees', 'nord_pas_de_calais', 'pays_de_la_loire', 'picardie', 'poitou_charentes', 'provence_alpes_cote_d_azur', 'reunion', 'rhone_alpes']
available = regions
available.sort()
country = {'name': 'france' + suffix, 'url': URL + europe_url + 'france' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + france_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class England:
regions = ['bedfordshire', 'berkshire', 'bristol', 'buckinghamshire', 'cambridgeshire', 'cheshire', 'cornwall', 'cumbria', 'derbyshire', 'devon', 'dorset', 'durham', 'east_sussex', 'east_yorkshire_with_hull', 'essex', 'gloucestershire', 'greater_london', 'greater_manchester', 'hampshire', 'herefordshire', 'hertfordshire', 'isle_of_wight', 'kent', 'lancashire', 'leicestershire', 'lincolnshire', 'merseyside', 'norfolk', 'north_yorkshire', 'northamptonshire', 'northumberland', 'nottinghamshire', 'oxfordshire', 'rutland', 'shropshire', 'somerset', 'south_yorkshire', 'staffordshire', 'suffolk', 'surrey', 'tyne_and_wear', 'warwickshire', 'west_midlands', 'west_sussex', 'west_yorkshire', 'wiltshire', 'worcestershire']
available = regions
available.sort()
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + england_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Greatbritain:
regions = ['england', 'scotland', 'wales']
england = england()
available = regions + england.available
available.sort()
country = {'name': 'great-britain' + suffix, 'url': URL + europe_url + 'great-britain' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + gb_url + region.replace('_', '-') + suffix} for region in regions}
for region in england.available:
_sources[region] = {'name': region.replace('_', '-') + suffix, 'url': URL + england_url + region.replace('_', '-') + suffix}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Italy:
regions = ['centro', 'isole', 'nord_est', 'nord_ovest', 'sud']
available = regions
available.sort()
country = {'name': 'italy' + suffix, 'url': URL + europe_url + 'italy' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + italy_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Russia:
regions = ['central_fed_district', 'crimean_fed_district', 'far_eastern_fed_district', 'kaliningrad', 'north_caucasus_fed_district', 'northwestern_fed_district', 'siberian_fed_district', 'south_fed_district', 'ural_fed_district', 'volga_fed_district']
available = regions
available.sort()
country = {'name': 'russia' + suffix, 'url': URL + russia_url + 'russia' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + russia_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Poland:
regions = ['dolnoslaskie', 'kujawsko_pomorskie', 'lodzkie', 'lubelskie', 'lubuskie', 'malopolskie', 'mazowieckie', 'opolskie', 'podkarpackie', 'podlaskie', 'pomorskie', 'slaskie', 'swietokrzyskie', 'warminsko_mazurskie', 'wielkopolskie', 'zachodniopomorskie']
available = regions
available.sort()
country = {'name': 'poland' + suffix, 'url': URL + europe_url + 'poland' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + poland_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Badenwuerttemberg:
regions = ['freiburg_regbez', 'karlsruhe_regbez', 'stuttgart_regbez', 'tuebingen_regbez']
available = regions
available.sort()
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + baden_wuerttemberg_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Nordrheinwestfalen:
regions = ['arnsberg_regbez', 'detmold_regbez', 'duesseldorf_regbez', 'koeln_regbez', 'muenster_regbez']
available = regions
available.sort()
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + nordrhein_wesfalen_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Bayern:
regions = ['mittelfranken', 'niederbayern', 'oberbayern', 'oberfranken', 'oberpfalz', 'schwaben', 'unterfranken']
available = regions
available.sort()
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + bayern_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Germany:
regions = ['baden_wuerttemberg', 'bayern', 'berlin', 'brandenburg', 'bremen', 'hamburg', 'hessen', 'mecklenburg_vorpommern', 'niedersachsen', 'nordrhein_westfalen', 'rheinland_pfalz', 'saarland', 'sachsen_anhalt', 'sachsen', 'schleswig_holstein', 'thueringen']
baden_wuerttemberg = baden_wuerttemberg()
bayern = bayern()
nordrhein_westfalen = nordrhein_westfalen()
available = regions + bayern.available + baden_wuerttemberg.available + nordrhein_westfalen.available
available.sort()
country = {'name': 'germany' + suffix, 'url': URL + europe_url + 'germany' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + germany_url + region.replace('_', '-') + suffix} for region in regions}
for region in nordrhein_westfalen.available:
_sources[region] = {'name': region.replace('_', '-') + suffix, 'url': URL + nordrhein_wesfalen_url + region.replace('_', '-') + suffix}
for region in baden_wuerttemberg.available:
_sources[region] = {'name': region.replace('_', '-') + suffix, 'url': URL + baden_wuerttemberg_url + region.replace('_', '-') + suffix}
for region in bayern.available:
_sources[region] = {'name': region.replace('_', '-') + suffix, 'url': URL + bayern_url + region.replace('_', '-') + suffix}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Netherlands:
regions = ['drenthe', 'flevoland', 'friesland', 'gelderland', 'groningen', 'limburg', 'noord_brabant', 'noord_holland', 'overijssel', 'utrecht', 'zeeland', 'zuid_holland']
available = regions
available.sort()
country = {'name': 'netherlands' + suffix, 'url': URL + europe_url + 'netherlands' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + netherlands_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Canada:
regions = ['alberta', 'british_columbia', 'manitoba', 'new_brunswick', 'newfoundland_and_labrador', 'northwest_territories', 'nova_scotia', 'nunavut', 'ontario', 'prince_edward_island', 'quebec', 'saskatchewan', 'yukon']
available = regions
available.sort()
country = {'name': 'canada' + suffix, 'url': URL + north_america_url + 'canada' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + canada_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Brazil:
regions = ['centro_oeste', 'nordeste', 'norte', 'sudeste', 'sul']
available = regions
available.sort()
country = {'name': 'brazil' + suffix, 'url': URL + south_america_url + 'brazil' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + brazil_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Japan:
regions = ['chubu', 'chugoku', 'hokkaido', 'kansai', 'kanto', 'kyushu', 'shikoku', 'tohoku']
available = regions
available.sort()
country = {'name': 'japan' + suffix, 'url': URL + asia_url + 'japan' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + japan_url + region + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Australiaoceania:
regions = ['australia', 'cook_islands', 'fiji', 'kiribati', 'marshall_islands', 'micronesia', 'nauru', 'new_caledonia', 'new_zealand', 'niue', 'palau', 'papua_new_guinea', 'samoa', 'solomon_islands', 'tonga', 'tuvalu', 'vanuatu']
available = regions
available.sort()
continent = {'name': 'australia-oceania' + suffix, 'url': URL + 'australia-oceania' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + australia_oceania_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Northamerica:
regions = ['canada', 'greenland', 'mexico', 'usa', 'us_midwest', 'us_northeast', 'us_pacific', 'us_south', 'us_west']
usa = usa()
canada = canada()
available = regions
available.sort()
continent = {'name': 'north-america' + suffix, 'url': URL + 'north-america' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + north_america_url + region.replace('_', '-') + suffix} for region in regions if region != 'usa'}
_sources['usa'] = {'name': 'us' + suffix, 'url': URL + north_america_url + 'us' + suffix}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Southamerica:
regions = ['argentina', 'bolivia', 'brazil', 'chile', 'colombia', 'ecuador', 'paraguay', 'peru', 'suriname', 'uruguay', 'venezuela']
brazil = brazil()
available = regions
available.sort()
available.sort()
continent = {'name': 'south-america' + suffix, 'url': URL + 'south-america' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + south_america_url + region + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Centralamerica:
regions = ['bahamas', 'belize', 'cuba', 'guatemala', 'haiti_and_domrep', 'jamaica', 'nicaragua']
available = regions
available.sort()
continent = {'name': 'central-america' + suffix, 'url': URL + 'central-america' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + central_america_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Europe:
france = france()
great_britain = great_britain()
italy = italy()
russia = russia()
poland = poland()
germany = germany()
netherlands = netherlands()
regions = ['albania', 'andorra', 'austria', 'azores', 'belarus', 'belgium', 'bosnia_herzegovina', 'bulgaria', 'croatia', 'cyprus', 'czech_republic', 'denmark', 'estonia', 'faroe_islands', 'finland', 'france', 'georgia', 'germany', 'great_britain', 'greece', 'hungary', 'iceland', 'ireland_and_northern_ireland', 'isle_of_man', 'italy', 'kosovo', 'latvia', 'liechtenstein', 'lithuania', 'luxembourg', 'macedonia', 'malta', 'moldova', 'monaco', 'montenegro', 'netherlands', 'norway', 'poland', 'portugal', 'romania', 'russia', 'serbia', 'slovakia', 'slovenia', 'spain', 'sweden', 'switzerland', 'turkey', 'ukraine']
available = regions
available.sort()
continent = {'name': 'europe' + suffix, 'url': URL + 'europe' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + europe_url + region.replace('_', '-') + suffix} for region in regions if region != 'russia'}
_sources['russia'] = {'name': 'russia' + suffix, 'url': URL + 'russia' + suffix}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Africa:
regions = ['algeria', 'angola', 'benin', 'botswana', 'burkina_faso', 'burundi', 'cameroon', 'canary_islands', 'cape_verde', 'central_african_republic', 'chad', 'comores', 'congo_brazzaville', 'congo_democratic_republic', 'djibouti', 'egypt', 'equatorial_guinea', 'eritrea', 'ethiopia', 'gabon', 'ghana', 'guinea_bissau', 'guinea', 'ivory_coast', 'kenya', 'lesotho', 'liberia', 'libya', 'madagascar', 'malawi', 'mali', 'mauritania', 'mauritius', 'morocco', 'mozambique', 'namibia', 'niger', 'nigeria', 'rwanda', 'saint_helena_ascension_and_tristan_da_cunha', 'sao_tome_and_principe', 'senegal_and_gambia', 'seychelles', 'sierra_leone', 'somalia', 'south_africa_and_lesotho', 'south_africa', 'south_sudan', 'sudan', 'swaziland', 'tanzania', 'togo', 'tunisia', 'uganda', 'zambia', 'zimbabwe']
available = regions
available.sort()
continent = {'name': 'africa' + suffix, 'url': URL + 'africa' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + africa_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Asia:
regions = ['afghanistan', 'armenia', 'azerbaijan', 'bangladesh', 'bhutan', 'cambodia', 'china', 'gcc_states', 'india', 'indonesia', 'iran', 'iraq', 'israel_and_palestine', 'japan', 'jordan', 'kazakhstan', 'kyrgyzstan', 'laos', 'lebanon', 'malaysia_singapore_brunei', 'maldives', 'mongolia', 'myanmar', 'nepal', 'north_korea', 'pakistan', 'philippines', 'south_korea', 'sri_lanka', 'syria', 'taiwan', 'tajikistan', 'thailand', 'turkmenistan', 'uzbekistan', 'vietnam', 'yemen']
japan = japan()
available = regions
available.sort()
continent = {'name': 'asia' + suffix, 'url': URL + 'asia' + suffix}
_sources = {region: {'name': region.replace('_', '-') + suffix, 'url': URL + asia_url + region.replace('_', '-') + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Antarctica:
regions = ['antarctica']
available = regions
available.sort()
continent = {'name': 'antarctica' + suffix, 'url': URL + 'antarctica' + suffix}
_sources = {region: {'name': region + suffix, 'url': URL + region + suffix} for region in regions}
__dict__ = _sources
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available
class Subregions:
def __init__(self):
self.regions = ['brazil', 'canada', 'france', 'germany', 'great_britain', 'italy', 'japan', 'netherlands', 'poland', 'russia', 'usa']
available = self.regions
available.sort()
self.brazil = brazil()
self.canada = canada()
self.france = france()
self.germany = germany()
self.great_britain = great_britain()
self.italy = italy()
self.japan = japan()
self.netherlands = netherlands()
self.poland = poland()
self.russia = russia()
self.usa = usa()
self.available = {name: self.__dict__[name].available for name in self.regions}
def __getattr__(self, name):
return self.__dict__[name]
def __call__(self):
return self.available |
t=int(input())
for sss in range(t):
sum=0
n,k=map(int,input().split())
a=[0]*(n+1)
for i in range(1,n+1):
if k==0 or k==n:
break
if (sum+1<=i+1 and k>0):
a[i]=i
sum+=i
i+=1
k-=1
continue
if sum>i:
a[i]=-i
sum-=i
i+=1
if sum>0:
k-=1
continue
if sum+1>i+1 and k==1:
a[i]=-i
i+=1
if sum-i>0:
break
else:
sum-=i
continue
if sum+i>i+1 and k>1:
a[i]=i
if sum>0:
k-=1
sum+=i
i+=1
if k==n:
for i in range(1,n+1):
a[i]=i
elif i<=n:
for i in range(i,n+1):
a[i]=-i
a=list(map(str,a))
a.pop(0)
print(' '.join(a))
| t = int(input())
for sss in range(t):
sum = 0
(n, k) = map(int, input().split())
a = [0] * (n + 1)
for i in range(1, n + 1):
if k == 0 or k == n:
break
if sum + 1 <= i + 1 and k > 0:
a[i] = i
sum += i
i += 1
k -= 1
continue
if sum > i:
a[i] = -i
sum -= i
i += 1
if sum > 0:
k -= 1
continue
if sum + 1 > i + 1 and k == 1:
a[i] = -i
i += 1
if sum - i > 0:
break
else:
sum -= i
continue
if sum + i > i + 1 and k > 1:
a[i] = i
if sum > 0:
k -= 1
sum += i
i += 1
if k == n:
for i in range(1, n + 1):
a[i] = i
elif i <= n:
for i in range(i, n + 1):
a[i] = -i
a = list(map(str, a))
a.pop(0)
print(' '.join(a)) |
#!/usr/bin/env python
# md5: 30abdfb918f7a6b87bd580600c506058
# coding: utf-8
databasename = 'ml-004_clickstream_video.sqlite'
def getDatabaseName():
return databasename
| databasename = 'ml-004_clickstream_video.sqlite'
def get_database_name():
return databasename |
class Proxy(object):
response_type = "proxy"
def __init__(self, url, client_certificate=None, client_key=None):
self.url = url
self.certificate = client_certificate
self.key = client_key
def as_dict(self):
proxy = {
'to': self.url
}
if self.certificate:
proxy['cert'] = self.certificate
if self.key:
proxy['key'] = self.key
result = {
self.response_type: proxy
}
return result
| class Proxy(object):
response_type = 'proxy'
def __init__(self, url, client_certificate=None, client_key=None):
self.url = url
self.certificate = client_certificate
self.key = client_key
def as_dict(self):
proxy = {'to': self.url}
if self.certificate:
proxy['cert'] = self.certificate
if self.key:
proxy['key'] = self.key
result = {self.response_type: proxy}
return result |
'''Defines the `JavaCompilationInfo` provider.
'''
JavaCompilationInfo = provider(
doc = "Describes the inputs, outputs, and options of a Java compiler invocation for a particular Java target.",
fields = {
"srcs": "A depset of the Java source `File`s directly included in a Java target. (This does not include either generated or transitive Java sources). This may be `None`. (E.g., a `java_import` target may not have any source files.).",
"srcs_args_file": "A `File` listing the Java source files in the `srcs` field. Each line of this `File` is the `File.path` of one of the `srcs` `File`s. These lines are in no particular order. (This field exists so the various lint aspects don't need to re-create a list of a target's Java sources. They can just use this file generated by the original Java target.)",
"class_path_jars": "A depset of JAR `File`s to be included on the class-path during this compilation.",
"class_files_output_jar": "A `File` pointing to the JAR of class files generated by this Java compilation action.",
"main_class": "Either a `string` or `None`. If non-null, this string is used as the output JAR's `Main-Class` manifest attribute.",
"additional_jar_manifest_attributes": "A list of strings to be included in the manifest of the generated JAR.",
"java_compiler_toolchain_info": "The `JavaCompilerToolchainInfo` which should be used to compile this Java target.",
"resources": "A dict from a `File` to be included in the output JAR to its in-JAR path.",
"javac_flags": "A list of strings to be included in the `javac` invocation."
# TODO(dwtj): Consider supporting compiler plugins
# TODO(dwtj): Consider supporting "generated_sources_output_jar".
# TODO(dwtj): Consider supporting "native_headers_archive" (i.e. `javac -h <directory>).
# TODO(dwtj): Consider supporting Java source code version checks.
},
)
| """Defines the `JavaCompilationInfo` provider.
"""
java_compilation_info = provider(doc='Describes the inputs, outputs, and options of a Java compiler invocation for a particular Java target.', fields={'srcs': 'A depset of the Java source `File`s directly included in a Java target. (This does not include either generated or transitive Java sources). This may be `None`. (E.g., a `java_import` target may not have any source files.).', 'srcs_args_file': "A `File` listing the Java source files in the `srcs` field. Each line of this `File` is the `File.path` of one of the `srcs` `File`s. These lines are in no particular order. (This field exists so the various lint aspects don't need to re-create a list of a target's Java sources. They can just use this file generated by the original Java target.)", 'class_path_jars': 'A depset of JAR `File`s to be included on the class-path during this compilation.', 'class_files_output_jar': 'A `File` pointing to the JAR of class files generated by this Java compilation action.', 'main_class': "Either a `string` or `None`. If non-null, this string is used as the output JAR's `Main-Class` manifest attribute.", 'additional_jar_manifest_attributes': 'A list of strings to be included in the manifest of the generated JAR.', 'java_compiler_toolchain_info': 'The `JavaCompilerToolchainInfo` which should be used to compile this Java target.', 'resources': 'A dict from a `File` to be included in the output JAR to its in-JAR path.', 'javac_flags': 'A list of strings to be included in the `javac` invocation.'}) |
def agent_settings(arglist, agent_name):
if agent_name[-1] == "1": return arglist.model1
elif agent_name[-1] == "2": return arglist.model2
elif agent_name[-1] == "3": return arglist.model3
elif agent_name[-1] == "4": return arglist.model4
else: raise ValueError("Agent name doesn't follow the right naming, `agent-<int>`")
| def agent_settings(arglist, agent_name):
if agent_name[-1] == '1':
return arglist.model1
elif agent_name[-1] == '2':
return arglist.model2
elif agent_name[-1] == '3':
return arglist.model3
elif agent_name[-1] == '4':
return arglist.model4
else:
raise value_error("Agent name doesn't follow the right naming, `agent-<int>`") |
# cp857_7x7.py - CP857 7x7 font file for Python
#
# Copyright (c) 2019-2022 Ercan Ersoy
# This file is written by Ercan Ersoy.
# This file is licensed under CC0-1.0 Universal License.
cp857_7x7 = [
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00,
0x14, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x14,
0x04, 0x2A, 0x2A, 0x7F, 0x2A, 0x2A, 0x10,
0x43, 0x23, 0x10, 0x08, 0x04, 0x62, 0x61,
0x30, 0x4A, 0x45, 0x2A, 0x10, 0x28, 0x40,
0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3E, 0x41, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x41, 0x3E, 0x00, 0x00,
0x00, 0x00, 0x0A, 0x07, 0x0A, 0x00, 0x00,
0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00,
0x00, 0x00, 0x40, 0x30, 0x00, 0x00, 0x00,
0x00, 0x00, 0x08, 0x08, 0x08, 0x00, 0x00,
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x40, 0x30, 0x08, 0x06, 0x01, 0x00,
0x3E, 0x61, 0x51, 0x49, 0x45, 0x43, 0x3E,
0x00, 0x44, 0x42, 0x7F, 0x40, 0x40, 0x00,
0x42, 0x61, 0x51, 0x49, 0x49, 0x45, 0x42,
0x22, 0x41, 0x49, 0x49, 0x49, 0x49, 0x36,
0x18, 0x14, 0x12, 0x7F, 0x10, 0x10, 0x00,
0x4F, 0x49, 0x49, 0x49, 0x49, 0x49, 0x31,
0x3E, 0x49, 0x49, 0x49, 0x49, 0x49, 0x32,
0x41, 0x21, 0x11, 0x09, 0x05, 0x03, 0x00,
0x36, 0x49, 0x49, 0x49, 0x49, 0x49, 0x36,
0x26, 0x49, 0x49, 0x49, 0x49, 0x49, 0x3E,
0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
0x00, 0x00, 0x40, 0x34, 0x00, 0x00, 0x00,
0x08, 0x14, 0x14, 0x22, 0x22, 0x41, 0x41,
0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
0x41, 0x41, 0x22, 0x22, 0x14, 0x14, 0x08,
0x02, 0x01, 0x01, 0x51, 0x09, 0x09, 0x06,
0x3E, 0x41, 0x49, 0x55, 0x5D, 0x51, 0x0E,
0x7E, 0x09, 0x09, 0x09, 0x09, 0x09, 0x7E,
0x7F, 0x49, 0x49, 0x49, 0x49, 0x49, 0x36,
0x3E, 0x41, 0x41, 0x41, 0x41, 0x41, 0x22,
0x7F, 0x41, 0x41, 0x41, 0x41, 0x22, 0x1C,
0x7F, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49,
0x7F, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
0x3E, 0x41, 0x41, 0x49, 0x49, 0x49, 0x32,
0x7F, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7F,
0x00, 0x41, 0x41, 0x7F, 0x41, 0x41, 0x00,
0x00, 0x00, 0x20, 0x40, 0x3F, 0x00, 0x00,
0x7F, 0x08, 0x14, 0x14, 0x22, 0x22, 0x41,
0x7F, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x7F, 0x02, 0x04, 0x08, 0x04, 0x02, 0x7F,
0x7F, 0x02, 0x04, 0x08, 0x10, 0x20, 0x7F,
0x3E, 0x41, 0x41, 0x41, 0x41, 0x41, 0x3E,
0x7F, 0x09, 0x09, 0x09, 0x09, 0x09, 0x06,
0x1E, 0x21, 0x21, 0x29, 0x31, 0x3E, 0x40,
0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x00,
0x26, 0x49, 0x49, 0x49, 0x49, 0x49, 0x32,
0x01, 0x01, 0x01, 0x7F, 0x01, 0x01, 0x01,
0x3F, 0x40, 0x40, 0x40, 0x40, 0x40, 0x3F,
0x03, 0x0C, 0x30, 0x40, 0x30, 0x0C, 0x03,
0x3F, 0x40, 0x40, 0x3F, 0x40, 0x40, 0x3F,
0x41, 0x22, 0x14, 0x08, 0x14, 0x22, 0x41,
0x01, 0x02, 0x04, 0x78, 0x04, 0x02, 0x01,
0x41, 0x61, 0x51, 0x49, 0x45, 0x43, 0x41,
0x00, 0x00, 0x7F, 0x41, 0x00, 0x00, 0x00,
0x00, 0x01, 0x06, 0x08, 0x30, 0x40, 0x00,
0x00, 0x00, 0x00, 0x41, 0x7F, 0x00, 0x00,
0x00, 0x00, 0x02, 0x01, 0x02, 0x00, 0x00,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x00, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00,
0x00, 0x20, 0x54, 0x54, 0x54, 0x78, 0x00,
0x00, 0x7F, 0x48, 0x48, 0x30, 0x00, 0x00,
0x00, 0x30, 0x48, 0x48, 0x48, 0x00, 0x00,
0x00, 0x30, 0x48, 0x48, 0x7F, 0x00, 0x00,
0x00, 0x38, 0x54, 0x54, 0x54, 0x08, 0x00,
0x00, 0x08, 0x7C, 0x0A, 0x02, 0x00, 0x00,
0x00, 0x24, 0x4A, 0x4A, 0x3E, 0x00, 0x00,
0x00, 0x7F, 0x08, 0x08, 0x70, 0x00, 0x00,
0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00,
0x00, 0x00, 0x20, 0x40, 0x3A, 0x00, 0x00,
0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3F, 0x40, 0x00, 0x00,
0x70, 0x08, 0x08, 0x70, 0x08, 0x08, 0x70,
0x00, 0x78, 0x08, 0x08, 0x70, 0x00, 0x00,
0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00,
0x00, 0x7C, 0x12, 0x12, 0x0C, 0x00, 0x00,
0x00, 0x0C, 0x12, 0x12, 0x7C, 0x00, 0x00,
0x00, 0x00, 0x70, 0x08, 0x08, 0x00, 0x00,
0x00, 0x48, 0x54, 0x54, 0x24, 0x00, 0x00,
0x00, 0x00, 0x08, 0x3E, 0x48, 0x00, 0x00,
0x00, 0x38, 0x40, 0x40, 0x78, 0x00, 0x00,
0x00, 0x18, 0x20, 0x40, 0x20, 0x18, 0x00,
0x38, 0x40, 0x40, 0x38, 0x40, 0x40, 0x38,
0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00,
0x00, 0x06, 0x48, 0x48, 0x48, 0x3E, 0x00,
0x00, 0x48, 0x68, 0x58, 0x48, 0x00, 0x00,
0x00, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00,
0x00, 0x00, 0x41, 0x36, 0x08, 0x00, 0x00,
0x08, 0x04, 0x04, 0x08, 0x08, 0x04, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0E, 0x11, 0x11, 0x51, 0x11, 0x11, 0x0A,
0x00, 0x3A, 0x40, 0x40, 0x7A, 0x00, 0x00,
0x00, 0x38, 0x54, 0x56, 0x55, 0x08, 0x00,
0x00, 0x20, 0x56, 0x55, 0x56, 0x78, 0x00,
0x00, 0x20, 0x55, 0x54, 0x55, 0x78, 0x00,
0x00, 0x20, 0x55, 0x56, 0x54, 0x78, 0x00,
0x00, 0x20, 0x54, 0x55, 0x54, 0x78, 0x00,
0x00, 0x0C, 0x12, 0x52, 0x12, 0x00, 0x00,
0x00, 0x38, 0x56, 0x55, 0x56, 0x08, 0x00,
0x00, 0x38, 0x55, 0x54, 0x55, 0x08, 0x00,
0x00, 0x38, 0x55, 0x56, 0x54, 0x08, 0x00,
0x00, 0x00, 0x02, 0x78, 0x02, 0x00, 0x00,
0x00, 0x00, 0x04, 0x72, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00,
0x78, 0x14, 0x15, 0x14, 0x15, 0x14, 0x78,
0x78, 0x14, 0x14, 0x15, 0x14, 0x14, 0x78,
0x7C, 0x54, 0x54, 0x56, 0x55, 0x54, 0x54,
0x20, 0x54, 0x54, 0x78, 0x38, 0x54, 0x4C,
0x7E, 0x09, 0x09, 0x7F, 0x49, 0x49, 0x49,
0x00, 0x38, 0x46, 0x45, 0x46, 0x38, 0x00,
0x00, 0x38, 0x45, 0x44, 0x45, 0x38, 0x00,
0x00, 0x38, 0x45, 0x46, 0x44, 0x38, 0x00,
0x00, 0x3A, 0x41, 0x41, 0x7A, 0x00, 0x00,
0x00, 0x38, 0x41, 0x42, 0x78, 0x00, 0x00,
0x00, 0x44, 0x44, 0x7D, 0x44, 0x44, 0x00,
0x38, 0x44, 0x45, 0x44, 0x45, 0x44, 0x38,
0x3D, 0x40, 0x40, 0x40, 0x40, 0x40, 0x3D,
0x40, 0x3C, 0x32, 0x2A, 0x26, 0x1E, 0x01,
0x44, 0x7E, 0x45, 0x41, 0x41, 0x22, 0x00,
0x3E, 0x51, 0x51, 0x49, 0x45, 0x45, 0x3E,
0x12, 0x15, 0x15, 0x55, 0x15, 0x15, 0x08,
0x00, 0x02, 0x15, 0x55, 0x15, 0x08, 0x00,
0x00, 0x20, 0x54, 0x56, 0x55, 0x78, 0x00,
0x00, 0x00, 0x00, 0x7A, 0x01, 0x00, 0x00,
0x00, 0x38, 0x44, 0x46, 0x45, 0x38, 0x00,
0x00, 0x38, 0x42, 0x41, 0x78, 0x00, 0x00,
0x00, 0x7A, 0x09, 0x0A, 0x71, 0x00, 0x00,
0x7E, 0x05, 0x09, 0x12, 0x22, 0x7D, 0x00,
0x39, 0x46, 0x56, 0x56, 0x56, 0x65, 0x00,
0x00, 0x08, 0x55, 0x56, 0x3D, 0x00, 0x00,
0x30, 0x48, 0x48, 0x45, 0x40, 0x40, 0x20,
0x3E, 0x41, 0x7D, 0x55, 0x6D, 0x41, 0x3E,
0x00, 0x04, 0x04, 0x04, 0x04, 0x1C, 0x00,
0x4A, 0x2F, 0x18, 0x08, 0x4C, 0x6A, 0x51,
0x4A, 0x2F, 0x18, 0x28, 0x34, 0x7A, 0x21,
0x00, 0x00, 0x00, 0x7D, 0x00, 0x00, 0x00,
0x00, 0x08, 0x14, 0x00, 0x08, 0x14, 0x00,
0x00, 0x14, 0x08, 0x00, 0x14, 0x08, 0x00,
0x55, 0x00, 0x55, 0x00, 0x55, 0x00, 0x55,
0x2A, 0x55, 0x2A, 0x55, 0x2A, 0x55, 0x2A,
0x2A, 0x7F, 0x2A, 0x7F, 0x2A, 0x7F, 0x2A,
0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00,
0x08, 0x08, 0x08, 0x7F, 0x00, 0x00, 0x00,
0x78, 0x16, 0x15, 0x14, 0x14, 0x14, 0x78,
0x78, 0x16, 0x15, 0x15, 0x15, 0x16, 0x78,
0x78, 0x14, 0x14, 0x14, 0x15, 0x16, 0x78,
0x3E, 0x41, 0x49, 0x55, 0x55, 0x41, 0x3E,
0x14, 0x14, 0x77, 0x00, 0x7F, 0x00, 0x00,
0x00, 0x00, 0x7F, 0x00, 0x7F, 0x00, 0x00,
0x14, 0x14, 0x74, 0x04, 0x7C, 0x00, 0x00,
0x14, 0x14, 0x17, 0x10, 0x1F, 0x00, 0x00,
0x00, 0x0C, 0x12, 0x33, 0x12, 0x00, 0x00,
0x00, 0x01, 0x2A, 0x7C, 0x2A, 0x01, 0x00,
0x08, 0x08, 0x08, 0x78, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0x08, 0x08, 0x08,
0x08, 0x08, 0x08, 0x0F, 0x08, 0x08, 0x08,
0x08, 0x08, 0x08, 0x78, 0x08, 0x08, 0x08,
0x00, 0x00, 0x00, 0x7F, 0x08, 0x08, 0x08,
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
0x08, 0x08, 0x08, 0x7F, 0x08, 0x08, 0x08,
0x00, 0x20, 0x56, 0x55, 0x56, 0x79, 0x00,
0x7A, 0x15, 0x15, 0x16, 0x16, 0x15, 0x78,
0x00, 0x00, 0x1F, 0x10, 0x17, 0x14, 0x14,
0x00, 0x00, 0x7E, 0x02, 0x7A, 0x0A, 0x0A,
0x14, 0x14, 0x17, 0x10, 0x17, 0x14, 0x14,
0x14, 0x14, 0x74, 0x04, 0x74, 0x14, 0x14,
0x00, 0x00, 0x7F, 0x00, 0x77, 0x14, 0x14,
0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
0x14, 0x14, 0x77, 0x00, 0x77, 0x14, 0x14,
0x41, 0x3E, 0x22, 0x22, 0x22, 0x3E, 0x41,
0x00, 0x12, 0x15, 0x12, 0x00, 0x00, 0x00,
0x00, 0x12, 0x15, 0x17, 0x00, 0x00, 0x00,
0x7C, 0x56, 0x55, 0x55, 0x55, 0x56, 0x54,
0x7C, 0x54, 0x55, 0x54, 0x55, 0x54, 0x54,
0x7C, 0x54, 0x55, 0x56, 0x54, 0x54, 0x54,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x48, 0x7A, 0x49, 0x00, 0x00,
0x00, 0x00, 0x4A, 0x79, 0x4A, 0x00, 0x00,
0x00, 0x00, 0x4A, 0x78, 0x4A, 0x00, 0x00,
0x08, 0x08, 0x08, 0x0F, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x78, 0x08, 0x08, 0x08,
0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F,
0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78,
0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00,
0x00, 0x00, 0x49, 0x7A, 0x48, 0x00, 0x00,
0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
0x38, 0x44, 0x44, 0x46, 0x45, 0x44, 0x38,
0x7E, 0x01, 0x09, 0x49, 0x49, 0x49, 0x36,
0x38, 0x44, 0x46, 0x45, 0x46, 0x44, 0x38,
0x38, 0x44, 0x45, 0x46, 0x44, 0x44, 0x38,
0x00, 0x3A, 0x45, 0x46, 0x45, 0x38, 0x00,
0x3A, 0x45, 0x45, 0x46, 0x46, 0x45, 0x38,
0x00, 0x7C, 0x20, 0x20, 0x1C, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x22, 0x14, 0x08, 0x14, 0x22, 0x00,
0x3C, 0x40, 0x40, 0x42, 0x41, 0x40, 0x3C,
0x3C, 0x40, 0x42, 0x41, 0x42, 0x40, 0x3C,
0x3C, 0x40, 0x41, 0x42, 0x40, 0x40, 0x3C,
0x00, 0x00, 0x01, 0x7A, 0x00, 0x00, 0x00,
0x00, 0x0D, 0x50, 0x50, 0x50, 0x3D, 0x00,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00,
0x00, 0x00, 0x24, 0x2E, 0x24, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x55, 0x35, 0x1A, 0x28, 0x34, 0x7A, 0x21,
0x02, 0x05, 0x7F, 0x01, 0x7F, 0x00, 0x00,
0x0A, 0x55, 0x55, 0x55, 0x55, 0x55, 0x28,
0x00, 0x08, 0x08, 0x2A, 0x08, 0x08, 0x00,
0x00, 0x00, 0x40, 0x50, 0x20, 0x00, 0x00,
0x00, 0x00, 0x02, 0x05, 0x02, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x12, 0x1F, 0x10, 0x00, 0x00,
0x00, 0x00, 0x15, 0x15, 0x0E, 0x00, 0x00,
0x00, 0x00, 0x12, 0x19, 0x16, 0x00, 0x00,
0x00, 0x00, 0x1C, 0x1C, 0x1C, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
];
| cp857_7x7 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 20, 20, 127, 20, 127, 20, 20, 4, 42, 42, 127, 42, 42, 16, 67, 35, 16, 8, 4, 98, 97, 48, 74, 69, 42, 16, 40, 64, 0, 0, 4, 3, 0, 0, 0, 0, 0, 62, 65, 0, 0, 0, 0, 0, 0, 65, 62, 0, 0, 0, 0, 10, 7, 10, 0, 0, 0, 8, 8, 62, 8, 8, 0, 0, 0, 64, 48, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 64, 48, 8, 6, 1, 0, 62, 97, 81, 73, 69, 67, 62, 0, 68, 66, 127, 64, 64, 0, 66, 97, 81, 73, 73, 69, 66, 34, 65, 73, 73, 73, 73, 54, 24, 20, 18, 127, 16, 16, 0, 79, 73, 73, 73, 73, 73, 49, 62, 73, 73, 73, 73, 73, 50, 65, 33, 17, 9, 5, 3, 0, 54, 73, 73, 73, 73, 73, 54, 38, 73, 73, 73, 73, 73, 62, 0, 0, 0, 20, 0, 0, 0, 0, 0, 64, 52, 0, 0, 0, 8, 20, 20, 34, 34, 65, 65, 20, 20, 20, 20, 20, 20, 20, 65, 65, 34, 34, 20, 20, 8, 2, 1, 1, 81, 9, 9, 6, 62, 65, 73, 85, 93, 81, 14, 126, 9, 9, 9, 9, 9, 126, 127, 73, 73, 73, 73, 73, 54, 62, 65, 65, 65, 65, 65, 34, 127, 65, 65, 65, 65, 34, 28, 127, 73, 73, 73, 73, 73, 73, 127, 9, 9, 9, 9, 9, 9, 62, 65, 65, 73, 73, 73, 50, 127, 8, 8, 8, 8, 8, 127, 0, 65, 65, 127, 65, 65, 0, 0, 0, 32, 64, 63, 0, 0, 127, 8, 20, 20, 34, 34, 65, 127, 64, 64, 64, 64, 64, 64, 127, 2, 4, 8, 4, 2, 127, 127, 2, 4, 8, 16, 32, 127, 62, 65, 65, 65, 65, 65, 62, 127, 9, 9, 9, 9, 9, 6, 30, 33, 33, 41, 49, 62, 64, 127, 9, 25, 41, 70, 0, 0, 38, 73, 73, 73, 73, 73, 50, 1, 1, 1, 127, 1, 1, 1, 63, 64, 64, 64, 64, 64, 63, 3, 12, 48, 64, 48, 12, 3, 63, 64, 64, 63, 64, 64, 63, 65, 34, 20, 8, 20, 34, 65, 1, 2, 4, 120, 4, 2, 1, 65, 97, 81, 73, 69, 67, 65, 0, 0, 127, 65, 0, 0, 0, 0, 1, 6, 8, 48, 64, 0, 0, 0, 0, 65, 127, 0, 0, 0, 0, 2, 1, 2, 0, 0, 64, 64, 64, 64, 64, 64, 64, 0, 0, 0, 3, 4, 0, 0, 0, 32, 84, 84, 84, 120, 0, 0, 127, 72, 72, 48, 0, 0, 0, 48, 72, 72, 72, 0, 0, 0, 48, 72, 72, 127, 0, 0, 0, 56, 84, 84, 84, 8, 0, 0, 8, 124, 10, 2, 0, 0, 0, 36, 74, 74, 62, 0, 0, 0, 127, 8, 8, 112, 0, 0, 0, 0, 0, 116, 0, 0, 0, 0, 0, 32, 64, 58, 0, 0, 0, 127, 16, 40, 68, 0, 0, 0, 0, 0, 63, 64, 0, 0, 112, 8, 8, 112, 8, 8, 112, 0, 120, 8, 8, 112, 0, 0, 0, 56, 68, 68, 68, 56, 0, 0, 124, 18, 18, 12, 0, 0, 0, 12, 18, 18, 124, 0, 0, 0, 0, 112, 8, 8, 0, 0, 0, 72, 84, 84, 36, 0, 0, 0, 0, 8, 62, 72, 0, 0, 0, 56, 64, 64, 120, 0, 0, 0, 24, 32, 64, 32, 24, 0, 56, 64, 64, 56, 64, 64, 56, 0, 68, 40, 16, 40, 68, 0, 0, 6, 72, 72, 72, 62, 0, 0, 72, 104, 88, 72, 0, 0, 0, 0, 8, 54, 65, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 65, 54, 8, 0, 0, 8, 4, 4, 8, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 14, 17, 17, 81, 17, 17, 10, 0, 58, 64, 64, 122, 0, 0, 0, 56, 84, 86, 85, 8, 0, 0, 32, 86, 85, 86, 120, 0, 0, 32, 85, 84, 85, 120, 0, 0, 32, 85, 86, 84, 120, 0, 0, 32, 84, 85, 84, 120, 0, 0, 12, 18, 82, 18, 0, 0, 0, 56, 86, 85, 86, 8, 0, 0, 56, 85, 84, 85, 8, 0, 0, 56, 85, 86, 84, 8, 0, 0, 0, 2, 120, 2, 0, 0, 0, 0, 4, 114, 4, 0, 0, 0, 0, 0, 112, 0, 0, 0, 120, 20, 21, 20, 21, 20, 120, 120, 20, 20, 21, 20, 20, 120, 124, 84, 84, 86, 85, 84, 84, 32, 84, 84, 120, 56, 84, 76, 126, 9, 9, 127, 73, 73, 73, 0, 56, 70, 69, 70, 56, 0, 0, 56, 69, 68, 69, 56, 0, 0, 56, 69, 70, 68, 56, 0, 0, 58, 65, 65, 122, 0, 0, 0, 56, 65, 66, 120, 0, 0, 0, 68, 68, 125, 68, 68, 0, 56, 68, 69, 68, 69, 68, 56, 61, 64, 64, 64, 64, 64, 61, 64, 60, 50, 42, 38, 30, 1, 68, 126, 69, 65, 65, 34, 0, 62, 81, 81, 73, 69, 69, 62, 18, 21, 21, 85, 21, 21, 8, 0, 2, 21, 85, 21, 8, 0, 0, 32, 84, 86, 85, 120, 0, 0, 0, 0, 122, 1, 0, 0, 0, 56, 68, 70, 69, 56, 0, 0, 56, 66, 65, 120, 0, 0, 0, 122, 9, 10, 113, 0, 0, 126, 5, 9, 18, 34, 125, 0, 57, 70, 86, 86, 86, 101, 0, 0, 8, 85, 86, 61, 0, 0, 48, 72, 72, 69, 64, 64, 32, 62, 65, 125, 85, 109, 65, 62, 0, 4, 4, 4, 4, 28, 0, 74, 47, 24, 8, 76, 106, 81, 74, 47, 24, 40, 52, 122, 33, 0, 0, 0, 125, 0, 0, 0, 0, 8, 20, 0, 8, 20, 0, 0, 20, 8, 0, 20, 8, 0, 85, 0, 85, 0, 85, 0, 85, 42, 85, 42, 85, 42, 85, 42, 42, 127, 42, 127, 42, 127, 42, 0, 0, 0, 127, 0, 0, 0, 8, 8, 8, 127, 0, 0, 0, 120, 22, 21, 20, 20, 20, 120, 120, 22, 21, 21, 21, 22, 120, 120, 20, 20, 20, 21, 22, 120, 62, 65, 73, 85, 85, 65, 62, 20, 20, 119, 0, 127, 0, 0, 0, 0, 127, 0, 127, 0, 0, 20, 20, 116, 4, 124, 0, 0, 20, 20, 23, 16, 31, 0, 0, 0, 12, 18, 51, 18, 0, 0, 0, 1, 42, 124, 42, 1, 0, 8, 8, 8, 120, 0, 0, 0, 0, 0, 0, 15, 8, 8, 8, 8, 8, 8, 15, 8, 8, 8, 8, 8, 8, 120, 8, 8, 8, 0, 0, 0, 127, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 127, 8, 8, 8, 0, 32, 86, 85, 86, 121, 0, 122, 21, 21, 22, 22, 21, 120, 0, 0, 31, 16, 23, 20, 20, 0, 0, 126, 2, 122, 10, 10, 20, 20, 23, 16, 23, 20, 20, 20, 20, 116, 4, 116, 20, 20, 0, 0, 127, 0, 119, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 119, 0, 119, 20, 20, 65, 62, 34, 34, 34, 62, 65, 0, 18, 21, 18, 0, 0, 0, 0, 18, 21, 23, 0, 0, 0, 124, 86, 85, 85, 85, 86, 84, 124, 84, 85, 84, 85, 84, 84, 124, 84, 85, 86, 84, 84, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 122, 73, 0, 0, 0, 0, 74, 121, 74, 0, 0, 0, 0, 74, 120, 74, 0, 0, 8, 8, 8, 15, 0, 0, 0, 0, 0, 0, 120, 8, 8, 8, 127, 127, 127, 127, 127, 127, 127, 120, 120, 120, 120, 120, 120, 120, 0, 0, 0, 119, 0, 0, 0, 0, 0, 73, 122, 72, 0, 0, 7, 7, 7, 7, 7, 7, 7, 56, 68, 68, 70, 69, 68, 56, 126, 1, 9, 73, 73, 73, 54, 56, 68, 70, 69, 70, 68, 56, 56, 68, 69, 70, 68, 68, 56, 0, 58, 69, 70, 69, 56, 0, 58, 69, 69, 70, 70, 69, 56, 0, 124, 32, 32, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 20, 8, 20, 34, 0, 60, 64, 64, 66, 65, 64, 60, 60, 64, 66, 65, 66, 64, 60, 60, 64, 65, 66, 64, 64, 60, 0, 0, 1, 122, 0, 0, 0, 0, 13, 80, 80, 80, 61, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 2, 1, 0, 0, 0, 8, 8, 8, 8, 8, 0, 0, 0, 36, 46, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 53, 26, 40, 52, 122, 33, 2, 5, 127, 1, 127, 0, 0, 10, 85, 85, 85, 85, 85, 40, 0, 8, 8, 42, 8, 8, 0, 0, 0, 64, 80, 32, 0, 0, 0, 0, 2, 5, 2, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 18, 31, 16, 0, 0, 0, 0, 21, 21, 14, 0, 0, 0, 0, 18, 25, 22, 0, 0, 0, 0, 28, 28, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0] |
config = {
'bot': {
'username': "", # Robinhood credentials. If you don't want to keep them stored here, launch "./2fa.py" to setup the access token interactively
'password': "",
'trades_enabled': False, # if False, just collect data
'simulate_api_calls': False, # if enabled, just pretend to connect to Robinhood
'data_source': 'robinhood', # which platform to use to track prices: kraken or robinhood
'minutes_between_updates': 5, # 1, 5, 15, 30, 60, 240, 1440, 10080, 21600
'cancel_pending_after_minutes': 20, # how long to wait before cancelling an order that hasn't been filled
'save_charts': True,
'max_data_rows': 2000
},
'ticker_list': { # list of coin ticker pairs Kraken/Robinhood (XETHZUSD/ETH, etc) - https://api.kraken.com/0/public/AssetPairs
'XETHZUSD': 'ETH'
},
'trade_signals': { # which strategies to use to generate entry/exit signals; see classes/signals.py for more info
'buy': {
'function': 'ema_crossover_rsi',
'params': {
'rsi_threshold': 40 # RSI thresholds to trigger a buy
}
},
'sell': {
'function': 'price_ema_crossover_rsi',
'params': {
'profit_percentage': 0.01, # sell if price raises above purchase price by this percentage (1%)
'rsi_threshold': 70 # RSI thresholds to trigger a sell
}
}
},
'ta': { # Technical analysis: parameters needed to calculate SMA fast, SMA slow, MACD fast, MACD slow, MACD signal, RSI
'moving_average_periods': {
'sma_fast': 12, # 12 data points per hour
'sma_slow': 48,
'ema_fast': 12,
'ema_slow': 48,
'macd_fast': 12,
'macd_slow': 26,
'macd_signal': 7
},
'rsi_period': 14
},
'assets': {
'buy_amount_per_trade': {
'min': 1.0, # buy at least $1 worth of coin
'max': 0.0 # if greater than zero, buy no more than this amount of coin, otherwise use all the cash in the account
},
'reserve': 0.0, # tell the bot if you don't want it to use all of the available cash in your account
'stop_loss_threshold': 0.3 # sell if the price drops at least 30% below the purchase price
}
} | config = {'bot': {'username': '', 'password': '', 'trades_enabled': False, 'simulate_api_calls': False, 'data_source': 'robinhood', 'minutes_between_updates': 5, 'cancel_pending_after_minutes': 20, 'save_charts': True, 'max_data_rows': 2000}, 'ticker_list': {'XETHZUSD': 'ETH'}, 'trade_signals': {'buy': {'function': 'ema_crossover_rsi', 'params': {'rsi_threshold': 40}}, 'sell': {'function': 'price_ema_crossover_rsi', 'params': {'profit_percentage': 0.01, 'rsi_threshold': 70}}}, 'ta': {'moving_average_periods': {'sma_fast': 12, 'sma_slow': 48, 'ema_fast': 12, 'ema_slow': 48, 'macd_fast': 12, 'macd_slow': 26, 'macd_signal': 7}, 'rsi_period': 14}, 'assets': {'buy_amount_per_trade': {'min': 1.0, 'max': 0.0}, 'reserve': 0.0, 'stop_loss_threshold': 0.3}} |
class DeprecatedLogger(object):
def __init__(self):
print(
"Deprecated logger, please use 'from puts import get_logger; logger = get_logger();' instead"
)
def debug(self, msg):
print(msg)
def info(self, msg):
print(msg)
def warning(self, msg):
print(msg)
def error(self, msg):
print(msg)
def critical(self, msg):
print(msg)
def exception(self, msg):
print(msg)
logger = DeprecatedLogger()
| class Deprecatedlogger(object):
def __init__(self):
print("Deprecated logger, please use 'from puts import get_logger; logger = get_logger();' instead")
def debug(self, msg):
print(msg)
def info(self, msg):
print(msg)
def warning(self, msg):
print(msg)
def error(self, msg):
print(msg)
def critical(self, msg):
print(msg)
def exception(self, msg):
print(msg)
logger = deprecated_logger() |
def run_functions(proteins, species):
interactions = GetSTRINGInteractions()
IDs_df = interactions.map_identifiers_string(list(proteins.values()), species)
if IDs_df.empty: return
IDs = IDs_df.values.flatten()
known_interactions = interactions.get_interactions(IDs, species)
known_interactions['Original geneID_A'] = IDs_df.loc[known_interactions['ncbiTaxonId'].astype(str).str.cat(known_interactions['stringId_A'], sep='.').values, 'queryItem'].values
known_interactions['Original geneID_B'] = IDs_df.loc[known_interactions['ncbiTaxonId'].astype(str).str.cat(known_interactions['stringId_B'], sep='.').values, 'queryItem'].values
results = known_interactions.set_index(['Original geneID_A', 'Original geneID_B'])
results = results.reset_index(level=['Original geneID_A', 'Original geneID_B'])
results = results[results.columns[[0, 1, 4, 5, 12]]]
return results
| def run_functions(proteins, species):
interactions = get_string_interactions()
i_ds_df = interactions.map_identifiers_string(list(proteins.values()), species)
if IDs_df.empty:
return
i_ds = IDs_df.values.flatten()
known_interactions = interactions.get_interactions(IDs, species)
known_interactions['Original geneID_A'] = IDs_df.loc[known_interactions['ncbiTaxonId'].astype(str).str.cat(known_interactions['stringId_A'], sep='.').values, 'queryItem'].values
known_interactions['Original geneID_B'] = IDs_df.loc[known_interactions['ncbiTaxonId'].astype(str).str.cat(known_interactions['stringId_B'], sep='.').values, 'queryItem'].values
results = known_interactions.set_index(['Original geneID_A', 'Original geneID_B'])
results = results.reset_index(level=['Original geneID_A', 'Original geneID_B'])
results = results[results.columns[[0, 1, 4, 5, 12]]]
return results |
# https://www.codingame.com/training/easy/detective-pikaptcha-ep1
def get_neighbors(row, col, grid):
if row > 0: yield row - 1, col
if row < len(grid) - 1: yield row + 1, col
if col > 0: yield row, col - 1
if col < len(grid[row]) - 1: yield row, col + 1
def solution():
width, height = [int(i) for i in input().split()]
grid = [list(input()) for _ in range(height)]
for row in range(height):
for col in range(width):
if grid[row][col] == '#': continue
grid[row][col] = str(sum(grid[r][c] != '#' for r, c in get_neighbors(row, col, grid)))
for row in grid:
print(''.join(row))
solution()
| def get_neighbors(row, col, grid):
if row > 0:
yield (row - 1, col)
if row < len(grid) - 1:
yield (row + 1, col)
if col > 0:
yield (row, col - 1)
if col < len(grid[row]) - 1:
yield (row, col + 1)
def solution():
(width, height) = [int(i) for i in input().split()]
grid = [list(input()) for _ in range(height)]
for row in range(height):
for col in range(width):
if grid[row][col] == '#':
continue
grid[row][col] = str(sum((grid[r][c] != '#' for (r, c) in get_neighbors(row, col, grid))))
for row in grid:
print(''.join(row))
solution() |
def parse_commands(lines):
commands = []
for l in lines:
c, offset = l.split()
commands.append([c, int(offset)])
return commands
def run_command(command, idx, acc):
c, offset = command
if c == 'acc':
acc += offset
idx += 1
elif c == 'jmp':
idx += offset
elif c == 'nop':
idx += 1
return idx, acc
def run_program(commands):
terminated, visited = True, [False for _ in commands]
acc, idx = 0, 0
while idx < len(commands):
if visited[idx]:
terminated = False
break
visited[idx] = True
idx, acc = run_command(commands[idx], idx, acc)
return acc, terminated
| def parse_commands(lines):
commands = []
for l in lines:
(c, offset) = l.split()
commands.append([c, int(offset)])
return commands
def run_command(command, idx, acc):
(c, offset) = command
if c == 'acc':
acc += offset
idx += 1
elif c == 'jmp':
idx += offset
elif c == 'nop':
idx += 1
return (idx, acc)
def run_program(commands):
(terminated, visited) = (True, [False for _ in commands])
(acc, idx) = (0, 0)
while idx < len(commands):
if visited[idx]:
terminated = False
break
visited[idx] = True
(idx, acc) = run_command(commands[idx], idx, acc)
return (acc, terminated) |
languages = ["Python", "Perl", "Ruby", "Go", "Java", "C"]
lengths = [len(language) for language in languages]
print(lengths)
z = [x for x in range(0,101) if x%3 ==0]
print(z)
| languages = ['Python', 'Perl', 'Ruby', 'Go', 'Java', 'C']
lengths = [len(language) for language in languages]
print(lengths)
z = [x for x in range(0, 101) if x % 3 == 0]
print(z) |
class RGB:
def __init__(self, r: int, g: int, b: int):
self.r = r
self.g = g
self.b = b | class Rgb:
def __init__(self, r: int, g: int, b: int):
self.r = r
self.g = g
self.b = b |
N = int(input())
if N % 2 == 0:
print(N)
else:
print(2 * N)
| n = int(input())
if N % 2 == 0:
print(N)
else:
print(2 * N) |
# Class which represents the university object and its data
class University:
def __init__(self, world_rank, name, national_rank, education_quality, alumni_employment, faculty_quality,
publications, influence, citations, impact, patents, aggregate_rank):
self.id = world_rank
self.name = name
self.national_rank = national_rank
self.education_quality = education_quality
self.alumni_employment = alumni_employment
self.faculty_quality = faculty_quality
self.publications = publications
self.influence = influence
self.citations = citations
self.impact = impact
self.patents = patents
self.aggregate_rank = aggregate_rank
def __gt__(self, uni):
return self.id < uni.id
| class University:
def __init__(self, world_rank, name, national_rank, education_quality, alumni_employment, faculty_quality, publications, influence, citations, impact, patents, aggregate_rank):
self.id = world_rank
self.name = name
self.national_rank = national_rank
self.education_quality = education_quality
self.alumni_employment = alumni_employment
self.faculty_quality = faculty_quality
self.publications = publications
self.influence = influence
self.citations = citations
self.impact = impact
self.patents = patents
self.aggregate_rank = aggregate_rank
def __gt__(self, uni):
return self.id < uni.id |
'''
Since 1926, the Belmont Stakes is a 1.5 mile-long race of 3-year old thoroughbred horses. Secretariat ran the fastest Belmont Stakes in history in 1973. While that was the fastest year, 1970 was the slowest because of unusually wet and sloppy conditions. With these two outliers removed from the data set, compute the mean and standard deviation of the Belmont winners' times. Sample out of a Normal distribution with this mean and standard deviation using the np.random.normal() function and plot a CDF. Overlay the ECDF from the winning Belmont times. Are these close to Normally distributed?
Note: Justin scraped the data concerning the Belmont Stakes from the Belmont Wikipedia page.
'''
# Compute mean and standard deviation: mu, sigma
mu = np.mean(belmont_no_outliers)
sigma = np.std(belmont_no_outliers)
# Sample out of a normal distribution with this mu and sigma: samples
samples = np.random.normal(mu, sigma, 10000)
# Get the CDF of the samples and of the data
x_theor, y_theor = ecdf(samples)
x, y = ecdf(belmont_no_outliers)
# Plot the CDFs and show the plot
_ = plt.plot(x_theor, y_theor)
_ = plt.plot(x, y, marker='.', linestyle='none')
_ = plt.xlabel('Belmont winning time (sec.)')
_ = plt.ylabel('CDF')
plt.show()
| """
Since 1926, the Belmont Stakes is a 1.5 mile-long race of 3-year old thoroughbred horses. Secretariat ran the fastest Belmont Stakes in history in 1973. While that was the fastest year, 1970 was the slowest because of unusually wet and sloppy conditions. With these two outliers removed from the data set, compute the mean and standard deviation of the Belmont winners' times. Sample out of a Normal distribution with this mean and standard deviation using the np.random.normal() function and plot a CDF. Overlay the ECDF from the winning Belmont times. Are these close to Normally distributed?
Note: Justin scraped the data concerning the Belmont Stakes from the Belmont Wikipedia page.
"""
mu = np.mean(belmont_no_outliers)
sigma = np.std(belmont_no_outliers)
samples = np.random.normal(mu, sigma, 10000)
(x_theor, y_theor) = ecdf(samples)
(x, y) = ecdf(belmont_no_outliers)
_ = plt.plot(x_theor, y_theor)
_ = plt.plot(x, y, marker='.', linestyle='none')
_ = plt.xlabel('Belmont winning time (sec.)')
_ = plt.ylabel('CDF')
plt.show() |
#if else can be done as
a=int(input())
b=int(input())
c=a%2
if a>b:
print("{} is greater than {}".format(a,b))
elif a==b:
print("{} and {} are equal".format(a,b))
else:
print("{} is greater than {}".format(b,a))
#if can be done in single line as
if a>b: print("{} is greater".format(a))
print("{} is even".format(a)) if c==0 else print("{} is odd".format(a)) | a = int(input())
b = int(input())
c = a % 2
if a > b:
print('{} is greater than {}'.format(a, b))
elif a == b:
print('{} and {} are equal'.format(a, b))
else:
print('{} is greater than {}'.format(b, a))
if a > b:
print('{} is greater'.format(a))
print('{} is even'.format(a)) if c == 0 else print('{} is odd'.format(a)) |
# Reading first input, not used anywhere in the program
first_input = input()
# Reading the input->split->parse to int->elements to set
set1 = set(map(int, input().split()))
# Same as second_input
second_input = input()
# Same as set2
set2 = set(map(int, input().split()))
# Union of set1 and set2 returns the set of all elements combining set1 and set2
# We can also use set1 | set2 , the or operator.
set3 = set1.union(set2)
# Printing the count of elements in Set
print(len(set3)) | first_input = input()
set1 = set(map(int, input().split()))
second_input = input()
set2 = set(map(int, input().split()))
set3 = set1.union(set2)
print(len(set3)) |
self.description = "Remove a no longer needed package (multiple provision)"
lp1 = pmpkg("pkg1")
lp1.provides = ["imaginary"]
self.addpkg2db("local", lp1)
lp2 = pmpkg("pkg2")
lp2.provides = ["imaginary"]
self.addpkg2db("local", lp2)
lp3 = pmpkg("pkg3")
lp3.depends = ["imaginary"]
self.addpkg2db("local", lp3)
self.args = "-R %s" % lp1.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=pkg1")
self.addrule("PKG_EXIST=pkg2")
| self.description = 'Remove a no longer needed package (multiple provision)'
lp1 = pmpkg('pkg1')
lp1.provides = ['imaginary']
self.addpkg2db('local', lp1)
lp2 = pmpkg('pkg2')
lp2.provides = ['imaginary']
self.addpkg2db('local', lp2)
lp3 = pmpkg('pkg3')
lp3.depends = ['imaginary']
self.addpkg2db('local', lp3)
self.args = '-R %s' % lp1.name
self.addrule('PACMAN_RETCODE=0')
self.addrule('!PKG_EXIST=pkg1')
self.addrule('PKG_EXIST=pkg2') |
def multiple(first,second):
return first * second * 3
def add(x,y):
return x+y
| def multiple(first, second):
return first * second * 3
def add(x, y):
return x + y |
config = {
'max_length' : 512,
'class_names' : ['O', 'B-C', 'B-P', 'I-C', 'I-P'],
'ft_data_folders' : ['/content/change-my-view-modes/v2.0/data/'],
'max_tree_size' : 10,
'max_labelled_users_per_tree':10,
'batch_size' : 4,
'd_model': 512,
'init_alphas': [0.0, 0.0, 0.0, -10000., -10000.],
'transition_init': [[0.01, -10000., -10000., 0.01, 0.01],
[0.01, -10000., -10000., 0.01, 0.01],
[0.01, -10000., -10000., 0.01, 0.01],
[-10000., 0.01, -10000., 0.01, -10000.],
[-10000., -10000., 0.01, -10000., 0.01]],
'scale_factors':[1.0, 10.0, 10.0, 1.0, 1.0],
'n_epochs' :10,
'max_grad_norm': 1.0,
'learning_rate':0.0001,
'n_layers' : 5,
} | config = {'max_length': 512, 'class_names': ['O', 'B-C', 'B-P', 'I-C', 'I-P'], 'ft_data_folders': ['/content/change-my-view-modes/v2.0/data/'], 'max_tree_size': 10, 'max_labelled_users_per_tree': 10, 'batch_size': 4, 'd_model': 512, 'init_alphas': [0.0, 0.0, 0.0, -10000.0, -10000.0], 'transition_init': [[0.01, -10000.0, -10000.0, 0.01, 0.01], [0.01, -10000.0, -10000.0, 0.01, 0.01], [0.01, -10000.0, -10000.0, 0.01, 0.01], [-10000.0, 0.01, -10000.0, 0.01, -10000.0], [-10000.0, -10000.0, 0.01, -10000.0, 0.01]], 'scale_factors': [1.0, 10.0, 10.0, 1.0, 1.0], 'n_epochs': 10, 'max_grad_norm': 1.0, 'learning_rate': 0.0001, 'n_layers': 5} |
load("//:import_external.bzl", import_external = "safe_wix_scala_maven_import_external")
def dependencies():
import_external(
name = "commons_lang_commons_lang",
artifact = "commons-lang:commons-lang:2.6",
jar_sha256 = "50f11b09f877c294d56f24463f47d28f929cf5044f648661c0f0cfbae9a2f49c",
srcjar_sha256 = "66c2760945cec226f26286ddf3f6ffe38544c4a69aade89700a9a689c9b92380",
)
| load('//:import_external.bzl', import_external='safe_wix_scala_maven_import_external')
def dependencies():
import_external(name='commons_lang_commons_lang', artifact='commons-lang:commons-lang:2.6', jar_sha256='50f11b09f877c294d56f24463f47d28f929cf5044f648661c0f0cfbae9a2f49c', srcjar_sha256='66c2760945cec226f26286ddf3f6ffe38544c4a69aade89700a9a689c9b92380') |
## Class responsible for representing a Sonobouy within Hunting the Plark
class Sonobuoy():
def __init__(self, active_range):
self.type = "SONOBUOY"
self.col = None
self.row = None
self.range = active_range
self.state = "COLD"
self.size = 1
## Setstate allows the change of state which will happen when detection occurs
def setState(self,state):
self.state = state
## Gets the state of the sonobuoy
def getState(self):
return self.state
## Getter to return range of sonobuoy
def getRange(self):
return self.range
## Getter for returning the object type.
def getType(self):
return self.type
def setLocation(self, col, row):
self.col = col
self.row = row | class Sonobuoy:
def __init__(self, active_range):
self.type = 'SONOBUOY'
self.col = None
self.row = None
self.range = active_range
self.state = 'COLD'
self.size = 1
def set_state(self, state):
self.state = state
def get_state(self):
return self.state
def get_range(self):
return self.range
def get_type(self):
return self.type
def set_location(self, col, row):
self.col = col
self.row = row |
def clamp(a, b):
if (b < 0 and a >= b) or (b > 0 and a <= b):
return a
def field(a, b, then):
val = clamp(a, b)
if val is not None:
return round(then(val), 3)
def sign_and_magnitude(intg, fract):
if fract > 100:
return None
val = (intg & 0x7F) + fract * 0.01
if intg & 0x80 == 0:
return val
return -val
| def clamp(a, b):
if b < 0 and a >= b or (b > 0 and a <= b):
return a
def field(a, b, then):
val = clamp(a, b)
if val is not None:
return round(then(val), 3)
def sign_and_magnitude(intg, fract):
if fract > 100:
return None
val = (intg & 127) + fract * 0.01
if intg & 128 == 0:
return val
return -val |
def countfreq(input):
freq={}
for i in input:
freq[i]=input.count(i)
for key,value in freq.items():
print("%d:%d"%(key,value))
input=[1, 1, 1, 5, 5, 3, 1, 3, 3, 1, 4, 4, 4, 2, 2, 2, 2]
countfreq(input)
| def countfreq(input):
freq = {}
for i in input:
freq[i] = input.count(i)
for (key, value) in freq.items():
print('%d:%d' % (key, value))
input = [1, 1, 1, 5, 5, 3, 1, 3, 3, 1, 4, 4, 4, 2, 2, 2, 2]
countfreq(input) |
#
# @lc app=leetcode.cn id=66 lang=python3
#
# [66] plus-one
#
None
# @lc code=end | None |
for i in range(1,5):
for j in range(i,5):
print(j," " ,end="")
print()
str1 = "ABCD"
str2 = "PQR"
for i in range(4):
print(str1[:i+1]+str2[i:]) | for i in range(1, 5):
for j in range(i, 5):
print(j, ' ', end='')
print()
str1 = 'ABCD'
str2 = 'PQR'
for i in range(4):
print(str1[:i + 1] + str2[i:]) |
def new(a,b):
return a - b
def x(a,b):
return a
def y(z,t):
return z(*t)
def inModule2(a,b):
return a+b
def outerMethod(a,b):
def innerMethod(a,b):
if a < b:
return a+b
else:
return a-b
return innerMethod(a+2, b+4)
| def new(a, b):
return a - b
def x(a, b):
return a
def y(z, t):
return z(*t)
def in_module2(a, b):
return a + b
def outer_method(a, b):
def inner_method(a, b):
if a < b:
return a + b
else:
return a - b
return inner_method(a + 2, b + 4) |
# This function takes a single parameter and prints it.
def print_value(x):
print(x)
print_value(12)
print_value("dog") | def print_value(x):
print(x)
print_value(12)
print_value('dog') |
__version__ = '1.3.0'
__url__ = 'https://github.com/mdawar/rq-exporter'
__description__ = 'Prometheus exporter for Python RQ (Redis Queue)'
__author__ = 'Pierre Mdawar'
__author_email__ = 'pierre@mdawar.dev'
__license__ = 'MIT'
| __version__ = '1.3.0'
__url__ = 'https://github.com/mdawar/rq-exporter'
__description__ = 'Prometheus exporter for Python RQ (Redis Queue)'
__author__ = 'Pierre Mdawar'
__author_email__ = 'pierre@mdawar.dev'
__license__ = 'MIT' |
# All possible values that should be constant through the entire script
ERR_CODE_NON_EXISTING_FILE = 404
ERR_CODE_CREATING_XML = 406
ERR_CODE_COMMAND_LINE_ARGS = 407
ERR_CODE_NON_EXISTING_DIRECTORY = 408
ERR_CODE_NON_EXISTING_W_E = 409
WARNING_CODE_INVALID_FORMAT = 405
WARNING_CODE_NO_PAIR_FOUND = 406
WARNING_NOT_A_TMX_FILE = 407
COMMAND_LINE_MIN_ARGS = 2
COMMAND_LINE_COMMAND_NAME_POSITION = 1
COMMAND_NAME_HELP = '-help'
COMMAND_NAME_CREATE_TMX = '-mktmx'
COMMAND_NAME_CREATE_VTT = '-mkvtt'
COMMAND_NAME_DEV = "-dev"
TMX_MIN_ARGS = [4, 2]
VTT_MIN_ARGS = [2]
WINDOW_GENERATE_TMX = 1
WINDOW_GENERATE_VTT = 2
WINDOW_ABOUT = 3
SUPPRESS_CONSOLE_PRINT = True
PRINT_MESSAGEBOX = 1
PRINT_CONSOLE = 2
MESSAGE_INFO = 1
MESSAGE_ERROR = 2
WINDOW_WIDTH = 300
WINDOW_HEIGHT = 280
GRID_CONFIGURATIONS = {
'padx': 12,
'pady': 6
}
| err_code_non_existing_file = 404
err_code_creating_xml = 406
err_code_command_line_args = 407
err_code_non_existing_directory = 408
err_code_non_existing_w_e = 409
warning_code_invalid_format = 405
warning_code_no_pair_found = 406
warning_not_a_tmx_file = 407
command_line_min_args = 2
command_line_command_name_position = 1
command_name_help = '-help'
command_name_create_tmx = '-mktmx'
command_name_create_vtt = '-mkvtt'
command_name_dev = '-dev'
tmx_min_args = [4, 2]
vtt_min_args = [2]
window_generate_tmx = 1
window_generate_vtt = 2
window_about = 3
suppress_console_print = True
print_messagebox = 1
print_console = 2
message_info = 1
message_error = 2
window_width = 300
window_height = 280
grid_configurations = {'padx': 12, 'pady': 6} |
# -*- coding: utf-8 -*-
class wcstr(str):
def __new__(*args, **kwargs):
return str.__new__(*args, **kwargs)
def __init__(self, *args, **kwargs):
self._update()
def _update(self):
self.bitindex = []
for i,j in zip(str(self), range(len(str(self)))):
iwidth = 1 if len(i.encode('utf8')) <= 2 else 2
self.bitindex += [j] * iwidth
def __len__(self):
return len(self.bitindex)
def __getitem__(self, y):
if type(y) == int:
return wcstr(super(wcstr, self).__getitem__(
self.bitindex[y]))
elif type(y) == slice:
start = self.bitindex[y.start] if y.start else None
stop = self.bitindex[y.stop] if y.stop else None
step = y.step
return wcstr(super(wcstr, self).__getitem__(slice(
start, stop, step)))
else: return
def dupstr(self):
# return a duplicated string with every element
# indicating one-width character
return ''.join([self[i] for i in range(len(self))])
# alias for other str methods
def __add__(self, *args, **kwargs):
return wcstr(super(wcstr, self).__add__(*args, **kwargs))
def __mul__(self, value):
return wcstr(super(wcstr, self).__mul__(value))
def __rmul__(self, *args, **kwargs):
return wcstr(super(wcstr, self).__rmul__(*args, **kwargs))
def __format__(self, *args, **kwargs):
return wcstr(super(wcstr, self).__format__(*args, **kwargs))
def center(self, width, fillchar=' '):
filllen = (width - len(self)) // 2
return wcstr(fillchar * filllen + self + fillchar * (width - len(self) - filllen))
def ljust(self, width, fillchar=' '):
return wcstr(super(wcstr, self).ljust(width - len(self) +
len(str(self)), fillchar))
def rjust(self, width, fillchar=' '):
return wcstr(super(wcstr, self).rjust(width - len(self) +
len(str(self)), fillchar))
def casefold(self, *args, **kwargs):
return wcstr(super(wcstr, self).casefold(*args, **kwargs))
def capitalize(self, *args, **kwargs):
return wcstr(super(wcstr, self).capitalize(*args, **kwargs))
def expandtabs(self, *args, **kwargs):
return wcstr(super(wcstr, self).expandtabs(*args, **kwargs))
def format(self, *args, **kwargs):
return wcstr(super(wcstr, self).format(*args, **kwargs))
def format_map(self, *args, **kwargs):
return wcstr(super(wcstr, self).format_map(*args, **kwargs))
def join(self, *args, **kwargs):
return wcstr(super(wcstr, self).join(*args, **kwargs))
def lower(self, *args, **kwargs):
return wcstr(super(wcstr, self).lower(*args, **kwargs))
def lstrip(self, *args, **kwargs):
return wcstr(super(wcstr, self).lstrip(*args, **kwargs))
def replace(self, *args, **kwargs):
return wcstr(super(wcstr, self).replace(*args, **kwargs))
def rstrip(self, *args, **kwargs):
return wcstr(super(wcstr, self).rstrip(*args, **kwargs))
def strip(self, *args, **kwargs):
return wcstr(super(wcstr, self).strip(*args, **kwargs))
def swapcase(self, *args, **kwargs):
return wcstr(super(wcstr, self).swapcase(*args, **kwargs))
def title(self, *args, **kwargs):
return wcstr(super(wcstr, self).title(*args, **kwargs))
def translate(self, *args, **kwargs):
return wcstr(super(wcstr, self).translate(*args, **kwargs))
def upper(self, *args, **kwargs):
return wcstr(super(wcstr, self).upper(*args, **kwargs))
def zfill(self, *args, **kwargs):
return wcstr(super(wcstr, self).zfill(*args, **kwargs))
| class Wcstr(str):
def __new__(*args, **kwargs):
return str.__new__(*args, **kwargs)
def __init__(self, *args, **kwargs):
self._update()
def _update(self):
self.bitindex = []
for (i, j) in zip(str(self), range(len(str(self)))):
iwidth = 1 if len(i.encode('utf8')) <= 2 else 2
self.bitindex += [j] * iwidth
def __len__(self):
return len(self.bitindex)
def __getitem__(self, y):
if type(y) == int:
return wcstr(super(wcstr, self).__getitem__(self.bitindex[y]))
elif type(y) == slice:
start = self.bitindex[y.start] if y.start else None
stop = self.bitindex[y.stop] if y.stop else None
step = y.step
return wcstr(super(wcstr, self).__getitem__(slice(start, stop, step)))
else:
return
def dupstr(self):
return ''.join([self[i] for i in range(len(self))])
def __add__(self, *args, **kwargs):
return wcstr(super(wcstr, self).__add__(*args, **kwargs))
def __mul__(self, value):
return wcstr(super(wcstr, self).__mul__(value))
def __rmul__(self, *args, **kwargs):
return wcstr(super(wcstr, self).__rmul__(*args, **kwargs))
def __format__(self, *args, **kwargs):
return wcstr(super(wcstr, self).__format__(*args, **kwargs))
def center(self, width, fillchar=' '):
filllen = (width - len(self)) // 2
return wcstr(fillchar * filllen + self + fillchar * (width - len(self) - filllen))
def ljust(self, width, fillchar=' '):
return wcstr(super(wcstr, self).ljust(width - len(self) + len(str(self)), fillchar))
def rjust(self, width, fillchar=' '):
return wcstr(super(wcstr, self).rjust(width - len(self) + len(str(self)), fillchar))
def casefold(self, *args, **kwargs):
return wcstr(super(wcstr, self).casefold(*args, **kwargs))
def capitalize(self, *args, **kwargs):
return wcstr(super(wcstr, self).capitalize(*args, **kwargs))
def expandtabs(self, *args, **kwargs):
return wcstr(super(wcstr, self).expandtabs(*args, **kwargs))
def format(self, *args, **kwargs):
return wcstr(super(wcstr, self).format(*args, **kwargs))
def format_map(self, *args, **kwargs):
return wcstr(super(wcstr, self).format_map(*args, **kwargs))
def join(self, *args, **kwargs):
return wcstr(super(wcstr, self).join(*args, **kwargs))
def lower(self, *args, **kwargs):
return wcstr(super(wcstr, self).lower(*args, **kwargs))
def lstrip(self, *args, **kwargs):
return wcstr(super(wcstr, self).lstrip(*args, **kwargs))
def replace(self, *args, **kwargs):
return wcstr(super(wcstr, self).replace(*args, **kwargs))
def rstrip(self, *args, **kwargs):
return wcstr(super(wcstr, self).rstrip(*args, **kwargs))
def strip(self, *args, **kwargs):
return wcstr(super(wcstr, self).strip(*args, **kwargs))
def swapcase(self, *args, **kwargs):
return wcstr(super(wcstr, self).swapcase(*args, **kwargs))
def title(self, *args, **kwargs):
return wcstr(super(wcstr, self).title(*args, **kwargs))
def translate(self, *args, **kwargs):
return wcstr(super(wcstr, self).translate(*args, **kwargs))
def upper(self, *args, **kwargs):
return wcstr(super(wcstr, self).upper(*args, **kwargs))
def zfill(self, *args, **kwargs):
return wcstr(super(wcstr, self).zfill(*args, **kwargs)) |
T = (1,) + (2,3)
print(T)
print(type(T)) #<class 'tuple'>
T = T[0], T[1:2], T * 3 # (1, (2,), (1, 2, 3, 1, 2, 3, 1, 2, 3))
print(T)
# sorting is not available
T = ('aa', 'cc', 'dd', 'bb')
tmp = list(T)
tmp.sort()
T = tuple(tmp)
print(T)
# or sorted(T)
T = ('aa', 'cc', 'dd', 'bb')
T = sorted(T) # ['aa', 'bb', 'cc', 'dd']
print(T)
T = 1, 2, 3, 4, 5
L = [x + 100 for x in T]
print(L) # [101, 102, 103, 104, 105]
T = 1, 2, 2, 3, 4, 2, 5
print(T.count(2)) # 3
print(T.index(2)) # 1
print(T.index(2, 3)) # 5
T = (1, [2, 3], 4)
# T[0] = 'test' - error
T[1].append('test')
print(T) # (1, [2, 3, 'test'], 4)
| t = (1,) + (2, 3)
print(T)
print(type(T))
t = (T[0], T[1:2], T * 3)
print(T)
t = ('aa', 'cc', 'dd', 'bb')
tmp = list(T)
tmp.sort()
t = tuple(tmp)
print(T)
t = ('aa', 'cc', 'dd', 'bb')
t = sorted(T)
print(T)
t = (1, 2, 3, 4, 5)
l = [x + 100 for x in T]
print(L)
t = (1, 2, 2, 3, 4, 2, 5)
print(T.count(2))
print(T.index(2))
print(T.index(2, 3))
t = (1, [2, 3], 4)
T[1].append('test')
print(T) |
class Solution:
def exist(self, board, word):
m, n, o = len(board), len(board and board[0]), len(word)
def explore(i, j, k, q):
for x, y in ((i - 1, j), (i, j - 1), (i + 1, j), (i, j + 1)):
if k>=o or (0<=x<m and 0<=y<n and board[x][y]==word[k] and (x,y) not in q and explore(x,y,k+1,q|{(x,y)})): return True
return False
for i in range(m):
for j in range(n):
if board[i][j] == word[0] and explore(i, j, 1, {(i, j)}): return True
return False | class Solution:
def exist(self, board, word):
(m, n, o) = (len(board), len(board and board[0]), len(word))
def explore(i, j, k, q):
for (x, y) in ((i - 1, j), (i, j - 1), (i + 1, j), (i, j + 1)):
if k >= o or (0 <= x < m and 0 <= y < n and (board[x][y] == word[k]) and ((x, y) not in q) and explore(x, y, k + 1, q | {(x, y)})):
return True
return False
for i in range(m):
for j in range(n):
if board[i][j] == word[0] and explore(i, j, 1, {(i, j)}):
return True
return False |
f=open("input.txt")
Input=sorted(map(int, f.read().split("\n")))
Input = [0] + Input
f.close()
print(Input)
combinationCounts = [1] + [0] * (len(Input) - 1)
for i, value in enumerate(Input):
for j, adapterValue in enumerate(Input[i+1:], start=i+1):
if(adapterValue > value + 3):
break
combinationCounts[j] += combinationCounts[i]
print(combinationCounts)
| f = open('input.txt')
input = sorted(map(int, f.read().split('\n')))
input = [0] + Input
f.close()
print(Input)
combination_counts = [1] + [0] * (len(Input) - 1)
for (i, value) in enumerate(Input):
for (j, adapter_value) in enumerate(Input[i + 1:], start=i + 1):
if adapterValue > value + 3:
break
combinationCounts[j] += combinationCounts[i]
print(combinationCounts) |
# coding: utf-8
country = {
'ARG': 'Argentina',
'BOL': 'Bolivia',
'CHI': 'Chile',
'COL': 'Colombia',
'COS': 'Costa Rica',
'CUB': 'Cuba',
'EQU': 'Ecuador',
'SPA': 'Spain',
'MEX': 'Mexico',
'PER': 'Peru',
'POR': 'Portugal',
'BRA': 'Brazil',
'SOU': 'South Africa',
'URY': 'Uruguay',
'VEN': 'Venezuela',
'BUL': 'Switzerland',
'ANN': 'Italy',
'MED': 'United States',
'REV': 'United States'
}
| country = {'ARG': 'Argentina', 'BOL': 'Bolivia', 'CHI': 'Chile', 'COL': 'Colombia', 'COS': 'Costa Rica', 'CUB': 'Cuba', 'EQU': 'Ecuador', 'SPA': 'Spain', 'MEX': 'Mexico', 'PER': 'Peru', 'POR': 'Portugal', 'BRA': 'Brazil', 'SOU': 'South Africa', 'URY': 'Uruguay', 'VEN': 'Venezuela', 'BUL': 'Switzerland', 'ANN': 'Italy', 'MED': 'United States', 'REV': 'United States'} |
class Solution:
def subsets(self, nums):
count = len(nums)
result = [[]]
for i in range(1, 2 ** count):
result.append([nums[j] for j in range(count) if i & (2 ** j)])
return result
| class Solution:
def subsets(self, nums):
count = len(nums)
result = [[]]
for i in range(1, 2 ** count):
result.append([nums[j] for j in range(count) if i & 2 ** j])
return result |
class Solution:
def maximumTime(self, time: str) -> str:
hour = time.split(':')[0]
minite = time.split(':')[1]
if hour[0] == '?':
if hour[1] == '?':
res_hour = '23'
elif hour[1] <= '3':
res_hour = str(2)+str(hour[1])
else:
res_hour = str(1)+str(hour[1])
else:
if hour[1] == '?':
if hour[0] <= '1':
res_hour = str(hour[0])+str(9)
else:
res_hour = str(hour[0])+str(3)
else:
res_hour = hour
if minite[0] == '?':
if minite[1] == '?':
res_minite = '59'
else:
res_minite = str(5)+str(minite[1])
else:
if minite[1] == '?':
res_minite = str(minite[0])+str(9)
else:
res_minite = minite
return res_hour+':'+res_minite
| class Solution:
def maximum_time(self, time: str) -> str:
hour = time.split(':')[0]
minite = time.split(':')[1]
if hour[0] == '?':
if hour[1] == '?':
res_hour = '23'
elif hour[1] <= '3':
res_hour = str(2) + str(hour[1])
else:
res_hour = str(1) + str(hour[1])
elif hour[1] == '?':
if hour[0] <= '1':
res_hour = str(hour[0]) + str(9)
else:
res_hour = str(hour[0]) + str(3)
else:
res_hour = hour
if minite[0] == '?':
if minite[1] == '?':
res_minite = '59'
else:
res_minite = str(5) + str(minite[1])
elif minite[1] == '?':
res_minite = str(minite[0]) + str(9)
else:
res_minite = minite
return res_hour + ':' + res_minite |
texto = 'python'
for l in texto:
if l == 't':
l += 't'.upper()
print(l,end='')
else:
print(l,end='') | texto = 'python'
for l in texto:
if l == 't':
l += 't'.upper()
print(l, end='')
else:
print(l, end='') |
def flatten(lst_of_lst: list) -> list:
return [item for sublist in lst_of_lst for item in sublist]
def tests() -> None:
print(flatten([[1, 2], [3, 4], [5, 6]]))
print(flatten([[1, 4], [5, 4], [5, 6]]))
if __name__ == "__main__":
tests()
| def flatten(lst_of_lst: list) -> list:
return [item for sublist in lst_of_lst for item in sublist]
def tests() -> None:
print(flatten([[1, 2], [3, 4], [5, 6]]))
print(flatten([[1, 4], [5, 4], [5, 6]]))
if __name__ == '__main__':
tests() |
__version__ = "0.19.0-dev"
__libnetwork_plugin_version__ = "v0.8.0-dev"
__libcalico_version__ = "v0.14.0-dev"
__felix_version__ = "1.4.0b1-dev"
| __version__ = '0.19.0-dev'
__libnetwork_plugin_version__ = 'v0.8.0-dev'
__libcalico_version__ = 'v0.14.0-dev'
__felix_version__ = '1.4.0b1-dev' |
#
# Created on Mon Jun 14 2021
#
# The MIT License (MIT)
# Copyright (c) 2021 Vishnu Suresh
#
# 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 above copyright notice and this permission notice shall be included in all copies or substantial
# portions of the Software.
#
# 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.
#
class RightHandTree():
def __init__(self):
self.left = None
self.right = None
self.data = None
def insertNode(self, value):
# print("need to add value ",value)
if self.data == None:
# print("Value added when None ", value)
self.data = value
elif "$" in self.data:
# print("node contain variable need to change ",self.data)
temp = self.data
self.data=value
self.right=None
self.left = RightHandTree()
self.left.insertNode(temp)
elif self.right == None:
# print("Add to right value :- ",value, " Current parent :- ",self.data )
# print("Current tree :- ")
# self.PrintTree()
self.right = RightHandTree()
self.right.insertNode(value=value)
else:
self.right.insertNode(value=value)
# else:
# self.right.insertNode(value=value)
# else:
# if "$" in self.right.data:
# # print("right is not none and $ ",value)
# temp = self.right
# self.right = RightHandTree()
# self.right.insertNode(value=value)
# self.right.left = temp
# else:
# # print("right is not none ",value)
# self.right.insertNode(value)
def PrintTree(self, nodePostion="root", height=0):
print(f'{self.data} : {nodePostion}, Height : {height}'),
if self.left:
self.left.PrintTree(nodePostion="left", height=height+1)
if self.right:
self.right.PrintTree(nodePostion="right", height=height+1)
def makeTape(self):
tape = []
while self.data is not None:
tape.append(self.data)
if self.left is not None:
tape.append(self.left.data)
if self.right is not None:
self = self.right
else:
break
return tape
| class Righthandtree:
def __init__(self):
self.left = None
self.right = None
self.data = None
def insert_node(self, value):
if self.data == None:
self.data = value
elif '$' in self.data:
temp = self.data
self.data = value
self.right = None
self.left = right_hand_tree()
self.left.insertNode(temp)
elif self.right == None:
self.right = right_hand_tree()
self.right.insertNode(value=value)
else:
self.right.insertNode(value=value)
def print_tree(self, nodePostion='root', height=0):
(print(f'{self.data} : {nodePostion}, Height : {height}'),)
if self.left:
self.left.PrintTree(nodePostion='left', height=height + 1)
if self.right:
self.right.PrintTree(nodePostion='right', height=height + 1)
def make_tape(self):
tape = []
while self.data is not None:
tape.append(self.data)
if self.left is not None:
tape.append(self.left.data)
if self.right is not None:
self = self.right
else:
break
return tape |
class Attachment(object):
def __init__(self, name, data, length, content_type, origin):
self.name = name
self.data = data
self.length = length
self.content_type = content_type
self.origin = origin
def __str__(self):
return f"[{self.length} byte; {self.content_type}; {self.name}]"
| class Attachment(object):
def __init__(self, name, data, length, content_type, origin):
self.name = name
self.data = data
self.length = length
self.content_type = content_type
self.origin = origin
def __str__(self):
return f'[{self.length} byte; {self.content_type}; {self.name}]' |
#!/usr/bin/env python
NAME = 'Wallarm (Wallarm Inc.)'
def is_waf(self):
if self.matchheader(('Server', r"nginx\-wallarm")):
return True
return False
| name = 'Wallarm (Wallarm Inc.)'
def is_waf(self):
if self.matchheader(('Server', 'nginx\\-wallarm')):
return True
return False |
class Point:
def __init__(self, new_x=0, new_y=0):
self.x = new_x
self.y = new_y
def set_point(self, point):
(self.x, self.y) = (point.x, point.y)
| class Point:
def __init__(self, new_x=0, new_y=0):
self.x = new_x
self.y = new_y
def set_point(self, point):
(self.x, self.y) = (point.x, point.y) |
test = { 'name': 'q7b',
'points': 1,
'suites': [ { 'cases': [ { 'code': '>>> '
"movies.head(1)['plots'][0]=='Two "
'imprisoned men bond over a '
'number of years, finding '
'solace and eventual redemption '
'through acts of common '
"decency.'\n"
'True',
'hidden': False,
'locked': False},
{ 'code': ">>> movies['plots'][23]=='An "
'undercover cop and a mole in '
'the police attempt to identify '
'each other while infiltrating '
'an Irish gang in South '
"Boston.'\n"
'True',
'hidden': False,
'locked': False}],
'scored': True,
'setup': '',
'teardown': '',
'type': 'doctest'}]}
| test = {'name': 'q7b', 'points': 1, 'suites': [{'cases': [{'code': ">>> movies.head(1)['plots'][0]=='Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.'\nTrue", 'hidden': False, 'locked': False}, {'code': ">>> movies['plots'][23]=='An undercover cop and a mole in the police attempt to identify each other while infiltrating an Irish gang in South Boston.'\nTrue", 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]} |
csp = {
'default-src': [
'\'self\''
],
'script-src': [
'https://kit.fontawesome.com/4b9ba14b0f.js',
'http://localhost:5500/livereload.js',
'https://use.fontawesome.com/releases/v5.3.1/js/all.js',
'http://localhost:5000/static/js/base.js',
'http://localhost:5500/static/js/base.js',
'\'sha256-MclZcNa5vMtp/wzxRW6+KS3i8mRUf6thpmjT3pkIT5I=\''
],
'style-src': [
'\'self\'',
'https://cdnjs.cloudflare.com',
'https://fonts.googleapis.com/css2',
'https://ka-f.fontawesome.com/releases/v5.15.3/css/free-v4-font-face.min.css',
'https://use.fontawesome.com',
'\'sha256-mCk+PuH4k8s22RWyQ0yVST1TXl6y5diityhSgV9XfOc=\'',
'\'sha256-Ni2urx9+Bf7ppgnlSfFIqsvlGMFm+9lurWkFfilXQq8=\'',
'\'sha256-JdCH8SP11p44kp0La4MPFI5qR9musjNwAg5WtqgDI4o=\'',
'\'sha256-bviLPwiqrYk7TOtr5i2eb7I5exfGcGEvVuxmITyg//c=\'',
'\'sha256-tUCWndpLW480EWA+8o4oeW9K2GGRBQIDiewZzv/cL4o=\''
],
'connect-src': [
'https://ka-f.fontawesome.com',
'ws://localhost:5500/livereload'
],
'font-src': [
'https://fonts.gstatic.com',
'https://ka-f.fontawesome.com'
],
'img-src': [
'\'self\'',
'data:'
],
'frame-ancestors': 'none'
} | csp = {'default-src': ["'self'"], 'script-src': ['https://kit.fontawesome.com/4b9ba14b0f.js', 'http://localhost:5500/livereload.js', 'https://use.fontawesome.com/releases/v5.3.1/js/all.js', 'http://localhost:5000/static/js/base.js', 'http://localhost:5500/static/js/base.js', "'sha256-MclZcNa5vMtp/wzxRW6+KS3i8mRUf6thpmjT3pkIT5I='"], 'style-src': ["'self'", 'https://cdnjs.cloudflare.com', 'https://fonts.googleapis.com/css2', 'https://ka-f.fontawesome.com/releases/v5.15.3/css/free-v4-font-face.min.css', 'https://use.fontawesome.com', "'sha256-mCk+PuH4k8s22RWyQ0yVST1TXl6y5diityhSgV9XfOc='", "'sha256-Ni2urx9+Bf7ppgnlSfFIqsvlGMFm+9lurWkFfilXQq8='", "'sha256-JdCH8SP11p44kp0La4MPFI5qR9musjNwAg5WtqgDI4o='", "'sha256-bviLPwiqrYk7TOtr5i2eb7I5exfGcGEvVuxmITyg//c='", "'sha256-tUCWndpLW480EWA+8o4oeW9K2GGRBQIDiewZzv/cL4o='"], 'connect-src': ['https://ka-f.fontawesome.com', 'ws://localhost:5500/livereload'], 'font-src': ['https://fonts.gstatic.com', 'https://ka-f.fontawesome.com'], 'img-src': ["'self'", 'data:'], 'frame-ancestors': 'none'} |
#encoding:utf-8
subreddit = 'pics'
t_channel = '@r_pics_redux'
def send_post(submission, r2t):
return r2t.send_simple(submission,
text=False,
gif=False,
img='{title}\n{short_link}',
album=False,
other=False
)
| subreddit = 'pics'
t_channel = '@r_pics_redux'
def send_post(submission, r2t):
return r2t.send_simple(submission, text=False, gif=False, img='{title}\n{short_link}', album=False, other=False) |
# Lesson3: while loop
# source: code/while.py
text = ''
while text != 'stop':
text = input('Tell me something:\n')
print('you told me:', text)
print('... and I\'m stopping')
| text = ''
while text != 'stop':
text = input('Tell me something:\n')
print('you told me:', text)
print("... and I'm stopping") |
workers = 1
worker_class = 'gevent'
bind = '0.0.0.0:5000'
pidfile = '/tmp/gunicorn-inspector.pid'
debug = True
reload = True
loglevel = 'info'
errorlog = '/tmp/gunicorn_inspector_error.log'
accesslog = '/tmp/gunicorn_inspector_access.log'
daemon = False
| workers = 1
worker_class = 'gevent'
bind = '0.0.0.0:5000'
pidfile = '/tmp/gunicorn-inspector.pid'
debug = True
reload = True
loglevel = 'info'
errorlog = '/tmp/gunicorn_inspector_error.log'
accesslog = '/tmp/gunicorn_inspector_access.log'
daemon = False |
# (User) Problem
# We know / We have: 3 number: win draw lose
# We need / We don't have: points for team
# We must: use: 3 points for win, 1 for draw, 0 for loss
# name of function must be: football_points
#
# Solution (Product)
# function with 3 inputs
def football_points(wins, draws, losses):
return wins * 3 + draws
# alt: Lambda Version
#
# football_points = lambda x, y, z: x * 3 + y
| def football_points(wins, draws, losses):
return wins * 3 + draws |
users = [
{ "id": 0, "name": "Hero" },
{ "id": 1, "name": "Dunn" },
{ "id": 2, "name": "Sue" },
{ "id": 3, "name": "Chi" },
{ "id": 4, "name": "Thor" },
{ "id": 5, "name": "Clive" },
{ "id": 6, "name": "Hicks" },
{ "id": 7, "name": "Devin" },
{ "id": 8, "name": "Kate" },
{ "id": 9, "name": "Klein" }
]
friendships = [(0, 1), (0, 2), (1, 2), (1, 3), (2, 3), (3, 4),
(4, 5), (5, 6), (5, 7), (6, 8), (7, 8), (8, 9)]
endorsements = [(0, 1), (1, 0), (0, 2), (2, 0), (1, 2),
(2, 1), (1, 3), (2, 3), (3, 4), (5, 4),
(5, 6), (7, 5), (6, 8), (8, 7), (8, 9)] | users = [{'id': 0, 'name': 'Hero'}, {'id': 1, 'name': 'Dunn'}, {'id': 2, 'name': 'Sue'}, {'id': 3, 'name': 'Chi'}, {'id': 4, 'name': 'Thor'}, {'id': 5, 'name': 'Clive'}, {'id': 6, 'name': 'Hicks'}, {'id': 7, 'name': 'Devin'}, {'id': 8, 'name': 'Kate'}, {'id': 9, 'name': 'Klein'}]
friendships = [(0, 1), (0, 2), (1, 2), (1, 3), (2, 3), (3, 4), (4, 5), (5, 6), (5, 7), (6, 8), (7, 8), (8, 9)]
endorsements = [(0, 1), (1, 0), (0, 2), (2, 0), (1, 2), (2, 1), (1, 3), (2, 3), (3, 4), (5, 4), (5, 6), (7, 5), (6, 8), (8, 7), (8, 9)] |
# Constants
Background = 'FF111111'
BackgroundDark = 'FF0A0A0A'
# OverlayVeryDark = GetAlpha(FF000000, 90),
# OverlayDark = GetAlpha(FF000000, 70),
# OverlayMed = GetAlpha(FF000000, 50),
# OverlayLht = GetAlpha(FF000000, 35),
Border = 'FF1F1F1F'
Empty = 'FF1F1F1F'
Card = 'FF1F1F1F'
Button = 'FF1F1F1F'
ButtonDark = 'FF171717'
ButtonLht = 'FF555555'
ButtonMed = 'FF2D2D2D'
Indicator = 'FF999999'
Text = 'FFFFFFFF'
Subtitle = 'FF999999'
# These are dependent on the regions background color
# TextLht = GetAlpha(FFFFFFFF, 90),
# TextMed = GetAlpha(FFFFFFFF, 75),
# TextDim = GetAlpha(FFFFFFFF, 50),
# TextDis = GetAlpha(FFFFFFFF, 30),
# TextDimDis = GetAlpha(FFFFFFFF, 10),
Transparent = '00000000'
Black = 'FF000000'
Blue = 'FF0033CC'
Red = 'FFC23529'
RedAlt = 'FFD9534F'
Green = 'FF5CB85C'
Orange = 'FFCC7B19'
OrangeLight = 'FFF9BE03'
# Component specific
# SettingsBg = 'FF2C2C2C'
# ScrollbarBg = GetAlpha(FFFFFFFF, 10),
# ScrollbarFgFocus = GetAlpha('Orange' 70),
# ScrollbarFg = GetAlpha(FFFFFFFF, 25),
# IndicatorBorder = 'FF000000'
# Separator = 'FF000000'
# Modal = GetAlpha(FF000000, 85),
# Focus = Orange,
# FocusToggle = OrangeLight,
# ListFocusBg = GetAlpha(FF000000, 40),
# TrackActionsBg = GetAlpha(FF000000, 30),
# ListBg = GetAlpha(FFFFFFFF, 10),
# ListBgNoBlur = GetAlpha(FF666666, 40),
# ListImageBorder = 'FF595959'
SearchBg = 'FF2D2D2D'
SearchButton = 'FF282828'
SearchButtonDark = 'FF1F1F1F'
SearchButtonLight = 'FF555555'
InputBg = 'FF000000'
InputButton = 'FF282828'
InputButtonDark = 'FF1F1F1F'
InputButtonLight = 'FF555555'
class _noAlpha:
def __getattr__(self, name):
return globals()[name][2:]
noAlpha = _noAlpha()
# def getAlpha(color, percent):
# if isinstance(color, basestring):
# color = COLORS[color]
# if isinstance(color, int):
# util.ERROR_LOG(str(color) + " is not found in object")
# return color and int((percent / 100 * 255) - 256)
| background = 'FF111111'
background_dark = 'FF0A0A0A'
border = 'FF1F1F1F'
empty = 'FF1F1F1F'
card = 'FF1F1F1F'
button = 'FF1F1F1F'
button_dark = 'FF171717'
button_lht = 'FF555555'
button_med = 'FF2D2D2D'
indicator = 'FF999999'
text = 'FFFFFFFF'
subtitle = 'FF999999'
transparent = '00000000'
black = 'FF000000'
blue = 'FF0033CC'
red = 'FFC23529'
red_alt = 'FFD9534F'
green = 'FF5CB85C'
orange = 'FFCC7B19'
orange_light = 'FFF9BE03'
search_bg = 'FF2D2D2D'
search_button = 'FF282828'
search_button_dark = 'FF1F1F1F'
search_button_light = 'FF555555'
input_bg = 'FF000000'
input_button = 'FF282828'
input_button_dark = 'FF1F1F1F'
input_button_light = 'FF555555'
class _Noalpha:
def __getattr__(self, name):
return globals()[name][2:]
no_alpha = _no_alpha() |
API_KEY = "PK3OA9F3DZ47286MDM81"
SECRET_KEY = "oJxGYAqcrIrhpLyXGJyIb3wsCrh2cR3xwaO662yp"
HEADERS = {
'APCA-API-KEY-ID': API_KEY,
'APCA-API-SECRET-KEY': SECRET_KEY
}
BARS_URL = 'https://data.alpaca.markets/v1/bars'
| api_key = 'PK3OA9F3DZ47286MDM81'
secret_key = 'oJxGYAqcrIrhpLyXGJyIb3wsCrh2cR3xwaO662yp'
headers = {'APCA-API-KEY-ID': API_KEY, 'APCA-API-SECRET-KEY': SECRET_KEY}
bars_url = 'https://data.alpaca.markets/v1/bars' |
n=int(input())
a=[int(i) for i in input().split()]
d=[a[0]]
for i in range(1,n):
x=a[i]
if x>d[-1]: d+=[x]
elif d[0]>=x: d[0]=x
else:
l,r=0,len(d)
while(r>l+1):
m=(l+r)//2
if(d[m]<x): l=m
else: r=m
d[r]=x
print(len(d))
| n = int(input())
a = [int(i) for i in input().split()]
d = [a[0]]
for i in range(1, n):
x = a[i]
if x > d[-1]:
d += [x]
elif d[0] >= x:
d[0] = x
else:
(l, r) = (0, len(d))
while r > l + 1:
m = (l + r) // 2
if d[m] < x:
l = m
else:
r = m
d[r] = x
print(len(d)) |
# Copyright 2016 Twitter. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
# Global variable to store config map and verbosity
################################################################################
config_opts = dict()
verbose_flag = False
trace_execution_flag = False
################################################################################
# Get config opts from the global variable
################################################################################
def get_heron_config():
opt_list = []
for (k, v) in config_opts.items():
opt_list.append('%s=%s' % (k, v))
all_opts = '-Dheron.options=' + (','.join(opt_list)).replace(' ', '%%%%')
return all_opts
################################################################################
# Get config opts from the config map
################################################################################
def get_config(k):
global config_opts
if config_opts.has_key(k):
return config_opts[k]
return None
################################################################################
# Store a config opt in the config map
################################################################################
def set_config(k, v):
global config_opts
config_opts[k] = v
################################################################################
# Clear all the config in the config map
################################################################################
def clear_config():
global config_opts
config_opts = dict()
################################################################################
# Methods to get and set verbose levels
################################################################################
def set_verbose():
global verbose_flag
verbose_flag = True
def verbose():
global verbose_flag
return verbose_flag
################################################################################
# Methods to get and set trace execution
################################################################################
def set_trace_execution():
global trace_execution_flag
trace_execution_flag = True
set_verbose()
def trace_execution():
global trace_execution_flag
return trace_execution_flag
| config_opts = dict()
verbose_flag = False
trace_execution_flag = False
def get_heron_config():
opt_list = []
for (k, v) in config_opts.items():
opt_list.append('%s=%s' % (k, v))
all_opts = '-Dheron.options=' + ','.join(opt_list).replace(' ', '%%%%')
return all_opts
def get_config(k):
global config_opts
if config_opts.has_key(k):
return config_opts[k]
return None
def set_config(k, v):
global config_opts
config_opts[k] = v
def clear_config():
global config_opts
config_opts = dict()
def set_verbose():
global verbose_flag
verbose_flag = True
def verbose():
global verbose_flag
return verbose_flag
def set_trace_execution():
global trace_execution_flag
trace_execution_flag = True
set_verbose()
def trace_execution():
global trace_execution_flag
return trace_execution_flag |
ENABLE_EXTERNAL_PATHS = False
SOURCE_DEFINITION = ['Landroid/telephony/TelephonyManager;->getDeviceId(',
'Landroid/telephony/TelephonyManager;->getSubscriberId(',
'Landroid/telephony/TelephonyManager;->getSimSerialNumber(',
'Landroid/telephony/TelephonyManager;->getLine1Number(']
#[
# 'Landroid/accounts/AccountManager;->getAccounts(',
# 'Landroid/app/Activity;->findViewById(',
# 'Landroid/app/Activity;->getIntent(',
# 'Landroid/app/Activity;->onActivityResult(',
# 'Landroid/app/PendingIntent;->getActivity(',
# 'Landroid/app/PendingIntent;->getBroadcast(',
# 'Landroid/app/PendingIntent;->getService(',
# 'Landroid/bluetooth/BluetoothAdapter;->getAddress(',
# 'Landroid/content/ContentResolver;->query(',
# 'Landroid/content/pm/PackageManager;->getInstalledApplications(',
# 'Landroid/content/pm/PackageManager;->getInstalledPackages(',
# 'Landroid/content/pm/PackageManager;->queryBroadcastReceivers(',
# 'Landroid/content/pm/PackageManager;->queryContentProviders(',
# 'Landroid/content/pm/PackageManager;->queryIntentActivities(',
# 'Landroid/content/pm/PackageManager;->queryIntentServices(',
# 'Landroid/content/SharedPreferences;->getDefaultSharedPreferences(',
# 'Landroid/database/Cursor;->getString(',
# 'Landroid/database/sqlite/SQLiteDatabase;->query(',
# 'Landroid/location/Location;->getLatitude(',
# 'Landroid/location/Location;->getLongitude(',
# 'Landroid/location/LocationManager;->getLastKnownLocation(',
# 'Landroid/media/AudioRecord;->read(',
# 'Landroid/net/wifi/WifiInfo;->getMacAddress(',
# 'Landroid/net/wifi/WifiInfo;->getSSID(',
# 'Landroid/os/Bundle;->get(',
# 'Landroid/os/Bundle;->getBoolean(',
# 'Landroid/os/Bundle;->getBooleanArray(',
# 'Landroid/os/Bundle;->getBundle(',
# 'Landroid/os/Bundle;->getByte(',
# 'Landroid/os/Bundle;->getByteArray(',
# 'Landroid/os/Bundle;->getChar(',
# 'Landroid/os/Bundle;->getCharArray(',
# 'Landroid/os/Bundle;->getCharSequence(',
# 'Landroid/os/Bundle;->getCharSequenceArray(',
# 'Landroid/os/Bundle;->getCharSequenceArrayList(',
# 'Landroid/os/Bundle;->getClassLoader(',
# 'Landroid/os/Bundle;->getDouble(',
# 'Landroid/os/Bundle;->getDoubleArray(',
# 'Landroid/os/Bundle;->getFloat(',
# 'Landroid/os/Bundle;->getFloatArray(',
# 'Landroid/os/Bundle;->getInt(',
# 'Landroid/os/Bundle;->getIntArray(',
# 'Landroid/os/Bundle;->getIntegerArrayList(',
# 'Landroid/os/Bundle;->getLong(',
# 'Landroid/os/Bundle;->getLongArray(',
# 'Landroid/os/Bundle;->getParcelable(',
# 'Landroid/os/Bundle;->getParcelableArray(',
# 'Landroid/os/Bundle;->getParcelableArrayList(',
# 'Landroid/os/Bundle;->getSerializable(',
# 'Landroid/os/Bundle;->getShort(',
# 'Landroid/os/Bundle;->getShortArray(',
# 'Landroid/os/Bundle;->getSparseParcelableArray(',
# 'Landroid/os/Bundle;->getString(',
# 'Landroid/os/Bundle;->getStringArrayList(',
# 'Landroid/os/Handler;->obtainMessage(',
# 'Landroid/provider/Browser;->getAllBookmarks(',
# 'Landroid/provider/Browser;->getAllVisitedUrls(',
# 'Landroid/telephony/gsm/GsmCellLocation;->getCid(',
# 'Landroid/telephony/gsm/GsmCellLocation;->getLac(',
# 'Landroid/telephony/TelephonyManager;->getDeviceId(',
# 'Landroid/telephony/TelephonyManager;->getLine1Number(',
# 'Landroid/telephony/TelephonyManager;->getSimSerialNumber(',
# 'Landroid/telephony/TelephonyManager;->getSubscriberId(',
# 'Ljava/net/URLConnection;->getInputStream(',
# 'Ljava/net/URLConnection;->getOutputStream(',
# 'Ljava/net/URL;->openConnection(',
# 'Ljava/util/Calendar;->getTimeZone(',
# 'Ljava/util/Locale;->getCountry(',
# 'Lorg/apache/http/HttpResponse;->getEntity(',
# 'Lorg/apache/http/util/EntityUtils;->getContentCharSet(',
# 'Lorg/apache/http/util/EntityUtils;->toByteArray(',
# 'Lorg/apache/http/util/EntityUtils;->toString(',
#]# SINKS taken from the flowdroid
SINK_DEFINITION = ['Landroid/util/Log;->d(',
'Landroid/util/Log;->e(',
'Landroid/util/Log;->i(',
'Landroid/util/Log;->v(',
'Landroid/util/Log;->w(',
'Landroid/util/Log;->wtf(',
'Ljava.io.OutputStream;->write('
]
#[
# 'Landroid/app/Activity;->bindService(',
# 'Landroid/app/Activity;->sendBroadcast(',
# 'Landroid/app/Activity;->sendBroadcastAsUser(',
# 'Landroid/app/Activity;->sendOrderedBroadcast(',
# 'Landroid/app/Activity;->sendOrderedBroadcastAsUser(',
# 'Landroid/app/Activity;->sendStickyBroadcast(',
# 'Landroid/app/Activity;->sendStickyBroadcastAsUser(',
# 'Landroid/app/Activity;->sendStickyOrderedBroadcast(',
# 'Landroid/app/Activity;->sendStickyOrderedBroadcastAsUser(',
# 'Landroid/app/Activity;->setResult(',
# 'Landroid/app/Activity;->startActivities(',
# 'Landroid/app/Activity;->startActivity(',
# 'Landroid/app/Activity;->startActivityForResult(',
# 'Landroid/app/Activity;->startActivityFromChild(',
# 'Landroid/app/Activity;->startActivityFromFragment(',
# 'Landroid/app/Activity;->startActivityIfNeeded(',
# 'Landroid/app/Activity;->startService(',
# 'Landroid/content/ContentResolver;->delete(',
# 'Landroid/content/ContentResolver;->insert(',
# 'Landroid/content/ContentResolver;->query(',
# 'Landroid/content/ContentResolver;->update(',
# 'Landroid/content/Context;->bindService(',
# 'Landroid/content/Context;->registerReceiver(',
# 'Landroid/content/Context;->sendBroadcast(',
# 'Landroid/content/Context;->startActivities(',
# 'Landroid/content/Context;->startActivity(',
# 'Landroid/content/Context;->startService(',
# 'Landroid/content/IntentFilter;->addAction(',
# 'Landroid/content/Intent;->setAction(',
# 'Landroid/content/Intent;->setClassName(',
# 'Landroid/content/Intent;->setComponent(',
# 'Landroid/content/SharedPreferences$Editor;->putBoolean(',
# 'Landroid/content/SharedPreferences$Editor;->putFloat(',
# 'Landroid/content/SharedPreferences$Editor;->putInt(',
# 'Landroid/content/SharedPreferences$Editor;->putLong(',
# 'Landroid/content/SharedPreferences$Editor;->putString(',
# 'Landroid/media/MediaRecorder;->setPreviewDisplay(',
# 'Landroid/media/MediaRecorder;->setVideoSource(',
# 'Landroid/media/MediaRecorder;->start(',
# 'Landroid/os/Bundle;->putAll(',
# 'Landroid/os/Bundle;->putBinder(',
# 'Landroid/os/Bundle;->putBoolean(',
# 'Landroid/os/Bundle;->putBooleanArray(',
# 'Landroid/os/Bundle;->putBundle(',
# 'Landroid/os/Bundle;->putByte(',
# 'Landroid/os/Bundle;->putByteArray(',
# 'Landroid/os/Bundle;->putChar(',
# 'Landroid/os/Bundle;->putCharArray(',
# 'Landroid/os/Bundle;->putCharSequence(',
# 'Landroid/os/Bundle;->putCharSequenceArray(',
# 'Landroid/os/Bundle;->putCharSequenceArrayList(',
# 'Landroid/os/Bundle;->putDouble(',
# 'Landroid/os/Bundle;->putDoubleArray(',
# 'Landroid/os/Bundle;->putFloat(',
# 'Landroid/os/Bundle;->putFloatArray(',
# 'Landroid/os/Bundle;->putInt(',
# 'Landroid/os/Bundle;->putIntArray(',
# 'Landroid/os/Bundle;->putIntegerArrayList(',
# 'Landroid/os/Bundle;->putLong(',
# 'Landroid/os/Bundle;->putLongArray(',
# 'Landroid/os/Bundle;->putParcelable(',
# 'Landroid/os/Bundle;->putParcelableArray(',
# 'Landroid/os/Bundle;->putParcelableArrayList(',
# 'Landroid/os/Bundle;->putSerializable(',
# 'Landroid/os/Bundle;->putShort(',
# 'Landroid/os/Bundle;->putShortArray(',
# 'Landroid/os/Bundle;->putSparseParcelableArray(',
# 'Landroid/os/Bundle;->putString(',
# 'Landroid/os/Bundle;->putStringArray(',
# 'Landroid/os/Bundle;->putStringArrayList(',
# 'Landroid/os/Handler;->sendMessage(',
# 'Landroid/telephony/SmsManager;->sendDataMessage(',
# 'Landroid/telephony/SmsManager;->sendMultipartTextMessage(',
# 'Landroid/telephony/SmsManager;->sendTextMessage(',
# 'Landroid/util/Log;->d(',
# 'Landroid/util/Log;->e(',
# 'Landroid/util/Log;->i(',
# 'Landroid/util/Log;->v(',
# 'Landroid/util/Log;->w(',
# 'Landroid/util/Log;->wtf(',
# 'Ljava/io/FileOutputStream;->write(',
# 'Ljava/io/OutputStream;->write(',
# 'Ljava/io/Writer;->write(',
# 'Ljava/net/Socket;->connect(',
# 'Ljava/net/URLConnection;->setRequestProperty(',
# 'Ljava/net/URL;-><init>(',
# 'Ljava/net/URL;->set(',
# 'Lorg/apache/http/client/HttpClient;->execute(',
# 'Lorg/apache/http/impl/client/DefaultHttpClient;->execute(',
# 'Lorg/apache/http/message/BasicNameValuePair;-><init>('
#]
NOPS = ['return-void',
'return',
'return-wide',
'return-object',
'monitor-exit',
'monitor-enter',
'move-exception', #only for backward analysis. in forward, this can be a tainting propagation, and will be checked!
'check-cast',
'instance-of',
'array-length', #@todo: hidden propagation?
'goto',
'goto/16',
'goto/32',
'packed-switch', #@todo: hidden propagation?
'sparse-switch', #@todo: hidden propagation?
'cmpl-float',
'cmpg-float',
'cmpl-double',
'cmpg-double',
'cmp-long',
'if-eq',
'if-ne',
'if-lt',
'if-ge',
'if-gt',
'if-le',
'if-eqz',
'if-nez',
'if-ltz',
'if-gez',
'if-gtz',
'if-lez'
]
UNTAINT = ['const/4',
'const/16',
'const',
'const/high16',
'const-wide/16',
'const-wide/32',
'const-wide',
'const-wide/high16',
'const-string',
'const-string/jumbo',
'const-class',
'new-instance', #what if the init taints THIS? -> then init is called afterwards!
'new-array',
'fill-array-data' #@sketchy
]
INSTRUCTION_PROPAGATION = { # if key is the instruction:
# taint all variables in value[1] (0-indexed, 0 could be target!)
# IF at least one entry in value[0] is tainted after this line
'move': [[0], [1]],
'move/from16': [[0], [1]],
'move-wide': [[0], [1]],
'move-wide/from16': [[0], [1]],
'move-object': [[0], [1]],
'move-object/from16': [[0], [1]],
'aget': [[0], [1]],
'aget-wide': [[0], [1]], #@todo: does not taint the index!
'aget-object': [[0], [1]],
'aget-boolean': [[0], [1]],
'aget-byte': [[0], [1]],
'aget-char': [[0], [1]],
'aget-short': [[0], [1]],
'aput': [[1], [0]],
'aput-wide': [[1], [0]],
'aput-object': [[1], [0]],
'aput-boolean': [[1], [0]],
'aput-byte': [[1], [0]],
'aput-char': [[1], [0]],
'aput-short': [[1], [0]],
'neg-int': [[0], [1]],
'not-int': [[0], [1]],
'neg-long': [[0], [1]],
'not-long': [[0], [1]],
'neg-float': [[0], [1]],
'not-float': [[0], [1]],
'neg-double': [[0], [1]],
'not-double': [[0], [1]],
'int-to-long': [[0], [1]],
'int-to-float': [[0], [1]],
'int-to-double': [[0], [1]],
'long-to-int': [[0], [1]],
'long-to-float': [[0], [1]],
'long-to-double': [[0], [1]],
'float-to-int': [[0], [1]],
'float-to-long': [[0], [1]],
'float-to-double': [[0], [1]],
'double-to-int': [[0], [1]],
'double-to-long': [[0], [1]],
'double-to-float': [[0], [1]],
'int-to-byte': [[0], [1]],
'int-to-char': [[0], [1]],
'int-to-short': [[0], [1]],
'add-int': [[0], [1, 2]],
'sub-int': [[0], [1, 2]],
'rsub-int': [[0], [1, 2]],
'mul-int': [[0], [1, 2]],
'div-int': [[0], [1, 2]],
'rem-int': [[0], [1, 2]],
'and-int': [[0], [1, 2]],
'or-int': [[0], [1, 2]],
'xor-int': [[0], [1, 2]],
'shl-int': [[0], [1, 2]],
'shr-int': [[0], [1, 2]],
'ushr-int': [[0], [1, 2]],
'add-long': [[0], [1, 2]],
'sub-long': [[0], [1, 2]],
'mul-long': [[0], [1, 2]],
'div-long': [[0], [1, 2]],
'rem-long': [[0], [1, 2]],
'and-long': [[0], [1, 2]],
'or-long': [[0], [1, 2]],
'xor-long': [[0], [1, 2]],
'shl-long': [[0], [1, 2]],
'shr-long': [[0], [1, 2]],
'ushr-long': [[0], [1, 2]],
'add-float': [[0], [1, 2]],
'sub-float': [[0], [1, 2]],
'mul-float': [[0], [1, 2]],
'div-float': [[0], [1, 2]],
'rem-float': [[0], [1, 2]],
'add-double': [[0], [1, 2]],
'sub-double': [[0], [1, 2]],
'mul-double': [[0], [1, 2]],
'div-double': [[0], [1, 2]],
'rem-double': [[0], [1, 2]],
'add-int/2addr': [[0],[0, 1]],
'sub-int/2addr': [[0],[0, 1]],
'mul-int/2addr': [[0],[0, 1]],
'div-int/2addr': [[0],[0, 1]],
'rem-int/2addr': [[0],[0, 1]],
'and-int/2addr': [[0],[0, 1]],
'or-int/2addr': [[0],[0, 1]],
'xor-int/2addr': [[0],[0, 1]],
'shl-int/2addr': [[0],[0, 1]],
'shr-int/2addr': [[0],[0, 1]],
'ushr-int/2addr': [[0],[0, 1]],
'add-long/2addr': [[0],[0, 1]],
'sub-long/2addr': [[0],[0, 1]],
'mul-long/2addr': [[0],[0, 1]],
'div-long/2addr': [[0],[0, 1]],
'rem-long/2addr': [[0],[0, 1]],
'and-long/2addr': [[0],[0, 1]],
'or-long/2addr': [[0],[0, 1]],
'xor-long/2addr': [[0],[0, 1]],
'shl-long/2addr': [[0],[0, 1]],
'shr-long/2addr': [[0],[0, 1]],
'ushr-long/2addr': [[0],[0, 1]],
'add-float/2addr': [[0],[0, 1]],
'sub-float/2addr': [[0],[0, 1]],
'mul-float/2addr': [[0],[0, 1]],
'div-float/2addr': [[0],[0, 1]],
'rem-float/2addr': [[0],[0, 1]],
'add-double/2addr': [[0],[0, 1]],
'sub-double/2addr': [[0],[0, 1]],
'mul-double/2addr': [[0],[0, 1]],
'div-double/2addr': [[0],[0, 1]],
'rem-double/2addr': [[0],[0, 1]],
'add-int/lit8': [[0], [1]],
'sub-int/lit8': [[0], [1]],
'rsub-int/lit8': [[0], [1]],
'mul-int/lit8': [[0], [1]],
'div-int/lit8': [[0], [1]],
'rem-int/lit8': [[0], [1]],
'and-int/lit8': [[0], [1]],
'or-int/lit8': [[0], [1]],
'xor-int/lit8': [[0], [1]],
'shl-int/lit8': [[0], [1]],
'shr-int/lit8': [[0], [1]],
'ushr-int/lit8': [[0], [1]],
'add-int/lit16': [[0], [1]],
'sub-int/lit16': [[0], [1]],
'rsub-int/lit16': [[0], [1]],
'mul-int/lit16': [[0], [1]],
'div-int/lit16': [[0], [1]],
'rem-int/lit16': [[0], [1]],
'and-int/lit16': [[0], [1]],
'or-int/lit16': [[0], [1]],
'xor-int/lit16': [[0], [1]],
'shl-int/lit16': [[0], [1]],
'shr-int/lit16': [[0], [1]],
'ushr-int/lit16': [[0], [1]],
#the following are only available in optimized dex files
#execute-inline
#invoke-*-quick
#iput/get - quick
}
## [
## 'Landroid/telephony/TelephonyManager;->getDeviceId(',
## 'Landroid/telephony/TelephonyManager;->getLine1Number(',
## 'Landroid/telephony/TelephonyManager;->getSubscriberId(',
## 'Landroid/telephony/TelephonyManager;->getCellLocation('
## ],
## # SINKS taken from the permissionmap, for PERMISSION_INTERNET
## [
## 'Landroid/webkit/WebSettings;->setBlockNetworkLoads(',
## 'Landroid/webkit/WebSettings;->verifyNetworkAccess(',
## 'Landroid/webkit/WebView;-><init>(',
## 'Landroid/webkit/WebViewCore;-><init>(',
## 'Lcom/android/http/multipart/FilePart;->sendData(',
## 'Lcom/android/http/multipart/FilePart;->sendDispositionHeader(',
## 'Lcom/android/http/multipart/Part;->send(',
## 'Lcom/android/http/multipart/Part;->sendStart(',
## 'Lcom/android/http/multipart/Part;->sendTransferEncodingHeader(',
## 'Lcom/android/http/multipart/StringPart;->sendData(',
## 'Ljava/net/DatagramSocket;-><init>(',
## 'Ljava/net/HttpURLConnection;-><init>(',
## 'Ljava/net/HttpURLConnection;->connect(',
## 'Ljava/net/MulticastSocket;-><init>(',
## 'Ljava/net/NetworkInterface;-><init>(',
## 'Ljava/net/ServerSocket;-><init>(',
## 'Ljava/net/ServerSocket;->bind(',
## 'Ljava/net/Socket;-><init>(',
## 'Ljava/net/URL;->getContent(',
## 'Ljava/net/URL;->openConnection(',
## 'Ljava/net/URL;->openStream(',
## 'Ljava/net/URLConnection;->connect(',
## 'Ljava/net/URLConnection;->getInputStream(',
## 'Lorg/apache/http/impl/client/DefaultHttpClient;-><init>(',
## 'Lorg/apache/http/impl/client/DefaultHttpClient;->execute(',
## 'Ljava/io/OutputStream;->write(',
##' Lorg/apache/http/impl/client/HttpClient;->execute']) | enable_external_paths = False
source_definition = ['Landroid/telephony/TelephonyManager;->getDeviceId(', 'Landroid/telephony/TelephonyManager;->getSubscriberId(', 'Landroid/telephony/TelephonyManager;->getSimSerialNumber(', 'Landroid/telephony/TelephonyManager;->getLine1Number(']
sink_definition = ['Landroid/util/Log;->d(', 'Landroid/util/Log;->e(', 'Landroid/util/Log;->i(', 'Landroid/util/Log;->v(', 'Landroid/util/Log;->w(', 'Landroid/util/Log;->wtf(', 'Ljava.io.OutputStream;->write(']
nops = ['return-void', 'return', 'return-wide', 'return-object', 'monitor-exit', 'monitor-enter', 'move-exception', 'check-cast', 'instance-of', 'array-length', 'goto', 'goto/16', 'goto/32', 'packed-switch', 'sparse-switch', 'cmpl-float', 'cmpg-float', 'cmpl-double', 'cmpg-double', 'cmp-long', 'if-eq', 'if-ne', 'if-lt', 'if-ge', 'if-gt', 'if-le', 'if-eqz', 'if-nez', 'if-ltz', 'if-gez', 'if-gtz', 'if-lez']
untaint = ['const/4', 'const/16', 'const', 'const/high16', 'const-wide/16', 'const-wide/32', 'const-wide', 'const-wide/high16', 'const-string', 'const-string/jumbo', 'const-class', 'new-instance', 'new-array', 'fill-array-data']
instruction_propagation = {'move': [[0], [1]], 'move/from16': [[0], [1]], 'move-wide': [[0], [1]], 'move-wide/from16': [[0], [1]], 'move-object': [[0], [1]], 'move-object/from16': [[0], [1]], 'aget': [[0], [1]], 'aget-wide': [[0], [1]], 'aget-object': [[0], [1]], 'aget-boolean': [[0], [1]], 'aget-byte': [[0], [1]], 'aget-char': [[0], [1]], 'aget-short': [[0], [1]], 'aput': [[1], [0]], 'aput-wide': [[1], [0]], 'aput-object': [[1], [0]], 'aput-boolean': [[1], [0]], 'aput-byte': [[1], [0]], 'aput-char': [[1], [0]], 'aput-short': [[1], [0]], 'neg-int': [[0], [1]], 'not-int': [[0], [1]], 'neg-long': [[0], [1]], 'not-long': [[0], [1]], 'neg-float': [[0], [1]], 'not-float': [[0], [1]], 'neg-double': [[0], [1]], 'not-double': [[0], [1]], 'int-to-long': [[0], [1]], 'int-to-float': [[0], [1]], 'int-to-double': [[0], [1]], 'long-to-int': [[0], [1]], 'long-to-float': [[0], [1]], 'long-to-double': [[0], [1]], 'float-to-int': [[0], [1]], 'float-to-long': [[0], [1]], 'float-to-double': [[0], [1]], 'double-to-int': [[0], [1]], 'double-to-long': [[0], [1]], 'double-to-float': [[0], [1]], 'int-to-byte': [[0], [1]], 'int-to-char': [[0], [1]], 'int-to-short': [[0], [1]], 'add-int': [[0], [1, 2]], 'sub-int': [[0], [1, 2]], 'rsub-int': [[0], [1, 2]], 'mul-int': [[0], [1, 2]], 'div-int': [[0], [1, 2]], 'rem-int': [[0], [1, 2]], 'and-int': [[0], [1, 2]], 'or-int': [[0], [1, 2]], 'xor-int': [[0], [1, 2]], 'shl-int': [[0], [1, 2]], 'shr-int': [[0], [1, 2]], 'ushr-int': [[0], [1, 2]], 'add-long': [[0], [1, 2]], 'sub-long': [[0], [1, 2]], 'mul-long': [[0], [1, 2]], 'div-long': [[0], [1, 2]], 'rem-long': [[0], [1, 2]], 'and-long': [[0], [1, 2]], 'or-long': [[0], [1, 2]], 'xor-long': [[0], [1, 2]], 'shl-long': [[0], [1, 2]], 'shr-long': [[0], [1, 2]], 'ushr-long': [[0], [1, 2]], 'add-float': [[0], [1, 2]], 'sub-float': [[0], [1, 2]], 'mul-float': [[0], [1, 2]], 'div-float': [[0], [1, 2]], 'rem-float': [[0], [1, 2]], 'add-double': [[0], [1, 2]], 'sub-double': [[0], [1, 2]], 'mul-double': [[0], [1, 2]], 'div-double': [[0], [1, 2]], 'rem-double': [[0], [1, 2]], 'add-int/2addr': [[0], [0, 1]], 'sub-int/2addr': [[0], [0, 1]], 'mul-int/2addr': [[0], [0, 1]], 'div-int/2addr': [[0], [0, 1]], 'rem-int/2addr': [[0], [0, 1]], 'and-int/2addr': [[0], [0, 1]], 'or-int/2addr': [[0], [0, 1]], 'xor-int/2addr': [[0], [0, 1]], 'shl-int/2addr': [[0], [0, 1]], 'shr-int/2addr': [[0], [0, 1]], 'ushr-int/2addr': [[0], [0, 1]], 'add-long/2addr': [[0], [0, 1]], 'sub-long/2addr': [[0], [0, 1]], 'mul-long/2addr': [[0], [0, 1]], 'div-long/2addr': [[0], [0, 1]], 'rem-long/2addr': [[0], [0, 1]], 'and-long/2addr': [[0], [0, 1]], 'or-long/2addr': [[0], [0, 1]], 'xor-long/2addr': [[0], [0, 1]], 'shl-long/2addr': [[0], [0, 1]], 'shr-long/2addr': [[0], [0, 1]], 'ushr-long/2addr': [[0], [0, 1]], 'add-float/2addr': [[0], [0, 1]], 'sub-float/2addr': [[0], [0, 1]], 'mul-float/2addr': [[0], [0, 1]], 'div-float/2addr': [[0], [0, 1]], 'rem-float/2addr': [[0], [0, 1]], 'add-double/2addr': [[0], [0, 1]], 'sub-double/2addr': [[0], [0, 1]], 'mul-double/2addr': [[0], [0, 1]], 'div-double/2addr': [[0], [0, 1]], 'rem-double/2addr': [[0], [0, 1]], 'add-int/lit8': [[0], [1]], 'sub-int/lit8': [[0], [1]], 'rsub-int/lit8': [[0], [1]], 'mul-int/lit8': [[0], [1]], 'div-int/lit8': [[0], [1]], 'rem-int/lit8': [[0], [1]], 'and-int/lit8': [[0], [1]], 'or-int/lit8': [[0], [1]], 'xor-int/lit8': [[0], [1]], 'shl-int/lit8': [[0], [1]], 'shr-int/lit8': [[0], [1]], 'ushr-int/lit8': [[0], [1]], 'add-int/lit16': [[0], [1]], 'sub-int/lit16': [[0], [1]], 'rsub-int/lit16': [[0], [1]], 'mul-int/lit16': [[0], [1]], 'div-int/lit16': [[0], [1]], 'rem-int/lit16': [[0], [1]], 'and-int/lit16': [[0], [1]], 'or-int/lit16': [[0], [1]], 'xor-int/lit16': [[0], [1]], 'shl-int/lit16': [[0], [1]], 'shr-int/lit16': [[0], [1]], 'ushr-int/lit16': [[0], [1]]} |
weather = []
for i in range(4):
x = input().split()
| weather = []
for i in range(4):
x = input().split() |
def sol(preorder,inorder):
ret = []
def print_postorder(preorder, inorder):
n = len(preorder)
if n == 0:
return
root = preorder[0]
i = inorder.index(root)
print_postorder(preorder[1 : i + 1], inorder[:i])
print_postorder(preorder[i + 1 :], inorder[i + 1 :])
ret.append(root)
print_postorder(preorder, inorder)
print(*ret)
test_case = int(input())
for _ in range(test_case):
num_node = int(input())
preorder = [int(x) for x in input().split()]
inorder = [int(x) for x in input().split()]
sol(preorder, inorder) | def sol(preorder, inorder):
ret = []
def print_postorder(preorder, inorder):
n = len(preorder)
if n == 0:
return
root = preorder[0]
i = inorder.index(root)
print_postorder(preorder[1:i + 1], inorder[:i])
print_postorder(preorder[i + 1:], inorder[i + 1:])
ret.append(root)
print_postorder(preorder, inorder)
print(*ret)
test_case = int(input())
for _ in range(test_case):
num_node = int(input())
preorder = [int(x) for x in input().split()]
inorder = [int(x) for x in input().split()]
sol(preorder, inorder) |
__version__ = '0.2.0'
__pdoc__ = {
'__version__': "The version of the installed nflfan module.",
}
| __version__ = '0.2.0'
__pdoc__ = {'__version__': 'The version of the installed nflfan module.'} |
{
"targets": [
{
"target_name": "math",
"sources": [ "math.cc" ],
"libraries": [
"<(module_root_dir)/libmath.a"
]
}
]
} | {'targets': [{'target_name': 'math', 'sources': ['math.cc'], 'libraries': ['<(module_root_dir)/libmath.a']}]} |
{
'target_defaults': {
'default_configuration': 'Release'
},
"targets": [
{
'configurations': {
'Debug': {
'cflags': ['-g3', '-O0'],
'msvs_settings': {
'VCCLCompilerTool': {
'BasicRuntimeChecks': 3, # /RTC1
'ExceptionHandling': 1, # /EHsc
'Optimization': '0', # /Od, no optimization
'WarningLevel': 4
},
'VCLinkerTool': {
'GenerateDebugInformation': 'true',
'LinkIncremental': 2 # enable incremental linking
}
}
},
'Release': {
'cflags': ['-O2', '-W', '-Wall', '-Wextra', '-ansi', '-pedantic'],
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': ['/Zc:inline', '/MP'],
'BufferSecurityCheck': 'true',
'ExceptionHandling': 1, # /EHsc
'FavorSizeOrSpeed': '1',
'OmitFramePointers': 'false', # Ideally, we should only disable for x64
'Optimization': '2',
'StringPooling': 'true',
'WarningLevel': 3,
'WholeProgramOptimization': 'true'
},
'VCLinkerTool': {
'DataExecutionPrevention': 2, # enable DEP
'EnableCOMDATFolding': 2, # /OPT:ICF
'LinkIncremental': 1, # disable incremental linking
'LinkTimeCodeGeneration': 1, # link-time code generation
'OptimizeReferences': 2, # /OPT:REF
'RandomizedBaseAddress': 2, # enable ASLR
'SetChecksum': 'true'
}
}
}
},
"target_name": "<(module_name)",
'lflags': ['-lm'],
"include_dirs": [
"zopfli/src/zopfli",
"zopfli/src/zopflipng",
"<!(node -e \"require('nan')\")"
],
"sources": [
"src/zopfli-binding.cc",
"src/png/zopflipng.cc",
"zopfli/src/zopfli/blocksplitter.c",
"zopfli/src/zopfli/cache.c",
"zopfli/src/zopfli/deflate.c",
"zopfli/src/zopfli/gzip_container.c",
"zopfli/src/zopfli/hash.c",
"zopfli/src/zopfli/katajainen.c",
"zopfli/src/zopfli/lz77.c",
"zopfli/src/zopfli/squeeze.c",
"zopfli/src/zopfli/tree.c",
"zopfli/src/zopfli/util.c",
"zopfli/src/zopfli/zlib_container.c",
"zopfli/src/zopfli/zopfli_lib.c",
"zopfli/src/zopflipng/zopflipng_lib.cc",
"zopfli/src/zopflipng/lodepng/lodepng.cpp",
"zopfli/src/zopflipng/lodepng/lodepng_util.cpp"
],
"cflags": [
"-Wall",
"-O3"
]
},
{
"target_name": "action_after_build",
"type": "none",
"dependencies": ["<(module_name)"],
"copies": [
{
"files": ["<(PRODUCT_DIR)/<(module_name).node"],
"destination": "<(module_path)"
}
]
}
]
}
| {'target_defaults': {'default_configuration': 'Release'}, 'targets': [{'configurations': {'Debug': {'cflags': ['-g3', '-O0'], 'msvs_settings': {'VCCLCompilerTool': {'BasicRuntimeChecks': 3, 'ExceptionHandling': 1, 'Optimization': '0', 'WarningLevel': 4}, 'VCLinkerTool': {'GenerateDebugInformation': 'true', 'LinkIncremental': 2}}}, 'Release': {'cflags': ['-O2', '-W', '-Wall', '-Wextra', '-ansi', '-pedantic'], 'msvs_settings': {'VCCLCompilerTool': {'AdditionalOptions': ['/Zc:inline', '/MP'], 'BufferSecurityCheck': 'true', 'ExceptionHandling': 1, 'FavorSizeOrSpeed': '1', 'OmitFramePointers': 'false', 'Optimization': '2', 'StringPooling': 'true', 'WarningLevel': 3, 'WholeProgramOptimization': 'true'}, 'VCLinkerTool': {'DataExecutionPrevention': 2, 'EnableCOMDATFolding': 2, 'LinkIncremental': 1, 'LinkTimeCodeGeneration': 1, 'OptimizeReferences': 2, 'RandomizedBaseAddress': 2, 'SetChecksum': 'true'}}}}, 'target_name': '<(module_name)', 'lflags': ['-lm'], 'include_dirs': ['zopfli/src/zopfli', 'zopfli/src/zopflipng', '<!(node -e "require(\'nan\')")'], 'sources': ['src/zopfli-binding.cc', 'src/png/zopflipng.cc', 'zopfli/src/zopfli/blocksplitter.c', 'zopfli/src/zopfli/cache.c', 'zopfli/src/zopfli/deflate.c', 'zopfli/src/zopfli/gzip_container.c', 'zopfli/src/zopfli/hash.c', 'zopfli/src/zopfli/katajainen.c', 'zopfli/src/zopfli/lz77.c', 'zopfli/src/zopfli/squeeze.c', 'zopfli/src/zopfli/tree.c', 'zopfli/src/zopfli/util.c', 'zopfli/src/zopfli/zlib_container.c', 'zopfli/src/zopfli/zopfli_lib.c', 'zopfli/src/zopflipng/zopflipng_lib.cc', 'zopfli/src/zopflipng/lodepng/lodepng.cpp', 'zopfli/src/zopflipng/lodepng/lodepng_util.cpp'], 'cflags': ['-Wall', '-O3']}, {'target_name': 'action_after_build', 'type': 'none', 'dependencies': ['<(module_name)'], 'copies': [{'files': ['<(PRODUCT_DIR)/<(module_name).node'], 'destination': '<(module_path)'}]}]} |
# ---
# jupyter:
# jupytext:
# formats: ipynb,md,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # Jonathan Date-Chong
# **Instructions:** This is an individual assignment. Complete the following code and push to get your score.
# I am providing the autograder answers locally so you may test your code before pushing. I will be reviewing your submissions, and if I find you are circumventing the autograder in any manner, you will receive a 0 on this assignment and your case will be reported to the honor board for review. i.e., approach the assignment in a genuine manner and you have nothing to worry about.
#
# **Question 1.**
# When will new material be available each week?
# You can answer the question by defining an anonymous function. This creates a function that I can test using pytest. You don't have to worry about the details. You just need to answer the question by changing the string argument that is currently set to "D". I know this is a bit weird, but I want you to get used to submitting code as early as possible.
# Nothing to modify in this cell
def question_1(answer):
answers = {
"A": "Monday morning",
"B": "Sunday night",
"C": "Monday evening",
"D": "I don't know"
}
try:
return answers[answer]
except:
return "Not a valid answer"
# YOUR SOLUTION HERE
# Sample incorrect answer
answer_question_1 = lambda: question_1("C")
# **Question 2.**
# Do I need to buy the textbook?
# Nothing to modify in this cell
def question_2(answer):
answers = {
"A": "No",
"B": "Maybe",
"C": "Yes. You will struggle with some of the chapters without the textbook",
}
try:
return answers[answer]
except:
return "Not a valid answer"
# YOUR SOLUTION HERE
# Sample incorrect answer
answer_question_2 = lambda: question_2("C")
# **Question 3.**
# Are these any required times that I be online?
# Nothing to modify in this cell
def question_3(answer):
answers = {
"A": "Yes",
"B": "No"
}
try:
return answers[answer]
except:
return "Not a valid answer"
# YOUR SOLUTION HERE
# Sample incorrect answer
answer_question_3 = lambda: question_3("A")
# **Question 4.**
# What software will I use to complete the assignments?
# Nothing to modify in this cell
def question_4(answer):
answers = {
"A": "Java",
"B": "Netbeans",
"C": "Anaconda"
}
try:
return answers[answer]
except:
return "Not a valid answer"
# YOUR SOLUTION HERE
# Sample incorrect answer
answer_question_4 = lambda: question_4("C")
# **Question 5.**
# Do I need to participate in this class or can I just do the labs and assignments?
# Nothing to modify in this cell
def question_5(answer):
answers = {
"A": "Yes. If you want to get anything higher than a C, you'll need to do more than the labs and assignments",
"B": "No",
}
try:
return answers[answer]
except:
return "Not a valid answer"
# YOUR SOLUTION HERE
# Sample incorrect answer
answer_question_5 = lambda: question_5("A")
# Don't forget to push!
| def question_1(answer):
answers = {'A': 'Monday morning', 'B': 'Sunday night', 'C': 'Monday evening', 'D': "I don't know"}
try:
return answers[answer]
except:
return 'Not a valid answer'
answer_question_1 = lambda : question_1('C')
def question_2(answer):
answers = {'A': 'No', 'B': 'Maybe', 'C': 'Yes. You will struggle with some of the chapters without the textbook'}
try:
return answers[answer]
except:
return 'Not a valid answer'
answer_question_2 = lambda : question_2('C')
def question_3(answer):
answers = {'A': 'Yes', 'B': 'No'}
try:
return answers[answer]
except:
return 'Not a valid answer'
answer_question_3 = lambda : question_3('A')
def question_4(answer):
answers = {'A': 'Java', 'B': 'Netbeans', 'C': 'Anaconda'}
try:
return answers[answer]
except:
return 'Not a valid answer'
answer_question_4 = lambda : question_4('C')
def question_5(answer):
answers = {'A': "Yes. If you want to get anything higher than a C, you'll need to do more than the labs and assignments", 'B': 'No'}
try:
return answers[answer]
except:
return 'Not a valid answer'
answer_question_5 = lambda : question_5('A') |
for i in range(1, 10+1):
if i%3 == 0:
print('hello')
elif i%5 == 0:
print('world')
else:
print(i)
| for i in range(1, 10 + 1):
if i % 3 == 0:
print('hello')
elif i % 5 == 0:
print('world')
else:
print(i) |
def place(arr, mask, vals):
# TODO(beam2d): Implement it
raise NotImplementedError
def put(a, ind, v, mode='raise'):
# TODO(beam2d): Implement it
raise NotImplementedError
def putmask(a, mask, values):
# TODO(beam2d): Implement it
raise NotImplementedError
def fill_diagonal(a, val, wrap=False):
# TODO(beam2d): Implement it
raise NotImplementedError
| def place(arr, mask, vals):
raise NotImplementedError
def put(a, ind, v, mode='raise'):
raise NotImplementedError
def putmask(a, mask, values):
raise NotImplementedError
def fill_diagonal(a, val, wrap=False):
raise NotImplementedError |
# maps biome IDs to supported biomes
biome_map = {
"Plains": [1, 129],
"Forest": [4, 18, 132],
"Birch Forest": [27, 28, 155, 156],
"Dark Forest": [29, 157],
"Swamp": [6, 134],
"Jungle": [21, 22, 23, 149, 151],
"River Beach": [7, 11, 16, 25],
"Taiga": [5, 19, 133, 30, 31, 158, 32, 33, 160, 161],
"Ice": [12, 140, 26],
"Mountains": [3, 13, 34, 131, 162, 20],
"Mushroom": [14, 15],
"Desert": [2, 17, 130],
"Savanna": [35, 36, 163, 164],
"Badlands": [37, 38, 39, 165, 166, 167],
"Aquatic": [0, 10, 24, 44, 45, 46, 47, 48, 49, 50]
}
| biome_map = {'Plains': [1, 129], 'Forest': [4, 18, 132], 'Birch Forest': [27, 28, 155, 156], 'Dark Forest': [29, 157], 'Swamp': [6, 134], 'Jungle': [21, 22, 23, 149, 151], 'River Beach': [7, 11, 16, 25], 'Taiga': [5, 19, 133, 30, 31, 158, 32, 33, 160, 161], 'Ice': [12, 140, 26], 'Mountains': [3, 13, 34, 131, 162, 20], 'Mushroom': [14, 15], 'Desert': [2, 17, 130], 'Savanna': [35, 36, 163, 164], 'Badlands': [37, 38, 39, 165, 166, 167], 'Aquatic': [0, 10, 24, 44, 45, 46, 47, 48, 49, 50]} |
def pprint(obj):
return repr(obj)
def to_hex_str(data):
return ''.join("{0:x}".format(b) for b in data)
| def pprint(obj):
return repr(obj)
def to_hex_str(data):
return ''.join(('{0:x}'.format(b) for b in data)) |
# -*- coding: utf-8 -*-
class PluginException(Exception):
pass
class PluginTypeNotFound(PluginException):
pass
| class Pluginexception(Exception):
pass
class Plugintypenotfound(PluginException):
pass |
class gr():
def __init__(self):
age = 28
def stop(self):
return 1+1
if __name__ == "__main__":
print("hello")
pass | class Gr:
def __init__(self):
age = 28
def stop(self):
return 1 + 1
if __name__ == '__main__':
print('hello')
pass |
# Kata url: https://www.codewars.com/kata/574b1916a3ebd6e4fa0012e7.
def is_opposite(s1: str, s2: str) -> bool:
return len(s1) and s1 == s2.swapcase()
| def is_opposite(s1: str, s2: str) -> bool:
return len(s1) and s1 == s2.swapcase() |
def sectrails(domain,requests,api):
print("[+] Consultando securitytrails")
url = "https://api.securitytrails.com/v1/domain/"+domain+"/subdomains"
querystring = {"children_only":"false","include_inactive":"true"}
headers = {"Accept": "application/json","APIKEY": api}
subs = []
# Insira sua chave de API em APIKEY
try:
response = requests.request("GET", url, headers=headers, params=querystring)
for x in response.json()['subdomains']:
sub = '{}.{}'.format(x,domain)
subs.append(sub)
return subs
except:
print('[!] Error: '+response.json()['message'],'\n')
return | def sectrails(domain, requests, api):
print('[+] Consultando securitytrails')
url = 'https://api.securitytrails.com/v1/domain/' + domain + '/subdomains'
querystring = {'children_only': 'false', 'include_inactive': 'true'}
headers = {'Accept': 'application/json', 'APIKEY': api}
subs = []
try:
response = requests.request('GET', url, headers=headers, params=querystring)
for x in response.json()['subdomains']:
sub = '{}.{}'.format(x, domain)
subs.append(sub)
return subs
except:
print('[!] Error: ' + response.json()['message'], '\n')
return |
class Node:
def __init__(self, data):
self.data = data
self.right_child = None
self.left_child = None
| class Node:
def __init__(self, data):
self.data = data
self.right_child = None
self.left_child = None |
secret_number = 9
guess_count = 0
guess_limit = 3
while guess_count < guess_limit:
guess = int(input("Guess any no. from 1-10: "))
guess_count+=1
if guess == secret_number:
print("You won")
break
else:
print("Better luck next time")
| secret_number = 9
guess_count = 0
guess_limit = 3
while guess_count < guess_limit:
guess = int(input('Guess any no. from 1-10: '))
guess_count += 1
if guess == secret_number:
print('You won')
break
else:
print('Better luck next time') |
# Linear Search Implementation
def linear_search(arr, search):
# Iterate over the array
for _, ele in enumerate(arr):
# Check for search element
if ele == search:
return True
return False
if __name__ == "__main__":
# Read input array from stdin
arr = list(map(int, input().strip().split()))
# Read search elements from stdin
search = list(map(int, input().strip().split()))
# Search in the array
for s in search:
print(f"Searching for {s} in [{arr}]:", end=" -> ")
flag = linear_search(arr, s)
print("Found:", flag)
| def linear_search(arr, search):
for (_, ele) in enumerate(arr):
if ele == search:
return True
return False
if __name__ == '__main__':
arr = list(map(int, input().strip().split()))
search = list(map(int, input().strip().split()))
for s in search:
print(f'Searching for {s} in [{arr}]:', end=' -> ')
flag = linear_search(arr, s)
print('Found:', flag) |
BASE_URL = "https://www.zhixue.com"
class Url:
SERVICE_URL = f"{BASE_URL}:443/ssoservice.jsp"
SSO_URL = f"https://sso.zhixue.com/sso_alpha/login?service={SERVICE_URL}"
TEST_PASSWORD_URL = f"{BASE_URL}/weakPwdLogin/?from=web_login"
TEST_URL = f"{BASE_URL}/container/container/teacher/teacherAccountNew"
GET_LOGIN_STATE = f"{BASE_URL}/loginState/" | base_url = 'https://www.zhixue.com'
class Url:
service_url = f'{BASE_URL}:443/ssoservice.jsp'
sso_url = f'https://sso.zhixue.com/sso_alpha/login?service={SERVICE_URL}'
test_password_url = f'{BASE_URL}/weakPwdLogin/?from=web_login'
test_url = f'{BASE_URL}/container/container/teacher/teacherAccountNew'
get_login_state = f'{BASE_URL}/loginState/' |
#!/usr/bin/env python2.7
# Copyright (c) 2014 Franco Fichtner <franco@packetwerk.com>
# Copyright (c) 2014 Tobias Boertitz <tobias@packetwerk.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
countries = []
with open('contrib/tzdata/iso3166.tab', 'r') as lines:
for line in lines:
country = line.strip().split('\t')
if country[0][0] == "#" or len(country) != 2:
# ignore garbage
continue
# be paranoid about upper case
country[0] = country[0].upper()
countries.append(country)
if len(countries) == 0:
exit(0)
# special case: not in the database when database isn't empty
countries.append(["XX", "undefined"])
countries.sort(key=lambda country: country[0])
def insertIntoFile(fileName, beginString, endString, insertString):
file_content = 0
insert_begin = -1
line_idx = -1
del_list = list()
# read destination file and prepare for writing
with open(fileName, 'r') as dest_file:
insert_section = False
file_content = dest_file.readlines()
# remove not needed / outdated lines and find insertion point
for line in file_content:
line_idx += 1
if line == beginString:
insert_section = True
insert_begin = line_idx
continue
elif line == endString:
insert_section = False
break
# collect obsolete line
# insert in front, so we delete form bottom up later on
if insert_section == True:
del_list.insert(0, line_idx)
# delete obsolete lines
for line_idx in del_list:
del file_content[line_idx]
line_idx = -1
# insert definitions
with open(fileName, 'w') as dest_file:
for line in file_content:
line_idx += 1
# write normal file data
dest_file.write(line)
# insert given string when insertion point is reached
if line_idx == insert_begin:
dest_file.write(insertString)
# prepare string for insertion into header file
header_string = "\n"
header_string += "/*\n"
header_string += " * Begin of autogenerated section. DO NOT EDIT.\n"
header_string += " */\n"
header_string += "\n"
header_string += "struct locate_item {\n"
header_string += "\tunsigned int guid;\n"
header_string += "\tconst char *name;\n"
header_string += "\tconst char *desc;\n"
header_string += "};\n\n"
header_string += "enum {\n"
header_string += "\tLOCATE_UNKNOWN = 0U,\n"
for country in countries:
header_string += "\tLOCATE_" + country[0] + ",\n"
header_string += "\tLOCATE_MAX\t/* last element */\n"
header_string += "};\n"
header_string += "\n"
header_string += "/*\n"
header_string += " * End of autogenerated section. YOU MAY CONTINUE.\n"
header_string += " */\n\n"
# prepare string for insertion into source file
source_string = "\n"
source_string += "/*\n"
source_string += " * Begin of autogenerated section. DO NOT EDIT.\n"
source_string += " */\n"
source_string += "\n"
source_string += "static const struct locate_item locate_items[] = {\n"
source_string += "\t{ LOCATE_UNKNOWN, \"\", \"unknown\" },\t/* `unknown' placeholder */\n"
for country in countries:
source_string += "\t{ LOCATE_" + country[0] + ", \"" + \
country[0] + "\", \"" + country[1] + "\" },\n"
source_string += "};\n\n"
source_string += "/*\n"
source_string += " * End of autogenerated section. YOU MAY CONTINUE.\n"
source_string += " */\n\n"
# insert relevant data into the target files
insertIntoFile('lib/peak_locate.h', "#define PEAK_LOCATE_H\n", \
"#define LOCATE_MAGIC\t0x10CA7E10CA7E7412ull\n", header_string)
insertIntoFile('lib/peak_locate.c', "#define LOCATE_DEFAULT\t\"/usr/local/var/peak/locate.bin\"\n", \
"struct peak_locates {\n", source_string)
| countries = []
with open('contrib/tzdata/iso3166.tab', 'r') as lines:
for line in lines:
country = line.strip().split('\t')
if country[0][0] == '#' or len(country) != 2:
continue
country[0] = country[0].upper()
countries.append(country)
if len(countries) == 0:
exit(0)
countries.append(['XX', 'undefined'])
countries.sort(key=lambda country: country[0])
def insert_into_file(fileName, beginString, endString, insertString):
file_content = 0
insert_begin = -1
line_idx = -1
del_list = list()
with open(fileName, 'r') as dest_file:
insert_section = False
file_content = dest_file.readlines()
for line in file_content:
line_idx += 1
if line == beginString:
insert_section = True
insert_begin = line_idx
continue
elif line == endString:
insert_section = False
break
if insert_section == True:
del_list.insert(0, line_idx)
for line_idx in del_list:
del file_content[line_idx]
line_idx = -1
with open(fileName, 'w') as dest_file:
for line in file_content:
line_idx += 1
dest_file.write(line)
if line_idx == insert_begin:
dest_file.write(insertString)
header_string = '\n'
header_string += '/*\n'
header_string += ' * Begin of autogenerated section. DO NOT EDIT.\n'
header_string += ' */\n'
header_string += '\n'
header_string += 'struct locate_item {\n'
header_string += '\tunsigned int guid;\n'
header_string += '\tconst char *name;\n'
header_string += '\tconst char *desc;\n'
header_string += '};\n\n'
header_string += 'enum {\n'
header_string += '\tLOCATE_UNKNOWN = 0U,\n'
for country in countries:
header_string += '\tLOCATE_' + country[0] + ',\n'
header_string += '\tLOCATE_MAX\t/* last element */\n'
header_string += '};\n'
header_string += '\n'
header_string += '/*\n'
header_string += ' * End of autogenerated section. YOU MAY CONTINUE.\n'
header_string += ' */\n\n'
source_string = '\n'
source_string += '/*\n'
source_string += ' * Begin of autogenerated section. DO NOT EDIT.\n'
source_string += ' */\n'
source_string += '\n'
source_string += 'static const struct locate_item locate_items[] = {\n'
source_string += '\t{ LOCATE_UNKNOWN, "", "unknown" },\t/* `unknown\' placeholder */\n'
for country in countries:
source_string += '\t{ LOCATE_' + country[0] + ', "' + country[0] + '", "' + country[1] + '" },\n'
source_string += '};\n\n'
source_string += '/*\n'
source_string += ' * End of autogenerated section. YOU MAY CONTINUE.\n'
source_string += ' */\n\n'
insert_into_file('lib/peak_locate.h', '#define PEAK_LOCATE_H\n', '#define LOCATE_MAGIC\t0x10CA7E10CA7E7412ull\n', header_string)
insert_into_file('lib/peak_locate.c', '#define LOCATE_DEFAULT\t"/usr/local/var/peak/locate.bin"\n', 'struct peak_locates {\n', source_string) |
#
# PySNMP MIB module HPN-ICF-LI-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-LI-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:27:25 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueSizeConstraint", "ValueRangeConstraint")
hpnicfCommon, = mibBuilder.importSymbols("HPN-ICF-OID-MIB", "hpnicfCommon")
InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero")
InetAddressType, InetAddressPrefixLength, InetAddress, InetPortNumber = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddressPrefixLength", "InetAddress", "InetPortNumber")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Counter32, Integer32, NotificationType, TimeTicks, Gauge32, ModuleIdentity, Unsigned32, Bits, MibIdentifier, IpAddress, Counter64, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Counter32", "Integer32", "NotificationType", "TimeTicks", "Gauge32", "ModuleIdentity", "Unsigned32", "Bits", "MibIdentifier", "IpAddress", "Counter64", "ObjectIdentity")
DisplayString, RowStatus, MacAddress, DateAndTime, TruthValue, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "RowStatus", "MacAddress", "DateAndTime", "TruthValue", "TextualConvention")
hpnicfLI = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111))
hpnicfLI.setRevisions(('2009-08-25 10:00',))
if mibBuilder.loadTexts: hpnicfLI.setLastUpdated('200908251000Z')
if mibBuilder.loadTexts: hpnicfLI.setOrganization('')
hpnicfLICommon = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1))
hpnicfLITrapBindObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 1))
hpnicfLIBoardInformation = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 1, 1), Unsigned32()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: hpnicfLIBoardInformation.setStatus('current')
hpnicfLINotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2))
hpnicfLINotificationsPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2, 0))
hpnicfLIActive = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2, 0, 1)).setObjects(("HPN-ICF-LI-MIB", "hpnicfLIStreamtype"))
if mibBuilder.loadTexts: hpnicfLIActive.setStatus('current')
hpnicfLITimeOut = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2, 0, 2)).setObjects(("HPN-ICF-LI-MIB", "hpnicfLIMediationRowStatus"))
if mibBuilder.loadTexts: hpnicfLITimeOut.setStatus('current')
hpnicfLIFailureInformation = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2, 0, 3)).setObjects(("HPN-ICF-LI-MIB", "hpnicfLIStreamtype"), ("HPN-ICF-LI-MIB", "hpnicfLIBoardInformation"))
if mibBuilder.loadTexts: hpnicfLIFailureInformation.setStatus('current')
hpnicfLIObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3))
hpnicfLINewIndex = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfLINewIndex.setStatus('current')
hpnicfLIMediationTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2), )
if mibBuilder.loadTexts: hpnicfLIMediationTable.setStatus('current')
hpnicfLIMediationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1), ).setIndexNames((0, "HPN-ICF-LI-MIB", "hpnicfLIMediationIndex"))
if mibBuilder.loadTexts: hpnicfLIMediationEntry.setStatus('current')
hpnicfLIMediationIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: hpnicfLIMediationIndex.setStatus('current')
hpnicfLIMediationDestAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 2), InetAddressType()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMediationDestAddrType.setStatus('current')
hpnicfLIMediationDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 3), InetAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMediationDestAddr.setStatus('current')
hpnicfLIMediationDestPort = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 4), InetPortNumber()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMediationDestPort.setStatus('current')
hpnicfLIMediationSrcInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 5), InterfaceIndexOrZero()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMediationSrcInterface.setStatus('current')
hpnicfLIMediationDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 6), Integer32().clone(34)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMediationDscp.setStatus('current')
hpnicfLIMediationTimeOut = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 7), DateAndTime()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMediationTimeOut.setStatus('current')
hpnicfLIMediationTransport = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("udp", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMediationTransport.setStatus('current')
hpnicfLIMediationNotificationEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 9), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMediationNotificationEnable.setStatus('current')
hpnicfLIMediationRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 10), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfLIMediationRowStatus.setStatus('current')
hpnicfLIStreamTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3), )
if mibBuilder.loadTexts: hpnicfLIStreamTable.setStatus('current')
hpnicfLIStreamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1), ).setIndexNames((0, "HPN-ICF-LI-MIB", "hpnicfLIMediationIndex"), (0, "HPN-ICF-LI-MIB", "hpnicfLIStreamIndex"))
if mibBuilder.loadTexts: hpnicfLIStreamEntry.setStatus('current')
hpnicfLIStreamIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: hpnicfLIStreamIndex.setStatus('current')
hpnicfLIStreamtype = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ip", 1), ("mac", 2), ("userConnection", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIStreamtype.setStatus('current')
hpnicfLIStreamEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 3), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIStreamEnable.setStatus('current')
hpnicfLIStreamPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfLIStreamPackets.setStatus('current')
hpnicfLIStreamDrops = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfLIStreamDrops.setStatus('current')
hpnicfLIStreamHPackets = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfLIStreamHPackets.setStatus('current')
hpnicfLIStreamHDrops = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfLIStreamHDrops.setStatus('current')
hpnicfLIStreamRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 8), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfLIStreamRowStatus.setStatus('current')
hpnicfLIIPStream = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2))
hpnicfLIIPStreamObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1))
hpnicfLIIPStreamTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1), )
if mibBuilder.loadTexts: hpnicfLIIPStreamTable.setStatus('current')
hpnicfLIIPStreamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1), ).setIndexNames((0, "HPN-ICF-LI-MIB", "hpnicfLIMediationIndex"), (0, "HPN-ICF-LI-MIB", "hpnicfLIStreamIndex"))
if mibBuilder.loadTexts: hpnicfLIIPStreamEntry.setStatus('current')
hpnicfLIIPStreamInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 1), InterfaceIndexOrZero()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamInterface.setStatus('current')
hpnicfLIIPStreamAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 2), InetAddressType().clone('ipv4')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamAddrType.setStatus('current')
hpnicfLIIPStreamDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 3), InetAddress().clone(hexValue="00000000")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamDestAddr.setStatus('current')
hpnicfLIIPStreamDestAddrLength = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 4), InetAddressPrefixLength()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamDestAddrLength.setStatus('current')
hpnicfLIIPStreamSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 5), InetAddress().clone(hexValue="00000000")).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamSrcAddr.setStatus('current')
hpnicfLIIPStreamSrcAddrLength = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 6), InetAddressPrefixLength()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamSrcAddrLength.setStatus('current')
hpnicfLIIPStreamTosByte = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamTosByte.setStatus('current')
hpnicfLIIPStreamTosByteMask = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamTosByteMask.setStatus('current')
hpnicfLIIPStreamFlowId = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 1048575), )).clone(-1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamFlowId.setStatus('current')
hpnicfLIIPStreamProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(0, 255), )).clone(-1)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamProtocol.setStatus('current')
hpnicfLIIPStreamDestL4PortMin = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 11), InetPortNumber()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamDestL4PortMin.setStatus('current')
hpnicfLIIPStreamDestL4PortMax = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 12), InetPortNumber().clone(65535)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamDestL4PortMax.setStatus('current')
hpnicfLIIPStreamSrcL4PortMin = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 13), InetPortNumber()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamSrcL4PortMin.setStatus('current')
hpnicfLIIPStreamSrcL4PortMax = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 14), InetPortNumber().clone(65535)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamSrcL4PortMax.setStatus('current')
hpnicfLIIPStreamVRF = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 15), SnmpAdminString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIIPStreamVRF.setStatus('current')
hpnicfLIIPStreamRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 18), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfLIIPStreamRowStatus.setStatus('current')
hpnicfLIMACStream = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3))
hpnicfLIMACStreamObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1))
hpnicfLIMACStreamTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1), )
if mibBuilder.loadTexts: hpnicfLIMACStreamTable.setStatus('current')
hpnicfLIMACStreamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1), ).setIndexNames((0, "HPN-ICF-LI-MIB", "hpnicfLIMediationIndex"), (0, "HPN-ICF-LI-MIB", "hpnicfLIStreamIndex"))
if mibBuilder.loadTexts: hpnicfLIMACStreamEntry.setStatus('current')
hpnicfLIMACStreamFields = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 1), Bits().clone(namedValues=NamedValues(("interface", 0), ("dstMacAddress", 1), ("srcMacAddress", 2), ("ethernetPid", 3), ("dSap", 4), ("sSap", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMACStreamFields.setStatus('current')
hpnicfLIMACStreamInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 2), InterfaceIndexOrZero()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMACStreamInterface.setStatus('current')
hpnicfLIMACStreamDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 3), MacAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMACStreamDestAddr.setStatus('current')
hpnicfLIMACStreamSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 4), MacAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMACStreamSrcAddr.setStatus('current')
hpnicfLIMACStreamEthPid = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 5), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMACStreamEthPid.setStatus('current')
hpnicfLIMACStreamDSap = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 6), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMACStreamDSap.setStatus('current')
hpnicfLIMACStreamSSap = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 7), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIMACStreamSSap.setStatus('current')
hpnicfLIMACStreamRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 8), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfLIMACStreamRowStatus.setStatus('current')
hpnicfLIUserStream = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4))
hpnicfLIUserStreamObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1))
hpnicfLIUserStreamTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1, 1), )
if mibBuilder.loadTexts: hpnicfLIUserStreamTable.setStatus('current')
hpnicfLIUserStreamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1, 1, 1), ).setIndexNames((0, "HPN-ICF-LI-MIB", "hpnicfLIMediationIndex"), (0, "HPN-ICF-LI-MIB", "hpnicfLIStreamIndex"))
if mibBuilder.loadTexts: hpnicfLIUserStreamEntry.setStatus('current')
hpnicfLIUserStreamAcctSessID = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 253))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hpnicfLIUserStreamAcctSessID.setStatus('current')
hpnicfLIUserStreamRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1, 1, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfLIUserStreamRowStatus.setStatus('current')
mibBuilder.exportSymbols("HPN-ICF-LI-MIB", hpnicfLIStreamDrops=hpnicfLIStreamDrops, hpnicfLIIPStreamDestAddrLength=hpnicfLIIPStreamDestAddrLength, hpnicfLIMACStreamFields=hpnicfLIMACStreamFields, hpnicfLIIPStreamSrcL4PortMax=hpnicfLIIPStreamSrcL4PortMax, hpnicfLIMediationRowStatus=hpnicfLIMediationRowStatus, hpnicfLIIPStream=hpnicfLIIPStream, hpnicfLIMACStreamTable=hpnicfLIMACStreamTable, hpnicfLIIPStreamFlowId=hpnicfLIIPStreamFlowId, hpnicfLIMediationSrcInterface=hpnicfLIMediationSrcInterface, hpnicfLIMACStreamSrcAddr=hpnicfLIMACStreamSrcAddr, hpnicfLIMACStreamRowStatus=hpnicfLIMACStreamRowStatus, hpnicfLIIPStreamDestL4PortMax=hpnicfLIIPStreamDestL4PortMax, hpnicfLIUserStreamTable=hpnicfLIUserStreamTable, hpnicfLIUserStreamEntry=hpnicfLIUserStreamEntry, hpnicfLIIPStreamTable=hpnicfLIIPStreamTable, PYSNMP_MODULE_ID=hpnicfLI, hpnicfLIMediationIndex=hpnicfLIMediationIndex, hpnicfLIIPStreamProtocol=hpnicfLIIPStreamProtocol, hpnicfLITrapBindObjects=hpnicfLITrapBindObjects, hpnicfLIMediationDestAddrType=hpnicfLIMediationDestAddrType, hpnicfLIMediationEntry=hpnicfLIMediationEntry, hpnicfLIIPStreamInterface=hpnicfLIIPStreamInterface, hpnicfLIMediationTransport=hpnicfLIMediationTransport, hpnicfLIIPStreamDestL4PortMin=hpnicfLIIPStreamDestL4PortMin, hpnicfLIMACStreamEthPid=hpnicfLIMACStreamEthPid, hpnicfLIStreamRowStatus=hpnicfLIStreamRowStatus, hpnicfLIMACStreamObjects=hpnicfLIMACStreamObjects, hpnicfLIStreamtype=hpnicfLIStreamtype, hpnicfLINotifications=hpnicfLINotifications, hpnicfLIIPStreamVRF=hpnicfLIIPStreamVRF, hpnicfLIStreamEnable=hpnicfLIStreamEnable, hpnicfLI=hpnicfLI, hpnicfLIIPStreamObjects=hpnicfLIIPStreamObjects, hpnicfLIIPStreamSrcAddr=hpnicfLIIPStreamSrcAddr, hpnicfLIFailureInformation=hpnicfLIFailureInformation, hpnicfLIIPStreamSrcAddrLength=hpnicfLIIPStreamSrcAddrLength, hpnicfLIMediationNotificationEnable=hpnicfLIMediationNotificationEnable, hpnicfLIMediationTimeOut=hpnicfLIMediationTimeOut, hpnicfLITimeOut=hpnicfLITimeOut, hpnicfLIStreamTable=hpnicfLIStreamTable, hpnicfLIIPStreamAddrType=hpnicfLIIPStreamAddrType, hpnicfLIUserStreamObjects=hpnicfLIUserStreamObjects, hpnicfLIMediationTable=hpnicfLIMediationTable, hpnicfLIMediationDestPort=hpnicfLIMediationDestPort, hpnicfLIMACStreamInterface=hpnicfLIMACStreamInterface, hpnicfLIIPStreamTosByte=hpnicfLIIPStreamTosByte, hpnicfLIMACStreamSSap=hpnicfLIMACStreamSSap, hpnicfLINotificationsPrefix=hpnicfLINotificationsPrefix, hpnicfLIIPStreamEntry=hpnicfLIIPStreamEntry, hpnicfLIIPStreamTosByteMask=hpnicfLIIPStreamTosByteMask, hpnicfLIUserStreamAcctSessID=hpnicfLIUserStreamAcctSessID, hpnicfLIIPStreamDestAddr=hpnicfLIIPStreamDestAddr, hpnicfLIMACStreamDestAddr=hpnicfLIMACStreamDestAddr, hpnicfLIStreamHPackets=hpnicfLIStreamHPackets, hpnicfLIUserStreamRowStatus=hpnicfLIUserStreamRowStatus, hpnicfLIMediationDestAddr=hpnicfLIMediationDestAddr, hpnicfLIIPStreamSrcL4PortMin=hpnicfLIIPStreamSrcL4PortMin, hpnicfLIBoardInformation=hpnicfLIBoardInformation, hpnicfLIMACStreamEntry=hpnicfLIMACStreamEntry, hpnicfLINewIndex=hpnicfLINewIndex, hpnicfLIStreamIndex=hpnicfLIStreamIndex, hpnicfLIMACStream=hpnicfLIMACStream, hpnicfLIIPStreamRowStatus=hpnicfLIIPStreamRowStatus, hpnicfLIStreamEntry=hpnicfLIStreamEntry, hpnicfLICommon=hpnicfLICommon, hpnicfLIStreamPackets=hpnicfLIStreamPackets, hpnicfLIMediationDscp=hpnicfLIMediationDscp, hpnicfLIStreamHDrops=hpnicfLIStreamHDrops, hpnicfLIObjects=hpnicfLIObjects, hpnicfLIActive=hpnicfLIActive, hpnicfLIMACStreamDSap=hpnicfLIMACStreamDSap, hpnicfLIUserStream=hpnicfLIUserStream)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, constraints_union, constraints_intersection, value_size_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ValueRangeConstraint')
(hpnicf_common,) = mibBuilder.importSymbols('HPN-ICF-OID-MIB', 'hpnicfCommon')
(interface_index_or_zero,) = mibBuilder.importSymbols('IF-MIB', 'InterfaceIndexOrZero')
(inet_address_type, inet_address_prefix_length, inet_address, inet_port_number) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressType', 'InetAddressPrefixLength', 'InetAddress', 'InetPortNumber')
(snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString')
(notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance')
(mib_scalar, mib_table, mib_table_row, mib_table_column, iso, counter32, integer32, notification_type, time_ticks, gauge32, module_identity, unsigned32, bits, mib_identifier, ip_address, counter64, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'Counter32', 'Integer32', 'NotificationType', 'TimeTicks', 'Gauge32', 'ModuleIdentity', 'Unsigned32', 'Bits', 'MibIdentifier', 'IpAddress', 'Counter64', 'ObjectIdentity')
(display_string, row_status, mac_address, date_and_time, truth_value, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'RowStatus', 'MacAddress', 'DateAndTime', 'TruthValue', 'TextualConvention')
hpnicf_li = module_identity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111))
hpnicfLI.setRevisions(('2009-08-25 10:00',))
if mibBuilder.loadTexts:
hpnicfLI.setLastUpdated('200908251000Z')
if mibBuilder.loadTexts:
hpnicfLI.setOrganization('')
hpnicf_li_common = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1))
hpnicf_li_trap_bind_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 1))
hpnicf_li_board_information = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 1, 1), unsigned32()).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
hpnicfLIBoardInformation.setStatus('current')
hpnicf_li_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2))
hpnicf_li_notifications_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2, 0))
hpnicf_li_active = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2, 0, 1)).setObjects(('HPN-ICF-LI-MIB', 'hpnicfLIStreamtype'))
if mibBuilder.loadTexts:
hpnicfLIActive.setStatus('current')
hpnicf_li_time_out = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2, 0, 2)).setObjects(('HPN-ICF-LI-MIB', 'hpnicfLIMediationRowStatus'))
if mibBuilder.loadTexts:
hpnicfLITimeOut.setStatus('current')
hpnicf_li_failure_information = notification_type((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 2, 0, 3)).setObjects(('HPN-ICF-LI-MIB', 'hpnicfLIStreamtype'), ('HPN-ICF-LI-MIB', 'hpnicfLIBoardInformation'))
if mibBuilder.loadTexts:
hpnicfLIFailureInformation.setStatus('current')
hpnicf_li_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3))
hpnicf_li_new_index = mib_scalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hpnicfLINewIndex.setStatus('current')
hpnicf_li_mediation_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2))
if mibBuilder.loadTexts:
hpnicfLIMediationTable.setStatus('current')
hpnicf_li_mediation_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1)).setIndexNames((0, 'HPN-ICF-LI-MIB', 'hpnicfLIMediationIndex'))
if mibBuilder.loadTexts:
hpnicfLIMediationEntry.setStatus('current')
hpnicf_li_mediation_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647)))
if mibBuilder.loadTexts:
hpnicfLIMediationIndex.setStatus('current')
hpnicf_li_mediation_dest_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 2), inet_address_type()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMediationDestAddrType.setStatus('current')
hpnicf_li_mediation_dest_addr = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 3), inet_address()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMediationDestAddr.setStatus('current')
hpnicf_li_mediation_dest_port = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 4), inet_port_number()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMediationDestPort.setStatus('current')
hpnicf_li_mediation_src_interface = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 5), interface_index_or_zero()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMediationSrcInterface.setStatus('current')
hpnicf_li_mediation_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 6), integer32().clone(34)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMediationDscp.setStatus('current')
hpnicf_li_mediation_time_out = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 7), date_and_time()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMediationTimeOut.setStatus('current')
hpnicf_li_mediation_transport = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1))).clone(namedValues=named_values(('udp', 1)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMediationTransport.setStatus('current')
hpnicf_li_mediation_notification_enable = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 9), truth_value().clone('true')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMediationNotificationEnable.setStatus('current')
hpnicf_li_mediation_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 2, 1, 10), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hpnicfLIMediationRowStatus.setStatus('current')
hpnicf_li_stream_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3))
if mibBuilder.loadTexts:
hpnicfLIStreamTable.setStatus('current')
hpnicf_li_stream_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1)).setIndexNames((0, 'HPN-ICF-LI-MIB', 'hpnicfLIMediationIndex'), (0, 'HPN-ICF-LI-MIB', 'hpnicfLIStreamIndex'))
if mibBuilder.loadTexts:
hpnicfLIStreamEntry.setStatus('current')
hpnicf_li_stream_index = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647)))
if mibBuilder.loadTexts:
hpnicfLIStreamIndex.setStatus('current')
hpnicf_li_streamtype = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('ip', 1), ('mac', 2), ('userConnection', 3)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIStreamtype.setStatus('current')
hpnicf_li_stream_enable = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 3), truth_value().clone('false')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIStreamEnable.setStatus('current')
hpnicf_li_stream_packets = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hpnicfLIStreamPackets.setStatus('current')
hpnicf_li_stream_drops = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hpnicfLIStreamDrops.setStatus('current')
hpnicf_li_stream_h_packets = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hpnicfLIStreamHPackets.setStatus('current')
hpnicf_li_stream_h_drops = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hpnicfLIStreamHDrops.setStatus('current')
hpnicf_li_stream_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 1, 3, 3, 1, 8), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hpnicfLIStreamRowStatus.setStatus('current')
hpnicf_liip_stream = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2))
hpnicf_liip_stream_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1))
hpnicf_liip_stream_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1))
if mibBuilder.loadTexts:
hpnicfLIIPStreamTable.setStatus('current')
hpnicf_liip_stream_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1)).setIndexNames((0, 'HPN-ICF-LI-MIB', 'hpnicfLIMediationIndex'), (0, 'HPN-ICF-LI-MIB', 'hpnicfLIStreamIndex'))
if mibBuilder.loadTexts:
hpnicfLIIPStreamEntry.setStatus('current')
hpnicf_liip_stream_interface = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 1), interface_index_or_zero()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamInterface.setStatus('current')
hpnicf_liip_stream_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 2), inet_address_type().clone('ipv4')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamAddrType.setStatus('current')
hpnicf_liip_stream_dest_addr = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 3), inet_address().clone(hexValue='00000000')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamDestAddr.setStatus('current')
hpnicf_liip_stream_dest_addr_length = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 4), inet_address_prefix_length()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamDestAddrLength.setStatus('current')
hpnicf_liip_stream_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 5), inet_address().clone(hexValue='00000000')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamSrcAddr.setStatus('current')
hpnicf_liip_stream_src_addr_length = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 6), inet_address_prefix_length()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamSrcAddrLength.setStatus('current')
hpnicf_liip_stream_tos_byte = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamTosByte.setStatus('current')
hpnicf_liip_stream_tos_byte_mask = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamTosByteMask.setStatus('current')
hpnicf_liip_stream_flow_id = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 9), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 1048575))).clone(-1)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamFlowId.setStatus('current')
hpnicf_liip_stream_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 10), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(-1, -1), value_range_constraint(0, 255))).clone(-1)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamProtocol.setStatus('current')
hpnicf_liip_stream_dest_l4_port_min = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 11), inet_port_number()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamDestL4PortMin.setStatus('current')
hpnicf_liip_stream_dest_l4_port_max = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 12), inet_port_number().clone(65535)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamDestL4PortMax.setStatus('current')
hpnicf_liip_stream_src_l4_port_min = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 13), inet_port_number()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamSrcL4PortMin.setStatus('current')
hpnicf_liip_stream_src_l4_port_max = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 14), inet_port_number().clone(65535)).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamSrcL4PortMax.setStatus('current')
hpnicf_liip_stream_vrf = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 15), snmp_admin_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIIPStreamVRF.setStatus('current')
hpnicf_liip_stream_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 2, 1, 1, 1, 18), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hpnicfLIIPStreamRowStatus.setStatus('current')
hpnicf_limac_stream = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3))
hpnicf_limac_stream_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1))
hpnicf_limac_stream_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1))
if mibBuilder.loadTexts:
hpnicfLIMACStreamTable.setStatus('current')
hpnicf_limac_stream_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1)).setIndexNames((0, 'HPN-ICF-LI-MIB', 'hpnicfLIMediationIndex'), (0, 'HPN-ICF-LI-MIB', 'hpnicfLIStreamIndex'))
if mibBuilder.loadTexts:
hpnicfLIMACStreamEntry.setStatus('current')
hpnicf_limac_stream_fields = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 1), bits().clone(namedValues=named_values(('interface', 0), ('dstMacAddress', 1), ('srcMacAddress', 2), ('ethernetPid', 3), ('dSap', 4), ('sSap', 5)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMACStreamFields.setStatus('current')
hpnicf_limac_stream_interface = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 2), interface_index_or_zero()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMACStreamInterface.setStatus('current')
hpnicf_limac_stream_dest_addr = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 3), mac_address()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMACStreamDestAddr.setStatus('current')
hpnicf_limac_stream_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 4), mac_address()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMACStreamSrcAddr.setStatus('current')
hpnicf_limac_stream_eth_pid = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 5), unsigned32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMACStreamEthPid.setStatus('current')
hpnicf_limac_stream_d_sap = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 6), unsigned32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMACStreamDSap.setStatus('current')
hpnicf_limac_stream_s_sap = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 7), unsigned32()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIMACStreamSSap.setStatus('current')
hpnicf_limac_stream_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 3, 1, 1, 1, 8), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hpnicfLIMACStreamRowStatus.setStatus('current')
hpnicf_li_user_stream = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4))
hpnicf_li_user_stream_objects = mib_identifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1))
hpnicf_li_user_stream_table = mib_table((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1, 1))
if mibBuilder.loadTexts:
hpnicfLIUserStreamTable.setStatus('current')
hpnicf_li_user_stream_entry = mib_table_row((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1, 1, 1)).setIndexNames((0, 'HPN-ICF-LI-MIB', 'hpnicfLIMediationIndex'), (0, 'HPN-ICF-LI-MIB', 'hpnicfLIStreamIndex'))
if mibBuilder.loadTexts:
hpnicfLIUserStreamEntry.setStatus('current')
hpnicf_li_user_stream_acct_sess_id = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1, 1, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(0, 253))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hpnicfLIUserStreamAcctSessID.setStatus('current')
hpnicf_li_user_stream_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 111, 4, 1, 1, 1, 2), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
hpnicfLIUserStreamRowStatus.setStatus('current')
mibBuilder.exportSymbols('HPN-ICF-LI-MIB', hpnicfLIStreamDrops=hpnicfLIStreamDrops, hpnicfLIIPStreamDestAddrLength=hpnicfLIIPStreamDestAddrLength, hpnicfLIMACStreamFields=hpnicfLIMACStreamFields, hpnicfLIIPStreamSrcL4PortMax=hpnicfLIIPStreamSrcL4PortMax, hpnicfLIMediationRowStatus=hpnicfLIMediationRowStatus, hpnicfLIIPStream=hpnicfLIIPStream, hpnicfLIMACStreamTable=hpnicfLIMACStreamTable, hpnicfLIIPStreamFlowId=hpnicfLIIPStreamFlowId, hpnicfLIMediationSrcInterface=hpnicfLIMediationSrcInterface, hpnicfLIMACStreamSrcAddr=hpnicfLIMACStreamSrcAddr, hpnicfLIMACStreamRowStatus=hpnicfLIMACStreamRowStatus, hpnicfLIIPStreamDestL4PortMax=hpnicfLIIPStreamDestL4PortMax, hpnicfLIUserStreamTable=hpnicfLIUserStreamTable, hpnicfLIUserStreamEntry=hpnicfLIUserStreamEntry, hpnicfLIIPStreamTable=hpnicfLIIPStreamTable, PYSNMP_MODULE_ID=hpnicfLI, hpnicfLIMediationIndex=hpnicfLIMediationIndex, hpnicfLIIPStreamProtocol=hpnicfLIIPStreamProtocol, hpnicfLITrapBindObjects=hpnicfLITrapBindObjects, hpnicfLIMediationDestAddrType=hpnicfLIMediationDestAddrType, hpnicfLIMediationEntry=hpnicfLIMediationEntry, hpnicfLIIPStreamInterface=hpnicfLIIPStreamInterface, hpnicfLIMediationTransport=hpnicfLIMediationTransport, hpnicfLIIPStreamDestL4PortMin=hpnicfLIIPStreamDestL4PortMin, hpnicfLIMACStreamEthPid=hpnicfLIMACStreamEthPid, hpnicfLIStreamRowStatus=hpnicfLIStreamRowStatus, hpnicfLIMACStreamObjects=hpnicfLIMACStreamObjects, hpnicfLIStreamtype=hpnicfLIStreamtype, hpnicfLINotifications=hpnicfLINotifications, hpnicfLIIPStreamVRF=hpnicfLIIPStreamVRF, hpnicfLIStreamEnable=hpnicfLIStreamEnable, hpnicfLI=hpnicfLI, hpnicfLIIPStreamObjects=hpnicfLIIPStreamObjects, hpnicfLIIPStreamSrcAddr=hpnicfLIIPStreamSrcAddr, hpnicfLIFailureInformation=hpnicfLIFailureInformation, hpnicfLIIPStreamSrcAddrLength=hpnicfLIIPStreamSrcAddrLength, hpnicfLIMediationNotificationEnable=hpnicfLIMediationNotificationEnable, hpnicfLIMediationTimeOut=hpnicfLIMediationTimeOut, hpnicfLITimeOut=hpnicfLITimeOut, hpnicfLIStreamTable=hpnicfLIStreamTable, hpnicfLIIPStreamAddrType=hpnicfLIIPStreamAddrType, hpnicfLIUserStreamObjects=hpnicfLIUserStreamObjects, hpnicfLIMediationTable=hpnicfLIMediationTable, hpnicfLIMediationDestPort=hpnicfLIMediationDestPort, hpnicfLIMACStreamInterface=hpnicfLIMACStreamInterface, hpnicfLIIPStreamTosByte=hpnicfLIIPStreamTosByte, hpnicfLIMACStreamSSap=hpnicfLIMACStreamSSap, hpnicfLINotificationsPrefix=hpnicfLINotificationsPrefix, hpnicfLIIPStreamEntry=hpnicfLIIPStreamEntry, hpnicfLIIPStreamTosByteMask=hpnicfLIIPStreamTosByteMask, hpnicfLIUserStreamAcctSessID=hpnicfLIUserStreamAcctSessID, hpnicfLIIPStreamDestAddr=hpnicfLIIPStreamDestAddr, hpnicfLIMACStreamDestAddr=hpnicfLIMACStreamDestAddr, hpnicfLIStreamHPackets=hpnicfLIStreamHPackets, hpnicfLIUserStreamRowStatus=hpnicfLIUserStreamRowStatus, hpnicfLIMediationDestAddr=hpnicfLIMediationDestAddr, hpnicfLIIPStreamSrcL4PortMin=hpnicfLIIPStreamSrcL4PortMin, hpnicfLIBoardInformation=hpnicfLIBoardInformation, hpnicfLIMACStreamEntry=hpnicfLIMACStreamEntry, hpnicfLINewIndex=hpnicfLINewIndex, hpnicfLIStreamIndex=hpnicfLIStreamIndex, hpnicfLIMACStream=hpnicfLIMACStream, hpnicfLIIPStreamRowStatus=hpnicfLIIPStreamRowStatus, hpnicfLIStreamEntry=hpnicfLIStreamEntry, hpnicfLICommon=hpnicfLICommon, hpnicfLIStreamPackets=hpnicfLIStreamPackets, hpnicfLIMediationDscp=hpnicfLIMediationDscp, hpnicfLIStreamHDrops=hpnicfLIStreamHDrops, hpnicfLIObjects=hpnicfLIObjects, hpnicfLIActive=hpnicfLIActive, hpnicfLIMACStreamDSap=hpnicfLIMACStreamDSap, hpnicfLIUserStream=hpnicfLIUserStream) |
def inorder(root):
res = []
if not root:
return res
stack = []
while root and stack:
while root:
stack.append(root)
root = root.left
root = stack.pop()
res.add(root.val)
root = root.right
return res
| def inorder(root):
res = []
if not root:
return res
stack = []
while root and stack:
while root:
stack.append(root)
root = root.left
root = stack.pop()
res.add(root.val)
root = root.right
return res |
class Solution:
def partition(self, s: str) -> list[list[str]]:
# TODO: add explanation, make clearer
if len(s) == 0:
return [[]]
result = []
def backtrack(current: list[str], prefix: str) -> None:
if len(prefix) == 0:
result.append(current)
return
for index in range(1, len(prefix)+1):
substring = prefix[:index]
if substring == substring[::-1]:
backtrack(current + [substring], prefix[index:])
backtrack([], s)
return result
tests = [
(
("aab",),
[["a", "a", "b"], ["aa", "b"]],
),
(
("a",),
[["a"]],
),
]
| class Solution:
def partition(self, s: str) -> list[list[str]]:
if len(s) == 0:
return [[]]
result = []
def backtrack(current: list[str], prefix: str) -> None:
if len(prefix) == 0:
result.append(current)
return
for index in range(1, len(prefix) + 1):
substring = prefix[:index]
if substring == substring[::-1]:
backtrack(current + [substring], prefix[index:])
backtrack([], s)
return result
tests = [(('aab',), [['a', 'a', 'b'], ['aa', 'b']]), (('a',), [['a']])] |
def geobox2rect(geobox):
x, y, w, h = geobox
return x - int(w / 2), y - int(h / 2), w, h
def geobox2ptrect(geobox):
x, y, w, h = geobox2rect(geobox)
return x, y, x + w, y + h
def rect2geobox(x, y, w, h):
return x + int(w / 2), y + int(h / 2), w, h
def ptrect2geobox(x1, y1, x2, y2):
return rect2geobox(x1, y1, x2 - x1, y2 - y1)
def bbox2rect(bbox):
return geobox2rect(bbox2geobox(bbox))
def bbox2lt(bbox):
x1, y1, x2, y2 = geobox2ptrect(bbox2geobox(bbox))
return x1, y1
def bbox2lb(bbox):
x1, y1, x2, y2 = geobox2ptrect(bbox2geobox(bbox))
return x1, y2
def bbox2rt(bbox):
x1, y1, x2, y2 = geobox2ptrect(bbox2geobox(bbox))
return x2, y1
def bbox2rb(bbox):
x1, y1, x2, y2 = geobox2ptrect(bbox2geobox(bbox))
return x2, y2
def bbox2name(bbox):
return bbox[0]
def bbox2score(bbox):
return bbox[1]
def bbox2geobox(bbox):
return bbox[2]
def bbox2center(bbox):
return bbox[2][:2]
def to_box(name, score, geobox):
return name, score, geobox
def margin_geobox(geobox, margin_ratio):
x, y, w, h = geobox
w_margin = int(w * margin_ratio)
h_margin = int(h * margin_ratio)
return x, y, w + (2 * w_margin), h + (2 * h_margin)
def margin_box(box, margin_ratio):
name, score, geobox = box
geobox = margin_geobox(geobox, margin_ratio)
return to_box(name, score, geobox)
| def geobox2rect(geobox):
(x, y, w, h) = geobox
return (x - int(w / 2), y - int(h / 2), w, h)
def geobox2ptrect(geobox):
(x, y, w, h) = geobox2rect(geobox)
return (x, y, x + w, y + h)
def rect2geobox(x, y, w, h):
return (x + int(w / 2), y + int(h / 2), w, h)
def ptrect2geobox(x1, y1, x2, y2):
return rect2geobox(x1, y1, x2 - x1, y2 - y1)
def bbox2rect(bbox):
return geobox2rect(bbox2geobox(bbox))
def bbox2lt(bbox):
(x1, y1, x2, y2) = geobox2ptrect(bbox2geobox(bbox))
return (x1, y1)
def bbox2lb(bbox):
(x1, y1, x2, y2) = geobox2ptrect(bbox2geobox(bbox))
return (x1, y2)
def bbox2rt(bbox):
(x1, y1, x2, y2) = geobox2ptrect(bbox2geobox(bbox))
return (x2, y1)
def bbox2rb(bbox):
(x1, y1, x2, y2) = geobox2ptrect(bbox2geobox(bbox))
return (x2, y2)
def bbox2name(bbox):
return bbox[0]
def bbox2score(bbox):
return bbox[1]
def bbox2geobox(bbox):
return bbox[2]
def bbox2center(bbox):
return bbox[2][:2]
def to_box(name, score, geobox):
return (name, score, geobox)
def margin_geobox(geobox, margin_ratio):
(x, y, w, h) = geobox
w_margin = int(w * margin_ratio)
h_margin = int(h * margin_ratio)
return (x, y, w + 2 * w_margin, h + 2 * h_margin)
def margin_box(box, margin_ratio):
(name, score, geobox) = box
geobox = margin_geobox(geobox, margin_ratio)
return to_box(name, score, geobox) |
def pythag_triple(n):
for a in range(1, n // 2):
b = (n**2/2 - n*a)/(n - a)
if b.is_integer():
return int(a*b*(n - a - b))
return None
print(pythag_triple(1000))
# Copyright Junipyr. All rights reserved.
# https://github.com/Junipyr | def pythag_triple(n):
for a in range(1, n // 2):
b = (n ** 2 / 2 - n * a) / (n - a)
if b.is_integer():
return int(a * b * (n - a - b))
return None
print(pythag_triple(1000)) |
mylitta = [1, 2, 3, 4, 5]
l2 = list([1, 2, 3, 4, 5])
l3 = list("casa de papel")
l4 = "alberto torres".split()
l5 = "alberto torres,carolina torres,mauricio torres".split(",")
cadena = " - ".join(l5)
mylitta = mylitta + [12, 13]
mylitta += [15, 16]
mylitta.append(9)
mylitta.extend([10, 11])
print(mylitta)
print(l2)
print(l3)
print(l4)
print(l5)
print(cadena)
print(l3.index("s"))
print(l3[-2])
| mylitta = [1, 2, 3, 4, 5]
l2 = list([1, 2, 3, 4, 5])
l3 = list('casa de papel')
l4 = 'alberto torres'.split()
l5 = 'alberto torres,carolina torres,mauricio torres'.split(',')
cadena = ' - '.join(l5)
mylitta = mylitta + [12, 13]
mylitta += [15, 16]
mylitta.append(9)
mylitta.extend([10, 11])
print(mylitta)
print(l2)
print(l3)
print(l4)
print(l5)
print(cadena)
print(l3.index('s'))
print(l3[-2]) |
# open the fil2.txt in read mode. causes error if no such file exists.
fileptr = open("file2.txt", "r")
# stores all the data of the file into the variable content
content = fileptr.readlines()
# prints the content of the file
print(content)
# closes the opened file
fileptr.close() | fileptr = open('file2.txt', 'r')
content = fileptr.readlines()
print(content)
fileptr.close() |
# Advent of Code 2017
#
# From https://adventofcode.com/2017/day/4
#
passwords = [row.strip().split() for row in open('../inputs/Advent2017_04.txt', 'r')]
print(sum(len(row) == len(set(row)) for row in passwords))
print(sum(len(row) == len(set("".join(sorted(x)) for x in row)) for row in passwords))
| passwords = [row.strip().split() for row in open('../inputs/Advent2017_04.txt', 'r')]
print(sum((len(row) == len(set(row)) for row in passwords)))
print(sum((len(row) == len(set((''.join(sorted(x)) for x in row))) for row in passwords))) |
'''
Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
Clarification:
Confused why the returned value is an integer but your answer is an array?
Note that the input array is passed in by reference, which means a modification to the input array will be known to the caller as well.
Internally you can think of this:
// nums is passed in by reference. (i.e., without making a copy)
int len = removeDuplicates(nums);
// any modification to nums in your function would be known by the caller.
// using the length returned by your function, it prints the first len elements.
for (int i = 0; i < len; i++) {
print(nums[i]);
}
Example 1:
Input: nums = [1,1,2]
Output: 2, nums = [1,2]
Explanation: Your function should return length = 2, with the first two elements of nums being 1 and 2 respectively. It doesn't matter what you leave beyond the returned length.
Example 2:
Input: nums = [0,0,1,1,1,2,2,3,3,4]
Output: 5, nums = [0,1,2,3,4]
Explanation: Your function should return length = 5, with the first five elements of nums being modified to 0, 1, 2, 3, and 4 respectively. It doesn't matter what values are set beyond the returned length.
Constraints:
0 <= nums.length <= 3 * 104
-104 <= nums[i] <= 104
nums is sorted in ascending order.
'''
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
new_len = len(nums)
if new_len == 0:
return 0
else:
# define counters and constants
target = nums[0]
# target2 = None ## needs to be unique
counter = 0
# clean the array
for idx in range(1,len(nums)):
if nums[idx]==target:
# if counter>0:
# nums[idx] = target2
counter += 1
new_len -= 1
else:
target = nums[idx]
if counter > 0:
nums[idx-counter] = nums[idx]
# nums[idx] = target2
# print(idx,target,nums,new_len)
return new_len
| """
Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
Clarification:
Confused why the returned value is an integer but your answer is an array?
Note that the input array is passed in by reference, which means a modification to the input array will be known to the caller as well.
Internally you can think of this:
// nums is passed in by reference. (i.e., without making a copy)
int len = removeDuplicates(nums);
// any modification to nums in your function would be known by the caller.
// using the length returned by your function, it prints the first len elements.
for (int i = 0; i < len; i++) {
print(nums[i]);
}
Example 1:
Input: nums = [1,1,2]
Output: 2, nums = [1,2]
Explanation: Your function should return length = 2, with the first two elements of nums being 1 and 2 respectively. It doesn't matter what you leave beyond the returned length.
Example 2:
Input: nums = [0,0,1,1,1,2,2,3,3,4]
Output: 5, nums = [0,1,2,3,4]
Explanation: Your function should return length = 5, with the first five elements of nums being modified to 0, 1, 2, 3, and 4 respectively. It doesn't matter what values are set beyond the returned length.
Constraints:
0 <= nums.length <= 3 * 104
-104 <= nums[i] <= 104
nums is sorted in ascending order.
"""
class Solution:
def remove_duplicates(self, nums: List[int]) -> int:
new_len = len(nums)
if new_len == 0:
return 0
else:
target = nums[0]
counter = 0
for idx in range(1, len(nums)):
if nums[idx] == target:
counter += 1
new_len -= 1
else:
target = nums[idx]
if counter > 0:
nums[idx - counter] = nums[idx]
return new_len |
def findLargest(l):
lo , hi = 0 , len(l)
left , right = l[0] , l[-1]
while(lo<hi):
mid = (lo + hi)//2
if(left > l[mid]):
hi = mid
else:
lo = mid +1
return l[lo-1]
| def find_largest(l):
(lo, hi) = (0, len(l))
(left, right) = (l[0], l[-1])
while lo < hi:
mid = (lo + hi) // 2
if left > l[mid]:
hi = mid
else:
lo = mid + 1
return l[lo - 1] |
def rule(event):
# Only check actions creating a new Network ACL entry
if event['eventName'] != 'CreateNetworkAclEntry':
return False
# Check if this new NACL entry is allowing traffic from anywhere
return (event['requestParameters']['cidrBlock'] == '0.0.0.0/0' and
event['requestParameters']['ruleAction'] == 'allow' and
event['requestParameters']['egress'] is False)
| def rule(event):
if event['eventName'] != 'CreateNetworkAclEntry':
return False
return event['requestParameters']['cidrBlock'] == '0.0.0.0/0' and event['requestParameters']['ruleAction'] == 'allow' and (event['requestParameters']['egress'] is False) |
_base_ = [
'./coco_data_pipeline.py'
]
model = dict(
type='MaskRCNN',
backbone=dict(
type='efficientnet_b2b',
out_indices=(2, 3, 4, 5),
frozen_stages=-1,
pretrained=True,
activation_cfg=dict(type='torch_swish'),
norm_cfg=dict(type='BN', requires_grad=True)),
neck=dict(
type='FPN',
in_channels=[24, 48, 120, 352],
out_channels=80,
num_outs=5),
rpn_head=dict(
type='RPNHead',
in_channels=80,
feat_channels=80,
anchor_generator=dict(
type='AnchorGenerator',
scales=[8],
ratios=[0.5, 1.0, 2.0],
strides=[4, 8, 16, 32, 64]),
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0.0, 0.0, 0.0, 0.0],
target_stds=[1.0, 1.0, 1.0, 1.0]),
loss_cls=dict(
type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0),
loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
roi_head=dict(
type='StandardRoIHead',
bbox_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0),
out_channels=80,
featmap_strides=[4, 8, 16, 32]),
bbox_head=dict(
type='Shared2FCBBoxHead',
in_channels=80,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=80,
bbox_coder=dict(
type='DeltaXYWHBBoxCoder',
target_means=[0.0, 0.0, 0.0, 0.0],
target_stds=[0.1, 0.1, 0.2, 0.2]),
reg_class_agnostic=False,
loss_cls=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
loss_bbox=dict(type='L1Loss', loss_weight=1.0)),
mask_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
out_channels=80,
featmap_strides=[4, 8, 16, 32]),
mask_head=dict(
type='FCNMaskHead',
num_convs=4,
in_channels=80,
conv_out_channels=80,
num_classes=80,
loss_mask=dict(
type='CrossEntropyLoss', use_mask=True, loss_weight=1.0))),
train_cfg=dict(
rpn=dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.7,
neg_iou_thr=0.3,
min_pos_iou=0.3,
match_low_quality=True,
ignore_iof_thr=-1,
gpu_assign_thr=300),
sampler=dict(
type='RandomSampler',
num=256,
pos_fraction=0.5,
neg_pos_ub=-1,
add_gt_as_proposals=False),
allowed_border=-1,
pos_weight=-1,
debug=False),
rpn_proposal=dict(
nms_across_levels=False,
nms_pre=2000,
nms_post=1000,
max_num=1000,
nms_thr=0.8,
min_bbox_size=0),
rcnn=dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.5,
neg_iou_thr=0.5,
min_pos_iou=0.5,
match_low_quality=True,
ignore_iof_thr=-1,
gpu_assign_thr=300),
sampler=dict(
type='RandomSampler',
num=256,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
mask_size=28,
pos_weight=-1,
debug=False)),
test_cfg=dict(
rpn=dict(
nms_across_levels=False,
nms_pre=800,
nms_post=500,
max_num=500,
nms_thr=0.8,
min_bbox_size=0),
rcnn=dict(
score_thr=0.05,
nms=dict(type='nms', iou_threshold=0.7),
max_per_img=500,
mask_thr_binary=0.5)))
cudnn_benchmark = True
evaluation = dict(interval=1, metric='mAP', save_best='mAP', iou_thr=[0.5 , 0.55, 0.6 , 0.65, 0.7 , 0.75, 0.8 , 0.85, 0.9, 0.95])
optimizer = dict(type='SGD', lr=0.015, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=None)
lr_config = dict(
policy='ReduceLROnPlateau',
metric='mAP',
patience=5,
iteration_patience=300,
interval=1,
min_lr=0.000001,
warmup='linear',
warmup_iters=200,
warmup_ratio=0.3333333333333333
)
runner = dict(type='EpochRunnerWithCancel', max_epochs=300)
checkpoint_config = dict(interval=5)
log_config = dict(
interval=1,
hooks=[
dict(type='TextLoggerHook'),
# dict(type='TensorboardLoggerHook'),
])
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = 'https://storage.openvinotoolkit.org/repositories/openvino_training_extensions/models/instance_segmentation/v2/efficientnet_b2b-mask_rcnn-576x576.pth'
resume_from = None
workflow = [('train', 1)]
work_dir = 'output'
custom_hooks = [
dict(type='EarlyStoppingHook', patience=10, metric='mAP',
interval=1, priority=75, iteration_patience=0),
]
fp16 = dict(loss_scale=512.)
| _base_ = ['./coco_data_pipeline.py']
model = dict(type='MaskRCNN', backbone=dict(type='efficientnet_b2b', out_indices=(2, 3, 4, 5), frozen_stages=-1, pretrained=True, activation_cfg=dict(type='torch_swish'), norm_cfg=dict(type='BN', requires_grad=True)), neck=dict(type='FPN', in_channels=[24, 48, 120, 352], out_channels=80, num_outs=5), rpn_head=dict(type='RPNHead', in_channels=80, feat_channels=80, anchor_generator=dict(type='AnchorGenerator', scales=[8], ratios=[0.5, 1.0, 2.0], strides=[4, 8, 16, 32, 64]), bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[1.0, 1.0, 1.0, 1.0]), loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1.0), loss_bbox=dict(type='L1Loss', loss_weight=1.0)), roi_head=dict(type='StandardRoIHead', bbox_roi_extractor=dict(type='SingleRoIExtractor', roi_layer=dict(type='RoIAlign', output_size=7, sampling_ratio=0), out_channels=80, featmap_strides=[4, 8, 16, 32]), bbox_head=dict(type='Shared2FCBBoxHead', in_channels=80, fc_out_channels=1024, roi_feat_size=7, num_classes=80, bbox_coder=dict(type='DeltaXYWHBBoxCoder', target_means=[0.0, 0.0, 0.0, 0.0], target_stds=[0.1, 0.1, 0.2, 0.2]), reg_class_agnostic=False, loss_cls=dict(type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), loss_bbox=dict(type='L1Loss', loss_weight=1.0)), mask_roi_extractor=dict(type='SingleRoIExtractor', roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0), out_channels=80, featmap_strides=[4, 8, 16, 32]), mask_head=dict(type='FCNMaskHead', num_convs=4, in_channels=80, conv_out_channels=80, num_classes=80, loss_mask=dict(type='CrossEntropyLoss', use_mask=True, loss_weight=1.0))), train_cfg=dict(rpn=dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.7, neg_iou_thr=0.3, min_pos_iou=0.3, match_low_quality=True, ignore_iof_thr=-1, gpu_assign_thr=300), sampler=dict(type='RandomSampler', num=256, pos_fraction=0.5, neg_pos_ub=-1, add_gt_as_proposals=False), allowed_border=-1, pos_weight=-1, debug=False), rpn_proposal=dict(nms_across_levels=False, nms_pre=2000, nms_post=1000, max_num=1000, nms_thr=0.8, min_bbox_size=0), rcnn=dict(assigner=dict(type='MaxIoUAssigner', pos_iou_thr=0.5, neg_iou_thr=0.5, min_pos_iou=0.5, match_low_quality=True, ignore_iof_thr=-1, gpu_assign_thr=300), sampler=dict(type='RandomSampler', num=256, pos_fraction=0.25, neg_pos_ub=-1, add_gt_as_proposals=True), mask_size=28, pos_weight=-1, debug=False)), test_cfg=dict(rpn=dict(nms_across_levels=False, nms_pre=800, nms_post=500, max_num=500, nms_thr=0.8, min_bbox_size=0), rcnn=dict(score_thr=0.05, nms=dict(type='nms', iou_threshold=0.7), max_per_img=500, mask_thr_binary=0.5)))
cudnn_benchmark = True
evaluation = dict(interval=1, metric='mAP', save_best='mAP', iou_thr=[0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95])
optimizer = dict(type='SGD', lr=0.015, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=None)
lr_config = dict(policy='ReduceLROnPlateau', metric='mAP', patience=5, iteration_patience=300, interval=1, min_lr=1e-06, warmup='linear', warmup_iters=200, warmup_ratio=0.3333333333333333)
runner = dict(type='EpochRunnerWithCancel', max_epochs=300)
checkpoint_config = dict(interval=5)
log_config = dict(interval=1, hooks=[dict(type='TextLoggerHook')])
dist_params = dict(backend='nccl')
log_level = 'INFO'
load_from = 'https://storage.openvinotoolkit.org/repositories/openvino_training_extensions/models/instance_segmentation/v2/efficientnet_b2b-mask_rcnn-576x576.pth'
resume_from = None
workflow = [('train', 1)]
work_dir = 'output'
custom_hooks = [dict(type='EarlyStoppingHook', patience=10, metric='mAP', interval=1, priority=75, iteration_patience=0)]
fp16 = dict(loss_scale=512.0) |
def main() -> None:
x0, y0 = map(int, input().split())
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
def calc(x0, y0, x1, y1, x2, y2):
if y2 == y0:
print(x2, y1)
else:
print(x2, y0)
if x0 == x1:
calc(x0, y0, x1, y1, x2, y2)
elif x1 == x2:
calc(x1, y1, x2, y2, x0, y0)
else:
calc(x2, y2, x0, y0, x1, y1)
# if y0 == y1:
if __name__ == "__main__":
main()
| def main() -> None:
(x0, y0) = map(int, input().split())
(x1, y1) = map(int, input().split())
(x2, y2) = map(int, input().split())
def calc(x0, y0, x1, y1, x2, y2):
if y2 == y0:
print(x2, y1)
else:
print(x2, y0)
if x0 == x1:
calc(x0, y0, x1, y1, x2, y2)
elif x1 == x2:
calc(x1, y1, x2, y2, x0, y0)
else:
calc(x2, y2, x0, y0, x1, y1)
if __name__ == '__main__':
main() |
class FreqStack:
def __init__(self):
self.fmap = Counter()
self.stack = [0]
def push(self, x: int) -> None:
self.fmap[x] += 1
freq = self.fmap[x]
if (freq == len(self.stack)): self.stack.append([x])
else: self.stack[freq].append(x)
def pop(self) -> int:
top = self.stack[-1]
x = top.pop()
if (not top): self.stack.pop()
self.fmap[x] -= 1
return x
| class Freqstack:
def __init__(self):
self.fmap = counter()
self.stack = [0]
def push(self, x: int) -> None:
self.fmap[x] += 1
freq = self.fmap[x]
if freq == len(self.stack):
self.stack.append([x])
else:
self.stack[freq].append(x)
def pop(self) -> int:
top = self.stack[-1]
x = top.pop()
if not top:
self.stack.pop()
self.fmap[x] -= 1
return x |
input_1 = int(input('Ingrese numero 1 = '))
input_2 = int(input('Ingrese numero 2 = '))
for x in range(input_1, input_2):
print(x)
| input_1 = int(input('Ingrese numero 1 = '))
input_2 = int(input('Ingrese numero 2 = '))
for x in range(input_1, input_2):
print(x) |
CERTIFICATE = {
"type": "service_account",
"project_id": "fir-orm-python",
"private_key_id": "47246fe582a99774f4daf19fad21b97a09df8c70",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDMp79d08KEZPrn\nN0xZGULfM/eZwAJ+MytsPQhs+LVSqtx1c/oGHpQC5GiW9xwgnMpEh7xfX5NNjp6x\n0BVP9e7jS1EGcjmZqauCzYzNhnG9fuUdVQv7WmskDuCcl6sVRLjhqbSxC+xTH4pP\n+PcC19NYxqcg3DVnEHG80lXTETZmgudfUPwS92UDZK7bn1mj/skSudg2mXeRDUek\nPUtQcKD92pr2Vd/5/cvUadBKx9/IOUb0UxKPynJFKttg2iWi2oZOSgorszm6j/ms\nt9jCe5tdyyXAFV5L6wPcJ9ZBLSi3VhIwVJbq1BKC/WvbfTiwDJ5+/NifcahfuhOB\nqgH+VyePAgMBAAECggEAUMUPoK83gNr9rw1DA5MVslOnL7X5BeeaBqDb124c2eB3\nG5/HGG0vCyksIhCquDBJH9zWOmnVD/Hurcyq7KDqRChwdPPVydCN0RTgsiiScTBI\nqlfrX6six9tbSFIPglhaAy3gE1PaVEAJbWCb1DJrxgi44x4lsWRrDxOQLboIV1Iz\nEEE/GDXq4u6EoMr0pfm9nduRj+JvOO6/1EYdTkPBzX2j/UgkrY4+tYNC0dBOwjvs\n+kyUAf/Sikmzs/3TnSoGG2savtCnT+ADNYrncUsXLtaMDMX3ejmirFJHYNH7kbGk\nZsA/21wUT94WFb62NIrLOBq1Y+gn+HBLg7Etke1jgQKBgQD74Jshv8Cw/2oHdwre\nO8YDdVq8feY1p2c4ygFuJATvubMyMpA1B97KxCOuFR5YmEI5aMCFaP184EJSNFLB\nVzgs3c4T7cRwWmP9AOZUJ7SKjSC4F6uCk2XjbviFqZ7vdBKo8nbTNbg+x0dQJowE\n3b3vQArNe6z3cE7p/iGCrUYpzwKBgQDQAUaUx8bmSWL37RdQNwRodogem2nWH/Jm\nb4Th3wBfaTxT8OndDNXZSakER1kOLLO1OijfS6QWFa0U1NJM4MERlC69V3v5TeNJ\n5/b15lwgva9WsUB5YwOWrsvO0H4Ywy1WsJUPnZe/YmlpocC8EZAFRr7Wr8D4jEg7\n8/t0aJVWQQKBgQDB0xWN4wFlMydklzbFzTmTb7tjUX7Vyvyjts9i8lTaJQzAlChk\npqnLXyQV0iqIAqLziqicAS8P6YMfvyPvpC6WWBk9PLrtuqE3EHouSF+mPvPutkhF\nMyg03DBiqySjH688U1kdLzmZFcDK7N7S39BJS/8EISf5QXN4nRcseCqGAQKBgQCP\nogHiJR3k0ZJEz3SE0Kj7lbYjJIBt+vuA3sssybfRKrMc58Ql/4IAHIxYxwfo8Ndb\ncoDcyLfTBD7Tnq5lpeHMSL4Jw0p5ed5Un5h6bwr5FOLqA1YZPFUzDRrxgilA4i4B\nqcgU02cBImzWI3saoyoHarXHO/AN8ZjDxZPC66ELwQKBgQDIk+ITDLDRm6lXGiP6\nUaLRs/esyG+iNLlkQBHZtqUV+RIsde0fhpSawCHbuv9rW6hDwhn4Ojc/ml2XB0Mx\nQxkhgLIyxzyFC4AzGYi2D4WWSBpeQZyNvyWBRcLVkI3d0jW7keUPOqBuSnT+qVUw\nxpAgGdUHYiug0D4BTt8SJlyLRA==\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-bcynb@fir-orm-python.iam.gserviceaccount.com",
"client_id": "103369610968201073713",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-bcynb%40fir-orm-python.iam.gserviceaccount.com"
}
BUCKET_NAME = 'fir-orm-python'
| certificate = {'type': 'service_account', 'project_id': 'fir-orm-python', 'private_key_id': '47246fe582a99774f4daf19fad21b97a09df8c70', 'private_key': '-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDMp79d08KEZPrn\nN0xZGULfM/eZwAJ+MytsPQhs+LVSqtx1c/oGHpQC5GiW9xwgnMpEh7xfX5NNjp6x\n0BVP9e7jS1EGcjmZqauCzYzNhnG9fuUdVQv7WmskDuCcl6sVRLjhqbSxC+xTH4pP\n+PcC19NYxqcg3DVnEHG80lXTETZmgudfUPwS92UDZK7bn1mj/skSudg2mXeRDUek\nPUtQcKD92pr2Vd/5/cvUadBKx9/IOUb0UxKPynJFKttg2iWi2oZOSgorszm6j/ms\nt9jCe5tdyyXAFV5L6wPcJ9ZBLSi3VhIwVJbq1BKC/WvbfTiwDJ5+/NifcahfuhOB\nqgH+VyePAgMBAAECggEAUMUPoK83gNr9rw1DA5MVslOnL7X5BeeaBqDb124c2eB3\nG5/HGG0vCyksIhCquDBJH9zWOmnVD/Hurcyq7KDqRChwdPPVydCN0RTgsiiScTBI\nqlfrX6six9tbSFIPglhaAy3gE1PaVEAJbWCb1DJrxgi44x4lsWRrDxOQLboIV1Iz\nEEE/GDXq4u6EoMr0pfm9nduRj+JvOO6/1EYdTkPBzX2j/UgkrY4+tYNC0dBOwjvs\n+kyUAf/Sikmzs/3TnSoGG2savtCnT+ADNYrncUsXLtaMDMX3ejmirFJHYNH7kbGk\nZsA/21wUT94WFb62NIrLOBq1Y+gn+HBLg7Etke1jgQKBgQD74Jshv8Cw/2oHdwre\nO8YDdVq8feY1p2c4ygFuJATvubMyMpA1B97KxCOuFR5YmEI5aMCFaP184EJSNFLB\nVzgs3c4T7cRwWmP9AOZUJ7SKjSC4F6uCk2XjbviFqZ7vdBKo8nbTNbg+x0dQJowE\n3b3vQArNe6z3cE7p/iGCrUYpzwKBgQDQAUaUx8bmSWL37RdQNwRodogem2nWH/Jm\nb4Th3wBfaTxT8OndDNXZSakER1kOLLO1OijfS6QWFa0U1NJM4MERlC69V3v5TeNJ\n5/b15lwgva9WsUB5YwOWrsvO0H4Ywy1WsJUPnZe/YmlpocC8EZAFRr7Wr8D4jEg7\n8/t0aJVWQQKBgQDB0xWN4wFlMydklzbFzTmTb7tjUX7Vyvyjts9i8lTaJQzAlChk\npqnLXyQV0iqIAqLziqicAS8P6YMfvyPvpC6WWBk9PLrtuqE3EHouSF+mPvPutkhF\nMyg03DBiqySjH688U1kdLzmZFcDK7N7S39BJS/8EISf5QXN4nRcseCqGAQKBgQCP\nogHiJR3k0ZJEz3SE0Kj7lbYjJIBt+vuA3sssybfRKrMc58Ql/4IAHIxYxwfo8Ndb\ncoDcyLfTBD7Tnq5lpeHMSL4Jw0p5ed5Un5h6bwr5FOLqA1YZPFUzDRrxgilA4i4B\nqcgU02cBImzWI3saoyoHarXHO/AN8ZjDxZPC66ELwQKBgQDIk+ITDLDRm6lXGiP6\nUaLRs/esyG+iNLlkQBHZtqUV+RIsde0fhpSawCHbuv9rW6hDwhn4Ojc/ml2XB0Mx\nQxkhgLIyxzyFC4AzGYi2D4WWSBpeQZyNvyWBRcLVkI3d0jW7keUPOqBuSnT+qVUw\nxpAgGdUHYiug0D4BTt8SJlyLRA==\n-----END PRIVATE KEY-----\n', 'client_email': 'firebase-adminsdk-bcynb@fir-orm-python.iam.gserviceaccount.com', 'client_id': '103369610968201073713', 'auth_uri': 'https://accounts.google.com/o/oauth2/auth', 'token_uri': 'https://accounts.google.com/o/oauth2/token', 'auth_provider_x509_cert_url': 'https://www.googleapis.com/oauth2/v1/certs', 'client_x509_cert_url': 'https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-bcynb%40fir-orm-python.iam.gserviceaccount.com'}
bucket_name = 'fir-orm-python' |
MODEL_PATH = {
"glove": "phrase-emb-storage/saved_models/glove/",
"bert": "bert-base-uncased",
"spanbert": "phrase-emb-storage/saved_models/span-bert-model/",
"sentbert": "bert-base-nli-stsb-mean-tokens",
"phrase-bert": "phrase-emb-storage/saved_models/phrase-bert-model/"
}
GLOVE_FILE_PATH = 'phrase-emb-storage/cc_glove/glove.840B.300d.txt' | model_path = {'glove': 'phrase-emb-storage/saved_models/glove/', 'bert': 'bert-base-uncased', 'spanbert': 'phrase-emb-storage/saved_models/span-bert-model/', 'sentbert': 'bert-base-nli-stsb-mean-tokens', 'phrase-bert': 'phrase-emb-storage/saved_models/phrase-bert-model/'}
glove_file_path = 'phrase-emb-storage/cc_glove/glove.840B.300d.txt' |
if __name__ == '__main__':
mark = []
for _ in range(int(input())):
name = input()
score = float(input())
mark.append([name, score])
second_highest = sorted(set([score for name, score in mark]))[1]
print('\n'.join(sorted([name for name, score in mark if score == second_highest])))
| if __name__ == '__main__':
mark = []
for _ in range(int(input())):
name = input()
score = float(input())
mark.append([name, score])
second_highest = sorted(set([score for (name, score) in mark]))[1]
print('\n'.join(sorted([name for (name, score) in mark if score == second_highest]))) |
# optimizer
optimizer = dict(type='Lamb', lr=0.005, weight_decay=0.02)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='CosineAnnealing',
min_lr=1.0e-6,
warmup='linear',
# For ImageNet-1k, 626 iters per epoch, warmup 5 epochs.
warmup_iters=5 * 626,
warmup_ratio=0.0001)
runner = dict(type='EpochBasedRunner', max_epochs=100)
| optimizer = dict(type='Lamb', lr=0.005, weight_decay=0.02)
optimizer_config = dict(grad_clip=None)
lr_config = dict(policy='CosineAnnealing', min_lr=1e-06, warmup='linear', warmup_iters=5 * 626, warmup_ratio=0.0001)
runner = dict(type='EpochBasedRunner', max_epochs=100) |
{
"targets": [
{
"target_name": "ultradb",
"sources": [ "src/ultradb.cc" ],
"conditions": [
["OS==\"linux\"", {
"cflags_cc": [ "-fpermissive", "-Os" ]
}]
]
}
]
}
| {'targets': [{'target_name': 'ultradb', 'sources': ['src/ultradb.cc'], 'conditions': [['OS=="linux"', {'cflags_cc': ['-fpermissive', '-Os']}]]}]} |
DEBUG = False
SQLALCHEMY_DATABASE_URI = 'postgresql:///logging'
PORT = 5555
SERVER = 'production'
#SSL_KEY = "/path/to/keyfile.key"
#SSL_CRT = "/path/to/certfile.crt"
| debug = False
sqlalchemy_database_uri = 'postgresql:///logging'
port = 5555
server = 'production' |
# Event: LCCS Python Fundamental Skills Workshop
# Date: Dec 2018
# Author: Joe English, PDST
# eMail: computerscience@pdst.ie
# Breakout 6.4 Check digits
# Solution to Exercise 1 - extract the ith digit from n
# A function to extract digit i from number n
def extractDigit(i, n):
i = len(n) - i
if i < 0:
return -1
n = int(n)
return (n//pow(10, i))%10
x = input("Enter a number: ")
pos = int(input("Enter position of digit to extract: "))
print(extractDigit(pos, x))
# The code snippets below will serve to provide a useful background
'''
n = int(input("Enter a 2 digit number: "))
d2 = n%10 # %10 extracts the final digit
d1 = n//10 # //10 to remove the final digit
print(d1, d2)
'''
'''
n = int(input("Enter a 3 digit number: "))
d1 = n%10 # %10 to extract the final digit
d2 = (n//10)%10 # //10 to remove the final digit
d3 = (n//100) # //100 to remove the final two digits
print(d1, d2, d3)
'''
'''
n = int(input("Enter a 4 digit number: "))
d1 = n%10 # %10 extracts the final digit
d2 = (n//10)%10 # //10 chops off the last digit
d3 = (n//100)%10 # //100 chops off the last two digits
d4 = (n//1000)%10 # //1000 chops off the last three digits
print(d1, d2, d3, d4)
'''
'''
n = input("Enter a number: ")
numDigits = len(n)
n = int(n)
d = n%10 # %10 to extract the final digit
print(d, end=' ')
for count in range(1, numDigits):
d = (n//pow(10, count))%10
print(d, end=' ')
print("")
'''
'''
def extractDigit2(i, n):
if i <= 0 or i>= len(n):
return -1
return (n[i-1])
n = input("Enter a number: ")
print(extractDigit2(0, n))
'''
| def extract_digit(i, n):
i = len(n) - i
if i < 0:
return -1
n = int(n)
return n // pow(10, i) % 10
x = input('Enter a number: ')
pos = int(input('Enter position of digit to extract: '))
print(extract_digit(pos, x))
'\nn = int(input("Enter a 2 digit number: "))\nd2 = n%10 # %10 extracts the final digit\nd1 = n//10 # //10 to remove the final digit\nprint(d1, d2)\n'
'\nn = int(input("Enter a 3 digit number: "))\nd1 = n%10 # %10 to extract the final digit\nd2 = (n//10)%10 # //10 to remove the final digit\nd3 = (n//100) # //100 to remove the final two digits\nprint(d1, d2, d3)\n'
'\nn = int(input("Enter a 4 digit number: "))\nd1 = n%10 # %10 extracts the final digit\nd2 = (n//10)%10 # //10 chops off the last digit\nd3 = (n//100)%10 # //100 chops off the last two digits\nd4 = (n//1000)%10 # //1000 chops off the last three digits\nprint(d1, d2, d3, d4)\n'
'\nn = input("Enter a number: ")\nnumDigits = len(n)\nn = int(n)\n\nd = n%10 # %10 to extract the final digit\nprint(d, end=\' \')\nfor count in range(1, numDigits):\n d = (n//pow(10, count))%10\n print(d, end=\' \') \nprint("")\n'
'\ndef extractDigit2(i, n):\n\n if i <= 0 or i>= len(n):\n return -1\n \n return (n[i-1])\n\n\nn = input("Enter a number: ")\nprint(extractDigit2(0, n))\n' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.